G SkillPropertyInt

From ZDoom Wiki
Jump to navigation Jump to search

static int G_SkillPropertyInt (int p)

Usage

Retrieves the value of the current skill's specified property.

This function is used with properties that are represented by integer or boolean values. For properties that are represented by float-point values, see G_SkillPropertyFloat.

Parameters

  • p: the property whose value to retrieve, which can be one of the following:
  • SKILLP_FastMonsters — The FastMonsters property. The returned value is true if either this property is set or the Fast monsters DMFlag is enabled.
  • SKILLP_Respawn — The RespawnTime property. If the Monsters respawn DMFlag is enabled and this property is 0, the returned value is the default respawn time set for the game, otherwise it is the value of this property.
  • SKILLP_RespawnLimit — The RespawnLimit property.
  • SKILLP_DisableCheats — The DisableCheats property.
  • SKILLP_AutoUseHealth — The AutoUseHealth property.
  • SKILLP_SpawnFilter — The SpawnFilter property.
  • SKILLP_EasyBossBrain — The EasyBossBrain property.
  • SKILLP_ACSReturn — The ACSReturn property. (Using this is the equivalent of calling the GameSkill ACS function, see example below)
  • SKILLP_NoPain — The NoPain property.
  • SKILLP_EasyKey — The EasyKey property.
  • SKILLP_SlowMonsters — The SlowMonsters property.
  • SKILLP_Infight — Returns the level, skill, or infighting console variable properties/value.
  • SKILLP_PlayerRespawn — The PlayerRespawn property.
  • SKILLP_SpawnMulti — The SpawnMulti property.
  • SKILLP_InstantReaction (development version 4ff72e9 only) — The InstantReaction property.

Examples

class TrashBinOfEvil : Actor
{
    Default
    {
        Mass 100;
        Health 4;
        Height 32;
        Radius 12;

        +SOLID
        +SHOOTABLE
        +DONTGIB
        +NOBLOOD
        +NOICEDEATH
    }

    States
    {
    Spawn:
        TCAN A -1;
        Stop;
     
    Death:
        TNT1 A 0
        {
            A_PlaySound("generic/break", CHAN_BODY);
         
            // This replaces wrapping the GameSkill ACS function
            // in a named script and calling it using CallACS
            int sk = G_SkillPropertyInt(SKILLP_ACSReturn);
         
            // check skill + Only spawn monsters if not -nomonsters
            // on higher skills let's be very rude to the player
            // but if they're on lower diffuclities go easy on them
            if (sk >= 3 && !(level.nomonsters || sv_nomonsters))
                Spawn("BaronOfHell", pos, ALLOW_REPLACE);
            else
                Spawn("Medikit", pos, ALLOW_REPLACE);
        }
        Stop;
    }
}