-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathpromotions.py
58 lines (53 loc) · 1.57 KB
/
promotions.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
def award_medal(grunt, medal, ua):
s = '%s awarded in %s' % (medal, ua)
grunt.decorations.append(s)
grunt.history.append(s)
def get_medal(grunt, roll, target, ua):
if (roll - target) >= 6:
award_medal(grunt, "SEH", ua)
elif (3 <= (roll - target) < 6):
award_medal(grunt, "MCG", ua)
elif (roll - target) < 3:
award_medal(grunt, "MCUF", ua)
def award_ribbon(grunt, ga, ua):
ribbon_type = '%s Combat Ribbon'
if grunt.officer and (ga=='Command'):
ribbon_type = '%s Combat Command Ribbon'
ribbon_name = ribbon_type % ua
grunt.ribbons.append(ribbon_name)
grunt.history.append(ribbon_name)
def promote(grunt):
if grunt.officer:
officer(grunt)
else:
enlisted(grunt)
def enlisted(grunt):
if grunt.officer:
officer(grunt)
return False
grunt.rank += 1
if grunt.rank > 8:
grunt.rank = 8
s = 'No promotion avilable until after OCS'
grunt.history.append(s)
return True
else:
s = 'Promoted to %s' % grunt.military_rank()
grunt.history.append(s)
return True
#end enlisted
def officer(grunt):
if (False == grunt.officer): #error condition, should never hit this
enlisted(grunt)
return False
if grunt.rank == 9:
grunt.rank = 9
s = 'No further promotion availiable.'
grunt.history.append(s)
else:
grunt.rank += 1
grunt.promote_this_term = True
s = 'Promoted to %s' % grunt.military_rank()
grunt.history.append(s)
return True
#end of officer