mirror of
https://github.com/wesnoth/wesnoth
synced 2025-05-05 20:21:00 +00:00
Added a defend location order (disabled by default since it crashes a lot).
This commit is contained in:
parent
8983f7ed50
commit
23d8eae674
@ -495,6 +495,101 @@
|
||||
|
||||
################
|
||||
|
||||
[defend_location]
|
||||
type=objective
|
||||
|
||||
# remove this line to enable the option...
|
||||
disabled=yes
|
||||
|
||||
[ai]
|
||||
[protect_location]
|
||||
radius=4
|
||||
[/protect_location]
|
||||
[/ai]
|
||||
|
||||
[option]
|
||||
message= _ "Defend a location..."
|
||||
|
||||
[show_if]
|
||||
[variable]
|
||||
name=ai_controller_{ID}.defend_location.disabled
|
||||
not_equals=yes
|
||||
[/variable]
|
||||
[/show_if]
|
||||
|
||||
[command]
|
||||
{VARIABLE ai_controller_{ID}.defend_location.picker_active yes}
|
||||
{VARIABLE ai_controller_finished yes}
|
||||
|
||||
[print]
|
||||
text= _ "Right-click to select a location to defend"
|
||||
duration=100
|
||||
{COLOR_WHITE}
|
||||
[/print]
|
||||
|
||||
[set_menu_item]
|
||||
id=ai_controller_defend_location_picker
|
||||
description= _ "Defend this location"
|
||||
|
||||
[show_if]
|
||||
[variable]
|
||||
name=ai_controller_{ID}.defend_location.picker_active
|
||||
boolean_equals=yes
|
||||
[/variable]
|
||||
[/show_if]
|
||||
|
||||
[command]
|
||||
{VARIABLE ai_controller.side_$ally_side|_current_settings.defend_location.x $x1}
|
||||
{VARIABLE ai_controller.side_$ally_side|_current_settings.defend_location.y $y1}
|
||||
{VARIABLE ai_controller_{ID}.defend_location.picker_active no}
|
||||
|
||||
{VARIABLE order_type defend_location}
|
||||
{VARIABLE ai_controller_{ID}.defend_location.ai.protect_location.x $x1}
|
||||
{VARIABLE ai_controller_{ID}.defend_location.ai.protect_location.y $y1}
|
||||
|
||||
[fire_event]
|
||||
name=apply_ai_params
|
||||
[/fire_event]
|
||||
|
||||
{VARIABLE ai_controller.side_$ally_side|_current_settings.current_objective defend_location}
|
||||
{VARIABLE ai_controller.side_$ally_side|_current_settings.currently_doing_objective_description _"focusing on defending the area around $x1|,$y1|."}
|
||||
|
||||
[fire_event]
|
||||
name=menu item ai_controller
|
||||
|
||||
[primary_unit]
|
||||
side=$ally_side
|
||||
[/primary_unit]
|
||||
[/fire_event]
|
||||
[/command]
|
||||
[/set_menu_item]
|
||||
|
||||
[event]
|
||||
name=select,recruit,recall,side turn,menu item ai_controller
|
||||
|
||||
[if]
|
||||
[variable]
|
||||
name=ai_controller_{ID}.defend_location.picker_active
|
||||
boolean_equals=yes
|
||||
[/variable]
|
||||
|
||||
[then]
|
||||
{VARIABLE ai_controller_{ID}.defend_location.picker_active no}
|
||||
|
||||
[print]
|
||||
text= _ "Location selection canceled"
|
||||
duration=100
|
||||
{COLOR_WHITE}
|
||||
[/print]
|
||||
[/then]
|
||||
[/if]
|
||||
[/event]
|
||||
[/command]
|
||||
[/option]
|
||||
[/defend_location]
|
||||
|
||||
################
|
||||
|
||||
[revoke_objective_orders]
|
||||
[option]
|
||||
message= _ "Clear objective orders"
|
||||
@ -599,6 +694,11 @@
|
||||
name=ai_controller_{ID}.player_side
|
||||
contains=$side_number
|
||||
[/variable]
|
||||
|
||||
[variable]
|
||||
name=ai_controller_{ID}.defend_location.picker_active
|
||||
boolean_equals=no
|
||||
[/variable]
|
||||
[/show_if]
|
||||
|
||||
[command]
|
||||
@ -750,6 +850,11 @@ Behaviour: $ai_controller.side_$ally_side|_current_settings.currently_doing_beha
|
||||
variable=ai_controller_{ID}.protect.option
|
||||
[/insert_tag]
|
||||
|
||||
[insert_tag]
|
||||
name=option
|
||||
variable=ai_controller_{ID}.defend_location.option
|
||||
[/insert_tag]
|
||||
|
||||
[insert_tag]
|
||||
name=option
|
||||
variable=ai_controller_{ID}.revoke_objective_orders.option
|
||||
|
Loading…
x
Reference in New Issue
Block a user