Add files via upload

This commit is contained in:
LDDestroier 2019-03-13 17:05:50 -04:00 committed by GitHub
parent 9e9d9592f0
commit a313b6364d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
41 changed files with 541 additions and 239 deletions

View File

@ -80,23 +80,23 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 20, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 20, info.owner, 1)\\\
\\\ \\\
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\ local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\
\\\ \\\
if info.frame > 50 or struckPlayer or struckObject then\\\ if info.frame > 50 or struckPlayer or struckObject then\\\
if struckPlayer then\\\ if struckPlayer then\\\
if act.player.movePlayer(struckPlayer, info.direction, 0, true) then\\\ if act.player.movePlayer(struckPlayer, info.direction, 0, true) then\\\
act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 1)\\\
end\\\ end\\\
elseif struckObject then\\\ elseif struckObject then\\\
if objects[struckObject].doYeet then\\\ if objects[struckObject].doYeet then\\\
objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\ objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\
else\\\ else\\\
if act.object.moveObject(struckObject, info.direction, 0) then\\\ if act.object.moveObject(struckObject, info.direction, 0) then\\\
act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 1)\\\
end\\\ end\\\
end\\\ end\\\
end\\\ end\\\
@ -171,7 +171,7 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 60, info.owner, 1)\\\ act.stage.setDamage(info.x, info.y, 60, info.owner, 1)\\\
\\\ \\\
@ -238,7 +238,7 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\
\\\ \\\
@ -246,11 +246,11 @@ return {\\\
\\\ \\\
if info.frame > 50 or struckPlayer or struckObject then\\\ if info.frame > 50 or struckPlayer or struckObject then\\\
if struckPlayer or struckObject then\\\ if struckPlayer or struckObject then\\\
act.stage.setDamage(info.x - 1, info.y - 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x - 1, info.y - 1, 30, info.owner, 1)\\\
act.stage.setDamage(info.x + 1, info.y - 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + 1, info.y - 1, 30, info.owner, 1)\\\
act.stage.setDamage(info.x - 1, info.y + 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x - 1, info.y + 1, 30, info.owner, 1)\\\
act.stage.setDamage(info.x + 1, info.y + 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + 1, info.y + 1, 30, info.owner, 1)\\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
end\\\ end\\\
return false\\\ return false\\\
else\\\ else\\\
@ -289,6 +289,9 @@ return {\\\
[ \"ccbn.lua\" ] = \"local scr_x, scr_y = term.getSize()\\\ [ \"ccbn.lua\" ] = \"local scr_x, scr_y = term.getSize()\\\
local keysDown, miceDown = {}, {}\\\ local keysDown, miceDown = {}, {}\\\
\\\ \\\
-- recommended at 0.1 for netplay, which you'll be doing all the time so yeah\\\
local gameDelayInit = 0.1\\\
\\\
local useAbsoluteMainDir = false\\\ local useAbsoluteMainDir = false\\\
\\\ \\\
local config = {\\\ local config = {\\\
@ -305,7 +308,8 @@ local game = {\\\
customMax = 200,\\\ customMax = 200,\\\
customSpeed = 1,\\\ customSpeed = 1,\\\
inChipSelect = true,\\\ inChipSelect = true,\\\
paused = false\\\ paused = false,\\\
turnNumber = 0\\\
}\\\ }\\\
\\\ \\\
local you = 1\\\ local you = 1\\\
@ -316,9 +320,6 @@ for k,v in pairs(keys) do\\\
revKeys[v] = k\\\ revKeys[v] = k\\\
end\\\ end\\\
\\\ \\\
-- recommended at 0.1 for netplay, which you'll be doing all the time so yeah\\\
local gameDelayInit = 0.05\\\
\\\
local gameID = math.random(0, 2^30)\\\ local gameID = math.random(0, 2^30)\\\
local waitingForGame = false\\\ local waitingForGame = false\\\
local isHost = true\\\ local isHost = true\\\
@ -714,7 +715,7 @@ local images = {\\\
\\\ \\\
local cwrite = function(text, y)\\\ local cwrite = function(text, y)\\\
local cx, cy = term.getCursorPos()\\\ local cx, cy = term.getCursorPos()\\\
term.setCursorPos(scr_x / 2 - #text / 2, y or (scr_y / 2))\\\ term.setCursorPos(0.5 + scr_x / 2 - #text / 2, y or (scr_y / 2))\\\
term.write(text)\\\ term.write(text)\\\
end\\\ end\\\
\\\ \\\
@ -804,7 +805,7 @@ act.stage.getDamage = function(x, y, pID, oID, pIDsafeCheck, oIDsafeCheck)\\\
end\\\ end\\\
\\\ \\\
local premadeFolders = {\\\ local premadeFolders = {\\\
[1] = { -- BN2 starting folder, modified slightly\\\ [1] = {\\\
{\\\"cannon\\\", \\\"a\\\"},\\\ {\\\"cannon\\\", \\\"a\\\"},\\\
{\\\"cannon\\\", \\\"a\\\"},\\\ {\\\"cannon\\\", \\\"a\\\"},\\\
{\\\"hicannon\\\", \\\"b\\\"},\\\ {\\\"hicannon\\\", \\\"b\\\"},\\\
@ -892,7 +893,7 @@ local premadeFolders = {\\\
{\\\"recov30\\\", \\\"l\\\"},\\\ {\\\"recov30\\\", \\\"l\\\"},\\\
{\\\"vulcan2\\\", \\\"c\\\"},\\\ {\\\"vulcan2\\\", \\\"c\\\"},\\\
{\\\"vulcan1\\\", \\\"c\\\"},\\\ {\\\"vulcan1\\\", \\\"c\\\"},\\\
{\\\"vulcan1\\\", \\\"c\\\"},\\\ {\\\"boomer1\\\", \\\"c\\\"},\\\
{\\\"geddon1\\\", \\\"f\\\"},\\\ {\\\"geddon1\\\", \\\"f\\\"},\\\
{\\\"shotgun\\\", \\\"d\\\"},\\\ {\\\"shotgun\\\", \\\"d\\\"},\\\
{\\\"shotgun\\\", \\\"d\\\"},\\\ {\\\"shotgun\\\", \\\"d\\\"},\\\
@ -1323,6 +1324,8 @@ local render = function(extraImage)\\\
buffer[#buffer + 1] = {makeRectangle(scr_x, scr_y, \\\"f\\\", \\\"f\\\", \\\"f\\\"), 1, 1}\\\ buffer[#buffer + 1] = {makeRectangle(scr_x, scr_y, \\\"f\\\", \\\"f\\\", \\\"f\\\"), 1, 1}\\\
drawImage(colorSwap(merge(table.unpack(buffer)), {[\\\" \\\"] = \\\"f\\\"}), 1, 1)\\\ drawImage(colorSwap(merge(table.unpack(buffer)), {[\\\" \\\"] = \\\"f\\\"}), 1, 1)\\\
\\\ \\\
term.setTextColor(colors.white)\\\
term.setBackgroundColor(colors.black)\\\
if players[you] then\\\ if players[you] then\\\
if chips[players[you].chipQueue[1]] then\\\ if chips[players[you].chipQueue[1]] then\\\
term.setCursorPos(1, scr_y)\\\ term.setCursorPos(1, scr_y)\\\
@ -1344,29 +1347,36 @@ local render = function(extraImage)\\\
end\\\ end\\\
end\\\ end\\\
\\\ \\\
term.setTextColor(colors.white)\\\ if game.custom == game.customMax and FRAME % 16 <= 12 and not game.inChipSelect then\\\
term.setBackgroundColor(colors.black)\\\
if game.custom == game.customMax and FRAME % 8 <= 5 then\\\
cwrite(\\\"PUSH '\\\" .. revKeys[control.custom]:upper() .. \\\"'!\\\", 2)\\\ cwrite(\\\"PUSH '\\\" .. revKeys[control.custom]:upper() .. \\\"'!\\\", 2)\\\
end\\\ end\\\
term.setBackgroundColor(colors.gray)\\\ term.setTextColor(colors.lightGray)\\\
term.setCursorPos(6, 1)\\\ term.setCursorPos(6, 1)\\\
term.write(\\\"[CUSTOM][\\\")\\\ term.write(\\\"CUSTOM\\\")\\\
local barLength = scr_x - 20\\\ term.setTextColor(colors.white)\\\
term.write(\\\"[\\\")\\\
local barLength = scr_x - 18\\\
if game.custom == game.customMax then\\\ if game.custom == game.customMax then\\\
term.setTextColor(colors.gray)\\\
term.setBackgroundColor(colors.lime)\\\ term.setBackgroundColor(colors.lime)\\\
else\\\ else\\\
term.setTextColor(colors.gray)\\\
term.setBackgroundColor(colors.green)\\\ term.setBackgroundColor(colors.green)\\\
end\\\ end\\\
for i = 1, barLength do\\\ for i = 1, barLength do\\\
if (i / barLength) <= (game.custom / game.customMax) then\\\ if (i / barLength) <= (game.custom / game.customMax) then\\\
term.write(\\\"=\\\")\\\ if game.custom == game.customMax then\\\
term.write(\\\"@\\\")\\\
else\\\
term.write(\\\"=\\\")\\\
end\\\
else\\\ else\\\
term.setBackgroundColor(colors.gray)\\\ term.setBackgroundColor(colors.black)\\\
term.write(\\\" \\\")\\\ term.write(\\\" \\\")\\\
end\\\ end\\\
end\\\ end\\\
term.setBackgroundColor(colors.gray)\\\ term.setTextColor(colors.white)\\\
term.setBackgroundColor(colors.black)\\\
term.write(\\\"]\\\")\\\ term.write(\\\"]\\\")\\\
\\\ \\\
if showDebug then\\\ if showDebug then\\\
@ -1377,6 +1387,8 @@ end\\\
\\\ \\\
local getInput = function()\\\ local getInput = function()\\\
local evt\\\ local evt\\\
keysDown = {}\\\
miceDown = {}\\\
while true do\\\ while true do\\\
evt = {os.pullEvent()}\\\ evt = {os.pullEvent()}\\\
if evt[1] == \\\"key\\\" then\\\ if evt[1] == \\\"key\\\" then\\\
@ -1435,7 +1447,7 @@ local chipSelectScreen = function()\\\
term.setCursorPos(3, y)\\\ term.setCursorPos(3, y)\\\
term.write((\\\" \\\"):rep(scr_x - 4))\\\ term.write((\\\" \\\"):rep(scr_x - 4))\\\
end\\\ end\\\
cwrite(\\\" Select Chips: \\\", 3)\\\ cwrite(\\\" Turn \\\" .. game.turnNumber .. \\\", Select Chips: \\\", 3)\\\
term.setTextColor(colors.lightGray)\\\ term.setTextColor(colors.lightGray)\\\
cwrite(\\\" (Push '\\\" .. revKeys[control.chip]:upper() .. \\\"' to add / '\\\" .. revKeys[control.buster]:upper() .. \\\"' to remove) \\\", 4)\\\ cwrite(\\\" (Push '\\\" .. revKeys[control.chip]:upper() .. \\\"' to add / '\\\" .. revKeys[control.buster]:upper() .. \\\"' to remove) \\\", 4)\\\
cwrite(\\\" (Push ENTER to confirm loadout) \\\", 5)\\\ cwrite(\\\" (Push ENTER to confirm loadout) \\\", 5)\\\
@ -1478,8 +1490,8 @@ local chipSelectScreen = function()\\\
end\\\ end\\\
\\\ \\\
local evt\\\ local evt\\\
render()\\\
while true do\\\ while true do\\\
-- render()\\\
renderMenu()\\\ renderMenu()\\\
evt = {os.pullEvent()}\\\ evt = {os.pullEvent()}\\\
if evt[1] == \\\"key\\\" then\\\ if evt[1] == \\\"key\\\" then\\\
@ -1530,19 +1542,25 @@ local waitingForClientChipSelection = false\\\
local runGame = function()\\\ local runGame = function()\\\
local evt, getStateInfo\\\ local evt, getStateInfo\\\
render()\\\ render()\\\
sleep(0.5)\\\ sleep(0.35)\\\
while true do\\\ while true do\\\
FRAME = FRAME + 1\\\ FRAME = FRAME + 1\\\
\\\
render()\\\
\\\ \\\
if game.inChipSelect then\\\ if game.inChipSelect then\\\
game.turnNumber = game.turnNumber + 1\\\
chipSelectScreen()\\\ chipSelectScreen()\\\
if isHost then\\\ if isHost then\\\
game.inChipSelect = false\\\
game.custom = 0\\\ game.custom = 0\\\
local msg\\\ local msg\\\
cwrite(\\\"Waiting...\\\", scr_y - 3)\\\ render()\\\
cwrite(\\\"Waiting for other player...\\\", scr_y - 3)\\\
\\\
transmit({\\\
gameID = gameID,\\\
command = \\\"turn_ready\\\",\\\
pID = you,\\\
})\\\
\\\
repeat\\\ repeat\\\
sleep(0)\\\ sleep(0)\\\
until cliChipSelect\\\ until cliChipSelect\\\
@ -1554,8 +1572,11 @@ local runGame = function()\\\
transmit({\\\ transmit({\\\
gameID = gameID,\\\ gameID = gameID,\\\
command = \\\"turn_ready\\\",\\\ command = \\\"turn_ready\\\",\\\
pID = you,\\\ pID = 1,\\\
})\\\ })\\\
term.clearLine()\\\
cwrite(\\\"READY!\\\", scr_y - 3)\\\
sleep(0.5)\\\
else\\\ else\\\
transmit({\\\ transmit({\\\
gameID = gameID,\\\ gameID = gameID,\\\
@ -1564,7 +1585,8 @@ local runGame = function()\\\
chipQueue = players[you].chipQueue,\\\ chipQueue = players[you].chipQueue,\\\
folder = players[you].folder,\\\ folder = players[you].folder,\\\
})\\\ })\\\
cwrite(\\\"Waiting...\\\", scr_y - 3)\\\ render()\\\
cwrite(\\\"Waiting for other player...\\\", scr_y - 3)\\\
repeat\\\ repeat\\\
msg = receive()\\\ msg = receive()\\\
msg = type(msg) == \\\"table\\\" and msg or {}\\\ msg = type(msg) == \\\"table\\\" and msg or {}\\\
@ -1573,11 +1595,14 @@ local runGame = function()\\\
msg.command == \\\"turn_ready\\\" and\\\ msg.command == \\\"turn_ready\\\" and\\\
players[msg.pID]\\\ players[msg.pID]\\\
)\\\ )\\\
term.clearLine()\\\
cwrite(\\\"READY!\\\", scr_y - 3)\\\
sleep(0.5)\\\
end\\\ end\\\
game.inChipSelect = false\\\
end\\\ end\\\
\\\ \\\
if isHost then\\\ if isHost then\\\
game.custom = math.min(game.customMax, game.custom + 1)\\\
getControls()\\\ getControls()\\\
for id, proj in pairs(projectiles) do\\\ for id, proj in pairs(projectiles) do\\\
local success, imageData = chips[proj.chipType].logic(proj)\\\ local success, imageData = chips[proj.chipType].logic(proj)\\\
@ -1667,14 +1692,15 @@ local runGame = function()\\\
end\\\ end\\\
end\\\ end\\\
end\\\ end\\\
reduceCooldowns()\\\
movePlayers()\\\
if players[you] then\\\ if players[you] then\\\
if players[you].control.custom and game.custom == game.customMax then\\\ if players[you].control.custom and game.custom == game.customMax then\\\
game.inChipSelect = true\\\ game.inChipSelect = true\\\
end\\\ end\\\
end\\\ end\\\
render()\\\
movePlayers()\\\
sleep(gameDelayInit)\\\ sleep(gameDelayInit)\\\
game.custom = math.min(game.customMax, game.custom + 1)\\\
transmit({\\\ transmit({\\\
gameID = gameID,\\\ gameID = gameID,\\\
command = \\\"get_state\\\",\\\ command = \\\"get_state\\\",\\\
@ -1686,6 +1712,7 @@ local runGame = function()\\\
stagePanels = stage.panels,\\\ stagePanels = stage.panels,\\\
id = id\\\ id = id\\\
})\\\ })\\\
reduceCooldowns()\\\
else\\\ else\\\
getControls()\\\ getControls()\\\
if players[you] then\\\ if players[you] then\\\
@ -1706,6 +1733,7 @@ local runGame = function()\\\
})\\\ })\\\
end\\\ end\\\
end\\\ end\\\
render()\\\
evt, getStateInfo = os.pullEvent(\\\"ccbn_get_state\\\")\\\ evt, getStateInfo = os.pullEvent(\\\"ccbn_get_state\\\")\\\
players = getStateInfo.players\\\ players = getStateInfo.players\\\
projectiles = getStateInfo.projectiles\\\ projectiles = getStateInfo.projectiles\\\
@ -1911,9 +1939,129 @@ local makeMenu = function(x, y, options, _cpos)\\\
end\\\ end\\\
end\\\ end\\\
\\\ \\\
local howToPlay = function()\\\
local help = {\\\
\\\" (Scroll with mousewheel / arrows)\\\",\\\
\\\" (Exit with 'Q')\\\",\\\
(\\\"=\\\"):rep(scr_x),\\\
\\\"\\\",\\\
\\\" If you're not familiar with\\\",\\\
\\\" Megaman Battle Network, buckle up.\\\",\\\
\\\"\\\",\\\
\\\" Battles are separated into 'turns'.\\\",\\\
\\\" At the beginning of each turn, you\\\",\\\
\\\" select one or more battlechips to use\\\",\\\
\\\" during that turn.\\\",\\\
\\\"\\\",\\\
\\\" Selecting battlechips has certain rules.\\\",\\\
\\\" Battlechips are given alphabetic codes\\\",\\\
\\\" You can only pick two or more battlechips\\\",\\\
\\\" that have the same code, or are of the same\\\",\\\
\\\" chip type. That means you can pick a\\\",\\\
\\\" Cannon A and a Minibomb A, but you can't\\\",\\\
\\\" add an extra Cannon B without removing\\\",\\\
\\\" the Minibomb B.\\\",\\\
\\\" ____ ____ ____ \\\",\\\
\\\"| | | | | ^ | \\\",\\\
\\\"| \\\"..revKeys[control.buster]:upper()..\\\" | | \\\"..revKeys[control.chip]:upper()..\\\" | | | | \\\",\\\
\\\"|____| |____| |____| \\\",\\\
\\\" ____ ____ ____ \\\",\\\
\\\" | | | | | | | \\\",\\\
\\\" | <- | | V | | -> | \\\",\\\
\\\" |____| |____| |____| \\\",\\\
\\\"\\\",\\\
\\\" To move, use the ARROW KEYS.\\\",\\\
\\\" Fire the MegaBuster with '\\\"..revKeys[control.buster]:upper()..\\\"'. It's a free\\\",\\\
\\\" action, but not very strong.\\\",\\\
\\\" Use the currently selected battlechip\\\",\\\
\\\" (indicated in the bottom-left corner)\\\",\\\
\\\" with '\\\"..revKeys[control.chip]:upper()..\\\"'.\\\",\\\
\\\"\\\",\\\
\\\" Once you use up all your chips, you will\\\",\\\
\\\" need to wait for the Custom bar to refill.\\\",\\\
\\\" Once it is full, push '\\\"..revKeys[control.custom]:upper()..\\\"' and the turn will\\\",\\\
\\\" end, and you can pick more battlechips.\\\",\\\
\\\"\\\",\\\
\\\" Keep in mind that this erases all currently\\\",\\\
\\\" loaded battlechips, and that the opponent\\\",\\\
\\\" can also end the turn without warning, so\\\",\\\
\\\" make sure that your battlechips are used\\\",\\\
\\\" before the bar fills!\\\",\\\
\\\"\\\",\\\
\\\" ___________________________________\\\",\\\
\\\" |yours|yours|yours|enemy|enemy|enemy|\\\",\\\
\\\" |_____|_____|_____|_____|_____|_____|\\\",\\\
\\\" |yours|yours|yours|enemy|enemy|enemy|\\\",\\\
\\\" |_____|_____|_____|_____|_____|_____|\\\",\\\
\\\" |yours|yours|yours|enemy|enemy|enemy|\\\",\\\
\\\" |_____|_____|_____|_____|_____|_____|\\\",\\\
\\\"\\\",\\\
\\\" The stage that you stand on can also be\\\",\\\
\\\" manipulated. Some chips, such as AreaGrab\\\",\\\
\\\" can take away ownership of one or more\\\",\\\
\\\" panels from the enemy for a short while.\\\",\\\
\\\" Some chips, such as CrackShot, will break\\\",\\\
\\\" panels, rendering them unusable for a short\\\",\\\
\\\" while. Some chips will crack panels, such\\\",\\\
\\\" as Geddon1. Stepping off of a cracked panel\\\",\\\
\\\" will cause it to break.\\\",\\\
\\\"\\\",\\\
\\\" That's all I can think of. Sorry for all that\\\",\\\
\\\" wall of text, and I hope you enjoy the game!\\\",\\\
\\\"\\\",\\\
\\\" ___ __ __ _ _ \\\",\\\
\\\"/ \\\\\\\\ | | | | | \\\\\\\\ | | | / \\\\\\\\ | / | \\\",\\\
\\\"| ___ | | | | | | | | | | |/\\\\\\\\ | \\\",\\\
\\\"\\\\\\\\__| |__| |__| |_/ |__ \\\\\\\\_/ \\\\\\\\_/ | \\\\\\\\ . \\\",\\\
}\\\
\\\
local scroll = 0\\\
local maxScroll = #help - scr_y + 2\\\
\\\
local rend = function(scroll)\\\
term.setBackgroundColor(colors.black)\\\
term.setTextColor(colors.white)\\\
for y = 1, scr_y do\\\
term.setCursorPos(1,y)\\\
term.clearLine()\\\
term.write(help[y + scroll] or \\\"\\\")\\\
end\\\
end\\\
\\\
local evt\\\
while true do\\\
evt = {os.pullEvent()}\\\
if evt[1] == \\\"key\\\" then\\\
if evt[2] == keys.q then\\\
return\\\
elseif evt[2] == keys.up then\\\
scroll = scroll - 1\\\
elseif evt[2] == keys.down then\\\
scroll = scroll + 1\\\
elseif evt[2] == keys.pageUp then\\\
scroll = scroll - scr_y\\\
elseif evt[2] == keys.pageDown then\\\
scroll = scroll + scr_y\\\
elseif evt[2] == keys.home then\\\
scroll = 0\\\
elseif evt[2] == keys[\\\"end\\\"] then\\\
scroll = maxScroll\\\
end\\\
elseif evt[1] == \\\"mouse_scroll\\\" then\\\
scroll = scroll + evt[2]\\\
end\\\
scroll = math.min(maxScroll, math.max(0, scroll))\\\
rend(scroll)\\\
end\\\
\\\
sleep(0.1)\\\
os.pullEvent(\\\"key\\\")\\\
end\\\
\\\
local titleScreen = function()\\\ local titleScreen = function()\\\
local menuOptions = {\\\ local menuOptions = {\\\
\\\"Start Game\\\",\\\ \\\"Start Game\\\",\\\
\\\"How to Play\\\",\\\
\\\"Exit\\\"\\\ \\\"Exit\\\"\\\
}\\\ }\\\
local choice\\\ local choice\\\
@ -1929,6 +2077,8 @@ local titleScreen = function()\\\
if choice == 1 then\\\ if choice == 1 then\\\
parallel.waitForAny(startGame, getInput)\\\ parallel.waitForAny(startGame, getInput)\\\
elseif choice == 2 then\\\ elseif choice == 2 then\\\
howToPlay()\\\
elseif choice == 3 then\\\
return\\\ return\\\
end\\\ end\\\
end\\\ end\\\
@ -1990,9 +2140,9 @@ return {\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
\\\ \\\
act.stage.setDamage(info.x + info.direction, info.y - 1, 80, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y - 1, 80, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction, info.y + 1, 80, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y + 1, 80, info.owner, 1)\\\
\\\ \\\
return false\\\ return false\\\
end\\\ end\\\
@ -2012,11 +2162,11 @@ return {\\\
local maxFrames = 10\\\ local maxFrames = 10\\\
local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2\\\ local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2\\\
if parabola < 0.1 and info.frame > 3 then\\\ if parabola < 0.1 and info.frame > 3 then\\\
act.stage.setDamage(info.x, info.y - 1, 70, info.owner, 2, false)\\\ act.stage.setDamage(info.x, info.y - 1, 70, info.owner, 1, false)\\\
act.stage.setDamage(info.x, info.y, 70, info.owner, 2, false)\\\ act.stage.setDamage(info.x, info.y, 70, info.owner, 1, false)\\\
act.stage.setDamage(info.x, info.y + 1, 70, info.owner, 2, 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, 2, 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, 2, false)\\\ act.stage.setDamage(info.x + 1, info.y, 70, info.owner, 1, false)\\\
return false\\\ return false\\\
else\\\ else\\\
info.x = info.x + (maxDist / maxFrames) * info.direction\\\ info.x = info.x + (maxDist / maxFrames) * info.direction\\\
@ -2027,7 +2177,7 @@ return {\\\
[ \"ccbn-data/chipdata/recov150\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ [ \"ccbn-data/chipdata/recov150\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\
return {\\\ return {\\\
info = {\\\ info = {\\\
name = \\\"Recon150\\\",\\\ name = \\\"Recov150\\\",\\\
description = \\\"Gives you 150 health!\\\",\\\ description = \\\"Gives you 150 health!\\\",\\\
cooldown = {\\\ cooldown = {\\\
shoot = 6,\\\ shoot = 6,\\\
@ -2054,7 +2204,7 @@ return {\\\
local maxFrames = 10\\\ local maxFrames = 10\\\
local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2\\\ local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2\\\
if parabola < 0.1 and info.frame > 3 then\\\ if parabola < 0.1 and info.frame > 3 then\\\
act.stage.setDamage(info.x, info.y, 50, info.owner, 2, false)\\\ act.stage.setDamage(info.x, info.y, 50, info.owner, 1, false)\\\
return false\\\ return false\\\
else\\\ else\\\
info.x = info.x + (maxDist / maxFrames) * info.direction\\\ info.x = info.x + (maxDist / maxFrames) * info.direction\\\
@ -2065,7 +2215,7 @@ return {\\\
[ \"ccbn-data/chipdata/recov200\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ [ \"ccbn-data/chipdata/recov200\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\
return {\\\ return {\\\
info = {\\\ info = {\\\
name = \\\"Recon200\\\",\\\ name = \\\"Recov200\\\",\\\
description = \\\"Gives you 200 health!\\\",\\\ description = \\\"Gives you 200 health!\\\",\\\
cooldown = {\\\ cooldown = {\\\
shoot = 6,\\\ shoot = 6,\\\
@ -2117,12 +2267,12 @@ return {\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
\\\ \\\
act.stage.setDamage(info.x + info.direction, info.y - 1, 400, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y - 1, 400, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction * 2, info.y - 1, 400, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction * 2, info.y - 1, 400, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction, info.y, 400, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y, 400, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction * 2, info.y, 400, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction * 2, info.y, 400, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction, info.y + 1, 400, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y + 1, 400, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction * 2, info.y + 1, 400, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction * 2, info.y + 1, 400, info.owner, 1)\\\
\\\ \\\
return false\\\ return false\\\
end\\\ end\\\
@ -2138,23 +2288,23 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 40, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 40, info.owner, 1)\\\
\\\ \\\
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\ local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\
\\\ \\\
if info.frame > 50 or struckPlayer or struckObject then\\\ if info.frame > 50 or struckPlayer or struckObject then\\\
if struckPlayer then\\\ if struckPlayer then\\\
if act.player.movePlayer(struckPlayer, info.direction, 0, true) then\\\ if act.player.movePlayer(struckPlayer, info.direction, 0, true) then\\\
act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 1)\\\
end\\\ end\\\
elseif struckObject then\\\ elseif struckObject then\\\
if objects[struckObject].doYeet then\\\ if objects[struckObject].doYeet then\\\
objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\ objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\
else\\\ else\\\
if act.object.moveObject(struckObject, info.direction, 0) then\\\ if act.object.moveObject(struckObject, info.direction, 0) then\\\
act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 1)\\\
end\\\ end\\\
end\\\ end\\\
end\\\ end\\\
@ -2208,17 +2358,17 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 40, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 40, info.owner, 1)\\\
\\\ \\\
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\ local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\
\\\ \\\
if info.frame > 50 or struckPlayer or struckObject then\\\ if info.frame > 50 or struckPlayer or struckObject then\\\
if struckPlayer or struckObject then\\\ if struckPlayer or struckObject then\\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction, info.y - 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y - 1, 30, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction, info.y + 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y + 1, 30, info.owner, 1)\\\
end\\\ end\\\
return false\\\ return false\\\
else\\\ else\\\
@ -2253,7 +2403,7 @@ return {\\\
[ \"ccbn-data/chipdata/recov80\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ [ \"ccbn-data/chipdata/recov80\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\
return {\\\ return {\\\
info = {\\\ info = {\\\
name = \\\"Recon80\\\",\\\ name = \\\"Recov80\\\",\\\
description = \\\"Gives you 80 health!\\\",\\\ description = \\\"Gives you 80 health!\\\",\\\
cooldown = {\\\ cooldown = {\\\
shoot = 6,\\\ shoot = 6,\\\
@ -2276,23 +2426,23 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
\\\ \\\
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\ local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\
\\\ \\\
if info.frame > 50 or struckPlayer or struckObject then\\\ if info.frame > 50 or struckPlayer or struckObject then\\\
if struckPlayer then\\\ if struckPlayer then\\\
if act.player.movePlayer(struckPlayer, info.direction, 0, true) then\\\ if act.player.movePlayer(struckPlayer, info.direction, 0, true) then\\\
act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 1)\\\
end\\\ end\\\
elseif struckObject then\\\ elseif struckObject then\\\
if objects[struckObject].doYeet then\\\ if objects[struckObject].doYeet then\\\
objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\ objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\
else\\\ else\\\
if act.object.moveObject(struckObject, info.direction, 0) then\\\ if act.object.moveObject(struckObject, info.direction, 0) then\\\
act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 1)\\\
end\\\ end\\\
end\\\ end\\\
end\\\ end\\\
@ -2314,7 +2464,7 @@ return {\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
\\\ \\\
act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 1)\\\
\\\ \\\
return false\\\ return false\\\
end\\\ end\\\
@ -2322,7 +2472,7 @@ return {\\\
[ \"ccbn-data/chipdata/recov50\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ [ \"ccbn-data/chipdata/recov50\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\
return {\\\ return {\\\
info = {\\\ info = {\\\
name = \\\"Recon50\\\",\\\ name = \\\"Recov50\\\",\\\
description = \\\"Gives you 50 health!\\\",\\\ description = \\\"Gives you 50 health!\\\",\\\
cooldown = {\\\ cooldown = {\\\
shoot = 6,\\\ shoot = 6,\\\
@ -2372,7 +2522,7 @@ return {\\\
info.yadj = math.max(0, info.yadj - 0.5)\\\ info.yadj = math.max(0, info.yadj - 0.5)\\\
\\\ \\\
if info.yadj == 0 then\\\ if info.yadj == 0 then\\\
act.stage.setDamage(info.x, info.y, 80, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 80, info.owner, 1)\\\
if not act.player.checkPlayerAtPos(info.x, info.y) then\\\ if not act.player.checkPlayerAtPos(info.x, info.y) then\\\
stage.panels[info.y][info.x].owner = info.owner\\\ stage.panels[info.y][info.x].owner = info.owner\\\
stage.panels[info.y][info.x].cooldown.owner = 500\\\ stage.panels[info.y][info.x].cooldown.owner = 500\\\
@ -2394,9 +2544,9 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
\\\ \\\
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\ local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\
\\\ \\\
@ -2404,7 +2554,7 @@ return {\\\
if struckPlayer or struckObject then\\\ if struckPlayer or struckObject then\\\
for y = -1, 1 do\\\ for y = -1, 1 do\\\
for x = -1, 1 do\\\ for x = -1, 1 do\\\
act.stage.setDamage(info.x + x, info.y + y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + x, info.y + y, 30, info.owner, 1)\\\
end\\\ end\\\
end\\\ end\\\
end\\\ end\\\
@ -2426,9 +2576,9 @@ return {\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
\\\ \\\
act.stage.setDamage(info.x + info.direction, info.y, 100, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y, 100, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction * 2, info.y, 100, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction * 2, info.y, 100, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction * 3, info.y, 100, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction * 3, info.y, 100, info.owner, 1)\\\
\\\ \\\
return false\\\ return false\\\
end\\\ end\\\
@ -2472,7 +2622,7 @@ return {\\\
[ \"ccbn-data/chipdata/recov30\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ [ \"ccbn-data/chipdata/recov30\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\
return {\\\ return {\\\
info = {\\\ info = {\\\
name = \\\"Recon30\\\",\\\ name = \\\"Recov30\\\",\\\
description = \\\"Gives you 30 health!\\\",\\\ description = \\\"Gives you 30 health!\\\",\\\
cooldown = {\\\ cooldown = {\\\
shoot = 6,\\\ shoot = 6,\\\
@ -2525,7 +2675,7 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (3 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, info.player.busterPower or 1, info.owner, 1, true)\\\ act.stage.setDamage(info.x, info.y, info.player.busterPower or 1, info.owner, 1, true)\\\
\\\ \\\
@ -2549,16 +2699,16 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
\\\ \\\
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\ local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\
\\\ \\\
if info.frame > 50 or struckPlayer or struckObject then\\\ if info.frame > 50 or struckPlayer or struckObject then\\\
if struckPlayer or struckObject then\\\ if struckPlayer or struckObject then\\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 1)\\\
end\\\ end\\\
return false\\\ return false\\\
else\\\ else\\\
@ -2581,9 +2731,9 @@ return {\\\
local maxFrames = 10\\\ local maxFrames = 10\\\
local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2\\\ local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2\\\
if parabola < 0.1 and info.frame > 3 then\\\ if parabola < 0.1 and info.frame > 3 then\\\
act.stage.setDamage(info.x, info.y - 1, 50, info.owner, 2, false)\\\ act.stage.setDamage(info.x, info.y - 1, 50, info.owner, 1, false)\\\
act.stage.setDamage(info.x, info.y, 50, info.owner, 2, false)\\\ act.stage.setDamage(info.x, info.y, 50, info.owner, 1, false)\\\
act.stage.setDamage(info.x, info.y + 1, 50, info.owner, 2, false)\\\ act.stage.setDamage(info.x, info.y + 1, 50, info.owner, 1, false)\\\
return false\\\ return false\\\
else\\\ else\\\
info.x = info.x + (maxDist / maxFrames) * info.direction\\\ info.x = info.x + (maxDist / maxFrames) * info.direction\\\
@ -2635,7 +2785,7 @@ return {\\\
[ \"ccbn-data/chipdata/recov300\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ [ \"ccbn-data/chipdata/recov300\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\
return {\\\ return {\\\
info = {\\\ info = {\\\
name = \\\"Recon300\\\",\\\ name = \\\"Recov300\\\",\\\
description = \\\"Gives you 300 health!\\\",\\\ description = \\\"Gives you 300 health!\\\",\\\
cooldown = {\\\ cooldown = {\\\
shoot = 6,\\\ shoot = 6,\\\
@ -2675,17 +2825,17 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
\\\ \\\
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\ local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)\\\
\\\ \\\
if info.frame > 50 or struckPlayer or struckObject then\\\ if info.frame > 50 or struckPlayer or struckObject then\\\
if struckPlayer or struckObject then\\\ if struckPlayer or struckObject then\\\
act.stage.setDamage(info.x, info.y, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\
act.stage.setDamage(info.x, info.y - 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y - 1, 30, info.owner, 1)\\\
act.stage.setDamage(info.x, info.y + 1, 30, info.owner, 2)\\\ act.stage.setDamage(info.x, info.y + 1, 30, info.owner, 1)\\\
end\\\ end\\\
return false\\\ return false\\\
else\\\ else\\\
@ -2724,6 +2874,7 @@ return {\\\
if info.frame == 0 then\\\ if info.frame == 0 then\\\
if act.stage.checkIfSolid(info.x + info.direction, info.y) then\\\ if act.stage.checkIfSolid(info.x + info.direction, info.y) then\\\
info.panelType = stage.panels[info.y][info.x + info.direction].panelType\\\ 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)\\\ act.stage.crackPanel(info.x + info.direction, info.y, 2)\\\
info.x = info.x + info.direction\\\ info.x = info.x + info.direction\\\
else\\\ else\\\
@ -2821,8 +2972,8 @@ return {\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
\\\ \\\
act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 1)\\\
act.stage.setDamage(info.x + info.direction * 2, info.y, 80, info.owner, 4)\\\ act.stage.setDamage(info.x + info.direction * 2, info.y, 80, info.owner, 1)\\\
\\\ \\\
return false\\\ return false\\\
end\\\ end\\\
@ -2844,7 +2995,7 @@ return {\\\
if parabola < 0.1 and info.frame > 3 then\\\ if parabola < 0.1 and info.frame > 3 then\\\
for y = -1, 1 do\\\ for y = -1, 1 do\\\
for x = -1, 1 do\\\ for x = -1, 1 do\\\
act.stage.setDamage(info.x + x, info.y + y, 90, info.owner, 2, false)\\\ act.stage.setDamage(info.x + x, info.y + y, 90, info.owner, 1, false)\\\
end\\\ end\\\
end\\\ end\\\
return false\\\ return false\\\
@ -2902,7 +3053,7 @@ return {\\\
}\\\ }\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
info.x = info.x + (2 / stage.panelWidth) * info.direction\\\ info.x = info.x + (4 / stage.panelWidth) * info.direction\\\
\\\ \\\
act.stage.setDamage(info.x, info.y, info.altDamage or 40, info.owner, 1, info.noFlinch)\\\ act.stage.setDamage(info.x, info.y, info.altDamage or 40, info.owner, 1, info.noFlinch)\\\
\\\ \\\
@ -2927,7 +3078,7 @@ return {\\\
},\\\ },\\\
logic = function(info)\\\ logic = function(info)\\\
\\\ \\\
act.stage.setDamage(info.x + info.direction, info.y, math.min(info.player.maxHealth - info.player.health, 1000), info.owner, 2, false)\\\ act.stage.setDamage(info.x + info.direction, info.y, math.min(info.player.maxHealth - info.player.health, 1000), info.owner, 1, false)\\\
\\\ \\\
return false\\\ return false\\\
end\\\ end\\\
@ -2963,7 +3114,7 @@ return {\\\
[ \"ccbn-data/chipdata/recov120\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ [ \"ccbn-data/chipdata/recov120\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\
return {\\\ return {\\\
info = {\\\ info = {\\\
name = \\\"Recon120\\\",\\\ name = \\\"Recov120\\\",\\\
description = \\\"Gives you 120 health!\\\",\\\ description = \\\"Gives you 120 health!\\\",\\\
cooldown = {\\\ cooldown = {\\\
shoot = 6,\\\ shoot = 6,\\\

View File

@ -9,23 +9,23 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 20, info.owner, 2) act.stage.setDamage(info.x, info.y, 20, info.owner, 1)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info) local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
if info.frame > 50 or struckPlayer or struckObject then if info.frame > 50 or struckPlayer or struckObject then
if struckPlayer then if struckPlayer then
if act.player.movePlayer(struckPlayer, info.direction, 0, true) then if act.player.movePlayer(struckPlayer, info.direction, 0, true) then
act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 1)
end end
elseif struckObject then elseif struckObject then
if objects[struckObject].doYeet then if objects[struckObject].doYeet then
objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction
else else
if act.object.moveObject(struckObject, info.direction, 0) then if act.object.moveObject(struckObject, info.direction, 0) then
act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y, 20, info.owner, 1)
end end
end end
end end
@ -34,4 +34,4 @@ return {
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -9,23 +9,23 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info) local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
if info.frame > 50 or struckPlayer or struckObject then if info.frame > 50 or struckPlayer or struckObject then
if struckPlayer then if struckPlayer then
if act.player.movePlayer(struckPlayer, info.direction, 0, true) then if act.player.movePlayer(struckPlayer, info.direction, 0, true) then
act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 1)
end end
elseif struckObject then elseif struckObject then
if objects[struckObject].doYeet then if objects[struckObject].doYeet then
objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction
else else
if act.object.moveObject(struckObject, info.direction, 0) then if act.object.moveObject(struckObject, info.direction, 0) then
act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 1)
end end
end end
end end
@ -34,4 +34,4 @@ return {
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -9,23 +9,23 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 40, info.owner, 2) act.stage.setDamage(info.x, info.y, 40, info.owner, 1)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info) local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
if info.frame > 50 or struckPlayer or struckObject then if info.frame > 50 or struckPlayer or struckObject then
if struckPlayer then if struckPlayer then
if act.player.movePlayer(struckPlayer, info.direction, 0, true) then if act.player.movePlayer(struckPlayer, info.direction, 0, true) then
act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 1)
end end
elseif struckObject then elseif struckObject then
if objects[struckObject].doYeet then if objects[struckObject].doYeet then
objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction
else else
if act.object.moveObject(struckObject, info.direction, 0) then if act.object.moveObject(struckObject, info.direction, 0) then
act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y, 40, info.owner, 1)
end end
end end
end end
@ -34,4 +34,4 @@ return {
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -40,4 +40,4 @@ return {
return false return false
end end
} }

View File

@ -15,7 +15,7 @@ return {
if parabola < 0.1 and info.frame > 3 then if parabola < 0.1 and info.frame > 3 then
for y = -1, 1 do for y = -1, 1 do
for x = -1, 1 do for x = -1, 1 do
act.stage.setDamage(info.x + x, info.y + y, 90, info.owner, 2, false) act.stage.setDamage(info.x + x, info.y + y, 90, info.owner, 1, false)
end end
end end
return false return false
@ -24,4 +24,4 @@ return {
end end
return true, {{images.cannon, info.x, info.y - parabola}} return true, {{images.cannon, info.x, info.y - parabola}}
end end
} }

View File

@ -51,4 +51,4 @@ return {
act.stage.setDamage(info.x, info.y, 60, info.owner, 2, false, {}, info.safeObjects) act.stage.setDamage(info.x, info.y, 60, info.owner, 2, false, {}, info.safeObjects)
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
} }

