diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 626ce15223..3f5ffd4ab0 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,12 +1,19 @@ -June 30, 2006 -- Changed the earthquake view shaking so that it works for anything and not - just players. +July 2, 2006 (Changes by Graf Zahl) +- Fixed: G_NewInit destroyed the players' userinfo data. +- Changed the special radius damage handling for the barrel and boss brain + into an actor flag. +- Added A_RadiusThrust code pointer for DECORATE and adjusted the radius + attack functions accordingly. July 1, 2006 (Changes by Graf Zahl) - Fixed: In multiplayer games, when trying to change targets, A_Chase forgot to check whether the new target was the same as the old one and treated this case as a real target change. +June 30, 2006 +- Changed the earthquake view shaking so that it works for anything and not + just players. + June 29, 2006 - Added some hackery at the start of MouseRead_Win32() that prevents it from yanking the mouse around if they keys haven't been read yet to combat the diff --git a/src/actor.h b/src/actor.h index ef12919733..d4b60da92f 100644 --- a/src/actor.h +++ b/src/actor.h @@ -282,6 +282,7 @@ enum MF5_NODAMAGE = 0x00000040, // Actor can be shot and reacts to being shot but takes no damage MF5_CHASEGOAL = 0x00000080, // Walks to goal instead of target if a valid goal is set. MF5_BLOODSPLATTER = 0x00000100, // Blood splatter like in Raven's games. + MF5_OLDRADIUSDMG = 0x00000200, // Use old radius damage code (for barrels and boss brain) // --- mobj.renderflags --- diff --git a/src/g_doom/a_bossbrain.cpp b/src/g_doom/a_bossbrain.cpp index a907ee510a..70ab7d88d9 100644 --- a/src/g_doom/a_bossbrain.cpp +++ b/src/g_doom/a_bossbrain.cpp @@ -74,6 +74,7 @@ IMPLEMENT_ACTOR (ABossBrain, Doom, 88, 0) PROP_PainChance (255) PROP_Flags (MF_SOLID|MF_SHOOTABLE) PROP_Flags4 (MF4_NOICEDEATH) + PROP_Flags5 (MF5_OLDRADIUSDMG) PROP_SpawnState (S_BRAIN) PROP_PainState (S_BRAIN_PAIN) diff --git a/src/g_doom/a_doommisc.cpp b/src/g_doom/a_doommisc.cpp index 2a93f5ac96..276c091194 100644 --- a/src/g_doom/a_doommisc.cpp +++ b/src/g_doom/a_doommisc.cpp @@ -40,6 +40,7 @@ IMPLEMENT_ACTOR (AExplosiveBarrel, Doom, 2035, 125) PROP_Flags2 (MF2_MCROSS) PROP_Flags3 (MF3_DONTGIB) PROP_Flags4 (MF4_NOICEDEATH) + PROP_Flags5 (MF5_OLDRADIUSDMG) PROP_SpawnState (S_BAR) PROP_DeathState (S_BEXP) diff --git a/src/g_level.cpp b/src/g_level.cpp index eee6199015..d448f565d6 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1372,10 +1372,12 @@ void G_NewInit () for (i = 0; i < MAXPLAYERS; ++i) { player_t *p = &players[i]; + userinfo_t saved_ui = players[i].userinfo; p->~player_t(); ::new(p) player_t; players[i].playerstate = PST_DEAD; playeringame[i] = 0; + players[i].userinfo = saved_ui; } BackupSaveName = ""; consoleplayer = 0; diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 492c30b481..6fcc4f6441 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -1080,12 +1080,21 @@ bool AInventory::DrawPowerup (int x, int y) /***************************************************************************/ IMPLEMENT_STATELESS_ACTOR (APowerupGiver, Any, -1, 0) - PROP_Inventory_RespawnTics (30+1400) PROP_Inventory_DefMaxAmount PROP_Inventory_FlagsSet (IF_INVBAR|IF_FANCYPICKUPSOUND) PROP_Inventory_PickupSound ("misc/p_pkup") END_DEFAULTS +AT_GAME_SET(PowerupGiver) +{ + APowerupGiver * giver = GetDefault(); + + if (gameinfo.gametype & GAME_Raven) + { + giver->RespawnTics = 1400+30; + } +} + //=========================================================================== // // AInventory :: DoRespawn diff --git a/src/p_local.h b/src/p_local.h index 48dc8465f3..c37fb70270 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -315,7 +315,7 @@ extern fixed_t CameraX, CameraY, CameraZ; extern sector_t *CameraSector; // [RH] Means of death -void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, int damageType, bool hurtSelf, bool thrustless=false); +void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, int damageType, bool hurtSelf, bool thrustless=false, bool dodamage=true); void P_DelSector_List(); void P_DelSeclist(msecnode_t *); // phares 3/16/98 diff --git a/src/p_map.cpp b/src/p_map.cpp index bfb2e451ab..b3cf868314 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3415,6 +3415,7 @@ bool DamageSource; int bombmod; vec3_t bombvec; bool bombthrustless; +bool bombdodamage; //============================================================================= // @@ -3463,9 +3464,7 @@ BOOL PIT_RadiusAttack (AActor *thing) // them far too "active." BossBrains also use the old code // because some user levels require they have a height of 16, // which can make them near impossible to hit with the new code. - if (!bombspot->IsKindOf (RUNTIME_CLASS(AExplosiveBarrel)) && - !thing->IsKindOf (RUNTIME_CLASS(AExplosiveBarrel)) && - !thing->IsKindOf (RUNTIME_CLASS(ABossBrain))) + if (!bombdodamage || !((bombspot->flags5 | thing->flags5) & MF5_OLDRADIUSDMG)) { // [RH] New code. The bounding box only covers the // height of the thing and not the height of the map. @@ -3523,11 +3522,13 @@ BOOL PIT_RadiusAttack (AActor *thing) float thrust; int damage = (int)points; - P_DamageMobj (thing, bombspot, bombsource, damage, bombmod); + if (bombdodamage) P_DamageMobj (thing, bombspot, bombsource, damage, bombmod); + else thing->flags2 |= MF2_BLASTED; + if (!(bombspot->flags2 & MF2_NODMGTHRUST) && !(thing->flags & MF_ICECORPSE)) { - P_TraceBleed (damage, thing, bombspot); + if (bombdodamage) P_TraceBleed (damage, thing, bombspot); if (!bombthrustless) { @@ -3591,7 +3592,7 @@ BOOL PIT_RadiusAttack (AActor *thing) // Source is the creature that caused the explosion at spot. // void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, int damageType, - bool hurtSource, bool thrustless) + bool hurtSource, bool thrustless, bool dodamage) { static TArray radbt; @@ -3616,6 +3617,7 @@ void P_RadiusAttack (AActor *spot, AActor *source, int damage, int distance, int DamageSource = hurtSource; bombdamagefloat = (float)damage; bombmod = damageType; + bombdodamage = dodamage; VectorPosition (spot, bombvec); radbt.Clear(); diff --git a/src/thingdef.cpp b/src/thingdef.cpp index dd356d8458..53aa1f78ee 100644 --- a/src/thingdef.cpp +++ b/src/thingdef.cpp @@ -216,6 +216,7 @@ static flagdef ActorFlags[]= DEFINE_FLAG(MF5, EXPLODEONWATER, AActor, flags5), DEFINE_FLAG(MF5, NODAMAGE, AActor, flags5), DEFINE_FLAG(MF5, BLOODSPLATTER, AActor, flags5), + DEFINE_FLAG(MF5, OLDRADIUSDMG, AActor, flags5), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), @@ -499,6 +500,7 @@ ACTOR(CountdownArg) ACTOR(CustomMeleeAttack) ACTOR(Light) ACTOR(Burst) +ACTOR(RadiusThrust) #include "d_dehackedactions.h" @@ -688,6 +690,7 @@ AFuncDesc AFTable[]= FUNC(A_CountdownArg, "X") FUNC(A_CustomMeleeAttack, "XXXsty" ) FUNC(A_Burst, "M") + FUNC(A_RadiusThrust, "xxy") }; //========================================================================== diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index 37802c719f..96ad2c5f1d 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -482,6 +482,32 @@ void A_ExplodeParms (AActor *self) } +//========================================================================== +// +// A_RadiusThrust +// +//========================================================================== + +void A_RadiusThrust (AActor *self) +{ + int index=CheckIndex(3); + if (index<0) return; + + int force = EvalExpressionI (StateParameters[index], self); + if (force==0) force=128; + + int distance = EvalExpressionI (StateParameters[index+1], self); + if (distance==0) distance=128; + + bool affectSource = EvalExpressionN (StateParameters[index+2], self);; + + P_RadiusAttack (self, self->target, force, distance, self->DamageType, affectSource, false, false); + if (self->z <= self->floorz + (distance<