-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCONQRULE
103 lines (90 loc) · 3.52 KB
/
CONQRULE
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
###############################################################################
#
# C O N Q R U L E S
#
# Copyright (C)1985-1986 by Jef Poskanzer and Craig Leres
#
# Permission to use, copy, modify, and distribute this software and
# its documentation for any purpose and without fee is hereby granted,
# provided that this copyright notice appear in all copies and in all
# supporting documentation. Jef Poskanzer and Craig Leres make no
# representations about the suitability of this software for any
# purpose. It is provided "as is" without express or implied warranty.
#
###############################################################################
#
# Detailed revision history lives in "incl/conqdef"
#
###############################################################################
# Toggle shields if an enemy has gotten close or if there are enemy torps.
dne <= 3 & shields >= 2 & ! shup ; ROB_SHIELD
incoming > 0 & shields >= 2 & ! shup ; ROB_SHIELD
# Allocate to weapons if an enemy has gotten close.
dne <= 3 & ! walloc ; ROB_ALLOCATE
# Weapon rules. Avoid phasers if we can't aim them.
dne <= 3 & fuel > 0 & phaserdam > 3 & ! enemycloaked ; ROB_PHASER
dne <= 3 & fuel > 1 & torpdam > 0 & numtorps >= 3 ; ROB_BURST
dne <= 3 & fuel > 0 & torpdam > 0 & numtorps > 0 ; ROB_TORPEDO
# Detonate rules.
fuel > 0 & incoming > 0 & damage < 8 ; ROB_DETONATE
dne < 3 & numtorps < 3 & wtemp < 8 ; ROB_MYDETONATE
# Lower shields when it's safe.
dne > 3 & incoming == 0 & shup ; ROB_SHIELD
# Deallocate weapons if we're not going to use them.
dne > 3 & walloc ; ROB_ALLOCATE
# Movement rules. Don't set warp if we are orbiting. (But notice that
# if we decide to lock on to a new planet, we're no longer orbiting
# and can set warp. Be careful to avoid continuous speed changes.
! orbiting & fuel == 0 & warp != 0 ; ROB_WARP_0
! orbiting & etemp >= 9 & warp != 0 ; ROB_WARP_0
! orbiting & fuel > 0 & warp != 2 & damage < 9 &
etemp > 7 & etemp < 9 ; ROB_WARP_2
! orbiting & fuel > 0 & warp != 5 & damage < 7 &
etemp > 4 & etemp < 7 ; ROB_WARP_5
! orbiting & fuel >= 3 & warp != 8 & damage < 5 &
etemp < 4 ; ROB_WARP_8
# Course rules.
dne < 9 & fuel >= 5 & damage < 2 ; ROB_TRACK
! orbiting & dne <= 3 & damage <= 6 & fuel >= 4 & enemydamage >= 8 ; ROB_TRACK
! orbiting & dne <= 3 & damage >= 5 & damage < 9 & fuel > 0 ; ROB_RUNAWAY
fuel < 2 & warp != 0 & damage < 4 ; ROB_GOFUEL
! orbiting & warp != 0 & damage >= 4 ; ROB_GOREPAIR
# Repair rules. If we're damaged and in orbit, repair. If we're damaged and
# can't move (i.e. warp is zero), repair.
dne > 3 & incoming == 0 & damage > 0 & ! repairing & orbiting ; ROB_REPAIR
dne > 3 & incoming == 0 & damage > 0 & ! repairing & ! orbiting &
warp == 0 ; ROB_REPAIR
# This rule is probably covered by the previous one.
## dne > 3 & incoming == 0 & damage >= 9 & ! repairing ; ROB_REPAIR
# Send our enemy some insults when he's approaching.
random == 3 & dne >= 7 & dne <= 8 ; ROB_INSULT
# Read a message if we can.
canread ; ROB_READMSG
# If nothing happens for awhile, go home.
random == 7 & dne >= 9 & ! orbiting ; ROB_GOHOME
#
# random dne damage incoming
# fuel numtorps shields etemp
# wtemp phaserdam torpdam warp
# shup walloc orbiting repairing
# enemycloaked enemydamage canread
#
# dist value
# 0 0
# 100 1
# 600 1
# 700 2
# 1300 2
# 1400 3
# 2000 3
# 2100 4
# 2800 4
# 2900 5
# 3600 5
# 3700 6
# 4500 6
# 4600 7
# 5500 7
# 5600 8
# 6700 8
# 6800 9