骑马与砍杀中文站论坛

 找回密码
 注册(Register!)

QQ登录

只需一步,快速开始

搜索
购买CDKEY 小黑盒加速器
查看: 3365|回复: 3

[功能与代码] 战斗中召唤单位

[复制链接]

10

主题

7

回帖

45

积分

扈从

Rank: 2Rank: 2

UID
3645558
第纳尔
140
精华
0
互助
8
荣誉
0
贡献
0
魅力
51
注册时间
2024-4-15
鲜花(6) 鸡蛋(0)
发表于 2024-4-15 19:47:39 | 显示全部楼层 |阅读模式


## 战斗中召唤单位

**触发器是箭矢击中或武器攻击请看清楚 所有人均可使用**

1. 箭矢击中触发器;在以箭矢落点为重心的等边三角形的三个顶点上分别生成1名设定好的友方士兵:(300为重心到顶点的距离)

```python
(assign,":trp_id","trp_bandit"), #请配置trp_id为你需要的单位id,trp_bandit为示例id,请勿使用trp_bandit

(store_trigger_param_1, ":var_0"),
(agent_get_group, ":var_1", ":var_0"),
(agent_get_team, ":var_2", ":var_0"),
(position_rotate_z, pos1, -30),
(position_move_x, pos1, -300, 0),
(set_spawn_position, pos1),
(spawn_agent, ":trp_id"),
(agent_set_group, reg0, ":var_1"),
(agent_set_team, reg0, ":var_2"),
(agent_add_relation_with_agent, reg0, ":var_0", 1),
(position_move_x, pos1, 300, 0),
(position_rotate_z, pos1, -120),
(position_move_x, pos1, -300, 0),
(set_spawn_position, pos1),
(spawn_agent, ":trp_id"),
(agent_set_group, reg0, ":var_1"),
(agent_set_team, reg0, ":var_2"),
(agent_add_relation_with_agent, reg0, ":var_0", 1),
(position_move_x, pos1, 300, 0),
(position_rotate_z, pos1, -120),
(position_move_x, pos1, -300, 0),
(set_spawn_position, pos1),
(spawn_agent, ":trp_id"),
(agent_set_group, reg0, ":var_1"),
(agent_set_team, reg0, ":var_2"),
(agent_add_relation_with_agent, reg0, ":var_0", 1),
```

2. 箭矢击中或武器攻击触发器;在以召唤者为重心的等边三角形的三个顶点上分别生成1名设定好的友方士兵:(300为重心到顶点的距离)

```python
(assign,":trp_id","trp_bandit"), #请配置trp_id为你需要的单位id,trp_bandit为示例id,请勿使用trp_bandit

(store_trigger_param_1, ":var_0"),
(agent_get_group, ":var_1", ":var_0"),
(agent_get_team, ":var_2", ":var_0"),
(agent_get_position, pos2, ":var_0"),
(position_rotate_z, pos2, -30),
(position_move_x, pos2, -300, 0),
(set_spawn_position, pos2),
(spawn_agent, ":trp_id"),
(agent_set_group, reg0, ":var_1"),
(agent_set_team, reg0, ":var_2"),
(agent_add_relation_with_agent, reg0, ":var_0", 1),
(position_move_x, pos2, 300, 0),
(position_rotate_z, pos2, -120),
(position_move_x, pos2, -300, 0),
(set_spawn_position, pos2),
(spawn_agent, ":trp_id"),
(agent_set_group, reg0, ":var_1"),
(agent_set_team, reg0, ":var_2"),
(agent_add_relation_with_agent, reg0, ":var_0", 1),
(position_move_x, pos2, 300, 0),
(position_rotate_z, pos2, -120),
(position_move_x, pos2, -300, 0),
(set_spawn_position, pos2),
(spawn_agent, ":trp_id"),
(agent_set_group, reg0, ":var_1"),
(agent_set_team, reg0, ":var_2"),
(agent_add_relation_with_agent, reg0, ":var_0", 1),
```

3. 箭矢击中触发器;在以箭矢落点位置为重心的等边三角形的三个顶点上分别生成一名与距离与该位置最近的一名敌方士兵相同的友方士兵 (300为重心到顶点的距离)

