From 55ce0510c2b181b941d30778f29b83a06955bb56 Mon Sep 17 00:00:00 2001 From: Blue Shadow Date: Sun, 4 Apr 2021 04:02:16 +0300 Subject: [PATCH] - added a A_SetFriendly function --- wadsrc/static/zscript/actors/actor.zs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/wadsrc/static/zscript/actors/actor.zs b/wadsrc/static/zscript/actors/actor.zs index e336b70ceb..0ce7ce09c1 100644 --- a/wadsrc/static/zscript/actors/actor.zs +++ b/wadsrc/static/zscript/actors/actor.zs @@ -1101,6 +1101,14 @@ class Actor : Thinker native native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0, double alpha2 = 0.); deprecated("2.3", "Use 'b = [true/false]' instead") native void A_ChangeFlag(string flagname, bool value); native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE); + + void A_SetFriendly (bool set) + { + if (CountsAsKill() && health > 0) level.total_monsters--; + bFriendly = set; + if (CountsAsKill() && health > 0) level.total_monsters++; + } + native void A_RaiseMaster(int flags = 0); native void A_RaiseChildren(int flags = 0); native void A_RaiseSiblings(int flags = 0);