summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJames Haley2010-08-31 01:55:51 +0000
committerJames Haley2010-08-31 01:55:51 +0000
commit5871acd3de5a88ea06d18f80a8f1dddc552e993e (patch)
tree4329d82fc2c25de889917050014f1b6d4968279d /src
parentb6ea4375e0b5db116a1cdf27e30273d4a92b7a53 (diff)
downloadchocolate-doom-5871acd3de5a88ea06d18f80a8f1dddc552e993e.tar.gz
chocolate-doom-5871acd3de5a88ea06d18f80a8f1dddc552e993e.tar.bz2
chocolate-doom-5871acd3de5a88ea06d18f80a8f1dddc552e993e.zip
Revamped player_t to match binary layout of structure, aside from
enum-determined arrays which will be tackled individually. Removed player itemcount, secretcount, and didsecret fields. Changed armorpoints, armortype, and killcount to shorts. Added all runtime Strife sector types and changed handling of DOOM types where appropriate. Added nukagecount handling in P_PlayerThink. Subversion-branch: /branches/strife-branch Subversion-revision: 1981
Diffstat (limited to 'src')
-rw-r--r--src/strife/d_player.h56
-rw-r--r--src/strife/doomdef.h1
-rw-r--r--src/strife/g_game.c6
-rw-r--r--src/strife/p_inter.c7
-rw-r--r--src/strife/p_local.h4
-rw-r--r--src/strife/p_saveg.c18
-rw-r--r--src/strife/p_setup.c4
-rw-r--r--src/strife/p_spec.c118
-rw-r--r--src/strife/p_user.c12
9 files changed, 148 insertions, 78 deletions
diff --git a/src/strife/d_player.h b/src/strife/d_player.h
index 8bdccf46..c4b9d7e1 100644
--- a/src/strife/d_player.h
+++ b/src/strife/d_player.h
@@ -79,10 +79,21 @@ typedef enum
} cheat_t;
+// haleyjd 08/30/10: [STRIFE]
+// Player Inventory Item Structure
+typedef struct inventory_s
+{
+ int sprite; // a sprite number
+ int type; // a thing type
+ int amount; // amount being carried
+} inventory_t;
//
// Extended player object info: player_t
//
+// haleyjd 08/30/10: [STRIFE]
+// * Transformed to match binary structure layout.
+//
typedef struct player_s
{
mobj_t* mo;
@@ -103,14 +114,33 @@ typedef struct player_s
// This is only used between levels,
// mo->health is used during levels.
int health;
- int armorpoints;
+ short armorpoints; // [STRIFE] Changed to short
// Armor type is 0-2.
- int armortype;
+ short armortype; // [STRIFE] Changed to short
// Power ups. invinc and invis are tic counters.
int powers[NUMPOWERS];
+
+ // [STRIFE] Additions:
+ int sigiltype; // Type of Sigil carried
+ int nukagecount; // Nukage exposure counter
+ int questflags; // Quest bit flags
+ int pitch; // Up/down look angle
+ boolean centerview; // True if view should be centered
+ inventory_t inventory[32]; // Player inventory items
+ boolean st_update; // If true, update status bar
+ short numinventory; // Num. active inventory items
+ short inventorycursor; // Selected inventory item
+ short accuracy; // Accuracy stat
+ short stamina; // Stamina stat
+
boolean cards[NUMCARDS];
boolean backpack;
+
+ // True if button down last tic.
+ int attackdown;
+ int usedown;
+ int inventorydown; // [STRIFE] Use inventory item
// Frags, kills of other players.
int frags[MAXPLAYERS];
@@ -123,21 +153,17 @@ typedef struct player_s
int ammo[NUMAMMO];
int maxammo[NUMAMMO];
- // True if button down last tic.
- int attackdown;
- int usedown;
-
// Bit flags, for cheats and debug.
// See cheat_t, above.
- int cheats;
+ int cheats;
// Refired shots are less accurate.
- int refire;
+ int refire;
// For intermission stats.
- int killcount;
- int itemcount;
- int secretcount;
+ short killcount; // [STRIFE] Changed to short
+ //int itemcount; // [STRIFE] Eliminated these.
+ //int secretcount;
// Hint messages.
char* message;
@@ -160,11 +186,17 @@ typedef struct player_s
// 0-3 for which color to draw player.
int colormap;
+ // [STRIFE] For use of teleport beacons
+ short allegiance;
+
// Overlay view sprites (gun, etc).
pspdef_t psprites[NUMPSPRITES];
+ // [STRIFE] Inefficient means of tracking automap state on all maps
+ boolean mapstate[40];
+
// True if secret level has been done.
- boolean didsecret;
+ //boolean didsecret; [STRIFE] Removed this.
} player_t;
diff --git a/src/strife/doomdef.h b/src/strife/doomdef.h
index e911f886..0d9daa6d 100644
--- a/src/strife/doomdef.h
+++ b/src/strife/doomdef.h
@@ -90,6 +90,7 @@ typedef enum
//
// Key cards.
//
+// STRIFE-TODO: A hell of a bunch of keys.
typedef enum
{
it_bluecard,
diff --git a/src/strife/g_game.c b/src/strife/g_game.c
index fb9c00f6..5c080d6f 100644
--- a/src/strife/g_game.c
+++ b/src/strife/g_game.c
@@ -1018,21 +1018,15 @@ void G_PlayerReborn (int player)
int i;
int frags[MAXPLAYERS];
int killcount;
- int itemcount;
- int secretcount;
memcpy (frags,players[player].frags,sizeof(frags));
killcount = players[player].killcount;
- itemcount = players[player].itemcount;
- secretcount = players[player].secretcount;
p = &players[player];
memset (p, 0, sizeof(*p));
memcpy (players[player].frags, frags, sizeof(players[player].frags));
players[player].killcount = killcount;
- players[player].itemcount = itemcount;
- players[player].secretcount = secretcount;
p->usedown = p->attackdown = true; // don't do anything immediately
p->playerstate = PST_LIVE;
diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c
index ebda8925..f549c348 100644
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -655,9 +655,10 @@ P_TouchSpecialThing
default:
I_Error ("P_SpecialThing: Unknown gettable thing");
}
-
- if (special->flags & MF_COUNTITEM)
- player->itemcount++;
+
+ // haleyjd 08/30/10: [STRIFE] No itemcount
+ //if (special->flags & MF_COUNTITEM)
+ // player->itemcount++;
P_RemoveMobj (special);
player->bonuscount += BONUSADD;
if (player == &players[consoleplayer])
diff --git a/src/strife/p_local.h b/src/strife/p_local.h
index 652ff8e1..9d4fa48f 100644
--- a/src/strife/p_local.h
+++ b/src/strife/p_local.h
@@ -91,7 +91,9 @@ void P_DropWeapon (player_t* player);
//
// P_USER
//
-void P_PlayerThink (player_t* player);
+void P_PlayerThink (player_t* player);
+// haleyjd 08/30/10: [STRIFE] Needed externally
+void P_Thrust (player_t* player, angle_t angle, fixed_t move);
//
diff --git a/src/strife/p_saveg.c b/src/strife/p_saveg.c
index e557e494..6da095e5 100644
--- a/src/strife/p_saveg.c
+++ b/src/strife/p_saveg.c
@@ -721,11 +721,13 @@ static void saveg_read_player_t(player_t *str)
// int killcount;
str->killcount = saveg_read32();
+ // haleyjd 08/30/10 [STRIFE] No itemcount.
// int itemcount;
- str->itemcount = saveg_read32();
+ //str->itemcount = saveg_read32();
+ // haleyjd 08/30/10 [STRIFE] No secretcount.
// int secretcount;
- str->secretcount = saveg_read32();
+ //str->secretcount = saveg_read32();
// char* message;
str->message = saveg_readp();
@@ -754,8 +756,9 @@ static void saveg_read_player_t(player_t *str)
saveg_read_pspdef_t(&str->psprites[i]);
}
+ // haleyjd 08/30/10: [STRIFE] No intermission, no didsecret.
// boolean didsecret;
- str->didsecret = saveg_read32();
+ //str->didsecret = saveg_read32();
}
static void saveg_write_player_t(player_t *str)
@@ -852,11 +855,13 @@ static void saveg_write_player_t(player_t *str)
// int killcount;
saveg_write32(str->killcount);
+ // haleyjd 08/30/10 [STRIFE] No itemcount
// int itemcount;
- saveg_write32(str->itemcount);
+ //saveg_write32(str->itemcount);
+ // haleyjd 08/30/10 [STRIFE] No secretcount
// int secretcount;
- saveg_write32(str->secretcount);
+ //saveg_write32(str->secretcount);
// char* message;
saveg_writep(str->message);
@@ -885,8 +890,9 @@ static void saveg_write_player_t(player_t *str)
saveg_write_pspdef_t(&str->psprites[i]);
}
+ // haleyjd 08/30/10: [STRIFE] No intermission, no secret.
// boolean didsecret;
- saveg_write32(str->didsecret);
+ //saveg_write32(str->didsecret);
}
diff --git a/src/strife/p_setup.c b/src/strife/p_setup.c
index 8a8bfd9c..50205d4f 100644
--- a/src/strife/p_setup.c
+++ b/src/strife/p_setup.c
@@ -680,8 +680,8 @@ P_SetupLevel
wminfo.partime = 180;
for (i=0 ; i<MAXPLAYERS ; i++)
{
- players[i].killcount = players[i].secretcount
- = players[i].itemcount = 0;
+ // haleyjd 08/30/10: [STRIFE] Removed secretcount, itemcount
+ players[i].killcount = 0;
}
// Initial height of PointOfView
diff --git a/src/strife/p_spec.c b/src/strife/p_spec.c
index 3b4993ac..c01534a5 100644
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -1035,64 +1035,86 @@ P_ShootSpecialLine
void P_PlayerInSpecialSector (player_t* player)
{
sector_t* sector;
-
+
sector = player->mo->subsector->sector;
// Falling, not all the way down yet?
if (player->mo->z != sector->floorheight)
- return;
+ return;
// Has hitten ground.
switch (sector->special)
{
- case 5:
- // HELLSLIME DAMAGE
- if (!player->powers[pw_ironfeet])
- if (!(leveltime&0x1f))
- P_DamageMobj (player->mo, NULL, NULL, 10);
- break;
-
- case 7:
- // NUKAGE DAMAGE
- if (!player->powers[pw_ironfeet])
- if (!(leveltime&0x1f))
- P_DamageMobj (player->mo, NULL, NULL, 5);
- break;
-
- case 16:
- // SUPER HELLSLIME DAMAGE
- case 4:
- // STROBE HURT
- if (!player->powers[pw_ironfeet]
- || (P_Random()<5) )
- {
- if (!(leveltime&0x1f))
- P_DamageMobj (player->mo, NULL, NULL, 20);
- }
- break;
-
- case 9:
- // SECRET SECTOR
- player->secretcount++;
- sector->special = 0;
- break;
-
- case 11:
- // EXIT SUPER DAMAGE! (for E1M8 finale)
- player->cheats &= ~CF_GODMODE;
+ case 5:
+ // HELLSLIME DAMAGE
+ // [STRIFE] +2 to nukagecount
+ if(!player->powers[pw_ironfeet])
+ player->nukagecount += 2;
+ break;
+
+ case 16:
+ // [STRIFE] +4 to nukagecount
+ if(!player->powers[pw_ironfeet])
+ player->nukagecount += 4;
+ break;
+
+ case 4:
+ case 7:
+ // [STRIFE] Immediate 5 damage every 31 tics
+ if(!player->powers[pw_ironfeet])
+ if(!(leveltime & 0x1f))
+ P_DamageMobj(player->mo, NULL, NULL, 5);
+ break;
+
+ case 9:
+ // SECRET SECTOR
+ //player->secretcount++; [STRIFE] Don't have a secret count.
+ sector->special = 0;
+ // STRIFE-TODO: sfx_yeah when secret is found
+ //if(player - players == consoleplayer)
+ // S_StartSound(NULL, sfx_yeah);
+ break;
+
+ case 11:
+ // EXIT SUPER DAMAGE! (for E1M8 finale)
+ player->cheats &= ~CF_GODMODE;
+
+ if (!(leveltime&0x1f))
+ P_DamageMobj (player->mo, NULL, NULL, 20);
+
+ if (player->health <= 10)
+ G_ExitLevel(0);
+ break;
+
+ case 15:
+ // haleyjd 08/30/10: [STRIFE] "Instant" Death sector
+ P_DamageMobj(player->mo, NULL, NULL, 999);
+ break;
+
+
+ case 18:
+ // haleyjd 08/30/10: [STRIFE] Water current
+ // STRIFE-TODO: Verify this works as the ASM is shifty
+ {
+ int tagval = sector->tag - 100;
+ fixed_t force;
+ angle_t angle;
- if (!(leveltime&0x1f))
- P_DamageMobj (player->mo, NULL, NULL, 20);
+ if(player->cheats & CF_NOCLIP)
+ return;
- if (player->health <= 10)
- G_ExitLevel(0);
- break;
-
- default:
- I_Error ("P_PlayerInSpecialSector: "
- "unknown special %i",
- sector->special);
- break;
+ force = (tagval % 10) << 12;
+ angle = (tagval / 10) << 29;
+
+ P_Thrust(player, angle, force);
+ }
+ break;
+
+ default:
+ I_Error ("P_PlayerInSpecialSector: "
+ "unknown special %i",
+ sector->special);
+ break;
};
}
diff --git a/src/strife/p_user.c b/src/strife/p_user.c
index 2ff7f818..609704a0 100644
--- a/src/strife/p_user.c
+++ b/src/strife/p_user.c
@@ -336,6 +336,18 @@ void P_PlayerThink (player_t* player)
// Counters, time dependend power ups.
+ // haleyjd 08/30/10: [STRIFE]
+ // Nukage count keeps track of exposure to hazardous conditions over time.
+ // After accumulating 16 total seconds or more of exposure, you will take
+ // 5 damage roughly once per second until the count drops back under 560
+ // tics.
+ if (player->nukagecount)
+ {
+ player->nukagecount--;
+ if (!(leveltime & 0x1f) && player->nukagecount > 16*TICRATE)
+ P_DamageMobj(player->mo, NULL, NULL, 5);
+ }
+
// Strength counts up to diminish fade.
if (player->powers[pw_strength])
player->powers[pw_strength]++;