这里用的计时器的原理是怎样的?
(defrule(can-research feudal-age);可以研究封建时代的情况下
=>
(set-strategic-number sn-food-gatherer-percentage 40)
(set-strategic-number sn-gold-gatherer-percentage 15)
(set-strategic-number sn-stone-gatherer-percentage 5)
(set-strategic-number sn-wood-gatherer-percentage 40)
(set-strategic-number sn-percent-civilian-explorers 0)
;人员分配
(set-escrow-percentage food 10);上供比例
(enable-timer TIMER_30S 30);倒计时
(research feudal-age)
(disable-self)
)
(defrule
(timer-triggered TIMER_30S) ;触发计时器30
(military-population > 0) ;部队人口数
(or
(players-unit-type-count any-enemy villager > 0)
(players-building-count any-enemy > 0)
)
=>
(attack-now)
(enable-timer TIMER_30S 30)
) 楼顶的AI是指升封的时候开启计时器,30s之后,如果有兵,每30s进攻一次,或者一旦发现敌人的单位,马上进攻并重启刷新计时器。 谢谢。现在看了文档后,已经懂得定时器的使用
页:
[1]