收获日2吧 关注:123,617贴子:1,819,150
  • 4回复贴,共1

模组伤害类型修改求助

只看楼主收藏回复

garand thumb模组
33%概率触发以下代码,想把触发的伤害改成直接作用于血量不影响护甲的类型,不知道应该用那种伤害类型(伤害计算是最后7行)
if self[_forced_stop] and type(self[_forced_stop_dt]) == "number" and self[_forced_stop_dt] < t then
local current_state_name = self._camera_unit:anim_state_machine():segment_state(self:get_animation("base"))
local segment_real_time = self._unit:anim_state_machine():segment_real_time(Idstring("base"))
if type(self._state_data.reload_expire_t) == "number" and type(self._state_data[reload_expire_t_req]) == "number" then
local t_rate = math.abs(t - self._state_data.reload_expire_t) / self._state_data[reload_expire_t_req]
if t_rate >= 0.15 and t_rate <= 0.16 then
self[__reload_anim_recover] = self._state_data.reload_expire_t + 1.5
if not self[not_working] then
self._camera_unit:anim_state_machine():set_speed(current_state_name, 0)
self._equipped_unit:base():tweak_data_anim_stop("reload_enter")
self._equipped_unit:base():tweak_data_anim_stop("reload")
self._equipped_unit:base():tweak_data_anim_stop("reload_not_empty")
self._equipped_unit:base():tweak_data_anim_stop("reload_exit")
self._ext_camera:play_shaker("player_taser_shock", 5, 3)
self._ext_damage:damage_simple({
variant = "delayed_tick",
damage = self._ext_damage:get_real_armor()
})
self._ext_damage:damage_simple({
variant = "delayed_tick",
damage = self._ext_damage:get_real_health() * 0.1 + 1

Garand Thumb - PAYDAY 2 Mods - ModWorkshop原地址


IP属地:浙江1楼2024-06-14 09:03回复
    没人?丢张全代码(hook)省略若干end


    IP属地:浙江2楼2024-06-14 09:23
    收起回复
      直接用
      managers.player:player_unit():character_damage():change_health(-血量)
      效果一样


      IP属地:江苏4楼2024-06-14 10:30
      收起回复