View File

@ -9,7 +9,7 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (3 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, info.player.busterPower or 1, info.owner, 1, true) act.stage.setDamage(info.x, info.y, info.player.busterPower or 1, info.owner, 1, true)
@ -21,4 +21,4 @@ return {
return true, {{images.buster, info.x, info.y}} return true, {{images.buster, info.x, info.y}}
end end
end end
} }

View File

@ -14,4 +14,4 @@ return {
return false return false
end end
} }

View File

@ -9,7 +9,7 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, info.altDamage or 40, info.owner, 1, info.noFlinch) act.stage.setDamage(info.x, info.y, info.altDamage or 40, info.owner, 1, info.noFlinch)
@ -21,4 +21,4 @@ return {
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -14,4 +14,4 @@ return {
return false return false
end end
} }

View File

@ -13,15 +13,15 @@ return {
local maxFrames = 10 local maxFrames = 10
local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2 local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2
if parabola < 0.1 and info.frame > 3 then if parabola < 0.1 and info.frame > 3 then
act.stage.setDamage(info.x, info.y - 1, 70, info.owner, 2, false) act.stage.setDamage(info.x, info.y - 1, 70, info.owner, 1, false)
act.stage.setDamage(info.x, info.y, 70, info.owner, 2, false) act.stage.setDamage(info.x, info.y, 70, info.owner, 1, false)
act.stage.setDamage(info.x, info.y + 1, 70, info.owner, 2, 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, 2, 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, 2, false) act.stage.setDamage(info.x + 1, info.y, 70, info.owner, 1, false)
return false return false
else else
info.x = info.x + (maxDist / maxFrames) * info.direction info.x = info.x + (maxDist / maxFrames) * info.direction
end end
return true, {{images.cannon, info.x, info.y - parabola}} return true, {{images.cannon, info.x, info.y - parabola}}
end end
} }

