Project

Profile

Help

HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. *Read more...*

Feature #846557 ยป 0001-CanPillage-unit-class-flag-to-the-ruleset.patch

Sveinung Kvilhaugsvik, 2019-11-10 11:58 PM

View differences:

client/gui-qt/citydlg.cpp
if ((utype_fuel(target->value.utype)
&& !uclass_has_flag(pclass, UCF_TERRAIN_DEFENSE)
&& !uclass_has_flag(pclass, UCF_CAN_PILLAGE)
&& !utype_can_do_action(target->value.utype, ACTION_PILLAGE)
&& !uclass_has_flag(pclass, UCF_CAN_FORTIFY)
&& !uclass_has_flag(pclass, UCF_ZOC))
/* FIXME: Assumed to be flying since only missiles can do suicide
client/helpdata.c
"units on its tile.\n"));
}
}
if (uclass_has_flag(pclass, UCF_CAN_PILLAGE)) {
CATLSTR(buf, bufsz,
_(" * Can pillage tile improvements.\n"));
}
if (uclass_has_flag(pclass, UCF_DOESNT_OCCUPY_TILE)
&& !utype_has_flag(utype, UTYF_CIVILIAN)) {
CATLSTR(buf, bufsz,
common/unittype.h
/* Can fortify on land squares */
#define SPECENUM_VALUE8 UCF_CAN_FORTIFY
#define SPECENUM_VALUE8NAME N_("?uclassflag:CanFortify")
#define SPECENUM_VALUE9 UCF_CAN_PILLAGE
#define SPECENUM_VALUE9NAME N_("?uclassflag:CanPillage")
/* Cities can still work tile when enemy unit on it */
#define SPECENUM_VALUE10 UCF_DOESNT_OCCUPY_TILE
#define SPECENUM_VALUE10NAME N_("?uclassflag:DoesntOccupyTile")
#define SPECENUM_VALUE9 UCF_DOESNT_OCCUPY_TILE
#define SPECENUM_VALUE9NAME N_("?uclassflag:DoesntOccupyTile")
/* Can attack against units on non-native tiles */
#define SPECENUM_VALUE11 UCF_ATTACK_NON_NATIVE
#define SPECENUM_VALUE11NAME N_("?uclassflag:AttackNonNative")
#define SPECENUM_VALUE10 UCF_ATTACK_NON_NATIVE
#define SPECENUM_VALUE10NAME N_("?uclassflag:AttackNonNative")
/* Kills citizens upon successful attack against a city */
#define SPECENUM_VALUE12 UCF_KILLCITIZEN
#define SPECENUM_VALUE12NAME N_("?uclassflag:KillCitizen")
#define SPECENUM_VALUE13 UCF_USER_FLAG_1
#define SPECENUM_VALUE14 UCF_USER_FLAG_2
#define SPECENUM_VALUE15 UCF_USER_FLAG_3
#define SPECENUM_VALUE16 UCF_USER_FLAG_4
#define SPECENUM_VALUE17 UCF_USER_FLAG_5
#define SPECENUM_VALUE18 UCF_USER_FLAG_6
#define SPECENUM_VALUE19 UCF_USER_FLAG_7
#define SPECENUM_VALUE20 UCF_USER_FLAG_8
#define SPECENUM_VALUE21 UCF_USER_FLAG_9
#define SPECENUM_VALUE22 UCF_USER_FLAG_10
#define SPECENUM_VALUE23 UCF_USER_FLAG_11
#define SPECENUM_VALUE24 UCF_USER_FLAG_12
#define SPECENUM_VALUE11 UCF_KILLCITIZEN
#define SPECENUM_VALUE11NAME N_("?uclassflag:KillCitizen")
#define SPECENUM_VALUE12 UCF_USER_FLAG_1
#define SPECENUM_VALUE13 UCF_USER_FLAG_2
#define SPECENUM_VALUE14 UCF_USER_FLAG_3
#define SPECENUM_VALUE15 UCF_USER_FLAG_4
#define SPECENUM_VALUE16 UCF_USER_FLAG_5
#define SPECENUM_VALUE17 UCF_USER_FLAG_6
#define SPECENUM_VALUE18 UCF_USER_FLAG_7
#define SPECENUM_VALUE19 UCF_USER_FLAG_8
#define SPECENUM_VALUE20 UCF_USER_FLAG_9
#define SPECENUM_VALUE21 UCF_USER_FLAG_10
#define SPECENUM_VALUE22 UCF_USER_FLAG_11
#define SPECENUM_VALUE23 UCF_USER_FLAG_12
/* keep this last */
#define SPECENUM_COUNT UCF_COUNT
data/alien/units.ruleset
{ "name", "helptxt"
_("Airliftable"), _("Can be airlifted from a suitable city.")
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/civ1/units.ruleset
class_flags =
{ "name", "helptxt"
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/civ2/units.ruleset
class_flags =
{ "name", "helptxt"
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/civ2civ3/units.ruleset
_("Airliftable"), _("Can be airlifted from a suitable city.")
_("AttFromNonNative"), _("Can launch attack from non-native tiles.")
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/classic/units.ruleset
{ "name", "helptxt"
_("AttFromNonNative"), _("Can launch attack from non-native tiles.")
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/experimental/units.ruleset
_("Airliftable"), _("Can be airlifted from a suitable city.")
_("AttFromNonNative"), _("Can launch attack from non-native tiles.")
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/granularity/units.ruleset
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type flag
data/multiplayer/units.ruleset
{ "name", "helptxt"
_("AttFromNonNative"), _("Can launch attack from non-native tiles.")
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/ruledit/comments-3.1.txt
; override this\n\
; \"CanFortify\" = Unit can fortify at land tiles. Unit type flag\n\
; \"Cant_Fortify\" can override this\n\
; \"CanPillage\" = Unit can pillage tile infrastructure\n\
; \"DoesntOccupyTile\" = Even if this kind of enemy unit is on tile, cities can\n\
; still work that tile\n\
; \"AttackNonNative\" = Unit can attack units on non-native tiles. Unit type\n\
data/sandbox/units.ruleset
_("Expellable"), _("Can be peacefully expelled from foreign tiles.")
_("AttFromNonNative"), _("Can launch attack from non-native tiles.")
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
data/stub/units.ruleset
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type flag
data/webperimental/units.ruleset
{ "name", "helptxt"
_("AttFromNonNative"), _("Can launch attack from non-native tiles.")
_("Missile")
_("CanPillage")
}
[veteran_system]
......
; override this
; "CanFortify" = Unit can fortify at land tiles. Unit type flag
; "Cant_Fortify" can override this
; "CanPillage" = Unit can pillage tile infrastructure
; "DoesntOccupyTile" = Even if this kind of enemy unit is on tile, cities can
; still work that tile
; "AttackNonNative" = Unit can attack units on non-native tiles. Unit type
doc/README.actions
"Pillage" - Pillage extra from tile
* UI name can be set using ui_name_pillage
* the actor unit has "CanPillage" unit class flag
* terrain type must be one where pillaging is possible
"Road" - Build road at the target tile.
server/rscompat.c
const char *helptxt;
} new_class_flags_31[] = {
{ N_("Missile"), N_("Unit is destroyed when it attacks") },
{ N_("CanPillage"), N_("Can pillage tile improvements.") },
};
int first_free;
......
enabler = action_enabler_new();
enabler->action = ACTION_PILLAGE;
e_req = req_from_values(VUT_UCFLAG, REQ_RANGE_LOCAL, FALSE, TRUE, FALSE,
UCF_CAN_PILLAGE);
e_req = req_from_str("UnitClassFlag", "Local", FALSE, TRUE, FALSE,
"CanPillage");
requirement_vector_append(&enabler->actor_reqs, e_req);
action_enabler_add(enabler);
    (1-1/1)