mirror of
https://github.com/fabiangreffrath/woof.git
synced 2025-09-22 11:22:18 -04:00
Merge pull request #1306 from fabiangreffrath/maxhealthbonus
fix Max Health setting in Dehacked using complevel 2
This commit is contained in:
commit
fd645bea1c
@ -129,6 +129,9 @@ boolean deh_pars = false; // in wi_stuff to allow pars in modified games
|
|||||||
|
|
||||||
boolean deh_set_blood_color = false;
|
boolean deh_set_blood_color = false;
|
||||||
|
|
||||||
|
int deh_maxhealth;
|
||||||
|
boolean deh_set_maxhealth = false;
|
||||||
|
|
||||||
char **dehfiles = NULL; // filenames of .deh files for demo footer
|
char **dehfiles = NULL; // filenames of .deh files for demo footer
|
||||||
|
|
||||||
// #include "d_deh.h" -- we don't do that here but we declare the
|
// #include "d_deh.h" -- we don't do that here but we declare the
|
||||||
@ -2777,7 +2780,10 @@ void deh_procMisc(DEHFILE *fpin, FILE* fpout, char *line) // done
|
|||||||
initial_bullets = value;
|
initial_bullets = value;
|
||||||
else
|
else
|
||||||
if (!strcasecmp(key,deh_misc[2])) // Max Health
|
if (!strcasecmp(key,deh_misc[2])) // Max Health
|
||||||
maxhealth = value;
|
{
|
||||||
|
deh_maxhealth = value;
|
||||||
|
deh_set_maxhealth = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
if (!strcasecmp(key,deh_misc[3])) // Max Armor
|
if (!strcasecmp(key,deh_misc[3])) // Max Armor
|
||||||
max_armor = value;
|
max_armor = value;
|
||||||
|
18
src/d_main.c
18
src/d_main.c
@ -68,6 +68,7 @@
|
|||||||
#include "i_endoom.h"
|
#include "i_endoom.h"
|
||||||
#include "d_quit.h"
|
#include "d_quit.h"
|
||||||
#include "r_bmaps.h"
|
#include "r_bmaps.h"
|
||||||
|
#include "p_inter.h" // maxhealthbonus
|
||||||
|
|
||||||
#include "dsdhacked.h"
|
#include "dsdhacked.h"
|
||||||
|
|
||||||
@ -1838,6 +1839,23 @@ static void D_InitTables(void)
|
|||||||
states[i].flags |= STATEF_SKILL5FAST;
|
states[i].flags |= STATEF_SKILL5FAST;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void D_SetMaxHealth(void)
|
||||||
|
{
|
||||||
|
extern boolean deh_set_maxhealth;
|
||||||
|
extern int deh_maxhealth;
|
||||||
|
|
||||||
|
if (demo_compatibility)
|
||||||
|
{
|
||||||
|
maxhealth = 100;
|
||||||
|
maxhealthbonus = deh_set_maxhealth ? deh_maxhealth : 200;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
maxhealth = deh_set_maxhealth ? deh_maxhealth : 100;
|
||||||
|
maxhealthbonus = maxhealth * 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void D_SetBloodColor(void)
|
void D_SetBloodColor(void)
|
||||||
{
|
{
|
||||||
extern boolean deh_set_blood_color;
|
extern boolean deh_set_blood_color;
|
||||||
|
@ -39,6 +39,7 @@ extern boolean clrespawnparm; // checkparm of -respawn
|
|||||||
extern boolean clfastparm; // checkparm of -fast
|
extern boolean clfastparm; // checkparm of -fast
|
||||||
//jff end of external declaration of command line playmode
|
//jff end of external declaration of command line playmode
|
||||||
|
|
||||||
|
void D_SetMaxHealth(void);
|
||||||
void D_SetBloodColor(void);
|
void D_SetBloodColor(void);
|
||||||
void D_SetPredefinedTranslucency(void);
|
void D_SetPredefinedTranslucency(void);
|
||||||
void D_DehChangePredefinedTranslucency(int index);
|
void D_DehChangePredefinedTranslucency(int index);
|
||||||
|
@ -3113,6 +3113,8 @@ void G_ReloadDefaults(boolean keep_demover)
|
|||||||
G_MBF21Defaults();
|
G_MBF21Defaults();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
D_SetMaxHealth();
|
||||||
|
|
||||||
D_SetBloodColor();
|
D_SetBloodColor();
|
||||||
|
|
||||||
D_SetPredefinedTranslucency();
|
D_SetPredefinedTranslucency();
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
int initial_health = 100;
|
int initial_health = 100;
|
||||||
int initial_bullets = 50;
|
int initial_bullets = 50;
|
||||||
int maxhealth = 100; // was MAXHEALTH as a #define, used only in this module
|
int maxhealth = 100; // was MAXHEALTH as a #define, used only in this module
|
||||||
|
int maxhealthbonus = 200;
|
||||||
int max_armor = 200;
|
int max_armor = 200;
|
||||||
int green_armor_class = 1; // these are involved with armortype below
|
int green_armor_class = 1; // these are involved with armortype below
|
||||||
int blue_armor_class = 2;
|
int blue_armor_class = 2;
|
||||||
@ -334,8 +335,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher)
|
|||||||
}
|
}
|
||||||
|
|
||||||
player->health++; // can go over 100%
|
player->health++; // can go over 100%
|
||||||
if (player->health > (maxhealth * 2))
|
if (player->health > maxhealthbonus)
|
||||||
player->health = (maxhealth * 2);
|
player->health = maxhealthbonus;
|
||||||
player->mo->health = player->health;
|
player->mo->health = player->health;
|
||||||
pickupmsg(player, "%s", s_GOTHTHBONUS); // Ty 03/22/98 - externalized
|
pickupmsg(player, "%s", s_GOTHTHBONUS); // Ty 03/22/98 - externalized
|
||||||
break;
|
break;
|
||||||
|
@ -46,6 +46,7 @@ extern int idkfa_armor_class; // Ty - end
|
|||||||
extern int initial_health;
|
extern int initial_health;
|
||||||
extern int initial_bullets;
|
extern int initial_bullets;
|
||||||
extern int maxhealth;
|
extern int maxhealth;
|
||||||
|
extern int maxhealthbonus;
|
||||||
extern int max_armor;
|
extern int max_armor;
|
||||||
extern int green_armor_class;
|
extern int green_armor_class;
|
||||||
extern int blue_armor_class;
|
extern int blue_armor_class;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user