diff --git a/docs/rh-log.txt b/docs/rh-log.txt index e53411b3b..19916de39 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,18 @@ +December 5, 2006 (Changes by Graf Zahl) +- Moved A_ThrowGrenade from Inventory to Actor because it can also be used by + monsters +- Added velocity multiplicators to A_SpawnDebris. +- Changed: A_JumpIfNoAmmo should have no effect for CustomInventory items. +- Fixed: DECORATE jump commands must set the call state's result to 0 + even when they have to return prematurely. +- Added obituaries for Strife's and Hexen's monsters. +- Converted Strife's Bishop to DECORATE. +- Added momx, momy and momz variables to the DECORATE expression evaluator. + +December 5, 2006 +- Finished the framework for specifying all action functions externally, + including restricting them to particular classes. + December 3, 2006 - Modified the trustInfo for updaterevision.exe so that it should be fine even with the buggy mt.exe that comes with Visual C++ 2005. diff --git a/src/decorations.cpp b/src/decorations.cpp index cfef91fd8..8bf4eb938 100644 --- a/src/decorations.cpp +++ b/src/decorations.cpp @@ -744,17 +744,9 @@ static void ParseInsideDecoration (FActorInfo *info, AActor *defaults, { defaults->DamageType = NAME_None; } - else if (SC_Compare ("Ice")) - { - defaults->DamageType = NAME_Ice; - } - else if (SC_Compare ("Fire")) - { - defaults->DamageType = NAME_Fire; - } else { - SC_ScriptError ("Unknown damage type \"%s\"", sc_String); + defaults->DamageType = sc_String; } } else if (def == DEF_Projectile && SC_Compare ("Speed")) diff --git a/src/g_hexen/a_bishop.cpp b/src/g_hexen/a_bishop.cpp index c52be6f64..de027ddc2 100644 --- a/src/g_hexen/a_bishop.cpp +++ b/src/g_hexen/a_bishop.cpp @@ -102,6 +102,7 @@ IMPLEMENT_ACTOR (ABishop, Hexen, 114, 19) PROP_PainSound ("BishopPain") PROP_DeathSound ("BishopDeath") PROP_ActiveSound ("BishopActiveSounds") + PROP_Obituary("$OB_BISHOP") END_DEFAULTS void ABishop::GetExplodeParms (int &damage, int &distance, bool &hurtSource) diff --git a/src/g_hexen/a_clericboss.cpp b/src/g_hexen/a_clericboss.cpp index 6dd95dc2d..35d7d8fc4 100644 --- a/src/g_hexen/a_clericboss.cpp +++ b/src/g_hexen/a_clericboss.cpp @@ -109,6 +109,7 @@ IMPLEMENT_ACTOR (AClericBoss, Hexen, 10101, 0) PROP_PainSound ("PlayerClericPain") PROP_DeathSound ("PlayerClericCrazyDeath") + PROP_Obituary ("$OB_CBOSS") END_DEFAULTS //============================================================================ diff --git a/src/g_hexen/a_dragon.cpp b/src/g_hexen/a_dragon.cpp index 81b6b6883..f3bb88885 100644 --- a/src/g_hexen/a_dragon.cpp +++ b/src/g_hexen/a_dragon.cpp @@ -89,6 +89,7 @@ IMPLEMENT_ACTOR (ADragon, Hexen, 254, 0) PROP_PainSound ("DragonPain") PROP_DeathSound ("DragonDeath") PROP_ActiveSound ("DragonActive") + PROP_Obituary ("$OB_DRAGON") END_DEFAULTS diff --git a/src/g_hexen/a_fighterboss.cpp b/src/g_hexen/a_fighterboss.cpp index f5e97d9cd..b51b24dd5 100644 --- a/src/g_hexen/a_fighterboss.cpp +++ b/src/g_hexen/a_fighterboss.cpp @@ -103,6 +103,7 @@ IMPLEMENT_ACTOR (AFighterBoss, Hexen, 10100, 0) PROP_PainSound ("PlayerFighterPain") PROP_DeathSound ("PlayerFighterCrazyDeath") + PROP_Obituary ("$OB_FBOSS") END_DEFAULTS void A_FighterAttack (AActor *actor) diff --git a/src/g_hexen/a_firedemon.cpp b/src/g_hexen/a_firedemon.cpp index 1dccfbd7f..c42baa18b 100644 --- a/src/g_hexen/a_firedemon.cpp +++ b/src/g_hexen/a_firedemon.cpp @@ -109,6 +109,7 @@ IMPLEMENT_ACTOR (AFireDemon, Hexen, 10060, 5) PROP_PainSound ("FireDemonPain") PROP_DeathSound ("FireDemonDeath") PROP_ActiveSound ("FireDemonActive") + PROP_Obituary("$OB_FIREDEMON") END_DEFAULTS // AFireDemonSplotch1 ------------------------------------------------------- diff --git a/src/g_hexen/a_heresiarch.cpp b/src/g_hexen/a_heresiarch.cpp index 1a1cbf2d5..39005401e 100644 --- a/src/g_hexen/a_heresiarch.cpp +++ b/src/g_hexen/a_heresiarch.cpp @@ -145,6 +145,7 @@ IMPLEMENT_ACTOR (AHeresiarch, Hexen, 10080, 0) PROP_PainSound ("SorcererPain") PROP_DeathSound ("SorcererDeathScream") PROP_ActiveSound ("SorcererActive") + PROP_Obituary ("$OB_HERESIARCH") END_DEFAULTS void AHeresiarch::Serialize (FArchive &arc) diff --git a/src/g_hexen/a_iceguy.cpp b/src/g_hexen/a_iceguy.cpp index 34827917f..ae5d64b82 100644 --- a/src/g_hexen/a_iceguy.cpp +++ b/src/g_hexen/a_iceguy.cpp @@ -75,6 +75,7 @@ IMPLEMENT_ACTOR (AIceGuy, Hexen, 8020, 20) PROP_SeeSound ("IceGuySight") PROP_AttackSound ("IceGuyAttack") PROP_ActiveSound ("IceGuyActive") + PROP_Obituary("$OB_ICEGUY") END_DEFAULTS void AIceGuy::Deactivate (AActor *activator) diff --git a/src/g_hexen/a_korax.cpp b/src/g_hexen/a_korax.cpp index 4e56dbf23..af56f9217 100644 --- a/src/g_hexen/a_korax.cpp +++ b/src/g_hexen/a_korax.cpp @@ -170,6 +170,7 @@ IMPLEMENT_ACTOR (AKorax, Hexen, 10200, 0) PROP_PainSound ("KoraxPain") PROP_DeathSound ("KoraxDeath") PROP_ActiveSound ("KoraxActive") + PROP_Obituary ("$OB_KORAX") END_DEFAULTS // Korax Spirit ------------------------------------------------------------- diff --git a/src/g_hexen/a_mageboss.cpp b/src/g_hexen/a_mageboss.cpp index e5456aafd..e45c47375 100644 --- a/src/g_hexen/a_mageboss.cpp +++ b/src/g_hexen/a_mageboss.cpp @@ -104,6 +104,7 @@ IMPLEMENT_ACTOR (AMageBoss, Hexen, 10102, 0) PROP_PainSound ("PlayerMagePain") PROP_DeathSound ("PlayerMageCrazyDeath") + PROP_Obituary ("$OB_MBOSS") END_DEFAULTS diff --git a/src/g_hexen/a_serpent.cpp b/src/g_hexen/a_serpent.cpp index 2cc06c731..949c3f439 100644 --- a/src/g_hexen/a_serpent.cpp +++ b/src/g_hexen/a_serpent.cpp @@ -166,6 +166,7 @@ IMPLEMENT_ACTOR (ASerpent, Hexen, 121, 6) PROP_AttackSound ("SerpentAttack") PROP_PainSound ("SerpentPain") PROP_DeathSound ("SerpentDeath") + PROP_HitObituary("$OB_SERPENTHIT") END_DEFAULTS void ASerpent::Serialize (FArchive &arc) @@ -185,6 +186,7 @@ public: IMPLEMENT_STATELESS_ACTOR (ASerpentLeader, Hexen, 120, 7) PROP_Mass (200) + PROP_Obituary("$OB_SERPENT") END_DEFAULTS void ASerpentLeader::BeginPlay () diff --git a/src/g_hexen/a_wraith.cpp b/src/g_hexen/a_wraith.cpp index 50f708a98..b382ebb56 100644 --- a/src/g_hexen/a_wraith.cpp +++ b/src/g_hexen/a_wraith.cpp @@ -118,6 +118,8 @@ IMPLEMENT_ACTOR (AWraith, Hexen, 34, 8) PROP_PainSound ("WraithPain") PROP_DeathSound ("WraithDeath") PROP_ActiveSound ("WraithActive") + PROP_HitObituary("$OB_WRAITHHIT") + PROP_Obituary("$OB_WRAITH") END_DEFAULTS // Buried wraith ------------------------------------------------------------ diff --git a/src/g_strife/a_acolyte.cpp b/src/g_strife/a_acolyte.cpp index 82533342d..c9ab8ca8a 100644 --- a/src/g_strife/a_acolyte.cpp +++ b/src/g_strife/a_acolyte.cpp @@ -113,6 +113,7 @@ IMPLEMENT_ACTOR (AAcolyte, Strife, -1, 0) PROP_AttackSound ("acolyte/rifle") PROP_DeathSound ("acolyte/death") PROP_ActiveSound ("acolyte/active") + PROP_Obituary ("$OB_ACOLYTE") END_DEFAULTS // Acolyte 1 ---------------------------------------------------------------- diff --git a/src/g_strife/a_alienspectres.cpp b/src/g_strife/a_alienspectres.cpp index dc6fe30e9..dc6249bfc 100644 --- a/src/g_strife/a_alienspectres.cpp +++ b/src/g_strife/a_alienspectres.cpp @@ -355,11 +355,6 @@ void A_SpawnSpectre1 (AActor *actor) GenericSpectreSpawn (actor, RUNTIME_CLASS(AAlienSpectre1)); } -void A_SpawnSpectre2 (AActor *actor) -{ - GenericSpectreSpawn (actor, RUNTIME_CLASS(AAlienSpectre2)); -} - void A_SpawnSpectre3 (AActor *actor) { GenericSpectreSpawn (actor, RUNTIME_CLASS(AAlienSpectre3)); diff --git a/src/g_strife/a_crusader.cpp b/src/g_strife/a_crusader.cpp index 6cdfe81af..fcd94cc8d 100644 --- a/src/g_strife/a_crusader.cpp +++ b/src/g_strife/a_crusader.cpp @@ -96,6 +96,7 @@ IMPLEMENT_ACTOR (ACrusader, Strife, 3005, 0) PROP_PainSound ("crusader/pain") PROP_DeathSound ("crusader/death") PROP_ActiveSound ("crusader/active") + PROP_Obituary ("$OB_CRUSADER") END_DEFAULTS // Fast Flame Projectile (used by Crusader) --------------------------------- diff --git a/src/g_strife/a_entityboss.cpp b/src/g_strife/a_entityboss.cpp index 125f44538..762a2983e 100644 --- a/src/g_strife/a_entityboss.cpp +++ b/src/g_strife/a_entityboss.cpp @@ -165,6 +165,7 @@ IMPLEMENT_ACTOR (AEntityBoss, Strife, 128, 0) PROP_PainSound ("entity/pain") PROP_DeathSound ("entity/death") PROP_ActiveSound ("entity/active") + PROP_Obituary ("$OB_ENTITY") END_DEFAULTS void AEntityBoss::Serialize (FArchive &arc) @@ -269,6 +270,7 @@ IMPLEMENT_ACTOR (AEntitySecond, Strife, -1, 0) PROP_PainSound ("alienspectre/pain") PROP_DeathSound ("alienspectre/death") PROP_ActiveSound ("alienspectre/active") + PROP_Obituary ("$OB_ENTITY") END_DEFAULTS void AEntitySecond::Touch (AActor *toucher) diff --git a/src/g_strife/a_inquisitor.cpp b/src/g_strife/a_inquisitor.cpp index 77f07d0cf..a96b0166e 100644 --- a/src/g_strife/a_inquisitor.cpp +++ b/src/g_strife/a_inquisitor.cpp @@ -106,6 +106,7 @@ IMPLEMENT_ACTOR (AInquisitor, Strife, 16, 0) PROP_SeeSound ("inquisitor/sight") PROP_DeathSound ("inquisitor/death") PROP_ActiveSound ("inquisitor/active") + PROP_Obituary ("$OB_INQUISITOR") END_DEFAULTS // Inquisitor Shot ---------------------------------------------------------- diff --git a/src/g_strife/a_loremaster.cpp b/src/g_strife/a_loremaster.cpp index ba43fdbe0..21e54f524 100644 --- a/src/g_strife/a_loremaster.cpp +++ b/src/g_strife/a_loremaster.cpp @@ -100,6 +100,7 @@ IMPLEMENT_ACTOR (ALoremaster, Strife, 12, 0) PROP_PainSound ("loremaster/pain") PROP_DeathSound ("loremaster/death") PROP_ActiveSound ("loremaster/active") + PROP_Obituary ("$OB_LOREMASTER") END_DEFAULTS diff --git a/src/g_strife/a_macil.cpp b/src/g_strife/a_macil.cpp index 3482b5a7a..6a3e8d1fb 100644 --- a/src/g_strife/a_macil.cpp +++ b/src/g_strife/a_macil.cpp @@ -99,6 +99,7 @@ IMPLEMENT_ACTOR (AMacil1, Strife, 64, 0) PROP_PainSound ("macil/pain") PROP_ActiveSound ("macil/active") PROP_Tag ("MACIL") + PROP_Obituary ("$OB_MACIL") END_DEFAULTS //============================================================================ diff --git a/src/g_strife/a_programmer.cpp b/src/g_strife/a_programmer.cpp index 12b59dc1a..3904df836 100644 --- a/src/g_strife/a_programmer.cpp +++ b/src/g_strife/a_programmer.cpp @@ -102,6 +102,7 @@ IMPLEMENT_ACTOR (AProgrammer, Strife, 71, 0) PROP_PainSound ("programmer/pain") PROP_DeathSound ("programmer/death") PROP_ActiveSound ("programmer/active") + PROP_Obituary ("$OB_PROGRAMMER") END_DEFAULTS //============================================================================ diff --git a/src/g_strife/a_reaver.cpp b/src/g_strife/a_reaver.cpp index d0cd1fdfb..7b4305384 100644 --- a/src/g_strife/a_reaver.cpp +++ b/src/g_strife/a_reaver.cpp @@ -104,6 +104,8 @@ IMPLEMENT_ACTOR (AReaver, Strife, 3001, 0) PROP_PainSound ("reaver/pain") PROP_DeathSound ("reaver/death") PROP_ActiveSound ("reaver/active") + PROP_HitObituary ("$OB_REAVERHIT") + PROP_Obituary ("$OB_REAVER") END_DEFAULTS void A_ReaverMelee (AActor *self) diff --git a/src/g_strife/a_rebels.cpp b/src/g_strife/a_rebels.cpp index 3b785693d..a167a67f3 100644 --- a/src/g_strife/a_rebels.cpp +++ b/src/g_strife/a_rebels.cpp @@ -102,6 +102,7 @@ IMPLEMENT_ACTOR (ARebel, Strife, -1, 0) PROP_PainSound ("rebel/pain") PROP_DeathSound ("rebel/death") PROP_ActiveSound ("rebel/active") + PROP_Obituary ("$OB_REBEL") END_DEFAULTS //============================================================================ diff --git a/src/g_strife/a_sentinel.cpp b/src/g_strife/a_sentinel.cpp index a33c29e63..a1fc5e78a 100644 --- a/src/g_strife/a_sentinel.cpp +++ b/src/g_strife/a_sentinel.cpp @@ -70,6 +70,7 @@ IMPLEMENT_ACTOR (ASentinel, Strife, 3006, 0) PROP_SeeSound ("sentinel/sight") PROP_DeathSound ("sentinel/death") PROP_ActiveSound ("sentinel/active") + PROP_Obituary ("$OB_SENTINEL") END_DEFAULTS // Sentinel FX 1 ------------------------------------------------------------ diff --git a/src/g_strife/a_spectral.cpp b/src/g_strife/a_spectral.cpp index aa63b2fef..442cf39a5 100644 --- a/src/g_strife/a_spectral.cpp +++ b/src/g_strife/a_spectral.cpp @@ -302,3 +302,61 @@ void A_201fc (AActor *self) flash->momz = -18*FRACUNIT; flash->health = self->health; } + +// In Strife, this number is stored in the data segment, but it doesn't seem to be +// altered anywhere. +#define TRACEANGLE (0xe000000) + +void A_Tracer2 (AActor *self) +{ + AActor *dest; + angle_t exact; + fixed_t dist; + fixed_t slope; + + dest = self->tracer; + + if (dest == NULL || dest->health <= 0) + return; + + // change angle + exact = R_PointToAngle2 (self->x, self->y, dest->x, dest->y); + + if (exact != self->angle) + { + if (exact - self->angle > 0x80000000) + { + self->angle -= TRACEANGLE; + if (exact - self->angle < 0x80000000) + self->angle = exact; + } + else + { + self->angle += TRACEANGLE; + if (exact - self->angle > 0x80000000) + self->angle = exact; + } + } + + exact = self->angle >> ANGLETOFINESHIFT; + self->momx = FixedMul (self->Speed, finecosine[exact]); + self->momy = FixedMul (self->Speed, finesine[exact]); + + // change slope + dist = P_AproxDistance (dest->x - self->x, dest->y - self->y); + dist /= self->Speed; + + if (dist < 1) + { + dist = 1; + } + slope = (dest->z + 40*FRACUNIT - self->z) / dist; + if (slope < self->momz) + { + self->momz -= FRACUNIT/8; + } + else + { + self->momz += FRACUNIT/8; + } +} diff --git a/src/g_strife/a_stalker.cpp b/src/g_strife/a_stalker.cpp index e9a7d1a44..ddcbf2f60 100644 --- a/src/g_strife/a_stalker.cpp +++ b/src/g_strife/a_stalker.cpp @@ -103,6 +103,7 @@ IMPLEMENT_ACTOR (AStalker, Strife, 186, 0) PROP_PainSound ("stalker/pain") PROP_DeathSound ("stalker/death") PROP_ActiveSound ("stalker/active") + PROP_HitObituary ("$OB_STALKER") END_DEFAULTS void A_StalkerChaseDecide (AActor *self) diff --git a/src/g_strife/a_strifebishop.cpp b/src/g_strife/a_strifebishop.cpp deleted file mode 100644 index 7f1b3a8c1..000000000 --- a/src/g_strife/a_strifebishop.cpp +++ /dev/null @@ -1,212 +0,0 @@ -#include "actor.h" -#include "p_enemy.h" -#include "a_action.h" -#include "s_sound.h" -#include "p_local.h" - -void A_TossGib (AActor *); - -// Bishop ------------------------------------------------------------------- - -void A_SBishopAttack (AActor *); -void A_SpawnSpectre2 (AActor *); - -class AStrifeBishop : public AActor -{ - DECLARE_ACTOR (AStrifeBishop, AActor) -public: - void GetExplodeParms (int &damage, int &dist, bool &hurtSource) - { - damage = dist = 64; - } - void NoBlockingSet () - { - P_DropItem (this, "CrateOfMissiles", 20, 256); - } -}; - -FState AStrifeBishop::States[] = -{ -#define S_BISHOP_STND 0 - S_NORMAL (MLDR, 'A', 10, A_Look, &States[S_BISHOP_STND]), - -#define S_BISHOP_RUN (S_BISHOP_STND+1) - S_NORMAL (MLDR, 'A', 3, A_Chase, &States[S_BISHOP_RUN+1]), - S_NORMAL (MLDR, 'A', 3, A_Chase, &States[S_BISHOP_RUN+2]), - S_NORMAL (MLDR, 'B', 3, A_Chase, &States[S_BISHOP_RUN+3]), - S_NORMAL (MLDR, 'B', 3, A_Chase, &States[S_BISHOP_RUN+4]), - S_NORMAL (MLDR, 'C', 3, A_Chase, &States[S_BISHOP_RUN+5]), - S_NORMAL (MLDR, 'C', 3, A_Chase, &States[S_BISHOP_RUN+6]), - S_NORMAL (MLDR, 'D', 3, A_Chase, &States[S_BISHOP_RUN+7]), - S_NORMAL (MLDR, 'D', 3, A_Chase, &States[S_BISHOP_RUN]), - -#define S_BISHOP_ATK (S_BISHOP_RUN+8) - S_NORMAL (MLDR, 'E', 3, A_FaceTarget, &States[S_BISHOP_ATK+1]), - S_BRIGHT (MLDR, 'F', 2, A_SBishopAttack, &States[S_BISHOP_RUN]), - -#define S_BISHOP_PAIN (S_BISHOP_ATK+2) - S_NORMAL (MLDR, 'D', 1, A_Pain, &States[S_BISHOP_RUN]), - -#define S_BISHOP_DIE (S_BISHOP_PAIN+1) - S_BRIGHT (MLDR, 'G', 3, NULL, &States[S_BISHOP_DIE+1]), - S_BRIGHT (MLDR, 'H', 5, A_Scream, &States[S_BISHOP_DIE+2]), - S_BRIGHT (MLDR, 'I', 4, A_TossGib, &States[S_BISHOP_DIE+3]), - S_BRIGHT (MLDR, 'J', 4, A_ExplodeAndAlert, &States[S_BISHOP_DIE+4]), - S_BRIGHT (MLDR, 'K', 4, NULL, &States[S_BISHOP_DIE+5]), - S_BRIGHT (MLDR, 'L', 4, NULL, &States[S_BISHOP_DIE+6]), - S_BRIGHT (MLDR, 'M', 4, A_NoBlocking, &States[S_BISHOP_DIE+7]), - S_BRIGHT (MLDR, 'N', 4, NULL, &States[S_BISHOP_DIE+8]), - S_BRIGHT (MLDR, 'O', 4, A_TossGib, &States[S_BISHOP_DIE+9]), - S_BRIGHT (MLDR, 'P', 4, NULL, &States[S_BISHOP_DIE+10]), - S_BRIGHT (MLDR, 'Q', 4, A_TossGib, &States[S_BISHOP_DIE+11]), - S_BRIGHT (MLDR, 'R', 4, NULL, &States[S_BISHOP_DIE+12]), - S_BRIGHT (MLDR, 'S', 4, A_TossGib, &States[S_BISHOP_DIE+13]), - S_BRIGHT (MLDR, 'T', 4, NULL, &States[S_BISHOP_DIE+14]), - S_BRIGHT (MLDR, 'U', 4, A_TossGib, &States[S_BISHOP_DIE+15]), - S_BRIGHT (MLDR, 'V', 4, A_SpawnSpectre2, NULL), -}; - -IMPLEMENT_ACTOR (AStrifeBishop, Strife, 187, 0) - PROP_SpawnState (S_BISHOP_STND) - PROP_SeeState (S_BISHOP_RUN) - PROP_PainState (S_BISHOP_PAIN) - PROP_MissileState (S_BISHOP_ATK) - PROP_DeathState (S_BISHOP_DIE) - - PROP_SpawnHealth (500) - PROP_PainChance (128) - PROP_SpeedFixed (8) - PROP_RadiusFixed (40) - PROP_HeightFixed (56) - PROP_Mass (500) - PROP_Flags (MF_SOLID|MF_SHOOTABLE|MF_NOBLOOD|MF_COUNTKILL|MF_NOTDMATCH) - PROP_Flags2 (MF2_FLOORCLIP|MF2_PASSMOBJ|MF2_PUSHWALL|MF2_MCROSS) - PROP_Flags4 (MF4_INCOMBAT|MF4_FIRERESIST|MF4_NOICEDEATH) - PROP_MinMissileChance (150) - PROP_MaxDropOffHeight (32) - PROP_StrifeType (64) - PROP_SeeSound ("bishop/sight") - PROP_PainSound ("bishop/pain") - PROP_DeathSound ("bishop/death") - PROP_ActiveSound ("bishop/active") -END_DEFAULTS - -// The Bishop's missile ----------------------------------------------------- - -void A_RocketInFlight (AActor *); -void A_Tracer2 (AActor *); - -class ABishopMissile : public AActor -{ - DECLARE_ACTOR (ABishopMissile, AActor) -public: - void PreExplode () - { - RenderStyle = STYLE_Add; - S_StopSound (this, CHAN_VOICE); - } - void GetExplodeParms (int &damage, int &dist, bool &hurtSource) - { - damage = dist = 64; - } -}; - -FState ABishopMissile::States[] = -{ - S_BRIGHT (MISS, 'A', 4, A_RocketInFlight, &States[1]), - S_BRIGHT (MISS, 'B', 3, A_Tracer2, &States[0]), - - S_BRIGHT (SMIS, 'A', 5, A_ExplodeAndAlert, &States[3]), - S_BRIGHT (SMIS, 'B', 5, NULL, &States[4]), - S_BRIGHT (SMIS, 'C', 4, NULL, &States[5]), - S_BRIGHT (SMIS, 'D', 2, NULL, &States[6]), - S_BRIGHT (SMIS, 'E', 2, NULL, &States[7]), - S_BRIGHT (SMIS, 'F', 2, NULL, &States[8]), - S_BRIGHT (SMIS, 'G', 2, NULL, NULL), -}; - -IMPLEMENT_ACTOR (ABishopMissile, Strife, -1, 0) - PROP_SpawnState (0) - PROP_DeathState (2) - PROP_SpeedFixed (20) - PROP_RadiusFixed (10) - PROP_HeightFixed (14) - PROP_Damage (10) - PROP_Flags (MF_NOBLOCKMAP|MF_NOGRAVITY|MF_DROPOFF|MF_MISSILE) - PROP_Flags2 (MF2_NOTELEPORT|MF2_PCROSS|MF2_IMPACT|MF2_SEEKERMISSILE) - PROP_Flags4 (MF4_STRIFEDAMAGE) - PROP_MaxStepHeight (4) - PROP_SeeSound ("bishop/misl") - PROP_DeathSound ("bishop/mislx") -END_DEFAULTS - -void A_SBishopAttack (AActor *self) -{ - if (self->target != NULL) - { - AActor *missile = P_SpawnMissileZ (self, self->z + 64*FRACUNIT, self->target, RUNTIME_CLASS(ABishopMissile)); - - if (missile != NULL) - { - missile->tracer = self->target; - } - } -} - -// In Strife, this number is stored in the data segment, but it doesn't seem to be -// altered anywhere. -#define TRACEANGLE (0xe000000) - -void A_Tracer2 (AActor *self) -{ - AActor *dest; - angle_t exact; - fixed_t dist; - fixed_t slope; - - dest = self->tracer; - - if (dest == NULL || dest->health <= 0) - return; - - // change angle - exact = R_PointToAngle2 (self->x, self->y, dest->x, dest->y); - - if (exact != self->angle) - { - if (exact - self->angle > 0x80000000) - { - self->angle -= TRACEANGLE; - if (exact - self->angle < 0x80000000) - self->angle = exact; - } - else - { - self->angle += TRACEANGLE; - if (exact - self->angle > 0x80000000) - self->angle = exact; - } - } - - exact = self->angle >> ANGLETOFINESHIFT; - self->momx = FixedMul (self->Speed, finecosine[exact]); - self->momy = FixedMul (self->Speed, finesine[exact]); - - // change slope - dist = P_AproxDistance (dest->x - self->x, dest->y - self->y); - dist /= self->Speed; - - if (dist < 1) - { - dist = 1; - } - slope = (dest->z + 40*FRACUNIT - self->z) / dist; - if (slope < self->momz) - { - self->momz -= FRACUNIT/8; - } - else - { - self->momz += FRACUNIT/8; - } -} diff --git a/src/g_strife/a_templar.cpp b/src/g_strife/a_templar.cpp index 98fb92119..ad375d18c 100644 --- a/src/g_strife/a_templar.cpp +++ b/src/g_strife/a_templar.cpp @@ -100,6 +100,8 @@ IMPLEMENT_ACTOR (ATemplar, Strife, 3003, 0) PROP_DeathSound ("templar/death") PROP_ActiveSound ("templar/active") PROP_Tag ("TEMPLAR") // Known as "Enforcer" in earlier versions. + PROP_HitObituary ("$OB_TEMPLARHIT") + PROP_Obituary ("$OB_TEMPLAR") END_DEFAULTS //============================================================================ diff --git a/src/namedef.h b/src/namedef.h index 75513b530..a08a6781c 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -209,6 +209,9 @@ xx(WaterLevel) xx(X) xx(Y) xx(Z) +xx(MomX) +xx(MomY) +xx(MomZ) // Various actor names which are used internally xx(MapSpot) diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index abf59208a..1d5e198b3 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -513,7 +513,7 @@ void DoJumpIfInventory(AActor * self, AActor * owner) { FState * CallingState; int index=CheckIndex(3, &CallingState); - if (index<0 || owner == NULL) return; + if (index<0) return; ENamedName ItemType=(ENamedName)StateParameters[index]; int ItemAmount = EvalExpressionI (StateParameters[index+1], self); @@ -522,7 +522,7 @@ void DoJumpIfInventory(AActor * self, AActor * owner) if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! - if (!Type) return; + if (!Type || owner == NULL) return; AInventory * Item=owner->FindInventory(Type); @@ -911,12 +911,13 @@ void A_JumpIfNoAmmo(AActor * self) { FState * CallingState; int index=CheckIndex(1, &CallingState); - if (index<0 || !self->player || !self->player->ReadyWeapon) return; // only for weapons! + + if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! + if (index<0 || !self->player || !self->player->ReadyWeapon || pStateCall != NULL) return; // only for weapons! if (!self->player->ReadyWeapon->CheckAmmo(self->player->ReadyWeapon->bAltFire, false, true)) DoJump(self, CallingState, StateParameters[index]); - if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! } @@ -1294,7 +1295,7 @@ void A_TakeFromTarget(AActor * self) // //=========================================================================== -static void InitSpawnedItem(AActor *self, AActor *mo, INTBOOL transfer_translation, INTBOOL setmaster) +static void InitSpawnedItem(AActor *self, AActor *mo, INTBOOL transfer_translation, INTBOOL setmaster, INTBOOL nocheckpos) { if (mo) { @@ -1310,12 +1311,12 @@ static void InitSpawnedItem(AActor *self, AActor *mo, INTBOOL transfer_translati if (mo->flags3&MF3_ISMONSTER) { - if (!P_TestMobjLocation(mo)) + if (!nocheckpos && !P_TestMobjLocation(mo)) { // The monster is blocked so don't spawn it at all! if (mo->CountsAsKill()) level.total_monsters--; mo->Destroy(); - if (pStateCall != NULL) pStateCall->Result=false; // for an inventory iten's use state + if (pStateCall != NULL) pStateCall->Result=false; // for an inventory item's use state return; } else if (originator) @@ -1402,7 +1403,7 @@ void A_SpawnItem(AActor * self) self->y + FixedMul(distance, finesine[self->angle>>ANGLETOFINESHIFT]), self->z - self->floorclip + zheight, ALLOW_REPLACE); - InitSpawnedItem(self, mo, transfer_translation, useammo); + InitSpawnedItem(self, mo, transfer_translation, useammo, false); } //=========================================================================== @@ -1418,7 +1419,8 @@ enum SIX_Flags SIXF_ABSOLUTEPOSITION=2, SIXF_ABSOLUTEANGLE=4, SIXF_ABSOLUTEMOMENTUM=8, - SIXF_SETMASTER=16 + SIXF_SETMASTER=16, + SIXF_NOCHECKPOSITION=32 }; void A_SpawnItemEx(AActor * self) @@ -1480,7 +1482,7 @@ void A_SpawnItemEx(AActor * self) } AActor * mo = Spawn( missile, x, y, self->z + self->floorclip + zofs, ALLOW_REPLACE); - InitSpawnedItem(self, mo, (flags & SIXF_TRANSFERTRANSLATION), (flags&SIXF_SETMASTER)); + InitSpawnedItem(self, mo, (flags & SIXF_TRANSFERTRANSLATION), (flags&SIXF_SETMASTER), (flags&SIXF_NOCHECKPOSITION)); if (mo) { mo->momx=xmom; @@ -1712,14 +1714,20 @@ void A_SpawnDebris(AActor * self) AActor * mo; const PClass * debris; - int index=CheckIndex(2, NULL); + int index=CheckIndex(4, NULL); if (index<0) return; - INTBOOL transfer_translation = EvalExpressionI (StateParameters[index+1], self); - debris = PClass::FindClass((ENamedName)StateParameters[index]); if (debris == NULL) return; + INTBOOL transfer_translation = EvalExpressionI (StateParameters[index+1], self); + fixed_t mult_h = fixed_t(EvalExpressionF (StateParameters[index], self) * FRACUNIT); + fixed_t mult_v = fixed_t(EvalExpressionF (StateParameters[index], self) * FRACUNIT); + + // only positive values make sense here + if (mult_v<=0) mult_v=FRACUNIT; + if (mult_h<=0) mult_h=FRACUNIT; + for (i = 0; i < GetDefaultByType(debris)->health; i++) { mo = Spawn(debris, self->x+((pr_spawndebris()-128)<<12), @@ -1732,9 +1740,9 @@ void A_SpawnDebris(AActor * self) if (mo && i < mo->GetClass()->ActorInfo->NumOwnedStates) { mo->SetState (mo->GetClass()->ActorInfo->OwnedStates + i); - mo->momz = ((pr_spawndebris()&7)+5)*FRACUNIT; - mo->momx = pr_spawndebris.Random2()<<(FRACBITS-6); - mo->momy = pr_spawndebris.Random2()<<(FRACBITS-6); + mo->momz = FixedMul(mult_v, ((pr_spawndebris()&7)+5)*FRACUNIT); + mo->momx = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6)); + mo->momy = FixedMul(mult_h, pr_spawndebris.Random2()<<(FRACBITS-6)); } } } @@ -1748,6 +1756,8 @@ void A_SpawnDebris(AActor * self) //=========================================================================== void A_CheckSight(AActor * self) { + if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! + for (int i=0;i=0) DoJump(self, CallingState, StateParameters[index]); - if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! } @@ -1839,11 +1848,11 @@ void A_JumpIf(AActor * self) FState * CallingState; int index=CheckIndex(2, &CallingState); if (index<0) return; - int expression = EvalExpressionI (StateParameters[index], self); - - if (index>=0 && expression) DoJump(self, CallingState, StateParameters[index+1]); + INTBOOL expression = EvalExpressionI (StateParameters[index], self); if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! + if (expression) DoJump(self, CallingState, StateParameters[index+1]); + } //=========================================================================== @@ -1971,12 +1980,12 @@ void A_CheckFloor (AActor *self) FState *CallingState; int index = CheckIndex (1, &CallingState); + if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! if (self->z <= self->floorz && index >= 0) { DoJump (self, CallingState, StateParameters[index]); } - if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! } //=========================================================================== @@ -2039,6 +2048,7 @@ void A_Respawn (AActor *actor) void A_PlayerSkinCheck (AActor *actor) { + if (pStateCall != NULL) pStateCall->Result=false; // Jumps should never set the result for inventory state chains! if (actor->player != NULL && skins[actor->player->userinfo.skin].othergame) { diff --git a/src/thingdef_exp.cpp b/src/thingdef_exp.cpp index 3a0a5ddf8..eb3e1e15f 100644 --- a/src/thingdef_exp.cpp +++ b/src/thingdef_exp.cpp @@ -223,6 +223,30 @@ ExpVal GetZ (AActor *actor, int id) return val; } +ExpVal GetMomX (AActor *actor, int id) +{ + ExpVal val; + val.Type = VAL_Float; + val.Float = FIXED2FLOAT (actor->momx); + return val; +} + +ExpVal GetMomY (AActor *actor, int id) +{ + ExpVal val; + val.Type = VAL_Float; + val.Float = FIXED2FLOAT (actor->momy); + return val; +} + +ExpVal GetMomZ (AActor *actor, int id) +{ + ExpVal val; + val.Type = VAL_Float; + val.Float = FIXED2FLOAT (actor->momz); + return val; +} + static struct FExpVar { ENamedName name; // identifier @@ -243,6 +267,9 @@ static struct FExpVar { NAME_X, 0, GetX }, { NAME_Y, 0, GetY }, { NAME_Z, 0, GetZ }, + { NAME_MomX, 0, GetMomX }, + { NAME_MomY, 0, GetMomY }, + { NAME_MomZ, 0, GetMomZ }, }; struct ExpData; diff --git a/tools/updaterevision/updaterevision.vcproj b/tools/updaterevision/updaterevision.vcproj index 88f4a5197..f39914dca 100644 --- a/tools/updaterevision/updaterevision.vcproj +++ b/tools/updaterevision/updaterevision.vcproj @@ -1,7 +1,7 @@ spawntype, optional eval bool transfer_translation); + action native A_SpawnDebris(class spawntype, optional eval bool transfer_translation, optional eval float mult_h, optional eval float mult_v); action native A_CheckSight(state label); action native A_ExtChase(eval bool usemelee, eval bool usemissile, optional evalnot bool playactive, optional eval bool nightmarefast); action native A_DropInventory(class itemtype); @@ -150,6 +150,7 @@ class Actor extends Thinker action native A_CheckFloor(state label); action native A_PlayerSkinCheck(state label); action native A_BasicAttack(int meleedamage, sound meleesound, class missiletype, float missileheight); + action native A_ThrowGrenade(class itemtype, optional eval float zheight, optional eval float xymom, optional eval float zmom, optional evalnot bool useammo); action native A_Recoil(eval float xymom); action native A_JumpIfInTargetInventory(class itemtype, eval int amount, state label); @@ -201,5 +202,4 @@ class Inventory extends Actor action native A_CheckReload(); action native A_GunFlash(); action native A_Saw(optional coerce sound fullsound, optional coerce sound hitsound, optional eval int damage, optional class pufftype); - action native A_ThrowGrenade(class itemtype, optional eval float zheight, optional eval float xymom, optional eval float zmom, optional evalnot bool useammo); } diff --git a/wadsrc/decorate/strife/beggars.txt b/wadsrc/decorate/strife/beggars.txt index 318fd844e..8820f32d0 100644 --- a/wadsrc/decorate/strife/beggars.txt +++ b/wadsrc/decorate/strife/beggars.txt @@ -16,6 +16,7 @@ ACTOR Beggar : StrifeHumanoid Tag "Beggar" MaxStepHeight 16 MaxDropoffHeight 32 + HitObituary "$OB_BEGGAR" AttackSound "beggar/attack" PainSound "beggar/pain" diff --git a/wadsrc/decorate/strife/peasants.txt b/wadsrc/decorate/strife/peasants.txt index 05b824338..c0e988558 100644 --- a/wadsrc/decorate/strife/peasants.txt +++ b/wadsrc/decorate/strife/peasants.txt @@ -19,6 +19,7 @@ ACTOR Peasant : StrifeHumanoid AttackSound "peasant/attack" PainSound "peasant/pain" DeathSound "peasant/death" + HitObituary "$OB_PEASANT" States { Spawn: diff --git a/wadsrc/decorate/strife/strifebishop.txt b/wadsrc/decorate/strife/strifebishop.txt new file mode 100644 index 000000000..5f7eb5788 --- /dev/null +++ b/wadsrc/decorate/strife/strifebishop.txt @@ -0,0 +1,100 @@ + +// Bishop ------------------------------------------------------------------- + +ACTOR StrifeBishop 187 +{ + Game Strife + ConversationID 64,-1,-1 + Health 500 + Painchance 128 + Speed 8 + Radius 40 + Height 56 + Mass 500 + Monster + +NOBLOOD + +NOTDMATCH + +FLOORCLIP + +INCOMBAT + +FIRERESIST + +NOICEDEATH + MinMissileChance 150 + MaxDropoffHeight 32 + SeeSound "bishop/sight" + PainSound "bishop/pain" + DeathSound "bishop/death" + ActiveSound "bishop/active" + DropItem "CrateOfMissiles", 256, 20 + Obituary "$OB_STFBISHOP" + States + { + Spawn: + MLDR A 10 A_Look + Loop + See: + MLDR AABBCCDD 3 A_Chase + Loop + Missile: + MLDR E 3 A_FaceTarget + MLDR F 2 Bright A_CustomMissile("BishopMissile", 64, 0, 0, CMF_AIMOFFSET) + Goto See + Pain: + MLDR D 1 A_Pain + Goto See + Death: + MLDR G 3 Bright + MLDR H 5 Bright A_Scream + MLDR I 4 Bright A_TossGib + MLDR J 0 Bright A_AlertMonsters + MLDR J 4 Bright A_Explode(64,64) + MLDR KL 3 Bright + MLDR M 4 Bright A_NoBlocking + MLDR N 4 Bright + MLDR O 4 Bright A_TossGib + MLDR P 4 Bright + MLDR Q 4 Bright A_TossGib + MLDR R 4 Bright + MLDR S 4 Bright A_TossGib + MLDR T 4 Bright + MLDR U 4 Bright A_TossGib + MLDR V 4 Bright A_SpawnItemEx("AlienSpectre2", 0, 0, 0, 0, 0, random[spectrespawn](0,255)*0.0078125, 0, SXF_NOCHECKPOSITION) + Stop + } +} + + +// The Bishop's missile ----------------------------------------------------- + +ACTOR BishopMissile +{ + Speed 20 + Radius 10 + Height 14 + Damage 10 + Projectile + +SEEKERMISSILE + +STRIFEDAMAGE + MaxStepHeight 4 + SeeSound "bishop/misl" + DeathSound "bishop/mislx" + States + { + Spawn: + MISS A 4 Bright + MISS B 3 Bright A_Tracer2 + MISS A 0 Bright A_PlaySoundEx("misc/missileinflight", "Voice") + MISS A 0 Bright A_SpawnItemEx("MiniMissilePuff", 0,0, random2[BishopMissile]()*0.015625) + MISS A 4 Bright A_SpawnItemEx("RocketTrail", -momx,-momy,0, 0,0,1) + Goto Spawn+1 + Death: + SMIS A 0 Bright A_SetTranslucent(1,1) + SMIS A 0 Bright A_StopSoundEx("Voice") + SMIS A 0 Bright A_AlertMonsters + SMIS A 5 Bright A_Explode(64,64) + SMIS B 5 Bright + SMIS C 4 Bright + SMIS DEFG 2 Bright + Stop + } +} + diff --git a/wadsrc/languages/english-us.txt b/wadsrc/languages/english-us.txt index 926ee152c..9d0747f60 100644 --- a/wadsrc/languages/english-us.txt +++ b/wadsrc/languages/english-us.txt @@ -630,6 +630,48 @@ OB_SNAKE = "%o was rattled by an ophidian."; OB_WIZARD = "%o was cursed by a wizard."; OB_WIZARDHIT = "%o was palpated by a wizard."; +OB_FIREDEMON = "%o tasted an Afrit's fire."; +OB_DEMON1 = "%o was scalded by a Serpent."; +OB_DEMON2 = "%o was poisoned by a Serpent."; +OB_ETTIN = "%o was mashed by an Ettin."; +OB_CENTAUR = "%o was cut up by a Centaur."; +OB_SLAUGHTAURHIT = "%o was cut up by a Slaughtaur."; +OB_SLAUGHTAUR = "%o was struck down by a Slaughtaur's fireball."; +OB_BISHOP = "%o succumbed to a Bishop's dark power."; +OB_ICEGUY = "%o was frozen solid by a Wendigo."; +OB_SERPENTHIT = "%o was mauled by a Stalker."; +OB_SERPENT = "%o was melted by a Stalker."; +OB_WRAITH = "%o was charred by a Reiver."; +OB_WRAITHHIT = "%o had his life stolen by a Reiver."; +OB_DRAGON = "%o was incinerated by the Death Wyvern."; +OB_KORAX = "%o was swept from the board by Korax."; +OB_FBOSS = "%o was slain by Zedek."; +OB_MBOSS = "%o couldn't absorb Menelkir's Mana."; +OB_CBOSS = "%o was baptized by Traductus."; +OB_HERESIARCH = "%o had his bones rolled by the Heresiarch." + +OB_ACOLYTE = "%o was zealously shot down by an Acolyte."; +OB_MACIL = "%o should have never rebelled against Macil."; +OB_REBEL = "%o was gunned down by a Rebel."; +OB_BEGGAR = "%o was beaten to death by the poor."; +OB_PEASANT = "%o should have never picked fights with civilians." +OB_ALIENSPECTE = "%o struck down by the Spectre"; +OB_ENTITY = "%o felt the wrath of The One God."; +OB_LOREMASTER = "%o couldn't escape from the Lore Master's grasp."; +OB_PROGRAMMER = "%o was deleted by the Programmer."; +OB_STFBISHOP = "%o was blown away by the Bishop."; +OB_SENTINEL = "%o was shot down by a Sentinel."; +OB_CRUSADER = "%o was swept away by a Crusader."; +OB_INQUISITOR = "%o was sentenced by an Inquisitor."; +OB_STALKER = "%o was bugged by a Stalker."; +OB_TURRET = "%o triggered the automatic defenses."; +OB_TEMPLARHIT = "%o was clawed by a Templar."; +OB_TEMPLAR = "%o was vaporized by a Templar."; +OB_REAVERHIT = "%o was sliced open by a Reaver."; +OB_REAVER = "%o was shot down by a Reaver."; + + + OB_MPFIST = "%o chewed on %k's fist."; OB_MPCHAINSAW = "%o was mowed over by %k's chainsaw."; OB_MPPISTOL = "%o was tickled by %k's pea shooter."; diff --git a/wadsrc/zdoom.lst b/wadsrc/zdoom.lst index 72987b657..ba0b7dbc3 100644 --- a/wadsrc/zdoom.lst +++ b/wadsrc/zdoom.lst @@ -313,6 +313,7 @@ actors/hexen/demons.txt decorate/hexen/demons.txt actors/strife/beggars.txt decorate/strife/beggars.txt actors/strife/merchants.txt decorate/strife/merchants.txt actors/strife/peasants.txt decorate/strife/peasants.txt +actors/strife/strifebishop.txt decorate/strife/strifebishop.txt actors/strife/questitems.txt decorate/strife/questitems.txt actors/strife/ratbuddy.txt decorate/strife/ratbuddy.txt actors/strife/strifeammo.txt decorate/strife/strifeammo.txt diff --git a/zdoom.vcproj b/zdoom.vcproj index cd5c511cf..bc619309e 100644 --- a/zdoom.vcproj +++ b/zdoom.vcproj @@ -8592,10 +8592,6 @@ RelativePath=".\src\g_strife\a_stalker.cpp" > - -