Skip to content

Commit

Permalink
Implemented / and attack elements.
Browse files Browse the repository at this point in the history
  • Loading branch information
alanwatsonforster committed Sep 21, 2023
1 parent 8ebf878 commit 96374e8
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions airpower/aircraft.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,13 @@ def _D(self, altitudechange):
def _C(self, altitudechange):
self._altitude, self._altitudecarry = apaltitude._adjustaltitude(self._altitude, self._altitudecarry, +altitudechange)

def _K(self):
self._report("aircraft has been killed.")
self._destroyed = True

def _A(self, what):
self._report("aircraft attacks with %s." % what)

def _report(self, s):
print("%s: turn %d: %s" % (self._name, self._turn, s))

Expand Down Expand Up @@ -250,6 +257,15 @@ def next(self, s):
["R" , lambda : self._R(30)],
["R30" , lambda : self._R(30)],

["K" , lambda : self._K()],

["AGN" , lambda : self._A("guns")],
["AGP" , lambda : self._A("gun pod")],
["ARK" , lambda : self._A("rockets")],
["ARP" , lambda : self._A("rocket pods")],

["/" , lambda : None]

]

if self._destroyed:
Expand Down

0 comments on commit 96374e8

Please sign in to comment.