mirror of
https://github.com/LDDestroier/CC/
synced 2024-11-13 21:34:54 +00:00
28 lines
913 B
Plaintext
28 lines
913 B
Plaintext
local stage, players, objects, projectiles, act, images = ...
|
|
return {
|
|
info = {
|
|
name = "CrossBomb",
|
|
description = "Lob a cross-shaped bomb 2 panels forward!",
|
|
cooldown = {
|
|
shoot = 6,
|
|
move = 5
|
|
}
|
|
},
|
|
logic = function(info)
|
|
local maxDist = 3
|
|
local maxFrames = 10
|
|
local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2
|
|
if parabola < 0.1 and info.frame > 3 then
|
|
act.stage.setDamage(info.x, info.y - 1, 70, info.owner, 1, false)
|
|
act.stage.setDamage(info.x, info.y, 70, info.owner, 1, false)
|
|
act.stage.setDamage(info.x, info.y + 1, 70, info.owner, 1, false)
|
|
act.stage.setDamage(info.x - 1, info.y, 70, info.owner, 1, false)
|
|
act.stage.setDamage(info.x + 1, info.y, 70, info.owner, 1, false)
|
|
return false
|
|
else
|
|
info.x = info.x + (maxDist / maxFrames) * info.direction
|
|
end
|
|
return true, {{images.cannon, info.x, info.y - parabola}}
|
|
end
|
|
}
|