Skip to content

Commit

Permalink
Added Bolt Counter
Browse files Browse the repository at this point in the history
  • Loading branch information
hero-clashes committed Jun 15, 2024
1 parent 362c30d commit f878bf8
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/itemFolder/military/boltTower.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import src
from src.rooms import Room


class BoltTower(src.items.Item):
Expand All @@ -17,7 +18,7 @@ def __init__(self):
super().__init__(display="/\\")
self.charges = 7
self.faction = None

self.pos
def apply(self, character):
self.showTargetingHud({"character":character})

Expand Down Expand Up @@ -49,12 +50,19 @@ def showTargetingHud(self,params):
character.timeTaken += 1

def rerender():
roomRender = self.container.render(advanceAnimations=False)
if isinstance(self.container,Room) :
roomRender = self.container.render(advanceAnimations = False)
else:
roomRender = self.container.render(size=(12,12),coordinateOffset = ((self.getTerrainPosition()[0] + 2)* 15 + 1 ,(self.getTerrainPosition()[1])* 15 + 1))

for line in roomRender:
line.append("\n")

return [roomRender,extraText,"\npress wasd to shoot \npress . to wait"]
if self.charges>0:
charges_text = self.charges
else:
charges_text = "no"
return [roomRender,extraText,f"you have {charges_text} shots left","\npress wasd to shoot \npress . to wait"]

submenue = src.interaction.OneKeystrokeMenu(rerender())
submenue.rerenderFunction = rerender
Expand Down

0 comments on commit f878bf8

Please sign in to comment.