Removed fall damage and fixed hero fury giving wrong kills

This commit is contained in:
Giov4 2022-11-04 22:28:08 +01:00
parent 01e683ff69
commit 9d73f6d208
5 changed files with 17 additions and 49 deletions

View File

@ -90,7 +90,7 @@ function append_slot_texture_and_change_pointer(arena, skill, pl_name, slots, i,
end
if arena.initial_time - arena.current_time > 5 then
if remaining_recharge_seconds > 0 and wielded_idx == 4 then
if remaining_recharge_seconds > 0 and wielded_idx == 4 and i == 4 then
arena_lib.HUD_send_msg("broadcast", pl_name, T("@1 kills left to use the ultimate", remaining_recharge_seconds), 0.1)
end
end

View File

@ -120,16 +120,6 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch,
local pl_name = hitter:get_player_name()
local wielded_item = hitter:get_wielded_item():get_name()
local perfect_combo = pl_name:get_skill("fbrawl:perfect_combo")
if
wielded_item == "fantasy_brawl:perfect_combo"
and perfect_combo
and not perfect_combo.is_active
then
perfect_combo:start(player)
end
if wielded_item == "fantasy_brawl:hero_fury" then
fbrawl.cast_ultimate(pl_name, "fbrawl:hero_fury", player:get_player_name())
end

View File

@ -55,7 +55,7 @@ skillz.register_skill("fbrawl:hero_fury", {
minetest.add_entity({x=0,y=0,z=0}, "fantasy_brawl:forward_punch", self.player:get_player_name())
hit_pl_name:unlock_skill("fbrawl:hit_by_hero_fury")
minetest.after(0.2, function() hit_pl_name:start_skill("fbrawl:hit_by_hero_fury") end)
minetest.after(0.2, function() hit_pl_name:start_skill("fbrawl:hit_by_hero_fury", self.player) end)
elseif self.data.hits == 3 then
hit(self.player, hit_player, {x=1, y=0, z=0})
@ -143,9 +143,10 @@ skillz.register_skill("fbrawl:hit_by_hero_fury", {
maxexptime = 1.5,
}}
},
cast = function(self, hit_player)
cast = function(self, hitter)
if fbrawl.is_on_the_ground(self.player) or self.player:get_hp() == 0 then
self:stop()
fbrawl.hit_player(hitter, self.player, skillz.get_skill_def("fbrawl:hero_fury").damage)
end
end,
on_stop = function(self)
@ -176,23 +177,22 @@ function forward_punch:on_activate(pl_name, dtime_s)
local hero_fury = pl_name:get_skill("fbrawl:hero_fury")
local hit_player = hero_fury.data.hit_player
local entity_duration = 0.32
local entity_speed = 9
local player = minetest.get_player_by_name(pl_name)
local obj = self.object
local player_center = vector.add(player:get_pos(), {x=0, y=1, z=0})
local look_dir = player:get_look_dir()
local hit_pl_hp = hit_player:get_hp()
local entity_duration = 0.32
local entity_speed = 9
obj:set_pos(player_center)
obj:set_velocity(vector.multiply(look_dir, entity_speed))
-- Preventing the skill from killing the player,
-- they have to die falling.
if hit_player:get_hp() > hero_fury.damage * 2 then
fbrawl.hit_player(hero_fury.player, hit_player, hero_fury.damage)
if hit_pl_hp > hero_fury.damage * 2 then
hit_player:set_hp(hit_pl_hp - hero_fury.damage * 2)
else
fbrawl.spawn_blood_particle(player, hero_fury.damage)
hit_player:set_hp(1)
@ -235,12 +235,10 @@ function hit(player, hit_player, offset, last)
end
local hitter_look_dir = player:get_look_dir()
local push_force = vector.multiply(hitter_look_dir, punch_force)
hit_player:add_velocity(push_force)
minetest.add_entity({x=0,y=0,z=0}, "fantasy_brawl:forward_punch", player:get_player_name())
hit_player:add_velocity(push_force)
end
@ -248,9 +246,12 @@ end
minetest.register_on_player_hpchange(function(player, hp_change, reason)
local pl_name = player:get_player_name()
local hero_fury = pl_name:get_skill("fbrawl:hero_fury")
local hit_by_hero_fury = pl_name:get_skill("fbrawl:hit_by_hero_fury")
if hero_fury and hero_fury.is_active then
return 0
elseif hit_by_hero_fury and hit_by_hero_fury.is_active and reason.object then
return 0
else
return hp_change
end

View File

@ -65,7 +65,6 @@ skillz.register_skill("fbrawl:smash", {
data = {
hit_players = {},
started = false,
fall_damage = false
},
loop_params = {
cast_rate = 0
@ -111,17 +110,12 @@ skillz.register_skill("fbrawl:smash", {
},
on_start = function(self)
self.data.hit_players = {}
self.data.fall_damage = false
self.data.started = false
end,
on_stop = function(self)
fbrawl.replace_slot_item(self.player, 2, "fantasy_brawl:warrior_jump")
minetest.after(self.slow_down_time, function()
if not self.is_active then
self.data.fall_damage = true
end
for i, player in ipairs(self.data.hit_players) do
local pl_speed = player:get_physics_override().speed
player:set_physics_override({speed = pl_speed + self.slow_down_factor})
@ -228,21 +222,3 @@ end
minetest.register_entity("fantasy_brawl:seismic_wave", seismic_wave)
minetest.register_on_player_hpchange(function(player, hp_change, reason)
local pl_name = player:get_player_name()
local smash = pl_name:get_skill("fbrawl:smash")
-- Smash
if
reason.type == "fall"
and smash
and not smash.data.fall_damage
then
return 0
end
return hp_change
end, true)

View File

@ -17,6 +17,7 @@ arena_lib.register_minigame("fantasy_brawl", {
kills = 0,
ultimate_recharge = 0,
},
disabled_damage_types = {"fall"},
hotbar = {slots = 4, background_image = "fbrawl_hotbar.png"},
load_time = fbrawl_settings.max_loading_time,
show_nametags = false,