```python
(store_trigger_param_1, ":var_0"),
(agent_get_group, ":var_1", ":var_0"),
(agent_get_team, ":var_2", ":var_0"),
(assign, ":var_3", 100000),
(assign, ":var_4", -1),
(try_for_agents, ":var_5"),
    (agent_is_alive, ":var_5"),
    (agent_is_human, ":var_5"),
    (agent_get_position, pos2, ":var_5"),
    (agent_get_team, ":var_6", ":var_5"),
    (teams_are_enemies, ":var_2", ":var_6"),
    (get_distance_between_positions, ":var_7", pos1, pos2),
    (neg|ge, ":var_7", ":var_3"),
    (assign, ":var_3", ":var_7"),
    (assign, ":var_4", ":var_5"),
(try_end),
(try_begin),
    (neg|eq, ":var_4", -1),
    (agent_get_troop_id, ":var_8", ":var_4"),
    (position_rotate_z, pos1, -30),
    (position_move_x, pos1, -300, 0),
    (set_spawn_position, pos1),
    (spawn_agent, ":var_8"),
    (agent_set_group, reg0, ":var_1"),
    (agent_set_team, reg0, ":var_2"),
    (agent_add_relation_with_agent, reg0, ":var_0", 1),
    (position_move_x, pos1, 300, 0),
    (position_rotate_z, pos1, -120),
    (position_move_x, pos1, -300, 0),
    (set_spawn_position, pos1),
    (spawn_agent, ":var_8"),
    (agent_set_group, reg0, ":var_1"),
    (agent_set_team, reg0, ":var_2"),
    (agent_add_relation_with_agent, reg0, ":var_0", 1),
    (position_move_x, pos1, 300, 0),
    (position_rotate_z, pos1, -120),
    (position_move_x, pos1, -300, 0),
    (set_spawn_position, pos1),
    (spawn_agent, ":var_8"),
    (agent_set_group, reg0, ":var_1"),
    (agent_set_team, reg0, ":var_2"),
    (agent_add_relation_with_agent, reg0, ":var_0", 1),
(try_end),
```

4. 箭矢击中触发器;在以距离箭矢落点位置最近的一名敌方士兵为重心的等边三角形的三个顶点上分别生成一名与其相同的友方士兵 (300为重心到顶点的距离)

```python
(store_trigger_param_1, ":var_0"),
(agent_get_group, ":var_1", ":var_0"),
(agent_get_team, ":var_2", ":var_0"),
(assign, ":var_3", 100000),
(assign, ":var_4", -1),
(try_for_agents, ":var_5"),
    (agent_is_alive, ":var_5"),
    (agent_is_human, ":var_5"),
    (agent_get_position, pos2, ":var_5"),
    (agent_get_team, ":var_6", ":var_5"),
    (teams_are_enemies, ":var_2", ":var_6"),
    (get_distance_between_positions, ":var_7", pos1, pos2),
    (neg|ge, ":var_7", ":var_3"),
    (assign, ":var_3", ":var_7"),
    (assign, ":var_4", ":var_5"),
(try_end),
(try_begin),
    (neg|eq, ":var_4", -1),
    (agent_get_troop_id, ":var_8", ":var_4"),
    (agent_get_position, pos3, ":var_4"),
    (position_rotate_z, pos3, -30),
    (position_move_x, pos3, -300, 0),
    (set_spawn_position, pos3),
    (spawn_agent, ":var_8"),
    (agent_set_group, reg0, ":var_1"),
    (agent_set_team, reg0, ":var_2"),
    (agent_add_relation_with_agent, reg0, ":var_0", 1),
    (position_move_x, pos3, 300, 0),
    (position_rotate_z, pos3, -120),
    (position_move_x, pos3, -300, 0),
    (set_spawn_position, pos3),
    (spawn_agent, ":var_8"),
    (agent_set_group, reg0, ":var_1"),
    (agent_set_team, reg0, ":var_2"),
    (agent_add_relation_with_agent, reg0, ":var_0", 1),
    (position_move_x, pos3, 300, 0),
    (position_rotate_z, pos3, -120),
    (position_move_x, pos3, -300, 0),
    (set_spawn_position, pos3),
    (spawn_agent, ":var_8"),
    (agent_set_group, reg0, ":var_1"),
    (agent_set_team, reg0, ":var_2"),
    (agent_add_relation_with_agent, reg0, ":var_0", 1),
(try_end),
```

