X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;f=roguelike-server;h=4e46788595bc942f116ca2a913c628798ca29b1a;hb=90f5ee88eb6b6d6ca5784e3d5188a838fa17aeaa;hp=3c4fd894b9c187553d71f9eaf984102615ac5274;hpb=291bf4d2137c7d04c3c7d5ce310da1f182384c28;p=plomrogue
diff --git a/roguelike-server b/roguelike-server
index 3c4fd89..4e46788 100755
--- a/roguelike-server
+++ b/roguelike-server
@@ -1348,7 +1348,7 @@ def ai(t):
"""Determine next command/argment for actor t via AI algorithms."""
# 7DRL add: Don't pick up or search things when inventory is full.
if t == world_db["Things"][0]:
- log("%AI------")
+ log("%AI------")
t["T_COMMAND"] = [id for id in world_db["ThingActions"]
if world_db["ThingActions"][id]["TA_NAME"] == "wait"][0]
if get_dir_to_target(t, "f"):
@@ -1389,6 +1389,7 @@ def ai(t):
def turn_over():
"""Run game world and its inhabitants until new player input expected."""
+ # 7DRL: effort of move action is TA_EFFORT / sqrt(TT_LIFEPOINTS)
id = 0
whilebreaker = False
while world_db["Things"][0]["T_LIFEPOINTS"]:
@@ -1417,7 +1418,14 @@ def turn_over():
taid = [a for a in world_db["ThingActions"]
if a == Thing["T_COMMAND"]][0]
ThingAction = world_db["ThingActions"][taid]
- if Thing["T_PROGRESS"] == ThingAction["TA_EFFORT"]:
+ #if Thing["T_PROGRESS"] == ThingAction["TA_EFFORT"]:
+ effort = ThingAction["TA_EFFORT"] # #
+ if ThingAction["TA_NAME"] == "move": # #
+ type = Thing["T_TYPE"] # #
+ max_hp = (world_db["ThingTypes"][type] # #
+ ["TT_LIFEPOINTS"]) # #
+ effort = int(effort / math.sqrt(max_hp)) # #
+ if Thing["T_PROGRESS"] == effort: # #
eval("actor_" + ThingAction["TA_NAME"])(Thing)
Thing["T_COMMAND"] = 0
Thing["T_PROGRESS"] = 0