Skip to content

Commit 55ce051

Browse files
Blue-Shadowcoelckers
authored andcommitted
- added a A_SetFriendly function
1 parent 9be78b1 commit 55ce051

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

wadsrc/static/zscript/actors/actor.zs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,14 @@ class Actor : Thinker native
11011101
native void A_SetBlend(color color1, double alpha, int tics, color color2 = 0, double alpha2 = 0.);
11021102
deprecated("2.3", "Use 'b<FlagName> = [true/false]' instead") native void A_ChangeFlag(string flagname, bool value);
11031103
native void A_ChangeCountFlags(int kill = FLAG_NO_CHANGE, int item = FLAG_NO_CHANGE, int secret = FLAG_NO_CHANGE);
1104+
1105+
void A_SetFriendly (bool set)
1106+
{
1107+
if (CountsAsKill() && health > 0) level.total_monsters--;
1108+
bFriendly = set;
1109+
if (CountsAsKill() && health > 0) level.total_monsters++;
1110+
}
1111+
11041112
native void A_RaiseMaster(int flags = 0);
11051113
native void A_RaiseChildren(int flags = 0);
11061114
native void A_RaiseSiblings(int flags = 0);

0 commit comments

Comments
 (0)