X-Git-Url: https://plomlompom.com/repos/foo.html?a=blobdiff_plain;ds=sidebyside;f=plugins%2Fserver%2FPleaseTheIslandGod.py;h=f12db06572668eed1d0df2cff916066d3246292c;hb=59d19fe458fddd7fbb63d4089b030e0d31633221;hp=799efeba51f50af5c76cdf3508414f15c4e44765;hpb=a88fab7f404b3f2a09b8002935e6f80b7bdbc845;p=plomrogue
diff --git a/plugins/server/PleaseTheIslandGod.py b/plugins/server/PleaseTheIslandGod.py
index 799efeb..f12db06 100644
--- a/plugins/server/PleaseTheIslandGod.py
+++ b/plugins/server/PleaseTheIslandGod.py
@@ -693,6 +693,16 @@ def write_metamap_B():
metamapB[pos] = ord(name[0])
return write_map(metamapB, length)
+def calc_effort(thing_action, thing):
+ from math import sqrt
+ effort = thing_action["TA_EFFORT"]
+ if thing_action["TA_NAME"] == "move":
+ typ = thing["T_TYPE"]
+ max_hp = (world_db["ThingTypes"][typ]["TT_LIFEPOINTS"])
+ effort = int(effort / sqrt(max_hp))
+ effort = 1 if effort == 0 else effort
+ return effort
+
strong_write(io_db["file_out"], "PLUGIN PleaseTheIslandGod\n")
if not "GOD_FAVOR" in world_db:
@@ -752,4 +762,5 @@ import server.config.misc
server.config.misc.make_map_func = make_map
server.config.misc.thingproliferation_func = thingproliferation
server.config.misc.make_world = make_world
-server.config.decrement_lifepoints_func = decrement_lifepoints
+server.config.misc.decrement_lifepoints_func = decrement_lifepoints
+server.config.misc.calc_effort_func = calc_effort