***

附一个网址(若打不开请使用chrome或用steam++等加速github):

https://b1inkie.github.io/b1note.github.io/

装备某件物品时增加属性点;添加书籍;全自动武器;自爆步兵;光环:移速BUFF(光写了 没测);散弹 但是每一个弹头都是自瞄;自定义战利品等等功能都可以在这里找到.

若依旧有疑问或需要视频讲解,可以加下面群:
附加1个交流群: 855512521


28

主题

4158

回帖

3131

积分

子爵[版主]

世纪风云制作组[程序]

圣殿骑士团[KT]
战团ID:Epig

中级术士

Rank: 7Rank: 7Rank: 7

UID
1706215
第纳尔
34958
精华
3
互助
157
荣誉
79
贡献
2005
魅力
207
注册时间
2013-12-8

骑砍中文站APP会员勋章原版正版勋章战团正版勋章火与剑正版勋章拿破仑正版勋章维京征服正版勋章汉匈决战正版勋章骑士美德之英勇勋章[杰出会员活跃勋章]骑士美德之仁慈勋章[杰出会员互助勋章]骑士美德之谦恭勋章[杰出会员财富勋章]骑士美德之公正勋章[杰出会员高级财富勋章]骑士美德之正义勋章[杰出会员荣誉勋章]骑士精神之文韬勋章杰出版主勋章骑士美德之奉献勋章骑士美德之高贵勋章骑砍中文站微博会员勋章骑砍中文站微信会员勋章骑友真人秀勋章汉匈决战荣誉用户勋章元老骑士勋章霸主正版勋章

鲜花(2039) 鸡蛋(904)
发表于 2024-4-21 15:56:36 | 显示全部楼层
对于反编译的代码我是不反对的,但是希望要做好两点,1、出自哪里的要标注出来,2、别直接po上来,要做好自己的理解和注释
童鞋们,欢迎来到骑马与砍杀学院,我是你们的科任老师,猪猪老师,由我来为童鞋们介绍以下课程:
1、人间五十年life50 2.0测试版
2、永恒世界4.5.5公测版
3、永恒世界网页端 UCP2.0
4、大逃杀1.0公测版
5、永恒世界4.5特别版
6、常见PY报错解决方案

10

主题

7

回帖

45

积分

扈从

Rank: 2Rank: 2

UID
3645558
第纳尔
140
精华
0
互助
8
荣誉
0
贡献
0
魅力
51
注册时间
2024-4-15
鲜花(6) 鸡蛋(0)
 楼主| 发表于 2024-4-22 18:28:53 | 显示全部楼层
恶猪 发表于 2024-4-21 15:56
对于反编译的代码我是不反对的,但是希望要做好两点,1、出自哪里的要标注出来,2、别直接po上来,要做好自 ...

兄弟你没事吧 我自己写的代码分享出来 有什么问题吗

1

主题

24

回帖

13

积分

随仆

Rank: 1

UID
3258106
第纳尔
127
精华
0
互助
1
荣誉
0
贡献
0
魅力
1
注册时间
2021-8-2
鲜花(3) 鸡蛋(0)
发表于 2024-6-25 16:57:08 | 显示全部楼层
我艹,兄弟,你是真的牛逼!!!你提供的网址太牛了!而且你还是原作者,真的太有心了,还按分类分清楚了,太谢谢你的分享了大佬收下我的膝盖。我把海盗的头盖骨给你当碗使。
您需要登录后才可以回帖 登录 | 注册(Register!)

本版积分规则

Archiver|手机版|小黑屋|骑马与砍杀中文站

GMT+8, 2024-12-27 11:56 , Processed in 0.135104 second(s), 24 queries , Gzip On, MemCached On.

Powered by Discuz! X3.4 Licensed

© 2001-2023 Discuz! Team.

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