View File

@ -9,7 +9,7 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 2)
@ -17,15 +17,15 @@ return {
if info.frame > 50 or struckPlayer or struckObject then if info.frame > 50 or struckPlayer or struckObject then
if struckPlayer or struckObject then if struckPlayer or struckObject then
act.stage.setDamage(info.x - 1, info.y - 1, 30, info.owner, 2) act.stage.setDamage(info.x - 1, info.y - 1, 30, info.owner, 1)
act.stage.setDamage(info.x + 1, info.y - 1, 30, info.owner, 2) act.stage.setDamage(info.x + 1, info.y - 1, 30, info.owner, 1)
act.stage.setDamage(info.x - 1, info.y + 1, 30, info.owner, 2) act.stage.setDamage(info.x - 1, info.y + 1, 30, info.owner, 1)
act.stage.setDamage(info.x + 1, info.y + 1, 30, info.owner, 2) act.stage.setDamage(info.x + 1, info.y + 1, 30, info.owner, 1)
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
end end
return false return false
else else
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -15,4 +15,4 @@ return {
return false return false
end end
} }

View File

@ -16,4 +16,4 @@ return {
return false return false
end end
} }

View File

@ -10,10 +10,10 @@ return {
}, },
logic = function(info) logic = function(info)
act.stage.setDamage(info.x + info.direction, info.y, 100, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y, 100, info.owner, 1)
act.stage.setDamage(info.x + info.direction * 2, info.y, 100, info.owner, 4) act.stage.setDamage(info.x + info.direction * 2, info.y, 100, info.owner, 1)
act.stage.setDamage(info.x + info.direction * 3, info.y, 100, info.owner, 4) act.stage.setDamage(info.x + info.direction * 3, info.y, 100, info.owner, 1)
return false return false
end end
} }

