From e6c880c93a98d98553aa35366170254fa10a8621 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 11:47:25 +0200 Subject: [PATCH 1/4] - fixed: The sector's 'hidden' UDMF property did not properly clear the corresponding flag if the value was 'false'. - added UDMF 'waterzone' property for sectors. --- specs/udmf_zdoom.txt | 4 ++++ src/namedef.h | 1 + src/p_udmf.cpp | 6 +++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index bdd70322e..4fc57f856 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -186,6 +186,7 @@ Note: All fields default to false unless mentioned otherwise. soundsequence = ; // The sound sequence to play when this sector moves. Placing a // sound sequence thing in the sector will override this property. hidden = ; // if true this sector will not be drawn on the textured automap. + waterzone = ; // Sector is under water and swimmable * Note about dropactors @@ -328,6 +329,9 @@ Added back locknumber property. 1.20 25.02.2012 Added arg0str thing property. +1.21 09.08.2013 +Added waterzone sector property. + =============================================================================== EOF =============================================================================== diff --git a/src/namedef.h b/src/namedef.h index 44fe35e79..f2d601eb5 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -442,6 +442,7 @@ xx(Alphafloor) xx(Alphaceiling) xx(Renderstylefloor) xx(Renderstyleceiling) +xx(Waterzone) xx(offsetx_top) xx(offsety_top) diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index c1d18fd4c..91e4c8565 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -1326,7 +1326,11 @@ public: continue; case NAME_hidden: - sec->MoreFlags |= SECF_HIDDEN; + Flag(sec->MoreFlags, SECF_HIDDEN, key); + break; + + case NAME_Waterzone: + Flag(sec->MoreFlags, SECF_UNDERWATER, key); break; default: From 34b71baad16bce52fb86ed0b18c057ef3658a389 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 11:57:14 +0200 Subject: [PATCH 2/4] - added Player.Aircapacity property which is used as a multiplier for the level's air supply. --- src/d_player.h | 1 + src/p_user.cpp | 6 +++++- src/thingdef/thingdef_properties.cpp | 9 +++++++++ src/version.h | 2 +- wadsrc/static/actors/shared/player.txt | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/d_player.h b/src/d_player.h index 892adeebf..75ed533d9 100644 --- a/src/d_player.h +++ b/src/d_player.h @@ -141,6 +141,7 @@ public: FNameNoInit MorphWeapon; fixed_t AttackZOffset; // attack height, relative to player center fixed_t UseRange; // [NS] Distance at which player can +use + fixed_t AirCapacity; // Multiplier for air supply underwater. const PClass *FlechetteType; // [CW] Fades for when you are being damaged. diff --git a/src/p_user.cpp b/src/p_user.cpp index c427353a5..e2c8b80c9 100644 --- a/src/p_user.cpp +++ b/src/p_user.cpp @@ -477,6 +477,10 @@ void APlayerPawn::Serialize (FArchive &arc) { arc << UseRange; } + if (SaveVersion >= 4503) + { + arc << AirCapacity; + } } //=========================================================================== @@ -1066,7 +1070,7 @@ bool APlayerPawn::ResetAirSupply (bool playgasp) { S_Sound (this, CHAN_VOICE, "*gasp", 1, ATTN_NORM); } - if (level.airsupply> 0) player->air_finished = level.time + level.airsupply; + if (level.airsupply> 0 && player->mo->AirCapacity > 0) player->air_finished = level.time + FixedMul(level.airsupply, player->mo->AirCapacity); else player->air_finished = INT_MAX; return wasdrowning; } diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index 61a18b370..fcb3bc2ef 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -2419,6 +2419,15 @@ DEFINE_CLASS_PROPERTY_PREFIX(player, userange, F, PlayerPawn) defaults->UseRange = z; } +//========================================================================== +// +//========================================================================== +DEFINE_CLASS_PROPERTY_PREFIX(player, aircapacity, F, PlayerPawn) +{ + PROP_FIXED_PARM(z, 0); + defaults->AirCapacity = z; +} + //========================================================================== // //========================================================================== diff --git a/src/version.h b/src/version.h index 8bdd8ca81..01fbc7a88 100644 --- a/src/version.h +++ b/src/version.h @@ -76,7 +76,7 @@ const char *GetVersionString(); // Use 4500 as the base git save version, since it's higher than the // SVN revision ever got. -#define SAVEVER 4502 +#define SAVEVER 4503 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x) diff --git a/wadsrc/static/actors/shared/player.txt b/wadsrc/static/actors/shared/player.txt index 5457880a7..159d4cca9 100644 --- a/wadsrc/static/actors/shared/player.txt +++ b/wadsrc/static/actors/shared/player.txt @@ -32,6 +32,7 @@ Actor PlayerPawn : Actor native Player.DamageScreenColor "ff 00 00" Player.MugShotMaxHealth 0 Player.FlechetteType "ArtiPoisonBag3" + Player.AirCapacity 1 Obituary "$OB_MPDEFAULT" } From b187451a711225b686ac6637c75f2fc65ec412d3 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 12:06:51 +0200 Subject: [PATCH 3/4] - added APROP_ViewHeight and APROP_AttackZOffset submission by TheFortuneTeller. --- src/p_acs.cpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/src/p_acs.cpp b/src/p_acs.cpp index d061d451a..4cb949539 100644 --- a/src/p_acs.cpp +++ b/src/p_acs.cpp @@ -3512,6 +3512,8 @@ enum APROP_Radius = 36, APROP_ReactionTime = 37, APROP_MeleeRange = 38, + APROP_ViewHeight = 39, + APROP_AttackZOffset = 40 }; // These are needed for ACS's APROP_RenderStyle @@ -3727,6 +3729,16 @@ void DLevelScript::DoSetActorProperty (AActor *actor, int property, int value) actor->reactiontime = value; break; + case APROP_ViewHeight: + if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn))) + static_cast(actor)->ViewHeight = value; + break; + + case APROP_AttackZOffset: + if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn))) + static_cast(actor)->AttackZOffset = value; + break; + default: // do nothing. break; @@ -3799,6 +3811,23 @@ int DLevelScript::GetActorProperty (int tid, int property, const SDWORD *stack, case APROP_Radius: return actor->radius; case APROP_ReactionTime:return actor->reactiontime; case APROP_MeleeRange: return actor->meleerange; + case APROP_ViewHeight: if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn))) + { + return static_cast(actor)->ViewHeight; + } + else + { + return 0; + } + case APROP_AttackZOffset: + if (actor->IsKindOf (RUNTIME_CLASS (APlayerPawn))) + { + return static_cast(actor)->AttackZOffset; + } + else + { + return 0; + } case APROP_SeeSound: return GlobalACSStrings.AddString(actor->SeeSound, stack, stackdepth); case APROP_AttackSound: return GlobalACSStrings.AddString(actor->AttackSound, stack, stackdepth); @@ -3851,6 +3880,8 @@ int DLevelScript::CheckActorProperty (int tid, int property, int value) case APROP_Radius: case APROP_ReactionTime: case APROP_MeleeRange: + case APROP_ViewHeight: + case APROP_AttackZOffset: return (GetActorProperty(tid, property, NULL, 0) == value); // Boolean values need to compare to a binary version of value From 5d0369d4eda44f3bb9471596b8281e9660dfc59b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Aug 2013 12:18:58 +0200 Subject: [PATCH 4/4] - Ability to set A_VileAttack's initial attack's damage type - by BlueShadow. --- src/g_doom/a_archvile.cpp | 17 +++++++++++++++-- wadsrc/static/actors/actor.txt | 2 +- wadsrc/static/actors/constants.txt | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/g_doom/a_archvile.cpp b/src/g_doom/a_archvile.cpp index e2fb689c2..8fce33324 100644 --- a/src/g_doom/a_archvile.cpp +++ b/src/g_doom/a_archvile.cpp @@ -101,15 +101,20 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileTarget) // // A_VileAttack // + +// A_VileAttack flags +#define VAF_DMGTYPEAPPLYTODIRECT 1 + DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack) { - ACTION_PARAM_START(6); + ACTION_PARAM_START(7); ACTION_PARAM_SOUND(snd,0); ACTION_PARAM_INT(dmg,1); ACTION_PARAM_INT(blastdmg,2); ACTION_PARAM_INT(blastrad,3); ACTION_PARAM_FIXED(thrust,4); ACTION_PARAM_NAME(dmgtype,5); + ACTION_PARAM_INT(flags,6); AActor *fire, *target; angle_t an; @@ -123,7 +128,15 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_VileAttack) return; S_Sound (self, CHAN_WEAPON, snd, 1, ATTN_NORM); - int newdam = P_DamageMobj (target, self, self, dmg, NAME_None); + + int newdam; + + if (flags & VAF_DMGTYPEAPPLYTODIRECT) + newdam = P_DamageMobj (target, self, self, dmg, dmgtype); + + else + newdam = P_DamageMobj (target, self, self, dmg, NAME_None); + P_TraceBleed (newdam > 0 ? newdam : dmg, target); an = self->angle >> ANGLETOFINESHIFT; diff --git a/wadsrc/static/actors/actor.txt b/wadsrc/static/actors/actor.txt index c2fa8a0c7..0ea018422 100644 --- a/wadsrc/static/actors/actor.txt +++ b/wadsrc/static/actors/actor.txt @@ -84,7 +84,7 @@ ACTOR Actor native //: Thinker action native A_VileChase(); action native A_VileStart(); action native A_VileTarget(class fire = "ArchvileFire"); - action native A_VileAttack(sound snd = "vile/stop", int initialdmg = 20, int blastdmg = 70, int blastradius = 70, float thrustfac = 1.0, name damagetype = "Fire"); + action native A_VileAttack(sound snd = "vile/stop", int initialdmg = 20, int blastdmg = 70, int blastradius = 70, float thrustfac = 1.0, name damagetype = "Fire", int flags = 0); action native A_StartFire(); action native A_Fire(float spawnheight = 0); action native A_FireCrackle(); diff --git a/wadsrc/static/actors/constants.txt b/wadsrc/static/actors/constants.txt index 18f991e43..cd9b088ab 100644 --- a/wadsrc/static/actors/constants.txt +++ b/wadsrc/static/actors/constants.txt @@ -4,6 +4,9 @@ const int PAF_NOSKULLATTACK = 1; const int PAF_AIMFACING = 2; const int PAF_NOTARGET = 4; +// Flags for A_VileAttack +const int VAF_DMGTYPEAPPLYTODIRECT = 1; + // Flags for A_Saw const int SF_NORANDOM = 1; const int SF_RANDOMLIGHTMISS = 2;