Removed fall damage and fixed hero fury giving wrong kills
This commit is contained in:
parent
01e683ff69
commit
9d73f6d208
@ -90,7 +90,7 @@ function append_slot_texture_and_change_pointer(arena, skill, pl_name, slots, i,
|
|||||||
end
|
end
|
||||||
|
|
||||||
if arena.initial_time - arena.current_time > 5 then
|
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)
|
arena_lib.HUD_send_msg("broadcast", pl_name, T("@1 kills left to use the ultimate", remaining_recharge_seconds), 0.1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -120,16 +120,6 @@ minetest.register_on_punchplayer(function(player, hitter, time_from_last_punch,
|
|||||||
local pl_name = hitter:get_player_name()
|
local pl_name = hitter:get_player_name()
|
||||||
local wielded_item = hitter:get_wielded_item():get_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
|
if wielded_item == "fantasy_brawl:hero_fury" then
|
||||||
fbrawl.cast_ultimate(pl_name, "fbrawl:hero_fury", player:get_player_name())
|
fbrawl.cast_ultimate(pl_name, "fbrawl:hero_fury", player:get_player_name())
|
||||||
end
|
end
|
||||||
|
@ -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())
|
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")
|
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
|
elseif self.data.hits == 3 then
|
||||||
hit(self.player, hit_player, {x=1, y=0, z=0})
|
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,
|
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
|
if fbrawl.is_on_the_ground(self.player) or self.player:get_hp() == 0 then
|
||||||
self:stop()
|
self:stop()
|
||||||
|
fbrawl.hit_player(hitter, self.player, skillz.get_skill_def("fbrawl:hero_fury").damage)
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_stop = function(self)
|
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 hero_fury = pl_name:get_skill("fbrawl:hero_fury")
|
||||||
local hit_player = hero_fury.data.hit_player
|
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 player = minetest.get_player_by_name(pl_name)
|
||||||
local obj = self.object
|
local obj = self.object
|
||||||
|
|
||||||
local player_center = vector.add(player:get_pos(), {x=0, y=1, z=0})
|
local player_center = vector.add(player:get_pos(), {x=0, y=1, z=0})
|
||||||
|
|
||||||
local look_dir = player:get_look_dir()
|
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_pos(player_center)
|
||||||
obj:set_velocity(vector.multiply(look_dir, entity_speed))
|
obj:set_velocity(vector.multiply(look_dir, entity_speed))
|
||||||
|
|
||||||
-- Preventing the skill from killing the player,
|
-- Preventing the skill from killing the player,
|
||||||
-- they have to die falling.
|
-- they have to die falling.
|
||||||
if hit_player:get_hp() > hero_fury.damage * 2 then
|
if hit_pl_hp > hero_fury.damage * 2 then
|
||||||
fbrawl.hit_player(hero_fury.player, hit_player, hero_fury.damage)
|
hit_player:set_hp(hit_pl_hp - hero_fury.damage * 2)
|
||||||
else
|
else
|
||||||
fbrawl.spawn_blood_particle(player, hero_fury.damage)
|
fbrawl.spawn_blood_particle(player, hero_fury.damage)
|
||||||
hit_player:set_hp(1)
|
hit_player:set_hp(1)
|
||||||
@ -235,12 +235,10 @@ function hit(player, hit_player, offset, last)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local hitter_look_dir = player:get_look_dir()
|
local hitter_look_dir = player:get_look_dir()
|
||||||
|
|
||||||
local push_force = vector.multiply(hitter_look_dir, punch_force)
|
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())
|
minetest.add_entity({x=0,y=0,z=0}, "fantasy_brawl:forward_punch", player:get_player_name())
|
||||||
|
|
||||||
hit_player:add_velocity(push_force)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
@ -248,9 +246,12 @@ end
|
|||||||
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
minetest.register_on_player_hpchange(function(player, hp_change, reason)
|
||||||
local pl_name = player:get_player_name()
|
local pl_name = player:get_player_name()
|
||||||
local hero_fury = pl_name:get_skill("fbrawl:hero_fury")
|
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
|
if hero_fury and hero_fury.is_active then
|
||||||
return 0
|
return 0
|
||||||
|
elseif hit_by_hero_fury and hit_by_hero_fury.is_active and reason.object then
|
||||||
|
return 0
|
||||||
else
|
else
|
||||||
return hp_change
|
return hp_change
|
||||||
end
|
end
|
||||||
|
@ -65,7 +65,6 @@ skillz.register_skill("fbrawl:smash", {
|
|||||||
data = {
|
data = {
|
||||||
hit_players = {},
|
hit_players = {},
|
||||||
started = false,
|
started = false,
|
||||||
fall_damage = false
|
|
||||||
},
|
},
|
||||||
loop_params = {
|
loop_params = {
|
||||||
cast_rate = 0
|
cast_rate = 0
|
||||||
@ -111,17 +110,12 @@ skillz.register_skill("fbrawl:smash", {
|
|||||||
},
|
},
|
||||||
on_start = function(self)
|
on_start = function(self)
|
||||||
self.data.hit_players = {}
|
self.data.hit_players = {}
|
||||||
self.data.fall_damage = false
|
|
||||||
self.data.started = false
|
self.data.started = false
|
||||||
end,
|
end,
|
||||||
on_stop = function(self)
|
on_stop = function(self)
|
||||||
fbrawl.replace_slot_item(self.player, 2, "fantasy_brawl:warrior_jump")
|
fbrawl.replace_slot_item(self.player, 2, "fantasy_brawl:warrior_jump")
|
||||||
|
|
||||||
minetest.after(self.slow_down_time, function()
|
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
|
for i, player in ipairs(self.data.hit_players) do
|
||||||
local pl_speed = player:get_physics_override().speed
|
local pl_speed = player:get_physics_override().speed
|
||||||
player:set_physics_override({speed = pl_speed + self.slow_down_factor})
|
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_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)
|
|
1
init.lua
1
init.lua
@ -17,6 +17,7 @@ arena_lib.register_minigame("fantasy_brawl", {
|
|||||||
kills = 0,
|
kills = 0,
|
||||||
ultimate_recharge = 0,
|
ultimate_recharge = 0,
|
||||||
},
|
},
|
||||||
|
disabled_damage_types = {"fall"},
|
||||||
hotbar = {slots = 4, background_image = "fbrawl_hotbar.png"},
|
hotbar = {slots = 4, background_image = "fbrawl_hotbar.png"},
|
||||||
load_time = fbrawl_settings.max_loading_time,
|
load_time = fbrawl_settings.max_loading_time,
|
||||||
show_nametags = false,
|
show_nametags = false,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user