Minified and repackaged files.

This commit is contained in:
Robbie Antenesse 2016-05-18 15:50:46 -06:00
parent af99529e12
commit e3d87dd869
16 changed files with 15 additions and 15 deletions

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
function mapGUI(){Oversimplified.DEBUG.showMessages&&console.log("Ran mapGUI()")}function drawMapGUI(){if(guiControl.map&&guiControl.map.show){guiControl.map.activateDelay-=guiControl.map.activateDelay>0?1:0,OS.context.drawImage(guiControl.background,0,0,240,240,pixel(2),pixel(2),240,240),guiControl.drawPixelText("Map",guiControl.leftBorder+pixel(10),guiControl.topOfBackground,8,"black",6),guiControl.drawPageArrow("left",pixel(4),guiControl.topOfBackground),guiControl.drawPageArrow("right",OS.camera.width-pixel(4)-pixel(4),guiControl.topOfBackground);var o=OS.context.fillStyle,t=guiControl.leftBorder-pixel(5),l=guiControl.upperBorder;OS.context.fillStyle="#0000CC",OS.context.fillRect(t,l,pixel(50),pixel(45)),OS.context.fillStyle="#00FF00";for(var e=0;e<G.map.length;e++){var i=t+pixel(G.map[e].drawX),r=l+pixel(G.map[e].drawY);OS.context.fillRect(i,r,pixel(),pixel())}OS.context.fillStyle="#FF0000",OS.context.fillRect(t+G.player.mapX,l+G.player.mapY,pixel(),pixel()),OS.context.fillStyle=o,guiControl.map.activateDelay<=0&&((ct_confirm().down||ct_cancel().down||ct_m.down)&&(snd_cursorup.Play(),guiControl.map.show=!1),ct_left().down&&(snd_cursordown.Play(),guiControl.map.show=!1,guiControl.inventory.activateDelay=5,guiControl.inventory.show=!0),ct_right().down&&(snd_cursordown.Play(),guiControl.map.show=!1,guiControl.inventory.activateDelay=5,guiControl.inventory.show=!0))}}guiControl.map={show:!1,activateDelay:0};
function mapGUI(){guiControl.map={show:!1,activateDelay:0}}function drawMapGUI(){if(guiControl.map&&guiControl.map.show){guiControl.map.activateDelay-=guiControl.map.activateDelay>0?1:0,OS.context.drawImage(guiControl.background,0,0,240,240,pixel(2),pixel(2),240,240),guiControl.drawPixelText("Map",guiControl.leftBorder+pixel(10),guiControl.topOfBackground,8,"black",6),guiControl.drawPageArrow("left",pixel(4),guiControl.topOfBackground),guiControl.drawPageArrow("right",OS.camera.width-pixel(4)-pixel(4),guiControl.topOfBackground);var o=OS.context.fillStyle,t=guiControl.leftBorder-pixel(5),l=guiControl.upperBorder;OS.context.fillStyle="#0000CC",OS.context.fillRect(t,l,pixel(50),pixel(45)),OS.context.fillStyle="#00FF00";for(var e=0;e<G.map.length;e++){var r=t+pixel(G.map[e].drawX),i=l+pixel(G.map[e].drawY);OS.context.fillRect(r,i,pixel(),pixel())}OS.context.fillStyle="#FF0000",OS.context.fillRect(t+G.player.mapX,l+G.player.mapY,pixel(),pixel()),OS.context.fillStyle=o,guiControl.map.activateDelay<=0&&((ct_confirm().down||ct_cancel().down||ct_m.down)&&(snd_cursorup.Play(),guiControl.map.show=!1),ct_left().down&&(snd_cursordown.Play(),guiControl.map.show=!1,guiControl.inventory.activateDelay=5,guiControl.inventory.show=!0),ct_right().down&&(snd_cursordown.Play(),guiControl.map.show=!1,guiControl.inventory.activateDelay=5,guiControl.inventory.show=!0))}}

View File

