Skip to content

Commit

Permalink
Merge pull request #49 from hero-clashes/master
Browse files Browse the repository at this point in the history
Added Bolt Counter. Thx for the donation
  • Loading branch information
MarxMustermann authored Jun 15, 2024
2 parents d7b4fa5 + 55a5b5f commit cbafa40
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 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,6 @@ def __init__(self):
super().__init__(display="/\\")
self.charges = 7
self.faction = None

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

Expand Down Expand Up @@ -49,12 +49,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 cbafa40

Please sign in to comment.