Mirathei
Sergeant Knight
I've done some thinking about how the shield bashing could work, and these are my ideas thus far:
For player:
ti_on_whatever_pressed calls the following script:
For ai:
Every second during battle call the following script:
There are most likely some variables in the wrong order, and someone would have to make a shield-bash animation and put it in game but otherwise this should work.
For player:
ti_on_whatever_pressed calls the following script:
Code:
(get_player_agent_no,":player"),
(agent_get_position,1,":player"),
(assign,":mindist",100),
(assign,":shield_equipped",0),
(try_for_range,":shield",shields_begin,shields_end), #fill in the appropriate item names
(agent_has_item_equipped,":shield",":player"),
(assign,":shield_equipped",1),
(neq,":shield",0),
(try_for_agents,":agent"),
(agent_is_alive,":agent"),
(agent_is_human,":agent"),
(neg|agent_is_ally,":agent"),
(agent_get_position,2,":agent"),
(neg|position_is_behind_position,2,1),
(get_distance_between_positions,":dist",1,2),
(lt,":dist",":mindist"),
(assign,":mindist",":dist"),
(assign,":chosen",":agent"),
(end_try),
(agent_set_animation, ":player", anim_shield_bash), # someone would have to make this animation.
(agent_set_animation, ":chosen", anim_strike_fall_back_rise),
(agent_store_health,":health",":chosen"),
(val_sub,":health",10),
(agent_set_health,":chosen",":health"),
For ai:
Every second during battle call the following script:
Code:
(get_player_agent_no,":player"),
(try_for_agents,":basher"),
(agent_is_human,":basher"),
(agent_is_alive,":basher"),
(neq,":player",":basher"),
(assign,":shield_equipped",0),
(try_for_range,":shield",shields_begin,shields_end), #fill in the appropriate item names
(agent_has_item_equipped,":shield",":basher"),
(assign,":shield_equipped",1),
(end_try),
(neq,":shield_equipped",0),
(try_begin),
(agent_is_ally,":basher"),
(agent_get_position,1,":basher"),
(assign,":mindist",100),
(try_for_agents,":agent"),
(agent_is_alive,":agent"),
(agent_is_human,":agent"),
(neg|agent_is_ally,":agent"),
(agent_get_position,2,":agent"),
(neg|position_is_behind_position,2,1),
(get_distance_between_positions,":dist",1,2),
(lt,":dist",":mindist"),
(assign,":mindist",":dist"),
(assign,":chosen",":agent"),
(end_try),
(store_random_in_range,":random",1,10),
(eq,":random",7), #this line and the one before it would keep to agents from simultaneously shield bashing one another save in rare instances.
(agent_set_animation, ":basher", anim_shield_bash), # someone would have to make this animation.
(agent_set_animation, ":chosen", anim_strike_fall_back_rise),
(agent_store_health,":health",":chosen"),
(val_sub,":health",10),
(agent_set_health,":chosen",":health"),
(else_try),
(neg|agent_is_ally,":basher"),
(agent_get_position,1,":basher"),
(assign,":mindist",100),
(try_for_agents,":agent"),
(agent_is_alive,":agent"),
(agent_is_human,":agent"),
(agent_is_ally,":agent"),
(agent_get_position,2,":agent"),
(neg|position_is_behind_position,2,1),
(get_distance_between_positions,":dist",1,2),
(lt,":dist",":mindist"),
(assign,":mindist",":dist"),
(assign,":chosen",":agent"),
(end_try),
(store_random_in_range,":random",1,10),
(eq,":random",7), #this line and the one before it would keep to agents from simultaneously shield bashing one another save in rare instances.
(agent_set_animation, ":basher", anim_shield_bash), # someone would have to make this animation.
(agent_set_animation, ":chosen", anim_strike_fall_back_rise),
(agent_store_health,":health",":chosen"),
(val_sub,":health",10),
(agent_set_health,":chosen",":health"),
(end_try),
(end_try),
There are most likely some variables in the wrong order, and someone would have to make a shield-bash animation and put it in game but otherwise this should work.