@ -1 +1 @@
function titleScreen(){Oversimplified.DEBUG.showMessages&&console.log("Ran titleScreen()")}function drawTitleScreen(){if(guiControl.title&&guiControl.title.show)if(guiControl.title.activateDelay-=guiControl.title.activateDelay>0?1:0,"main"==guiControl.title.screen){if(ct_down().down&&(snd_cursordown.Play(),guiControl.title.cursorPosition++),ct_up().down&&(snd_cursordown.Play(),guiControl.title.cursorPosition--),guiControl.title.cursorPosition<0&&(guiControl.title.cursorPosition=2),guiControl.title.cursorPosition>2&&(guiControl.title.cursorPosition=0),OS.context.drawImage(guiControl.titleImage,0,0),guiControl.drawPixelText("New Game",guiControl.title.leftBorder,guiControl.title.rowTop(0),10,"white",6),guiControl.drawPixelText("Continue",guiControl.title.leftBorder,guiControl.title.rowTop(1),10,G.savedGameExists?"white":"black",6),guiControl.drawPixelText("Options",guiControl.title.leftBorder,guiControl.title.rowTop(2)+pixel(),8,guiControl.optionsScreen?"white":"black",6),OS.context.drawImage(guiControl.cursor,guiControl.title.leftBorder-guiControl.iconScaled,guiControl.title.rowTop(guiControl.title.cursorPosition)),guiControl.title.activateDelay<=0){if(ct_confirm().down){switch(guiControl.title.cursorPosition){case 0:snd_select.Play(),mus_title.Stop(),mus_sail.Play(),guiControl.title.show=!1,G.gameStarted=!0,G.SaveGame();break;case 1:G.savedGameExists?(G.LoadGame(),snd_select.Play(),mus_title.Stop(),mus_sail.Play(),guiControl.title.show=!1,G.gameStarted=!0):snd_cannotbuy.Play();break;case 2:snd_cannotbuy.Play()}guiControl.title.cursorPosition=0}ct_cancel().down&&(guiControl.title.screen="credits")}}else"credits"==guiControl.title.screen&&(guiControl.drawPixelText("Credits",guiControl.title.leftBorder-pixel(),pixel(2),0,"white",6),guiControl.drawPixelText("Music, Icons",pixel(),pixel(11),0,"white",4),guiControl.drawPixelText("Paws Menu",pixel(2),pixel(17),0,"yellow",6),guiControl.drawPixelText("paws.bandcamp.com",pixel(2),pixel(25),0,"yellow",4),guiControl.drawPixelText("Evrthng Else",pixel(),pixel(39),0,"white",4),guiControl.drawPixelText("Alamantus",pixel(2),pixel(45),0,"yellow",6),guiControl.drawPixelText("alamantus.com",pixel(2),pixel(53),0,"yellow",4),(ct_confirm().down||ct_cancel().down||ct_esc.down)&&(guiControl.title.screen="main"))}guiControl.title={screen:"main",show:!0,cursorPosition:0,activateDelay:0,padding:pixel(2),leftBorder:pixel(12),rowTop:function(t){return pixel(32)+pixel(2)+pixel((guiControl.iconSize+2)*t)}};
function titleScreen(){guiControl.title={screen:"main",show:!0,cursorPosition:0,activateDelay:0,padding:pixel(2),leftBorder:pixel(12),rowTop:function(t){return pixel(32)+pixel(2)+pixel((guiControl.iconSize+2)*t)}}}function drawTitleScreen(){if(guiControl.title&&guiControl.title.show)if(guiControl.title.activateDelay-=guiControl.title.activateDelay>0?1:0,"main"==guiControl.title.screen){if(ct_down().down&&(snd_cursordown.Play(),guiControl.title.cursorPosition++),ct_up().down&&(snd_cursordown.Play(),guiControl.title.cursorPosition--),guiControl.title.cursorPosition<0&&(guiControl.title.cursorPosition=2),guiControl.title.cursorPosition>2&&(guiControl.title.cursorPosition=0),OS.context.drawImage(guiControl.titleImage,0,0),guiControl.drawPixelText("New Game",guiControl.title.leftBorder,guiControl.title.rowTop(0),10,"white",6),guiControl.drawPixelText("Continue",guiControl.title.leftBorder,guiControl.title.rowTop(1),10,G.savedGameExists?"white":"black",6),guiControl.drawPixelText("Options",guiControl.title.leftBorder,guiControl.title.rowTop(2)+pixel(),8,guiControl.optionsScreen?"white":"black",6),OS.context.drawImage(guiControl.cursor,guiControl.title.leftBorder-guiControl.iconScaled,guiControl.title.rowTop(guiControl.title.cursorPosition)),guiControl.title.activateDelay<=0){if(ct_confirm().down){switch(guiControl.title.cursorPosition){case 0:snd_select.Play(),mus_title.Stop(),mus_sail.Play(),guiControl.title.show=!1,G.gameStarted=!0,G.SaveGame();break;case 1:G.savedGameExists?(G.LoadGame(),snd_select.Play(),mus_title.Stop(),mus_sail.Play(),guiControl.title.show=!1,G.gameStarted=!0):snd_cannotbuy.Play();break;case 2:snd_cannotbuy.Play()}guiControl.title.cursorPosition=0}ct_cancel().down&&(guiControl.title.screen="credits")}}else"credits"==guiControl.title.screen&&(guiControl.drawPixelText("Credits",guiControl.title.leftBorder-pixel(),pixel(2),0,"white",6),guiControl.drawPixelText("Music, Icons",pixel(),pixel(11),0,"white",4),guiControl.drawPixelText("Paws Menu",pixel(2),pixel(17),0,"yellow",6),guiControl.drawPixelText("paws.bandcamp.com",pixel(2),pixel(25),0,"yellow",4),guiControl.drawPixelText("Evrthng Else",pixel(),pixel(39),0,"white",4),guiControl.drawPixelText("Alamantus",pixel(2),pixel(45),0,"yellow",6),guiControl.drawPixelText("alamantus.com",pixel(2),pixel(53),0,"yellow",4),(ct_confirm().down||ct_cancel().down||ct_esc.down)&&(guiControl.title.screen="main"))}

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
function loadAudio(){Oversimplified.DEBUG.showMessages&&console.log("Ran loadAudio()")}var mus_title=new OS.E.AddTune("Title",{mp3:"audio/music/title.mp3",wav:"audio/music/title.wav"}),mus_sail=new OS.E.AddTune("Sailing",{mp3:"audio/music/ocean.mp3",wav:"audio/music/ocean.wav"}),mus_trade=new OS.E.AddTune("Trade",{mp3:"audio/music/trade.mp3",wav:"audio/music/trade.wav"}),mus_credits=new OS.E.AddTune("Credits",{mp3:"audio/music/credits.mp3",wav:"audio/music/credits.wav"}),snd_buy=new OS.E.AddSound("Buy",{wav:"audio/sounds/Buy.wav",mp3:"audio/sounds/Buy.mp3"}),snd_cannotbuy=new OS.E.AddSound("Cannot Buy",{wav:"audio/sounds/Cannot_Buy.wav",mp3:"audio/sounds/Cannot_Buy.mp3"}),snd_heal=new OS.E.AddSound("Heal",{wav:"audio/sounds/Heal.wav",mp3:"audio/sounds/Heal.mp3"}),snd_illness=new OS.E.AddSound("Illness",{wav:"audio/sounds/Illness.wav",mp3:"audio/sounds/Illness.mp3"}),snd_cursordown=new OS.E.AddSound("Move Cursor Down",{wav:"audio/sounds/Move_Cursor.wav",mp3:"audio/sounds/Move_Cursor.mp3"}),snd_cursorup=new OS.E.AddSound("Move Cursor Up",{wav:"audio/sounds/Move_Cursor_Up.wav",mp3:"audio/sounds/Move_Cursor_Up.mp3"}),snd_sailing=new OS.E.AddSound("Sailing",{wav:"audio/sounds/Sailing.wav",mp3:"audio/sounds/Sailing.mp3"}),snd_select=new OS.E.AddSound("Select",{wav:"audio/sounds/Select.wav",mp3:"audio/sounds/Select.mp3"}),snd_sell=new OS.E.AddSound("Sell",{wav:"audio/sounds/Sell.wav",mp3:"audio/sounds/Sell.mp3"}),snd_wave=new OS.E.AddSound("Wave Crash",{wav:"audio/sounds/Wave_Crash.wav",mp3:"audio/sounds/Wave_Crash.mp3"});
function loadAudio(){}var mus_title=new OS.E.AddTune("Title",{mp3:"audio/music/title.mp3",wav:"audio/music/title.wav"}),mus_sail=new OS.E.AddTune("Sailing",{mp3:"audio/music/ocean.mp3",wav:"audio/music/ocean.wav"}),mus_trade=new OS.E.AddTune("Trade",{mp3:"audio/music/trade.mp3",wav:"audio/music/trade.wav"}),mus_credits=new OS.E.AddTune("Credits",{mp3:"audio/music/credits.mp3",wav:"audio/music/credits.wav"}),snd_buy=new OS.E.AddSound("Buy",{wav:"audio/sounds/Buy.wav",mp3:"audio/sounds/Buy.mp3"}),snd_cannotbuy=new OS.E.AddSound("Cannot Buy",{wav:"audio/sounds/Cannot_Buy.wav",mp3:"audio/sounds/Cannot_Buy.mp3"}),snd_heal=new OS.E.AddSound("Heal",{wav:"audio/sounds/Heal.wav",mp3:"audio/sounds/Heal.mp3"}),snd_illness=new OS.E.AddSound("Illness",{wav:"audio/sounds/Illness.wav",mp3:"audio/sounds/Illness.mp3"}),snd_cursordown=new OS.E.AddSound("Move Cursor Down",{wav:"audio/sounds/Move_Cursor.wav",mp3:"audio/sounds/Move_Cursor.mp3"}),snd_cursorup=new OS.E.AddSound("Move Cursor Up",{wav:"audio/sounds/Move_Cursor_Up.wav",mp3:"audio/sounds/Move_Cursor_Up.mp3"}),snd_sailing=new OS.E.AddSound("Sailing",{wav:"audio/sounds/Sailing.wav",mp3:"audio/sounds/Sailing.mp3"}),snd_select=new OS.E.AddSound("Select",{wav:"audio/sounds/Select.wav",mp3:"audio/sounds/Select.mp3"}),snd_sell=new OS.E.AddSound("Sell",{wav:"audio/sounds/Sell.wav",mp3:"audio/sounds/Sell.mp3"}),snd_wave=new OS.E.AddSound("Wave Crash",{wav:"audio/sounds/Wave_Crash.wav",mp3:"audio/sounds/Wave_Crash.mp3"});

View File