View File

@ -18,4 +18,4 @@ return {
return false return false
end end
} }

View File

@ -18,4 +18,4 @@ return {
return false return false
end end
} }

View File

@ -9,7 +9,7 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 60, info.owner, 1) act.stage.setDamage(info.x, info.y, 60, info.owner, 1)
@ -21,4 +21,4 @@ return {
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -12,4 +12,4 @@ return {
info.player.cooldown.iframe = 50 info.player.cooldown.iframe = 50
return false return false
end end
} }

View File

@ -10,13 +10,13 @@ return {
}, },
logic = function(info) logic = function(info)
act.stage.setDamage(info.x + info.direction, info.y - 1, 400, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y - 1, 400, info.owner, 1)
act.stage.setDamage(info.x + info.direction * 2, info.y - 1, 400, info.owner, 4) act.stage.setDamage(info.x + info.direction * 2, info.y - 1, 400, info.owner, 1)
act.stage.setDamage(info.x + info.direction, info.y, 400, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y, 400, info.owner, 1)
act.stage.setDamage(info.x + info.direction * 2, info.y, 400, info.owner, 4) act.stage.setDamage(info.x + info.direction * 2, info.y, 400, info.owner, 1)
act.stage.setDamage(info.x + info.direction, info.y + 1, 400, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y + 1, 400, info.owner, 1)
act.stage.setDamage(info.x + info.direction * 2, info.y + 1, 400, info.owner, 4) act.stage.setDamage(info.x + info.direction * 2, info.y + 1, 400, info.owner, 1)
return false return false
end end
} }

