ref: ae8ca20a1d02dade7bc0d8feb09225d91e53f3be
parent: 4dc1ca199d444314dfeada9bf159a538edc50414
author: Simon Howard <[email protected]>
date: Mon Oct 17 16:49:42 EDT 2005
Add dehacked "Misc" implementations for max armor+health, blue+green armor classes Subversion-branch: /trunk/chocolate-doom Subversion-revision: 207
--- a/src/deh_misc.c
+++ b/src/deh_misc.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: deh_misc.c 206 2005-10-17 20:27:05Z fraggle $
+// $Id: deh_misc.c 207 2005-10-17 20:49:42Z fraggle $
//
// Copyright(C) 2005 Simon Howard
//
@@ -21,6 +21,10 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.4 2005/10/17 20:49:42 fraggle
+// Add dehacked "Misc" implementations for max armor+health, blue+green
+// armor classes
+//
// Revision 1.3 2005/10/17 20:27:05 fraggle
// Start of Dehacked 'Misc' section support. Initial Health+Bullets,
// and bfg cells/shot are supported.
@@ -47,12 +51,50 @@
#include "deh_io.h"
#include "deh_main.h"
+// Dehacked: "Initial Health"
+// This is the initial health a player has when starting anew.
+// See G_PlayerReborn in g_game.c
+
int deh_initial_health = 100;
+
+// Dehacked: "Initial bullets"
+// This is the number of bullets the player has when starting anew.
+// See G_PlayerReborn in g_game.c
+
int deh_initial_bullets = 50;
-int deh_max_health; // TODO
-int deh_max_armor; // TODO
-int deh_green_armor_class; // TODO
-int deh_blue_armor_class; // TODO
+
+// Dehacked: "Max Health"
+// This is the maximum health that can be reached using medikits
+// alone. See P_GiveBody in p_inter.c
+
+int deh_max_health = 100;
+
+// Dehacked: "Max Armor"
+// This is the maximum armor which can be reached by picking up
+// armor helmets. See P_TouchSpecialThing in p_inter.c
+
+int deh_max_armor = 200;
+
+// Dehacked: "Green Armor Class"
+// This is the armor class that is given when picking up the green
+// armor or an armor helmet. See P_TouchSpecialThing in p_inter.c
+//
+// Question: Does DOS dehacked modify the armor helmet behavior
+// as well as the green armor behavior? I am currently following
+// the Boom behavior, which is "yes".
+
+int deh_green_armor_class = 1;
+
+// Dehacked: "Blue Armor Class"
+// This is the armor class that is given when picking up the blue
+// armor or a megasphere. See P_TouchSpecialThing in p_inter.c
+//
+// Question: Does DOS dehacked modify the megasphere behavior
+// as well as the blue armor behavior? I am currently following
+// the Boom behavior, which is "yes".
+
+int deh_blue_armor_class = 2;
+
int deh_max_soulsphere; // TODO
int deh_soulsphere_health; // TODO
int deh_megasphere_health; // TODO
@@ -61,7 +103,13 @@
int deh_idfa_armor_class; // TODO
int deh_idkfa_armor; // TODO
int deh_idkfa_armor_class; // TODO
+
+// Dehacked: "BFG Cells/Shot"
+// This is the number of CELLs firing the BFG uses up.
+// See P_CheckAmmo and A_FireBFG in p_pspr.c
+
int deh_bfg_cells_per_shot = 40;
+
int deh_monsters_infight; // TODO
static struct
@@ -72,10 +120,10 @@
} misc_settings[] = {
{"Initial Health", &deh_initial_health, true},
{"Initial Bullets", &deh_initial_bullets, true},
- {"Max Health", &deh_max_health},
- {"Max Armor", &deh_max_armor},
- {"Green Armor Class", &deh_green_armor_class},
- {"Blue Armor Class", &deh_blue_armor_class},
+ {"Max Health", &deh_max_health, true},
+ {"Max Armor", &deh_max_armor, true},
+ {"Green Armor Class", &deh_green_armor_class, true},
+ {"Blue Armor Class", &deh_blue_armor_class, true},
{"Max Soulsphere", &deh_max_soulsphere},
{"Soulsphere Health", &deh_soulsphere_health},
{"Megasphere Health", &deh_megasphere_health},
--- a/src/p_inter.c
+++ b/src/p_inter.c
@@ -1,7 +1,7 @@
// Emacs style mode select -*- C++ -*-
//-----------------------------------------------------------------------------
//
-// $Id: p_inter.c 160 2005-10-03 21:39:39Z fraggle $
+// $Id: p_inter.c 207 2005-10-17 20:49:42Z fraggle $
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005 Simon Howard
@@ -22,6 +22,10 @@
// 02111-1307, USA.
//
// $Log$
+// Revision 1.5 2005/10/17 20:49:42 fraggle
+// Add dehacked "Misc" implementations for max armor+health, blue+green
+// armor classes
+//
// Revision 1.4 2005/10/03 21:39:39 fraggle
// Dehacked text substitutions
//
@@ -42,7 +46,7 @@
static const char
-rcsid[] = "$Id: p_inter.c 160 2005-10-03 21:39:39Z fraggle $";
+rcsid[] = "$Id: p_inter.c 207 2005-10-17 20:49:42Z fraggle $";
// Data.
@@ -51,6 +55,7 @@
#include "sounds.h"
#include "deh_main.h"
+#include "deh_misc.h"
#include "doomstat.h"
#include "m_random.h"
@@ -247,12 +252,12 @@
( player_t* player,
int num )
{
- if (player->health >= MAXHEALTH)
+ if (player->health >= deh_max_health)
return false;
player->health += num;
- if (player->health > MAXHEALTH)
- player->health = MAXHEALTH;
+ if (player->health > deh_max_health)
+ player->health = deh_max_health;
player->mo->health = player->health;
return true;
@@ -385,13 +390,13 @@
{
// armor
case SPR_ARM1:
- if (!P_GiveArmor (player, 1))
+ if (!P_GiveArmor (player, deh_green_armor_class))
return;
player->message = DEH_String(GOTARMOR);
break;
case SPR_ARM2:
- if (!P_GiveArmor (player, 2))
+ if (!P_GiveArmor (player, deh_blue_armor_class))
return;
player->message = DEH_String(GOTMEGA);
break;
@@ -407,10 +412,10 @@
case SPR_BON2:
player->armorpoints++; // can go over 100%
- if (player->armorpoints > 200)
- player->armorpoints = 200;
+ if (player->armorpoints > deh_max_armor)
+ player->armorpoints = deh_max_armor;
if (!player->armortype)
- player->armortype = 1;
+ player->armortype = deh_green_armor_class;
player->message = DEH_String(GOTARMBONUS);
break;
@@ -428,7 +433,7 @@
return;
player->health = 200;
player->mo->health = player->health;
- P_GiveArmor (player,2);
+ P_GiveArmor (player, deh_blue_armor_class);
player->message = DEH_String(GOTMSPHERE);
sound = sfx_getpow;
break;