+def calc_effort(ta, t):
+ from server.utils import mv_yx_in_dir_legal
+ if ta["TA_NAME"] == "move":
+ move_result = mv_yx_in_dir_legal(chr(t["T_ARGUMENT"]),
+ t["T_POSY"], t["T_POSX"])
+ if 1 == move_result[0]:
+ pos = (move_result[1] * world_db["MAP_LENGTH"]) + move_result[2]
+ terrain = chr(world_db["MAP"][pos])
+ if terrain == ".":
+ return 2
+ elif terrain == ":":
+ return 4
+ return 1
+world_db["calc_effort"] = calc_effort
+
+