From 8e631eca0b9c3073f3dad502988b45f143deead6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 18 Apr 2006 22:15:05 +0000 Subject: [PATCH] SVN r54 (trunk) --- docs/rh-log.txt | 18 +++++++++++++++++ src/actor.h | 3 +++ src/g_hexen/a_clericholy.cpp | 13 ++++++++----- src/g_strife/a_programmer.cpp | 4 +++- src/g_strife/a_strifeglobal.h | 7 +++++++ src/g_strife/a_strifekeys.cpp | 1 + src/g_strife/a_strifeplayer.cpp | 12 ++++++++++++ src/g_strife/a_strifeweapons.cpp | 18 ++++++++--------- src/info.h | 1 + src/infodefaults.cpp | 1 + src/infomacros.h | 1 + src/p_conversation.cpp | 5 +++++ src/p_mobj.cpp | 33 ++++++++++++++++++++++++++------ src/thingdef.cpp | 14 +++++++++++++- src/thingdef_codeptr.cpp | 1 + wadsrc/mapinfo/strife.txt | 11 ++++++++++- 16 files changed, 120 insertions(+), 23 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 214ca006ad..7bd3b86071 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,21 @@ +April 18, 2006 (Changes by Graf Zahl) +- Fixed A_CHolyAttack used linetarget to set the spirits' target actor. + But it assumed that this variable was still valid from shooting the + weapon. Not only is that not guaranteed. When used by the ClericBoss + it is an unwanted effect because the linetarget is most likely the + last thing the player fired at which normally is the ClericBoss itself. + A_CHolyAttack now sets tracer to the intended target instead of + relying on linetarget being preserved. +- Fixed: Strife's grenades only bounce twice off the floor. They also + bounce off all actors and immediately explode when hitting liquids. +- Fixed: Strife's flame thrower gives 100 ammo as a pickup item but only + 40 when given in a dialog. +- Moved the sky change script starts for the Programmer into MAPINFO as + special death actions. +- Changed the sky in MAP09 of Strife to the blue sky to make it more + consistent. Now the sky change occurs when the player wakes up after + fighting the programmer. + April 18, 2006 - Fixed: FBaseStatusBar::DrBNumber() should behave like Doom's STlib_drawNum(), and FDoomStatusBarTexture::DrawToBar() should add diff --git a/src/actor.h b/src/actor.h index 7cdf1d01a9..fe6ed95f79 100644 --- a/src/actor.h +++ b/src/actor.h @@ -276,6 +276,8 @@ enum MF5_FASTER = 0x00000001, // moves faster when DF_FAST_MONSTERS or nightmare is on. MF5_FASTMELEE = 0x00000002, // has a faster melee attack when DF_FAST_MONSTERS or nightmare is on. MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances. + MF5_BOUNCEONACTORS = 0x00000008, // bouncing missile doesn't explode when it hits an actor + MF5_EXPLODEONWATER = 0x00000010, // bouncing missile explpdes when hitting a water surface // --- mobj.renderflags --- @@ -649,6 +651,7 @@ public: WORD SpawnFlags; fixed_t meleerange; fixed_t bouncefactor; // Strife's grenades use 50%, Hexen's Flechettes 70. + int bouncecount; // Strife's grenades only bounce twice before exploding // a linked list of sectors where this object appears struct msecnode_s *touching_sectorlist; // phares 3/14/98 diff --git a/src/g_hexen/a_clericholy.cpp b/src/g_hexen/a_clericholy.cpp index 3e23f8213d..71da48237e 100644 --- a/src/g_hexen/a_clericholy.cpp +++ b/src/g_hexen/a_clericholy.cpp @@ -245,7 +245,7 @@ IMPLEMENT_ACTOR (AHolyMissile, Hexen, -1, 0) PROP_HeightFixed (8) PROP_Damage (4) PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE) - PROP_Flags2 (MF2_NOTELEPORT) + PROP_Flags2 (MF2_NOTELEPORT) PROP_SpawnState (0) PROP_DeathState (4) @@ -468,7 +468,8 @@ END_DEFAULTS void A_CHolyAttack3 (AActor *actor) { - P_SpawnMissileZ (actor, actor->z + 40*FRACUNIT, actor->target, RUNTIME_CLASS(AHolyMissile)); + AActor * missile = P_SpawnMissileZ (actor, actor->z + 40*FRACUNIT, actor->target, RUNTIME_CLASS(AHolyMissile)); + if (missile != NULL) missile->tracer = NULL; // No initial target S_Sound (actor, CHAN_WEAPON, "HolySymbolFire", 1, ATTN_NORM); } @@ -518,9 +519,9 @@ void A_CHolyAttack2 (AActor *actor) { // Ghosts last slightly less longer in DeathMatch mo->health = 85; } - if (linetarget) + if (actor->tracer) { - mo->tracer = linetarget; + mo->tracer = actor->tracer; mo->flags |= MF_NOCLIP|MF_SKULLFLY; mo->flags &= ~MF_MISSILE; } @@ -570,7 +571,9 @@ void A_CHolyAttack (AActor *actor) if (!weapon->DepleteAmmo (weapon->bAltFire)) return; } - P_SpawnPlayerMissile (actor, RUNTIME_CLASS(AHolyMissile)); + AActor * missile = P_SpawnPlayerMissile (actor, RUNTIME_CLASS(AHolyMissile)); + if (missile != NULL) missile->tracer = linetarget; + weapon->CHolyCount = 3; S_Sound (actor, CHAN_WEAPON, "HolySymbolFire", 1, ATTN_NORM); } diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index 3fc6df9fb6..4d79e8f1ea 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -293,5 +293,7 @@ void A_ProgrammerDeath (AActor *self) break; } } - P_StartScript (self, NULL, 250, NULL, 0, 0, 0, 0, false, false); + // the sky change scripts are now done as special actions in MAPINFO + A_BossDeath(self); + //P_StartScript (self, NULL, 250, NULL, 0, 0, 0, 0, false, false); } diff --git a/src/g_strife/a_strifeglobal.h b/src/g_strife/a_strifeglobal.h index 6ce6f81340..1ccbae02d6 100644 --- a/src/g_strife/a_strifeglobal.h +++ b/src/g_strife/a_strifeglobal.h @@ -92,6 +92,13 @@ class AStrifeWeapon : public AWeapon DECLARE_STATELESS_ACTOR (AStrifeWeapon, AWeapon) }; +class AFlameThrower : public AStrifeWeapon +{ + DECLARE_ACTOR (AFlameThrower, AStrifeWeapon) +public: + const char *PickupMessage (); +}; + class ASigil : public AStrifeWeapon { DECLARE_ACTOR (ASigil, AStrifeWeapon) diff --git a/src/g_strife/a_strifekeys.cpp b/src/g_strife/a_strifekeys.cpp index 0951899e1b..09f36759c9 100644 --- a/src/g_strife/a_strifekeys.cpp +++ b/src/g_strife/a_strifekeys.cpp @@ -825,6 +825,7 @@ END_DEFAULTS bool APrisonPass::TryPickup (AActor *toucher) { + Super::TryPickup (toucher); EV_DoDoor (DDoor::doorOpen, NULL, toucher, 223, 2*FRACUNIT, 0, 0, 0); toucher->GiveInventoryType (QuestItemClasses[9]); return true; diff --git a/src/g_strife/a_strifeplayer.cpp b/src/g_strife/a_strifeplayer.cpp index 4b964409a5..e7a212c8cb 100644 --- a/src/g_strife/a_strifeplayer.cpp +++ b/src/g_strife/a_strifeplayer.cpp @@ -6,6 +6,7 @@ #include "a_action.h" #include "p_local.h" #include "a_doomglobal.h" +#include "templates.h" void A_Pain (AActor *); void A_PlayerScream (AActor *); @@ -24,6 +25,7 @@ class AStrifePlayer : public APlayerPawn DECLARE_ACTOR (AStrifePlayer, APlayerPawn) public: void GiveDefaultInventory (); + void TweakSpeeds (int &forward, int &side); }; FState AStrifePlayer::States[] = @@ -138,3 +140,13 @@ void AStrifePlayer::GiveDefaultInventory () weapon = static_cast(player->mo->GiveInventoryType (TypeInfo::FindType ("PunchDagger"))); player->ReadyWeapon = player->PendingWeapon = weapon; } + +void AStrifePlayer::TweakSpeeds (int &forward, int &side) +{ + if (health<=10) + { + forward = clamp(forward, -0x1900, 0x1900); + side = clamp(side, -0x1800, 0x1800); + } + Super::TweakSpeeds (forward, side); +} diff --git a/src/g_strife/a_strifeweapons.cpp b/src/g_strife/a_strifeweapons.cpp index 3a8691480e..73f9916396 100644 --- a/src/g_strife/a_strifeweapons.cpp +++ b/src/g_strife/a_strifeweapons.cpp @@ -955,15 +955,11 @@ void A_RocketInFlight (AActor *self) void A_FireFlamer (AActor *); -class AFlameThrower : public AStrifeWeapon + +const char *AFlameThrower::PickupMessage () { - DECLARE_ACTOR (AFlameThrower, AStrifeWeapon) -public: - const char *PickupMessage () - { - return "You picked up the flame thrower"; - } -}; + return "You picked up the flame thrower"; +} FState AFlameThrower::States[] = { @@ -996,7 +992,7 @@ IMPLEMENT_ACTOR (AFlameThrower, Strife, 2005, 0) PROP_Weapon_Flags (WIF_BOT_MELEE) PROP_Weapon_Kickback (0) PROP_Weapon_AmmoUse1 (1) - PROP_Weapon_AmmoGive1 (40) + PROP_Weapon_AmmoGive1 (100) PROP_Weapon_UpState (S_FLAMERUP) PROP_Weapon_DownState (S_FLAMERDOWN) PROP_Weapon_ReadyState (S_FLAMER) @@ -1513,9 +1509,11 @@ IMPLEMENT_ACTOR (AHEGrenade, Strife, -1, 0) PROP_Flags2 (MF2_FLOORCLIP|MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT|MF2_DOOMBOUNCE) PROP_Flags3 (MF3_CANBOUNCEWATER) PROP_Flags4 (MF4_STRIFEDAMAGE|MF4_NOBOUNCESOUND) + PROP_Flags5 (MF5_BOUNCEONACTORS|MF5_EXPLODEONWATER) PROP_MaxStepHeight (4) PROP_StrifeType (106) PROP_BounceFactor((FRACUNIT*5/10)) + PROP_BounceCount(2) PROP_SeeSound ("weapons/hegrenadeshoot") PROP_DeathSound ("weapons/hegrenadebang") END_DEFAULTS @@ -1562,9 +1560,11 @@ IMPLEMENT_ACTOR (APhosphorousGrenade, Strife, -1, 0) PROP_Flags2 (MF2_FLOORCLIP|MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT|MF2_DOOMBOUNCE) PROP_Flags3 (MF3_CANBOUNCEWATER) PROP_Flags4 (MF4_STRIFEDAMAGE|MF4_NOBOUNCESOUND) + PROP_Flags5 (MF5_BOUNCEONACTORS|MF5_EXPLODEONWATER) PROP_MaxStepHeight (4) PROP_StrifeType (107) PROP_BounceFactor((FRACUNIT*5/10)) + PROP_BounceCount(2) PROP_SeeSound ("weapons/phgrenadeshoot") PROP_DeathSound ("weapons/phgrenadebang") END_DEFAULTS diff --git a/src/info.h b/src/info.h index ada25291af..53653a0dc8 100644 --- a/src/info.h +++ b/src/info.h @@ -277,6 +277,7 @@ enum ADEF_MaxDropOffHeight, ADEF_MaxStepHeight, ADEF_BounceFactor, + ADEF_BounceCount, ADEF_SpawnState, ADEF_SeeState, diff --git a/src/infodefaults.cpp b/src/infodefaults.cpp index 07a75327bc..79f48833fb 100644 --- a/src/infodefaults.cpp +++ b/src/infodefaults.cpp @@ -214,6 +214,7 @@ static void ApplyActorDefault (int defnum, const char *datastr, int dataint) case ADEF_MaxDropOffHeight: actor->MaxDropOffHeight = dataint; break; case ADEF_MaxStepHeight: actor->MaxStepHeight = dataint; break; case ADEF_BounceFactor: actor->bouncefactor = dataint; break; + case ADEF_BounceCount: actor->bouncecount = dataint; break; case ADEF_SpawnState: actor->SpawnState = datastate; break; case ADEF_SeeState: actor->SeeState = datastate; break; diff --git a/src/infomacros.h b/src/infomacros.h index cb38e9869e..32af1765cf 100644 --- a/src/infomacros.h +++ b/src/infomacros.h @@ -257,6 +257,7 @@ public: #define PROP_MaxDropOffHeight(x) ADD_FIXD_PROP(ADEF_MaxDropOffHeight,x) #define PROP_MaxStepHeight(x) ADD_FIXD_PROP(ADEF_MaxStepHeight,x) #define PROP_BounceFactor(x) ADD_LONG_PROP(ADEF_BounceFactor,x) +#define PROP_BounceCount(x) ADD_LONG_PROP(ADEF_BounceCount,x) #define PROP_SpawnState(x) ADD_BYTE_PROP(ADEF_SpawnState,x) #define PROP_SeeState(x) ADD_BYTE_PROP(ADEF_SeeState,x) diff --git a/src/p_conversation.cpp b/src/p_conversation.cpp index c2d43195ea..d821472e80 100644 --- a/src/p_conversation.cpp +++ b/src/p_conversation.cpp @@ -984,6 +984,11 @@ static void PickConversationReply () level.total_items--; item->flags &= ~MF_COUNTITEM; } + if (item->IsA(RUNTIME_CLASS(AFlameThrower))) + { + // The flame thrower gives less ammo when given in a dialog + static_cast(item)->AmmoGive1 = 40; + } item->flags |= MF_DROPPED; if (!item->TryPickup (players[consoleplayer].mo)) { diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index faa566b590..c96bad1f8c 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -228,6 +228,7 @@ void AActor::Serialize (FArchive &arc) TexMan.WriteTexture (arc, picnum); } TexMan.WriteTexture (arc, floorpic); + TexMan.WriteTexture (arc, ceilingpic); } else { @@ -242,6 +243,7 @@ void AActor::Serialize (FArchive &arc) picnum = TexMan.ReadTexture (arc); } floorpic = TexMan.ReadTexture (arc); + ceilingpic = TexMan.ReadTexture (arc); } arc << TIDtoHate; if (TIDtoHate == 0) @@ -334,6 +336,7 @@ void AActor::Serialize (FArchive &arc) << MaxDropOffHeight << MaxStepHeight << bouncefactor + << bouncecount << meleerange << DamageType; @@ -1101,9 +1104,25 @@ void P_ExplodeMissile (AActor *mo, line_t *line) bool AActor::FloorBounceMissile (secplane_t &plane) { - if (z <= floorz && P_HitFloor (this) && !(flags3 & MF3_CANBOUNCEWATER)) - { // Landed in some sort of liquid - Destroy (); + if (z <= floorz && P_HitFloor (this)) + { + // Landed in some sort of liquid + if (flags5 & MF5_EXPLODEONWATER) + { + P_ExplodeMissile(this, NULL); + return true; + } + if (!(flags3 & MF3_CANBOUNCEWATER)) + { + Destroy (); + return true; + } + } + + // The amount of bounces is limited + if (bouncecount>0 && --bouncecount==0) + { + P_ExplodeMissile(this, NULL); return true; } @@ -1521,9 +1540,10 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) { if (mo->flags2 & MF2_BOUNCE2) { - if ((BlockingMobj->flags2 & MF2_REFLECTIVE) || + if (mo->flags5&MF5_BOUNCEONACTORS || + (BlockingMobj->flags2 & MF2_REFLECTIVE) || ((!BlockingMobj->player) && - (!(BlockingMobj->flags3 & MF3_ISMONSTER)))) + (!(BlockingMobj->flags3 & MF3_ISMONSTER)))) { fixed_t speed; @@ -1536,7 +1556,7 @@ void P_XYMovement (AActor *mo, fixed_t scrollx, fixed_t scrolly) angle >>= ANGLETOFINESHIFT; mo->momx = FixedMul (speed, finecosine[angle]); mo->momy = FixedMul (speed, finesine[angle]); - if (mo->SeeSound) + if (mo->SeeSound && !(mo->flags4&MF4_NOBOUNCESOUND)) { S_SoundID (mo, CHAN_VOICE, mo->SeeSound, 1, ATTN_IDLE); } @@ -2980,6 +3000,7 @@ BEGIN_DEFAULTS (AActor, Any, -1, 0) PROP_MaxDropOffHeight(24) PROP_MaxStepHeight(24) PROP_BounceFactor(FRACUNIT*7/10) + PROP_BounceCount(-1) END_DEFAULTS //========================================================================== diff --git a/src/thingdef.cpp b/src/thingdef.cpp index 2af6f0607a..d46353dc81 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -218,6 +218,8 @@ static flagdef ActorFlags[]= DEFINE_FLAG(MF5, FASTER, AActor, flags5), DEFINE_FLAG(MF5, FASTMELEE, AActor, flags5), DEFINE_FLAG(MF5, NODROPOFF, AActor, flags5), + DEFINE_FLAG(MF5, BOUNCEONACTORS, AActor, flags5), + DEFINE_FLAG(MF5, EXPLODEONWATER, AActor, flags5), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), @@ -2644,7 +2646,16 @@ static void ActorBloodColor (AActor *defaults, Baggage &bag) static void ActorBounceFactor (AActor *defaults, Baggage &bag) { SC_MustGetFloat (); - defaults->bouncefactor = fixed_t(sc_Float * FRACUNIT); + defaults->bouncefactor = clamp(fixed_t(sc_Float * FRACUNIT), 0, FRACUNIT); +} + +//========================================================================== +// +//========================================================================== +static void ActorBounceCount (AActor *defaults, Baggage &bag) +{ + SC_MustGetNumber (); + defaults->bouncecount = sc_Number; } //========================================================================== @@ -3209,6 +3220,7 @@ static const ActorProps props[] = { "armor.savepercent", (apf)ArmorSavePercent, RUNTIME_CLASS(AActor) }, { "attacksound", ActorAttackSound, RUNTIME_CLASS(AActor) }, { "bloodcolor", ActorBloodColor, RUNTIME_CLASS(AActor) }, + { "bouncecount", ActorBounceCount, RUNTIME_CLASS(AActor) }, { "bouncefactor", ActorBounceFactor, RUNTIME_CLASS(AActor) }, { "burn", ActorBurnState, RUNTIME_CLASS(AActor) }, { "burnheight", ActorBurnHeight, RUNTIME_CLASS(AActor) }, diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index 68ab45d030..d201db2b8f 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -1505,3 +1505,4 @@ void A_KillChildren(AActor * self) } } } + diff --git a/wadsrc/mapinfo/strife.txt b/wadsrc/mapinfo/strife.txt index ef8aa2b21a..41672b49e5 100644 --- a/wadsrc/mapinfo/strife.txt +++ b/wadsrc/mapinfo/strife.txt @@ -59,9 +59,18 @@ cluster 1 map MAP09 "AREA 9: Castle: Programmer's Keep" next MAP10 -sky1 SKYMNT01 0 +sky1 SKYMNT02 0 music D_TRIBAL cluster 1 +// These are the sky changes for the first 8 maps +specialaction "Programmer", ACS_Execute, 0, 1, 256 +specialaction "Programmer", ACS_Execute, 0, 2, 256 +specialaction "Programmer", ACS_Execute, 0, 3, 256 +specialaction "Programmer", ACS_Execute, 0, 4, 256 +specialaction "Programmer", ACS_Execute, 0, 5, 256 +specialaction "Programmer", ACS_Execute, 0, 6, 256 +specialaction "Programmer", ACS_Execute, 0, 7, 256 +specialaction "Programmer", ACS_Execute, 0, 8, 256 // It seems that Strife was originally going to print the text // from the C1TEXT lump when you move from map 9 to map 10, but