From cfe4886c2adda9db13f6a8b26a65418918173261 Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Sun, 13 Feb 2022 16:59:33 +0200 Subject: [PATCH 38/38] Add BarbarianBoatTech unit role Requested by ihnatus See osdn #41867 Signed-off-by: Marko Lindqvist --- common/unittype.h | 71 +++++++++++++++++--------------- data/alien/units.ruleset | 2 + data/civ1/units.ruleset | 2 + data/civ2/units.ruleset | 2 + data/civ2civ3/units.ruleset | 2 + data/classic/units.ruleset | 2 + data/goldkeep/units.ruleset | 2 + data/granularity/units.ruleset | 2 + data/multiplayer/units.ruleset | 2 + data/ruledit/comments-3.2.txt | 14 ++++--- data/sandbox/units.ruleset | 2 + data/stub/units.ruleset | 2 + data/webperimental/units.ruleset | 2 + fc_version | 2 +- server/barbarian.c | 2 +- 15 files changed, 69 insertions(+), 42 deletions(-) diff --git a/common/unittype.h b/common/unittype.h index f01afdb40b..81a4274c2e 100644 --- a/common/unittype.h +++ b/common/unittype.h @@ -364,57 +364,60 @@ struct unit_class { /* barbarian boat */ #define SPECENUM_VALUE85 L_BARBARIAN_BOAT #define SPECENUM_VALUE85NAME N_("?unitflag:BarbarianBoat") +/* barbarians boat, global tech required */ +#define SPECENUM_VALUE86 L_BARBARIAN_BOAT_TECH +#define SPECENUM_VALUE86NAME N_("?unitflag:BarbarianBoatTech") /* what barbarians should build */ -#define SPECENUM_VALUE86 L_BARBARIAN_BUILD -#define SPECENUM_VALUE86NAME N_("?unitflag:BarbarianBuild") +#define SPECENUM_VALUE87 L_BARBARIAN_BUILD +#define SPECENUM_VALUE87NAME N_("?unitflag:BarbarianBuild") /* barbarians build when global tech */ -#define SPECENUM_VALUE87 L_BARBARIAN_BUILD_TECH -#define SPECENUM_VALUE87NAME N_("?unitflag:BarbarianBuildTech") +#define SPECENUM_VALUE88 L_BARBARIAN_BUILD_TECH +#define SPECENUM_VALUE88NAME N_("?unitflag:BarbarianBuildTech") /* barbarian leader */ -#define SPECENUM_VALUE88 L_BARBARIAN_LEADER -#define SPECENUM_VALUE88NAME N_("?unitflag:BarbarianLeader") +#define SPECENUM_VALUE89 L_BARBARIAN_LEADER +#define SPECENUM_VALUE89NAME N_("?unitflag:BarbarianLeader") /* sea raider unit */ -#define SPECENUM_VALUE89 L_BARBARIAN_SEA -#define SPECENUM_VALUE89NAME N_("?unitflag:BarbarianSea") +#define SPECENUM_VALUE90 L_BARBARIAN_SEA +#define SPECENUM_VALUE90NAME N_("?unitflag:BarbarianSea") /* sea raider unit, global tech required */ -#define SPECENUM_VALUE90 L_BARBARIAN_SEA_TECH -#define SPECENUM_VALUE90NAME N_("?unitflag:BarbarianSeaTech") +#define SPECENUM_VALUE91 L_BARBARIAN_SEA_TECH +#define SPECENUM_VALUE91NAME N_("?unitflag:BarbarianSeaTech") /* StartUnit: Cities */ -#define SPECENUM_VALUE91 L_START_CITIES -#define SPECENUM_VALUE91NAME N_("?unitflag:CitiesStartUnit") +#define SPECENUM_VALUE92 L_START_CITIES +#define SPECENUM_VALUE92NAME N_("?unitflag:CitiesStartUnit") /* StartUnit: Worker */ -#define SPECENUM_VALUE92 L_START_WORKER -#define SPECENUM_VALUE92NAME N_("?unitflag:WorkerStartUnit") +#define SPECENUM_VALUE93 L_START_WORKER +#define SPECENUM_VALUE93NAME N_("?unitflag:WorkerStartUnit") /* StartUnit: Explorer */ -#define SPECENUM_VALUE93 L_START_EXPLORER -#define SPECENUM_VALUE93NAME N_("?unitflag:ExplorerStartUnit") +#define SPECENUM_VALUE94 L_START_EXPLORER +#define SPECENUM_VALUE94NAME N_("?unitflag:ExplorerStartUnit") /* StartUnit: King */ -#define SPECENUM_VALUE94 L_START_KING -#define SPECENUM_VALUE94NAME N_("?unitflag:KingStartUnit") +#define SPECENUM_VALUE95 L_START_KING +#define SPECENUM_VALUE95NAME N_("?unitflag:KingStartUnit") /* StartUnit: Diplomat */ -#define SPECENUM_VALUE95 L_START_DIPLOMAT -#define SPECENUM_VALUE95NAME N_("?unitflag:DiplomatStartUnit") +#define SPECENUM_VALUE96 L_START_DIPLOMAT +#define SPECENUM_VALUE96NAME N_("?unitflag:DiplomatStartUnit") /* StartUnit: Ferryboat */ -#define SPECENUM_VALUE96 L_START_FERRY -#define SPECENUM_VALUE96NAME N_("?unitflag:FerryStartUnit") +#define SPECENUM_VALUE97 L_START_FERRY +#define SPECENUM_VALUE97NAME N_("?unitflag:FerryStartUnit") /* StartUnit: DefendOk */ -#define SPECENUM_VALUE97 L_START_DEFEND_OK -#define SPECENUM_VALUE97NAME N_("?unitflag:DefendOkStartUnit") +#define SPECENUM_VALUE98 L_START_DEFEND_OK +#define SPECENUM_VALUE98NAME N_("?unitflag:DefendOkStartUnit") /* StartUnit: DefendGood */ -#define SPECENUM_VALUE98 L_START_DEFEND_GOOD -#define SPECENUM_VALUE98NAME N_("?unitflag:DefendGoodStartUnit") +#define SPECENUM_VALUE99 L_START_DEFEND_GOOD +#define SPECENUM_VALUE99NAME N_("?unitflag:DefendGoodStartUnit") /* StartUnit: AttackFast */ -#define SPECENUM_VALUE99 L_START_ATTACK_FAST -#define SPECENUM_VALUE99NAME N_("?unitflag:AttackFastStartUnit") +#define SPECENUM_VALUE100 L_START_ATTACK_FAST +#define SPECENUM_VALUE100NAME N_("?unitflag:AttackFastStartUnit") /* StartUnit: AttackStrong */ -#define SPECENUM_VALUE100 L_START_ATTACK_STRONG -#define SPECENUM_VALUE100NAME N_("?unitflag:AttackStrongStartUnit") +#define SPECENUM_VALUE101 L_START_ATTACK_STRONG +#define SPECENUM_VALUE101NAME N_("?unitflag:AttackStrongStartUnit") /* AI hunter type unit */ -#define SPECENUM_VALUE101 L_HUNTER -#define SPECENUM_VALUE101NAME N_("?unitflag:Hunter") +#define SPECENUM_VALUE102 L_HUNTER +#define SPECENUM_VALUE102NAME N_("?unitflag:Hunter") /* can improve terrain */ -#define SPECENUM_VALUE102 L_SETTLERS -#define SPECENUM_VALUE102NAME N_("?unitflag:Settlers") +#define SPECENUM_VALUE103 L_SETTLERS +#define SPECENUM_VALUE103NAME N_("?unitflag:Settlers") #define L_LAST (L_SETTLERS + 1) #include "specenum_gen.h" diff --git a/data/alien/units.ruleset b/data/alien/units.ruleset index cd6e119c6a..bd79198e71 100644 --- a/data/alien/units.ruleset +++ b/data/alien/units.ruleset @@ -418,6 +418,8 @@ flags = "Missile", "DoesntOccupyTile" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/civ1/units.ruleset b/data/civ1/units.ruleset index 876d2ad780..9b18932bd6 100644 --- a/data/civ1/units.ruleset +++ b/data/civ1/units.ruleset @@ -316,6 +316,8 @@ flags = "Missile", "Unreachable", "HutNothing" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/civ2/units.ruleset b/data/civ2/units.ruleset index a846778c22..421a87558a 100644 --- a/data/civ2/units.ruleset +++ b/data/civ2/units.ruleset @@ -334,6 +334,8 @@ flags = "Unreachable", "DoesntOccupyTile", "HutFrighten" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/civ2civ3/units.ruleset b/data/civ2civ3/units.ruleset index a7b33b8123..8c32427397 100644 --- a/data/civ2civ3/units.ruleset +++ b/data/civ2civ3/units.ruleset @@ -449,6 +449,8 @@ flags = "Unreachable", "DoesntOccupyTile", "CanPillage", ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/classic/units.ruleset b/data/classic/units.ruleset index 33010fccbd..761b239ff5 100644 --- a/data/classic/units.ruleset +++ b/data/classic/units.ruleset @@ -421,6 +421,8 @@ flags = "Unreachable", "DoesntOccupyTile", "HutFrighten" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/goldkeep/units.ruleset b/data/goldkeep/units.ruleset index 4106eeb47e..08d17834f9 100644 --- a/data/goldkeep/units.ruleset +++ b/data/goldkeep/units.ruleset @@ -433,6 +433,8 @@ flags = "Unreachable", "DoesntOccupyTile", "HutFrighten" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/granularity/units.ruleset b/data/granularity/units.ruleset index 9a39949eb6..310df3e747 100644 --- a/data/granularity/units.ruleset +++ b/data/granularity/units.ruleset @@ -359,6 +359,8 @@ flags = "TerrainSpeed" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/multiplayer/units.ruleset b/data/multiplayer/units.ruleset index 0facf80eee..f683ca46a2 100644 --- a/data/multiplayer/units.ruleset +++ b/data/multiplayer/units.ruleset @@ -421,6 +421,8 @@ flags = "Unreachable", "DoesntOccupyTile", "HutFrighten" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/ruledit/comments-3.2.txt b/data/ruledit/comments-3.2.txt index 081cd098f5..d8b211a6fe 100644 --- a/data/ruledit/comments-3.2.txt +++ b/data/ruledit/comments-3.2.txt @@ -532,13 +532,15 @@ utypes = "\ ; \"DefendOk\" = AI hint: ok for defending with\n\ ; \"DefendGood\" = AI hint: good for defending with\n\ ; \"Ferryboat\" = AI hint: useful for ferrying\n\ -; \"Barbarian\" = can be created as land barbarian\n\ -; \"BarbarianTech\" = can be created as land barbarian, if someone has\n\ -; researched its tech requirements\n\ -; \"BarbarianBoat\" = can be created as boat for sea barbarian\n\ -; \"BarbarianBuild\" = can be built by barbarians\n\ +; \"Barbarian\" = can be created as land barbarian\n\ +; \"BarbarianTech\" = can be created as land barbarian, if someone has\n\ +; researched its tech requirements\n\ +; \"BarbarianBoat\" = can be created as boat for sea barbarian\n\ +; \"BarbarianBoatTech\" = can be created as boat for sea barbarian, if someone has\n\ +; researched its tech requirements\n\ +; \"BarbarianBuild\" = can be built by barbarians\n\ ; \"BarbarianBuildTech\" = can be built by barbarians if someone has\n\ -; researched its tech requirements\n\ +; researched its tech requirements\n\ ; \"BarbarianLeader\" = this unit is the barbarian leader (only one)\n\ ; \"BarbarianSea\" = can be created as a barbarian that disembarks from a barbarian boat\n\ ; \"BarbarianSeaTech\" = can be created as a barbarian that disembarks from a barbarian boat\n\ diff --git a/data/sandbox/units.ruleset b/data/sandbox/units.ruleset index 2b0cc058a1..785e46fc56 100644 --- a/data/sandbox/units.ruleset +++ b/data/sandbox/units.ruleset @@ -462,6 +462,8 @@ flags = "Unreachable", "DoesntOccupyTile", "CanPillage", ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/stub/units.ruleset b/data/stub/units.ruleset index c430a2445e..3387335f1f 100644 --- a/data/stub/units.ruleset +++ b/data/stub/units.ruleset @@ -343,6 +343,8 @@ flags = "" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/data/webperimental/units.ruleset b/data/webperimental/units.ruleset index c97ad932af..203307ebc9 100644 --- a/data/webperimental/units.ruleset +++ b/data/webperimental/units.ruleset @@ -425,6 +425,8 @@ flags = "Unreachable", "DoesntOccupyTile", "HutFrighten" ; "BarbarianTech" = can be created as land barbarian, if someone has ; researched its tech requirements ; "BarbarianBoat" = can be created as boat for sea barbarian +; "BarbarianBoatTech" = can be created as boat for sea barbarian, if someone has +; researched its tech requirements ; "BarbarianBuild" = can be built by barbarians ; "BarbarianBuildTech" = can be built by barbarians if someone has ; researched its tech requirements diff --git a/fc_version b/fc_version index b2118bbc9c..7b1392a823 100755 --- a/fc_version +++ b/fc_version @@ -56,7 +56,7 @@ DEFAULT_FOLLOW_TAG=S3_2 # - No new mandatory capabilities can be added to the release branch; doing # so would break network capability of supposedly "compatible" releases. # -NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2022.Feb.13" +NETWORK_CAPSTRING="+Freeciv.Devel-3.2-2022.Feb.13b" FREECIV_DISTRIBUTOR="" diff --git a/server/barbarian.c b/server/barbarian.c index 63ea25ffd8..fb543179fd 100644 --- a/server/barbarian.c +++ b/server/barbarian.c @@ -390,7 +390,7 @@ bool unleash_barbarians(struct tile *ptile) struct unit_type *candidate; int rdir = random_unchecked_direction(ocean_tiles - checked_count, checked); - candidate = find_a_unit_type(L_BARBARIAN_BOAT, -1); + candidate = find_a_unit_type(L_BARBARIAN_BOAT, L_BARBARIAN_BOAT_TECH); if (is_native_tile(candidate, dir_tiles[rdir])) { boat = create_unit(barbarians, dir_tiles[rdir], candidate, 0, 0, -1); -- 2.34.1