mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-15 16:51:31 +00:00
- added a 'DefaultStateUsage' property so that this setting can be properly set up for the classes that can inject states into other actors.
This commit is contained in:
parent
a8e2f4d539
commit
384f4fe7ce
6 changed files with 49 additions and 28 deletions
|
@ -285,6 +285,7 @@ void PClassActor::DeriveData(PClass *newclass)
|
|||
assert(newclass->IsKindOf(RUNTIME_CLASS(PClassActor)));
|
||||
PClassActor *newa = static_cast<PClassActor *>(newclass);
|
||||
|
||||
newa->DefaultStateUsage = DefaultStateUsage;
|
||||
newa->Obituary = Obituary;
|
||||
newa->HitObituary = HitObituary;
|
||||
newa->DeathHeight = DeathHeight;
|
||||
|
|
|
@ -271,6 +271,7 @@ public:
|
|||
PClassActor *Replacee;
|
||||
int NumOwnedStates;
|
||||
BYTE GameFilter;
|
||||
uint8_t DefaultStateUsage; // state flag defaults for blocks without a qualifier.
|
||||
WORD SpawnID;
|
||||
WORD ConversationID;
|
||||
SWORD DoomEdNum;
|
||||
|
|
|
@ -6121,6 +6121,7 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
|
|||
case NAME_Name:
|
||||
case NAME_Color:
|
||||
case NAME_Sound:
|
||||
case NAME_State:
|
||||
if (CheckArgSize(MethodName, ArgList, 1, 1, ScriptPosition))
|
||||
{
|
||||
PType *type =
|
||||
|
@ -6130,6 +6131,7 @@ FxExpression *FxFunctionCall::Resolve(FCompileContext& ctx)
|
|||
MethodName == NAME_Float ? TypeFloat64 :
|
||||
MethodName == NAME_Double ? TypeFloat64 :
|
||||
MethodName == NAME_Name ? TypeName :
|
||||
MethodName == NAME_State ? TypeState :
|
||||
MethodName == NAME_Color ? TypeColor : (PType*)TypeSound;
|
||||
|
||||
func = new FxTypeCast(ArgList[0], type, true, true);
|
||||
|
|
|
@ -533,6 +533,15 @@ DEFINE_PROPERTY(skip_super, 0, Actor)
|
|||
ResetBaggage (&bag, RUNTIME_CLASS(AActor));
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
// for internal use only - please do not document!
|
||||
//==========================================================================
|
||||
DEFINE_PROPERTY(defaultstateusage, I, Actor)
|
||||
{
|
||||
PROP_INT_PARM(use, 0);
|
||||
static_cast<PClassActor*>(bag.Info)->DefaultStateUsage = use;
|
||||
|
||||
}
|
||||
//==========================================================================
|
||||
//
|
||||
//==========================================================================
|
||||
|
|
|
@ -45,6 +45,7 @@ class Actor : Thinker native
|
|||
StencilColor "00 00 00";
|
||||
VisibleAngles 0, 0;
|
||||
VisiblePitch 0, 0;
|
||||
DefaultStateUsage SUF_ACTOR|SUF_OVERLAY;
|
||||
}
|
||||
|
||||
// Functions
|
||||
|
|
|
@ -88,9 +88,9 @@ class ScoreItem : Inventory native
|
|||
Default
|
||||
{
|
||||
Height 10;
|
||||
+COUNTITEM;
|
||||
+COUNTITEM
|
||||
Inventory.Amount 1;
|
||||
+Inventory.ALWAYSPICKUP;
|
||||
+Inventory.ALWAYSPICKUP
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -98,7 +98,7 @@ class Ammo : Inventory native
|
|||
{
|
||||
Default
|
||||
{
|
||||
+INVENTORY.KEEPDEPLETED;
|
||||
+INVENTORY.KEEPDEPLETED
|
||||
Inventory.PickupSound "misc/ammo_pkup";
|
||||
}
|
||||
}
|
||||
|
@ -119,7 +119,7 @@ class BasicArmor : Armor native
|
|||
{
|
||||
Default
|
||||
{
|
||||
+Inventory.KEEPDEPLETED;
|
||||
+Inventory.KEEPDEPLETED
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -127,8 +127,8 @@ class BasicArmorBonus : Armor native
|
|||
{
|
||||
Default
|
||||
{
|
||||
+Inventory.AUTOACTIVATE;
|
||||
+Inventory.ALWAYSPICKUP;
|
||||
+Inventory.AUTOACTIVATE
|
||||
+Inventory.ALWAYSPICKUP
|
||||
Inventory.MaxAmount 0;
|
||||
Armor.SavePercent 33.335;
|
||||
}
|
||||
|
@ -147,8 +147,8 @@ class HexenArmor : Armor native
|
|||
{
|
||||
Default
|
||||
{
|
||||
+Inventory.KEEPDEPLETED;
|
||||
+Inventory.UNDROPPABLE;
|
||||
+Inventory.KEEPDEPLETED
|
||||
+Inventory.UNDROPPABLE
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,13 @@ class DehackedPickup : Inventory native {}
|
|||
|
||||
class FakeInventory : Inventory native {}
|
||||
|
||||
class CustomInventory : StateProvider native {}
|
||||
class CustomInventory : StateProvider native
|
||||
{
|
||||
Default
|
||||
{
|
||||
DefaultStateUsage SUF_ACTOR|SUF_OVERLAY|SUF_ITEM;
|
||||
}
|
||||
}
|
||||
|
||||
class Health : Inventory native
|
||||
{
|
||||
|
@ -173,7 +179,7 @@ class HealthPickup : Inventory native
|
|||
Default
|
||||
{
|
||||
Inventory.DefMaxAmount;
|
||||
+INVENTORY.INVBAR;
|
||||
+INVENTORY.INVBAR
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -192,8 +198,8 @@ class PowerupGiver : Inventory native
|
|||
Default
|
||||
{
|
||||
Inventory.DefMaxAmount;
|
||||
+INVENTORY.INVBAR;
|
||||
+INVENTORY.FANCYPICKUPSOUND;
|
||||
+INVENTORY.INVBAR
|
||||
+INVENTORY.FANCYPICKUPSOUND
|
||||
Inventory.PickupSound "misc/p_pkup";
|
||||
}
|
||||
}
|
||||
|
@ -215,7 +221,7 @@ class PowerStrength : Powerup native
|
|||
{
|
||||
Powerup.Duration 1;
|
||||
Powerup.Color "ff 00 00", 0.5;
|
||||
+INVENTORY.HUBPOWER;
|
||||
+INVENTORY.HUBPOWER
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -245,7 +251,7 @@ class PowerShadow : PowerInvisibility
|
|||
{
|
||||
Default
|
||||
{
|
||||
+INVENTORY.HUBPOWER;
|
||||
+INVENTORY.HUBPOWER
|
||||
Powerup.Duration -55;
|
||||
Powerup.Strength 75;
|
||||
Powerup.Mode "Cumulative";
|
||||
|
@ -267,7 +273,7 @@ class PowerMask : PowerIronFeet native
|
|||
{
|
||||
Powerup.Duration -80;
|
||||
Powerup.Color "00 00 00", 0;
|
||||
+INVENTORY.HUBPOWER;
|
||||
+INVENTORY.HUBPOWER
|
||||
Inventory.Icon "I_MASK";
|
||||
}
|
||||
}
|
||||
|
@ -287,7 +293,7 @@ class PowerFlight : Powerup native
|
|||
Default
|
||||
{
|
||||
Powerup.Duration -60;
|
||||
+INVENTORY.HUBPOWER;
|
||||
+INVENTORY.HUBPOWER
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -297,7 +303,7 @@ class PowerWeaponLevel2 : Powerup native
|
|||
{
|
||||
Powerup.Duration -40;
|
||||
Inventory.Icon "SPINBK0";
|
||||
+INVENTORY.NOTELEPORTFREEZE;
|
||||
+INVENTORY.NOTELEPORTFREEZE
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -308,7 +314,7 @@ class PowerSpeed : Powerup native
|
|||
Powerup.Duration -45;
|
||||
Speed 1.5;
|
||||
Inventory.Icon "SPBOOT0";
|
||||
+INVENTORY.NOTELEPORTFREEZE;
|
||||
+INVENTORY.NOTELEPORTFREEZE
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -318,8 +324,8 @@ class PlayerSpeedTrail native
|
|||
{
|
||||
Default
|
||||
{
|
||||
+NOBLOCKMAP;
|
||||
+NOGRAVITY;
|
||||
+NOBLOCKMAP
|
||||
+NOGRAVITY
|
||||
Alpha 0.6;
|
||||
RenderStyle "Translucent";
|
||||
}
|
||||
|
@ -339,7 +345,7 @@ class PowerTargeter : Powerup native
|
|||
Default
|
||||
{
|
||||
Powerup.Duration -160;
|
||||
+INVENTORY.HUBPOWER;
|
||||
+INVENTORY.HUBPOWER
|
||||
}
|
||||
States
|
||||
{
|
||||
|
@ -374,7 +380,7 @@ class PowerScanner : Powerup native
|
|||
Default
|
||||
{
|
||||
Powerup.Duration -80;
|
||||
+INVENTORY.HUBPOWER;
|
||||
+INVENTORY.HUBPOWER
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -445,8 +451,8 @@ class PuzzleItem : Inventory native
|
|||
{
|
||||
Default
|
||||
{
|
||||
+NOGRAVITY;
|
||||
+INVENTORY.INVBAR;
|
||||
+NOGRAVITY
|
||||
+INVENTORY.INVBAR
|
||||
Inventory.DefMaxAmount;
|
||||
Inventory.UseSound "PuzzleSuccess";
|
||||
Inventory.PickupSound "misc/i_pkup";
|
||||
|
@ -462,7 +468,8 @@ class Weapon : StateProvider native
|
|||
Weapon.BobSpeed 1.0;
|
||||
Weapon.BobRangeX 1.0;
|
||||
Weapon.BobRangeY 1.0;
|
||||
+WEAPONSPAWN;
|
||||
+WEAPONSPAWN
|
||||
DefaultStateUsage SUF_ACTOR|SUF_OVERLAY|SUF_ITEM;
|
||||
}
|
||||
States
|
||||
{
|
||||
|
@ -491,9 +498,9 @@ class WeaponHolder : Inventory native
|
|||
{
|
||||
Default
|
||||
{
|
||||
+NOBLOCKMAP;
|
||||
+NOSECTOR;
|
||||
+INVENTORY.UNDROPPABLE;
|
||||
+NOBLOCKMAP
|
||||
+NOSECTOR
|
||||
+INVENTORY.UNDROPPABLE
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue