From c6150cc3fa196aa1c0993127111b5532b1f0e468 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Tue, 14 Feb 2023 04:49:35 +0200 Subject: [PATCH 40/40] Rulesets: Move auto_attack.if_attacker before attack_actions See osdn #47353 Signed-off-by: Marko Lindqvist --- data/alien/actions.ruleset | 8 ++++---- data/civ1/actions.ruleset | 8 ++++---- data/civ2/actions.ruleset | 8 ++++---- data/civ2civ3/actions.ruleset | 8 ++++---- data/classic/actions.ruleset | 8 ++++---- data/goldkeep/actions.ruleset | 8 ++++---- data/granularity/actions.ruleset | 8 ++++---- data/multiplayer/actions.ruleset | 8 ++++---- data/ruledit/comments-3.2.txt | 4 ++-- data/sandbox/actions.ruleset | 8 ++++---- data/stub/actions.ruleset | 8 ++++---- data/webperimental/actions.ruleset | 8 ++++---- tools/ruleutil/rulesave.c | 6 +++--- 13 files changed, 49 insertions(+), 49 deletions(-) diff --git a/data/alien/actions.ruleset b/data/alien/actions.ruleset index bf619b7cd7..d40df3bd87 100644 --- a/data/alien/actions.ruleset +++ b/data/alien/actions.ruleset @@ -19,12 +19,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -32,6 +30,8 @@ if_attacker = "MinMoveFrags", "1", "Local", TRUE } +attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" + [actions] ; Forbid "Enter Marketplace" if any one of the listed actions are legal. enter_marketplace_blocked_by = "Establish Trade Route" diff --git a/data/civ1/actions.ruleset b/data/civ1/actions.ruleset index 0d02ca400e..9a004ca473 100644 --- a/data/civ1/actions.ruleset +++ b/data/civ1/actions.ruleset @@ -18,12 +18,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -33,6 +31,8 @@ if_attacker = "UnitFlag", "Nuclear", "Local", FALSE } +attack_actions = "Attack", "Suicide Attack" + [actions] ; Forbid "Enter Marketplace" if any one of the listed actions are legal. enter_marketplace_blocked_by = "Establish Trade Route" diff --git a/data/civ2/actions.ruleset b/data/civ2/actions.ruleset index 38a5dd99e6..98373f269e 100644 --- a/data/civ2/actions.ruleset +++ b/data/civ2/actions.ruleset @@ -18,12 +18,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -33,6 +31,8 @@ if_attacker = "UnitFlag", "Nuclear", "Local", FALSE } +attack_actions = "Attack", "Suicide Attack" + [actions] ; Forbid "Enter Marketplace" if any one of the listed actions are legal. enter_marketplace_blocked_by = "Establish Trade Route" diff --git a/data/civ2civ3/actions.ruleset b/data/civ2civ3/actions.ruleset index ac152c65c1..4eb8bda48a 100644 --- a/data/civ2civ3/actions.ruleset +++ b/data/civ2civ3/actions.ruleset @@ -18,12 +18,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -33,6 +31,8 @@ if_attacker = "UnitFlag", "Nuclear", "Local", FALSE } +attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" + [actions] ; Forbid "Bombard" if any one of the listed actions are legal. bombard_blocked_by = "Capture Units" diff --git a/data/classic/actions.ruleset b/data/classic/actions.ruleset index 9e5d421e37..6c52fd74f4 100644 --- a/data/classic/actions.ruleset +++ b/data/classic/actions.ruleset @@ -19,12 +19,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -34,6 +32,8 @@ if_attacker = "UnitFlag", "Nuclear", "Local", FALSE } +attack_actions = "Attack", "Suicide Attack" + [actions] ; Forbid "Enter Marketplace" if any one of the listed actions are legal. enter_marketplace_blocked_by = "Establish Trade Route" diff --git a/data/goldkeep/actions.ruleset b/data/goldkeep/actions.ruleset index b3cf83a6ef..4831714e79 100644 --- a/data/goldkeep/actions.ruleset +++ b/data/goldkeep/actions.ruleset @@ -22,12 +22,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -37,6 +35,8 @@ if_attacker = "UnitFlag", "Nuclear", "Local", FALSE } +attack_actions = "Attack", "Suicide Attack" + [actions] ; Forbid "Attack" if any one of the listed actions are legal. attack_blocked_by = "Explode Nuclear", "Nuke City", "Nuke Units" diff --git a/data/granularity/actions.ruleset b/data/granularity/actions.ruleset index 85647699cf..e67c51acfa 100644 --- a/data/granularity/actions.ruleset +++ b/data/granularity/actions.ruleset @@ -19,12 +19,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -;attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. ;if_attacker = ; { "type", "name", "range", "present" @@ -32,6 +30,8 @@ format_version = 30 ; "MinMoveFrags", "10" "Local", TRUE ; } +;attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" + [actions] ; Forbid regular unit move if one of the actions below is legal. move_blocked_by = "Transport Disembark", "Transport Disembark 2" diff --git a/data/multiplayer/actions.ruleset b/data/multiplayer/actions.ruleset index 0779a5369f..c2c54836b5 100644 --- a/data/multiplayer/actions.ruleset +++ b/data/multiplayer/actions.ruleset @@ -19,12 +19,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -34,6 +32,8 @@ if_attacker = "UnitFlag", "Nuclear", "Local", FALSE } +attack_actions = "Attack", "Suicide Attack" + [actions] ; Forbid "Attack" if any one of the listed actions are legal. attack_blocked_by = "Explode Nuclear", "Nuke City", "Nuke Units" diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index 20b39357cb..3c53bcbb6e 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -1484,10 +1484,10 @@ auto_attack = "\n\ ; An auto attack may be triggered when another unit moves to an adjacent\n\ ; tile and the autoattack server setting is enabled. The following details\n\ ; are ruleset controlled.\n\ -; attack_actions - the actions to try during an auto attack in the order\n\ -; they should be tried.\n\ ; if_attacker - this requirement vector must be true before a unit even\n\ ; considers to auto attack.\ +; attack_actions - the actions to try during an auto attack in the order\n\ +; they should be tried.\n\ " ui_names = "\n\ diff --git a/data/sandbox/actions.ruleset b/data/sandbox/actions.ruleset index 530a17d225..063f6881aa 100644 --- a/data/sandbox/actions.ruleset +++ b/data/sandbox/actions.ruleset @@ -19,12 +19,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -35,6 +33,8 @@ if_attacker = "UnitFlag", "NuclearOP", "Local", FALSE } +attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" + [actions] ; Forbid "Bombard" if any one of the listed actions are legal. bombard_blocked_by = "Capture Units" diff --git a/data/stub/actions.ruleset b/data/stub/actions.ruleset index b946b806c0..a191cd49f6 100644 --- a/data/stub/actions.ruleset +++ b/data/stub/actions.ruleset @@ -11,17 +11,17 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -;attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. ;if_attacker = ; { "type", "name", "range", "present" ; } +;attack_actions = "Capture Units", "Bombard", "Attack", "Suicide Attack" + [actions] ; Forbid regular unit move if one of the actions below is legal. ;move_blocked_by = "Conquer Extras" diff --git a/data/webperimental/actions.ruleset b/data/webperimental/actions.ruleset index e884ec2a12..aea4b9b5b3 100644 --- a/data/webperimental/actions.ruleset +++ b/data/webperimental/actions.ruleset @@ -19,12 +19,10 @@ format_version = 30 ; An auto attack may be triggered when another unit moves to an adjacent ; tile and the autoattack server setting is enabled. The following details ; are ruleset controlled. -; attack_actions - the actions to try during an auto attack in the order -; they should be tried. ; if_attacker - this requirement vector must be true before a unit even ; considers to auto attack. - -attack_actions = "Bombard", "Attack", "Suicide Attack" +; attack_actions - the actions to try during an auto attack in the order +; they should be tried. if_attacker = { "type", "name", "range", "present" @@ -34,6 +32,8 @@ if_attacker = "UnitFlag", "Nuclear", "Local", FALSE } +attack_actions = "Bombard", "Attack", "Suicide Attack" + [actions] ; Forbid "Enter Marketplace" if any one of the listed actions are legal. enter_marketplace_blocked_by = "Establish Trade Route" diff --git a/tools/ruleutil/rulesave.c b/tools/ruleutil/rulesave.c index 210a7e3455..1d1fe45a36 100644 --- a/tools/ruleutil/rulesave.c +++ b/tools/ruleutil/rulesave.c @@ -1123,11 +1123,11 @@ static bool save_actions_ruleset(const char *filename, const char *name) comment_auto_attack(sfile); - save_action_auto_actions(sfile, ACTION_AUTO_MOVED_ADJ, - "auto_attack.attack_actions"); - save_reqs_vector(sfile, &auto_perf->reqs, "auto_attack", "if_attacker"); + + save_action_auto_actions(sfile, ACTION_AUTO_MOVED_ADJ, + "auto_attack.attack_actions"); } comment_actions_dc_initial_odds(sfile); -- 2.39.1