Finished death_twirl + ice spikes are faster

This commit is contained in:
Giov4 2022-10-27 01:28:32 +02:00
parent d351b9e472
commit b37172e81d
13 changed files with 25 additions and 28 deletions

View File

@ -1,6 +1,7 @@
local function get_classes_btns() end
local function get_skills_btns() end
local function start_match_if_everyone_selected_a_class() end
local data = {} -- player: ObjectRef = data: table
local T = fbrawl.T
@ -53,7 +54,7 @@ function fbrawl.show_class_selector(pl_name)
-- CLASSES BTNS
get_classes_btns(pl_data)..
-- SELECT BTN
"image_button_exit[4.2,8.6;2.8,1.3;fbrawl_gui_btn_choose.png;choose_class;Choose]"
@ -65,6 +66,7 @@ end
minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname ~= "class_selector" then return false end
local pl_name = player:get_player_name()
local arena = arena_lib.get_arena_by_player(pl_name)
@ -102,7 +104,7 @@ end)
function get_classes_btns(pl_data)
function get_classes_btns(pl_data)
local btns = ""
local selected_class_name = pl_data.selected_class_name or "Warrior"
@ -112,6 +114,7 @@ function get_classes_btns(pl_data)
if class.name == selected_class_name then
btns = btns ..
"set_focus[selected_class;]"..
"image_button[0,"..btn_y..";1.5,1.5;fbrawl_gui_btn_class_selected.png;selected_class;]"..
"image[0,"..btn_y..";1.5,1.5;"..class.icon.."]"

View File

@ -45,7 +45,7 @@
fbrawl.classes = {} -- index : number = class : {}
fbrawl.min_kills_to_use_ultimate = 10
fbrawl.min_kills_to_use_ultimate = 5
local function get_valid_class() end
local function set_callbacks() end
@ -163,7 +163,7 @@ function set_callbacks(class)
local props = arena.players[pl_name]
props.kills = props.kills + 1
props.ultimate_recharge = math.min(props.ultimate_recharge + 1, fbrawl.min_kills_to_use_ultimate)
on_kill(self, arena, pl_name, killed_pl_name)
end
@ -179,6 +179,7 @@ function set_callbacks(class)
end
class.on_end = function(self, arena, pl_name)
pl_name:remove_skill("fbrawl:mana")
on_end(self, arena, pl_name)
end
end

View File

