Originally Posted by
kostic
Interesting note. I almost never destroy a city after conquering it, but it seems to me that damage to buildings should be logical in the event of extermination and even in the event of looting, although in the latter case the same damage should be mitigated.
In the future for certain cities there'll be some probability of certain core buildings damaged. We may diffenciate depending on many factors, to be seen where we land.
Code:
;------------------------------------------------------------------------------ WROCLAW
declare_counter current_name_Wroclaw ; 0 - Wroclaw, 1 - Breslau, 2 - Vuartizlau
set_counter current_name_Wroclaw 0
monitor_event GeneralCaptureSettlement SettlementName Wroclaw
if I_EventCounter faction_turn_poland = 1 ; Poland: Wroclaw
change_settlement_name Wroclaw Wroclaw
if I_EventCounter is_the_player = 1
and I_CompareCounter current_name_Wroclaw > 0
historic_event CONQUERED_WROCLAW_PL factions { poland, hre, denmark, hungary, lithuania, kievan_rus, russia, }
end_if
set_counter current_name_Wroclaw 0
end_if
if I_EventCounter faction_turn_orthodox = 1 ; Orthodox: Wroclaw
change_settlement_name Wroclaw Wroclaw
if I_EventCounter is_the_player = 1
and I_CompareCounter current_name_Wroclaw > 0
historic_event CONQUERED_WROCLAW factions { poland, hre, denmark, hungary, lithuania, kievan_rus, russia, }
end_if
set_counter current_name_Wroclaw 0
end_if
if I_EventCounter faction_turn_catholic = 1 ; Catholic factions but Poland: Breslau
and not I_EventCounter faction_turn_poland = 1
change_settlement_name Wroclaw WroclawGerman
if I_EventCounter is_the_player = 1
and I_CompareCounter current_name_Wroclaw < 1
historic_event CONQUERED_WROCLAW factions { poland, hre, denmark, hungary, lithuania, kievan_rus, russia, }
end_if
if I_EventCounter is_the_player = 1
and I_CompareCounter current_name_Wroclaw > 1
historic_event CONQUERED_WROCLAW factions { poland, hre, denmark, hungary, lithuania, kievan_rus, russia, }
end_if
set_counter current_name_Wroclaw 1
end_if
if I_EventCounter faction_turn_pagan = 1 ; Pagan: Vuartizlau
change_settlement_name Wroclaw WroclawPagan
if I_EventCounter is_the_player = 1
and I_CompareCounter current_name_Wroclaw < 2
historic_event SETTLEMENT_NAME_CHANGE
end_if
set_counter current_name_Wroclaw 2
end_if
if I_EventCounter is_the_player = 1 ; additional 10% turmoil for H/VH difficulties
and I_EventCounter DifficultyLevel > 2
and RandomPercent < 66
add_settlement_turmoil Wroclaw 2
end_if
if I_EventCounter is_the_player = 1 ; building destroyed for VH difficulty
and I_EventCounter DifficultyLevel > 3
and RandomPercent < 66
console_command set_building_health Wroclaw hinterland_roads 60
end_if
end_monitor
Coward - here you've got the relevant part of the code.
Code:
;--------------------------------------------------------- Coward from Battles
;------------------------------------------ very unlikely on autoresolve
Trigger BattleCoward_No_Killed_Enemies
WhenToTest PostBattle
Condition IsGeneral
and BattleOdds < 3.0
and GeneralNumKillsInBattle < 2
Affects Coward 1 Chance 33
;------------------------------------------
Trigger BattleCoward_Only_Weak_Enemies
WhenToTest PostBattle
Condition IsGeneral
and BattleOdds < 2.0
and PercentageBodyguardKilled < 10
Affects Coward 1 Chance 33
;------------------------------------------
Trigger BattleCoward_No_Real_Fight
WhenToTest PostBattle
Condition IsGeneral
and BattleOdds < 1.0
and PercentageBodyguardKilled < 20
Affects Coward 1 Chance 33
;------------------------------------------
Trigger BattleCoward_Loss_Without_Fight
WhenToTest PostBattle
Condition IsGeneral
and BattleOdds <= 3
and not WonBattle
and PercentageEnemyKilled < 30
and PercentageBodyguardKilled < 50
Affects Coward 1 Chance 33
;------------------------------------------
Trigger BattleCoward_Routed
WhenToTest BattleGeneralRouted
Affects Coward 1 Chance 70
Affects Coward 1 Chance 20
;------------------------------------------
Trigger Coward_Withdraws
WhenToTest PreBattleWithdrawal
Condition WasAttacker
Affects Coward 1 Chance 20
;------------------------------------------
Trigger Coward_Withdraw_Before_Battle_Even_Odds
WhenToTest PreBattleWithdrawal
Condition IsGeneral
and I_WithdrawsBeforeBattle
and BattleOdds > 0.7
and BattleOdds < 1.75
Affects Coward 1 Chance 50
;--------------------------------------------------------- Brave and Coward - other reasons
;------------------------------------------
Trigger Coward_In_City
WhenToTest CharacterTurnEnd
Condition IsGeneral
and EndedInSettlement
and RemainingMPPercentage > 95
and SettlementBuildingExists > wooden_wall
and RandomPercent > 50
Affects Coward 1 Chance 2
;------------------------------------------
Trigger Brave_Selfperpetuating_OldAge
WhenToTest CharacterTurnEnd
Condition Trait Brave > 2
and Trait Senile > 0
and Trait Haemophobic < 1
Affects Brave 1 Chance 10
;------------------------------------------
Trigger Coward_Selfperpetuating
WhenToTest CharacterTurnEnd
Condition Trait Coward > 0
and Trait Wantschool < 1
Affects Coward 1 Chance 2
;------------------------------------------
Trigger Coward_NoGoingBack
WhenToTest CharacterTurnEnd
Condition IsGeneral
and Trait Coward < 5
and Trait Coward > 3
Affects Coward 10 Chance 100
;--- AI doesnt know how to deal with this trait -----
Trigger AI_Coward_Normalization
WhenToTest CharacterTurnEnd
Condition not FactionIsLocal
and Trait Coward > 0
Affects Coward -1 Chance 10
Affects Coward 1 Chance 3
;------------------------------------------
Trigger AI_Brave_Normalization
WhenToTest CharacterTurnEnd
Condition not FactionIsLocal
and Trait Brave > 0
Affects Brave 1 Chance 10
Affects Brave -1 Chance 5