Created
April 16, 2016 03:28
-
-
Save Willsr71/ba0124ae04512d4bbf1019bc92684c3c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Load Upgrades | |
function LoadUpgrades() { | |
var HTML = ''; | |
HTML = '<div style="margin-bottom:7px;font-size:40px;font-weight:bold"><center>Upgrades</center></div>'; | |
for(var x = 0; x < Upgrades.List.length; x = x + 1) { | |
HTML = HTML + '<img class="Upgraded tooltip" id="Upgraded' + rS(Upgrades.List[x].Name) + '" src="' + Upgrades.List[x].IMG + '" title="' + Upgrades.List[x].Name + ' - ' + Upgrades.List[x].Desc + '"/>'; | |
} | |
for(var x = 0; x < Upgrades.List.length; x = x + 1) { | |
HTML = HTML + '<div class="UpgradeBox" onclick="Game.BuyUpgrade(' + x + ')" id="Upgrade' + rS(Upgrades.List[x].Name) + '"><img class="UpgradeIMG" src="' + Upgrades.List[x].IMG + '"/><a><b>' + Upgrades.List[x].Name + '</b><br>Price: ' + Beautify(Upgrades.List[x].Cost) + ' Emeralds<br>' + Upgrades.List[x].Desc + '</a></div>'; | |
} | |
l('UpgradeContainer').innerHTML = HTML; //Load | |
HTML = ''; | |
for(var x = 0; x < Upgrades.List.length; x = x + 1) { | |
HTML = HTML + '<img class="StatsUpgraded tooltip" id="StatsUpgraded' + rS(Upgrades.List[x].Name) + '" src="' + Upgrades.List[x].IMG + '" title="' + Upgrades.List[x].Name + ' - ' + Upgrades.List[x].Desc + '"/>'; | |
} | |
l('StatsUpgradedContainer').innerHTML = HTML; //Load for Stats | |
} | |
//Load Workers | |
function LoadWorkers(){ | |
var HTML = ''; | |
for(var x = 0; x < Workers.List.length; x = x + 1){ | |
HTML = HTML + '<tr><td><img class="t" id="Img' + rS(Workers.List[x].Name) + '" src="' + Workers.List[x].IMG + '" onclick="Game.BuyWorker(' + x + ')" onmouseover="Game.HighlightImage(' + x + ',\'Workers\')" onmouseout="Game.UnHighlightImage(' + x + ',\'Workers\')"/></td><td width="38%"><div id="' + rS(Workers.List[x].Name) + 'Price">' + Workers.List[x].Name + ': ' + Beautify(Workers.List[x].Cost) + ' Emeralds</div><div>' + Workers.List[x].EPS + ' EPS</div><div id="' + rS(Workers.List[x].Name) + 'Have">You own ' + Workers.List[x].Have + '</div><button id="' + rS(Workers.List[x].Name) + 'Buy" onclick="Game.BuyWorker(' + x + ')">Buy</button><button id="' + rS(Workers.List[x].Name) + 'Sell" onclick="Game.SellWorker(' + x + ')">Sell</button></td><td><div>' + Workers.List[x].Desc + '</div></td></tr>'; | |
} | |
l('Workers').innerHTML=HTML; //Load | |
} | |
//Load Army | |
function LoadArmy(){HTML=''; | |
for(var x=0;x<Army.List.length;x++){ | |
HTML+='<tr><td><img class="t" id="'+rS(Army.List[x].Name)+'" src="'+Army.List[x].IMG+'" onclick="Game.BuyArmy('+x+')" onmouseover="Game.HighlightImage('+x+',\'Army\')" onmouseout="Game.UnHighlightImage('+x+',\'Army\')"/></td><td width="38%"><div id="'+rS(Army.List[x].Name)+'Price">'+Army.List[x].Name+': '+Beautify(Army.List[x].Cost)+' Emeralds</div><div>Strength: '+Army.List[x].Strength+'</div><div id="'+rS(Army.List[x].Name)+'Have">You own '+Army.List[x].Have+'</div><button id="'+rS(Army.List[x].Name)+'Buy" onclick="Game.BuyArmy('+x+')">Buy</button><button id="'+rS(Army.List[x].Name)+'Sell" onclick="Game.SellArmy('+x+')">Sell</button></td><td><div>'+Army.List[x].Desc+'</div></td></tr>'; | |
} | |
l('Army').innerHTML=HTML; //Load | |
} | |
//Update Upgrades | |
Game.UpdateUpgrades=function(){var HTML="function ExecUpgradesScript(){\n"; | |
for(var x=0;x<Upgrades.List.length;x++){ | |
HTML+="if(Upgrades."+rS(Upgrades.List[x].Name)+".Have"+Upgrades.List[x].NoShowUpgBoxIF+"){l('Upgrade"+rS(Upgrades.List[x].Name)+"').style.display='none';}else if(Upgrades."+rS(Upgrades.List[x].Name)+".Cost<=Game.Emeralds){l('Upgrade"+rS(Upgrades.List[x].Name)+"').style.display='block';l('Upgrade"+rS(Upgrades.List[x].Name)+"').style.backgroundColor='green';}else{l('Upgrade"+rS(Upgrades.List[x].Name)+"').style.display='block';l('Upgrade"+rS(Upgrades.List[x].Name)+"').style.backgroundColor='red';}\n"; | |
HTML+="if(Upgrades."+rS(Upgrades.List[x].Name)+".Have"+Upgrades.List[x].ShowUpgradedIF+"){l('Upgraded"+rS(Upgrades.List[x].Name)+"').style.display='inline-block';}else{l('Upgraded"+rS(Upgrades.List[x].Name)+"').style.display='none';}\n"; | |
} | |
l('UpgradesScript').innerHTML=HTML+"}"; | |
ExecUpgradesScript(); | |
}; | |
//Load Statz | |
function LoadStats(){ | |
HTML="function ExecStatsScript(){\n"; | |
for(var x=0;x<Upgrades.List.length;x++){ | |
HTML+="if(Upgrades."+rS(Upgrades.List[x].Name)+".Have){l('StatsUpgraded"+rS(Upgrades.List[x].Name)+"').style.display='inline-block';}else{l('StatsUpgraded"+rS(Upgrades.List[x].Name)+"').style.display='none';}\n"; | |
} | |
l('StatsScript').innerHTML=HTML+"}"; | |
HTML=''; | |
HTML+='<br><br><br>'; | |
HTML+='<div class="StatsContainer">Total Emeralds Earned: <a class="QuickStats" style="background-color:#367C17">'+Beautify(Game.EmeraldsTotal)+'</a></div>'; | |
HTML+='<div class="StatsContainer">Emeralds per Second: <a class="QuickStats" style="background-color:grey">'+Beautify(Game.EPS)+'</a></div>'; | |
HTML+='<div class="StatsContainer">Time Started: '+timeSinceStart()+' ago</div>'; | |
HTML+='<div class="StatsContainer">Last Saved: '+Game.LastSaved+' seconds ago</div>'; | |
HTML+='<div class="StatsContainer">Upgrades Purchased:</div>'; | |
l('StatsContainer').innerHTML=HTML; //Load | |
ExecStatsScript(); | |
} | |
//Load EVERYTHING IN THE UNIVERRSE | |
function DataLoad(){ | |
Game.Version=0.3; | |
Game.Emeralds=0; | |
Game.EmeraldsTotal=0; | |
Game.EmeraldsEarned=0; | |
Game.EmeraldsSold=0; | |
Game.EmeraldsFound=0; | |
Game.EmeraldsLost=0; | |
Game.EPS=0; | |
Game.EPSMultiplier=1; | |
Game.TimeStarted=new Date(); | |
Game.LastSaved=60; | |
Game.Tick=0; | |
Game.CheckedUpdate=0; | |
Game.Cheated=false; | |
/*======================= | |
= Menu Items = | |
=======================*/ | |
Game.MenuItems=["Workers","Army","Stats","Highscores"]; | |
/*======================= | |
= Workers = | |
=======================*/ | |
Workers={ | |
Miner:{'Name': 'Miner', | |
'Desc': 'A Miner to mine Emeralds for you.', | |
'Have': 0, | |
'BaseCost': 20, | |
'Cost': 20, | |
'EPS': 1, | |
'IMGH': false, | |
'IMG': 'Images/Miner.png'}, | |
Villager:{'Name': 'Villager', | |
'Desc': 'A Villager to ship Emeralds for you.', | |
'Have': 0, | |
'BaseCost': 500, | |
'Cost': 500, | |
'EPS': 2, | |
'IMGH': false, | |
'IMG': 'Images/Villager.png'}, | |
Mule:{'Name': 'Mule', | |
'Desc': 'A Mule to increase Emerald shipping speed.', | |
'Have': 0, | |
'BaseCost': 1000, | |
'Cost': 1000, | |
'EPS': 5, | |
'IMG': 'Images/Mule.png'}, | |
Minecart:{'Name': 'Minecart', | |
'Desc': 'A Minecart to help with mining and transportation.', | |
'Have': 0, | |
'BaseCost': 8000, | |
'Cost': 8000, | |
'EPS': 20, | |
'IMGH': false, | |
'IMG': 'Images/Minecart.png'}, | |
Boat:{'Name': 'Boat', | |
'Desc': 'A Boat for faster shipping.', | |
'Have': 0, | |
'BaseCost': 100000, | |
'Cost': 100000, | |
'EPS': 50, | |
'IMGH': false, | |
'IMG': 'Images/Boat.png'}, | |
TNT:{'Name': 'TNT', | |
'Desc': 'A faster way to mine.', | |
'Have': 0, | |
'BaseCost': 1111111, | |
'Cost': 1111111, | |
'EPS': 100, | |
'IMGH': false, | |
'IMG': 'Images/TNT.png'}, | |
TNTMinecart:{'Name': 'TNT Minecart', | |
'Desc': 'Increased explosion radious!', | |
'Have': 0, | |
'BaseCost': 999999999, | |
'Cost': 999999999, | |
'EPS': 500, | |
'IMGH': false, | |
'IMG': 'Images/TNTMinecart.png'} | |
}; | |
Workers.List=[Workers.Miner,Workers.Villager,Workers.Mule,Workers.Minecart,Workers.Boat,Workers.TNT,Workers.TNTMinecart]; | |
/*======================= | |
= ARMY = | |
=======================*/ | |
Army={ | |
SnowGolem:{'Name': 'Snow Golem', | |
'Desc': 'An Snow Golem to delay Enemies from attacking you workers.', | |
'Have': 0, | |
'BaseCost': 1000, | |
'Cost': 1000, | |
'Strength': 10, | |
'IMGH': false, | |
'IMG': 'Images/SnowGolem.png'}, | |
Wolf:{'Name': 'Wolf', | |
'Desc': 'A Wolf to help with fighting off mobs.', | |
'Have': 0, | |
'BaseCost': 5000, | |
'Cost': 1000, | |
'Strength': 50, | |
'IMGH': false, | |
'IMG': 'Images/Wolf.png'}, | |
IronGolem:{'Name': 'Iron Golem', | |
'Desc': 'An Iron Golem to fight off Zombies and Skeletons.', | |
'Have': 0, | |
'BaseCost': 10000, | |
'Cost': 5000, | |
'Strength': 100, | |
'IMGH': false, | |
'IMG': 'Images/IronGolem.png'}, | |
Ocelot:{'Name': 'Ocelot', | |
'Desc': 'A Kitty to scare away Creepers.', | |
'Have': 0, | |
'BaseCost': 100000, | |
'Cost': 10000, | |
'Strength': 100, | |
'IMGH': false, | |
'IMG': 'Images/Ocelot.png'} | |
}; | |
Army.List=[Army.SnowGolem,Army.Wolf,Army.IronGolem,Army.Ocelot]; | |
/*======================= | |
= UPGRADES = | |
=======================*/ | |
Upgrades={ | |
BetterClicker:{'Name': 'Better Clicker', | |
'Have': false, | |
'Cost': 1000, | |
'ClickMultiplier': 10, | |
'Desc': 'x10 Emeralds for each Click.', | |
'NoShowUpgBoxIF': '||Game.EmeraldsTotal<=0', | |
'ShowUpgradedIF': '&&!Upgrades.ExtremeClicker.Have', | |
'IMG': 'Images/Clicker.png'}, | |
ExtremeClicker:{'Name': 'Extreme Clicker', | |
'Have': false, | |
'Cost': 10000, | |
'ClickMultiplier': 100, | |
'Desc': 'x100 Emeralds for each Click.', | |
'NoShowUpgBoxIF': '||!Upgrades.BetterClicker.Have', | |
'ShowUpgradedIF': '&&!Upgrades.InsaneClicker.Have', | |
'IMG': 'Images/Clicker.png'}, | |
InsaneClicker:{'Name': 'Insane Clicker', | |
'Have': false, | |
'Cost': 100000, | |
'ClickMultiplier': 1000, | |
'Desc': 'x1000 Emeralds for each Click.', | |
'NoShowUpgBoxIF': '||!Upgrades.ExtremeClicker.Have', | |
'ShowUpgradedIF': '&&!Upgrades.GodlyClicker.Have', | |
'IMG': 'Images/Clicker.png'}, | |
GodlyClicker:{'Name': 'Godly Clicker', | |
'Have': false, | |
'Cost': 1000000, | |
'ClickMultiplier': 10000, | |
'Desc': 'x10000 Emeralds for each Click.', | |
'NoShowUpgBoxIF': '||!Upgrades.InsaneClicker.Have', | |
'ShowUpgradedIF': '&&!Upgrades.UltimateClicker.Have', | |
'IMG': 'Images/Clicker.png'}, | |
UltimateClicker:{'Name': 'Ultimate Clicker', | |
'Have': false, | |
'Cost': 10000000, | |
'ClickMultiplier': 100000, | |
'Desc': 'x100000 Emeralds for each Click.', | |
'NoShowUpgBoxIF': '||!Upgrades.GodlyClicker.Have', | |
'ShowUpgradedIF': '&&!Upgrades.DerpClicker.Have', | |
'IMG': 'Images/Clicker.png'}, | |
DerpClicker:{'Name': 'Derp Clicker', | |
'Have': false, | |
'Cost': 9999999999, | |
'ClickMultiplier': 1, | |
'Desc': 'xRand*Emeralds/50 Emeralds for each Click.', | |
'NoShowUpgBoxIF': '||!Upgrades.UltimateClicker.Have', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/Clicker.png'}, | |
WoodPick:{'Name': 'Wood Pick', | |
'Have': false, | |
'Cost': 1000, | |
'MinerEPSMultiplier': 1.25, | |
'Desc': 'x1.25 EPS for each Miner.', | |
'NoShowUpgBoxIF': '||Workers.Miner.Have<=0', | |
'ShowUpgradedIF': '&&!Upgrades.StonePick.Have', | |
'IMG': 'Images/WoodPick.png'}, | |
StonePick:{'Name': 'Stone Pick', | |
'Have': false, | |
'Cost': 10000, | |
'MinerEPSMultiplier': 2, | |
'Desc': 'x2 EPS for each Miner.', | |
'NoShowUpgBoxIF': '||!Upgrades.WoodPick.Have', | |
'ShowUpgradedIF': '&&!Upgrades.IronPick.Have', | |
'IMG': 'Images/StonePick.png'}, | |
IronPick:{'Name': 'Iron Pick', | |
'Have': false, | |
'Cost': 100000, | |
'MinerEPSMultiplier': 5, | |
'Desc': 'x5 EPS for each Miner.', | |
'NoShowUpgBoxIF': '||!Upgrades.StonePick.Have', | |
'ShowUpgradedIF': '&&!Upgrades.GoldPick.Have', | |
'IMG': 'Images/IronPick.png'}, | |
GoldPick:{'Name': 'Gold Pick', | |
'Have': false, | |
'Cost': 1000000, | |
'MinerEPSMultiplier': 10, | |
'Desc': 'x10 EPS for each Miner.', | |
'NoShowUpgBoxIF': '||!Upgrades.IronPick.Have', | |
'ShowUpgradedIF': '&&!Upgrades.DiamondPick.Have', | |
'IMG': 'Images/GoldPick.png'}, | |
DiamondPick:{'Name': 'Diamond Pick', | |
'Have': false, | |
'Cost': 10000000, | |
'MinerEPSMultiplier': 20, | |
'Desc': 'x20 EPS for each Miner.', | |
'NoShowUpgBoxIF': '||!Upgrades.GoldPick.Have', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/DiamondPick.png'}, | |
WoodSword:{'Name': 'Wood Sword', | |
'Have': false, | |
'Cost': 1000, | |
'Desc': 'Increase your army\'s strength with this.', | |
'NoShowUpgBoxIF': '||Army.SnowGolem.Have<=0||Army.IronGolem.Have<=0||Army.Ocelot.Have<=0', | |
'ShowUpgradedIF': '&&!Upgrades.StoneSword.Have', | |
'IMG': 'Images/WoodSword.png'}, | |
StoneSword:{'Name': 'Stone Sword', | |
'Have': false, | |
'Cost': 10000, | |
'Desc': 'Increase your army\'s strength with this.', | |
'NoShowUpgBoxIF': '||!Upgrades.WoodSword.Have', | |
'ShowUpgradedIF': '&&!Upgrades.IronSword.Have', | |
'IMG': 'Images/StoneSword.png'}, | |
IronSword:{'Name': 'Iron Sword', | |
'Have': false, | |
'Cost': 100000, | |
'EPSMultiplier': 5, | |
'Desc': 'Increase your army\'s strength with this.', | |
'NoShowUpgBoxIF': '||!Upgrades.StoneSword.Have', | |
'ShowUpgradedIF': '&&!Upgrades.GoldSword.Have', | |
'IMG': 'Images/IronSword.png'}, | |
GoldSword:{'Name': 'Gold Sword', | |
'Have': false, | |
'Cost': 1000000, | |
'Desc': 'Increase your army\'s strength with this.', | |
'NoShowUpgBoxIF': '||!Upgrades.IronSword.Have', | |
'ShowUpgradedIF': '&&!Upgrades.DiamondSword.Have', | |
'IMG': 'Images/GoldSword.png'}, | |
DiamondSword:{'Name': 'Diamond Sword', | |
'Have': false, | |
'Cost': 10000000, | |
'Desc': 'Increase your army\'s strength with this.', | |
'NoShowUpgBoxIF': '||!Upgrades.GoldSword.Have', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/DiamondSword.png'}, | |
PotionofStrength:{'Name': 'Potion of Strength', | |
'Have': false, | |
'Cost': 10000, | |
'Desc': 'x10 EPS for Mules', | |
'NoShowUpgBoxIF': '||Workers.Mule.Have<=0', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/PotionofStrength.png'}, | |
PotionofSwiftness:{'Name': 'Potion of Swiftness', | |
'Have': false, | |
'Cost': 100000, | |
'Desc': '+50 EPS for Miners and Villagers', | |
'NoShowUpgBoxIF': '||Workers.Miner.Have<=0&&Workers.Villager.Have<=0', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/PotionofSwiftness.png'}, | |
BetterRails:{'Name': 'Better Rails', | |
'Have': false, | |
'Cost': 100000, | |
'Desc': '+10 EPS for Minecarts', | |
'NoShowUpgBoxIF': '||Workers.Minecart.Have<=0', | |
'ShowUpgradedIF': '&&!Upgrades.PoweredRails.Have', | |
'IMG': 'Images/BetterRails.png'}, | |
PoweredRails:{'Name': 'Powered Rails', | |
'Have': false, | |
'Cost': 10000000, | |
'Desc': '+50 EPS for Minecarts', | |
'NoShowUpgBoxIF': '||!Upgrades.PoweredRails.Have', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/PoweredRails.png'}, | |
BlastResistantRails:{'Name': 'Blast Resistant Rails', | |
'Have': false, | |
'Cost': 1000000000, | |
'Desc': '+100 EPS for TNT Minecarts', | |
'NoShowUpgBoxIF': '||Workers.TNTMinecart.Have<=0', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/BlastResistantRails.png'}, | |
Poppy:{'Name': 'Poppy', | |
'Have': false, | |
'Cost': 10000, | |
'Desc': '+10 Strength for Iron Golems', | |
'NoShowUpgBoxIF': '||Army.IronGolem.Have<=0', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/Poppy.png'}, | |
Fish:{'Name': 'Fish', | |
'Have': false, | |
'Cost': 10000, | |
'Desc': '+10 Strength for Ocelots', | |
'NoShowUpgBoxIF': '||Army.Ocelot.Have<=0', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/Fish.png'}, | |
Bone:{'Name': 'Bone', | |
'Have': false, | |
'Cost': 10000, | |
'Desc': '+10 Strength for Wolves', | |
'NoShowUpgBoxIF': '||Army.Wolf.Have<=0', | |
'ShowUpgradedIF': '', | |
'IMG': 'Images/Bone.png'} | |
}; | |
Upgrades.List=[Upgrades.BetterClicker,Upgrades.ExtremeClicker,Upgrades.InsaneClicker,Upgrades.GodlyClicker,Upgrades.UltimateClicker,Upgrades.DerpClicker,Upgrades.WoodPick,Upgrades.StonePick,Upgrades.IronPick,Upgrades.GoldPick,Upgrades.DiamondPick,Upgrades.WoodSword,Upgrades.StoneSword,Upgrades.IronSword,Upgrades.GoldSword,Upgrades.DiamondSword,Upgrades.PotionofStrength,Upgrades.PotionofSwiftness,Upgrades.BetterRails,Upgrades.PoweredRails,Upgrades.BlastResistantRails,Upgrades.Bone,Upgrades.Poppy,Upgrades.Fish]; | |
/*======================= | |
= EMEMIES = | |
=======================*/ | |
Enemy={ | |
Zombie:{'Name': 'Zombie', | |
'Army': 0, | |
'Strength': 1, | |
'IMG': 'Images/Zombie.png'}, | |
Skeleton:{'Name': 'Skeleton', | |
'Army': 0, | |
'Strength': 2, | |
'IMG': 'Images/Skeleton.png'}, | |
Creeper:{'Name': 'Creeper', | |
'Army': 0, | |
'Strength': 5, | |
'IMG': 'Images/Creeper.png'} | |
}; | |
Enemy.List=[Enemy.Zombie,Enemy.Skeleton,Enemy.Creeper]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment