_CyZ_Kaiser 发表于 2008-6-29 13:33:37

AI语法中or不能一次放超过2个条件吗?

(defrule
      (goal GOAL-ANTI-ARCHER 0)
      (or (players-unit-type-count any-enemy longbowman-line > 12) ;长弓兵
                (or (players-unit-type-count any-enemy chu-ko-nu-line > 12);诸葛弩
                (players-unit-type-count any-enemyplumed-archer-line > 11);羽箭手 )
                )
=>

      (chat-to-allies "发现敌人远程部队!")
      (set-goal GOAL-ANTI-ARCHER 1)
)


看见boom有这样的写法,不明白,这些部队都可以放在一起吧?



      (or (players-unit-type-count any-enemy longbowman-line > 12) ;长弓兵
               (players-unit-type-count any-enemy chu-ko-nu-line > 12);诸葛弩
               (players-unit-type-count any-enemyplumed-archer-line > 11);羽箭手
                )

_CCC_大智 发表于 2008-7-4 13:13:48

自己测试一下不就搞掂咯?
页: [1]
查看完整版本: AI语法中or不能一次放超过2个条件吗?