From b77405702654198f38ccb0d387ca35e998cd182d Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Wed, 24 Mar 2021 01:14:36 +0100 Subject: [PATCH] sandbox: add "Mechanic". Demonstrate "Heal Unit" in 3.0 and non 25% unit healing and two Heal Unit actions in 3.1 and 3.2. See osdn #41845 --- data/sandbox/README.sandbox | 3 + data/sandbox/effects.ruleset | 24 ++++++++ data/sandbox/game.ruleset | 20 +++++++ data/sandbox/units.ruleset | 104 +++++++++++++++++++++++++---------- 4 files changed, 121 insertions(+), 30 deletions(-) diff --git a/data/sandbox/README.sandbox b/data/sandbox/README.sandbox index a8de5f5efc..21dc1860c2 100644 --- a/data/sandbox/README.sandbox +++ b/data/sandbox/README.sandbox @@ -206,6 +206,9 @@ The new wonder "Altar to The Divine Ruler" makes it possible to make a unit that has a home city become unhomed by performing the action "Make Sacrifice of Work". +Mechanic +The new unit Mechanic can repair machines in the field. + Casus belli Starting to do Pillage to a tile gives the tile owner (not the extra owner) a casus belli against you. diff --git a/data/sandbox/effects.ruleset b/data/sandbox/effects.ruleset index 68824cb770..0df8ba43e7 100644 --- a/data/sandbox/effects.ruleset +++ b/data/sandbox/effects.ruleset @@ -4733,6 +4733,30 @@ value = 300 type = "Thiefs_Share_Pm" value = 50 +[effect_action_repair_success_actor_move_cost] +type = "Action_Success_Actor_Move_Cost" +value = 65535 +reqs = + { "type", "name", "range", "present" + "Action", "Heal Unit", "Local", TRUE + } + +[effect_action_repair_success_target_move_cost] +type = "Action_Success_Target_Move_Cost" +value = 65535 +reqs = + { "type", "name", "range", "present" + "Action", "Heal Unit", "Local", TRUE + } + +[effect_action_repair_amount] +type = "Heal_Unit_Pct" +value = -50 +reqs = + { "type", "name", "range", "present" + "Action", "Heal Unit", "Local", TRUE + } + ; Treuga Dei Casus Belli [effect_treuga_dei_casus_belli_poison_city_escape] type = "Casus_Belli_Success" diff --git a/data/sandbox/game.ruleset b/data/sandbox/game.ruleset index e72058c1c2..bfd170fe92 100644 --- a/data/sandbox/game.ruleset +++ b/data/sandbox/game.ruleset @@ -629,6 +629,9 @@ ui_name_spy_attack = _("Eliminate %sSpy%s") ui_name_spread_plague = _("Release %sPlague%s") spread_plague_actor_consuming_always = TRUE +; /* TRANS: _Repair (100% chance of success). */ +ui_name_heal_unit = _("%sRepair%s") + ; /* TRANS: Enter _Hut (100% chance of success). */ ui_name_enter_hut = _("Enter %sHut%s") @@ -1030,6 +1033,23 @@ target_reqs = "Building", "Research Lab", "City" } +[actionenabler_mechanic] +action = "Heal Unit" +actor_reqs = + { "type", "name", "range", "present" + "UnitType", "Mechanic", "Local", TRUE + "MinMoveFrags", 1, "Local", TRUE + "DiplRel", "Armistice", "Local", FALSE + "DiplRel", "War", "Local", FALSE + "DiplRel", "Cease-fire", "Local", FALSE + "DiplRel", "Peace", "Local", FALSE + "DiplRel", "Never met", "Local", FALSE + } +target_reqs = + { "type", "name", "range", "present" + "UnitFlag", "IronBased", "Local", TRUE + } + [actionenabler_incite_city] action = "Incite City" actor_reqs = diff --git a/data/sandbox/units.ruleset b/data/sandbox/units.ruleset index c2e9a7ccb2..9e5fa41cbf 100644 --- a/data/sandbox/units.ruleset +++ b/data/sandbox/units.ruleset @@ -34,6 +34,7 @@ flags = _("SupplyLines"), _("Can slow down (take 1 MP from) an enemy unit by disrupting its supply lines.") _("Consensus"), _("Undisbandable when your bureaucracy has a veto.") _("FleshBased") + _("IronBased") _("Unbribable") _("TradeRoute"), _("Can establish trade routes (must travel to target city).") _("HelpWonder") @@ -626,7 +627,8 @@ uk_happy = 0 uk_shield = 1 uk_food = 0 uk_gold = 1 -flags = "Settlers", "Cant_Fortify", "NonMil", "HasNoZOC", "Airbase", "Transform" +flags = "Settlers", "Cant_Fortify", "NonMil", "HasNoZOC", "Airbase", + "Transform", "IronBased" veteran_names = _("beginner"), _("seasoned"), _("senior"), _("expert") veteran_base_raise_chance = 50, 33, 20, 0 veteran_work_raise_chance = 3, 2, 1, 0 @@ -647,6 +649,42 @@ sufficient existing land). See the Terrain Alterations section \ for more details.\ ") +[unit_mechanic] +name = _("Mechanic") +class = "Small Land" +tech_req = "Engineering" +obsolete_by = "None" +graphic = "u.mechanic" +graphic_alt = "u.engineers" +sound_move = "m_mechanic" +sound_move_alt = "m_generic" +sound_fight = "f_mechanic" +sound_fight_alt = "f_generic" +build_cost = 30 +pop_cost = 0 +attack = 0 +defense = 2 +hitpoints = 10 +firepower = 1 +move_rate = 1 +vision_radius_sq = 2 +transport_cap = 0 +fuel = 0 +uk_happy = 0 +uk_shield = 1 +uk_food = 0 +uk_gold = 1 +flags = "Cant_Fortify", "NonMil", "HasNoZOC", "FleshBased" +; No veteran levels (level name is never displayed) +veteran_names = _("green") +veteran_base_raise_chance = 0 +veteran_work_raise_chance = 0 +veteran_power_fact = 100 +veteran_move_bonus = 0 +helptext = _("\ +A Mechanic can repair machines in the field.\ +") + [unit_warriors] name = _("Warriors") class = "Land" @@ -1084,7 +1122,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "" +flags = "IronBased" roles = "DefendGood", "DefendGoodStartUnit", "FirstBuild" helptext = _("\ The Mechanized Infantry has the strongest inherent defensive strength \ @@ -1346,7 +1384,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "" +flags = "IronBased" roles = "DefendOk", "DefendOkStartUnit", "AttackFastStartUnit", "Hunter" helptext = _("\ Armors are motorized war wagons that are faster, stronger, and can take \ @@ -1381,7 +1419,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "" +flags = "IronBased" roles = "AttackStrongStartUnit" helptext = _("\ Catapults are large rock-throwing machines of war.\ @@ -1419,7 +1457,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "" +flags = "IronBased" roles = "AttackStrongStartUnit", "BarbarianTech", "BarbarianBuildTech" helptext = _("\ Cannons are large firearms that can fire heavy projectiles over long \ @@ -1453,7 +1491,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "CityBuster" +flags = "CityBuster", "IronBased" roles = "AttackStrongStartUnit" helptext = _("\ The artillery is an upgraded cannon. As with its predecessors, it is a \ @@ -1486,7 +1524,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "CityBuster" +flags = "CityBuster", "IronBased" roles = "AttackStrongStartUnit" helptext = _("\ Howitzers are upgraded artillery with improved defensive as well as \ @@ -1520,7 +1558,7 @@ uk_shield = 1 uk_food = 1 uk_gold = 1 targets = "Air", "Missile", "Helicopter" -flags = "AirAttacker", "HasNoZOC" +flags = "AirAttacker", "HasNoZOC", "IronBased" roles = "DefendOk", "DefendOkStartUnit" helptext = _("\ Fighters are your first airborne units. They can\ @@ -1557,7 +1595,8 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "FieldUnit", "OneAttack", "AirAttacker", "Bombarder", "HasNoZOC" +flags = "FieldUnit", "OneAttack", "AirAttacker", "Bombarder", + "HasNoZOC", "IronBased" roles = "" helptext = _("\ Bombers are specialized airborne units that may\ @@ -1601,7 +1640,7 @@ uk_food = 1 uk_gold = 1 cargo = "Land" flags = "OneAttack", "AirAttacker", "Bombarder", "HasNoZOC", - "Provoking" + "Provoking", "IronBased" roles = "" helptext = _("\ A Helicopter's attack against units on land is a bombard attack; against \ @@ -1646,7 +1685,7 @@ uk_food = 1 uk_gold = 1 targets = "Air", "Missile", "Helicopter" vision_layer = "Stealth" -flags = "AirAttacker", "HasNoZOC" +flags = "AirAttacker", "HasNoZOC", "IronBased" roles = "DefendGood", "DefendGoodStartUnit" helptext = _("\ An improved Fighter, with improved attack and a higher movement\ @@ -1679,7 +1718,8 @@ uk_shield = 1 uk_food = 1 uk_gold = 1 vision_layer = "Stealth" -flags = "FieldUnit", "OneAttack", "AirAttacker", "Bombarder", "HasNoZOC" +flags = "FieldUnit", "OneAttack", "AirAttacker", "Bombarder", + "HasNoZOC", "IronBased" roles = "DefendOk", "DefendOkStartUnit" helptext = _("\ An improved Bomber, with improved attack and a higher movement\ @@ -1713,7 +1753,7 @@ uk_shield = 1 uk_food = 1 uk_gold = 1 cargo = "Land", "Small Land", "Merchant" -flags = "BadCityDefender", "HasNoZOC", "Provoking" +flags = "BadCityDefender", "HasNoZOC", "Provoking", "IronBased" roles = "Ferryboat", "FerryStartUnit" helptext = _("\ The Trireme is your first boat unit. It can act\ @@ -1749,7 +1789,7 @@ uk_food = 1 uk_gold = 1 cargo = "Land", "Small Land", "Merchant" flags = "BadCityDefender", "Only_Native_Attack", "HasNoZOC", - "Provoking", "Coast" + "Provoking", "Coast", "IronBased" roles = "Ferryboat", "FerryStartUnit", "BarbarianBoat" helptext = _("\ The Caravel is a sailing ship that can enter\ @@ -1783,7 +1823,7 @@ uk_shield = 1 uk_food = 1 uk_gold = 1 cargo = "Land", "Small Land", "Big Land", "Merchant" -flags = "BadCityDefender", "HasNoZOC", "Provoking" +flags = "BadCityDefender", "HasNoZOC", "Provoking", "IronBased" roles = "Ferryboat", "FerryStartUnit", "BarbarianBoat" helptext = _("\ The Galleon is a pure transport ship, the first which can\ @@ -1816,7 +1856,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "BadCityDefender" +flags = "BadCityDefender", "IronBased" roles = "Hunter" helptext = _("\ The Frigate is a specialized ship with a strong offensive value,\ @@ -1848,7 +1888,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "BadCityDefender" +flags = "BadCityDefender", "IronBased" roles = "Hunter" helptext = _("\ The Ironclad is an armored ship,\ @@ -1884,7 +1924,7 @@ bonuses = { "flag", "type", "value" "Submarine", "DefenseMultiplier", 1 } -flags = "BadCityDefender" +flags = "BadCityDefender", "IronBased" roles = "Hunter" helptext = _("\ An improved Ironclad, with better move rate and vision.\ @@ -1919,7 +1959,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 1 uk_gold = 1 -flags = "BadCityDefender" +flags = "BadCityDefender", "IronBased" roles = "DefendOk", "DefendOkStartUnit" helptext = _("\ The Cruiser is a strong offensive boat unit.\ @@ -1954,7 +1994,7 @@ bonuses = { "flag", "type", "value" "AirAttacker", "DefenseMultiplier", 4 } -flags = "BadCityDefender" +flags = "BadCityDefender", "IronBased" roles = "DefendGood", "DefendGoodStartUnit" helptext = _("\ The AEGIS Cruiser is equipped with an advanced\ @@ -1990,7 +2030,7 @@ uk_gold = 1 ; Consensus historical article: "Airplanes Sink a Battleship? ; No, Sir! Declares President" Chicago Daily Tribune, Feb. 26, 1938. ; */ <-- avoid gettext warnings -flags = "BadCityDefender", "Consensus" +flags = "BadCityDefender", "Consensus", "IronBased" roles = "DefendOk", "DefendOkStartUnit" helptext = _("\ The Battleship is the supreme naval unit with\ @@ -2025,7 +2065,7 @@ uk_gold = 1 cargo = "Missile" vision_layer = "Subsurface" flags = "BadCityDefender", "Only_Native_Attack", - "Submarine", "Provoking" + "Submarine", "Provoking", "IronBased" roles = "Hunter" helptext = _("\ Traveling under the surface of the ocean, Submarines have\ @@ -2061,7 +2101,7 @@ uk_gold = 1 cargo = "Missile" vision_layer = "Subsurface" flags = "BadCityDefender", "Only_Native_Attack", - "Submarine", "Provoking", "TacticalNuke" + "Submarine", "Provoking", "TacticalNuke", "IronBased" roles = "Hunter" helptext = _("\ A SSBN is a nuclear submarine.\ @@ -2097,7 +2137,8 @@ uk_gold = 1 cargo = "Land", "Air", "Missile", "Helicopter" ; Consensus historical article: Julian Borger. "Wake-up call" ; The Guardian, Sep. 6, 2002. -flags = "BadCityDefender", "HasNoZOC", "Consensus", "Provoking" +flags = "BadCityDefender", "HasNoZOC", "Consensus", "Provoking", + "IronBased" roles = "DefendGood", "DefendGoodStartUnit" helptext = _("\ The Carrier is a mobile airport.\ @@ -2138,7 +2179,7 @@ uk_food = 1 uk_gold = 1 cargo = "Land", "Small Land", "Big Land", "Merchant" flags = "Settlers", "BadCityDefender", "HasNoZOC", - "Provoking" + "Provoking", "IronBased" veteran_names = _("green"), _("veteran"), _("hardened"), _("elite") veteran_base_raise_chance = 50, 33, 20, 0 veteran_work_raise_chance = 0, 0, 0, 0 @@ -2182,7 +2223,8 @@ uk_shield = 1 uk_food = 0 uk_gold = 1 targets = "Air", "Missile", "Helicopter" -flags = "OneAttack", "AirAttacker", "CityBuster", "HasNoZOC" +flags = "OneAttack", "AirAttacker", "CityBuster", "HasNoZOC", + "IronBased" roles = "" helptext = _("\ The Cruise Missile is a long-distance missile\ @@ -2217,7 +2259,7 @@ uk_happy = 1 uk_shield = 1 uk_food = 0 uk_gold = 1 -flags = "FieldUnit", "OneAttack", "Nuclear", "HasNoZOC" +flags = "FieldUnit", "OneAttack", "Nuclear", "HasNoZOC", "IronBased" ; No veteran levels (level name is never displayed) veteran_names = _("green") veteran_base_raise_chance = 0 @@ -2275,7 +2317,8 @@ uk_happy = 1 uk_shield = 1 uk_food = 0 uk_gold = 1 -flags = "FieldUnit", "OneAttack", "NuclearOP", "HasNoZOC" +flags = "FieldUnit", "OneAttack", "NuclearOP", "HasNoZOC", + "IronBased" ; No veteran levels (level name is never displayed) veteran_names = _("green") veteran_base_raise_chance = 0 @@ -2572,7 +2615,8 @@ uk_happy = 0 uk_shield = 1 uk_food = 0 uk_gold = 1 -flags = "TradeRoute", "HelpWonder", "NonMil", "HasNoZOC", "Capturable" +flags = "TradeRoute", "HelpWonder", "NonMil", "HasNoZOC", + "Capturable", "IronBased" roles = "" helptext = _("\ The Freight unit replaces the Caravan, and moves at twice the speed.\ @@ -2734,7 +2778,7 @@ uk_happy = 0 uk_shield = 1 uk_food = 0 uk_gold = 1 -flags = "HasNoZOC" +flags = "HasNoZOC", "IronBased" roles = "" helptext = _("\ The AWACS (Airborne Warning and Control System) is an airplane with an \ -- 2.20.1