Lebegő számok

This commit is contained in:
markojozsef
2026-10-17 15:31:14 +02:00
parent f26964e697
commit a4cb6136a8
4 changed files with 51 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
import math
import math
K_NORMAL = 100
K_DEFUP = 50
@@ -56,7 +56,7 @@ class Action:
def __repr__(self):
return self.__str__()
def execute(self):
def execute(self, damage_callback):
target = self.where
if self.who.ko or self.who.stone:
print(f" -> {self.who.name} cannot move!")
@@ -91,8 +91,10 @@ class Action:
if delta_hp > 0:
print(f" -> {target.name} got healed for {delta_hp} HP!")
damage_callback(delta_hp, target)
elif delta_hp < 0:
print(f" -> {target.name} suffered {-delta_hp} damage!")
damage_callback(delta_hp, target)
target.hp = max(0, min(target.maxhp, target.hp + delta_hp))