home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
TCE: Refactor eating.
[plomrogue]
/
plugins
/
server
/
TheCrawlingEater.py
diff --git
a/plugins/server/TheCrawlingEater.py
b/plugins/server/TheCrawlingEater.py
index d9b827bc3b28965879878b89300e6e397fef94d5..cf6f204d8933505190f4e6b0121c67a13ed3fc51 100644
(file)
--- a/
plugins/server/TheCrawlingEater.py
+++ b/
plugins/server/TheCrawlingEater.py
@@
-129,14
+129,15
@@
def actor_move(t):
t["pos"] = move_result[1] * world_db["MAP_LENGTH"] + move_result[2]
build_fov_map(t)
else:
t["pos"] = move_result[1] * world_db["MAP_LENGTH"] + move_result[2]
build_fov_map(t)
else:
- if t["T_BOWEL"] >= 32 or chr(world_db["MAP"][pos]) == "5":
+ height = world_db["MAP"][pos] - ord("0")
+ if t["T_BOWEL"] >= 32 or height == 5:
return
eaten = False
return
eaten = False
- if
chr(world_db["MAP"][pos]) == "3"
and 0 == int(rand.next() % 2):
- t["T_BOWEL"] +=
3
+ if
height == 3
and 0 == int(rand.next() % 2):
+ t["T_BOWEL"] +=
height
eaten = True
eaten = True
- elif
chr(world_db["MAP"][pos]) == "4"
and 0 == int(rand.next() % 5):
- t["T_BOWEL"] +=
4
+ elif
height == 4
and 0 == int(rand.next() % 5):
+ t["T_BOWEL"] +=
height
eaten = True
log("You EAT.")
if eaten:
eaten = True
log("You EAT.")
if eaten: