SetPlayerProperty
From ZDoom Wiki
191:SetPlayerProperty (who, set, which)
- who: Set to 1 to affect all players, 0 for just the one who activated the special.
- set: Set to 1 to turn on the property, or 0 to turn it off. PROP_INVULNERABILITY has a special use for this field.
- which: Which property to change
Sets a property for a player.
| Note: Using this special to grant powerup effects to players has been deprecated. Consider using the GiveInventory function for this purpose instead. |
- 0 — PROP_FROZEN — The player cannot move, but can still fire and perform other actions.
- 1 — PROP_NOTARGET — Monsters ignore the player, unless they have already seen him or the player harms them.
- 2 — PROP_INSTANTWEAPONSWITCH — The weapons do not delay between changing them.
- 3 — PROP_FLY — The player is (not) subjected to gravity. The behavior is about the same as having Heretic's/Hexen's Wings of Wrath.
- 4 — PROP_TOTALLYFROZEN — Same as PROP_FROZEN, but does not allow the player to look around or shoot. (In fact, the only control they can still use is the “+use” key)
- 5 — PROP_INVULNERABILITY (deprecated) — Invulnerability sphere. Using a "set" value of 1 makes the player(s) invulnerable and applies the inverted greyscale invulnerable palette. Using a "set" value of 2 makes the player(s) invulnerable but does not apply the invulnerability palette. SetActorProperty with APROP_Invulnerable or APROP_DamageFactor is a valid substitution.
- 6 — PROP_STRENGTH (deprecated) — Berserk pack
- 7 — PROP_INVISIBILITY (deprecated) — Partial Invisibility sphere
- 8 — PROP_RADIATIONSUIT (deprecated) — Radiation suit
- 9 — PROP_ALLMAP (deprecated) — Computer area map
- 10 — PROP_INFRARED (deprecated) — Light Amplification Goggles
- 11 — PROP_WEAPONLEVEL2 (deprecated) — Tome of Power
- 12 — PROP_FLIGHT (deprecated) — Wings of Wrath
- 13 — PROP_UNUSED1 — Does nothing. Do not use.
- 14 — PROP_UNUSED2 — Does nothing. Do not use.
- 15 — PROP_SPEED (deprecated) — Speed boots
- 16 — PROP_BUDDHA — Buddha Mode (1 indestructible hit point)
Examples
This function is almost like an ACS pause game function, and can be toggled on and off.
Function void PlayerFreeze (bool IsOn)
{
if(IsOn)
{
Thing_Stop(TID_Player);
SetPlayerProperty(TRUE, ON, PROP_TotallyFrozen);
if(CheckActorInventory(TID_Player, "PowerTimeFreezer") == 0)
GiveActorInventory(TID_Player, "PowerGiver_ACSTimeFreeze", 1);
}
else
{
SetPlayerProperty(TRUE, OFF, PROP_TotallyFrozen);
TakeActorInventory(TID_Player, "PowerTimeFreezer", 0x7fffffff);
}
}