本帖最后由 杰喵喵 于 2023-9-22 14:31 编辑
自己做的火箭功能,精确到agent的骨骼与燃烧减血效果。攻击精确到agent的骨骼位置、持续燃烧10s减少生命值。一、module_items
- fuel_arrows_missile_hit = [
- (ti_on_missile_hit,
- [
- (store_trigger_param_2, ":object_type"),
- (copy_position,pos5,pos1),
- (try_begin),
- (eq|this_or_next,":object_type",0),
- (eq|this_or_next,":object_type",3),
- (eq,":object_type",4),
- (particle_system_burst,"psys_fuel_arrows_fire",pos5,300),
- (try_end),
-
- ])]
复制代码
二、module_mission_templates 将下面三个触发器放入需要的地方,如lead_charge等
-
- # ti_on_missile_hit = -52.0 #can only be used in module_items triggers
- # Position Register 1: Missile Position
- # Trigger Param 1: shooter agent id
- fuel_arrows_missile_hit = [
- (ti_on_missile_hit,
- [
- (set_fixed_point_multiplier, 1000),
- #(store_trigger_param_1, ":agent_shooter"),
- (copy_position,pos5,pos1),
- (position_get_distance_to_ground_level,":height_to_ground", pos5),
- (assign,":flag",0),
- #判断是否攻中agent附近并且高于50,如果不在agent附近则点火特效,可以有效防止鬼火
- (try_begin),
- (ge,":height_to_ground",50),
- (try_for_agents,":possable_agent"),
- (neq,":flag",-1),
- (agent_is_alive,":possable_agent"),
- (agent_get_position,pos3,":possable_agent"),
- (get_distance_between_positions,":dist",pos5,pos3),
- (this_or_next|eq,pos5,pos3),
- (le,":dist",300),
- (assign,":flag",-1),
- (try_end),
- (try_end),
-
- (try_begin),
- (eq,":flag",0),
- (particle_system_burst,"psys_fuel_arrows_fire",pos5,300),
- (try_end),
-
- ])]
复制代码- agent_buff_check = (
- 0,0,0,[],
- [
- (set_fixed_point_multiplier, 1000),
-
- (try_for_agents,":agent_no"),
- (agent_is_alive,":agent_no"),
- (agent_is_human,":agent_no"),
-
- (try_for_range,":slot",slot_agent_fuel_abdomen,slot_agent_fuel_num),
- (agent_get_slot,":num",":agent_no",":slot"),
- (gt,":num",0),
- (store_sub,":value",":slot",slot_agent_fuel_abdomen),
- (agent_get_bone_position,pos56,":agent_no",":value",1),
- (position_move_z,pos56,-25),
- (particle_system_burst,"psys_torch_fire",pos56,5),
- (try_end),
-
- (try_end),
-
- ])
复制代码- time_task_1s = (
- 1,0,0,[],
- [
- ##################agent-AI######################
- (set_fixed_point_multiplier,1000),#cm
-
- (try_for_agents, ":agent_no"),
- (assign,":fuel_harm",0),
- (try_for_range,":slot",slot_agent_fuel_abdomen,slot_agent_fuel_num),
- (agent_get_slot,":num",":agent_no",":slot"),
- (gt,":num",0),
- (val_add,":fuel_harm",":num"),
- (val_sub,":num",1),
- (agent_set_slot,":agent_no",":slot",":num"),
- (try_end),
-
- (try_begin),
- (gt,":fuel_harm",0),
- (store_div,":harm",":fuel_harm",10),
- (store_mul,":remainder",":harm",10),
- (store_sub,":remainder",":fuel_harm",":harm"),
-
- (try_begin),
- (gt,":remainder",0),
- (val_add,":harm",1),
- (try_end),
-
- (troop_get_type,":type",":troop_id"),
- (try_begin),
- (is_between,":type",tf_undead,tf_undead_end),
- (val_mul,":harm",2),
- (try_end),
-
- (store_agent_hit_points,":cur_hp",":agent_no",1),
- (val_sub,":cur_hp",":harm"),
- (agent_set_hit_points,":agent_no",":cur_hp",1),
-
- (get_player_agent_no,":player_agent_id"),
- (try_begin),
- (eq,":agent_no",":player_agent_id"),
- (store_agent_hit_points,":cur_hp",":agent_no",1),
- (assign,reg20,":harm"),
- (assign,reg21,":cur_hp"),
- (display_message,"@player fuel harm {reg20} and residue hp {reg21}",0xFFFF3333),
- (try_end),
- (try_end),
-
- (try_end),
-
- ]
- )
复制代码 三、module_constants设置slot
- #agent 燃烧buff slot
- slot_agent_fuel_abdomen = 200
- slot_agent_fuel_thigh = 201
- slot_agent_fuel_calf_l = 202
- slot_agent_fuel_foot_l = 203
- slot_agent_fuel_thigh_r = 204
- slot_agent_fuel_calf_r = 205
- slot_agent_fuel_foot_r = 206
- slot_agent_fuel_spine = 207
- slot_agent_fuel_thorax = 208
- slot_agent_fuel_head = 209
- slot_agent_fuel_shoulder_l = 210
- slot_agent_fuel_upperarm_l = 211
- slot_agent_fuel_forearm_l = 212
- slot_agent_fuel_hand_l = 213
- slot_agent_fuel_item_l = 214
- slot_agent_fuel_shoulder_r = 215
- slot_agent_fuel_upperarm_r = 216
- slot_agent_fuel_forearm_r = 217
- slot_agent_fuel_hand_r = 218
- slot_agent_fuel_item_r = 219
- slot_agent_fuel_num = 220
- #腹部= 200 骨骼位置0
- #大腿l = 201 骨骼位置1
- #小腿l = 202 骨骼位置2
- #脚l = 203 骨骼位置3
- #大腿r = 204 骨骼位置4
- #小腿r = 205 骨骼位置5
- #脚r = 206 骨骼位置6
- #脊柱= 207 骨骼位置7
- #胸腔= 208 骨骼位置8
- #头= 209 骨骼位置9
- #肩膀l = 210 骨骼位置10
- #上臂l = 211 骨骼位置11
- #前臂l = 212 骨骼位置12
- #手l = 213 骨骼位置13
- #项l = 214 骨骼位置14
- #肩膀r = 215 骨骼位置15
- #上臂r = 216 骨骼位置16
- #前臂r = 217 骨骼位置17
- #手r = 218 骨骼位置18
- #项r = 219 骨骼位置19
复制代码 四、粒子特效
-
- ("fuel_arrows_fire", psf_billboard_3d|psf_global_emit_dir|psf_always_emit|psf_randomize_size|psf_randomize_rotation, "prt_mesh_fire_1",
- 50, 1.0, 0, -1.2, 15.0, 10.0, #num_particles, life, damping, gravity_strength, turbulance_size, turbulance_strength
- (0.2, 0.7), (1, 0), #alpha keys
- (0.2, 1.0), (1, 0.9), #red keys
- (0.2, 0.7),(1, 0.3), #green keys
- (0.2, 0.2), (1, 0.0), #blue keys
- (0, 0.20), (0.20, 1), #scale keys
- (0.20, 0.20, 0.020), #emit box size
- (0, 0, 0.0), #emit velocity
- 0.0, #emit dir randomness
- 250, #rotation speed
- 0.3 #rotation damping
- ),
-
复制代码 五、效果图
|