View File

@ -13,13 +13,13 @@ return {
local maxFrames = 10 local maxFrames = 10
local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2 local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2
if parabola < 0.1 and info.frame > 3 then if parabola < 0.1 and info.frame > 3 then
act.stage.setDamage(info.x, info.y - 1, 50, info.owner, 2, false) act.stage.setDamage(info.x, info.y - 1, 50, info.owner, 1, false)
act.stage.setDamage(info.x, info.y, 50, info.owner, 2, false) act.stage.setDamage(info.x, info.y, 50, info.owner, 1, false)
act.stage.setDamage(info.x, info.y + 1, 50, info.owner, 2, false) act.stage.setDamage(info.x, info.y + 1, 50, info.owner, 1, false)
return false return false
else else
info.x = info.x + (maxDist / maxFrames) * info.direction info.x = info.x + (maxDist / maxFrames) * info.direction
end end
return true, {{images.cannon, info.x, info.y - parabola}} return true, {{images.cannon, info.x, info.y - parabola}}
end end
} }

View File

@ -10,9 +10,9 @@ return {
}, },
logic = function(info) logic = function(info)
act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 1)
act.stage.setDamage(info.x + info.direction * 2, info.y, 80, info.owner, 4) act.stage.setDamage(info.x + info.direction * 2, info.y, 80, info.owner, 1)
return false return false
end end
} }

