Project

General

Profile

Feature #168 ยป 0050-Add-building-flag-Indestructible.patch

Marko Lindqvist, 01/10/2024 10:17 PM

View differences:

common/fc_types.h
/* Never destroyed by disasters */
#define SPECENUM_VALUE3 IF_DISASTER_PROOF
#define SPECENUM_VALUE3NAME "DisasterProof"
#define SPECENUM_VALUE4 IF_USER_FLAG_1
#define SPECENUM_VALUE5 IF_USER_FLAG_2
#define SPECENUM_VALUE6 IF_USER_FLAG_3
#define SPECENUM_VALUE7 IF_USER_FLAG_4
#define SPECENUM_VALUE8 IF_USER_FLAG_5
#define SPECENUM_VALUE9 IF_USER_FLAG_6
#define SPECENUM_VALUE10 IF_USER_FLAG_7
#define SPECENUM_VALUE11 IF_USER_FLAG_8
/* Never destroyed by a surgical strike */
#define SPECENUM_VALUE4 IF_INDESTRUCTIBLE
#define SPECENUM_VALUE4NAME "Indestructible"
#define SPECENUM_VALUE5 IF_USER_FLAG_1
#define SPECENUM_VALUE6 IF_USER_FLAG_2
#define SPECENUM_VALUE7 IF_USER_FLAG_3
#define SPECENUM_VALUE8 IF_USER_FLAG_4
#define SPECENUM_VALUE9 IF_USER_FLAG_5
#define SPECENUM_VALUE10 IF_USER_FLAG_6
#define SPECENUM_VALUE11 IF_USER_FLAG_7
#define SPECENUM_VALUE12 IF_USER_FLAG_8
#define SPECENUM_COUNT IF_COUNT
#define SPECENUM_NAMEOVERRIDE
#define SPECENUM_BITVECTOR bv_impr_flags
data/alien/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/civ1/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/civ2/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/civ2civ3/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/classic/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/goldkeep/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/granularity/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/multiplayer/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/ruledit/comments-3.3.txt
; \"DisasterProof\" = Disasters never destroy this building. Is meaningful\n\
; only for genus \"Improvement\" buildings as others are\n\
; automatically disaster proof.\n\
; \"Indestructible\" = Surgical strike can never destroy this building.\n\
;\n\
; */ <-- avoid gettext warnings\n\
"
data/sandbox/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/stub/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
data/webperimental/buildings.ruleset
; "DisasterProof" = Disasters never destroy this building. Is meaningful
; only for genus "Improvement" buildings as others are
; automatically disaster proof.
; "Indestructible" = Surgical strike can never destroy this building.
;
; */ <-- avoid gettext warnings
server/actiontools.c
paction);
/* Roll the dice. */
return fc_rand (100) >= odds;
return fc_rand(100) >= odds;
}
server/diplomats.c
plrcity = map_get_player_city(city_tile(pcity), unit_owner(pdiplomat));
if (!plrcity) {
if (plrcity == nullptr) {
/* Must know city to remember visible buildings. */
return;
}
improvement_iterate(ptarget) {
if (BV_ISSET(plrcity->improvements, improvement_index(ptarget))) {
if (BV_ISSET(plrcity->improvements, improvement_index(ptarget))
&& !improvement_has_flag(ptarget, IF_INDESTRUCTIBLE)) {
BV_SET(packet.improvements, improvement_index(ptarget));
}
} improvement_iterate_end;
server/unithand.c
return FALSE;
}
if (improvement_has_flag(tgt_bld, IF_INDESTRUCTIBLE)) {
/* Notify the player. */
notify_player(act_player, tgt_tile,
E_UNIT_ACTION_ACTOR_FAILURE, ftc_server,
_("Your %s cannot do %s to %s in %s."),
unit_link(act_unit),
action_name_translation(paction),
improvement_name_translation(tgt_bld),
city_link(tgt_city));
/* Punish the player for blindly attacking a building. */
act_unit->moves_left = MAX(0, act_unit->moves_left - SINGLE_MOVE);
return FALSE;
}
act_utype = unit_type_get(act_unit);
/* Destroy the building. */
    (1-1/1)