Skip to content

Commit

Permalink
add Eclipse's tweak tables to statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
SonicSoapyBoi authored Jul 28, 2024
1 parent 985ddb0 commit e320fc0
Show file tree
Hide file tree
Showing 4 changed files with 77 additions and 1 deletion.
1 change: 1 addition & 0 deletions lua/charactertweakdata.lua
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,7 @@ Hooks:PostHook(CharacterTweakData, "init", "eclipse_init", function(self)

self.city_swat.move_speed = self.presets.move_speed.fast
self.city_swat.no_arrest = true
self.city_swat.speech_prefix_p2 = "d" --cool radio filtered voices for GenSec SWATs
self.city_swat.suppression = { panic_chance_mul = 0.15, duration = { 1.5, 2 }, react_point = { 2, 5 }, brown_point = { 5, 6 } }

-- Specials
Expand Down
74 changes: 74 additions & 0 deletions lua/statisticsmanager.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
--add Eclipse's tweak tables to special unit ids
StatisticsManager.special_unit_ids = {
"shield",
"spooc",
"tank",
"tank_elite",
"tank_hw",
"taser",
"medic",
"sniper",
"phalanx_minion",
"phalanx_minion_break",
"phalanx_vip",
"heavy_swat_sniper",
"zeal_shield",
"zeal_medic",
"zeal_taser",
"swat_turret",
"biker_boss",
"chavez_boss",
"mobster_boss",
"hector_boss",
"hector_boss_no_armor",
"tank_medic",
"tank_mini",
"marshal_marksman",
"marshal_shield",
"triad_boss",
"triad_boss_no_armor",
"snowman_boss",
"deep_boss",
"piggydozer"
}

--use vanilla's stat tweak_tables while adding new ones
local old_stats = StatisticsManager.init
function StatisticsManager:init()
old_stats(self)
self._defaults.killed.tank_elite = {
count = 0,
head_shots = 0,
melee = 0,
explosion = 0,
tied = 0
}
self._defaults.killed.zeal_shield = {
count = 0,
head_shots = 0,
melee = 0,
explosion = 0,
tied = 0
}
self._defaults.killed.zeal_taser = {
count = 0,
head_shots = 0,
melee = 0,
explosion = 0,
tied = 0
}
self._defaults.killed.zeal_medic = {
count = 0,
head_shots = 0,
melee = 0,
explosion = 0,
tied = 0
}
self._defaults.killed.phalanx_minion_break = {
count = 0,
head_shots = 0,
melee = 0,
explosion = 0,
tied = 0
}
end
2 changes: 1 addition & 1 deletion req/mission_script_add/glace.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local difficulty = tweak_data:difficulty_to_index(Global.game_settings and Global.game_settings.difficulty or "normal")
local dozer = (difficulty == 6 and "units/pd2_dlc_drm/characters/ene_bulldozer_minigun_classic/ene_bulldozer_minigun_classic") or "units/payday2/characters/ene_bulldozer_1/ene_bulldozer_1"
local dozer_skull = "units/payday2/characters/ene_bulldozer_3/ene_bulldozer_3"
local shield = (difficulty == 6 and pro_job and "units/pd2_dlc_vip/characters/ene_phalanx_1/ene_phalanx_1") or "units/payday2/characters/ene_shield_1/ene_shield_1"
local shield = ((difficulty == 6 and pro_job) and "units/pd2_dlc_vip/characters/ene_phalanx_1/ene_phalanx_1") or "units/payday2/characters/ene_shield_1/ene_shield_1"
local taser = "units/payday2/characters/ene_tazer_1/ene_tazer_1"
local pro_job = Global.game_settings and Global.game_settings.one_down
local overkill_above = difficulty >= 5
Expand Down
1 change: 1 addition & 0 deletions supermod.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
<post :hook_id="hudmanager"/>
<post :hook_id="menumanager"/>
<post :hook_id="savefilemanager"/>
<post :hook_id="statisticsmanager"/>
<post :hook_id="achievmentmanager"/>
<post :hook_id="tangomanager"/>
<post :hook_id="sidejobeventmanager"/>
Expand Down

0 comments on commit e320fc0

Please sign in to comment.