翔鹰帝国网|帝国时代论坛|帝国时代系列|神话时代
 找回密码
 注册翔鹰会员(昵称)
搜索
查看: 327|回复: 0

[交流] 获取敌方城门的地图ID

[复制链接]

14

主题

0

精华

1165

积分

伯爵

耕战
100
鹰币
320
天龙币
0
回帖
30
附庸关系0
 楼主| 发表于 2020-7-6 13:39:53 | 显示全部楼层 |阅读模式
本帖最后由 wangzhen 于 2020-7-6 13:49 编辑

(defconst wall-class 927);石墙
(defconst gate-class 939);城门
(defconst gl-wall-id 129);获取石墙的地图ID(defconst gl-point2x 130);获得友军位置
(defconst gl-temppoint1x 131);临时判断坐标X
(defconst gl-temppoint1y 132);临时判断坐标Y
;假设通过DUC获取到需要攻击目标 判断攻击目标不可达 执行攻击城门
(defrule
(true)
=>
(up-full-reset-search)
(up-find-local c: 453 c: 1);寻找一个友军单位
(up-get-point position-object gl-point2x);获得友军单位的位置
(up-copy-point gl-temppoint1x gl-point2x)
(up-modify-goal gl-temppoint1x c:- 1);以友军位置判断往地图左边一格
)

(defrule
(not(up-point-contains gl-temppoint1x c: 939))
=>
(up-get-point position-object gl-lumbercamppoint2x)
(up-copy-point gl-temppoint1x gl-lumbercamppoint2x)
(up-modify-goal gl-temppoint1x c:+ 1);以友军位置判断往地图右边一格
)

(defrule
(not(up-point-contains gl-temppoint1x c: 939))
=>
(up-get-point position-object gl-lumbercamppoint2x)
(up-copy-point gl-temppoint1x gl-lumbercamppoint2x)
(up-modify-goal gl-temppoint1y c:- 1);以友军位置判断往地图上边一格
)

(defrule
(not(up-point-contains gl-temppoint1x c: 939))
=>
(up-get-point position-object gl-lumbercamppoint2x)
(up-copy-point gl-temppoint1x gl-lumbercamppoint2x)
(up-modify-goal gl-temppoint1y c:+ 1);以友军位置判断往地图下边一格
)

(defrule
(up-point-contains gl-temppoint1x c: 939)
=>
(up-get-point-contains gl-temppoint1x gl-wall-id c: 939)
)

(defrule
(up-compare-goal gl-wall-id c:!= -1)
(up-compare-goal gl-wall-id c:!= -2)
=>
(up-set-target-by-id g: gl-wall-id)
(up-target-objects 1 action-default -1 -1)
(disable-self)
)


本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册翔鹰会员(昵称)

x
回复

使用道具 举报

本版积分规则

排行榜|小黑屋|翔鹰帝国

GMT+8, 2024-3-29 23:58 , Processed in 0.138456 second(s), 25 queries , File On.

Powered by Hawk Studio  QS Security Corp.® Licensed

Copyright © 2001-2023, Hawkaoe.net All Rights Reserved

快速回复 返回顶部 返回列表