From 458142eb8b533833a6a33f560f100ef586317ef1 Mon Sep 17 00:00:00 2001 From: inkoalawetrust <56005600+inkoalawetrust@users.noreply.github.com> Date: Thu, 5 Jan 2023 01:10:15 +0200 Subject: [PATCH] Added flags to SetPlayerProperty. Added all of the missing player cheats to the SetPlayerProperty special. --- src/playsim/p_lnspec.cpp | 62 +++++++++++++++++++++--------- wadsrc/static/zscript/constants.zs | 6 +++ 2 files changed, 50 insertions(+), 18 deletions(-) diff --git a/src/playsim/p_lnspec.cpp b/src/playsim/p_lnspec.cpp index f3ce6ac64..88b37f8c3 100644 --- a/src/playsim/p_lnspec.cpp +++ b/src/playsim/p_lnspec.cpp @@ -2914,7 +2914,14 @@ enum PROP_UNUSED1, PROP_UNUSED2, PROP_SPEED, + PROP_BUDDHA, + PROP_BUDDHA2, + PROP_FRIGHTENING, + PROP_NOCLIP, + PROP_NOCLIP2, + PROP_GODMODE, + PROP_GODMODE2, }; FUNC(LS_SetPlayerProperty) @@ -3035,24 +3042,43 @@ FUNC(LS_SetPlayerProperty) // Set or clear a flag switch (arg2) { - case PROP_BUDDHA: - mask = CF_BUDDHA; - break; - case PROP_FROZEN: - mask = CF_FROZEN; - break; - case PROP_NOTARGET: - mask = CF_NOTARGET; - break; - case PROP_INSTANTWEAPONSWITCH: - mask = CF_INSTANTWEAPSWITCH; - break; - case PROP_FLY: - //mask = CF_FLY; - break; - case PROP_TOTALLYFROZEN: - mask = CF_TOTALLYFROZEN; - break; + case PROP_BUDDHA: + mask = CF_BUDDHA; + break; + case PROP_BUDDHA2: + mask = CF_BUDDHA2; + break; + case PROP_FROZEN: + mask = CF_FROZEN; + break; + case PROP_NOTARGET: + mask = CF_NOTARGET; + break; + case PROP_INSTANTWEAPONSWITCH: + mask = CF_INSTANTWEAPSWITCH; + break; + //CF_FLY has special handling + case PROP_FLY: + //mask = CF_FLY; + break; + case PROP_TOTALLYFROZEN: + mask = CF_TOTALLYFROZEN; + break; + case PROP_FRIGHTENING: + mask = CF_FRIGHTENING; + break; + case PROP_NOCLIP: + mask = CF_NOCLIP; + break; + case PROP_NOCLIP2: + mask = CF_NOCLIP|CF_NOCLIP2; //Both must be on. + break; + case PROP_GODMODE: + mask = CF_GODMODE; + break; + case PROP_GODMODE2: + mask = CF_GODMODE2; + break; } if (arg0 == 0) diff --git a/wadsrc/static/zscript/constants.zs b/wadsrc/static/zscript/constants.zs index a8bc17bda..66426a125 100644 --- a/wadsrc/static/zscript/constants.zs +++ b/wadsrc/static/zscript/constants.zs @@ -435,6 +435,12 @@ enum EPlayerProperties PROP_FLIGHT = 12, // (Deprecated) PROP_SPEED = 15, // (Deprecated) PROP_BUDDHA = 16, + PROP_BUDDHA2 = 17, + PROP_FRIGHTENING = 18, + PROP_NOCLIP = 19, + PROP_NOCLIP2 = 20, + PROP_GODMODE = 21, + PROP_GODMODE2 = 22, } // Line_SetBlocking