Project

General

Profile

Feature #1195 ยป 0033-Turn-Shield2Gold-to-a-user-unit-type-flag.patch

Marko Lindqvist, 12/22/2024 06:12 PM

View differences:

client/helpdata.c
"choose to do so even if it has better odds when defending "
"against it than when attacking it.\n"), BULLET);
}
if (utype_has_flag(utype, UTYF_SHIELD2GOLD)) {
/* FIXME: the conversion shield => gold is activated if
* EFT_SHIELD2GOLD_FACTOR is not equal null; how to determine
* possible sources? */
CATLSTR(buf, bufsz,
_("%s Under certain conditions the shield upkeep of this unit can "
"be converted to gold upkeep.\n"), BULLET);
}
unit_class_iterate(target) {
if (uclass_has_flag(target, UCF_UNREACHABLE)
common/unittype.h
/* Can 'refuel' at coast - meaningless if fuel value not set */
#define SPECENUM_VALUE10 UTYF_COAST
#define SPECENUM_VALUE10NAME N_("?unitflag:Coast")
/* upkeep can switch from shield to gold */
#define SPECENUM_VALUE11 UTYF_SHIELD2GOLD
#define SPECENUM_VALUE11NAME N_("?unitflag:Shield2Gold")
/* Strong in diplomatic battles. */
#define SPECENUM_VALUE12 UTYF_SPY
#define SPECENUM_VALUE12NAME N_("?unitflag:Spy")
#define SPECENUM_VALUE11 UTYF_SPY
#define SPECENUM_VALUE11NAME N_("?unitflag:Spy")
/* Cannot attack vs non-native tiles even if class can */
#define SPECENUM_VALUE13 UTYF_ONLY_NATIVE_ATTACK
#define SPECENUM_VALUE13NAME N_("?unitflag:Only_Native_Attack")
#define SPECENUM_VALUE12 UTYF_ONLY_NATIVE_ATTACK
#define SPECENUM_VALUE12NAME N_("?unitflag:Only_Native_Attack")
/* Only Fundamentalist government can build these units */
#define SPECENUM_VALUE14 UTYF_FANATIC
#define SPECENUM_VALUE14NAME N_("?unitflag:Fanatic")
#define SPECENUM_VALUE13 UTYF_FANATIC
#define SPECENUM_VALUE13NAME N_("?unitflag:Fanatic")
/* Losing this unit means losing the game */
#define SPECENUM_VALUE15 UTYF_GAMELOSS
#define SPECENUM_VALUE15NAME N_("?unitflag:GameLoss")
#define SPECENUM_VALUE14 UTYF_GAMELOSS
#define SPECENUM_VALUE14NAME N_("?unitflag:GameLoss")
/* A player can only have one unit of this type */
#define SPECENUM_VALUE16 UTYF_UNIQUE
#define SPECENUM_VALUE16NAME N_("?unitflag:Unique")
#define SPECENUM_VALUE15 UTYF_UNIQUE
#define SPECENUM_VALUE15NAME N_("?unitflag:Unique")
/* When a transport containing this unit disappears the game will try to
* rescue units with this flag before it tries to rescue units without
* it. */
#define SPECENUM_VALUE17 UTYF_EVAC_FIRST
#define SPECENUM_VALUE17NAME N_("?unitflag:EvacuateFirst")
#define SPECENUM_VALUE16 UTYF_EVAC_FIRST
#define SPECENUM_VALUE16NAME N_("?unitflag:EvacuateFirst")
/* Always wins diplomatic contests */
#define SPECENUM_VALUE18 UTYF_SUPERSPY
#define SPECENUM_VALUE18NAME N_("?unitflag:SuperSpy")
#define SPECENUM_VALUE17 UTYF_SUPERSPY
#define SPECENUM_VALUE17NAME N_("?unitflag:SuperSpy")
/* Has no homecity */
#define SPECENUM_VALUE19 UTYF_NOHOME
#define SPECENUM_VALUE19NAME N_("?unitflag:NoHome")
#define SPECENUM_VALUE18 UTYF_NOHOME
#define SPECENUM_VALUE18NAME N_("?unitflag:NoHome")
/* Unreserved - clean out */
#define SPECENUM_VALUE20 UTYF_UNRESERVED
#define SPECENUM_VALUE20NAME "Unreserved"
#define SPECENUM_VALUE19 UTYF_UNRESERVED
#define SPECENUM_VALUE19NAME "Unreserved"
/* Gets double firepower against cities */
#define SPECENUM_VALUE21 UTYF_CITYBUSTER
#define SPECENUM_VALUE21NAME N_("?unitflag:CityBuster")
#define SPECENUM_VALUE20 UTYF_CITYBUSTER
#define SPECENUM_VALUE20NAME N_("?unitflag:CityBuster")
/* Unit cannot be built (barb leader etc) */
#define SPECENUM_VALUE22 UTYF_NOBUILD
#define SPECENUM_VALUE22NAME N_("?unitflag:NoBuild")
#define SPECENUM_VALUE21 UTYF_NOBUILD
#define SPECENUM_VALUE21NAME N_("?unitflag:NoBuild")
/* Firepower set to 1 when EFT_DEFEND_BONUS applies
* (for example, land unit attacking city with walls) */
#define SPECENUM_VALUE23 UTYF_BADWALLATTACKER
#define SPECENUM_VALUE23NAME N_("?unitflag:BadWallAttacker")
#define SPECENUM_VALUE22 UTYF_BADWALLATTACKER
#define SPECENUM_VALUE22NAME N_("?unitflag:BadWallAttacker")
/* Firepower set to 1 and attackers x2 when in city */
#define SPECENUM_VALUE24 UTYF_BADCITYDEFENDER
#define SPECENUM_VALUE24NAME N_("?unitflag:BadCityDefender")
#define SPECENUM_VALUE23 UTYF_BADCITYDEFENDER
#define SPECENUM_VALUE23NAME N_("?unitflag:BadCityDefender")
/* Only barbarians can build this unit */
#define SPECENUM_VALUE25 UTYF_BARBARIAN_ONLY
#define SPECENUM_VALUE25NAME N_("?unitflag:BarbarianOnly")
#define SPECENUM_VALUE24 UTYF_BARBARIAN_ONLY
#define SPECENUM_VALUE24NAME N_("?unitflag:BarbarianOnly")
/* Unit can't be built in scenarios where founding new cities is prevented. */
#define SPECENUM_VALUE26 UTYF_NEWCITY_GAMES_ONLY
#define SPECENUM_VALUE26NAME N_("?unitflag:NewCityGamesOnly")
#define SPECENUM_VALUE25 UTYF_NEWCITY_GAMES_ONLY
#define SPECENUM_VALUE25NAME N_("?unitflag:NewCityGamesOnly")
/* Can kill escaping units */
#define SPECENUM_VALUE27 UTYF_CANKILLESCAPING
#define SPECENUM_VALUE27NAME N_("?unitflag:CanKillEscaping")
#define SPECENUM_VALUE26 UTYF_CANKILLESCAPING
#define SPECENUM_VALUE26NAME N_("?unitflag:CanKillEscaping")
/* Makes random movement, not under player control */
#define SPECENUM_VALUE28 UTYF_RANDOM_MOVEMENT
#define SPECENUM_VALUE28NAME N_("?unitflag:RandomMovement")
#define SPECENUM_VALUE27 UTYF_RANDOM_MOVEMENT
#define SPECENUM_VALUE27NAME N_("?unitflag:RandomMovement")
/* Do not show flag for the unit */
#define SPECENUM_VALUE29 UTYF_FLAGLESS
#define SPECENUM_VALUE29NAME N_("?unitflag:Flagless")
#define SPECENUM_VALUE30 UTYF_PROVIDES_RANSOM
#define SPECENUM_VALUE30NAME N_("?unitflag:ProvidesRansom")
#define SPECENUM_VALUE31 UTYF_USER_FLAG_1
#define SPECENUM_VALUE32 UTYF_USER_FLAG_2
#define SPECENUM_VALUE33 UTYF_USER_FLAG_3
#define SPECENUM_VALUE34 UTYF_USER_FLAG_4
#define SPECENUM_VALUE35 UTYF_USER_FLAG_5
#define SPECENUM_VALUE36 UTYF_USER_FLAG_6
#define SPECENUM_VALUE37 UTYF_USER_FLAG_7
#define SPECENUM_VALUE38 UTYF_USER_FLAG_8
#define SPECENUM_VALUE39 UTYF_USER_FLAG_9
#define SPECENUM_VALUE40 UTYF_USER_FLAG_10
#define SPECENUM_VALUE41 UTYF_USER_FLAG_11
#define SPECENUM_VALUE42 UTYF_USER_FLAG_12
#define SPECENUM_VALUE43 UTYF_USER_FLAG_13
#define SPECENUM_VALUE44 UTYF_USER_FLAG_14
#define SPECENUM_VALUE45 UTYF_USER_FLAG_15
#define SPECENUM_VALUE46 UTYF_USER_FLAG_16
#define SPECENUM_VALUE47 UTYF_USER_FLAG_17
#define SPECENUM_VALUE48 UTYF_USER_FLAG_18
#define SPECENUM_VALUE49 UTYF_USER_FLAG_19
#define SPECENUM_VALUE50 UTYF_USER_FLAG_20
#define SPECENUM_VALUE51 UTYF_USER_FLAG_21
#define SPECENUM_VALUE52 UTYF_USER_FLAG_22
#define SPECENUM_VALUE53 UTYF_USER_FLAG_23
#define SPECENUM_VALUE54 UTYF_USER_FLAG_24
#define SPECENUM_VALUE55 UTYF_USER_FLAG_25
#define SPECENUM_VALUE56 UTYF_USER_FLAG_26
#define SPECENUM_VALUE57 UTYF_USER_FLAG_27
#define SPECENUM_VALUE58 UTYF_USER_FLAG_28
#define SPECENUM_VALUE59 UTYF_USER_FLAG_29
#define SPECENUM_VALUE60 UTYF_USER_FLAG_30
#define SPECENUM_VALUE61 UTYF_USER_FLAG_31
#define SPECENUM_VALUE62 UTYF_USER_FLAG_32
#define SPECENUM_VALUE63 UTYF_USER_FLAG_33
#define SPECENUM_VALUE64 UTYF_USER_FLAG_34
#define SPECENUM_VALUE65 UTYF_USER_FLAG_35
#define SPECENUM_VALUE66 UTYF_USER_FLAG_36
#define SPECENUM_VALUE67 UTYF_USER_FLAG_37
#define SPECENUM_VALUE68 UTYF_USER_FLAG_38
#define SPECENUM_VALUE69 UTYF_USER_FLAG_39
#define SPECENUM_VALUE70 UTYF_USER_FLAG_40
#define SPECENUM_VALUE71 UTYF_USER_FLAG_41
#define SPECENUM_VALUE72 UTYF_USER_FLAG_42
#define SPECENUM_VALUE73 UTYF_USER_FLAG_43
#define SPECENUM_VALUE74 UTYF_USER_FLAG_44
#define SPECENUM_VALUE75 UTYF_USER_FLAG_45
#define SPECENUM_VALUE76 UTYF_USER_FLAG_46
#define SPECENUM_VALUE77 UTYF_USER_FLAG_47
#define SPECENUM_VALUE78 UTYF_USER_FLAG_48
#define SPECENUM_VALUE79 UTYF_USER_FLAG_49
#define SPECENUM_VALUE80 UTYF_USER_FLAG_50
#define SPECENUM_VALUE81 UTYF_USER_FLAG_51
#define SPECENUM_VALUE82 UTYF_USER_FLAG_52
#define SPECENUM_VALUE28 UTYF_FLAGLESS
#define SPECENUM_VALUE28NAME N_("?unitflag:Flagless")
#define SPECENUM_VALUE29 UTYF_PROVIDES_RANSOM
#define SPECENUM_VALUE29NAME N_("?unitflag:ProvidesRansom")
#define SPECENUM_VALUE30 UTYF_USER_FLAG_1
#define SPECENUM_VALUE31 UTYF_USER_FLAG_2
#define SPECENUM_VALUE32 UTYF_USER_FLAG_3
#define SPECENUM_VALUE33 UTYF_USER_FLAG_4
#define SPECENUM_VALUE34 UTYF_USER_FLAG_5
#define SPECENUM_VALUE35 UTYF_USER_FLAG_6
#define SPECENUM_VALUE36 UTYF_USER_FLAG_7
#define SPECENUM_VALUE37 UTYF_USER_FLAG_8
#define SPECENUM_VALUE38 UTYF_USER_FLAG_9
#define SPECENUM_VALUE39 UTYF_USER_FLAG_10
#define SPECENUM_VALUE40 UTYF_USER_FLAG_11
#define SPECENUM_VALUE41 UTYF_USER_FLAG_12
#define SPECENUM_VALUE42 UTYF_USER_FLAG_13
#define SPECENUM_VALUE43 UTYF_USER_FLAG_14
#define SPECENUM_VALUE44 UTYF_USER_FLAG_15
#define SPECENUM_VALUE45 UTYF_USER_FLAG_16
#define SPECENUM_VALUE46 UTYF_USER_FLAG_17
#define SPECENUM_VALUE47 UTYF_USER_FLAG_18
#define SPECENUM_VALUE48 UTYF_USER_FLAG_19
#define SPECENUM_VALUE49 UTYF_USER_FLAG_20
#define SPECENUM_VALUE50 UTYF_USER_FLAG_21
#define SPECENUM_VALUE51 UTYF_USER_FLAG_22
#define SPECENUM_VALUE52 UTYF_USER_FLAG_23
#define SPECENUM_VALUE53 UTYF_USER_FLAG_24
#define SPECENUM_VALUE54 UTYF_USER_FLAG_25
#define SPECENUM_VALUE55 UTYF_USER_FLAG_26
#define SPECENUM_VALUE56 UTYF_USER_FLAG_27
#define SPECENUM_VALUE57 UTYF_USER_FLAG_28
#define SPECENUM_VALUE58 UTYF_USER_FLAG_29
#define SPECENUM_VALUE59 UTYF_USER_FLAG_30
#define SPECENUM_VALUE60 UTYF_USER_FLAG_31
#define SPECENUM_VALUE61 UTYF_USER_FLAG_32
#define SPECENUM_VALUE62 UTYF_USER_FLAG_33
#define SPECENUM_VALUE63 UTYF_USER_FLAG_34
#define SPECENUM_VALUE64 UTYF_USER_FLAG_35
#define SPECENUM_VALUE65 UTYF_USER_FLAG_36
#define SPECENUM_VALUE66 UTYF_USER_FLAG_37
#define SPECENUM_VALUE67 UTYF_USER_FLAG_38
#define SPECENUM_VALUE68 UTYF_USER_FLAG_39
#define SPECENUM_VALUE69 UTYF_USER_FLAG_40
#define SPECENUM_VALUE70 UTYF_USER_FLAG_41
#define SPECENUM_VALUE71 UTYF_USER_FLAG_42
#define SPECENUM_VALUE72 UTYF_USER_FLAG_43
#define SPECENUM_VALUE73 UTYF_USER_FLAG_44
#define SPECENUM_VALUE74 UTYF_USER_FLAG_45
#define SPECENUM_VALUE75 UTYF_USER_FLAG_46
#define SPECENUM_VALUE76 UTYF_USER_FLAG_47
#define SPECENUM_VALUE77 UTYF_USER_FLAG_48
#define SPECENUM_VALUE78 UTYF_USER_FLAG_49
#define SPECENUM_VALUE79 UTYF_USER_FLAG_50
#define SPECENUM_VALUE80 UTYF_USER_FLAG_51
#define SPECENUM_VALUE81 UTYF_USER_FLAG_52
#define SPECENUM_VALUE82 UTYF_USER_FLAG_53
/* Note that first role must have value next to last flag */
#define UTYF_LAST_USER_FLAG UTYF_USER_FLAG_52
#define UTYF_LAST_USER_FLAG UTYF_USER_FLAG_53
#define MAX_NUM_USER_UNIT_FLAGS (UTYF_LAST_USER_FLAG - UTYF_USER_FLAG_1 + 1)
#define SPECENUM_NAMEOVERRIDE
#define SPECENUM_NAME_UPDATER
data/alien/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/civ1/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/civ2/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/civ2civ3/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/classic/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/goldkeep/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
_("Cant_Fortify")
_("OneAttack")
_("Bomber"), _("Bad at attacking Fighters")
_("Shield2Gold"), _("May switch from shield upkeep to gold upkeep")
}
; Names for custom unit class flags. There can be up to 25 of these.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/granularity/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/multiplayer/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/ruledit/comments-3.3.txt
; and firepower of attacker is doubled (the Pearl Harbor\n\
; rule)\n\
; \"BarbarianOnly\" = only barbarians can build this unit\n\
; \"Shield2Gold\" = Switch from shield upkeep to gold upkeep possible\n\
; \"NewCityGamesOnly\" = unit can\'t be built on scenarios where founding new cities\n\
; is not allowed. Give this flag to units that would make no sense\n\
; to have in a game with such a scenario\n\
......
; This section has comments documenting user (custom) flag types
utype = "\
; Names for custom unit type flags. There can be up to 52 of these.\n\
; Names for custom unit type flags. There can be up to 53 of these.\n\
; name = rule name; In some circumstances user may see this\n\
; as part of some sentences, so try to make it descriptive\n\
; and sensible.\n\
data/sandbox/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/stub/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
data/webperimental/units.ruleset
format_version = 40
[control]
; Names for custom unit type flags. There can be up to 52 of these.
; Names for custom unit type flags. There can be up to 53 of these.
; name = rule name; In some circumstances user may see this
; as part of some sentences, so try to make it descriptive
; and sensible.
......
; and firepower of attacker is doubled (the Pearl Harbor
; rule)
; "BarbarianOnly" = only barbarians can build this unit
; "Shield2Gold" = Switch from shield upkeep to gold upkeep possible
; "NewCityGamesOnly" = unit can't be built on scenarios where founding new cities
; is not allowed. Give this flag to units that would make no sense
; to have in a game with such a scenario
server/ruleset/rscompat.c
const char *helptxt;
} new_flags_33[] = {
{ N_("NoVeteran"), N_("May acquire veteran status.") },
{ N_("CanEscape"), N_("Can try to escape stack death.") }
{ N_("CanEscape"), N_("Can try to escape stack death.") },
{ N_("Shield2Gold"), N_("May switch from shield upkeep to gold upkeep") }
};
enough_new_user_flags(new_flags_33, unit_type,
    (1-1/1)