diff --git a/lua/charactertweakdata.lua b/lua/charactertweakdata.lua
index d0b8caa8..a6d9988e 100644
--- a/lua/charactertweakdata.lua
+++ b/lua/charactertweakdata.lua
@@ -281,6 +281,51 @@ function CharacterTweakData:_presets(tweak_data, ...)
end
end
+ -- thanks sbz for removing this from vanilla for no reason :)
+ presets.hurt_severities.only_light_hurt_and_fire = {
+ tase = true,
+ bullet = {
+ health_reference = 1,
+ zones = {
+ {
+ light = 1,
+ },
+ },
+ },
+ explosion = {
+ health_reference = 1,
+ zones = {
+ {
+ explode = 1,
+ },
+ },
+ },
+ melee = {
+ health_reference = 1,
+ zones = {
+ {
+ light = 1,
+ },
+ },
+ },
+ fire = {
+ health_reference = 1,
+ zones = {
+ {
+ fire = 1,
+ },
+ },
+ },
+ poison = {
+ health_reference = 1,
+ zones = {
+ {
+ none = 1,
+ },
+ },
+ },
+ }
+
-- dozer damage reaction
presets.hurt_severities.dozer = {
tase = false,
@@ -624,7 +669,7 @@ Hooks:PostHook(CharacterTweakData, "init", "eclipse_init", function(self)
self.phalanx_minion_break.access = "swat"
self.phalanx_minion_break.chatter = self.presets.enemy_chatter.swat
self.phalanx_minion_break.announce_incomming = nil
- self.phalanx_minion_break.damage.hurt_severity = self.presets.hurt_severities.light_hurt_fire_poison
+ self.phalanx_minion_break.damage.hurt_severity = self.presets.hurt_severities.base
self.phalanx_minion_break.damage.explosion_damage_mul = 1
self.phalanx_minion_break.use_animation_on_fire_damage = nil
self.phalanx_minion_break.damage.shield_knocked = nil
diff --git a/lua/dottweakdata.lua b/lua/dottweakdata.lua
new file mode 100644
index 00000000..86af4736
--- /dev/null
+++ b/lua/dottweakdata.lua
@@ -0,0 +1,15 @@
+-- rework poison cloud DOT
+Hooks:PostHook(DOTTweakData, "init", "eclipse_init", function(self)
+ self.dot_entries.poison.proj_gas_grenade_cloud.hurt_animation_chance = 1
+ self.dot_entries.poison.proj_gas_grenade_cloud.dot_damage = 8
+ self.dot_entries.poison.proj_gas_grenade_cloud.dot_tick_period = 2
+ self.dot_entries.poison.proj_gas_grenade_cloud.dot_length = 10
+ self.dot_entries.poison.proj_launcher_cloud.hurt_animation_chance = 0.3
+ self.dot_entries.poison.proj_launcher_cloud.dot_damage = 4
+ self.dot_entries.poison.proj_launcher_cloud.dot_tick_period = 2
+ self.dot_entries.poison.proj_launcher_cloud.dot_length = 10
+ self.dot_entries.poison.proj_launcher_arbiter_cloud.hurt_animation_chance = 0.3
+ self.dot_entries.poison.proj_launcher_arbiter_cloud.dot_damage = 4
+ self.dot_entries.poison.proj_launcher_arbiter_cloud.dot_tick_period = 2
+ self.dot_entries.poison.proj_launcher_arbiter_cloud.dot_length = 10
+end)
diff --git a/lua/drill.lua b/lua/drill.lua
deleted file mode 100644
index 95fba5dc..00000000
--- a/lua/drill.lua
+++ /dev/null
@@ -1,32 +0,0 @@
--- Make autorepair reroll everytime the drill is jammed and fix swapped values
-Hooks:PreHook(Drill, "set_jammed", "shc_set_jammed", function(self, jammed)
- if Network:is_server() and jammed and not self._jammed then
- local current_auto_repair_level_1 = self._skill_upgrades.auto_repair_level_1 or 0
- local current_auto_repair_level_2 = self._skill_upgrades.auto_repair_level_2 or 0
- local drill_autorepair_chance = 0
-
- if current_auto_repair_level_1 > 0 then
- drill_autorepair_chance = drill_autorepair_chance + tweak_data.upgrades.values.player.drill_autorepair_1[1]
- end
- if current_auto_repair_level_2 > 0 then
- drill_autorepair_chance = drill_autorepair_chance + tweak_data.upgrades.values.player.drill_autorepair_2[1]
- end
-
- self:set_autorepair(math.random() < drill_autorepair_chance, true)
- end
-end)
-
--- Reduce time it takes for autorepair to kick in
-function Drill:set_autorepair(state, jammed)
- self._autorepair = state
-
- if self._autorepair_clbk_id then
- managers.enemy:remove_delayed_clbk(self._autorepair_clbk_id)
- self._autorepair_clbk_id = nil
- end
-
- if state and (self._jammed or jammed) then
- self._autorepair_clbk_id = "Drill_autorepair" .. tostring(self._unit:key())
- managers.enemy:add_delayed_clbk(self._autorepair_clbk_id, callback(self, self, "clbk_autorepair"), TimerManager:game():time() + 5 + 5 * math.random())
- end
-end
diff --git a/lua/firetweakdata.lua b/lua/firetweakdata.lua
new file mode 100644
index 00000000..3be78057
--- /dev/null
+++ b/lua/firetweakdata.lua
@@ -0,0 +1,25 @@
+Hooks:PostHook(FireTweakData, "_init_dot_entries_fire", "eclipse__init_dot_entries_fire", function(self, fire_entries)
+ -- incendiary
+ fire_entries.proj_fire_com.dot_damage = 30
+ fire_entries.proj_fire_com.dot_length = 5
+
+ -- flamer dot (might just rework later)
+ fire_entries.weapon_flamethrower_mk2 = {
+ dot_trigger_chance = 50,
+ dot_damage = 7.5,
+ dot_length = 1.1,
+ dot_tick_period = 0.5,
+ dot_trigger_max_distance = false,
+ }
+ fire_entries.ammo_flamethrower_mk2_rare = deep_clone(fire_entries.weapon_flamethrower_mk2)
+ fire_entries.ammo_flamethrower_mk2_welldone = deep_clone(fire_entries.weapon_flamethrower_mk2)
+
+ -- db dot (might rework too)
+ fire_entries.ammo_dragons_breath = {
+ dot_trigger_chance = 1,
+ dot_damage = 3,
+ dot_length = 4,
+ dot_trigger_max_distance = 1500,
+ dot_tick_period = 0.25,
+ }
+end)
diff --git a/lua/playerstandard.lua b/lua/playerstandard.lua
index 67078a58..4a4d2a75 100644
--- a/lua/playerstandard.lua
+++ b/lua/playerstandard.lua
@@ -240,8 +240,6 @@ function PlayerStandard:_check_action_primary_attack(t, input, params)
end
-- End modification
- self._camera_unit:base():recoil_kick(up * recoil_multiplier, down * recoil_multiplier, left * recoil_multiplier, right * recoil_multiplier)
-
if self._shooting_t then
local time_shooting = t - self._shooting_t
local achievement_data = tweak_data.achievement.never_let_you_go
diff --git a/lua/raycastweaponbase.lua b/lua/raycastweaponbase.lua
index 7ede047b..280eb19b 100644
--- a/lua/raycastweaponbase.lua
+++ b/lua/raycastweaponbase.lua
@@ -29,6 +29,11 @@ local mvec_to = Vector3()
local mvec_right_ax = Vector3()
local mvec_up_ay = Vector3()
local mvec_spread_direction = Vector3()
+local mvec3_norm = mvector3.normalize
+local mvec3_set = mvector3.set
+local mvec3_mul = mvector3.multiply
+local mvec3_add = mvector3.add
+local math_clamp = math.clamp
-- lower damage on shield pen
function RaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul, shoot_player, spread_mul, autohit_mul, suppr_mul)
@@ -43,54 +48,56 @@ function RaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul
spread_mul = spread_mul or 1
mvector3.cross(mvec_right_ax, direction, math.UP)
- mvector3.normalize(mvec_right_ax)
+ mvec3_norm(mvec_right_ax)
mvector3.cross(mvec_up_ay, direction, mvec_right_ax)
- mvector3.normalize(mvec_up_ay)
- mvector3.set(mvec_spread_direction, direction)
+ mvec3_norm(mvec_up_ay)
+ mvec3_set(mvec_spread_direction, direction)
local theta = math.random() * 360
- mvector3.multiply(mvec_right_ax, math.rad(math.sin(theta) * math.random() * spread_x * spread_mul))
- mvector3.multiply(mvec_up_ay, math.rad(math.cos(theta) * math.random() * spread_y * spread_mul))
- mvector3.add(mvec_spread_direction, mvec_right_ax)
- mvector3.add(mvec_spread_direction, mvec_up_ay)
- mvector3.set(mvec_to, mvec_spread_direction)
- mvector3.multiply(mvec_to, ray_distance)
- mvector3.add(mvec_to, from_pos)
+ mvec3_mul(mvec_right_ax, math.rad(math.sin(theta) * math.random() * spread_x * spread_mul))
+ mvec3_mul(mvec_up_ay, math.rad(math.cos(theta) * math.random() * spread_y * spread_mul))
+ mvec3_add(mvec_spread_direction, mvec_right_ax)
+ mvec3_add(mvec_spread_direction, mvec_up_ay)
+ mvec3_set(mvec_to, mvec_spread_direction)
+ mvec3_mul(mvec_to, ray_distance)
+ mvec3_add(mvec_to, from_pos)
- local ray_hits, hit_enemy = self:_collect_hits(from_pos, mvec_to)
- local auto_hit_candidate, suppression_enemies = self:check_autoaim(from_pos, direction)
+ local ray_hits, hit_enemy, enemies_hit = self:_collect_hits(from_pos, mvec_to)
- if suppression_enemies and self._suppression then
- result.enemies_in_cone = suppression_enemies
- end
-
- if self._autoaim then
+ if self._autoaim and self._autohit_data then
local weight = 0.1
- if auto_hit_candidate and not hit_enemy then
- local autohit_chance = 1 - math.clamp((self._autohit_current - self._autohit_data.MIN_RATIO) / (self._autohit_data.MAX_RATIO - self._autohit_data.MIN_RATIO), 0, 1)
+ if hit_enemy then
+ self._autohit_current = (self._autohit_current + weight) / (1 + weight)
+ else
+ local auto_hit_candidate, enemies_to_suppress = self:check_autoaim(from_pos, direction, nil, nil, nil, true)
+ result.enemies_in_cone = enemies_to_suppress or false
- if autohit_mul then
- autohit_chance = autohit_chance * autohit_mul
- end
+ if auto_hit_candidate then
+ local autohit_chance = self:get_current_autohit_chance_for_roll()
- if math.random() < autohit_chance then
- self._autohit_current = (self._autohit_current + weight) / (1 + weight)
+ if autohit_mul then
+ autohit_chance = autohit_chance * autohit_mul
+ end
+
+ if math.random() < autohit_chance then
+ self._autohit_current = (self._autohit_current + weight) / (1 + weight)
- mvector3.set(mvec_spread_direction, auto_hit_candidate.ray)
- mvector3.set(mvec_to, mvec_spread_direction)
- mvector3.multiply(mvec_to, ray_distance)
- mvector3.add(mvec_to, from_pos)
+ mvec3_set(mvec_spread_direction, auto_hit_candidate.ray)
+ mvec3_set(mvec_to, mvec_spread_direction)
+ mvec3_mul(mvec_to, ray_distance)
+ mvec3_add(mvec_to, from_pos)
- ray_hits, hit_enemy = self:_collect_hits(from_pos, mvec_to)
+ ray_hits, hit_enemy, enemies_hit = self:_collect_hits(from_pos, mvec_to)
+ end
end
- end
- if hit_enemy then
- self._autohit_current = (self._autohit_current + weight) / (1 + weight)
- elseif auto_hit_candidate then
- self._autohit_current = self._autohit_current / (1 + weight)
+ if hit_enemy then
+ self._autohit_current = (self._autohit_current + weight) / (1 + weight)
+ elseif auto_hit_candidate then
+ self._autohit_current = self._autohit_current / (1 + weight)
+ end
end
end
@@ -115,7 +122,9 @@ function RaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul
end
if dmg > 0 then
- local hit_result = self._bullet_class:on_collision(hit, self._unit, user_unit, dmg)
+ local hit_result = self:bullet_class():on_collision(hit, self._unit, user_unit, dmg)
+ hit_through_wall = hit_through_wall or hit.unit:in_slot(self.wall_mask)
+ hit_through_shield = hit_through_shield or hit.unit:in_slot(self.shield_mask) and alive(hit.unit:parent())
if hit_result then
hit.damage_result = hit_result
@@ -123,17 +132,15 @@ function RaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul
hit_count = hit_count + 1
if hit_result.type == "death" then
- local unit_type = hit.unit:base() and hit.unit:base()._tweak_table
+ local unit_base = hit.unit:base()
+ local unit_type = unit_base and unit_base._tweak_table
local is_civilian = unit_type and is_civ_f(unit_type)
if not is_civilian then
cop_kill_count = cop_kill_count + 1
end
- hit_through_wall = hit_through_wall or hit.unit:in_slot(self.wall_mask)
- hit_through_shield = hit_through_shield or hit.unit:in_slot(self.shield_mask) and alive(hit.unit:parent())
-
- self:_check_kill_achievements(cop_kill_count, unit_type, is_civilian, hit_through_wall, hit_through_shield)
+ self:_check_kill_achievements(cop_kill_count, unit_base, unit_type, is_civilian, hit_through_wall, hit_through_shield)
end
end
end
@@ -147,7 +154,7 @@ function RaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul
self._shot_fired_stats_table.hit = hit_anyone
self._shot_fired_stats_table.hit_count = hit_count
- if (not self._ammo_data or not self._ammo_data.ignore_statistic) and not self._rays then
+ if not self._ammo_data or not self._ammo_data.ignore_statistic then
managers.statistics:shot_fired(self._shot_fired_stats_table)
end
end
@@ -156,12 +163,28 @@ function RaycastWeaponBase:_fire_raycast(user_unit, from_pos, direction, dmg_mul
if (not furthest_hit or furthest_hit.distance > 600) and alive(self._obj_fire) then
self._obj_fire:m_position(self._trail_effect_table.position)
- mvector3.set(self._trail_effect_table.normal, mvec_spread_direction)
+ mvec3_set(self._trail_effect_table.normal, mvec_spread_direction)
local trail = World:effect_manager():spawn(self._trail_effect_table)
if furthest_hit then
- World:effect_manager():set_remaining_lifetime(trail, math.clamp((furthest_hit.distance - 600) / 10000, 0, furthest_hit.distance))
+ World:effect_manager():set_remaining_lifetime(trail, math_clamp((furthest_hit.distance - 600) / 10000, 0, furthest_hit.distance))
+ end
+ end
+
+ if result.enemies_in_cone == nil then
+ result.enemies_in_cone = self._suppression and self:check_suppression(from_pos, direction, enemies_hit) or nil
+ elseif enemies_hit and self._suppression then
+ result.enemies_in_cone = result.enemies_in_cone or {}
+ local all_enemies = managers.enemy:all_enemies()
+
+ for u_key, enemy in pairs(enemies_hit) do
+ if all_enemies[u_key] then
+ result.enemies_in_cone[u_key] = {
+ error_mul = 1,
+ unit = enemy,
+ }
+ end
end
end
@@ -191,7 +214,9 @@ function RaycastWeaponBase.collect_hits(from, to, setup_data)
hit_enemy = hit.unit:in_slot(enemy_mask)
end
- return ray_hits, hit_enemy
+ return ray_hits, hit_enemy, hit_enemy and {
+ [hit.unit:key()] = hit.unit,
+ } or nil
end
local can_shoot_through_wall = setup_data.can_shoot_through_wall
@@ -208,31 +233,41 @@ function RaycastWeaponBase.collect_hits(from, to, setup_data)
ray_hits = World:raycast_all("ray", from, to, "slot_mask", bullet_slotmask, "ignore_unit", ignore_unit)
end
- local units_hit = {}
local unique_hits = {}
+ local enemies_hit = {}
+ local unit, u_key, is_enemy = nil
+ local units_hit = {}
+ local in_slot_func = Unit.in_slot
+ local has_ray_type_func = Body.has_ray_type
for i, hit in ipairs(ray_hits) do
- if not units_hit[hit.unit:key()] then
- units_hit[hit.unit:key()] = true
+ unit = hit.unit
+ u_key = unit:key()
+
+ if not units_hit[u_key] then
+ units_hit[u_key] = true
unique_hits[#unique_hits + 1] = hit
hit.hit_position = hit.position
- hit_enemy = hit_enemy or hit.unit:in_slot(enemy_mask)
- local weak_body = hit.body:has_ray_type(ai_vision_ids)
- weak_body = weak_body or hit.body:has_ray_type(bulletproof_ids)
+ is_enemy = in_slot_func(unit, enemy_mask)
+
+ if is_enemy then
+ enemies_hit[u_key] = unit
+ hit_enemy = true
+ end
- if not can_shoot_through_enemy and hit_enemy then
+ if not can_shoot_through_enemy and is_enemy then
break
- elseif not can_shoot_through_wall and hit.unit:in_slot(wall_mask) and weak_body then
+ elseif not can_shoot_through_shield and in_slot_func(unit, shield_mask) then
break
- elseif not can_shoot_through_shield and hit.unit:in_slot(shield_mask) then
+ elseif not can_shoot_through_wall and in_slot_func(unit, wall_mask) and (has_ray_type_func(hit.body, ai_vision_ids) or has_ray_type_func(hit.body, bulletproof_ids)) then
break
- elseif hit.unit:in_slot(shield_mask) and (hit.unit:name():key() == "af254947f0288a6c" or hit.unit:name():key() == "15cbabccf0841ff8") and not can_shoot_through_titan_shield then -- hi thanks resmod if you're reading this :)
+ elseif hit.unit:in_slot(shield_mask) and (hit.unit:name():key() == "af254947f0288a6c" or hit.unit:name():key() == "15cbabccf0841ff8") then -- hi thanks resmod if you're reading this :)
break
end
end
end
- return unique_hits, hit_enemy
+ return unique_hits, hit_enemy, hit_enemy and enemies_hit or nil
end
-- Auto Fire Sound Fix
diff --git a/lua/tweakdata.lua b/lua/tweakdata.lua
index 22bffc9e..a47b1a7a 100644
--- a/lua/tweakdata.lua
+++ b/lua/tweakdata.lua
@@ -93,9 +93,9 @@ tweak_data.projectiles.underbarrel_electric_groza.damage = 10
tweak_data.projectiles.launcher_electric_ms3gl.damage = 10
-- incendiary buff
--- tweak_data.projectiles.fir_com.damage = 10
-tweak_data.projectiles.fir_com.fire_dot_data.dot_damage = 30
+tweak_data.projectiles.fir_com.damage = 10
tweak_data.projectiles.fir_com.range = 800
+
-- frags buff
tweak_data.projectiles.frag.damage = 200
tweak_data.projectiles.frag_com.damage = 200
@@ -103,17 +103,12 @@ tweak_data.projectiles.dada_com.damage = 200
tweak_data.projectiles.dynamite.damage = 200
-- poison nerf
--- tweak_data.projectiles.poison_gas_grenade.poison_gas_dot_data.hurt_animation_chance = 1
--- tweak_data.projectiles.poison_gas_grenade.poison_gas_dot_data.dot_damage = 8
--- tweak_data.projectiles.poison_gas_grenade.poison_gas_dot_data.dot_tick_period = 2
--- tweak_data.projectiles.poison_gas_grenade.poison_gas_dot_data.dot_length = 10
tweak_data.projectiles.poison_gas_grenade.poison_gas_range = 400
tweak_data.projectiles.poison_gas_grenade.poison_gas_duration = 10
tweak_data.projectiles.launcher_poison.damage = 9
tweak_data.projectiles.launcher_poison.poison_gas_range = 300
tweak_data.projectiles.launcher_poison.poison_gas_duration = 10
-tweak_data.projectiles.launcher_poison.poison_gas_dot_data = { hurt_animation_chance = 0.3, dot_damage = 4, dot_length = 10, dot_tick_period = 2 }
tweak_data.projectiles.launcher_poison_gre_m79 = deep_clone(tweak_data.projectiles.launcher_poison)
tweak_data.projectiles.launcher_poison_gre_m79.damage = 9
tweak_data.projectiles.launcher_poison_gre_m79.poison_gas_range = 300
diff --git a/lua/weaponfactorytweakdata.lua b/lua/weaponfactorytweakdata.lua
index 9697de90..927f8d6b 100644
--- a/lua/weaponfactorytweakdata.lua
+++ b/lua/weaponfactorytweakdata.lua
@@ -25,7 +25,6 @@ Hooks:PostHook(WeaponFactoryTweakData, "init", "eclipse__init", function(self)
self.parts.wpn_fps_upg_a_dragons_breath.stats.total_ammo_mod = -8
self.parts.wpn_fps_upg_a_dragons_breath.custom_stats.ammo_pickup_max_mul = 0.85
self.parts.wpn_fps_upg_a_dragons_breath.custom_stats.ammo_pickup_min_mul = 0.85
- self.parts.wpn_fps_upg_a_dragons_breath.custom_stats.fire_dot_data = { dot_trigger_chance = "100", dot_damage = "3", dot_length = "4", dot_trigger_max_distance = "1500", dot_tick_period = "0.25" }
-- Shell Rack for loco and r880
self.parts.wpn_fps_shot_r870_body_rack.stats.reload = 2
self.parts.wpn_fps_shot_r870_body_rack.stats.total_ammo_mod = 0
diff --git a/lua/weapontweakdata.lua b/lua/weapontweakdata.lua
index f67e8a80..de25af56 100644
--- a/lua/weapontweakdata.lua
+++ b/lua/weapontweakdata.lua
@@ -1658,13 +1658,6 @@ self.x_judge.damage_falloff = FALLOFF_TEMPLATE.SHOTGUN_FALL_HIGH
-- mk2
self.flamethrower_mk2.stats.damage = 25
-self.flamethrower_mk2.fire_dot_data = {
- dot_trigger_chance = 50,
- dot_damage = 7.5,
- dot_length = 1.1,
- dot_trigger_max_distance = 3000,
- dot_tick_period = 0.5
-}
self.flamethrower_mk2.AMMO_PICKUP = {2.65, 3.5}
diff --git a/meta.json b/meta.json
index 45e3c12f..b67338ed 100644
--- a/meta.json
+++ b/meta.json
@@ -1,7 +1,7 @@
[
{
"ident": "eclipse_difficulty",
- "version": "5.4.2",
+ "version": "5.4.3",
"patchnotes_url": "https://github.com/mrcreepysos/Eclipse-Difficulty/commits/main",
"download_url": "https://github.com/mrcreepysos/Eclipse-Difficulty/archive/refs/heads/main.zip"
}
diff --git a/mod.txt b/mod.txt
index 382611ce..332d87af 100644
--- a/mod.txt
+++ b/mod.txt
@@ -5,7 +5,7 @@
"contact" : "nikita_was_taken on Discord",
"image" : "mod.png",
"blt_version" : 2,
- "version" : "5.4.2",
+ "version" : "5.4.3",
"updates" : [{
"identifier" : "eclipse_difficulty",
"host" : { "meta" : "https://raw.githubusercontent.com/mrcreepysos/Eclipse-Difficulty/main/meta.json" }
diff --git a/supermod.xml b/supermod.xml
index c5e70572..5f0c6add 100644
--- a/supermod.xml
+++ b/supermod.xml
@@ -74,6 +74,8 @@
+
+
@@ -198,7 +200,6 @@
-