mirror of
https://github.com/LDDestroier/CC/
synced 2024-11-17 23:34:52 +00:00
37 lines
1.1 KiB
Plaintext
37 lines
1.1 KiB
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
|
|
info.panelOwner = stage.panels[info.y][info.x + info.direction].owner
|
|
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
|
|
}
|