1
0
mirror of https://github.com/LDDestroier/CC/ synced 2024-12-14 04:00:29 +00:00
ldd-CC/CCBN/ccbn-data/chipdata/panelshot
2019-03-13 00:15:41 -04:00

36 lines
1016 B
Plaintext

local stage, players, objects, projectiles, act, images = ...
return {
info = {
name = "CrackShot",
description = "Fires a panel forwards!",
cooldown = {
shoot = 6,
move = 4
}
},
logic = function(info)
if info.frame == 0 then
if act.stage.checkIfSolid(info.x + info.direction, info.y) then
info.panelType = stage.panels[info.y][info.x + info.direction].panelType
act.stage.crackPanel(info.x + info.direction, info.y, 2)
info.x = info.x + info.direction
else
return false
end
elseif info.panelType then
info.x = info.x + (3 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, info.altDamage or 60, info.owner, 1, info.noFlinch)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
if info.frame > 50 or struckPlayer or struckObject then
return false
else
return true, {{images.panel[info.panelType], info.x, info.y}}
end
end
return {{images.panel[info.panelType], info.x, info.y}}
end
}