@ -1 +1 @@
function loadControls(){Oversimplified.DEBUG.showMessages&&console.log("Ran loadControls()")}function ct_up(){return{held:ct_wasd_up.held||ct_arrow_up.held,down:ct_wasd_up.down||ct_arrow_up.down,up:ct_wasd_up.up||ct_arrow_up.up}}function ct_left(){return{held:ct_wasd_left.held||ct_arrow_left.held,down:ct_wasd_left.down||ct_arrow_left.down,up:ct_wasd_left.up||ct_arrow_left.up}}function ct_down(){return{held:ct_wasd_down.held||ct_arrow_down.held,down:ct_wasd_down.down||ct_arrow_down.down,up:ct_wasd_down.up||ct_arrow_down.up}}function ct_right(){return{held:ct_wasd_right.held||ct_arrow_right.held,down:ct_wasd_right.down||ct_arrow_right.down,up:ct_wasd_right.up||ct_arrow_right.up}}function ct_confirm(){return{held:ct_space.held||ct_z.held,down:ct_space.down||ct_z.down,up:ct_space.up||ct_z.up}}function ct_cancel(){return{held:ct_shift.held||ct_x.held,down:ct_shift.down||ct_x.down,up:ct_shift.up||ct_x.up}}var ct_wasd_up=OS.C.Add("WASD Up",OS.Keycode.w),ct_wasd_left=OS.C.Add("WASD Left",OS.Keycode.a),ct_wasd_down=OS.C.Add("WASD Down",OS.Keycode.s),ct_wasd_right=OS.C.Add("WASD Right",OS.Keycode.d),ct_arrow_up=OS.C.Add("Arrow Up",OS.Keycode.up),ct_arrow_left=OS.C.Add("Arrow Left",OS.Keycode.left),ct_arrow_down=OS.C.Add("Arrow Down",OS.Keycode.down),ct_arrow_right=OS.C.Add("Arrow Right",OS.Keycode.right),ct_shift=OS.C.Add("Shift",OS.Keycode.shift),ct_space=OS.C.Add("Space",OS.Keycode.space),ct_z=OS.C.Add("Z",OS.Keycode.z),ct_x=OS.C.Add("X",OS.Keycode.x),ct_m=OS.C.Add("M",OS.Keycode.m),ct_esc=OS.C.Add("Cancel",OS.Keycode.escape);
function loadControls(){}function ct_up(){return{held:ct_wasd_up.held||ct_arrow_up.held,down:ct_wasd_up.down||ct_arrow_up.down,up:ct_wasd_up.up||ct_arrow_up.up}}function ct_left(){return{held:ct_wasd_left.held||ct_arrow_left.held,down:ct_wasd_left.down||ct_arrow_left.down,up:ct_wasd_left.up||ct_arrow_left.up}}function ct_down(){return{held:ct_wasd_down.held||ct_arrow_down.held,down:ct_wasd_down.down||ct_arrow_down.down,up:ct_wasd_down.up||ct_arrow_down.up}}function ct_right(){return{held:ct_wasd_right.held||ct_arrow_right.held,down:ct_wasd_right.down||ct_arrow_right.down,up:ct_wasd_right.up||ct_arrow_right.up}}function ct_confirm(){return{held:ct_space.held||ct_z.held,down:ct_space.down||ct_z.down,up:ct_space.up||ct_z.up}}function ct_cancel(){return{held:ct_shift.held||ct_x.held,down:ct_shift.down||ct_x.down,up:ct_shift.up||ct_x.up}}var ct_wasd_up=OS.C.Add("WASD Up",OS.Keycode.w),ct_wasd_left=OS.C.Add("WASD Left",OS.Keycode.a),ct_wasd_down=OS.C.Add("WASD Down",OS.Keycode.s),ct_wasd_right=OS.C.Add("WASD Right",OS.Keycode.d),ct_arrow_up=OS.C.Add("Arrow Up",OS.Keycode.up),ct_arrow_left=OS.C.Add("Arrow Left",OS.Keycode.left),ct_arrow_down=OS.C.Add("Arrow Down",OS.Keycode.down),ct_arrow_right=OS.C.Add("Arrow Right",OS.Keycode.right),ct_shift=OS.C.Add("Shift",OS.Keycode.shift),ct_space=OS.C.Add("Space",OS.Keycode.space),ct_z=OS.C.Add("Z",OS.Keycode.z),ct_x=OS.C.Add("X",OS.Keycode.x),ct_m=OS.C.Add("M",OS.Keycode.m),ct_esc=OS.C.Add("Cancel",OS.Keycode.escape);

View File

