From f802d7a44c172709daccef7364a237960c06d748 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Mon, 27 Oct 2014 21:35:55 -0500 Subject: [PATCH 01/10] - Added +FULLMASS. Actors will be excluded from damage/radius thrusting of all sorts by explosions or damage of any kind. They will also never deal impact damage to other enemies, nor will they damage themselves from being too close to a wall. --- src/actor.h | 1 + src/p_interaction.cpp | 3 ++- src/p_map.cpp | 40 +++++++++++++++++++--------------- src/thingdef/thingdef_data.cpp | 1 + 4 files changed, 26 insertions(+), 19 deletions(-) diff --git a/src/actor.h b/src/actor.h index f1c733ab24..6ae45f4b75 100644 --- a/src/actor.h +++ b/src/actor.h @@ -344,6 +344,7 @@ enum MF7_HARMFRIENDS = 0x00000020, // is allowed to harm friendly monsters. MF7_BUDDHA = 0x00000040, // Behaves just like the buddha cheat. MF7_FOILBUDDHA = 0x00000080, // Similar to FOILINVUL, foils buddha mode. + MF7_FULLMASS = 0x00000100, // Thrusting functions do not take, and do not give thrust (damage) to actors with this flag. // --- mobj.renderflags --- diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 2ac29e11cf..0a615d3cc0 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1097,6 +1097,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, && !(target->flags & MF_NOCLIP) && !(inflictor->flags2 & MF2_NODMGTHRUST) && !(flags & DMG_THRUSTLESS) + && !(target->flags7 & MF7_FULLMASS) && (source == NULL || source->player == NULL || !(source->flags2 & MF2_NODMGTHRUST))) { int kickback; @@ -1324,7 +1325,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, if (target->health <= 0) { if ((target->flags7 & MF7_BUDDHA) && (damage < TELEFRAG_DAMAGE) && (!(inflictor->flags3 & MF7_FOILBUDDHA) && !(flags & DMG_FOILBUDDHA))) - { //Make sure FOILINVUL flags work here too for monsters. Or perhaps consider a FOILBUDDHA flag... + { //FOILBUDDHA or Telefrag damage must kill it. target->health = 1; } else diff --git a/src/p_map.cpp b/src/p_map.cpp index 43b16a5064..3c17115ff0 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4679,7 +4679,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo if (!(flags & RADF_NODAMAGE)) newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod); - else if (thing->player == NULL && !(flags & RADF_NOIMPACTDAMAGE)) + else if (thing->player == NULL && (!(flags & RADF_NOIMPACTDAMAGE) && !(thing->flags7 & MF7_FULLMASS))) thing->flags2 |= MF2_BLASTED; if (!(thing->flags & MF_ICECORPSE)) @@ -4691,25 +4691,29 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo { if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST)) { - thrust = points * 0.5f / (double)thing->Mass; - if (bombsource == thing) + if (!(thing->flags7 & MF7_FULLMASS)) { - thrust *= selfthrustscale; + + thrust = points * 0.5f / (double)thing->Mass; + if (bombsource == thing) + { + thrust *= selfthrustscale; + } + velz = (double)(thing->z + (thing->height >> 1) - bombspot->z) * thrust; + if (bombsource != thing) + { + velz *= 0.5f; + } + else + { + velz *= 0.8f; + } + angle_t ang = R_PointToAngle2(bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT; + thing->velx += fixed_t(finecosine[ang] * thrust); + thing->vely += fixed_t(finesine[ang] * thrust); + if (!(flags & RADF_NODAMAGE)) + thing->velz += (fixed_t)velz; // this really doesn't work well } - velz = (double)(thing->z + (thing->height >> 1) - bombspot->z) * thrust; - if (bombsource != thing) - { - velz *= 0.5f; - } - else - { - velz *= 0.8f; - } - angle_t ang = R_PointToAngle2(bombspot->x, bombspot->y, thing->x, thing->y) >> ANGLETOFINESHIFT; - thing->velx += fixed_t(finecosine[ang] * thrust); - thing->vely += fixed_t(finesine[ang] * thrust); - if (!(flags & RADF_NODAMAGE)) - thing->velz += (fixed_t)velz; // this really doesn't work well } } } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 90c3313a69..fe1cec588c 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -244,6 +244,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF7, HARMFRIENDS, AActor, flags7), DEFINE_FLAG(MF7, BUDDHA, AActor, flags7), DEFINE_FLAG(MF7, FOILBUDDHA, AActor, flags7), + DEFINE_FLAG(MF7, FULLMASS, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From c01d1a8003dcfb90abd3170545ec3891e5f67f79 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Mon, 27 Oct 2014 22:29:10 -0500 Subject: [PATCH 02/10] - Added DMSS_NOPROTECT. Bypasses PowerProtection inventory items. --- src/p_interaction.cpp | 10 +++++----- src/p_local.h | 1 + src/thingdef/thingdef_codeptr.cpp | 3 +++ wadsrc/static/actors/constants.txt | 1 + 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 0a615d3cc0..db6dcdc7d4 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1053,8 +1053,8 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, return -1; } } - // Handle passive damage modifiers (e.g. PowerProtection) - if (target->Inventory != NULL) + // Handle passive damage modifiers (e.g. PowerProtection), provided they are not afflicted with protection penetrating powers. + if ((target->Inventory != NULL) && !(flags & DMG_NO_PROTECT)) { int olddam = damage; target->Inventory->ModifyDamage(olddam, mod, damage, true); @@ -1592,7 +1592,7 @@ bool AActor::OkayToSwitchTarget (AActor *other) bool P_PoisonPlayer (player_t *player, AActor *poisoner, AActor *source, int poison) { - if((player->cheats&CF_GODMODE) || (player->mo->flags2 & MF2_INVULNERABLE)) + if((player->cheats&CF_GODMODE) || (player->mo->flags2 & MF2_INVULNERABLE) || (player->cheats & CF_GODMODE2)) { return false; } @@ -1643,8 +1643,8 @@ void P_PoisonDamage (player_t *player, AActor *source, int damage, { return; } - if (damage < TELEFRAG_DAMAGE && ((target->flags2 & MF2_INVULNERABLE) || - (player->cheats & CF_GODMODE))) + if ((damage < TELEFRAG_DAMAGE && ((target->flags2 & MF2_INVULNERABLE) || + (player->cheats & CF_GODMODE))) || (player->cheats & CF_GODMODE2)) { // target is invulnerable return; } diff --git a/src/p_local.h b/src/p_local.h index f7e4738456..dec80ecaa1 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -560,6 +560,7 @@ enum EDmgFlags DMG_PLAYERATTACK = 32, DMG_FOILINVUL = 64, DMG_FOILBUDDHA = 128, + DMG_NO_PROTECT = 256, }; diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 6a1cf6e674..a8f0a4d400 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -4832,6 +4832,7 @@ enum DMSS DMSS_KILL = 4, DMSS_NOFACTOR = 8, DMSS_FOILBUDDHA = 16, + DMSS_NOPROTECT = 32, }; static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageType, int flags) @@ -4847,6 +4848,8 @@ static void DoDamage(AActor *dmgtarget, AActor *self, int amount, FName DamageTy dmgFlags += DMG_NO_ARMOR; if (flags & DMSS_KILL) //Kill adds the value of the damage done to it. Allows for more controlled extreme death types. amount += dmgtarget->health; + if (flags & DMSS_NOPROTECT) //Ignore PowerProtection. + dmgFlags += DMG_NO_PROTECT; if (amount > 0) P_DamageMobj(dmgtarget, self, self, amount, DamageType, dmgFlags); //Should wind up passing them through just fine. diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index f806f8224f..278d4b90f3 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -383,6 +383,7 @@ const int DMSS_AFFECTARMOR = 2; const int DMSS_KILL = 4; const int DMSS_NOFACTOR = 8; const int DMSS_FOILBUDDHA = 16; +const int DMSS_NOPROTECT = 32; // Flags for A_AlertMonsters const int AMF_TARGETEMITTER = 1; From 774db445ec815be0099e7b3fba08c4ffb1bc3eb0 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Mon, 27 Oct 2014 22:40:25 -0500 Subject: [PATCH 03/10] -Fixed: WhirlWind was still able to affect actors with the FULLMASS flag. --- src/g_heretic/a_ironlich.cpp | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index d8c1fd285c..d2e49a0f3e 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -28,10 +28,14 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage, FName damagetype) { int randVal; - target->angle += pr_foo.Random2() << 20; - target->velx += pr_foo.Random2() << 10; - target->vely += pr_foo.Random2() << 10; - if ((level.time & 16) && !(target->flags2 & MF2_BOSS)) + if (!(target->flags7 & MF7_FULLMASS)) + { + target->angle += pr_foo.Random2() << 20; + target->velx += pr_foo.Random2() << 10; + target->vely += pr_foo.Random2() << 10; + } + + if ((level.time & 16) && !(target->flags2 & MF2_BOSS) && !(target->flags7 & MF7_FULLMASS)) { randVal = pr_foo(); if (randVal > 160) From 6073adbeef6cb497084bad8371134648a18fe1a3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 28 Oct 2014 08:40:34 +0100 Subject: [PATCH 04/10] - renamed FULLMASS to DONTTHRUST. --- src/actor.h | 2 +- src/g_heretic/a_ironlich.cpp | 4 ++-- src/p_interaction.cpp | 2 +- src/p_map.cpp | 4 ++-- src/thingdef/thingdef_data.cpp | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/actor.h b/src/actor.h index 6ae45f4b75..6c9d53a4f2 100644 --- a/src/actor.h +++ b/src/actor.h @@ -344,7 +344,7 @@ enum MF7_HARMFRIENDS = 0x00000020, // is allowed to harm friendly monsters. MF7_BUDDHA = 0x00000040, // Behaves just like the buddha cheat. MF7_FOILBUDDHA = 0x00000080, // Similar to FOILINVUL, foils buddha mode. - MF7_FULLMASS = 0x00000100, // Thrusting functions do not take, and do not give thrust (damage) to actors with this flag. + MF7_DONTTHRUST = 0x00000100, // Thrusting functions do not take, and do not give thrust (damage) to actors with this flag. // --- mobj.renderflags --- diff --git a/src/g_heretic/a_ironlich.cpp b/src/g_heretic/a_ironlich.cpp index d2e49a0f3e..dba16b622c 100644 --- a/src/g_heretic/a_ironlich.cpp +++ b/src/g_heretic/a_ironlich.cpp @@ -28,14 +28,14 @@ int AWhirlwind::DoSpecialDamage (AActor *target, int damage, FName damagetype) { int randVal; - if (!(target->flags7 & MF7_FULLMASS)) + if (!(target->flags7 & MF7_DONTTHRUST)) { target->angle += pr_foo.Random2() << 20; target->velx += pr_foo.Random2() << 10; target->vely += pr_foo.Random2() << 10; } - if ((level.time & 16) && !(target->flags2 & MF2_BOSS) && !(target->flags7 & MF7_FULLMASS)) + if ((level.time & 16) && !(target->flags2 & MF2_BOSS) && !(target->flags7 & MF7_DONTTHRUST)) { randVal = pr_foo(); if (randVal > 160) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index db6dcdc7d4..860e30d0fe 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1097,7 +1097,7 @@ int P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage, && !(target->flags & MF_NOCLIP) && !(inflictor->flags2 & MF2_NODMGTHRUST) && !(flags & DMG_THRUSTLESS) - && !(target->flags7 & MF7_FULLMASS) + && !(target->flags7 & MF7_DONTTHRUST) && (source == NULL || source->player == NULL || !(source->flags2 & MF2_NODMGTHRUST))) { int kickback; diff --git a/src/p_map.cpp b/src/p_map.cpp index 3c17115ff0..b688ef43d9 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4679,7 +4679,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo if (!(flags & RADF_NODAMAGE)) newdam = P_DamageMobj(thing, bombspot, bombsource, damage, bombmod); - else if (thing->player == NULL && (!(flags & RADF_NOIMPACTDAMAGE) && !(thing->flags7 & MF7_FULLMASS))) + else if (thing->player == NULL && (!(flags & RADF_NOIMPACTDAMAGE) && !(thing->flags7 & MF7_DONTTHRUST))) thing->flags2 |= MF2_BLASTED; if (!(thing->flags & MF_ICECORPSE)) @@ -4691,7 +4691,7 @@ void P_RadiusAttack(AActor *bombspot, AActor *bombsource, int bombdamage, int bo { if (bombsource == NULL || !(bombsource->flags2 & MF2_NODMGTHRUST)) { - if (!(thing->flags7 & MF7_FULLMASS)) + if (!(thing->flags7 & MF7_DONTTHRUST)) { thrust = points * 0.5f / (double)thing->Mass; diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index fe1cec588c..dbd1f10318 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -244,7 +244,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF7, HARMFRIENDS, AActor, flags7), DEFINE_FLAG(MF7, BUDDHA, AActor, flags7), DEFINE_FLAG(MF7, FOILBUDDHA, AActor, flags7), - DEFINE_FLAG(MF7, FULLMASS, AActor, flags7), + DEFINE_FLAG(MF7, DONTTHRUST, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From 65cb662678c29c0d66e817a0d77a18e516994cf8 Mon Sep 17 00:00:00 2001 From: Gaerzi Date: Tue, 28 Oct 2014 21:19:01 +0100 Subject: [PATCH 05/10] Missing break in case NAME_FillColor This caused weirdness with invulnerable monsters when their fillcolor was changed. --- src/p_udmf.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index 6af777b360..926e65dcc4 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -690,6 +690,7 @@ public: case NAME_FillColor: th->fillcolor = CheckInt(key); + break; case NAME_Health: th->health = CheckInt(key); From 978667143c4acc49e323cb68cad0483a0b665ad8 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Oct 2014 08:54:14 +0100 Subject: [PATCH 06/10] - fixed: P_RemoveThing must not remove owned inventory items. --- src/p_things.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/p_things.cpp b/src/p_things.cpp index 2a93ee31e0..a8d0404b69 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -402,10 +402,14 @@ void P_RemoveThing(AActor * actor) // Don't remove live players. if (actor->player == NULL || actor != actor->player->mo) { + // Don't also remove owned inventory items + if (actor->IsKindOf(RUNTIME_CLASS(AInventory)) && static_cast(actor)->Owner == NULL) return; + // be friendly to the level statistics. ;) actor->ClearCounters(); actor->Destroy (); } + } bool P_Thing_Raise(AActor *thing) From c1a0ee9623637984ad01c75521b80bc410d895d2 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Oct 2014 10:40:08 +0100 Subject: [PATCH 07/10] - fixed last commit. --- src/p_things.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_things.cpp b/src/p_things.cpp index a8d0404b69..0189848e4e 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -403,7 +403,7 @@ void P_RemoveThing(AActor * actor) if (actor->player == NULL || actor != actor->player->mo) { // Don't also remove owned inventory items - if (actor->IsKindOf(RUNTIME_CLASS(AInventory)) && static_cast(actor)->Owner == NULL) return; + if (actor->IsKindOf(RUNTIME_CLASS(AInventory)) && static_cast(actor)->Owner != NULL) return; // be friendly to the level statistics. ;) actor->ClearCounters(); From 5977cb04d9d24265b823168ccbb663e9ff9c65a2 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Wed, 29 Oct 2014 12:33:25 -0500 Subject: [PATCH 08/10] - Fixed: A_Die didn't consider missiles for the function. --- src/p_enemy.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index e51d601f3a..ef6136fdc0 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -3161,7 +3161,10 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Die) ACTION_PARAM_START(1); ACTION_PARAM_NAME(damagetype, 0); - P_DamageMobj (self, NULL, NULL, self->health, damagetype, DMG_FORCED); + if (self->flags & MF_MISSILE) + P_ExplodeMissile(self, NULL, NULL); + else + P_DamageMobj (self, NULL, NULL, self->health, damagetype, DMG_FORCED); } // From 165d2887fd8bdab5e4f388c5db54e99c83e27488 Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Wed, 29 Oct 2014 14:01:31 -0500 Subject: [PATCH 09/10] - Added: A_GiveToChildren - Added: A_TakeFromChildren - Added: A_GiveToSiblings - Added: A_TakeFromSiblings - Added the following flags for A_RadiusGive: - RGF_NOSIGHT: Exclude sight check from distance. - RGF_MISSILES: Missiles can take inventory items. --- src/thingdef/thingdef_codeptr.cpp | 85 +++++++++++++++++++++++++----- wadsrc/static/actors/actor.txt | 4 ++ wadsrc/static/actors/constants.txt | 20 +++---- 3 files changed, 87 insertions(+), 22 deletions(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index a8f0a4d400..6fafbddcfb 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -1677,6 +1677,31 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToTarget) DoGiveInventory(self->target, PUSH_PARAMINFO); } +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToChildren) +{ + TThinkerIterator it; + AActor * mo; + + while ((mo = it.Next())) + { + if (mo->master == self) DoGiveInventory(mo, PUSH_PARAMINFO); + } +} + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_GiveToSiblings) +{ + TThinkerIterator it; + AActor * mo; + + if (self->master != NULL) + { + while ((mo = it.Next())) + { + if (mo->master == self->master && mo != self) DoGiveInventory(mo, PUSH_PARAMINFO); + } + } +} + //=========================================================================== // // A_TakeInventory @@ -1737,6 +1762,31 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromTarget) DoTakeInventory(self->target, PUSH_PARAMINFO); } +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromChildren) +{ + TThinkerIterator it; + AActor * mo; + + while ((mo = it.Next())) + { + if (mo->master == self) DoTakeInventory(mo, PUSH_PARAMINFO); + } +} + +DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_TakeFromSiblings) +{ + TThinkerIterator it; + AActor * mo; + + if (self->master != NULL) + { + while ((mo = it.Next())) + { + if (mo->master == self->master && mo != self) DoTakeInventory(mo, PUSH_PARAMINFO); + } + } +} + //=========================================================================== // // Common code for A_SpawnItem and A_SpawnItemEx @@ -4608,17 +4658,19 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, ACS_NamedTerminate) //========================================================================== enum RadiusGiveFlags { - RGF_GIVESELF = 1, - RGF_PLAYERS = 2, - RGF_MONSTERS = 4, - RGF_OBJECTS = 8, - RGF_VOODOO = 16, - RGF_CORPSES = 32, - RGF_MASK = 63, - RGF_NOTARGET = 64, - RGF_NOTRACER = 128, - RGF_NOMASTER = 256, - RGF_CUBE = 512, + RGF_GIVESELF = 1 << 0, + RGF_PLAYERS = 1 << 1, + RGF_MONSTERS = 1 << 2, + RGF_OBJECTS = 1 << 3, + RGF_VOODOO = 1 << 4, + RGF_CORPSES = 1 << 5, + RGF_MASK = 63, + RGF_NOTARGET = 1 << 6, + RGF_NOTRACER = 1 << 7, + RGF_NOMASTER = 1 << 8, + RGF_CUBE = 1 << 9, + RGF_NOSIGHT = 1 << 10, + RGF_MISSILES = 1 << 11, }; DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) @@ -4699,6 +4751,13 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) continue; } } + else if (thing->flags & MF_MISSILE) + { + if (!(flags & RGF_MISSILES)) + { + continue; + } + } else { continue; @@ -4724,8 +4783,8 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) } fixed_t dz = abs ((thing->z + thing->height/2) - (self->z + self->height/2)); - if (P_CheckSight (thing, self, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY)) - { // OK to give; target is in direct path + if (P_CheckSight (thing, self, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) || (RGF_NOSIGHT)) + { // OK to give; target is in direct path, or the monster doesn't care about it being in line of sight. AInventory *gift = static_cast(Spawn (item, 0, 0, 0, NO_REPLACE)); if (gift->IsKindOf(RUNTIME_CLASS(AHealth))) { diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index 280321ad09..e253f53ac9 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -312,6 +312,10 @@ ACTOR Actor native //: Thinker action native A_RemoveTarget(int flags = 0); action native A_RemoveTracer(int flags = 0); action native A_Remove(int removee, int flags = 0); + action native A_GiveToChildren(class itemtype, int amount = 0); + action native A_GiveToSiblings(class itemtype, int amount = 0); + action native A_TakeFromChildren(class itemtype, int amount = 0); + action native A_TakeFromSiblings(class itemtype, int amount = 0); action native A_CheckSightOrRange(float distance, state label); action native A_CheckRange(float distance, state label); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 278d4b90f3..a43d90f96f 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -191,15 +191,17 @@ const int WAF_USEPUFF = 2; enum { RGF_GIVESELF = 1, - RGF_PLAYERS = 2, - RGF_MONSTERS = 4, - RGF_OBJECTS = 8, - RGF_VOODOO = 16, - RGF_CORPSES = 32, - RGF_NOTARGET = 64, - RGF_NOTRACER = 128, - RGF_NOMASTER = 256, - RGF_CUBE = 512, + RGF_PLAYERS = 1 << 1, + RGF_MONSTERS = 1 << 2, + RGF_OBJECTS = 1 << 3, + RGF_VOODOO = 1 << 4, + RGF_CORPSES = 1 << 5, + RGF_NOTARGET = 1 << 6, + RGF_NOTRACER = 1 << 7, + RGF_NOMASTER = 1 << 8, + RGF_CUBE = 1 << 9, + RGF_NOSIGHT = 1 << 10, + RGF_MISSILES = 1 << 11, }; // Activation flags From 31611c17d572e2aab109099d047e157fd51682cc Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Wed, 29 Oct 2014 22:00:15 +0100 Subject: [PATCH 10/10] - fixed RGF_NOSIGHT checking for A_RadiusGive. --- src/thingdef/thingdef_codeptr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/thingdef/thingdef_codeptr.cpp b/src/thingdef/thingdef_codeptr.cpp index 6fafbddcfb..80583b5870 100644 --- a/src/thingdef/thingdef_codeptr.cpp +++ b/src/thingdef/thingdef_codeptr.cpp @@ -4783,7 +4783,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_RadiusGive) } fixed_t dz = abs ((thing->z + thing->height/2) - (self->z + self->height/2)); - if (P_CheckSight (thing, self, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY) || (RGF_NOSIGHT)) + if ((flags & RGF_NOSIGHT) || P_CheckSight (thing, self, SF_IGNOREVISIBILITY|SF_IGNOREWATERBOUNDARY)) { // OK to give; target is in direct path, or the monster doesn't care about it being in line of sight. AInventory *gift = static_cast(Spawn (item, 0, 0, 0, NO_REPLACE)); if (gift->IsKindOf(RUNTIME_CLASS(AHealth)))