-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathschools.py
174 lines (146 loc) · 5.33 KB
/
schools.py
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
from dice import *
from arm_data import *
import skills
specialist_school_table = ['Admin', 'Medical', 'Commo', 'Computer', 'Mechanical', 'Electronics']
schools = {}
schools['Commando School'] = {
"threshold":5,
"skills":['Brawling', 'Gun Cmbt', 'Demolition', 'Wilderness Survival', 'Recon', 'Vac Suit', 'Blade Cbt', 'Instruction']
}
schools['Intelligence School'] = {
"threshold":4,
"skills":['Forgery', 'Bribery', 'Streetwise', 'Interrogation']
}
schools['Command College'] = {
"threshold":4,
"skills":['Tactics', 'Leadership', 'Recon']
}
schools['Staff College'] = {
"threshold":4,
"skills":['Admin', 'Engineering', 'Computer']
}
def cross_train(grunt):
'Book 4 cross training'
if grunt.is_navy():
print 'X-Training in the navy!' #debug
b5_data.navy_xtrain(grunt)
else:
if grunt.arm == 'Commando':
arm_index = dice(sides=4)-1 # any of the other arms
else:
arm_index = dice(sides=3) # any but Commando/Infantry
if arms[arm_index] == grunt.arm:
arm_index = 0 # can't cross-train in your own arm; set to infantry
crossarm = arms[arm_index]
grunt.xtrained.append(crossarm)
s = 'Cross-trained in ' + crossarm
grunt.history.append(s)
skills.get_mos_skill(grunt)
#end of cross_train
def specialist_school(grunt):
roll = dice()
sSkill = specialist_school_table[roll - 1]
school = sSkill
s = 'Attended %s school' % school
grunt.history.append(s)
grunt.add_skill(sSkill)
school_text = 'Specialist School: ' + sSkill
grunt.schools.append(school_text)
#send of specialist_school
def pf_training(grunt):
grunt.schools.append('Protected Forces')
grunt.history.append('Protected Forces Training')
# need to add check for number of skills
# if has level 2 in any of the listed skills
# then the character is an instructor at the school
# and gets one level of Instruction skill
if dice() >= 3:
grunt.add_skill('Vac Suit')
if dice() >= 3:
grunt.add_skill('Zero-G Cbt')
#end of pf_training
def ocs(grunt):
if grunt.officer == True:
raise Exception("Officers cannot attend OCS")
grunt.history.append('Attending OCS')
grunt.schools.append('OCS')
grunt.officer = True
grunt.rank = 0
skills.get_command_skill(grunt)
skills.get_staff_skill(grunt)
#IA and IM, in addition get a MOS Table skill
if grunt.is_army() or grunt.is_marine():
roll = dice()
skill = grunt.arm_entry(special_marine_infantry=False)["mos"][roll-1]
grunt.add_skill(skill)
else:
raise Exception("Navy cannot attend OCS")
#end of ocs
def recruiting(grunt):
grunt.add_skill('Recruiting')
def officer_recruiting(grunt):
recruiting(grunt)
grunt.specials.append('Recruiting')
def officer_special_assign(grunt, school):
# TODO: need to add check for number of skills
# if has level 2 in any of the listed skills
# then the character is an instructor at the school
# and gets one level of Instruction skill
# TODO: is that for all schools?
grunt.schools.append(school)
grunt.history.append(school)
threshold = schools[school]["threshold"]
for skill in schools[school]["skills"]:
if dice() >= threshold:
grunt.add_skill(skill)
def attache_or_aide(grunt):
if dice()-1 > 3:
grunt.upp.soc += 1
grunt.specials.append('Aide to General officer')
grunt.history.append('Aide to General officer')
grunt.history.append('+1 Soc')
else:
grunt.stat_change("soc", 1)
grunt.rank += 1 #Not using promote() here because this can override the 1 promotion per term rule
if grunt.rank > 8:
grunt.rank = 8
grunt.history.append('Already at Max Officer rank. No promotion')
grunt.specials.append('Military Attache')
grunt.history.append('Military Attache')
grunt.history.append('+1 Soc & promotion')
def intelligence_school(grunt):
officer_special_assign(grunt, 'Intelligence School')
def command_college(grunt):
officer_special_assign(grunt, 'Command College')
def staff_college(grunt):
officer_special_assign(grunt, 'Staff College')
def commando_school(grunt):
officer_special_assign(grunt, 'Commando School')
sa_enl = [
{"name":'Cross Trng', "apply":cross_train},
{"name":'Specialist School', "apply":specialist_school},
{"name":'Commando School', "apply":commando_school},
{"name":'Protected Forces', "apply":pf_training},
{"name":'Recruiting', "apply":recruiting},
{"name":'OCS', "apply":ocs},
{"name":'OCS', "apply":ocs},
]
sa_officer = [
{"name":'Intelligence School', "apply":intelligence_school},
{"name":'Command College', "apply":command_college},
{"name":'Staff College', "apply":staff_college},
{"name":'Commando School', "apply":commando_school},
{"name":'Recruiting', "apply":officer_recruiting},
{"name":'Military Attache/Aide', "apply":attache_or_aide},
]
def special_assign(grunt):
roll = dice()-1
if grunt.officer:
s = 'Special Assignment is %s' % sa_officer[roll]["name"]
grunt.history.append(s)
sa_officer[roll]["apply"](grunt)
else:
s = 'Special Assignment is %s' % sa_enl[roll]["name"]
grunt.history.append(s)
sa_enl[roll]["apply"](grunt)
#end of special_assignment