View File

@ -13,11 +13,11 @@ return {
local maxFrames = 10 local maxFrames = 10
local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2 local parabola = math.sin((math.pi / maxFrames) * info.frame) * 2
if parabola < 0.1 and info.frame > 3 then if parabola < 0.1 and info.frame > 3 then
act.stage.setDamage(info.x, info.y, 50, info.owner, 2, false) act.stage.setDamage(info.x, info.y, 50, info.owner, 1, false)
return false return false
else else
info.x = info.x + (maxDist / maxFrames) * info.direction info.x = info.x + (maxDist / maxFrames) * info.direction
end end
return true, {{images.cannon, info.x, info.y - parabola}} return true, {{images.cannon, info.x, info.y - parabola}}
end end
} }

View File

@ -10,8 +10,8 @@ return {
}, },
logic = function(info) logic = function(info)
act.stage.setDamage(info.x + info.direction, info.y, math.min(info.player.maxHealth - info.player.health, 1000), info.owner, 2, false) act.stage.setDamage(info.x + info.direction, info.y, math.min(info.player.maxHealth - info.player.health, 1000), info.owner, 1, false)
return false return false
end end
} }

View File

@ -21,7 +21,7 @@ return {
info.yadj = math.max(0, info.yadj - 0.5) info.yadj = math.max(0, info.yadj - 0.5)
if info.yadj == 0 then if info.yadj == 0 then
act.stage.setDamage(info.x, info.y, 80, info.owner, 2) act.stage.setDamage(info.x, info.y, 80, info.owner, 1)
if not act.player.checkPlayerAtPos(info.x, info.y) then if not act.player.checkPlayerAtPos(info.x, info.y) then
stage.panels[info.y][info.x].owner = info.owner stage.panels[info.y][info.x].owner = info.owner
stage.panels[info.y][info.x].cooldown.owner = 500 stage.panels[info.y][info.x].cooldown.owner = 500
@ -31,4 +31,4 @@ return {
return true, {{images.cannon, info.x, info.y - info.yadj}} return true, {{images.cannon, info.x, info.y - info.yadj}}
end end
} }

View File

@ -12,6 +12,7 @@ return {
if info.frame == 0 then if info.frame == 0 then
if act.stage.checkIfSolid(info.x + info.direction, info.y) then if act.stage.checkIfSolid(info.x + info.direction, info.y) then
info.panelType = stage.panels[info.y][info.x + info.direction].panelType 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) act.stage.crackPanel(info.x + info.direction, info.y, 2)
info.x = info.x + info.direction info.x = info.x + info.direction
else else
@ -32,4 +33,4 @@ return {
end end
return {{images.panel[info.panelType], info.x, info.y}} return {{images.panel[info.panelType], info.x, info.y}}
end end
} }

View File

