Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added Bolt Counter #49

Merged
merged 2 commits into from
Jun 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading