-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathkirby.lua
More file actions
36 lines (33 loc) · 976 Bytes
/
kirby.lua
File metadata and controls
36 lines (33 loc) · 976 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---------------------------------
-- Golf copy ability for Kirby --
---------------------------------
local K_Snolf = function(checkflags, destroy, late, player)
if checkflags then
return AF_NOJUMP|AF_NOSWIM|AF_NODUCK
elseif destroy then
--reset stats
local skin = skins[player.mo.skin]
player.jumpfactor = skin.jumpfactor
player.accelstart = skin.accelstart
player.acceleration = skin.acceleration
player.charability2 = skin.ability2
return
end
if late then
return
end
--Immediately set stats to 0
if player.kvars.ablvar1 == 0 then
player.jumpfactor = 0
player.accelstart = 0
player.acceleration = 0
player.charability2 = CA2_NONE
end
player.kvars.ablvar1 = $1+1 --use ablvar1 as a timer
end
addHook("PreThinkFrame", function()
if K_AddAbility and kirbyabilitytable and not kirby_snolf_ability then
rawset(_G, "kirby_snolf_ability", K_AddAbility( K_Snolf, true, "GOLF"))
kirbyabilitytable["snolf"] = - kirby_snolf_ability
end
end)