Skip to content

Commit

Permalink
Code cleanups and fixes.
Browse files Browse the repository at this point in the history
- Fixed a bug that made the marines start shooting a few times, even when an actor or hitscan blocking line was obstructing their target.
- Fixed the marines' alerting, now marines will also alert each other if they were hurt by a player too, and not just monsters.
- Removed reference to a scrapped taunt feature.
- Updated credits and document.
  • Loading branch information
inkoalawetrust committed May 8, 2022
1 parent 1e531c3 commit 91b9226
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Document.txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ User_NoRifleDrop: Marines will never drop their rifles when killed.
User_RetreatAttempts: The amount of times the marine tries to run out of sight of his target, when he needs to reload.
- Default is 10. -1 makes the marine reload in the open, without trying to get behind cover at all.
User_AlertRange: The distance around which a marine will alert other marines on his side of a target.
- Default is 256 map units. -1 disables alerting entirely for this marine, but still allows them to hear the alerts of other marines.
- Default is 384 map units. -1 disables alerting entirely for this marine, but still allows them to hear the alerts of other marines.
User_EnemyAlertHearingRange: The distance around which a marine can hear the alerts of other, enemy marines.
- Default is 1024 map units. -1 disables hearing enemy alerts entirely, but the marine can still be alerted by other marines on his side.
User_MeleeChance: The chance of the marine to try changing position after smacking something once.
Expand Down
5 changes: 0 additions & 5 deletions MAPINFO
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,4 @@ DoomEdNums
8574 = TurretMarine
8575 = VanillaRifle
8576 = SmartMarineMGTurret
}

GameInfo
{
//AddEventHandlers = "SmartMarineTauntHandler"
}
5 changes: 3 additions & 2 deletions ZScript.zsc
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Class SmartMarine : Actor

Override Bool OkayToSwitchTarget(Actor Other)
{
If (Other.bIsMonster && IsHostile(Other) && Other.Health > 0) {SM_AlertNearbyMarines(User_AlertRange,True);}
If ((Other.bIsMonster || Other.Player) && IsHostile(Other) && Other.Health > 0) {SM_AlertNearbyMarines(User_AlertRange,True);}
Return Super.OkayToSwitchTarget(Other);
}

Expand Down Expand Up @@ -404,7 +404,8 @@ Class SmartMarine : Actor
DecideAttack: //Decide if you should use a turret, throw a grenade, or just shoot.
TNT1 A 0 SM_TurretUseDecision();
TNT1 A 0 A_JumpIf (GrenadeAttackDecision(),"ThrowGrenade"); //The code for GrenadeAttackDecision is in MarineFunctions.zsc.
Goto RifleBurst;
TNT1 A 0 A_JumpIf (!SM_CantHitTarget(True),"RifleBurst"); //Make sure nothing is getting in the way of the rifle hitscans.
Goto ChangePosition;
RifleSmack:
MARA A 3 A_JumpIf (SM_FindNearbyGrenade(),"RunAway");
MARM A 3;
Expand Down
1 change: 0 additions & 1 deletion credits.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Rifle melee sprites made by TG5.
Grenade air blast sprites by Gorman Freebmane.
Grenade sprites made by inkoalawetrust.
Alternate marine death sprites made by DavidG/ItsNatureToDie.
Rocket launcher marine sprites made by Vader, edited by Sergeant_Mark_IV, then edited again by TG5.
Machine gun turret sprites made by Sergeant_Mark_IV, redrawn by TG5.

======|Other graphics|======
Expand Down

0 comments on commit 91b9226

Please sign in to comment.