diff --git a/docs/rh-log.txt b/docs/rh-log.txt index a631d1213..59654d890 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,5 @@ September 28, 2009 (Changes by Graf Zahl) +- Added BHS's death special flags submission. - Added Gez's A_Blast submission. September 27, 2009 (Changes by Graf Zahl) diff --git a/src/actor.h b/src/actor.h index b490aeade..c2b0ef1a8 100644 --- a/src/actor.h +++ b/src/actor.h @@ -442,6 +442,8 @@ enum EThingSpecialActivationType THINGSPEC_MonsterTrigger = 8, // The thing can be triggered by a monster THINGSPEC_MissileTrigger = 16, // The thing can be triggered by a projectile THINGSPEC_ClearSpecial = 32, // Clears special after successful activation + THINGSPEC_NoDeathSpecial = 64, // Don't activate special on death + THINGSPEC_TriggerActs = 128, // The trigger is the activator of the special (overrides LEVEL_ACTOWNSPECIAL Hexen hack) }; // [RH] Like msecnode_t, but for the blockmap diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index a062281f9..6b52bdd38 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -420,10 +420,16 @@ void AActor::Die (AActor *source, AActor *inflictor) // the activator of the script. // New: In Hexen, the thing that died is the activator, // so now a level flag selects who the activator gets to be. - if (special && (!(flags & MF_SPECIAL) || (flags3 & MF3_ISMONSTER))) + if (special && (!(flags & MF_SPECIAL) || (flags3 & MF3_ISMONSTER)) && !(activationtype & THINGSPEC_NoDeathSpecial)) { - LineSpecials[special] (NULL, level.flags & LEVEL_ACTOWNSPECIAL - ? this : source, false, args[0], args[1], args[2], args[3], args[4]); + // Activation flags override LEVEL_ACTOWNSPECIAL if set. + AActor *activator = (activationtype & THINGSPEC_TriggerActs ? source : + (activationtype & THINGSPEC_ThingActs ? this : (level.flags & LEVEL_ACTOWNSPECIAL ? this : source))); + if (activationtype & THINGSPEC_ThingTargets) + this->target = source; + if (activationtype & THINGSPEC_TriggerTargets) + source->target = this; + LineSpecials[special] (NULL, activator, false, args[0], args[1], args[2], args[3], args[4]); special = 0; } diff --git a/src/thingdef/thingdef_parse.cpp b/src/thingdef/thingdef_parse.cpp index a4bde9259..6d83627aa 100644 --- a/src/thingdef/thingdef_parse.cpp +++ b/src/thingdef/thingdef_parse.cpp @@ -463,6 +463,8 @@ static int ParseThingActivation (FScanner &sc) { "THINGSPEC_MonsterTrigger", THINGSPEC_MonsterTrigger}, { "THINGSPEC_MissileTrigger", THINGSPEC_MissileTrigger}, { "THINGSPEC_ClearSpecial", THINGSPEC_ClearSpecial}, + { "THINGSPEC_NoDeathSpecial", THINGSPEC_NoDeathSpecial}, + { "THINGSPEC_TriggerActs", THINGSPEC_TriggerActs}, { NULL, 0 } }; diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index a3b619a0c..033920d90 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -86,6 +86,8 @@ enum THINGSPEC_MonsterTrigger = 8, THINGSPEC_MissileTrigger = 16, THINGSPEC_ClearSpecial = 32, + THINGSPEC_NoDeathSpecial = 64, + THINGSPEC_TriggerActs = 128, }; // Shorter aliases for same const int AF_Default = 0;