From 47dafa3824d0115a6515f28fa4ab1e3e714fdf77 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 6 Dec 2007 08:55:17 +0000 Subject: [PATCH] - Fixed: A_PainDie and A_DualPainAttack could fail to spawn the correct actor if the first spawned one died and executed some code in its death state. - Added Karate Chris's submission for 'allowrespawn' MAPINFO option. - Added Karate Chris's submission for customizable skill confirmation text. - Fixed: Doom's statusbar only checked for primary attacks, not secondary ones when setting Doomguy's face. (Thanks to Karate Chris for the fix.) - added Skulltag's FORCEYBILLBOARD and FORCEXYBILLBOARD flags to the DECORATE parser. Even though the software renderer has no use for them it is necessary to support them so that mods can use these flags without becoming incompatible with ZDoom. SVN r576 (trunk) --- docs/rh-log.txt | 15 +++++++++++ src/actor.h | 3 +++ src/g_doom/a_painelemental.cpp | 38 ++++++++++++++++------------ src/g_doom/doom_sbar.cpp | 2 +- src/g_game.cpp | 2 +- src/g_level.cpp | 6 +++++ src/g_level.h | 4 +++ src/m_menu.cpp | 5 +++- src/thingdef/thingdef_properties.cpp | 2 ++ src/thingdef_codeptr.cpp | 1 + wadsrc/mapinfo/doomcommon.txt | 2 +- wadsrc/mapinfo/heretic.txt | 2 +- wadsrc/mapinfo/hexen.txt | 2 +- wadsrc/mapinfo/strife.txt | 2 +- 14 files changed, 63 insertions(+), 23 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 57f81422d..fa13a3ce3 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,8 +1,23 @@ +December 6, 2007 (Changes by Graf Zahl) +- Fixed: A_PainDie and A_DualPainAttack could fail to spawn the correct actor + if the first spawned one died and executed some code in its death state. + December 5, 2007 - Fixed: The Linux makefile should use the include files for the system FLAC installation, not the bundled copies which might not match what is installed. - Upgraded bundled FLAC from version 1.1.2 to version 1.2.1. +December 2, 2007 (Changes by Graf Zahl) +- Added Karate Chris's submission for 'allowrespawn' MAPINFO option. +- Added Karate Chris's submission for customizable skill confirmation text. +- Fixed: Doom's statusbar only checked for primary attacks, not secondary ones when + setting Doomguy's face. (Thanks to Karate Chris for the fix.) + +November 29, 2007 (Changes by Graf Zahl) +- added Skulltag's FORCEYBILLBOARD and FORCEXYBILLBOARD flags to the DECORATE parser. + Even though the software renderer has no use for them it is necessary to support them + so that mods can use these flags without becoming incompatible with ZDoom. + November 28, 2007 (Changes by Graf Zahl) - after looking at the most recent Vavoom update I realized that A_FastChase should not use the multi-purpose special2 as counter for strafing so I added a new variable diff --git a/src/actor.h b/src/actor.h index 60b503c00..95b1e1c67 100644 --- a/src/actor.h +++ b/src/actor.h @@ -322,6 +322,9 @@ enum RF_VOXELSPRITE = 0x3000, // Voxel object RF_INVISIBLE = 0x8000, // Don't bother drawing this actor + RF_FORCEYBILLBOARD = 0x10000, // [BB] OpenGL only: draw with y axis billboard, i.e. anchored to the floor (overrides gl_billboard_mode setting) + RF_FORCEXYBILLBOARD = 0x20000, // [BB] OpenGL only: draw with xy axis billboard, i.e. unanchored (overrides gl_billboard_mode setting) + // --- dummies for unknown/unimplemented Strife flags --- MF_STRIFEx8000000 = 0, // seems related to MF_SHADOW diff --git a/src/g_doom/a_painelemental.cpp b/src/g_doom/a_painelemental.cpp index 995b5fe13..a479eb84a 100644 --- a/src/g_doom/a_painelemental.cpp +++ b/src/g_doom/a_painelemental.cpp @@ -11,11 +11,23 @@ void A_PainDie (AActor *); void A_SkullAttack (AActor *self); +static const PClass *GetSpawnType() +{ + const PClass *spawntype = NULL; + int index=CheckIndex(1, NULL); + if (index>=0) + { + spawntype = PClass::FindClass((ENamedName)StateParameters[index]); + } + if (spawntype == NULL) spawntype = PClass::FindClass("LostSoul"); + return spawntype; +} + // // A_PainShootSkull // Spawn a lost soul and launch it at the target // -void A_PainShootSkull (AActor *self, angle_t angle) +void A_PainShootSkull (AActor *self, angle_t angle, const PClass *spawntype) { fixed_t x, y, z; @@ -23,17 +35,8 @@ void A_PainShootSkull (AActor *self, angle_t angle) angle_t an; int prestep; - const PClass *spawntype = NULL; - if (self->DamageType==NAME_Massacre) return; - int index=CheckIndex(1, NULL); - if (index>=0) - { - spawntype = PClass::FindClass((ENamedName)StateParameters[index]); - } - if (spawntype == NULL) spawntype = PClass::FindClass("LostSoul"); - // [RH] check to make sure it's not too close to the ceiling if (self->z + self->height + 8*FRACUNIT > self->ceilingz) { @@ -121,8 +124,9 @@ void A_PainAttack (AActor *self) if (!self->target) return; + const PClass *spawntype = GetSpawnType(); A_FaceTarget (self); - A_PainShootSkull (self, self->angle); + A_PainShootSkull (self, self->angle, spawntype); } void A_DualPainAttack (AActor *self) @@ -130,9 +134,10 @@ void A_DualPainAttack (AActor *self) if (!self->target) return; + const PClass *spawntype = GetSpawnType(); A_FaceTarget (self); - A_PainShootSkull (self, self->angle + ANG45); - A_PainShootSkull (self, self->angle - ANG45); + A_PainShootSkull (self, self->angle + ANG45, spawntype); + A_PainShootSkull (self, self->angle - ANG45, spawntype); } void A_PainDie (AActor *self) @@ -141,8 +146,9 @@ void A_PainDie (AActor *self) { // And I thought you were my friend! self->flags &= ~MF_FRIENDLY; } + const PClass *spawntype = GetSpawnType(); A_NoBlocking (self); - A_PainShootSkull (self, self->angle + ANG90); - A_PainShootSkull (self, self->angle + ANG180); - A_PainShootSkull (self, self->angle + ANG270); + A_PainShootSkull (self, self->angle + ANG90, spawntype); + A_PainShootSkull (self, self->angle + ANG180, spawntype); + A_PainShootSkull (self, self->angle + ANG270, spawntype); } diff --git a/src/g_doom/doom_sbar.cpp b/src/g_doom/doom_sbar.cpp index 2938ba599..e66fe6e82 100644 --- a/src/g_doom/doom_sbar.cpp +++ b/src/g_doom/doom_sbar.cpp @@ -916,7 +916,7 @@ private: if (FacePriority < 6) { // rapid firing - if ((CPlayer->cmd.ucmd.buttons & BT_ATTACK) && !(CPlayer->cheats & (CF_FROZEN | CF_TOTALLYFROZEN))) + if ((CPlayer->cmd.ucmd.buttons & (BT_ATTACK|BT_ALTATTACK)) && !(CPlayer->cheats & (CF_FROZEN | CF_TOTALLYFROZEN))) { if (FaceLastAttackDown == -1) FaceLastAttackDown = ST_RAMPAGEDELAY; diff --git a/src/g_game.cpp b/src/g_game.cpp index cd14ff666..9539ebc18 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1405,7 +1405,7 @@ static void G_QueueBody (AActor *body) // void G_DoReborn (int playernum, bool freshbot) { - if (!multiplayer) + if (!multiplayer && !(level.flags & LEVEL_ALLOWRESPAWN)) { if (BackupSaveName.Len() > 0 && FileExists (BackupSaveName.GetChars())) { // Load game from the last point it was saved diff --git a/src/g_level.cpp b/src/g_level.cpp index d5c9ff5c7..c3b79df9a 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -297,6 +297,7 @@ static const char *MapInfoMapLevel[] = "totalinfighting", "infiniteflightpowerup", "noinfiniteflightpowerup", + "allowrespawn", NULL }; @@ -437,6 +438,7 @@ MapHandlers[] = { MITYPE_SCFLAGS, LEVEL_TOTALINFIGHTING, ~LEVEL_NOINFIGHTING }, { MITYPE_SETFLAG, LEVEL_INFINITE_FLIGHT, 0 }, { MITYPE_CLRFLAG, LEVEL_INFINITE_FLIGHT, 0 }, + { MITYPE_SETFLAG, LEVEL_ALLOWRESPAWN, 0 }, }; static const char *MapInfoClusterLevel[] = @@ -3142,6 +3144,10 @@ static void ParseSkill () else if (SC_Compare("MustConfirm")) { skill.MustConfirm = true; + if (SC_CheckToken(TK_String)) + { + skill.MustConfirmText = sc_String; + } } else if (SC_Compare("Key")) { diff --git a/src/g_level.h b/src/g_level.h index c5f413509..9cd43d7d1 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -113,6 +113,8 @@ #define LEVEL_NOMONSTERS UCONST64(0x1000000000000) #define LEVEL_INFINITE_FLIGHT UCONST64(0x2000000000000) +#define LEVEL_ALLOWRESPAWN UCONST64(0x4000000000000) + struct acsdefered_s; struct FSpecialAction @@ -392,6 +394,7 @@ struct FSkillInfo SkillMenuNames MenuNamesForPlayerClass; bool MenuNameIsLump; bool MustConfirm; + FString MustConfirmText; char shortcut; int textcolor; @@ -417,6 +420,7 @@ struct FSkillInfo MenuNamesForPlayerClass = other.MenuNamesForPlayerClass; MenuNameIsLump = other.MenuNameIsLump; MustConfirm = other.MustConfirm; + MustConfirmText = other.MustConfirmText; shortcut = other.shortcut; textcolor = other.textcolor; return *this; diff --git a/src/m_menu.cpp b/src/m_menu.cpp index 605c6b813..62e235953 100644 --- a/src/m_menu.cpp +++ b/src/m_menu.cpp @@ -1741,7 +1741,10 @@ void M_ChooseSkill (int choice) { if (gameinfo.gametype == GAME_Doom && AllSkills[choice].MustConfirm) { - M_StartMessage (GStrings("NIGHTMARE"), M_VerifyNightmare, true); + const char *msg = AllSkills[choice].MustConfirmText; + if (*msg==0) msg = GStrings("NIGHTMARE"); + if (*msg=='$') msg = GStrings(msg+1); + M_StartMessage (msg, M_VerifyNightmare, true); return; } diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 396e1cf37..fbef0c7a1 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -226,6 +226,8 @@ static flagdef ActorFlags[]= DEFINE_FLAG2(FX_ROCKET, ROCKETTRAIL, AActor, effects), DEFINE_FLAG2(FX_GRENADE, GRENADETRAIL, AActor, effects), DEFINE_FLAG(RF, INVISIBLE, AActor, renderflags), + DEFINE_FLAG(RF, FORCEYBILLBOARD, AActor, renderflags), + DEFINE_FLAG(RF, FORCEXYBILLBOARD, AActor, renderflags), // Deprecated flags. Handling must be performed in HandleDeprecatedFlags DEFINE_DEPRECATED_FLAG(FIREDAMAGE, AActor, 0), diff --git a/src/thingdef_codeptr.cpp b/src/thingdef_codeptr.cpp index bc1c08a95..d6eb5c5c0 100644 --- a/src/thingdef_codeptr.cpp +++ b/src/thingdef_codeptr.cpp @@ -2041,6 +2041,7 @@ void A_Respawn (AActor *actor) { Spawn (x, y, actor->z + TELEFOGHEIGHT, ALLOW_REPLACE); } + if (actor->CountsAsKill()) level.total_monsters++; } else { diff --git a/wadsrc/mapinfo/doomcommon.txt b/wadsrc/mapinfo/doomcommon.txt index 6ade281bc..7d0f698b0 100644 --- a/wadsrc/mapinfo/doomcommon.txt +++ b/wadsrc/mapinfo/doomcommon.txt @@ -29,5 +29,5 @@ skill nightmare RespawnTime 12 SpawnFilter "Hard" PicName "M_NMARE" - MustConfirm + MustConfirm "" Key n diff --git a/wadsrc/mapinfo/heretic.txt b/wadsrc/mapinfo/heretic.txt index 2ceeaef82..5a3a549a7 100644 --- a/wadsrc/mapinfo/heretic.txt +++ b/wadsrc/mapinfo/heretic.txt @@ -25,7 +25,7 @@ skill nightmare DisableCheats SpawnFilter "Hard" Name "MNU_BLACKPLAGUE" - MustConfirm + MustConfirm "" diff --git a/wadsrc/mapinfo/hexen.txt b/wadsrc/mapinfo/hexen.txt index d106e9eb9..59b47278b 100644 --- a/wadsrc/mapinfo/hexen.txt +++ b/wadsrc/mapinfo/hexen.txt @@ -42,7 +42,7 @@ skill nightmare PlayerClassName "fighter" "MNU_TITAN" PlayerClassName "cleric" "MNU_POPE" PlayerClassName "mage" "MNU_ARCHMAGE" - MustConfirm + MustConfirm "" clusterdef 1 diff --git a/wadsrc/mapinfo/strife.txt b/wadsrc/mapinfo/strife.txt index fa98e667b..5980b2424 100644 --- a/wadsrc/mapinfo/strife.txt +++ b/wadsrc/mapinfo/strife.txt @@ -30,7 +30,7 @@ skill nightmare RespawnTime 16 SpawnFilter "Hard" PicName "M_NMARE" - MustConfirm + MustConfirm "" Key b defaultmap