diff --git a/Document.txt b/Document.txt index 5ec1159..eeeb541 100644 --- a/Document.txt +++ b/Document.txt @@ -44,10 +44,10 @@ The turret's editor name is "Machine Gun Emplacement", and it can be found in th - Random (Randomly pick a color.) - Default (Use the default shade of green. Similar to just leaving User_Color empty.) - Most of the marines' behaviour can be configured on a per actor basis using user variables. -- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomied. +- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomized. - They also have a rifle that they sometimes drop, which you can pick up and use yourself. - The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too. - - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increased you accuracy as well. + - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well. - The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine. ================|USER VARIABLES|================ diff --git a/MarineFunctions.zsc b/MarineFunctions.zsc index 9649de9..0488e43 100644 --- a/MarineFunctions.zsc +++ b/MarineFunctions.zsc @@ -154,7 +154,7 @@ Mixin Class MarineFunctions //If your target is hostile, and is a player or marine that's on a turret. And they are in range and visible. /*This Else If is here so marines scared of an enemy on a turret, won't be any more likely to get on one themselves. Since protecting yourself from machine gun fire by getting to a stationary turret yourself is stupid, and MORE likely to get you killed.*/ - Else If ((Target.Player && Target.Player.ReadyWeapon.GetClassName() == "SmartMarineMGWeapon" && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret || + Else If ((Target.Player && Target.Player.ReadyWeapon && Target.Player.ReadyWeapon.GetClassName() == "SmartMarineMGWeapon" && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret || Target Is "SmartMarine" && SmartMarine(Target).OnTurret && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret || Target Is "TurretMarine" && Distance3D (Target) <= User_FearDistance*FRandom (1.01,1.25) && IsVisible (Target,True) && !GoingToTurret)) { @@ -273,7 +273,7 @@ Mixin Class MarineFunctions //And it is not your current target. !(Target == Mobj)) { - Return True; //Then return that the actor should not be shot. + Return (bFriendly && !IsHostile(Mobj)) || (!bFriendly && !Mobj.bFriendly); //Then return that the actor should not be shot if it isn't hostile to you. } } diff --git a/ZScript.zsc b/ZScript.zsc index 23f09b2..c5fa4e7 100644 --- a/ZScript.zsc +++ b/ZScript.zsc @@ -1,4 +1,4 @@ -Version "4.3.3" +Version "4.7.0" #Include "VanillaRifle.zsc" //The rifle the marine may drop when killed. #Include "MarineFunctions.zsc" //A mixin container for all the marines' custom functions. diff --git a/readme.md b/readme.md index 3eb59a8..f7b5b89 100644 --- a/readme.md +++ b/readme.md @@ -37,10 +37,10 @@ Smart marines are NPCs for Doom that are far more intelligent than vanilla monst - Random (Randomly pick a color.) - Default (Use the default shade of green. Similar to just leaving User_Color empty.) - Most of the marines' behaviour can be configured on a per actor basis using user variables. -- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomied. +- Can have a randomized personality, that gives the marine a random armor color, different attention spans and chances to throw a grenade etc. Adding a custom value to a user variable prevents it from being randomized. - They also have a rifle that they sometimes drop, which you can pick up and use yourself. - The rifle fires at full auto, and needs reloading after firing 20 rounds, just like when the marines use them. You can reload before the magazine fully runs out too. - - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increased you accuracy as well. + - It also features animated digital sights complete with an animation for looking in and out of them, using the sights increases your accuracy as well. - The rifle can be entirely disabled from dropping from dead marines, by enabling User_NoRifleDrop on the marine. More information, such as info on what all the user variables available on the marines are, and what they do. Can be found inside Document.txt