Lebegő számok
This commit is contained in:
@@ -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))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user