summaryrefslogtreecommitdiff
path: root/src/strife
diff options
context:
space:
mode:
authorJames Haley2010-09-26 06:26:50 +0000
committerJames Haley2010-09-26 06:26:50 +0000
commit2f326ebddc4f4de18909b557fa69fe74ac849e82 (patch)
treeda193613e54c47df599208e2c59ba45cf48f1c64 /src/strife
parente9e7b85ab932b70caea5c1f7a40561f36c953d32 (diff)
downloadchocolate-doom-2f326ebddc4f4de18909b557fa69fe74ac849e82.tar.gz
chocolate-doom-2f326ebddc4f4de18909b557fa69fe74ac849e82.tar.bz2
chocolate-doom-2f326ebddc4f4de18909b557fa69fe74ac849e82.zip
Identified quest #7 (killed Blue Acolytes), fixed a bug in P_SpawnMobj
(Strife doesn't withhold mobj->reactioncount in skill 5), added static line specials 142, 143, and 149 for vertical texture scrolling, and made note of a bug with Irale's door line type. Subversion-branch: /branches/strife-branch Subversion-revision: 2142
Diffstat (limited to 'src/strife')
-rw-r--r--src/strife/doomdef.h2
-rw-r--r--src/strife/p_enemy.c5
-rw-r--r--src/strife/p_inter.c15
-rw-r--r--src/strife/p_mobj.c20
-rw-r--r--src/strife/p_spec.c300
-rw-r--r--src/strife/p_switch.c2
6 files changed, 188 insertions, 156 deletions
diff --git a/src/strife/doomdef.h b/src/strife/doomdef.h
index 2dbf716b..bf24b619 100644
--- a/src/strife/doomdef.h
+++ b/src/strife/doomdef.h
@@ -247,7 +247,7 @@ enum
QF_QUEST4 = (1 << tk_quest4),
QF_QUEST5 = (1 << tk_quest5),
QF_QUEST6 = (1 << tk_quest6), // Destroyed the Power Coupling
- QF_QUEST7 = (1 << tk_quest7),
+ QF_QUEST7 = (1 << tk_quest7), // Killed Blue Acolytes ("Scanning Team")
QF_QUEST8 = (1 << tk_quest8),
QF_QUEST9 = (1 << tk_quest9),
QF_QUEST10 = (1 << tk_quest10),
diff --git a/src/strife/p_enemy.c b/src/strife/p_enemy.c
index d7c5d72f..7c5c9117 100644
--- a/src/strife/p_enemy.c
+++ b/src/strife/p_enemy.c
@@ -2803,9 +2803,7 @@ void A_RaiseAlarm(mobj_t* actor)
//
void A_MissileTick(mobj_t* actor)
{
- int r = actor->reactiontime--;
-
- if(r - 1 <= 0)
+ if(--actor->reactiontime <= 0)
{
P_ExplodeMissile(actor);
actor->flags &= ~MF_MISSILE;
@@ -3339,6 +3337,7 @@ void A_ClearForceField(mobj_t* actor)
for(i = 0; i < sec->linecount; i++)
{
secline = sec->lines[i];
+ // BUG: will crash if 1S line has TWOSIDED flag!
if(!(secline->flags & ML_TWOSIDED))
continue;
if(secline->special != 148)
diff --git a/src/strife/p_inter.c b/src/strife/p_inter.c
index 25917e5f..cddd097c 100644
--- a/src/strife/p_inter.c
+++ b/src/strife/p_inter.c
@@ -173,6 +173,7 @@ boolean P_GiveWeapon(player_t* player, weapontype_t weapon, boolean dropped)
gaveweapon = true;
player->weaponowned[weapon] = true;
+ // Alternate "sister" weapons that you also get as a bonus:
switch(weapon)
{
case wp_elecbow:
@@ -1152,7 +1153,7 @@ void P_DamageMobj(mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage)
// villsa [STRIFE] handle fieldguard damage
if(target->type == MT_FIELDGUARD)
{
- // degin ores are only allowed to damage the fieldguard
+ // degnin ores are only allowed to damage the fieldguard
if(!inflictor || inflictor->type != MT_DEGNINORE)
return;
@@ -1215,12 +1216,12 @@ void P_DamageMobj(mobj_t* target, mobj_t* inflictor, mobj_t* source, int damage)
// villsa [STRIFE] flame attacks don't damage player if wearing envirosuit??
if(player->powers[pw_ironfeet] && inflictor)
{
- if(inflictor->type == MT_SFIREBALL
- || inflictor->type == MT_C_FLAME
- || inflictor->type == MT_PFLAME)
- {
- damage = 0;
- }
+ if(inflictor->type == MT_SFIREBALL ||
+ inflictor->type == MT_C_FLAME ||
+ inflictor->type == MT_PFLAME)
+ {
+ damage = 0;
+ }
}
if(player->armortype)
diff --git a/src/strife/p_mobj.c b/src/strife/p_mobj.c
index 3a8486a3..36b05cbd 100644
--- a/src/strife/p_mobj.c
+++ b/src/strife/p_mobj.c
@@ -597,11 +597,11 @@ P_SpawnMobj
mobj_t* mobj;
state_t* st;
mobjinfo_t* info;
-
+
mobj = Z_Malloc (sizeof(*mobj), PU_LEVEL, NULL);
memset (mobj, 0, sizeof (*mobj));
info = &mobjinfo[type];
-
+
mobj->type = type;
mobj->info = info;
mobj->x = x;
@@ -611,8 +611,10 @@ P_SpawnMobj
mobj->flags = info->flags;
mobj->health = info->spawnhealth;
- if (gameskill != sk_nightmare)
- mobj->reactiontime = info->reactiontime;
+ // haleyjd 09/25/10: [STRIFE] Doesn't do this; messes up flamethrower
+ // and a lot of other stuff.
+ //if (gameskill != sk_nightmare)
+ mobj->reactiontime = info->reactiontime;
mobj->lastlook = P_Random () % MAXPLAYERS;
// do not set the state with P_SetMobjState,
@@ -626,13 +628,13 @@ P_SpawnMobj
// set subsector and/or block links
P_SetThingPosition (mobj);
-
+
mobj->floorz = mobj->subsector->sector->floorheight;
mobj->ceilingz = mobj->subsector->sector->ceilingheight;
if (z == ONFLOORZ)
{
- mobj->z = mobj->floorz;
+ mobj->z = mobj->floorz;
// villsa [STRIFE]
if(P_GetTerrainType(mobj) != FLOOR_SOLID)
@@ -640,12 +642,12 @@ P_SpawnMobj
}
else if (z == ONCEILINGZ)
- mobj->z = mobj->ceilingz - mobj->info->height;
+ mobj->z = mobj->ceilingz - mobj->info->height;
else
- mobj->z = z;
+ mobj->z = z;
mobj->thinker.function.acp1 = (actionf_p1)P_MobjThinker;
-
+
P_AddThinker (&mobj->thinker);
return mobj;
diff --git a/src/strife/p_spec.c b/src/strife/p_spec.c
index af8bc568..a53b6584 100644
--- a/src/strife/p_spec.c
+++ b/src/strife/p_spec.c
@@ -1462,6 +1462,8 @@ P_ShootSpecialLine
// Called every tic frame
// that the player origin is in a special sector
//
+// [STRIFE] Modified for new sector types and changes to old ones.
+//
void P_PlayerInSpecialSector (player_t* player)
{
sector_t* sector;
@@ -1523,7 +1525,6 @@ void P_PlayerInSpecialSector (player_t* player)
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;
@@ -1554,81 +1555,103 @@ void P_PlayerInSpecialSector (player_t* player)
// P_UpdateSpecials
// Animate planes, scroll walls, etc.
//
-boolean levelTimer;
-int levelTimeCount;
+// [STRIFE] Modifications to support multiple scrolling line types.
+//
+boolean levelTimer;
+int levelTimeCount;
void P_UpdateSpecials (void)
{
- anim_t* anim;
- int pic;
- int i;
- line_t* line;
+ anim_t* anim;
+ int pic;
+ int i;
+ line_t* line;
-
- // LEVEL TIMER
+
+ // LEVEL TIMER
if (levelTimer == true)
{
- levelTimeCount--;
- if (!levelTimeCount)
- G_ExitLevel(0);
+ if(levelTimeCount) // [STRIFE] Does not allow to go negative
+ levelTimeCount--;
+
+ /*
+ // [STRIFE] Not done here. Exit lines check this manually instead.
+ if (!levelTimeCount)
+ G_ExitLevel(0);
+ */
}
-
- // ANIMATE FLATS AND TEXTURES GLOBALLY
+
+ // ANIMATE FLATS AND TEXTURES GLOBALLY
for (anim = anims ; anim < lastanim ; anim++)
{
- for (i=anim->basepic ; i<anim->basepic+anim->numpics ; i++)
- {
- pic = anim->basepic + ( (leveltime/anim->speed + i)%anim->numpics );
- if (anim->istexture)
- texturetranslation[i] = pic;
- else
- flattranslation[i] = pic;
- }
+ for (i=anim->basepic ; i<anim->basepic+anim->numpics ; i++)
+ {
+ pic = anim->basepic + ( (leveltime/anim->speed + i)%anim->numpics );
+ if (anim->istexture)
+ texturetranslation[i] = pic;
+ else
+ flattranslation[i] = pic;
+ }
}
- // ANIMATE LINE SPECIALS
+ // ANIMATE LINE SPECIALS
for (i = 0; i < numlinespecials; i++)
{
- line = linespeciallist[i];
- switch(line->special)
- {
- case 48:
- // EFFECT FIRSTCOL SCROLL +
- sides[line->sidenum[0]].textureoffset += FRACUNIT;
- break;
- }
+ line = linespeciallist[i];
+ switch(line->special)
+ {
+ case 48:
+ // EFFECT FIRSTCOL SCROLL +
+ sides[line->sidenum[0]].textureoffset += FRACUNIT;
+ break;
+
+ case 142:
+ // haleyjd 09/25/10 [STRIFE] Scroll Up Slow
+ sides[line->sidenum[0]].rowoffset += FRACUNIT;
+ break;
+
+ case 143:
+ // haleyjd 09/25/10 [STRIFE] Scroll Down Fast (3 Units/Tic)
+ sides[line->sidenum[0]].rowoffset -= 3*FRACUNIT;
+ break;
+
+ case 149:
+ // haleyjd 09/25/10 [STRIFE] Scroll Down Slow
+ sides[line->sidenum[0]].rowoffset -= FRACUNIT;
+ break;
+ }
}
- // DO BUTTONS
+ // DO BUTTONS
for (i = 0; i < MAXBUTTONS; i++)
- if (buttonlist[i].btimer)
- {
- buttonlist[i].btimer--;
- if (!buttonlist[i].btimer)
- {
- switch(buttonlist[i].where)
- {
- case top:
- sides[buttonlist[i].line->sidenum[0]].toptexture =
- buttonlist[i].btexture;
- break;
-
- case middle:
- sides[buttonlist[i].line->sidenum[0]].midtexture =
- buttonlist[i].btexture;
- break;
-
- case bottom:
- sides[buttonlist[i].line->sidenum[0]].bottomtexture =
- buttonlist[i].btexture;
- break;
- }
- S_StartSound(&buttonlist[i].soundorg,sfx_swtchn);
- memset(&buttonlist[i],0,sizeof(button_t));
- }
- }
+ if (buttonlist[i].btimer)
+ {
+ buttonlist[i].btimer--;
+ if (!buttonlist[i].btimer)
+ {
+ switch(buttonlist[i].where)
+ {
+ case top:
+ sides[buttonlist[i].line->sidenum[0]].toptexture =
+ buttonlist[i].btexture;
+ break;
+
+ case middle:
+ sides[buttonlist[i].line->sidenum[0]].midtexture =
+ buttonlist[i].btexture;
+ break;
+
+ case bottom:
+ sides[buttonlist[i].line->sidenum[0]].bottomtexture =
+ buttonlist[i].btexture;
+ break;
+ }
+ S_StartSound(&buttonlist[i].soundorg,sfx_swtchn);
+ memset(&buttonlist[i],0,sizeof(button_t));
+ }
+ }
}
@@ -1838,17 +1861,21 @@ line_t* linespeciallist[MAXLINEANIMS];
// Parses command line parameters.
+//
+// haleyjd 09/25/10: [STRIFE] Modifications for more scrolling line types and
+// for initialization of sliding door resources.
+//
void P_SpawnSpecials (void)
{
- sector_t* sector;
- int i;
- int episode;
+ sector_t* sector;
+ int i;
+ int episode;
episode = 1;
if (W_CheckNumForName(DEH_String("texture2")) >= 0)
- episode = 2;
+ episode = 2;
+
-
// See if -TIMER was specified.
if (timelimit > 0)
@@ -1858,99 +1885,100 @@ void P_SpawnSpecials (void)
}
else
{
- levelTimer = false;
+ levelTimer = false;
}
-
- // Init special SECTORs.
+
+ // Init special SECTORs - [STRIFE] Verified unmodified.
sector = sectors;
for (i=0 ; i<numsectors ; i++, sector++)
{
- if (!sector->special)
- continue;
-
- switch (sector->special)
- {
- case 1:
- // FLICKERING LIGHTS
- P_SpawnLightFlash (sector);
- break;
+ if (!sector->special)
+ continue;
- case 2:
- // STROBE FAST
- P_SpawnStrobeFlash(sector,FASTDARK,0);
- break;
-
- case 3:
- // STROBE SLOW
- P_SpawnStrobeFlash(sector,SLOWDARK,0);
- break;
-
- case 4:
- // STROBE FAST/DEATH SLIME
- P_SpawnStrobeFlash(sector,FASTDARK,0);
- sector->special = 4;
- break;
-
- case 8:
- // GLOWING LIGHT
- P_SpawnGlowingLight(sector);
- break;
- case 9:
- // SECRET SECTOR
- totalsecret++;
- break;
-
- case 10:
- // DOOR CLOSE IN 30 SECONDS
- P_SpawnDoorCloseIn30 (sector);
- break;
-
- case 12:
- // SYNC STROBE SLOW
- P_SpawnStrobeFlash (sector, SLOWDARK, 1);
- break;
+ switch (sector->special)
+ {
+ case 1:
+ // FLICKERING LIGHTS
+ P_SpawnLightFlash (sector);
+ break;
- case 13:
- // SYNC STROBE FAST
- P_SpawnStrobeFlash (sector, FASTDARK, 1);
- break;
+ case 2:
+ // STROBE FAST
+ P_SpawnStrobeFlash(sector,FASTDARK,0);
+ break;
- case 14:
- // DOOR RAISE IN 5 MINUTES
- P_SpawnDoorRaiseIn5Mins (sector, i);
- break;
-
- case 17:
- P_SpawnFireFlicker(sector);
- break;
- }
+ case 3:
+ // STROBE SLOW
+ P_SpawnStrobeFlash(sector,SLOWDARK,0);
+ break;
+
+ case 4:
+ // STROBE FAST/DEATH SLIME
+ P_SpawnStrobeFlash(sector,FASTDARK,0);
+ sector->special = 4;
+ break;
+
+ case 8:
+ // GLOWING LIGHT
+ P_SpawnGlowingLight(sector);
+ break;
+ case 9:
+ // SECRET SECTOR
+ totalsecret++;
+ break;
+
+ case 10:
+ // DOOR CLOSE IN 30 SECONDS
+ P_SpawnDoorCloseIn30 (sector);
+ break;
+
+ case 12:
+ // SYNC STROBE SLOW
+ P_SpawnStrobeFlash (sector, SLOWDARK, 1);
+ break;
+
+ case 13:
+ // SYNC STROBE FAST
+ P_SpawnStrobeFlash (sector, FASTDARK, 1);
+ break;
+
+ case 14:
+ // DOOR RAISE IN 5 MINUTES
+ P_SpawnDoorRaiseIn5Mins (sector, i);
+ break;
+
+ case 17:
+ P_SpawnFireFlicker(sector);
+ break;
+ }
}
-
+
// Init line EFFECTs
numlinespecials = 0;
for (i = 0;i < numlines; i++)
{
- switch(lines[i].special)
- {
- case 48:
- // EFFECT FIRSTCOL SCROLL+
- linespeciallist[numlinespecials] = &lines[i];
- numlinespecials++;
- break;
- }
+ switch(lines[i].special)
+ {
+ case 48: // EFFECT FIRSTCOL SCROLL+
+ case 142: // [STRIFE] TODO: verify scroll types
+ case 143:
+ case 149:
+ linespeciallist[numlinespecials] = &lines[i];
+ numlinespecials++;
+ break;
+ }
}
-
// Init other misc stuff
for (i = 0;i < MAXCEILINGS;i++)
- activeceilings[i] = NULL;
+ activeceilings[i] = NULL;
for (i = 0;i < MAXPLATS;i++)
- activeplats[i] = NULL;
-
+ activeplats[i] = NULL;
+
for (i = 0;i < MAXBUTTONS;i++)
- memset(&buttonlist[i],0,sizeof(button_t));
+ memset(&buttonlist[i],0,sizeof(button_t));
// villsa [STRIFE]
P_InitSlidingDoorFrames();
diff --git a/src/strife/p_switch.c b/src/strife/p_switch.c
index 50c6996b..70bf41c3 100644
--- a/src/strife/p_switch.c
+++ b/src/strife/p_switch.c
@@ -1055,6 +1055,8 @@ boolean P_UseSpecialLine(mobj_t* thing, line_t* line, int side)
// haleyjd 09/24/10: [STRIFE] SR Raise Door if Quest 3
if(!(thing->player->questflags & QF_QUEST3)) // QUEST3 == Irale
{
+ // BUG: doesn't make sfx_oof sound like all other message-
+ // giving door types. I highly doubt this was intentional.
DEH_snprintf(usemessage, sizeof(usemessage),
"That doesn't seem to work!");
thing->player->message = usemessage;