@ -1 +1 @@
function loadGameManager(){for(var e=0;e<G.economy.cargoItemWorth.length;e++)G.economy.cargoItemWorth[e]+=Math.round(Math.randomRange(-5,5));Oversimplified.DEBUG.showMessages&&console.log("Ran loadGameManager()")}var Game={};G=Game,G.gameStarted=!1,G.savedGameExists=!!OS.Load("TradeWindsSave"),G.player={},G.oceanParticle={},G.map=[],G.currentScreen="",G.inventory={money:100,supplies:20,cargo:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],moneyDisplay:function(){var e="";return G.inventory.money>=1e6&&(e=G.inventory.money.toString().substr(0,1),parseInt(G.inventory.money.toString().substr(1,1))>0&&(e+="."+G.inventory.money.toString().substr(1,1))),G.inventory.money>=1e12?e+="T":G.inventory.money>=1e9?e+="B":G.inventory.money>=1e6?e+="M":e=G.inventory.money.toString(),e},CheckCargo:function(){for(var e=[],n=0;n<G.inventory.cargo.length;n++)G.inventory.cargo[n]>0&&e.push(n);return e},CargoTotal:function(){for(var e=G.inventory.CheckCargo(),n=0,a=0;a<e.length;a++)n+=G.inventory.cargo[e[a]];return n},CanBuy:function(e,n){return G.inventory.cargo[e]<G.stats.hold&&G.inventory.money>n&&(G.inventory.cargo[e]>0||G.inventory.CheckCargo().length<G.stats.inventory)},CanSell:function(e){return G.inventory.cargo[e]>0}},G.stats={inventory:3,hold:20,speed:1,hull:3,maxHull:3,popularity:5,haggling:10,crew:2,energy:25,maxEnergy:50,illness:0},G.economy={innCost:50,innStays:0,cargoItemWorth:[10,20,30,30,40,20,50,80,65,20,20,30,30,60,45,70],cargoSold:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],cargoBought:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],UpdateEconomy:function(){for(var e=0;e<G.economy.cargoItemWorth.length;e++){for(var n=0,a=0;a<G.map.length;a++)n+=G.map[a].island.priceDifferences[e];G.economy.cargoItemWorth[e]+=Math.round(n/G.map.length)}for(var t=0,a=0;a<G.map.length;a++)t+=G.map[a].island.innPriceDifference;G.economy.innCost+=Math.round(t/G.map.length)}},G.SaveGame=function(){for(var e={playerX:G.player.x,playerY:G.player.y,money:G.inventory.money,supplies:G.inventory.supplies,cargo:G.inventory.cargo.slice(),stats:{inventory:G.stats.inventory,hold:G.stats.hold,speed:G.stats.speed,hull:G.stats.hull,maxHull:G.stats.maxHull,popularity:G.stats.popularity,haggling:G.stats.haggling,crew:G.stats.crew,energy:G.stats.energy,maxEnergy:G.stats.maxEnergy,illness:G.stats.illness},economy:{innCost:G.economy.innCost,innStays:G.economy.innStays,itemWorth:G.economy.cargoItemWorth.slice(),cargoSold:G.economy.cargoSold.slice(),cargoBought:G.economy.cargoBought.slice()},map:[]},n=0;n<G.map.length;n++)e.map.push({drawX:G.map[n].drawX,drawY:G.map[n].drawY,drawWidth:G.map[n].drawWidth,drawHeight:G.map[n].drawHeight,inventory:G.map[n].island.inventory.slice(),innPriceDifference:G.map[n].island.innPriceDifference,innStays:G.map[n].island.innStays,priceDifferences:G.map[n].island.priceDifferences.slice(),itemsSold:G.map[n].island.itemsSold.slice(),itemsBought:G.map[n].island.itemsBought.slice()});OS.Save("TradeWindsSave",JSON.stringify(e))&&console.log("Game Saved!")},G.LoadGame=function(){var e=OS.Load("TradeWindsSave");if(!e)return console.log("Could not load game!"),!1;e=JSON.parse(e),G.player.x=e.playerX,G.player.y=e.playerY,G.inventory.money=e.money,G.inventory.supplies=e.supplies,G.inventory.cargo=e.cargo.slice(),G.stats.inventory=e.stats.inventory,G.stats.hold=e.stats.hold,G.stats.speed=e.stats.speed,G.stats.hull=e.stats.hull,G.stats.maxHull=e.stats.maxHull,G.stats.popularity=e.stats.popularity,G.stats.haggling=e.stats.haggling,G.stats.crew=e.stats.crew,G.stats.energy=e.stats.energy,G.stats.maxEnergy=e.stats.maxEnergy,G.stats.illness=e.stats.illness,G.economy.innCost=e.economy.innCost,G.economy.innStays=e.economy.innStays,G.economy.cargoItemWorth=e.economy.itemWorth.slice(),G.economy.cargoSold=e.economy.cargoSold.slice(),G.economy.cargoBought=e.economy.cargoBought.slice();for(var n=0;n<e.map.length;n++)G.map[n].drawX=e.map[n].drawX,G.map[n].drawY=e.map[n].drawY,G.map[n].drawWidth=e.map[n].drawWidth,G.map[n].drawHeight=e.map[n].drawHeight,G.map[n].island.x=rm_Ocean.squareSize*e.map[n].drawX,G.map[n].island.y=rm_Ocean.squareSize*e.map[n].drawY,G.map[n].island.inventory=e.map[n].inventory.slice(),G.map[n].island.innPriceDifference=e.map[n].innPriceDifference,G.map[n].island.innStays=e.map[n].innStays,G.map[n].island.priceDifferences=e.map[n].priceDifferences.slice(),G.map[n].island.itemsSold=e.map[n].itemsSold.slice(),G.map[n].island.itemsBought=e.map[n].itemsBought.slice();e=null,console.log("Game Loaded!")};
function loadGameManager(){for(var e=0;e<G.economy.cargoItemWorth.length;e++)G.economy.cargoItemWorth[e]+=Math.round(Math.randomRange(-5,5))}var Game={};G=Game,G.gameStarted=!1,G.savedGameExists=!!OS.Load("TradeWindsSave"),G.player={},G.oceanParticle={},G.map=[],G.currentScreen="",G.inventory={money:100,supplies:20,cargo:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],moneyDisplay:function(){var e="";return G.inventory.money>=1e6&&(e=G.inventory.money.toString().substr(0,1),parseInt(G.inventory.money.toString().substr(1,1))>0&&(e+="."+G.inventory.money.toString().substr(1,1))),G.inventory.money>=1e12?e+="T":G.inventory.money>=1e9?e+="B":G.inventory.money>=1e6?e+="M":e=G.inventory.money.toString(),e},CheckCargo:function(){for(var e=[],n=0;n<G.inventory.cargo.length;n++)G.inventory.cargo[n]>0&&e.push(n);return e},CargoTotal:function(){for(var e=G.inventory.CheckCargo(),n=0,a=0;a<e.length;a++)n+=G.inventory.cargo[e[a]];return n},CanBuy:function(e,n){return G.inventory.cargo[e]<G.stats.hold&&G.inventory.money>n&&(G.inventory.cargo[e]>0||G.inventory.CheckCargo().length<G.stats.inventory)},CanSell:function(e){return G.inventory.cargo[e]>0}},G.stats={inventory:3,hold:20,speed:1,hull:3,maxHull:3,popularity:5,haggling:10,crew:2,energy:25,maxEnergy:50,illness:0},G.economy={innCost:50,innStays:0,cargoItemWorth:[10,20,30,30,40,20,50,80,65,20,20,30,30,60,45,70],cargoSold:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],cargoBought:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],UpdateEconomy:function(){for(var e=0;e<G.economy.cargoItemWorth.length;e++){for(var n=0,a=0;a<G.map.length;a++)n+=G.map[a].island.priceDifferences[e];G.economy.cargoItemWorth[e]+=Math.round(n/G.map.length)}for(var t=0,a=0;a<G.map.length;a++)t+=G.map[a].island.innPriceDifference;G.economy.innCost+=Math.round(t/G.map.length)}},G.SaveGame=function(){for(var e={playerX:G.player.x,playerY:G.player.y,money:G.inventory.money,supplies:G.inventory.supplies,cargo:G.inventory.cargo.slice(),stats:{inventory:G.stats.inventory,hold:G.stats.hold,speed:G.stats.speed,hull:G.stats.hull,maxHull:G.stats.maxHull,popularity:G.stats.popularity,haggling:G.stats.haggling,crew:G.stats.crew,energy:G.stats.energy,maxEnergy:G.stats.maxEnergy,illness:G.stats.illness},economy:{innCost:G.economy.innCost,innStays:G.economy.innStays,itemWorth:G.economy.cargoItemWorth.slice(),cargoSold:G.economy.cargoSold.slice(),cargoBought:G.economy.cargoBought.slice()},map:[]},n=0;n<G.map.length;n++)e.map.push({drawX:G.map[n].drawX,drawY:G.map[n].drawY,drawWidth:G.map[n].drawWidth,drawHeight:G.map[n].drawHeight,inventory:G.map[n].island.inventory.slice(),innPriceDifference:G.map[n].island.innPriceDifference,innStays:G.map[n].island.innStays,priceDifferences:G.map[n].island.priceDifferences.slice(),itemsSold:G.map[n].island.itemsSold.slice(),itemsBought:G.map[n].island.itemsBought.slice()});OS.Save("TradeWindsSave",JSON.stringify(e))&&console.log("Game Saved!")},G.LoadGame=function(){var e=OS.Load("TradeWindsSave");if(!e)return console.log("Could not load game!"),!1;e=JSON.parse(e),G.player.x=e.playerX,G.player.y=e.playerY,G.inventory.money=e.money,G.inventory.supplies=e.supplies,G.inventory.cargo=e.cargo.slice(),G.stats.inventory=e.stats.inventory,G.stats.hold=e.stats.hold,G.stats.speed=e.stats.speed,G.stats.hull=e.stats.hull,G.stats.maxHull=e.stats.maxHull,G.stats.popularity=e.stats.popularity,G.stats.haggling=e.stats.haggling,G.stats.crew=e.stats.crew,G.stats.energy=e.stats.energy,G.stats.maxEnergy=e.stats.maxEnergy,G.stats.illness=e.stats.illness,G.economy.innCost=e.economy.innCost,G.economy.innStays=e.economy.innStays,G.economy.cargoItemWorth=e.economy.itemWorth.slice(),G.economy.cargoSold=e.economy.cargoSold.slice(),G.economy.cargoBought=e.economy.cargoBought.slice();for(var n=0;n<e.map.length;n++)G.map[n].drawX=e.map[n].drawX,G.map[n].drawY=e.map[n].drawY,G.map[n].drawWidth=e.map[n].drawWidth,G.map[n].drawHeight=e.map[n].drawHeight,G.map[n].island.x=rm_Ocean.squareSize*e.map[n].drawX,G.map[n].island.y=rm_Ocean.squareSize*e.map[n].drawY,G.map[n].island.inventory=e.map[n].inventory.slice(),G.map[n].island.innPriceDifference=e.map[n].innPriceDifference,G.map[n].island.innStays=e.map[n].innStays,G.map[n].island.priceDifferences=e.map[n].priceDifferences.slice(),G.map[n].island.itemsSold=e.map[n].itemsSold.slice(),G.map[n].island.itemsBought=e.map[n].itemsBought.slice();e=null,console.log("Game Loaded!")};

