Skip to content

Commit

Permalink
tweaked fighting system
Browse files Browse the repository at this point in the history
  • Loading branch information
Marx Mustermann committed May 18, 2024
1 parent 91a34d0 commit c13990d
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/characters.py
Original file line number Diff line number Diff line change
Expand Up @@ -1367,10 +1367,10 @@ def heal(self, amount, reason=None):
if not amount:
return

if self.reduceExhaustionOnHeal:
self.exhaustion = max(0,self.exhaustion-(amount//self.reduceExhaustionDividend+self.reduceExhaustionBonus))
if self.removeExhaustionOnHeal:
self.exhaustion = 0
#if self.reduceExhaustionOnHeal:
# self.exhaustion = max(0,self.exhaustion-(amount//self.reduceExhaustionDividend+self.reduceExhaustionBonus))
#if self.removeExhaustionOnHeal:
# self.exhaustion = 0

if self.maxHealth - self.health < amount:
amount = self.maxHealth - self.health
Expand Down
5 changes: 4 additions & 1 deletion src/interaction.py
Original file line number Diff line number Diff line change
Expand Up @@ -2532,7 +2532,10 @@ def handleNoContextKeystroke(char,charState,flags,key,main,header,footer,urwid,n
# move the player
if key in (commandChars.wait):
char.timeTaken += 1
char.exhaustion = max(0,char.exhaustion-10)
if char.exhaustion > 1:
char.exhaustion = max(1,char.exhaustion-10)
else:
char.exhaustion = 0
char.lastMoveSkipped = True
return None
if key in (commandChars.move_north, "up"):
Expand Down
6 changes: 5 additions & 1 deletion src/rooms.py
Original file line number Diff line number Diff line change
Expand Up @@ -1730,7 +1730,11 @@ def moveCharacterDirection(self, character, direction, dash=False):
if character in self.characters:
self.removeCharacter(character)
if not dash:
character.timeTaken += character.movementSpeed
multiplier = 1
if character.exhaustion:
character.exhaustion -= 1
multiplier = 1.2
character.timeTaken += character.movementSpeed*multiplier
else:
character.timeTaken += character.movementSpeed/2
character.exhaustion += 5
Expand Down
13 changes: 11 additions & 2 deletions src/terrains.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,12 @@ def enterLocalised(self, char, room, localisedEntry, direction):
return room.itemByCoordinates[localisedEntry][0]

char.changed("moved", (char, direction))
char.timeTaken += char.movementSpeed

multiplier = 1
if char.exhaustion:
char.exhaustion -= 1
multiplier = 1.2
char.timeTaken += char.movementSpeed*multiplier

# teleport the character into the room
room.addCharacter(char, localisedEntry[0], localisedEntry[1])
Expand Down Expand Up @@ -886,7 +891,11 @@ def moveCharacterDirection(self, char, direction, dash=False):

char.changed("moved", (char, direction))
if not dash:
char.timeTaken += char.movementSpeed
multiplier = 1
if char.exhaustion:
char.exhaustion -= 1
multiplier = 1.2
char.timeTaken += char.movementSpeed*multiplier
else:
char.timeTaken += char.movementSpeed/2
char.exhaustion += 5
Expand Down

0 comments on commit c13990d

Please sign in to comment.