home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer 1999 November
/
CD-Gamer_1999-11_02_cd.bin
/
games
/
fleetcom
/
data1.cab
/
Doctrines_Files
/
SubAtkSub.txt
< prev
next >
Wrap
Text File
|
1999-07-22
|
3KB
|
156 lines
TITLE SubAtkSubDef
; Timer 1 : TMA Leg timer
; Var 1 : Min firing range
; Var 2 : Store speed before changing it
; Var 3 : Closing speed calculation
; Var 4 : 0 = Closing target, 1 = Receding target
; Var 5 : Oblique approach angle
; Var 6 : priority of this action
; Var 7 : indicates if we did a shot already at active pinger
RULE Randomize firing range
IF INIT = 1 THEN
VAR_SET 1 {3500,6000}
VAR_SET 6 200
VAR_SET 7 0
ELSE
RULE let sub attack sub
IF VAR6 > 0 THEN
;if the guy is actively pinging us, then lets waste him!
RULE attack active intercept
IF SOURCE = "Active Intercept" AND VAR7 = 0 THEN
DEBUG "Attacking Active Ping"
ATTACK_BEST
VAR_SET 7 1
ELSE
PRIORITY VAR6
RULE Store current speed
IF NEWTRACK = 1 THEN
VAR_SET 2 SPD
END
RULE Avoid Friendly
IF ID = FRIEND OR ID = UAF THEN
DONE
DEBUG "AVOID FRIENDLY!"
TACTIC SubAvoidSub
END
RULE ID
IF ID = UPD THEN
DEBUG "UPD!"
PRIORITY VAR6
VAR_SET 5 BRG
RULE New Leg
IF TIMER3 = -1 THEN
DEBUG "Silos:"
DEBUG SILOS
RULE Approaching?
IF SILOS > 0 THEN
DEBUG "UPD Opening Pursuit"
VAR_SET 4 1
VAR_SET 3 OWNSPD
VAR_ADD 3 SILOS
VAR_ADD 3 {3,5}
ELSE
DEBUG "UPD Approaching Leg"
VAR_SET 4 0
VAR_SET 3 {6,8}
VAR_SET 5 BRG
RULE Compute oblique angle for leg
IF AOB < 0 THEN
VAR_SUB 5 {30,60}
ELSE
VAR_ADD 5 {30,60}
END
END
SET_TIMER 3 {300,420}
END
RULE Proceed on leg, or pursue
IF VAR4 = 0 THEN
DEBUG "Proceed on Leg to UPD"
PRIORITY VAR6
SETCRS VAR5
ELSE
DEBUG "pursue to UPD"
PRIORITY VAR6
STEER_TO
END
RULE Minimum speed
IF VAR3 < 4 THEN
VAR_SET 3 4
END
PRIORITY VAR6
SETSPD VAR3
END
RULE ID Hostile
IF ID = HOSTILE OR ID = UAE THEN
DEBUG "Hostile!"
VAR_SET 5 BRG
RULE New Closing Leg
IF RNG > VAR1 AND TIMER1 = -1 THEN
DEBUG "Silos:"
DEBUG SILOS
RULE Approaching?
IF SILOS > 0 THEN
DEBUG "Hostile Opening Pursuit"
VAR_SET 4 1
VAR_SET 3 OWNSPD
VAR_ADD 3 SILOS
VAR_ADD 3 {3,5}
ELSE
DEBUG "Hostile Approaching Leg"
VAR_SET 4 0
VAR_SET 3 {6,8}
VAR_SET 5 BRG
RULE Compute oblique angle for leg
IF AOB < 0 THEN
VAR_SUB 5 {30,60}
ELSE
VAR_ADD 5 {30,60}
END
END
SET_TIMER 1 {480,600}
END
RULE Proceed on leg, or pursue
IF VAR4 = 0 THEN
DEBUG "Proceed on Leg to Hostile"
PRIORITY VAR6
SETCRS VAR5
ELSE
DEBUG "Pursue Hostile"
PRIORITY VAR6
STEER_TO
END
RULE Minimum speed
IF VAR3 < 4 THEN
VAR_SET 3 4
END
PRIORITY VAR6
SETSPD VAR3
RULE Attack
IF ( RNG < 6000 AND CONF > 40 ) OR
RNG < VAR1 OR
( CONF > 60 AND SILOS > 0 ) THEN
DEBUG "Attack Best Hostile"
PRIORITY VAR6
ATTACK_BEST
END
END
RULE PostLaunch
IF WEAPON_AWAY = 1 THEN
DEBUG "Avoid after shooting"
TACTIC SubAvoidSub
END
END ;if not active ping
END ;let sub engage
END