From bb008bfe4350dad81957e28fe11227f08a456d6e Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Tue, 16 Mar 2021 13:50:29 +0100 Subject: [PATCH] !TerrainSpeed shouldn't pay slow_invasion cost. Make sure that units without the TerrainSpeed unit class flag doesn't pay the slow_invasion MP cost. See osdn #41794 --- data/alien/effects.ruleset | 14 +++++++------ data/civ2civ3/effects.ruleset | 28 ++++++++++++++----------- data/classic/effects.ruleset | 35 ++++++++++++++++++------------- data/experimental/effects.ruleset | 35 ++++++++++++++++++------------- data/granularity/effects.ruleset | 7 ++++--- data/multiplayer/effects.ruleset | 35 ++++++++++++++++++------------- data/sandbox/effects.ruleset | 35 ++++++++++++++++++------------- server/rscompat.c | 4 ++++ 8 files changed, 112 insertions(+), 81 deletions(-) diff --git a/data/alien/effects.ruleset b/data/alien/effects.ruleset index 6380226b10..6076a0ea4b 100644 --- a/data/alien/effects.ruleset +++ b/data/alien/effects.ruleset @@ -1084,18 +1084,20 @@ reqs = type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Transport Disembark 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Transport Disembark 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_entry_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Enter Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Enter Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_unit_shield_value_recycle] diff --git a/data/civ2civ3/effects.ruleset b/data/civ2civ3/effects.ruleset index df94b0994d..68cc7503c3 100644 --- a/data/civ2civ3/effects.ruleset +++ b/data/civ2civ3/effects.ruleset @@ -4335,36 +4335,40 @@ reqs = type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Transport Disembark 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Transport Disembark 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_conquer_cost_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer City 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer City 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_entry_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Enter Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Enter Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_frighten_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Frighten Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Frighten Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_attack_one_attack] diff --git a/data/classic/effects.ruleset b/data/classic/effects.ruleset index fbd3c1cce8..c2d171cac4 100644 --- a/data/classic/effects.ruleset +++ b/data/classic/effects.ruleset @@ -2592,45 +2592,50 @@ reqs = type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Transport Disembark 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Transport Disembark 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_conquer_cost_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer City 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer City 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_entry_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Enter Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Enter Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_frighten_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Frighten Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Frighten Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_conquer_extras_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer Extras 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer Extras 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_attack_one_attack] diff --git a/data/experimental/effects.ruleset b/data/experimental/effects.ruleset index 2c5e8af826..42d4c57335 100644 --- a/data/experimental/effects.ruleset +++ b/data/experimental/effects.ruleset @@ -2895,45 +2895,50 @@ reqs = type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Transport Disembark 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Transport Disembark 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_conquer_cost_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer City 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer City 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_entry_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Enter Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Enter Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_frighten_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Frighten Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Frighten Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_conquer_extras_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer Extras 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer Extras 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_attack_one_attack] diff --git a/data/granularity/effects.ruleset b/data/granularity/effects.ruleset index f35f989a48..9b731525e4 100644 --- a/data/granularity/effects.ruleset +++ b/data/granularity/effects.ruleset @@ -190,9 +190,10 @@ reqs = type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Transport Disembark 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Transport Disembark 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_no_tools] diff --git a/data/multiplayer/effects.ruleset b/data/multiplayer/effects.ruleset index e0d9ba0176..6ad264b844 100644 --- a/data/multiplayer/effects.ruleset +++ b/data/multiplayer/effects.ruleset @@ -2557,45 +2557,50 @@ reqs = type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Transport Disembark 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Transport Disembark 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_conquer_cost_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer City 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer City 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_entry_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Enter Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Enter Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_frighten_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Frighten Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Frighten Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_conquer_extras_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer Extras 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer Extras 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_attack_one_attack] diff --git a/data/sandbox/effects.ruleset b/data/sandbox/effects.ruleset index 38ba2928ec..7bf92dffaf 100644 --- a/data/sandbox/effects.ruleset +++ b/data/sandbox/effects.ruleset @@ -4599,45 +4599,50 @@ reqs = type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Transport Disembark 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Transport Disembark 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_conquer_cost_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer City 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer City 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_entry_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Enter Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Enter Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_hut_frighten_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Frighten Hut 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Frighten Hut 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_move_cost_conquer_extras_from_non_native] type = "Action_Success_Actor_Move_Cost" value = 65535 reqs = - { "type", "name", "range", "present" - "Action", "Conquer Extras 2", "Local", TRUE - "UnitState", "OnNativeTile", "Local", TRUE + { "type", "name", "range", "present" + "Action", "Conquer Extras 2", "Local", TRUE + "UnitState", "OnNativeTile", "Local", TRUE + "UnitClassFlag", "TerrainSpeed", "Local", TRUE } [effect_action_success_attack_one_attack] diff --git a/server/rscompat.c b/server/rscompat.c index c607421dfb..d394e0ec2f 100644 --- a/server/rscompat.c +++ b/server/rscompat.c @@ -1655,6 +1655,10 @@ static bool slow_invasion_effects(const char *action_rule_name) REQ_RANGE_LOCAL, FALSE, TRUE, TRUE, USP_NATIVE_TILE)); + /* Doesn't apply to non TerrainSpeed. */ + effect_req_append(peffect, req_from_str("UnitClassFlag", "Local", + FALSE, TRUE, FALSE, + "TerrainSpeed")); return TRUE; } -- 2.20.1