View File

@ -1 +1 @@
function loadPrefabs(){OS.AddScript("prefabs/shipPrefab.js"),OS.AddScript("prefabs/islandPrefab.js"),OS.AddScript("prefabs/oceanTilePrefab.js"),OS.AddScript("prefabs/wavePrefab.js"),WaitForPrefabsToLoad(),Oversimplified.DEBUG.showMessages&&console.log("Ran loadPrefabs()")}var prefabsLoaded=0,prefabsToLoad=4;WaitForPrefabsToLoad=function(){console.log("waiting for "+(prefabsToLoad-prefabsLoaded).toString()+" prefabs to load"),prefabsToLoad>prefabsLoaded||!window.oceanRoom?setTimeout(function(){WaitForPrefabsToLoad()},.1):(G.player=rm_Ocean.AddObject(OS.P.Ship),G.oceanParticle=rm_Ocean.AddObject(OS.P["Ocean Particle"]),G.player.xBound?rm_Ocean.SetAsCurrentRoom():setTimeout(function(){WaitForPrefabsToLoad()},.1))};
function loadPrefabs(){OS.AddScript("prefabs/shipPrefab.js"),OS.AddScript("prefabs/islandPrefab.js"),OS.AddScript("prefabs/oceanTilePrefab.js"),OS.AddScript("prefabs/wavePrefab.js")}

View File

@ -1 +1 @@
function loadRooms(){OS.AddScript("rooms/oceanRoom.js"),rm_Load.SetAsCurrentRoom(),Oversimplified.DEBUG.showMessages&&console.log("Ran loadRooms()")}var rm_Load=OS.R.Add("Default"),rm_Ocean=OS.R.Add("Ocean Room",{width:50*pixel(64),height:44*pixel(64),backgroundColor:"#1b2632",squaresX:50,squaresY:44,squareSize:pixel(64),numberOfIslands:10,clockTimerCutoff:1/OS.S.defaultStep*60*5});rm_Ocean.speedGaugeImg=new Image,rm_Ocean.speedGaugeImg.src="images/speed_gauge_sheet.png",rm_Ocean.clockImg=new Image,rm_Ocean.clockImg.src="images/clock_sheet.png";
function loadRooms(){OS.AddScript("rooms/oceanRoom.js"),OS.SetRoom(rm_Ocean)}var rm_Ocean=OS.R.Add("Default",{width:50*pixel(64),height:44*pixel(64),backgroundColor:"#1b2632",squaresX:50,squaresY:44,squareSize:pixel(64),numberOfIslands:10,clockTimerCutoff:1/OS.S.defaultStep*60*5});rm_Ocean.speedGaugeImg=new Image,rm_Ocean.speedGaugeImg.src="images/speed_gauge_sheet.png",rm_Ocean.clockImg=new Image,rm_Ocean.clockImg.src="images/clock_sheet.png";

View File

@ -1 +1 @@
function islandPrefab(){Oversimplified.DEBUG.showMessages&&console.log("Ran islandPrefab()"),prefabsLoaded++}var ani_island_1=OS.A.Add("Island 1",256,256,{}),pr_island=OS.P.Add("Island",{solid:!0,imageSrc:"images/island.png",animations:[ani_island_1],depth:-50,mapX:0,mapY:0,mapWidth:1,mapHeight:1,mapColor:"#00AB00",canTrade:!0,haggleAmount:0,timesHaggledToday:0,inventory:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],innPriceDifference:0,innStays:0,priceDifferences:[],itemsSold:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],itemsBought:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]});pr_island.DoFirst=function(){this.GetMapPosition(),this.SetUp()},pr_island.GetMapPosition=function(){this.mapX=this.x/OS.S.pixelScale/(OS.camera.width/OS.S.pixelScale),this.mapY=this.y/OS.S.pixelScale/(OS.camera.height/OS.S.pixelScale)},pr_island.SetUp=function(){for(var n=0;16>n;n++)Math.randomRange(0,100)<25&&(this.inventory[n]=Math.round(Math.randomRange(0,20)));this.AdjustPrices(),this.CheckInventory().length<4&&this.SetUp()},pr_island.AdjustPrices=function(){for(var n=0;16>n;n++)this.inventory[n]>10?this.priceDifferences[n]=-Math.round(this.inventory[n]*Math.randomRange(1,3)):this.inventory[n]<5?this.priceDifferences[n]=Math.round((10-this.inventory[n])*Math.randomRange(1,3)):this.priceDifferences[n]=Math.round(Math.randomRange(-2,2)),G.economy.cargoItemWorth[n]+this.priceDifferences[n]<0&&(this.priceDifferences[n]=-G.economy.cargoItemWorth[n]+1);var i=this.priceDifferences.slice().sort(sortNumber);this.innPriceDifference+=Math.round(Math.randomRange(i[0],i[i.length-1]))-Math.round(Math.randomRange(0,this.innStays))},pr_island.SimulateTrade=function(){for(var n=0;16>n;n++)this.inventory[n]>0?(this.inventory[n]+=Math.round(Math.randomRange(-5,5)),this.inventory[n]<0&&(this.inventory[n]=0)):Math.randomRange(0,100)<15&&(this.inventory[n]=Math.round(Math.randomRange(0,5)));this.AdjustPrices()},pr_island.NewDay=function(){this.haggleAmount=0,this.timesHaggledToday=0,this.SimulateTrade()},pr_island.CheckInventory=function(){for(var n=[],i=0;i<this.inventory.length;i++)this.inventory[i]>0&&n.push(i);return n},pr_island.TradeWith=function(){mus_sail.Stop(),mus_trade.Play(),guiControl.trade.island=this,guiControl.trade.haggleAmount=0,guiControl.trade.activateDelay=5,guiControl.trade.show=!0},pr_island.SellTo=function(n,i){this.inventory[n]++,this.itemsBought[n]++,G.inventory.cargo[n]--,G.inventory.money+=i,G.economy.cargoSold[n]++},pr_island.BuyFrom=function(n,i){this.inventory[n]--,this.itemsBought[n]++,G.inventory.cargo[n]++,G.inventory.money-=i,G.economy.cargoBought[n]++},pr_island.StayAtInn=function(){this.innStays++,G.stats.illness--,G.inventory.money-=G.economy.innCost+this.innPriceDifference,G.economy.innStays++};
function islandPrefab(){}var ani_island_1=OS.A.Add("Island 1",256,256,{}),pr_island=OS.P.Add("Island",{solid:!0,imageSrc:"images/island.png",animations:[ani_island_1],depth:-50,mapX:0,mapY:0,mapWidth:1,mapHeight:1,mapColor:"#00AB00",canTrade:!0,haggleAmount:0,timesHaggledToday:0,inventory:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],innPriceDifference:0,innStays:0,priceDifferences:[],itemsSold:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],itemsBought:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]});pr_island.DoFirst=function(){this.GetMapPosition(),this.SetUp()},pr_island.GetMapPosition=function(){this.mapX=this.x/OS.S.pixelScale/(OS.camera.width/OS.S.pixelScale),this.mapY=this.y/OS.S.pixelScale/(OS.camera.height/OS.S.pixelScale)},pr_island.SetUp=function(){for(var n=0;16>n;n++)Math.randomRange(0,100)<25&&(this.inventory[n]=Math.round(Math.randomRange(0,20)));this.AdjustPrices(),this.CheckInventory().length<4&&this.SetUp()},pr_island.AdjustPrices=function(){for(var n=0;16>n;n++)this.inventory[n]>10?this.priceDifferences[n]=-Math.round(this.inventory[n]*Math.randomRange(1,3)):this.inventory[n]<5?this.priceDifferences[n]=Math.round((10-this.inventory[n])*Math.randomRange(1,3)):this.priceDifferences[n]=Math.round(Math.randomRange(-2,2)),G.economy.cargoItemWorth[n]+this.priceDifferences[n]<0&&(this.priceDifferences[n]=-G.economy.cargoItemWorth[n]+1);var i=this.priceDifferences.slice().sort(sortNumber);this.innPriceDifference+=Math.round(Math.randomRange(i[0],i[i.length-1]))-Math.round(Math.randomRange(0,this.innStays))},pr_island.SimulateTrade=function(){for(var n=0;16>n;n++)this.inventory[n]>0?(this.inventory[n]+=Math.round(Math.randomRange(-5,5)),this.inventory[n]<0&&(this.inventory[n]=0)):Math.randomRange(0,100)<15&&(this.inventory[n]=Math.round(Math.randomRange(0,5)));this.AdjustPrices()},pr_island.NewDay=function(){this.haggleAmount=0,this.timesHaggledToday=0,this.SimulateTrade()},pr_island.CheckInventory=function(){for(var n=[],i=0;i<this.inventory.length;i++)this.inventory[i]>0&&n.push(i);return n},pr_island.TradeWith=function(){mus_sail.Stop(),mus_trade.Play(),guiControl.trade.island=this,guiControl.trade.haggleAmount=0,guiControl.trade.activateDelay=5,guiControl.trade.show=!0},pr_island.SellTo=function(n,i){this.inventory[n]++,this.itemsBought[n]++,G.inventory.cargo[n]--,G.inventory.money+=i,G.economy.cargoSold[n]++},pr_island.BuyFrom=function(n,i){this.inventory[n]--,this.itemsBought[n]++,G.inventory.cargo[n]++,G.inventory.money-=i,G.economy.cargoBought[n]++},pr_island.StayAtInn=function(){this.innStays++,G.stats.illness--,G.inventory.money-=G.economy.innCost+this.innPriceDifference,G.economy.innStays++};

