- #hitted = [tid for tid in world_db["Things"]
- # if world_db["Things"][tid] != t
- # if world_db["Things"][tid]["T_LIFEPOINTS"]
- # if world_db["Things"][tid]["T_POSY"] == move_result[1]
- # if world_db["Things"][tid]["T_POSX"] == move_result[2]]
- #if len(hitted):
- # hit_id = hitted[0]
- # hitted_tid = world_db["Things"][hit_id]["T_TYPE"]
- # if t == world_db["Things"][0]:
- # hitted_name = world_db["ThingTypes"][hitted_tid]["TT_NAME"]
- # log("You BUMP into " + hitted_name + ".")
- # elif 0 == hit_id:
- # hitter_name = world_db["ThingTypes"][t["T_TYPE"]]["TT_NAME"]
- # log(hitter_name +" BUMPS into you.")
- # return
+ hitted = [tid for tid in world_db["Things"]
+ if world_db["Things"][tid]["T_POSY"] == move_result[1]
+ if world_db["Things"][tid]["T_POSX"] == move_result[2]]
+ if len(hitted):
+ hit_id = hitted[0]
+ hitted_tid = world_db["Things"][hit_id]["T_TYPE"]
+ if t == world_db["Things"][0]:
+ hitted_name = world_db["ThingTypes"][hitted_tid]["TT_NAME"]
+ log("You SUCK from " + hitted_name + ".")
+ elif 0 == hit_id:
+ hitter_name = world_db["ThingTypes"][t["T_TYPE"]]["TT_NAME"]
+ log(hitter_name +" SUCKS from you.")
+ hitted = world_db["Things"][hit_id]
+ if t["T_STOMACH"] < 32:
+ t["T_STOMACH"] = t["T_STOMACH"] + 1
+ hitted["T_STOMACH"] -= 1
+ if t["T_KIDNEY"] < 32:
+ t["T_KIDNEY"] = t["T_KIDNEY"] + 1
+ hitted["T_KIDNEY"] -= 1
+ return