Total War: WARHAMMER III

Total War: WARHAMMER III

+20% Casualties in Autoresolve (no AI impact)
Porkenstein  [developer] 8 May, 2024 @ 4:17pm
Source Code
-- setup listeners on game load/start local function post_first_tick_callback() -- apply debuff core:add_listener( "porkenstein_ar_missile_nerf_PendingBattle", "PendingBattle", function(context) local pb = context:pending_battle(); return (pb:has_attacker() and pb:attacker():faction():is_human()) or (pb:has_defender() and pb:defender():faction():is_human()); end, function(context) local pb = context:pending_battle(); if pb:has_attacker() and pb:attacker():faction():is_human() then cm:modify_next_autoresolve_battle(1, 1, 1.2, 1.0, false); elseif pb:has_defender() and pb:defender():faction():is_human() and not pb:siege_battle() then -- don't apply nerf to siege defence cm:modify_next_autoresolve_battle(1, 1, 1.0, 1.2, false); end; end, true ); -- remove debuff when battle is done for any reason, including retreating core:add_listener( "porkenstein_ar_missile_nerf_BattleCompleted", "BattleCompleted", function() return cm:pending_battle_cache_human_is_involved(); end, function() -- reset to default values cm:modify_next_autoresolve_battle(1, 1, 1.0, 1.0, false); end, true ); end cm:add_post_first_tick_callback(post_first_tick_callback);
Last edited by Porkenstein; 8 May, 2024 @ 4:19pm