wangzhen 发表于 2020-6-4 22:36:04

每10秒显示村民状态

本帖最后由 wangzhen 于 2020-6-5 01:39 编辑

侦察村民 想吧资源存储量 采集工人分配到资源存储量比较少食物采集 牧羊工 农夫 采果 猎人数量调整
#load-if-defined UP-AVAILABLE
(load "Promi\const")
#end-if
(defconst gl-lumberwork 101);砍树工
(defconst gl-goldwork 102);采金工
(defconst gl-stonework 103) ;采石工
(defconst gl-sheepwork 104) ;牧羊人
(defconst gl-farmerwork 105);农夫
(defconst gl-foragerwork 106);采果工
(defconst gl-hunterwork 107) ;猎人
(defconst gl-fishwork 108)   ;渔夫

(defconst gl-lumber-resource 110);树木资源
(defconst gl-gold-resource 111);金矿资源
(defconst gl-stone-resource 112) ;石矿资源
(defconst gl-forage-resource 113);果树资源
(defconst gl-local-total 114)
(defconst gl-local-last 115)
(defconst gl-remote-total 116)
(defconst gl-remote-last 117)


(defrule
(true)
=>
    (set-goal gl-hunterwork 0)
      (set-goal gl-fishwork 0)
      (set-goal gl-lumberwork 0)
      (set-goal gl-goldwork 0)
      (set-goal gl-stonework 0)
      (set-goal gl-sheepwork 0)
      (set-goal gl-farmerwork 0)
      (set-goal gl-foragerwork 0)
      (set-strategic-number sn-placement-zone-size 0)
      (set-strategic-number sn-placement-fail-delta 1)
      (set-strategic-number sn-percent-civilian-gatherers20)
    (set-strategic-number sn-percent-civilian-builders80)
      ;(set-strategic-number sn-enable-new-building-system1)
      (set-strategic-number sn-enable-training-queue1)
      (set-strategic-number sn-maximum-food-drop-distance -1)
      (set-strategic-number sn-maximum-wood-drop-distance -1)
      (set-strategic-number sn-maximum-gold-drop-distance -1)
      (set-strategic-number sn-maximum-stone-drop-distance -1)
      (set-strategic-number sn-maximum-hunt-drop-distance 8)
      (set-strategic-number sn-mill-max-distance 15)
      (up-set-timer c: 1 c: 10)
      (up-set-timer c: 2 c: 10)
      (up-set-timer c: 3 c: 10)
      (disable-self)
)   

(defrule
(true)
=>
    (set-strategic-number sn-preferred-mill-placement 0)
      (set-strategic-number sn-cap-civilian-explorers 0)
      (set-strategic-number sn-percent-civilian-explorers 0)
      (set-strategic-number sn-percent-enemy-sighted-response 100)
      (set-strategic-number sn-hits-before-alliance-change 25)
      (set-strategic-number sn-number-explore-groups 1)
      (set-strategic-number sn-percent-attack-soldiers 0)
      (set-strategic-number sn-task-ungrouped-soldiers 0)
      (set-strategic-number sn-number-attack-groups 0)
      (set-strategic-number sn-enemy-sighted-response-distance 10)
      (set-strategic-number sn-total-number-explorers 0)
      (set-strategic-number sn-relic-return-distance 0)
(disable-self)
)
(defrule
(timer-triggered 1)
=>
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id != lid-villager-lumberjack)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人砍树" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id != lid-villager-gold-miner)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人采金" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id != lid-villager-stone-miner )
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人采石" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(disable-timer 1)
(enable-timer 1 10)
)

(defrule
(timer-triggered 2)
=>
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id != lid-villager-shepherd)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人吃羊" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id != lid-villager-farmer)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人种田" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id != lid-villager-forager)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人采果" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(disable-timer 2)
(enable-timer 2 10)
)

(defrule
(timer-triggered 3)
=>
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id != lid-villager-hunter )
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人打猎" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(up-full-reset-search)
(up-find-local c: villager-class c: 240)
(up-remove-objects search-local object-data-language-id == lid-villager-fisherman )
(up-remove-objects search-local object-data-language-id == lid-villager-hunter )
(up-remove-objects search-local object-data-language-id == lid-villager-forager)
(up-remove-objects search-local object-data-language-id == lid-villager-farmer)
(up-remove-objects search-local object-data-language-id == lid-villager-shepherd)
(up-remove-objects search-local object-data-language-id == lid-villager-stone-miner )
(up-remove-objects search-local object-data-language-id == lid-villager-gold-miner)
(up-remove-objects search-local object-data-language-id == lid-villager-lumberjack)
(up-remove-objects search-local object-data-language-id == lid-villager-builder )
(up-remove-objects search-local object-data-language-id == lid-villager-repairer)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d人闲着" g: gl-local-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(disable-timer 3)
(enable-timer 3 10)
)


(defrule
(taunt-detected 1 6)
=>
(up-full-reset-search)
(up-reset-filters)
(up-filter-status c: status-resource c: list-active)
(up-find-resource c: wood c: 240)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d树木" g: gl-remote-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(up-full-reset-search)
(up-reset-filters)
(up-filter-status c: status-resource c: list-active)
(up-find-resource c: gold c: 240)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d金矿" g: gl-remote-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(up-full-reset-search)
(up-reset-filters)
(up-filter-status c: status-resource c: list-active)
(up-find-resource c: stone c: 240)
(up-get-search-state gl-local-total)
(up-chat-data-to-all "有%d石矿" g: gl-remote-total)
(set-goal gl-local-total 0)
(set-goal gl-local-last 0)
(set-goal gl-remote-total 0)
(set-goal gl-remote-last 0)
(acknowledge-taunt 1 6)
)



newtonerdai 发表于 2020-6-5 00:42:39

所以你想表达什么吗?
只发代码的话,有点让人难以体会你的意图啊
页: [1]
查看完整版本: 每10秒显示村民状态