From abdba5b2dde3e206e60d331a22567fbf9fea1e39 Mon Sep 17 00:00:00 2001 From: Sveinung Kvilhaugsvik Date: Thu, 4 Mar 2021 00:30:45 +0100 Subject: [PATCH 3/3] sandbox: demonstrate surviving nukes. Introduce the new unit type SSBN, a nuclear submarine. On top of being able to carry 16 ICBM or Nuclear units it gets the ability to launch one tactical nuke per turn once its owner discovers Rocketry. See osdn #41689 --- data/sandbox/effects.ruleset | 10 +++++++++- data/sandbox/game.ruleset | 18 ++++++++++++++---- data/sandbox/units.ruleset | 37 ++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+), 5 deletions(-) diff --git a/data/sandbox/effects.ruleset b/data/sandbox/effects.ruleset index fc37655082..46e1afb85c 100644 --- a/data/sandbox/effects.ruleset +++ b/data/sandbox/effects.ruleset @@ -4374,7 +4374,15 @@ reqs = [effect_nuke_units_blast_radius] type = "Nuke_Blast_Radius_1_Sq" -value = 2 +value = 1 +reqs = + { "type", "name", "range", "present" + "Action", "Nuke Units", "Local", TRUE + } + +[effect_nuke_units_move_price] +type = "Action_Success_Actor_Move_Cost" +value = 65535 reqs = { "type", "name", "range", "present" "Action", "Nuke Units", "Local", TRUE diff --git a/data/sandbox/game.ruleset b/data/sandbox/game.ruleset index 1f9908f785..03f44a5348 100644 --- a/data/sandbox/game.ruleset +++ b/data/sandbox/game.ruleset @@ -404,10 +404,10 @@ nuke_city_target_kind = "tiles" ; adjacent to the actor unit. The special value "unlimited" lifts the ; maximum distance restriction. The maximum distance can`t be smaller than ; the minimum distance. -nuke_units_max_range = 1 +nuke_units_max_range = 10 ; Will performing this action always consume the actor unit? -nuke_units_consuming_always = TRUE; +nuke_units_consuming_always = FALSE; ; The maximum distance from the actor unit to the target of the "Airlift Unit" ; action. The value 1 means that the targets must be on a tile adjacent to @@ -512,8 +512,8 @@ ui_name_explode_nuclear = _("%sNuke Target Tile%s") ; /* TRANS: _Nuke (100% chance of success). */ ui_name_nuke_city = _("%sNuke%s") -; /* TRANS: _Nuke Units (100% chance of success). */ -ui_name_nuke_units = _("%sNuke Units%s") +; /* TRANS: Tactical _Nuke (100% chance of success). */ +ui_name_nuke_units = _("Tactical %sNuke%s") ; /* TRANS: Set _Home City (100% chance of success). */ ui_name_home_city = _("Set %sHome City%s") @@ -1243,6 +1243,16 @@ actor_reqs = "MinMoveFrags", "1", "Local" } +[actionenabler_nuke_units] +action = "Nuke Units" +actor_reqs = + { "type", "name", "range" + "UnitFlag", "TacticalNuke", "Local" + "Tech", "Rocketry", "Player" + "MinMoveFrags", "1", "Local" + "DiplRel", "War", "Local" + } + ; The GameLoss unit requirement makes sending units on a suicide mission to ; capture and destroy cities deep inside enemy terrain national suicide. ; The risk of moving a GameLoss unit to the target city increases the cost diff --git a/data/sandbox/units.ruleset b/data/sandbox/units.ruleset index 92b9c78749..8490a26c7e 100644 --- a/data/sandbox/units.ruleset +++ b/data/sandbox/units.ruleset @@ -44,6 +44,7 @@ flags = _("AddToCity") _("Nuclear") _("NuclearOP") + _("TacticalNuke") _("Paratroopers"), _("Can be paradropped from a friendly city or suitable base.") _("Marines"), _("Can launch attack from non-native tiles.") _("Cant_Fortify") @@ -2033,6 +2034,42 @@ Traveling under the surface of the ocean, Submarines have\ off guard.\ ") +[unit_SSBN] +name = _("SSBN") +class = "Sea" +tech_req = "Nuclear Fission" +obsolete_by = "None" +graphic = "u.ssbn" +graphic_alt = "u.submarine" +sound_move = "m_ssbm" +sound_move_alt = "m_generic" +sound_fight = "f_ssbm" +sound_fight_alt = "f_generic" +build_cost = 320 +pop_cost = 0 +attack = 12 +defense = 5 +hitpoints = 20 +firepower = 1 +move_rate = 5 +vision_radius_sq = 8 +transport_cap = 16 +fuel = 0 +uk_happy = 0 +uk_shield = 1 +uk_food = 1 +uk_gold = 1 +cargo = "Missile" +vision_layer = "Subsurface" +flags = "BadCityDefender", "Only_Native_Attack", + "Submarine", "Provoking", "TacticalNuke" +roles = "Hunter" +helptext = _("\ +A SSBN is a nuclear submarine.\ +"), _("\ +It gets tactical nukes once you discover Rocketry.\ +") + [unit_carrier] name = _("Carrier") class = "Sea" -- 2.20.1