View File

@ -1 +1 @@
function oceanTilePrefab(){Oversimplified.DEBUG.showMessages&&console.log("Ran oceanTilePrefab()"),prefabsLoaded++}var ani_ocean=OS.A.Add("Ocean",256,256,{columns:10,speed:1/60}),pr_ocean=OS.P.Add("Ocean Particle",{imageSrc:"images/ocean_sheet.png",animations:[ani_ocean],depth:-100,positionCheckStep:30,positionCheckProgress:30,doCheckPosition:!1,moveTimer:0});pr_ocean.BeforeDo=function(){this.positionCheckProgress++,this.positionCheckProgress>=this.positionCheckStep&&(this.positionCheckProgress=0,this.doCheckPosition=!0)},pr_ocean.Do=function(){this.moveTimer++,this.moveTimer>=120&&(this.x+=1*pixel(Math.round(Math.randomRange(-1,1))),this.y+=1*pixel(Math.round(Math.randomRange(-1,1))),this.moveTimer=0)},pr_ocean.CheckPosition=function(i,e,a){if(this.doCheckPosition){if(Math.abs(this.x-i)>OS.camera.width+this.xBound||Math.abs(this.y-e)>OS.camera.height+this.yBound)switch(a){case 0:this.x=i+(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+randomSmidge();break;case 45:this.x=i+(OS.camera.width+this.xBound)+randomSmidge(),this.y=e-(OS.camera.height+this.yBound)+randomSmidge();break;case 90:this.x=i+randomSmidge(),this.y=e-(OS.camera.height+this.yBound)+randomSmidge();break;case 135:this.x=i-(OS.camera.width+this.xBound)+randomSmidge(),this.y=e-(OS.camera.height+this.yBound)+randomSmidge();break;case 180:this.x=i-(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+randomSmidge();break;case 225:this.x=i-(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+(OS.camera.height+this.yBound)+randomSmidge();break;case 270:this.x=i+randomSmidge(),this.y=e+(OS.camera.height+this.yBound)+randomSmidge();break;case 315:this.x=i+(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+(OS.camera.height+this.yBound)+randomSmidge();break;default:console.log("No valid direction")}this.doCheckPosition=!1}};
function oceanTilePrefab(){}var ani_ocean=OS.A.Add("Ocean",256,256,{columns:10,speed:1/60}),pr_ocean=OS.P.Add("Ocean Particle",{imageSrc:"images/ocean_sheet.png",animations:[ani_ocean],depth:-100,positionCheckStep:30,positionCheckProgress:30,doCheckPosition:!1,moveTimer:0});pr_ocean.BeforeDo=function(){this.positionCheckProgress++,this.positionCheckProgress>=this.positionCheckStep&&(this.positionCheckProgress=0,this.doCheckPosition=!0)},pr_ocean.Do=function(){this.moveTimer++,this.moveTimer>=120&&(this.x+=1*pixel(Math.round(Math.randomRange(-1,1))),this.y+=1*pixel(Math.round(Math.randomRange(-1,1))),this.moveTimer=0)},pr_ocean.CheckPosition=function(i,e,a){if(this.doCheckPosition){if(Math.abs(this.x-i)>OS.camera.width+this.xBound||Math.abs(this.y-e)>OS.camera.height+this.yBound)switch(a){case 0:this.x=i+(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+randomSmidge();break;case 45:this.x=i+(OS.camera.width+this.xBound)+randomSmidge(),this.y=e-(OS.camera.height+this.yBound)+randomSmidge();break;case 90:this.x=i+randomSmidge(),this.y=e-(OS.camera.height+this.yBound)+randomSmidge();break;case 135:this.x=i-(OS.camera.width+this.xBound)+randomSmidge(),this.y=e-(OS.camera.height+this.yBound)+randomSmidge();break;case 180:this.x=i-(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+randomSmidge();break;case 225:this.x=i-(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+(OS.camera.height+this.yBound)+randomSmidge();break;case 270:this.x=i+randomSmidge(),this.y=e+(OS.camera.height+this.yBound)+randomSmidge();break;case 315:this.x=i+(OS.camera.width+this.xBound)+randomSmidge(),this.y=e+(OS.camera.height+this.yBound)+randomSmidge();break;default:console.log("No valid direction")}this.doCheckPosition=!1}};

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
function wavePrefab(){Oversimplified.DEBUG.showMessages&&console.log("Ran wavePrefab()"),prefabsLoaded++}var ani_wave=OS.A.Add("Wave",64,64,{columns:10,speed:.1}),pr_wave=OS.P.Add("Wave Particle",{imageSrc:"images/wave_sheet.png",animations:[ani_wave],depth:-90,lifeTimer:100});pr_wave.DoFirst=function(){snd_wave.IsPlaying()||snd_wave.Play()},pr_wave.Do=function(){this.lifeTimer--,this.lifeTimer<=0&&this.Destroy()};
function wavePrefab(){}var ani_wave=OS.A.Add("Wave",64,64,{columns:10,speed:.1}),pr_wave=OS.P.Add("Wave Particle",{imageSrc:"images/wave_sheet.png",animations:[ani_wave],depth:-90,lifeTimer:100});pr_wave.DoFirst=function(){snd_wave.IsPlaying()||snd_wave.Play()},pr_wave.Do=function(){this.lifeTimer--,this.lifeTimer<=0&&this.Destroy()};

View File

@ -1 +1 @@
function oceanRoom(){Oversimplified.DEBUG.showMessages&&console.log("Ran oceanRoom()")}rm_Ocean.waveTimer=Math.round(Math.randomRange(30,150)),rm_Ocean.clockTimerCount=1,rm_Ocean.DoFirst=function(){mus_title.Play(),rm_Ocean.GenerateMap(),console.log("player xBound: "+G.player.xBound),G.player.x=this.squareSize*(this.squaresX/2)-this.squareSize/2-G.player.xBound,G.player.y=this.squareSize*(this.squaresY/2),G.oceanParticle.x=G.player.x+randomSmidge(),G.oceanParticle.y=G.player.y+randomSmidge(),OS.SetCamera({x:G.player.x-OS.camera.width/2,y:G.player.y-OS.camera.height/2,objectToFollow:G.player}),this.mapLeftTrigger=OS.camera.hBorder,this.mapLeftTriggerTarget=this.width-(OS.camera.width-OS.camera.hBorder),this.mapRightTrigger=this.width-OS.camera.hBorder,this.mapRightTriggerTarget=OS.camera.width-OS.camera.hBorder,this.mapUpTrigger=OS.camera.vBorder,this.mapUpTriggerTarget=this.height-(OS.camera.height-OS.camera.vBorder),this.mapDownTrigger=this.height-OS.camera.vBorder,this.mapDownTriggerTarget=OS.camera.height-OS.camera.vBorder},rm_Ocean.Do=function(){if(G.gameStarted&&(guiControl&&guiControl.inventory&&guiControl.map&&guiControl.trade&&(guiControl.inventory.show||guiControl.map.show||guiControl.trade.show||(G.oceanParticle.CheckPosition&&G.oceanParticle.CheckPosition(G.player.x,G.player.y,G.player.direction),ct_cancel().down&&(snd_select.Play(),guiControl.inventory.activateDelay=5,guiControl.inventory.show=!0),ct_m.down&&(snd_select.Play(),guiControl.map.activateDelay=5,guiControl.map.show=!0))),this.RunClock()),guiControl&&guiControl.trade&&!guiControl.trade.show&&(this.waveTimer--,this.waveTimer<=0)){var e=this.AddObject(OS.P["Wave Particle"]);e.x=G.player.x+4*randomSmidge(),e.y=G.player.y+4*randomSmidge(),this.waveTimer=Math.round(Math.randomRange(30,150))}},rm_Ocean.DrawAbove=function(){G.gameStarted?(this.DrawNightDarkness(),OS.context.drawImage(rm_Ocean.speedGaugeImg,32*G.player.currentSpeed,0,32,32,16,OS.camera.height-32-16,32,32),this.DrawEnergyBar(),this.DrawClock(),drawInventoryGUI(),drawMapGUI(),drawTradeGUI()):drawTitleScreen()},rm_Ocean.DoLast=function(){},rm_Ocean.RunClock=function(){if(guiControl.trade&&!guiControl.trade.show){if(rm_Ocean.clockTimerCount++,rm_Ocean.clockTimerCount>rm_Ocean.clockTimerCutoff){rm_Ocean.clockTimerCount=0,G.economy.UpdateEconomy();for(var e=0;e<G.map.length;e++)G.map[e].island.NewDay();G.SaveGame()}0!=rm_Ocean.clockTimerCount&&rm_Ocean.clockTimerCount!=Math.round(.33*rm_Ocean.clockTimerCutoff)&&rm_Ocean.clockTimerCount!=Math.round(.66*rm_Ocean.clockTimerCutoff)||G.player.CheckIllnessIncrease()}},rm_Ocean.DrawNightDarkness=function(){var e=Math.sin(this.clockTimerCount/(this.clockTimerCutoff*Math.PI)*10*1.5-2)-.4;if(0>e&&(e=0),e>0){var a=OS.context.globalAlpha,r=Oversimplified.context.fillStyle;OS.context.globalAlpha=e,Oversimplified.context.fillStyle="#112189",Oversimplified.context.fillRect(0,0,Oversimplified.camera.width,Oversimplified.camera.height),Oversimplified.context.fillStyle=r,Oversimplified.context.globalAlpha=a}},rm_Ocean.DrawEnergyBar=function(){var e=G.stats.energy/G.stats.maxEnergy,a=pixel(2),r=32,t=pixel(Math.round(r*e)),i=OS.context.fillStyle;OS.context.fillStyle="#0055FF",OS.context.fillRect(64,OS.camera.height-a-16,t,a),OS.context.fillStyle=i},rm_Ocean.DrawClock=function(){var e=OS.camera.width-pixel(9)-pixel(2),a=OS.camera.height-pixel(9)-pixel(2),r=this.clockTimerCount/this.clockTimerCutoff,t=Math.floor(16*r)*pixel(9);OS.context.drawImage(this.clockImg,t,0,pixel(9),pixel(9),e,a,pixel(9),pixel(9))},rm_Ocean.GenerateMap=function(){for(var e=[25],a=[22];e.length<this.numberOfIslands;){for(var r=Math.round(Math.randomRange(2,this.squaresX-2)),t=!1,i=0;i<e.length;i++)if(e[i]-this.squaresX/this.numberOfIslands/2<r&&r<e[i]+this.squaresX/this.numberOfIslands/2){t=!0;break}t||e.push(r)}for(;a.length<this.numberOfIslands;){for(var r=Math.round(Math.randomRange(2,this.squaresY-2)),t=!1,i=0;i<a.length;i++)if(a[i]-this.squaresY/this.numberOfIslands/2<r&&r<a[i]+this.squaresY/this.numberOfIslands/2){t=!0;break}t||a.push(r)}for(var i=0;i<this.numberOfIslands;i++)G.map[i]={island:rm_Ocean.AddObject(OS.P.Island,{x:this.squareSize*e[i],y:this.squareSize*a[i]}),drawX:e[i],drawY:a[i],drawWidth:1,drawHeight:1}};
function oceanRoom(){G.player=rm_Ocean.AddObject(OS.P.Ship),G.oceanParticle=rm_Ocean.AddObject(OS.P["Ocean Particle"]),rm_Ocean.GenerateMap(),OS.SetRoom(rm_Ocean)}rm_Ocean.waveTimer=Math.round(Math.randomRange(30,150)),rm_Ocean.clockTimerCount=1,rm_Ocean.DoFirst=function(){mus_title.Play(),G.player.x=this.squareSize*(this.squaresX/2)-this.squareSize/2-G.player.xBound,G.player.y=this.squareSize*(this.squaresY/2),G.oceanParticle.x=G.player.x+randomSmidge(),G.oceanParticle.y=G.player.y+randomSmidge(),OS.SetCamera({x:G.player.x-OS.camera.width/2,y:G.player.y-OS.camera.height/2,objectToFollow:G.player}),this.mapLeftTrigger=OS.camera.hBorder,this.mapLeftTriggerTarget=this.width-(OS.camera.width-OS.camera.hBorder),this.mapRightTrigger=this.width-OS.camera.hBorder,this.mapRightTriggerTarget=OS.camera.width-OS.camera.hBorder,this.mapUpTrigger=OS.camera.vBorder,this.mapUpTriggerTarget=this.height-(OS.camera.height-OS.camera.vBorder),this.mapDownTrigger=this.height-OS.camera.vBorder,this.mapDownTriggerTarget=OS.camera.height-OS.camera.vBorder},rm_Ocean.Do=function(){if(G.gameStarted&&(guiControl&&guiControl.inventory&&guiControl.map&&guiControl.trade&&(guiControl.inventory.show||guiControl.map.show||guiControl.trade.show||(G.oceanParticle.CheckPosition&&G.oceanParticle.CheckPosition(G.player.x,G.player.y,G.player.direction),ct_cancel().down&&(snd_select.Play(),guiControl.inventory.activateDelay=5,guiControl.inventory.show=!0),ct_m.down&&(snd_select.Play(),guiControl.map.activateDelay=5,guiControl.map.show=!0))),this.RunClock()),guiControl&&guiControl.trade&&!guiControl.trade.show&&(this.waveTimer--,this.waveTimer<=0)){var e=this.AddObject(OS.P["Wave Particle"]);e.x=G.player.x+4*randomSmidge(),e.y=G.player.y+4*randomSmidge(),this.waveTimer=Math.round(Math.randomRange(30,150))}},rm_Ocean.DrawAbove=function(){G.gameStarted?(this.DrawNightDarkness(),OS.context.drawImage(rm_Ocean.speedGaugeImg,32*G.player.currentSpeed,0,32,32,16,OS.camera.height-32-16,32,32),this.DrawEnergyBar(),this.DrawClock(),drawInventoryGUI(),drawMapGUI(),drawTradeGUI()):drawTitleScreen()},rm_Ocean.DoLast=function(){},rm_Ocean.RunClock=function(){if(guiControl.trade&&!guiControl.trade.show){if(rm_Ocean.clockTimerCount++,rm_Ocean.clockTimerCount>rm_Ocean.clockTimerCutoff){rm_Ocean.clockTimerCount=0,G.economy.UpdateEconomy();for(var e=0;e<G.map.length;e++)G.map[e].island.NewDay();G.SaveGame()}0!=rm_Ocean.clockTimerCount&&rm_Ocean.clockTimerCount!=Math.round(.33*rm_Ocean.clockTimerCutoff)&&rm_Ocean.clockTimerCount!=Math.round(.66*rm_Ocean.clockTimerCutoff)||G.player.CheckIllnessIncrease()}},rm_Ocean.DrawNightDarkness=function(){var e=Math.sin(this.clockTimerCount/(this.clockTimerCutoff*Math.PI)*10*1.5-2)-.4;if(0>e&&(e=0),e>0){var a=OS.context.globalAlpha,r=Oversimplified.context.fillStyle;OS.context.globalAlpha=e,Oversimplified.context.fillStyle="#112189",Oversimplified.context.fillRect(0,0,Oversimplified.camera.width,Oversimplified.camera.height),Oversimplified.context.fillStyle=r,Oversimplified.context.globalAlpha=a}},rm_Ocean.DrawEnergyBar=function(){var e=G.stats.energy/G.stats.maxEnergy,a=pixel(2),r=32,t=pixel(Math.round(r*e)),i=OS.context.fillStyle;OS.context.fillStyle="#0055FF",OS.context.fillRect(64,OS.camera.height-a-16,t,a),OS.context.fillStyle=i},rm_Ocean.DrawClock=function(){var e=OS.camera.width-pixel(9)-pixel(2),a=OS.camera.height-pixel(9)-pixel(2),r=this.clockTimerCount/this.clockTimerCutoff,t=Math.floor(16*r)*pixel(9);OS.context.drawImage(this.clockImg,t,0,pixel(9),pixel(9),e,a,pixel(9),pixel(9))},rm_Ocean.GenerateMap=function(){for(var e=[25],a=[22];e.length<this.numberOfIslands;){for(var r=Math.round(Math.randomRange(2,this.squaresX-2)),t=!1,i=0;i<e.length;i++)if(e[i]-this.squaresX/this.numberOfIslands/2<r&&r<e[i]+this.squaresX/this.numberOfIslands/2){t=!0;break}t||e.push(r)}for(;a.length<this.numberOfIslands;){for(var r=Math.round(Math.randomRange(2,this.squaresY-2)),t=!1,i=0;i<a.length;i++)if(a[i]-this.squaresY/this.numberOfIslands/2<r&&r<a[i]+this.squaresY/this.numberOfIslands/2){t=!0;break}t||a.push(r)}for(var i=0;i<this.numberOfIslands;i++)G.map[i]={island:rm_Ocean.AddObject(OS.P.Island,{x:this.squareSize*e[i],y:this.squareSize*a[i]}),drawX:e[i],drawY:a[i],drawWidth:1,drawHeight:1}};

View File

@ -1 +1 @@
function start(){OS.AddScript("loadControls.js"),OS.AddScript("loadAudio.js"),OS.AddScript("loadGameManager.js"),OS.AddScript("loadGUIs.js"),OS.AddScript("loadPrefabs.js"),OS.AddScript("loadRooms.js"),Oversimplified.DEBUG.showMessages&&console.log("Ran start()")}function pixel(e){return("undefined"!=typeof e?e:1)*OS.S.pixelScale}function secondsWorthOfFrames(e){return e*(1/OS.R[OS.R.currentRoom].stepSpeed)}function randomSmidge(){return pixel(Math.round(Math.randomRange(-10,10)))}function sortNumber(e,r){return e-r}OS.S.defaultStep=1/120,OS.S.numberOfScriptsToLoad=16,OS.S.pixelScale=4,OS.SetCamera({width:pixel(64),height:pixel(64),hBorder:pixel(24),vBorder:pixel(24)});
function start(){OS.AddScript("loadControls.js"),OS.AddScript("loadAudio.js"),OS.AddScript("loadGameManager.js"),OS.AddScript("loadPrefabs.js"),OS.AddScript("loadGUIs.js"),OS.AddScript("loadRooms.js")}function pixel(e){return("undefined"!=typeof e?e:1)*OS.S.pixelScale}function secondsWorthOfFrames(e){return e*(1/OS.R[OS.R.currentRoom].stepSpeed)}function randomSmidge(){return pixel(Math.round(Math.randomRange(-10,10)))}function sortNumber(e,r){return e-r}OS.S.defaultStep=1/120,OS.S.numberOfScriptsToLoad=16,OS.S.pixelScale=4,Oversimplified.DEBUG.showMessages=!1,OS.SetCamera({width:pixel(64),height:pixel(64),hBorder:pixel(24),vBorder:pixel(24)});

Binary file not shown.