@ -47,7 +47,7 @@ minetest.register_craftitem("fantasy_brawl:fire_sprint", {
minetest.register_craftitem("fantasy_brawl:meteor", {
minetest.register_craftitem("fantasy_brawl:cry_of_gaia", {
description = T("Crush 'em all!"),
inventory_image = "fbrawl_cry_of_gaia_skill.png",
stack_max = 1,
@ -94,7 +94,7 @@ minetest.register_craftitem("fantasy_brawl:enchanted_coat", {
minetest.register_craftitem("fantasy_brawl:rocky_propulsion", {
minetest.register_craftitem("fantasy_brawl:gaia_fist", {
description = skillz.get_skill_def("fbrawl:gaia_fist").description,
inventory_image = "fbrawl_gaia_fist.png",
stack_max = 1,

View File

@ -5,8 +5,7 @@ fbrawl.register_class("mage", {
physics_override = {
speed = 1.5,
},
items = {"fantasy_brawl:mage_staff", "fantasy_brawl:fire_sprint", "fantasy_brawl:enchanted_coat", "fantasy_brawl:rocky_propulsion", "fantasy_brawl:meteor"},
-- TODO: togliere l'icona a bubble beam e creare l'abilità staff alla quale assegno la desc. di bubble b. + ice_spikes
items = {"fantasy_brawl:mage_staff", "fantasy_brawl:fire_sprint", "fantasy_brawl:enchanted_coat", "fantasy_brawl:gaia_fist", "fantasy_brawl:cry_of_gaia"},
skills = {"fbrawl:mage_staff", "fbrawl:ice_spikes", "fbrawl:bubble_beam", "fbrawl:fire_sprint", "fbrawl:enchanted_coat", "fbrawl:gaia_fist", "fbrawl:cry_of_gaia"},
sound = "mage-class"
})

View File

@ -6,14 +6,15 @@ skillz.register_skill("fbrawl:ice_spikes", {
name = "Ice Spikes",
description = T("Creates a path of ice spikes that damages the enemies."),
cooldown = 7,
spikes = 6,
speed = 20,
cast = function(self)
local spike_base_pos = vector.add(self.player:get_pos(), {x=0, y=-1, z=0})
local look_dir = self.player:get_look_dir()
look_dir.y = 0
local spikes = 5
for i = 1, spikes+1, 1 do
minetest.after(i/7, function ()
for i = 1, self.spikes+1, 1 do
minetest.after(i/self.speed, function ()
local offset = vector.multiply(look_dir, i)
local entity1 = minetest.add_entity(vector.add(spike_base_pos, offset), "fantasy_brawl:ice_spikes", self.pl_name)
local entity2 = minetest.add_entity(vector.add(spike_base_pos, offset), "fantasy_brawl:ice_spikes", self.pl_name)
@ -36,13 +37,14 @@ local ice_spikes = {
collide_with_objects = false,
visual = "wielditem",
wield_item = "fantasy_brawl:ice_spikes",
visual_size = {x = 0.5, y = 0.5, z = 0.01},
visual_size = {x = 0.5, y = 0.6, z = 0.01},
},
_pl_name = "",
_time_passed = 0,
_lifetime = 4,
_damage = 2 / 2,
_tick_buffer = 0
_tick_buffer = 0,
_speed = 8
}
@ -57,7 +59,7 @@ function ice_spikes:on_activate(pl_name, dtime_s)
minetest.sound_play(sound, sound, true)
self._pl_name = pl_name
obj:set_velocity({x=0, y=5.4, z=0})
obj:set_velocity({x=0, y=self._speed, z=0})
else
obj:remove()
end
@ -103,7 +105,7 @@ function ice_spikes:on_step(dtime)
return
end
if self._time_passed >= 0.25 then
if self._time_passed >= 1.2/self._speed then
self.object:set_velocity({x=0, y=0, z=0})
end
if self._time_passed >= self._lifetime then

View File

@ -64,10 +64,10 @@ skillz.register_skill("fbrawl:mana", {
function fbrawl.consume_mana(skill)
function fbrawl.consume_mana(skill)
if fbrawl.has_enough_mana(skill) then
local mana_skill = skill.pl_name:get_skill("fbrawl:mana")
if skill.cooldown_timer > 0 then
skill:cast() --
skill:start() -- this will print an error in the chat

View File

@ -15,7 +15,7 @@ skillz.register_skill("fbrawl:death_twirl", {
time_passed = 0
},
sounds = {
start = {name="fbrawl_death_twirl", max_hear_distance = 12}
start = {name="fbrawl_death_twirl", object = true, max_hear_distance = 12},
},
attachments = {
particles = {{

View File

@ -7,7 +7,7 @@ fbrawl.register_class("warrior", {
gravity = 0.9
},
items = {"fantasy_brawl:sword_steel", "fantasy_brawl:warrior_jump", "fantasy_brawl:iron_skin", "fantasy_brawl:perfect_combo", "fantasy_brawl:hero_fury"},
skills = {"fbrawl:sword", "fbrawl:warrior_jump", "fbrawl:iron_skin", "fbrawl:perfect_combo", "fbrawl:hero_fury",},
skills = {"fbrawl:sword", "fbrawl:death_twirl", "fbrawl:warrior_jump", "fbrawl:iron_skin", "fbrawl:perfect_combo", "fbrawl:hero_fury",},
sound = "warrior-class"
})

View File

@ -1,7 +1,6 @@
local saved_huds = {} -- pl_name = {hud_name = id}
-- TODO: ultimate HUD
function fbrawl.generate_HUD(arena, pl_name)
-- Save the huds IDs for each player.

View File

@ -51,11 +51,4 @@ minetest.register_allow_player_inventory_action(function(player, action, invento
if arena_lib.is_player_in_arena(pl_name, "fantasy_brawl") then
return 0
end
end)
minetest.register_on_joinplayer(function(p, last_login)
end)
skillz.register_on_unlock("fbrawl", function(def) minetest.log("+ " .. def.name .. " to " .. def.pl_name) end)
end)

Binary file not shown.

Binary file not shown.

Binary file not shown.