-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjumpingAttack.lua
More file actions
34 lines (26 loc) · 784 Bytes
/
Copy pathjumpingAttack.lua
File metadata and controls
34 lines (26 loc) · 784 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
local attack = require "attack"
local airborne = require "airborne"
local jumping = require "jumping"
local jumpingAttack = {}
setmetatable(jumpingAttack,jumpingAttack)
jumpingAttack.__index=attack
jumpingAttack.isAirborneState = true
function jumpingAttack:__call(c1,c2,xVel,yVel,s,a,r,hitb,damage,chip,effect,blockEffect)
local nt = attack(c1,c2,s,a,r,hitb,damage,chip,effect,blockEffect)
setmetatable(nt,{__index=jumpingAttack})
nt.isAirborneState=true
nt.xVel = xVel
nt.yVel = yVel
return nt
end
function jumpingAttack:update()
attack.update(self)
airborne.update(self)
end
function jumpingAttack:fallback()
local newJumping = self.c1.jumping:copy()
newJumping.xVel = self.xVel
newJumping.yVel = self.yVel
self.c1:setState(newJumping)
end
return jumpingAttack