@ -1,7 +1,7 @@
local stage, players, objects, projectiles, act, images = ... local stage, players, objects, projectiles, act, images = ...
return { return {
info = { info = {
name = "Recon120", name = "Recov120",
description = "Gives you 120 health!", description = "Gives you 120 health!",
cooldown = { cooldown = {
shoot = 6, shoot = 6,
@ -12,4 +12,4 @@ return {
info.player.health = math.min(info.player.health + 120, info.player.maxHealth) info.player.health = math.min(info.player.health + 120, info.player.maxHealth)
return false return false
end, end,
} }

View File

@ -1,7 +1,7 @@
local stage, players, objects, projectiles, act, images = ... local stage, players, objects, projectiles, act, images = ...
return { return {
info = { info = {
name = "Recon150", name = "Recov150",
description = "Gives you 150 health!", description = "Gives you 150 health!",
cooldown = { cooldown = {
shoot = 6, shoot = 6,
@ -12,4 +12,4 @@ return {
info.player.health = math.min(info.player.health + 150, info.player.maxHealth) info.player.health = math.min(info.player.health + 150, info.player.maxHealth)
return false return false
end, end,
} }

View File

@ -1,7 +1,7 @@
local stage, players, objects, projectiles, act, images = ... local stage, players, objects, projectiles, act, images = ...
return { return {
info = { info = {
name = "Recon200", name = "Recov200",
description = "Gives you 200 health!", description = "Gives you 200 health!",
cooldown = { cooldown = {
shoot = 6, shoot = 6,
@ -12,4 +12,4 @@ return {
info.player.health = math.min(info.player.health + 200, info.player.maxHealth) info.player.health = math.min(info.player.health + 200, info.player.maxHealth)
return false return false
end, end,
} }

View File

@ -1,7 +1,7 @@
local stage, players, objects, projectiles, act, images = ... local stage, players, objects, projectiles, act, images = ...
return { return {
info = { info = {
name = "Recon30", name = "Recov30",
description = "Gives you 30 health!", description = "Gives you 30 health!",
cooldown = { cooldown = {
shoot = 6, shoot = 6,
@ -12,4 +12,4 @@ return {
info.player.health = math.min(info.player.health + 30, info.player.maxHealth) info.player.health = math.min(info.player.health + 30, info.player.maxHealth)
return false return false
end, end,
} }

View File

@ -1,7 +1,7 @@
local stage, players, objects, projectiles, act, images = ... local stage, players, objects, projectiles, act, images = ...
return { return {
info = { info = {
name = "Recon300", name = "Recov300",
description = "Gives you 300 health!", description = "Gives you 300 health!",
cooldown = { cooldown = {
shoot = 6, shoot = 6,
@ -12,4 +12,4 @@ return {
info.player.health = math.min(info.player.health + 300, info.player.maxHealth) info.player.health = math.min(info.player.health + 300, info.player.maxHealth)
return false return false
end, end,
} }

View File

@ -1,7 +1,7 @@
local stage, players, objects, projectiles, act, images = ... local stage, players, objects, projectiles, act, images = ...
return { return {
info = { info = {
name = "Recon50", name = "Recov50",
description = "Gives you 50 health!", description = "Gives you 50 health!",
cooldown = { cooldown = {
shoot = 6, shoot = 6,
@ -12,4 +12,4 @@ return {
info.player.health = math.min(info.player.health + 50, info.player.maxHealth) info.player.health = math.min(info.player.health + 50, info.player.maxHealth)
return false return false
end, end,
} }

View File

@ -1,7 +1,7 @@
local stage, players, objects, projectiles, act, images = ... local stage, players, objects, projectiles, act, images = ...
return { return {
info = { info = {
name = "Recon80", name = "Recov80",
description = "Gives you 80 health!", description = "Gives you 80 health!",
cooldown = { cooldown = {
shoot = 6, shoot = 6,
@ -12,4 +12,4 @@ return {
info.player.health = math.min(info.player.health + 80, info.player.maxHealth) info.player.health = math.min(info.player.health + 80, info.player.maxHealth)
return false return false
end, end,
} }

View File

@ -9,20 +9,20 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info) local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
if info.frame > 50 or struckPlayer or struckObject then if info.frame > 50 or struckPlayer or struckObject then
if struckPlayer or struckObject then if struckPlayer or struckObject then
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y, 30, info.owner, 1)
end end
return false return false
else else
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -9,21 +9,21 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info) local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
if info.frame > 50 or struckPlayer or struckObject then if info.frame > 50 or struckPlayer or struckObject then
if struckPlayer or struckObject then if struckPlayer or struckObject then
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
act.stage.setDamage(info.x, info.y - 1, 30, info.owner, 2) act.stage.setDamage(info.x, info.y - 1, 30, info.owner, 1)
act.stage.setDamage(info.x, info.y + 1, 30, info.owner, 2) act.stage.setDamage(info.x, info.y + 1, 30, info.owner, 1)
end end
return false return false
else else
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -9,9 +9,9 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info) local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
@ -19,7 +19,7 @@ return {
if struckPlayer or struckObject then if struckPlayer or struckObject then
for y = -1, 1 do for y = -1, 1 do
for x = -1, 1 do for x = -1, 1 do
act.stage.setDamage(info.x + x, info.y + y, 30, info.owner, 2) act.stage.setDamage(info.x + x, info.y + y, 30, info.owner, 1)
end end
end end
end end
@ -28,4 +28,4 @@ return {
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -10,8 +10,8 @@ return {
}, },
logic = function(info) logic = function(info)
act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 1)
return false return false
end end
} }

View File

@ -9,21 +9,21 @@ return {
} }
}, },
logic = function(info) logic = function(info)
info.x = info.x + (2 / stage.panelWidth) * info.direction info.x = info.x + (4 / stage.panelWidth) * info.direction
act.stage.setDamage(info.x, info.y, 40, info.owner, 2) act.stage.setDamage(info.x, info.y, 40, info.owner, 1)
local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info) local struckPlayer, struckObject = act.projectile.checkProjectileCollisions(info)
if info.frame > 50 or struckPlayer or struckObject then if info.frame > 50 or struckPlayer or struckObject then
if struckPlayer or struckObject then if struckPlayer or struckObject then
act.stage.setDamage(info.x, info.y, 30, info.owner, 2) act.stage.setDamage(info.x, info.y, 30, info.owner, 1)
act.stage.setDamage(info.x + info.direction, info.y - 1, 30, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y - 1, 30, info.owner, 1)
act.stage.setDamage(info.x + info.direction, info.y + 1, 30, info.owner, 2) act.stage.setDamage(info.x + info.direction, info.y + 1, 30, info.owner, 1)
end end
return false return false
else else
return true, {{images.cannon, info.x, info.y}} return true, {{images.cannon, info.x, info.y}}
end end
end end
} }

View File

@ -10,10 +10,10 @@ return {
}, },
logic = function(info) logic = function(info)
act.stage.setDamage(info.x + info.direction, info.y - 1, 80, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y - 1, 80, info.owner, 1)
act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 1)
act.stage.setDamage(info.x + info.direction, info.y + 1, 80, info.owner, 4) act.stage.setDamage(info.x + info.direction, info.y + 1, 80, info.owner, 1)
return false return false
end end
} }

View File

@ -1,6 +1,9 @@
local scr_x, scr_y = term.getSize() local scr_x, scr_y = term.getSize()
local keysDown, miceDown = {}, {} local keysDown, miceDown = {}, {}
-- recommended at 0.1 for netplay, which you'll be doing all the time so yeah
local gameDelayInit = 0.1
local useAbsoluteMainDir = false local useAbsoluteMainDir = false
local config = { local config = {
@ -17,7 +20,8 @@ local game = {
customMax = 200, customMax = 200,
customSpeed = 1, customSpeed = 1,
inChipSelect = true, inChipSelect = true,
paused = false paused = false,
turnNumber = 0
} }
local you = 1 local you = 1
@ -28,9 +32,6 @@ for k,v in pairs(keys) do
revKeys[v] = k revKeys[v] = k
end end
-- recommended at 0.1 for netplay, which you'll be doing all the time so yeah
local gameDelayInit = 0.05
local gameID = math.random(0, 2^30) local gameID = math.random(0, 2^30)
local waitingForGame = false local waitingForGame = false
local isHost = true local isHost = true
@ -426,7 +427,7 @@ local images = {
local cwrite = function(text, y) local cwrite = function(text, y)
local cx, cy = term.getCursorPos() local cx, cy = term.getCursorPos()
term.setCursorPos(scr_x / 2 - #text / 2, y or (scr_y / 2)) term.setCursorPos(0.5 + scr_x / 2 - #text / 2, y or (scr_y / 2))
term.write(text) term.write(text)
end end
@ -516,7 +517,7 @@ act.stage.getDamage = function(x, y, pID, oID, pIDsafeCheck, oIDsafeCheck)
end end
local premadeFolders = { local premadeFolders = {
[1] = { -- BN2 starting folder, modified slightly [1] = {
{"cannon", "a"}, {"cannon", "a"},
{"cannon", "a"}, {"cannon", "a"},
{"hicannon", "b"}, {"hicannon", "b"},
@ -604,7 +605,7 @@ local premadeFolders = {
{"recov30", "l"}, {"recov30", "l"},
{"vulcan2", "c"}, {"vulcan2", "c"},
{"vulcan1", "c"}, {"vulcan1", "c"},
{"vulcan1", "c"}, {"boomer1", "c"},
{"geddon1", "f"}, {"geddon1", "f"},
{"shotgun", "d"}, {"shotgun", "d"},
{"shotgun", "d"}, {"shotgun", "d"},
@ -1035,6 +1036,8 @@ local render = function(extraImage)
buffer[#buffer + 1] = {makeRectangle(scr_x, scr_y, "f", "f", "f"), 1, 1} buffer[#buffer + 1] = {makeRectangle(scr_x, scr_y, "f", "f", "f"), 1, 1}
drawImage(colorSwap(merge(table.unpack(buffer)), {[" "] = "f"}), 1, 1) drawImage(colorSwap(merge(table.unpack(buffer)), {[" "] = "f"}), 1, 1)
term.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
if players[you] then if players[you] then
if chips[players[you].chipQueue[1]] then if chips[players[you].chipQueue[1]] then
term.setCursorPos(1, scr_y) term.setCursorPos(1, scr_y)
@ -1056,29 +1059,36 @@ local render = function(extraImage)
end end
end end
term.setTextColor(colors.white) if game.custom == game.customMax and FRAME % 16 <= 12 and not game.inChipSelect then
term.setBackgroundColor(colors.black)
if game.custom == game.customMax and FRAME % 8 <= 5 then
cwrite("PUSH '" .. revKeys[control.custom]:upper() .. "'!", 2) cwrite("PUSH '" .. revKeys[control.custom]:upper() .. "'!", 2)
end end
term.setBackgroundColor(colors.gray) term.setTextColor(colors.lightGray)
term.setCursorPos(6, 1) term.setCursorPos(6, 1)
term.write("[CUSTOM][") term.write("CUSTOM")
local barLength = scr_x - 20 term.setTextColor(colors.white)
term.write("[")
local barLength = scr_x - 18
if game.custom == game.customMax then if game.custom == game.customMax then
term.setTextColor(colors.gray)
term.setBackgroundColor(colors.lime) term.setBackgroundColor(colors.lime)
else else
term.setTextColor(colors.gray)
term.setBackgroundColor(colors.green) term.setBackgroundColor(colors.green)
end end
for i = 1, barLength do for i = 1, barLength do
if (i / barLength) <= (game.custom / game.customMax) then if (i / barLength) <= (game.custom / game.customMax) then
term.write("=") if game.custom == game.customMax then
term.write("@")
else
term.write("=")
end
else else
term.setBackgroundColor(colors.gray) term.setBackgroundColor(colors.black)
term.write(" ") term.write(" ")
end end
end end
term.setBackgroundColor(colors.gray) term.setTextColor(colors.white)
term.setBackgroundColor(colors.black)
term.write("]") term.write("]")
if showDebug then if showDebug then
@ -1089,6 +1099,8 @@ end
local getInput = function() local getInput = function()
local evt local evt
keysDown = {}
miceDown = {}
while true do while true do
evt = {os.pullEvent()} evt = {os.pullEvent()}
if evt[1] == "key" then if evt[1] == "key" then
@ -1147,7 +1159,7 @@ local chipSelectScreen = function()
term.setCursorPos(3, y) term.setCursorPos(3, y)
term.write((" "):rep(scr_x - 4)) term.write((" "):rep(scr_x - 4))
end end
cwrite(" Select Chips: ", 3) cwrite(" Turn " .. game.turnNumber .. ", Select Chips: ", 3)
term.setTextColor(colors.lightGray) term.setTextColor(colors.lightGray)
cwrite(" (Push '" .. revKeys[control.chip]:upper() .. "' to add / '" .. revKeys[control.buster]:upper() .. "' to remove) ", 4) cwrite(" (Push '" .. revKeys[control.chip]:upper() .. "' to add / '" .. revKeys[control.buster]:upper() .. "' to remove) ", 4)
cwrite(" (Push ENTER to confirm loadout) ", 5) cwrite(" (Push ENTER to confirm loadout) ", 5)
@ -1190,8 +1202,8 @@ local chipSelectScreen = function()
end end
local evt local evt
render()
while true do while true do
-- render()
renderMenu() renderMenu()
evt = {os.pullEvent()} evt = {os.pullEvent()}
if evt[1] == "key" then if evt[1] == "key" then
@ -1242,19 +1254,25 @@ local waitingForClientChipSelection = false
local runGame = function() local runGame = function()
local evt, getStateInfo local evt, getStateInfo
render() render()
sleep(0.5) sleep(0.35)
while true do while true do
FRAME = FRAME + 1 FRAME = FRAME + 1
render()
if game.inChipSelect then if game.inChipSelect then
game.turnNumber = game.turnNumber + 1
chipSelectScreen() chipSelectScreen()
if isHost then if isHost then
game.inChipSelect = false
game.custom = 0 game.custom = 0
local msg local msg
cwrite("Waiting...", scr_y - 3) render()
cwrite("Waiting for other player...", scr_y - 3)
transmit({
gameID = gameID,
command = "turn_ready",
pID = you,
})
repeat repeat
sleep(0) sleep(0)
until cliChipSelect until cliChipSelect
@ -1266,8 +1284,11 @@ local runGame = function()
transmit({ transmit({
gameID = gameID, gameID = gameID,
command = "turn_ready", command = "turn_ready",
pID = you, pID = 1,
}) })
term.clearLine()
cwrite("READY!", scr_y - 3)
sleep(0.5)
else else
transmit({ transmit({
gameID = gameID, gameID = gameID,
@ -1276,7 +1297,8 @@ local runGame = function()
chipQueue = players[you].chipQueue, chipQueue = players[you].chipQueue,
folder = players[you].folder, folder = players[you].folder,
}) })
cwrite("Waiting...", scr_y - 3) render()
cwrite("Waiting for other player...", scr_y - 3)
repeat repeat
msg = receive() msg = receive()
msg = type(msg) == "table" and msg or {} msg = type(msg) == "table" and msg or {}
@ -1285,11 +1307,14 @@ local runGame = function()
msg.command == "turn_ready" and msg.command == "turn_ready" and
players[msg.pID] players[msg.pID]
) )
term.clearLine()
cwrite("READY!", scr_y - 3)
sleep(0.5)
end end
game.inChipSelect = false
end end
if isHost then if isHost then
game.custom = math.min(game.customMax, game.custom + 1)
getControls() getControls()
for id, proj in pairs(projectiles) do for id, proj in pairs(projectiles) do
local success, imageData = chips[proj.chipType].logic(proj) local success, imageData = chips[proj.chipType].logic(proj)
@ -1379,14 +1404,15 @@ local runGame = function()
end end
end end
end end
reduceCooldowns()
movePlayers()
if players[you] then if players[you] then
if players[you].control.custom and game.custom == game.customMax then if players[you].control.custom and game.custom == game.customMax then
game.inChipSelect = true game.inChipSelect = true
end end
end end
render()
movePlayers()
sleep(gameDelayInit) sleep(gameDelayInit)
game.custom = math.min(game.customMax, game.custom + 1)
transmit({ transmit({
gameID = gameID, gameID = gameID,
command = "get_state", command = "get_state",
@ -1398,6 +1424,7 @@ local runGame = function()
stagePanels = stage.panels, stagePanels = stage.panels,
id = id id = id
}) })
reduceCooldowns()
else else
getControls() getControls()
if players[you] then if players[you] then
@ -1418,6 +1445,7 @@ local runGame = function()
}) })
end end
end end
render()
evt, getStateInfo = os.pullEvent("ccbn_get_state") evt, getStateInfo = os.pullEvent("ccbn_get_state")
players = getStateInfo.players players = getStateInfo.players
projectiles = getStateInfo.projectiles projectiles = getStateInfo.projectiles
@ -1623,9 +1651,129 @@ local makeMenu = function(x, y, options, _cpos)
end end
end end
local howToPlay = function()
local help = {
" (Scroll with mousewheel / arrows)",
" (Exit with 'Q')",
("="):rep(scr_x),
"",
" If you're not familiar with",
" Megaman Battle Network, buckle up.",
"",
" Battles are separated into 'turns'.",
" At the beginning of each turn, you",
" select one or more battlechips to use",
" during that turn.",
"",
" Selecting battlechips has certain rules.",
" Battlechips are given alphabetic codes",
" You can only pick two or more battlechips",
" that have the same code, or are of the same",
" chip type. That means you can pick a",
" Cannon A and a Minibomb A, but you can't",
" add an extra Cannon B without removing",
" the Minibomb B.",
" ____ ____ ____ ",
"| | | | | ^ | ",
"| "..revKeys[control.buster]:upper().." | | "..revKeys[control.chip]:upper().." | | | | ",
"|____| |____| |____| ",
" ____ ____ ____ ",
" | | | | | | | ",
" | <- | | V | | -> | ",
" |____| |____| |____| ",
"",
" To move, use the ARROW KEYS.",
" Fire the MegaBuster with '"..revKeys[control.buster]:upper().."'. It's a free",
" action, but not very strong.",
" Use the currently selected battlechip",
" (indicated in the bottom-left corner)",
" with '"..revKeys[control.chip]:upper().."'.",
"",
" Once you use up all your chips, you will",
" need to wait for the Custom bar to refill.",
" Once it is full, push '"..revKeys[control.custom]:upper().."' and the turn will",
" end, and you can pick more battlechips.",
"",
" Keep in mind that this erases all currently",
" loaded battlechips, and that the opponent",
" can also end the turn without warning, so",
" make sure that your battlechips are used",
" before the bar fills!",
"",
" ___________________________________",
" |yours|yours|yours|enemy|enemy|enemy|",
" |_____|_____|_____|_____|_____|_____|",
" |yours|yours|yours|enemy|enemy|enemy|",
" |_____|_____|_____|_____|_____|_____|",
" |yours|yours|yours|enemy|enemy|enemy|",
" |_____|_____|_____|_____|_____|_____|",
"",
" The stage that you stand on can also be",
" manipulated. Some chips, such as AreaGrab",
" can take away ownership of one or more",
" panels from the enemy for a short while.",
" Some chips, such as CrackShot, will break",
" panels, rendering them unusable for a short",
" while. Some chips will crack panels, such",
" as Geddon1. Stepping off of a cracked panel",
" will cause it to break.",
"",
" That's all I can think of. Sorry for all that",
" wall of text, and I hope you enjoy the game!",
"",
" ___ __ __ _ _ ",
"/ \\ | | | | | \\ | | | / \\ | / | ",
"| ___ | | | | | | | | | | |/\\ | ",
"\\__| |__| |__| |_/ |__ \\_/ \\_/ | \\ . ",
}
local scroll = 0
local maxScroll = #help - scr_y + 2
local rend = function(scroll)
term.setBackgroundColor(colors.black)
term.setTextColor(colors.white)
for y = 1, scr_y do
term.setCursorPos(1,y)
term.clearLine()
term.write(help[y + scroll] or "")
end
end
local evt
while true do
evt = {os.pullEvent()}
if evt[1] == "key" then
if evt[2] == keys.q then
return
elseif evt[2] == keys.up then
scroll = scroll - 1
elseif evt[2] == keys.down then
scroll = scroll + 1
elseif evt[2] == keys.pageUp then
scroll = scroll - scr_y
elseif evt[2] == keys.pageDown then
scroll = scroll + scr_y
elseif evt[2] == keys.home then
scroll = 0
elseif evt[2] == keys["end"] then
scroll = maxScroll
end
elseif evt[1] == "mouse_scroll" then
scroll = scroll + evt[2]
end
scroll = math.min(maxScroll, math.max(0, scroll))
rend(scroll)
end
sleep(0.1)
os.pullEvent("key")
end
local titleScreen = function() local titleScreen = function()
local menuOptions = { local menuOptions = {
"Start Game", "Start Game",
"How to Play",
"Exit" "Exit"
} }
local choice local choice
@ -1641,6 +1789,8 @@ local titleScreen = function()
if choice == 1 then if choice == 1 then
parallel.waitForAny(startGame, getInput) parallel.waitForAny(startGame, getInput)
elseif choice == 2 then elseif choice == 2 then
howToPlay()
elseif choice == 3 then
return return
end end
end end