diff --git a/CCBN/ccbn-autoextract.lua b/CCBN/ccbn-autoextract.lua index 6f203ab..76c2804 100644 --- a/CCBN/ccbn-autoextract.lua +++ b/CCBN/ccbn-autoextract.lua @@ -80,23 +80,23 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ if info.frame > 50 or struckPlayer or struckObject then\\\ if struckPlayer 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\\\ elseif struckObject then\\\ if objects[struckObject].doYeet then\\\ objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\ else\\\ 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\\\ @@ -171,7 +171,7 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ @@ -238,7 +238,7 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ @@ -246,11 +246,11 @@ return {\\\ \\\ if info.frame > 50 or 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, 2)\\\ - 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, 2)\\\ - act.stage.setDamage(info.x, info.y, 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, 1)\\\ + 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, 1)\\\ + act.stage.setDamage(info.x, info.y, 30, info.owner, 1)\\\ end\\\ return false\\\ else\\\ @@ -289,6 +289,9 @@ return {\\\ [ \"ccbn.lua\" ] = \"local scr_x, scr_y = term.getSize()\\\ 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 config = {\\\ @@ -305,7 +308,8 @@ local game = {\\\ customMax = 200,\\\ customSpeed = 1,\\\ inChipSelect = true,\\\ - paused = false\\\ + paused = false,\\\ + turnNumber = 0\\\ }\\\ \\\ local you = 1\\\ @@ -316,9 +320,6 @@ for k,v in pairs(keys) do\\\ revKeys[v] = k\\\ 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 waitingForGame = false\\\ local isHost = true\\\ @@ -714,7 +715,7 @@ local images = {\\\ \\\ local cwrite = function(text, y)\\\ 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)\\\ end\\\ \\\ @@ -804,7 +805,7 @@ act.stage.getDamage = function(x, y, pID, oID, pIDsafeCheck, oIDsafeCheck)\\\ end\\\ \\\ local premadeFolders = {\\\ - [1] = { -- BN2 starting folder, modified slightly\\\ + [1] = {\\\ {\\\"cannon\\\", \\\"a\\\"},\\\ {\\\"cannon\\\", \\\"a\\\"},\\\ {\\\"hicannon\\\", \\\"b\\\"},\\\ @@ -892,7 +893,7 @@ local premadeFolders = {\\\ {\\\"recov30\\\", \\\"l\\\"},\\\ {\\\"vulcan2\\\", \\\"c\\\"},\\\ {\\\"vulcan1\\\", \\\"c\\\"},\\\ - {\\\"vulcan1\\\", \\\"c\\\"},\\\ + {\\\"boomer1\\\", \\\"c\\\"},\\\ {\\\"geddon1\\\", \\\"f\\\"},\\\ {\\\"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}\\\ drawImage(colorSwap(merge(table.unpack(buffer)), {[\\\" \\\"] = \\\"f\\\"}), 1, 1)\\\ \\\ + term.setTextColor(colors.white)\\\ + term.setBackgroundColor(colors.black)\\\ if players[you] then\\\ if chips[players[you].chipQueue[1]] then\\\ term.setCursorPos(1, scr_y)\\\ @@ -1344,29 +1347,36 @@ local render = function(extraImage)\\\ end\\\ end\\\ \\\ - term.setTextColor(colors.white)\\\ - term.setBackgroundColor(colors.black)\\\ - if game.custom == game.customMax and FRAME % 8 <= 5 then\\\ + if game.custom == game.customMax and FRAME % 16 <= 12 and not game.inChipSelect then\\\ cwrite(\\\"PUSH '\\\" .. revKeys[control.custom]:upper() .. \\\"'!\\\", 2)\\\ end\\\ - term.setBackgroundColor(colors.gray)\\\ + term.setTextColor(colors.lightGray)\\\ term.setCursorPos(6, 1)\\\ - term.write(\\\"[CUSTOM][\\\")\\\ - local barLength = scr_x - 20\\\ + term.write(\\\"CUSTOM\\\")\\\ + term.setTextColor(colors.white)\\\ + term.write(\\\"[\\\")\\\ + local barLength = scr_x - 18\\\ if game.custom == game.customMax then\\\ + term.setTextColor(colors.gray)\\\ term.setBackgroundColor(colors.lime)\\\ else\\\ + term.setTextColor(colors.gray)\\\ term.setBackgroundColor(colors.green)\\\ end\\\ for i = 1, barLength do\\\ if (i / barLength) <= (game.custom / game.customMax) then\\\ - term.write(\\\"=\\\")\\\ + if game.custom == game.customMax then\\\ + term.write(\\\"@\\\")\\\ + else\\\ + term.write(\\\"=\\\")\\\ + end\\\ else\\\ - term.setBackgroundColor(colors.gray)\\\ + term.setBackgroundColor(colors.black)\\\ term.write(\\\" \\\")\\\ end\\\ end\\\ - term.setBackgroundColor(colors.gray)\\\ + term.setTextColor(colors.white)\\\ + term.setBackgroundColor(colors.black)\\\ term.write(\\\"]\\\")\\\ \\\ if showDebug then\\\ @@ -1377,6 +1387,8 @@ end\\\ \\\ local getInput = function()\\\ local evt\\\ + keysDown = {}\\\ + miceDown = {}\\\ while true do\\\ evt = {os.pullEvent()}\\\ if evt[1] == \\\"key\\\" then\\\ @@ -1435,7 +1447,7 @@ local chipSelectScreen = function()\\\ term.setCursorPos(3, y)\\\ term.write((\\\" \\\"):rep(scr_x - 4))\\\ end\\\ - cwrite(\\\" Select Chips: \\\", 3)\\\ + cwrite(\\\" Turn \\\" .. game.turnNumber .. \\\", Select Chips: \\\", 3)\\\ term.setTextColor(colors.lightGray)\\\ cwrite(\\\" (Push '\\\" .. revKeys[control.chip]:upper() .. \\\"' to add / '\\\" .. revKeys[control.buster]:upper() .. \\\"' to remove) \\\", 4)\\\ cwrite(\\\" (Push ENTER to confirm loadout) \\\", 5)\\\ @@ -1478,8 +1490,8 @@ local chipSelectScreen = function()\\\ end\\\ \\\ local evt\\\ + render()\\\ while true do\\\ --- render()\\\ renderMenu()\\\ evt = {os.pullEvent()}\\\ if evt[1] == \\\"key\\\" then\\\ @@ -1530,19 +1542,25 @@ local waitingForClientChipSelection = false\\\ local runGame = function()\\\ local evt, getStateInfo\\\ render()\\\ - sleep(0.5)\\\ + sleep(0.35)\\\ while true do\\\ FRAME = FRAME + 1\\\ -\\\ - render()\\\ \\\ if game.inChipSelect then\\\ + game.turnNumber = game.turnNumber + 1\\\ chipSelectScreen()\\\ if isHost then\\\ - game.inChipSelect = false\\\ game.custom = 0\\\ 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\\\ sleep(0)\\\ until cliChipSelect\\\ @@ -1554,8 +1572,11 @@ local runGame = function()\\\ transmit({\\\ gameID = gameID,\\\ command = \\\"turn_ready\\\",\\\ - pID = you,\\\ + pID = 1,\\\ })\\\ + term.clearLine()\\\ + cwrite(\\\"READY!\\\", scr_y - 3)\\\ + sleep(0.5)\\\ else\\\ transmit({\\\ gameID = gameID,\\\ @@ -1564,7 +1585,8 @@ local runGame = function()\\\ chipQueue = players[you].chipQueue,\\\ folder = players[you].folder,\\\ })\\\ - cwrite(\\\"Waiting...\\\", scr_y - 3)\\\ + render()\\\ + cwrite(\\\"Waiting for other player...\\\", scr_y - 3)\\\ repeat\\\ msg = receive()\\\ msg = type(msg) == \\\"table\\\" and msg or {}\\\ @@ -1573,11 +1595,14 @@ local runGame = function()\\\ msg.command == \\\"turn_ready\\\" and\\\ players[msg.pID]\\\ )\\\ + term.clearLine()\\\ + cwrite(\\\"READY!\\\", scr_y - 3)\\\ + sleep(0.5)\\\ end\\\ + game.inChipSelect = false\\\ end\\\ \\\ if isHost then\\\ - game.custom = math.min(game.customMax, game.custom + 1)\\\ getControls()\\\ for id, proj in pairs(projectiles) do\\\ local success, imageData = chips[proj.chipType].logic(proj)\\\ @@ -1667,14 +1692,15 @@ local runGame = function()\\\ end\\\ end\\\ end\\\ - reduceCooldowns()\\\ - movePlayers()\\\ if players[you] then\\\ if players[you].control.custom and game.custom == game.customMax then\\\ game.inChipSelect = true\\\ end\\\ end\\\ + render()\\\ + movePlayers()\\\ sleep(gameDelayInit)\\\ + game.custom = math.min(game.customMax, game.custom + 1)\\\ transmit({\\\ gameID = gameID,\\\ command = \\\"get_state\\\",\\\ @@ -1686,6 +1712,7 @@ local runGame = function()\\\ stagePanels = stage.panels,\\\ id = id\\\ })\\\ + reduceCooldowns()\\\ else\\\ getControls()\\\ if players[you] then\\\ @@ -1706,6 +1733,7 @@ local runGame = function()\\\ })\\\ end\\\ end\\\ + render()\\\ evt, getStateInfo = os.pullEvent(\\\"ccbn_get_state\\\")\\\ players = getStateInfo.players\\\ projectiles = getStateInfo.projectiles\\\ @@ -1911,9 +1939,129 @@ local makeMenu = function(x, y, options, _cpos)\\\ 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 menuOptions = {\\\ \\\"Start Game\\\",\\\ + \\\"How to Play\\\",\\\ \\\"Exit\\\"\\\ }\\\ local choice\\\ @@ -1929,6 +2077,8 @@ local titleScreen = function()\\\ if choice == 1 then\\\ parallel.waitForAny(startGame, getInput)\\\ elseif choice == 2 then\\\ + howToPlay()\\\ + elseif choice == 3 then\\\ return\\\ end\\\ end\\\ @@ -1990,9 +2140,9 @@ return {\\\ },\\\ 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, 80, info.owner, 4)\\\ - 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, 1)\\\ + act.stage.setDamage(info.x + info.direction, info.y + 1, 80, info.owner, 1)\\\ \\\ return false\\\ end\\\ @@ -2012,11 +2162,11 @@ return {\\\ 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, 2, false)\\\ - act.stage.setDamage(info.x, info.y, 70, info.owner, 2, false)\\\ - act.stage.setDamage(info.x, info.y + 1, 70, info.owner, 2, 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, 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, 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\\\ @@ -2027,7 +2177,7 @@ return {\\\ [ \"ccbn-data/chipdata/recov150\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ return {\\\ info = {\\\ - name = \\\"Recon150\\\",\\\ + name = \\\"Recov150\\\",\\\ description = \\\"Gives you 150 health!\\\",\\\ cooldown = {\\\ shoot = 6,\\\ @@ -2054,7 +2204,7 @@ return {\\\ 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, 50, info.owner, 2, false)\\\ + act.stage.setDamage(info.x, info.y, 50, info.owner, 1, false)\\\ return false\\\ else\\\ info.x = info.x + (maxDist / maxFrames) * info.direction\\\ @@ -2065,7 +2215,7 @@ return {\\\ [ \"ccbn-data/chipdata/recov200\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ return {\\\ info = {\\\ - name = \\\"Recon200\\\",\\\ + name = \\\"Recov200\\\",\\\ description = \\\"Gives you 200 health!\\\",\\\ cooldown = {\\\ shoot = 6,\\\ @@ -2117,12 +2267,12 @@ return {\\\ },\\\ logic = function(info)\\\ \\\ - act.stage.setDamage(info.x + info.direction, info.y - 1, 400, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction * 2, info.y - 1, 400, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction, info.y, 400, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction * 2, info.y, 400, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction, info.y + 1, 400, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction * 2, 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, 1)\\\ + 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, 1)\\\ + 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, 1)\\\ \\\ return false\\\ end\\\ @@ -2138,23 +2288,23 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ if info.frame > 50 or struckPlayer or struckObject then\\\ if struckPlayer 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\\\ elseif struckObject then\\\ if objects[struckObject].doYeet then\\\ objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\ else\\\ 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\\\ @@ -2208,17 +2358,17 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ if info.frame > 50 or 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.direction, info.y - 1, 30, info.owner, 2)\\\ - act.stage.setDamage(info.x + info.direction, info.y + 1, 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, 1)\\\ + act.stage.setDamage(info.x + info.direction, info.y + 1, 30, info.owner, 1)\\\ end\\\ return false\\\ else\\\ @@ -2253,7 +2403,7 @@ return {\\\ [ \"ccbn-data/chipdata/recov80\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ return {\\\ info = {\\\ - name = \\\"Recon80\\\",\\\ + name = \\\"Recov80\\\",\\\ description = \\\"Gives you 80 health!\\\",\\\ cooldown = {\\\ shoot = 6,\\\ @@ -2276,23 +2426,23 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ if info.frame > 50 or struckPlayer or struckObject then\\\ if struckPlayer 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\\\ elseif struckObject then\\\ if objects[struckObject].doYeet then\\\ objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction\\\ else\\\ 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\\\ @@ -2314,7 +2464,7 @@ return {\\\ },\\\ 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\\\ end\\\ @@ -2322,7 +2472,7 @@ return {\\\ [ \"ccbn-data/chipdata/recov50\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ return {\\\ info = {\\\ - name = \\\"Recon50\\\",\\\ + name = \\\"Recov50\\\",\\\ description = \\\"Gives you 50 health!\\\",\\\ cooldown = {\\\ shoot = 6,\\\ @@ -2372,7 +2522,7 @@ return {\\\ info.yadj = math.max(0, info.yadj - 0.5)\\\ \\\ 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\\\ stage.panels[info.y][info.x].owner = info.owner\\\ stage.panels[info.y][info.x].cooldown.owner = 500\\\ @@ -2394,9 +2544,9 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ @@ -2404,7 +2554,7 @@ return {\\\ if struckPlayer or struckObject then\\\ for y = -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\\\ @@ -2426,9 +2576,9 @@ return {\\\ },\\\ logic = function(info)\\\ \\\ - act.stage.setDamage(info.x + info.direction, info.y, 100, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction * 2, info.y, 100, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction * 3, 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, 1)\\\ + act.stage.setDamage(info.x + info.direction * 3, info.y, 100, info.owner, 1)\\\ \\\ return false\\\ end\\\ @@ -2472,7 +2622,7 @@ return {\\\ [ \"ccbn-data/chipdata/recov30\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ return {\\\ info = {\\\ - name = \\\"Recon30\\\",\\\ + name = \\\"Recov30\\\",\\\ description = \\\"Gives you 30 health!\\\",\\\ cooldown = {\\\ shoot = 6,\\\ @@ -2525,7 +2675,7 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ @@ -2549,16 +2699,16 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ if info.frame > 50 or 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.direction, 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, 1)\\\ end\\\ return false\\\ else\\\ @@ -2581,9 +2731,9 @@ return {\\\ 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, 50, info.owner, 2, false)\\\ - act.stage.setDamage(info.x, info.y, 50, info.owner, 2, 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)\\\ + act.stage.setDamage(info.x, info.y, 50, info.owner, 1, false)\\\ + act.stage.setDamage(info.x, info.y + 1, 50, info.owner, 1, false)\\\ return false\\\ else\\\ info.x = info.x + (maxDist / maxFrames) * info.direction\\\ @@ -2635,7 +2785,7 @@ return {\\\ [ \"ccbn-data/chipdata/recov300\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ return {\\\ info = {\\\ - name = \\\"Recon300\\\",\\\ + name = \\\"Recov300\\\",\\\ description = \\\"Gives you 300 health!\\\",\\\ cooldown = {\\\ shoot = 6,\\\ @@ -2675,17 +2825,17 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ if info.frame > 50 or 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 - 1, 30, info.owner, 2)\\\ - act.stage.setDamage(info.x, info.y + 1, 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, 1)\\\ + act.stage.setDamage(info.x, info.y + 1, 30, info.owner, 1)\\\ end\\\ return false\\\ else\\\ @@ -2724,6 +2874,7 @@ return {\\\ 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\\\ @@ -2821,8 +2972,8 @@ return {\\\ },\\\ logic = function(info)\\\ \\\ - act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4)\\\ - act.stage.setDamage(info.x + info.direction * 2, 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, 1)\\\ \\\ return false\\\ end\\\ @@ -2844,7 +2995,7 @@ return {\\\ if parabola < 0.1 and info.frame > 3 then\\\ for y = -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\\\ return false\\\ @@ -2902,7 +3053,7 @@ return {\\\ }\\\ },\\\ 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)\\\ \\\ @@ -2927,7 +3078,7 @@ return {\\\ },\\\ 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\\\ end\\\ @@ -2963,7 +3114,7 @@ return {\\\ [ \"ccbn-data/chipdata/recov120\" ] = \"local stage, players, objects, projectiles, act, images = ...\\\ return {\\\ info = {\\\ - name = \\\"Recon120\\\",\\\ + name = \\\"Recov120\\\",\\\ description = \\\"Gives you 120 health!\\\",\\\ cooldown = {\\\ shoot = 6,\\\ diff --git a/CCBN/ccbn-data/chipdata/airshot1 b/CCBN/ccbn-data/chipdata/airshot1 index 762c6c2..31bf31a 100644 --- a/CCBN/ccbn-data/chipdata/airshot1 +++ b/CCBN/ccbn-data/chipdata/airshot1 @@ -9,23 +9,23 @@ return { } }, 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) if info.frame > 50 or struckPlayer or struckObject then if struckPlayer 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 elseif struckObject then if objects[struckObject].doYeet then objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction else 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 @@ -34,4 +34,4 @@ return { return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/airshot2 b/CCBN/ccbn-data/chipdata/airshot2 index bdada75..cfc5afb 100644 --- a/CCBN/ccbn-data/chipdata/airshot2 +++ b/CCBN/ccbn-data/chipdata/airshot2 @@ -9,23 +9,23 @@ return { } }, 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) if info.frame > 50 or struckPlayer or struckObject then if struckPlayer 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 elseif struckObject then if objects[struckObject].doYeet then objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction else 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 @@ -34,4 +34,4 @@ return { return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/airshot3 b/CCBN/ccbn-data/chipdata/airshot3 index 761b4c9..3212f41 100644 --- a/CCBN/ccbn-data/chipdata/airshot3 +++ b/CCBN/ccbn-data/chipdata/airshot3 @@ -9,23 +9,23 @@ return { } }, 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) if info.frame > 50 or struckPlayer or struckObject then if struckPlayer 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 elseif struckObject then if objects[struckObject].doYeet then objects[struckObject].xvel = (4 / stage.panelWidth) * info.direction else 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 @@ -34,4 +34,4 @@ return { return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/areagrab b/CCBN/ccbn-data/chipdata/areagrab index f3972fd..cd13471 100644 --- a/CCBN/ccbn-data/chipdata/areagrab +++ b/CCBN/ccbn-data/chipdata/areagrab @@ -40,4 +40,4 @@ return { return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/bigbomb b/CCBN/ccbn-data/chipdata/bigbomb index abd1c11..683e6da 100644 --- a/CCBN/ccbn-data/chipdata/bigbomb +++ b/CCBN/ccbn-data/chipdata/bigbomb @@ -15,7 +15,7 @@ return { if parabola < 0.1 and info.frame > 3 then for y = -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 return false @@ -24,4 +24,4 @@ return { end return true, {{images.cannon, info.x, info.y - parabola}} end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/boomer1 b/CCBN/ccbn-data/chipdata/boomer1 index 534270e..3a771c5 100644 --- a/CCBN/ccbn-data/chipdata/boomer1 +++ b/CCBN/ccbn-data/chipdata/boomer1 @@ -51,4 +51,4 @@ return { act.stage.setDamage(info.x, info.y, 60, info.owner, 2, false, {}, info.safeObjects) return true, {{images.cannon, info.x, info.y}} end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/buster b/CCBN/ccbn-data/chipdata/buster index 1b6019b..4304962 100644 --- a/CCBN/ccbn-data/chipdata/buster +++ b/CCBN/ccbn-data/chipdata/buster @@ -9,7 +9,7 @@ return { } }, 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) @@ -21,4 +21,4 @@ return { return true, {{images.buster, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/busterup b/CCBN/ccbn-data/chipdata/busterup index 48f36ef..0cb2ad7 100644 --- a/CCBN/ccbn-data/chipdata/busterup +++ b/CCBN/ccbn-data/chipdata/busterup @@ -14,4 +14,4 @@ return { return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/cannon b/CCBN/ccbn-data/chipdata/cannon index 2ea54e5..54f9851 100644 --- a/CCBN/ccbn-data/chipdata/cannon +++ b/CCBN/ccbn-data/chipdata/cannon @@ -9,7 +9,7 @@ return { } }, 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) @@ -21,4 +21,4 @@ return { return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/crackout b/CCBN/ccbn-data/chipdata/crackout index 707d028..c3dab40 100644 --- a/CCBN/ccbn-data/chipdata/crackout +++ b/CCBN/ccbn-data/chipdata/crackout @@ -14,4 +14,4 @@ return { return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/crossbomb b/CCBN/ccbn-data/chipdata/crossbomb index 2cb872f..6172c87 100644 --- a/CCBN/ccbn-data/chipdata/crossbomb +++ b/CCBN/ccbn-data/chipdata/crossbomb @@ -13,15 +13,15 @@ return { 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, 2, false) - act.stage.setDamage(info.x, info.y, 70, info.owner, 2, false) - act.stage.setDamage(info.x, info.y + 1, 70, info.owner, 2, 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, 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, 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 -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/crossgun b/CCBN/ccbn-data/chipdata/crossgun index 18e2ea7..c73aaed 100644 --- a/CCBN/ccbn-data/chipdata/crossgun +++ b/CCBN/ccbn-data/chipdata/crossgun @@ -9,7 +9,7 @@ return { } }, 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) @@ -17,15 +17,15 @@ return { if info.frame > 50 or 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, 2) - 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, 2) - act.stage.setDamage(info.x, info.y, 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, 1) + 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, 1) + act.stage.setDamage(info.x, info.y, 30, info.owner, 1) end return false else return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/doublecrack b/CCBN/ccbn-data/chipdata/doublecrack index 78525b5..4c5c060 100644 --- a/CCBN/ccbn-data/chipdata/doublecrack +++ b/CCBN/ccbn-data/chipdata/doublecrack @@ -15,4 +15,4 @@ return { return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/doubleshot b/CCBN/ccbn-data/chipdata/doubleshot index 71122bb..cf9b233 100644 --- a/CCBN/ccbn-data/chipdata/doubleshot +++ b/CCBN/ccbn-data/chipdata/doubleshot @@ -16,4 +16,4 @@ return { return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/fightersword b/CCBN/ccbn-data/chipdata/fightersword index 58c4222..e4fcb40 100644 --- a/CCBN/ccbn-data/chipdata/fightersword +++ b/CCBN/ccbn-data/chipdata/fightersword @@ -10,10 +10,10 @@ return { }, logic = function(info) - act.stage.setDamage(info.x + info.direction, info.y, 100, info.owner, 4) - act.stage.setDamage(info.x + info.direction * 2, info.y, 100, info.owner, 4) - act.stage.setDamage(info.x + info.direction * 3, 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, 1) + act.stage.setDamage(info.x + info.direction * 3, info.y, 100, info.owner, 1) return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/geddon1 b/CCBN/ccbn-data/chipdata/geddon1 index de51dcf..9f38d49 100644 --- a/CCBN/ccbn-data/chipdata/geddon1 +++ b/CCBN/ccbn-data/chipdata/geddon1 @@ -18,4 +18,4 @@ return { return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/geddon2 b/CCBN/ccbn-data/chipdata/geddon2 index 41663f3..edf0d07 100644 --- a/CCBN/ccbn-data/chipdata/geddon2 +++ b/CCBN/ccbn-data/chipdata/geddon2 @@ -18,4 +18,4 @@ return { return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/hicannon b/CCBN/ccbn-data/chipdata/hicannon index 61269e8..09be2d3 100644 --- a/CCBN/ccbn-data/chipdata/hicannon +++ b/CCBN/ccbn-data/chipdata/hicannon @@ -9,7 +9,7 @@ return { } }, 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) @@ -21,4 +21,4 @@ return { return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/invis b/CCBN/ccbn-data/chipdata/invis index b515418..46b9580 100644 --- a/CCBN/ccbn-data/chipdata/invis +++ b/CCBN/ccbn-data/chipdata/invis @@ -12,4 +12,4 @@ return { info.player.cooldown.iframe = 50 return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/lifesword b/CCBN/ccbn-data/chipdata/lifesword index caef1cb..4c1657b 100644 --- a/CCBN/ccbn-data/chipdata/lifesword +++ b/CCBN/ccbn-data/chipdata/lifesword @@ -10,13 +10,13 @@ return { }, logic = function(info) - act.stage.setDamage(info.x + info.direction, info.y - 1, 400, info.owner, 4) - act.stage.setDamage(info.x + info.direction * 2, info.y - 1, 400, info.owner, 4) - act.stage.setDamage(info.x + info.direction, info.y, 400, info.owner, 4) - act.stage.setDamage(info.x + info.direction * 2, info.y, 400, info.owner, 4) - act.stage.setDamage(info.x + info.direction, info.y + 1, 400, info.owner, 4) - act.stage.setDamage(info.x + info.direction * 2, 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, 1) + 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, 1) + 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, 1) return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/lilbomb b/CCBN/ccbn-data/chipdata/lilbomb index 0977c65..ee6a3f5 100644 --- a/CCBN/ccbn-data/chipdata/lilbomb +++ b/CCBN/ccbn-data/chipdata/lilbomb @@ -13,13 +13,13 @@ return { 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, 50, info.owner, 2, false) - act.stage.setDamage(info.x, info.y, 50, info.owner, 2, 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) + act.stage.setDamage(info.x, info.y, 50, info.owner, 1, false) + act.stage.setDamage(info.x, info.y + 1, 50, 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 -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/longsword b/CCBN/ccbn-data/chipdata/longsword index b62470b..69a898a 100644 --- a/CCBN/ccbn-data/chipdata/longsword +++ b/CCBN/ccbn-data/chipdata/longsword @@ -10,9 +10,9 @@ return { }, logic = function(info) - act.stage.setDamage(info.x + info.direction, info.y, 80, info.owner, 4) - act.stage.setDamage(info.x + info.direction * 2, 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, 1) return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/minibomb b/CCBN/ccbn-data/chipdata/minibomb index 8c493bb..489ea1f 100644 --- a/CCBN/ccbn-data/chipdata/minibomb +++ b/CCBN/ccbn-data/chipdata/minibomb @@ -13,11 +13,11 @@ return { 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, 50, info.owner, 2, false) + act.stage.setDamage(info.x, info.y, 50, 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 -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/muramasa b/CCBN/ccbn-data/chipdata/muramasa index a345113..d638dfe 100644 --- a/CCBN/ccbn-data/chipdata/muramasa +++ b/CCBN/ccbn-data/chipdata/muramasa @@ -10,8 +10,8 @@ return { }, 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 end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/panelgrab_internal b/CCBN/ccbn-data/chipdata/panelgrab_internal index ade9f95..f3a5310 100644 --- a/CCBN/ccbn-data/chipdata/panelgrab_internal +++ b/CCBN/ccbn-data/chipdata/panelgrab_internal @@ -21,7 +21,7 @@ return { info.yadj = math.max(0, info.yadj - 0.5) 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 stage.panels[info.y][info.x].owner = info.owner stage.panels[info.y][info.x].cooldown.owner = 500 @@ -31,4 +31,4 @@ return { return true, {{images.cannon, info.x, info.y - info.yadj}} end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/panelshot b/CCBN/ccbn-data/chipdata/panelshot index 49f60d8..63c8c4f 100644 --- a/CCBN/ccbn-data/chipdata/panelshot +++ b/CCBN/ccbn-data/chipdata/panelshot @@ -12,6 +12,7 @@ return { 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 @@ -32,4 +33,4 @@ return { end return {{images.panel[info.panelType], info.x, info.y}} end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/recov120 b/CCBN/ccbn-data/chipdata/recov120 index 466fa93..7f70610 100644 --- a/CCBN/ccbn-data/chipdata/recov120 +++ b/CCBN/ccbn-data/chipdata/recov120 @@ -1,7 +1,7 @@ local stage, players, objects, projectiles, act, images = ... return { info = { - name = "Recon120", + name = "Recov120", description = "Gives you 120 health!", cooldown = { shoot = 6, @@ -12,4 +12,4 @@ return { info.player.health = math.min(info.player.health + 120, info.player.maxHealth) return false end, -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/recov150 b/CCBN/ccbn-data/chipdata/recov150 index 1a93d38..c6f6fa9 100644 --- a/CCBN/ccbn-data/chipdata/recov150 +++ b/CCBN/ccbn-data/chipdata/recov150 @@ -1,7 +1,7 @@ local stage, players, objects, projectiles, act, images = ... return { info = { - name = "Recon150", + name = "Recov150", description = "Gives you 150 health!", cooldown = { shoot = 6, @@ -12,4 +12,4 @@ return { info.player.health = math.min(info.player.health + 150, info.player.maxHealth) return false end, -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/recov200 b/CCBN/ccbn-data/chipdata/recov200 index 609c3fd..5322e8e 100644 --- a/CCBN/ccbn-data/chipdata/recov200 +++ b/CCBN/ccbn-data/chipdata/recov200 @@ -1,7 +1,7 @@ local stage, players, objects, projectiles, act, images = ... return { info = { - name = "Recon200", + name = "Recov200", description = "Gives you 200 health!", cooldown = { shoot = 6, @@ -12,4 +12,4 @@ return { info.player.health = math.min(info.player.health + 200, info.player.maxHealth) return false end, -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/recov30 b/CCBN/ccbn-data/chipdata/recov30 index 2778495..b5cfaa4 100644 --- a/CCBN/ccbn-data/chipdata/recov30 +++ b/CCBN/ccbn-data/chipdata/recov30 @@ -1,7 +1,7 @@ local stage, players, objects, projectiles, act, images = ... return { info = { - name = "Recon30", + name = "Recov30", description = "Gives you 30 health!", cooldown = { shoot = 6, @@ -12,4 +12,4 @@ return { info.player.health = math.min(info.player.health + 30, info.player.maxHealth) return false end, -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/recov300 b/CCBN/ccbn-data/chipdata/recov300 index cb1bbe0..19be9ce 100644 --- a/CCBN/ccbn-data/chipdata/recov300 +++ b/CCBN/ccbn-data/chipdata/recov300 @@ -1,7 +1,7 @@ local stage, players, objects, projectiles, act, images = ... return { info = { - name = "Recon300", + name = "Recov300", description = "Gives you 300 health!", cooldown = { shoot = 6, @@ -12,4 +12,4 @@ return { info.player.health = math.min(info.player.health + 300, info.player.maxHealth) return false end, -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/recov50 b/CCBN/ccbn-data/chipdata/recov50 index 8356a4a..c829cf5 100644 --- a/CCBN/ccbn-data/chipdata/recov50 +++ b/CCBN/ccbn-data/chipdata/recov50 @@ -1,7 +1,7 @@ local stage, players, objects, projectiles, act, images = ... return { info = { - name = "Recon50", + name = "Recov50", description = "Gives you 50 health!", cooldown = { shoot = 6, @@ -12,4 +12,4 @@ return { info.player.health = math.min(info.player.health + 50, info.player.maxHealth) return false end, -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/recov80 b/CCBN/ccbn-data/chipdata/recov80 index 08e9805..ba2d5b3 100644 --- a/CCBN/ccbn-data/chipdata/recov80 +++ b/CCBN/ccbn-data/chipdata/recov80 @@ -1,7 +1,7 @@ local stage, players, objects, projectiles, act, images = ... return { info = { - name = "Recon80", + name = "Recov80", description = "Gives you 80 health!", cooldown = { shoot = 6, @@ -12,4 +12,4 @@ return { info.player.health = math.min(info.player.health + 80, info.player.maxHealth) return false end, -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/shotgun b/CCBN/ccbn-data/chipdata/shotgun index 3e081f1..8eb5622 100644 --- a/CCBN/ccbn-data/chipdata/shotgun +++ b/CCBN/ccbn-data/chipdata/shotgun @@ -9,20 +9,20 @@ return { } }, 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) if info.frame > 50 or 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.direction, 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, 1) end return false else return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/sidegun b/CCBN/ccbn-data/chipdata/sidegun index 6a3bfaa..bf8ac60 100644 --- a/CCBN/ccbn-data/chipdata/sidegun +++ b/CCBN/ccbn-data/chipdata/sidegun @@ -9,21 +9,21 @@ return { } }, 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) if info.frame > 50 or 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 - 1, 30, info.owner, 2) - act.stage.setDamage(info.x, info.y + 1, 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, 1) + act.stage.setDamage(info.x, info.y + 1, 30, info.owner, 1) end return false else return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/spreader b/CCBN/ccbn-data/chipdata/spreader index b05020b..0cb2355 100644 --- a/CCBN/ccbn-data/chipdata/spreader +++ b/CCBN/ccbn-data/chipdata/spreader @@ -9,9 +9,9 @@ return { } }, 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) @@ -19,7 +19,7 @@ return { if struckPlayer or struckObject then for y = -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 @@ -28,4 +28,4 @@ return { return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/sword b/CCBN/ccbn-data/chipdata/sword index 6dc67b8..9c5c06b 100644 --- a/CCBN/ccbn-data/chipdata/sword +++ b/CCBN/ccbn-data/chipdata/sword @@ -10,8 +10,8 @@ return { }, 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 end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/vgun b/CCBN/ccbn-data/chipdata/vgun index 95d1de2..1e855d6 100644 --- a/CCBN/ccbn-data/chipdata/vgun +++ b/CCBN/ccbn-data/chipdata/vgun @@ -9,21 +9,21 @@ return { } }, 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) if info.frame > 50 or 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.direction, info.y - 1, 30, info.owner, 2) - act.stage.setDamage(info.x + info.direction, info.y + 1, 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, 1) + act.stage.setDamage(info.x + info.direction, info.y + 1, 30, info.owner, 1) end return false else return true, {{images.cannon, info.x, info.y}} end end -} \ No newline at end of file +} diff --git a/CCBN/ccbn-data/chipdata/widesword b/CCBN/ccbn-data/chipdata/widesword index 646d1fa..5addfdb 100644 --- a/CCBN/ccbn-data/chipdata/widesword +++ b/CCBN/ccbn-data/chipdata/widesword @@ -10,10 +10,10 @@ return { }, 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, 80, info.owner, 4) - 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, 1) + act.stage.setDamage(info.x + info.direction, info.y + 1, 80, info.owner, 1) return false end -} \ No newline at end of file +} diff --git a/CCBN/ccbn.lua b/CCBN/ccbn.lua index b26b786..d82fe93 100644 --- a/CCBN/ccbn.lua +++ b/CCBN/ccbn.lua @@ -1,6 +1,9 @@ local scr_x, scr_y = term.getSize() 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 config = { @@ -17,7 +20,8 @@ local game = { customMax = 200, customSpeed = 1, inChipSelect = true, - paused = false + paused = false, + turnNumber = 0 } local you = 1 @@ -28,9 +32,6 @@ for k,v in pairs(keys) do revKeys[v] = k 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 waitingForGame = false local isHost = true @@ -426,7 +427,7 @@ local images = { local cwrite = function(text, y) 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) end @@ -516,7 +517,7 @@ act.stage.getDamage = function(x, y, pID, oID, pIDsafeCheck, oIDsafeCheck) end local premadeFolders = { - [1] = { -- BN2 starting folder, modified slightly + [1] = { {"cannon", "a"}, {"cannon", "a"}, {"hicannon", "b"}, @@ -604,7 +605,7 @@ local premadeFolders = { {"recov30", "l"}, {"vulcan2", "c"}, {"vulcan1", "c"}, - {"vulcan1", "c"}, + {"boomer1", "c"}, {"geddon1", "f"}, {"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} drawImage(colorSwap(merge(table.unpack(buffer)), {[" "] = "f"}), 1, 1) + term.setTextColor(colors.white) + term.setBackgroundColor(colors.black) if players[you] then if chips[players[you].chipQueue[1]] then term.setCursorPos(1, scr_y) @@ -1056,29 +1059,36 @@ local render = function(extraImage) end end - term.setTextColor(colors.white) - term.setBackgroundColor(colors.black) - if game.custom == game.customMax and FRAME % 8 <= 5 then + if game.custom == game.customMax and FRAME % 16 <= 12 and not game.inChipSelect then cwrite("PUSH '" .. revKeys[control.custom]:upper() .. "'!", 2) end - term.setBackgroundColor(colors.gray) + term.setTextColor(colors.lightGray) term.setCursorPos(6, 1) - term.write("[CUSTOM][") - local barLength = scr_x - 20 + term.write("CUSTOM") + term.setTextColor(colors.white) + term.write("[") + local barLength = scr_x - 18 if game.custom == game.customMax then + term.setTextColor(colors.gray) term.setBackgroundColor(colors.lime) else + term.setTextColor(colors.gray) term.setBackgroundColor(colors.green) end for i = 1, barLength do if (i / barLength) <= (game.custom / game.customMax) then - term.write("=") + if game.custom == game.customMax then + term.write("@") + else + term.write("=") + end else - term.setBackgroundColor(colors.gray) + term.setBackgroundColor(colors.black) term.write(" ") end end - term.setBackgroundColor(colors.gray) + term.setTextColor(colors.white) + term.setBackgroundColor(colors.black) term.write("]") if showDebug then @@ -1089,6 +1099,8 @@ end local getInput = function() local evt + keysDown = {} + miceDown = {} while true do evt = {os.pullEvent()} if evt[1] == "key" then @@ -1147,7 +1159,7 @@ local chipSelectScreen = function() term.setCursorPos(3, y) term.write((" "):rep(scr_x - 4)) end - cwrite(" Select Chips: ", 3) + cwrite(" Turn " .. game.turnNumber .. ", Select Chips: ", 3) term.setTextColor(colors.lightGray) cwrite(" (Push '" .. revKeys[control.chip]:upper() .. "' to add / '" .. revKeys[control.buster]:upper() .. "' to remove) ", 4) cwrite(" (Push ENTER to confirm loadout) ", 5) @@ -1190,8 +1202,8 @@ local chipSelectScreen = function() end local evt + render() while true do --- render() renderMenu() evt = {os.pullEvent()} if evt[1] == "key" then @@ -1242,19 +1254,25 @@ local waitingForClientChipSelection = false local runGame = function() local evt, getStateInfo render() - sleep(0.5) + sleep(0.35) while true do FRAME = FRAME + 1 - render() - if game.inChipSelect then + game.turnNumber = game.turnNumber + 1 chipSelectScreen() if isHost then - game.inChipSelect = false game.custom = 0 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 sleep(0) until cliChipSelect @@ -1266,8 +1284,11 @@ local runGame = function() transmit({ gameID = gameID, command = "turn_ready", - pID = you, + pID = 1, }) + term.clearLine() + cwrite("READY!", scr_y - 3) + sleep(0.5) else transmit({ gameID = gameID, @@ -1276,7 +1297,8 @@ local runGame = function() chipQueue = players[you].chipQueue, folder = players[you].folder, }) - cwrite("Waiting...", scr_y - 3) + render() + cwrite("Waiting for other player...", scr_y - 3) repeat msg = receive() msg = type(msg) == "table" and msg or {} @@ -1285,11 +1307,14 @@ local runGame = function() msg.command == "turn_ready" and players[msg.pID] ) + term.clearLine() + cwrite("READY!", scr_y - 3) + sleep(0.5) end + game.inChipSelect = false end if isHost then - game.custom = math.min(game.customMax, game.custom + 1) getControls() for id, proj in pairs(projectiles) do local success, imageData = chips[proj.chipType].logic(proj) @@ -1379,14 +1404,15 @@ local runGame = function() end end end - reduceCooldowns() - movePlayers() if players[you] then if players[you].control.custom and game.custom == game.customMax then game.inChipSelect = true end end + render() + movePlayers() sleep(gameDelayInit) + game.custom = math.min(game.customMax, game.custom + 1) transmit({ gameID = gameID, command = "get_state", @@ -1398,6 +1424,7 @@ local runGame = function() stagePanels = stage.panels, id = id }) + reduceCooldowns() else getControls() if players[you] then @@ -1418,6 +1445,7 @@ local runGame = function() }) end end + render() evt, getStateInfo = os.pullEvent("ccbn_get_state") players = getStateInfo.players projectiles = getStateInfo.projectiles @@ -1623,9 +1651,129 @@ local makeMenu = function(x, y, options, _cpos) 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 menuOptions = { "Start Game", + "How to Play", "Exit" } local choice @@ -1641,6 +1789,8 @@ local titleScreen = function() if choice == 1 then parallel.waitForAny(startGame, getInput) elseif choice == 2 then + howToPlay() + elseif choice == 3 then return end end