home
·
contact
·
privacy
projects
/
plomrogue
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Server, plugin: Refactor ai (plugin hooks).
[plomrogue]
/
server
/
ai.py
diff --git
a/server/ai.py
b/server/ai.py
index a243aa4dfc9e49d20c096162089185576fd21e7f..0d1effce2262a6f0473d270e4a37ad3128cc19de 100644
(file)
--- a/
server/ai.py
+++ b/
server/ai.py
@@
-285,12
+285,13
@@
def ai(t):
if get_dir_to_target(t, "f"):
return
sel = get_inventory_slot_to_consume(t)
if get_dir_to_target(t, "f"):
return
sel = get_inventory_slot_to_consume(t)
+ from server.config.ai import ai_hook_pickup_test
if -1 != sel:
t["T_COMMAND"] = [id for id in world_db["ThingActions"]
if world_db["ThingActions"][id]["TA_NAME"]
== "use"][0]
t["T_ARGUMENT"] = sel
if -1 != sel:
t["T_COMMAND"] = [id for id in world_db["ThingActions"]
if world_db["ThingActions"][id]["TA_NAME"]
== "use"][0]
t["T_ARGUMENT"] = sel
- elif standing_on_food(t):
+ elif standing_on_food(t)
and ai_hook_pickup_test(t)
:
t["T_COMMAND"] = [id for id in world_db["ThingActions"]
if world_db["ThingActions"][id]["TA_NAME"]
== "pickup"][0]
t["T_COMMAND"] = [id for id in world_db["ThingActions"]
if world_db["ThingActions"][id]["TA_NAME"]
== "pickup"][0]