// @ts-check on
/*
[---WOW! LOOKS LIKE [legacy] CODE!---]
/*
CREDITS:
GAME CREATOR - Noobaz#9612
HELP WITH CODE - gdcocos
SOUNDTRACK - Noobaz#9612 AND meowy66
MOD API - vax325
MARSHMALLOW TOYS - vax325
*/
/*=====================================================================================
LOCALIZATIONS STRINGS
=======================================================================================*/
/**
* Contains all locale strings and methods for they usage
* @namespace Localization
*/
const Localization = {
/**
* Map of localized strings
* @type Map
*/
Strings: new Map,
/**
* Used for finding localized string by key
* @param {string} str Locale string key
* @returns {string}
*/
GetText: (str) => {
let localizedStr = Localization.Strings.get(str);
if (localizedStr == undefined)
return str;
return localizedStr;
}
};
Localization.Strings.set("#ModAPI_AlredyLoaded", "{0} already loaded!");
Localization.Strings.set("#ModAPI_NotLoaded", "{0} not loaded!");
Localization.Strings.set("#ModAPI_ModLoaded", "{0} v{1} loaded!");
Localization.Strings.set("#ModAPI_LoadContinueWithout", "Continue loading without mod \"{0}\"");
Localization.Strings.set("#Game_NewVersion", "<b>New version available : v.{0}!</b>");
Localization.Strings.set("#Game_UpdateNote", "<br>Update note : \"{0}\"");
Localization.Strings.set("#Game_RefreshIt", "<br><b>Refresh to get it!</b>");
Localization.Strings.set("#Game_SaveError", "Error while saving.<br>Export your save instead!");
Localization.Strings.set("#Game_SaveOK", "Game saved");
Localization.Strings.set("#Game_ResetConfirm", "Do you REALLY want to start over?\n(your will lose your progress, but you will keep your achievements and your prestige.)");
Localization.Strings.set("#Game_ResetDone", "Game reset");
Localization.Strings.set("#Game_PrestigeEarn", "You earn {0} heavenly cupcakes!");
Localization.Strings.set("#Game_ResetHard", "Do you REALLY want to wipe your save?\n(you will lose your progress, your achievements, and your prestige!)");
Localization.Strings.set("#Game_ResetHardReally", "Whoah now, are you really, REALLY sure?\n(don\'t say we didn\'t warn you!)");
Localization.Strings.set("#Game_LoadedOK", "Game loaded");
Localization.Strings.set("#Achievement_Sacrifice", "Sacrifice");
Localization.Strings.set("#Achievement_SacrificeDesc", "Reset your game with <b>1 million</b> cupcakes baked.<q>Easy come, easy go.</q>");
Localization.Strings.set("#Achievement_Oblivion", "Oblivion");
Localization.Strings.set("#Achievement_OblivionDesc", "Reset your game with <b>1 billion</b> cupcakes baked.<q>Back to square one.</q>");
Localization.Strings.set("#Achievement_FromScratch", "From scratch");
Localization.Strings.set("#Achievement_FromScratchDesc", "Reset your game with <b>1 trillion</b> cupcakes baked.<q>It\'s been fun.</q>");
Localization.Strings.set("#Achievement_Neverclick", "Neverclick");
Localization.Strings.set("#Achievement_NeverclickDesc", "Make <b>1 million</b> cupcakes by only having clicked <b>15 times</b>.");
Localization.Strings.set("#Achievement_Clicktastic", "Clicktastic");
Localization.Strings.set("#Achievement_ClicktasticDesc", "Make <b>1,000</b> cupcakes from clicking.");
Localization.Strings.set("#Achievement_Clickathlon", "Clickathlon");
Localization.Strings.set("#Achievement_ClickathlonDesc", "Make <b>100,000</b> cupcakes from clicking.");
Localization.Strings.set("#Achievement_Clickolympics", "Clickolympics");
Localization.Strings.set("#Achievement_ClickolympicsDesc", "Make <b>10,000,000</b> cupcakes from clicking.");
Localization.Strings.set("#Achievement_Clickorama", "Clickorama");
Localization.Strings.set("#Achievement_ClickoramaDesc", "Make <b>1,000,000,000</b> cupcakes from clicking.");
Localization.Strings.set("#Achievement_UncannyClicker", "Uncanny clicker");
Localization.Strings.set("#Achievement_UncannyClickerDesc", "Click really, really fast.<q>Well I\'ll be!</q>");
Localization.Strings.set("#Achievement_CheatedCupcakesTasteAwful", "Cheated cupcakes taste awful");
Localization.Strings.set("#Achievement_CheatedCupcakesTasteAwfulDesc", "Hack in some cupcakes.");
Localization.Strings.set("#Achievement_ChocolateLover", "Chocolate Lover");
Localization.Strings.set("#Achievement_ChocolateLoverDesc", "Click <b>5</b> dark chocolate cupcakes.");
Localization.Strings.set("#Achievement_ChocolateFan", "Chocolate Fan");
Localization.Strings.set("#Achievement_ChocolateFanDesc", "Click <b>10</b> dark chocolate cupcakes.");
Localization.Strings.set("#Achievement_ChocolateFrenzy", "Chocolate Frenzy");
Localization.Strings.set("#Achievement_ChocolateFrenzyDesc", "Click <b>20</b> dark chocolate cupcakes.");
Localization.Strings.set("#Achievement_LemonCupcake", "Lemon Cupcake");
Localization.Strings.set("#Achievement_LemonCupcakeDesc", "Click a <b>lemon cupcake</b>.");
Localization.Strings.set("#Achievement_LuckyCupcake", "Lucky cupcake");
Localization.Strings.set("#Achievement_LuckyCupcakeDesc", "Click <b>7 lemon cupcakes</b>.");
Localization.Strings.set("#Achievement_AStrokeOfLuck", "A stroke of luck");
Localization.Strings.set("#Achievement_AStrokeOfLuckDesc", "Click <b>27 lemon cupcakes</b>.");
Localization.Strings.set("#Achievement_HugeLuck", "Huge Luck");
Localization.Strings.set("#Achievement_HugeLuckDesc", "Click <b>77 lemon cupcakes</b>.<q>With such luck in the casino to play</q>");
Localization.Strings.set("#Achievement_Leprechaun", "Leprechaun");
Localization.Strings.set("#Achievement_LeprechaunDesc", "Click <b>777 lemon cupcakes</b>.");
Localization.Strings.set("#Achievement_BlackCatsPaw", "Black cat's paw");
Localization.Strings.set("#Achievement_BlackCatsPawDesc", "Click <b>7777 lemon cupcakes</b>.");
Localization.Strings.set("#Achievement_Click", "Click");
Localization.Strings.set("#Achievement_ClickDesc", "Have <b>1</b> cursor.");
Localization.Strings.set("#Achievement_DoubleClick", "Double-click");
Localization.Strings.set("#Achievement_DoubleClickDesc", "Have <b>2</b> cursors.");
Localization.Strings.set("#Achievement_MouseWheel", "Mouse wheel");
Localization.Strings.set("#Achievement_MouseWheelDesc", "Have <b>50</b> cursors.");
Localization.Strings.set("#Achievement_OfMiceAndMen", "Of Mice and Men");
Localization.Strings.set("#Achievement_OfMiceAndMenDesc", "Have <b>100</b> cursors.");
Localization.Strings.set("#Achievement_TheDigital", "The Digital");
Localization.Strings.set("#Achievement_TheDigitalDesc", "Have <b>200</b> cursors.");
Localization.Strings.set("#Achievement_BusinessStarts", "Business starts!");
Localization.Strings.set("#Achievement_BusinessStartsDesc", "Have <b>1</b> baker");
Localization.Strings.set("#Achievement_Professional", "Professional");
Localization.Strings.set("#Achievement_ProfessionalDesc", "Have <b>50</b> bakers.");
Localization.Strings.set("#Achievement_UltimateBakery", "Ultimate Bakery");
Localization.Strings.set("#Achievement_UltimateBakeryDesc", "Have <b>100</b> bakers.");
Localization.Strings.set("#Achievement_JustWrong", "Just wrong");
Localization.Strings.set("#Achievement_JustWrongDesc", "Sell a baker.<q>Well... goodbye boss...</q>");
Localization.Strings.set("#Achievement_ElderPledge", "Elder Pledge");
Localization.Strings.set("#Achievement_UnlockLabel", "Achievement unlocked :<br>{0}<br> ");
Localization.Strings.set("#Achievement_SkynetAttacks", "Skynet Attacks!");
Localization.Strings.set("#Achievement_SkynetAttacksDesc", "Have <b>1</b> robot baker.");
Localization.Strings.set("#Achievement_SmartBakery", "Smart Bakery");
Localization.Strings.set("#Achievement_SmartBakeryDesc", "Have <b>50</b> robot bakers.");
Localization.Strings.set("#Achievement_UltimateTechnology", "Ultimate Technology");
Localization.Strings.set("#Achievement_UltimateTechnologyDesc", "Have <b>100</b> robot bakers.");
Localization.Strings.set("#Achievement_ProductionChain", "Production chain");
Localization.Strings.set("#Achievement_ProductionChainDesc", "Have <b>1</b> techno furnaces.");
Localization.Strings.set("#Achievement_IndustrialRevolution", "Industrial revolution");
Localization.Strings.set("#Achievement_IndustrialRevolutionDesc", "Have <b>50</b> techno furnaces.");
Localization.Strings.set("#Achievement_GlobalWarming", "Global warming");
Localization.Strings.set("#Achievement_GlobalWarmingDesc", "Have <b>100</b> techno furnaces.");
Localization.Strings.set("#Achievement_Conveyor", "Conveyor!");
Localization.Strings.set("#Achievement_ConveyorDesc", "Have <b>1</b> C-Factory.");
Localization.Strings.set("#Achievement_MolecularPhysics", "Molecular Physics");
Localization.Strings.set("#Achievement_MolecularPhysicsDesc", "Have <b>1</b> Atomic Cupcake.");
Localization.Strings.set("#Achievement_AtomicProgression", "Atomic Progression!");
Localization.Strings.set("#Achievement_AtomicProgressionDesc", "Have <b>50</b> Atomic Cupcakes.");
Localization.Strings.set("#Achievement_AtomicDominance", "Atomic Dominance");
Localization.Strings.set("#Achievement_AtomicDominanceDesc", "Have <b>100</b> Atomic Cupcakes.");
Localization.Strings.set("#Achievement_Transmutation", "Transmutation");
Localization.Strings.set("#Achievement_TransmutationDesc", "Have <b>1</b> alchemy lab.");
Localization.Strings.set("#Achievement_Transmogrification", "Transmogrification");
Localization.Strings.set("#Achievement_TransmogrificationDesc", "Have <b>50</b> alchemy labs.");
Localization.Strings.set("#Achievement_GoldMember", "Gold member");
Localization.Strings.set("#Achievement_GoldMemberDesc", "Have <b>100</b> alchemy labs.");
Localization.Strings.set("#Achievement_PlanetColonization", "Planet Colonization");
Localization.Strings.set("#Achievement_PlanetColonizationDesc", "Have <b>50</b> cupplanets.");
Localization.Strings.set("#Achievement_GalacticDomination", "Galactic Domination");
Localization.Strings.set("#Achievement_GalacticDominationDesc", "Have <b>100</b> cupplanets.");
Localization.Strings.set("#Achievement_EasyBaking", "Easy-baking");
Localization.Strings.set("#Achievement_EasyBakingDesc", "Have <b>1</b> clone machine.");
Localization.Strings.set("#Achievement_Builder", "Builder");
Localization.Strings.set("#Achievement_BuilderDesc", "Own <b>100</b> buildings.");
Localization.Strings.set("#Achievement_Architect", "Architect");
Localization.Strings.set("#Achievement_ArchitectDesc", "Own <b>400</b> buildings.");
Localization.Strings.set("#Achievement_Automation", "Automation");
Localization.Strings.set("#Achievement_AutomationDesc", "Own <b>150</b> robot bakers.");
Localization.Strings.set("#Achievement_ProgressInScience", "Progress in science");
Localization.Strings.set("#Achievement_ProgressInScienceDesc", "Own <b>160</b> robot bakers. <q>AI has become smarter!</q>");
Localization.Strings.set("#Achievement_MachineLearning", "Machine learning");
Localization.Strings.set("#Achievement_MachineLearningDesc", "Own <b>170</b> robot bakers. <q>Robots are now being trained too!</q>");
Localization.Strings.set("#Achievement_Fabricology", "Fabricology");
Localization.Strings.set("#Achievement_FabricologyDesc", "Buy <b>100</b> C-Factories. <q>Large O2 emissions are not a problem!</q>");
Localization.Strings.set("#Achievement_ProductionOptimization", "Production Optimization");
Localization.Strings.set("#Achievement_ProductionOptimizationDesc", "Buy <b>150</b> C-Factories. <q>People are no longer needed!</q>");
Localization.Strings.set("#Achievement_Enhancer", "Enhancer");
Localization.Strings.set("#Achievement_EnhancerDesc", "Purchase <b>20</b> upgrades.");
Localization.Strings.set("#Achievement_Augmenter", "Enhancer");
Localization.Strings.set("#Achievement_AugmenterDesc", "Purchase <b>50</b> upgrades.");
Localization.Strings.set("#Achievement_CupcakeDunker", "Cupcake-dunker");
Localization.Strings.set("#Achievement_CupcakeDunkerDesc", "Dunk the cupcake.<q>You did it!</q>");
Localization.Strings.set("#Achievement_TrueNeverclick", "True Neverclick");
Localization.Strings.set("#Achievement_TrueNeverclickDesc", "Make <b>1 million</b> cupcakes with <b>no</b> cupcake clicks.<q>This kinda defeats the whole purpose, doesn\'t it?</q>");
Localization.Strings.set("#Achievement_CupcakeMaster", "Cupcake Master");
Localization.Strings.set("#Achievement_CupcakeMasterDesc", "Bake <b>1 trillion</b> cupcakes.");
Localization.Strings.set("#Achievement_GodOfCupcakes", "God of Cupcakes");
Localization.Strings.set("#Achievement_GodOfCupcakesDesc", "Bake <b>10 trillion</b> cupcakes.");
Localization.Strings.set("#Achievement_Engineer", "Engineer");
Localization.Strings.set("#Achievement_EngineerDesc", "Own <b>800</b> buildings.");
Localization.Strings.set("#Achievement_Nihilism", "Nihilism");
Localization.Strings.set("#Achievement_NihilismDesc", "Reset your game with <b>1 quadrillion</b> cupcakes baked.<q>There are many things<br>that need to be erased</q>");
Localization.Strings.set("#Achievement_Galactus", "Galactus");
Localization.Strings.set("#Achievement_GalactusDesc", "Reset your game with <b>1 quintillion</b> cupcakes baked. <q>Okay, There is NO any achievements like these.</q>");
Localization.Strings.set("#Achievement_Upgrader", "Upgrader");
Localization.Strings.set("#Achievement_UpgraderDesc", "Purchase <b>100</b> upgrades.");
Localization.Strings.set("#Achievement_SkilledClicker", "Skilled Clicker");
Localization.Strings.set("#Achievement_SkilledClickerDesc", "Click <b>2000</b> times on the cupcake.");
Localization.Strings.set("#Achievement_ClickRecruit", "Click Recruit");
Localization.Strings.set("#Achievement_ClickRecruitDesc", "Click <b>5000</b> times on the cupcake.");
Localization.Strings.set("#Achievement_SpeedyClicker", "Speedy Clicker");
Localization.Strings.set("#Achievement_SpeedyClickerDesc", "Click <b>11000</b> times on the cupcake. <q>Cheetah speed!</q>");
Localization.Strings.set("#Achievement_ClickMaster", "Click Master");
Localization.Strings.set("#Achievement_ClickMasterDesc", "Click <b>23000</b> times on the cupcake.");
Localization.Strings.set("#Achievement_ClickSensei", "Click Sensei");
Localization.Strings.set("#Achievement_ClickSenseiDesc", "Click <b>50000</b> times on the cupcake.");
Localization.Strings.set("#Achievement_Centennial", "Centennial");
Localization.Strings.set("#Achievement_CentennialDesc", "Have at least <b>100 of everything</b>.");
Localization.Strings.set("#Achievement_CyberSpace", "Cyber Space");
Localization.Strings.set("#Achievement_CyberSpaceDesc", "Buy <b>1</b> Cyber Prism. <q>Too much space...</q>");
Localization.Strings.set("#Achievement_CyberneticMind", "Cybernetic Mind");
Localization.Strings.set("#Achievement_CyberneticMindDesc", "Buy <b>10</b> Cyber Prism.");
Localization.Strings.set("#Achievement_TrueSciFi", "True Sci-fi");
Localization.Strings.set("#Achievement_TrueSciFiDesc", "Buy <b>50</b> Cyber Prism. <q>We've built entire underground complexes for these things!</q>");
Localization.Strings.set("#Achievement_Invader", "Invader");
Localization.Strings.set("#Achievement_InvaderDesc", "Have <b>1</b> portal.");
Localization.Strings.set("#Achievement_GlobalConqueror", "Global Conqueror");
Localization.Strings.set("#Achievement_GlobalConquerorDesc", "Have <b>20</b> portals.");
Localization.Strings.set("#Achievement_CupcakesFromAcrossTheMultiverse", "Cupcakes From Across the Multiverse");
Localization.Strings.set("#Achievement_CupcakesFromAcrossTheMultiverseDesc", "Have <b>50</b> portals.");
Localization.Strings.set("#Achievement_ANewWordInScience", "A New Word in Science");
Localization.Strings.set("#Achievement_ANewWordInScienceDesc", "Have <b>1</b> cupcake generator. <q>This technology is quite dangerous, but it is very profitable, let the scientists think about safety.</q>");
Localization.Strings.set("#Achievement_CupcakesOutOfThinAir", "Cupcakes Out of Thin Air");
Localization.Strings.set("#Achievement_CupcakesOutOfThinAirDesc", "Have <b>20</b> cupcake generators. <q>Profits exceed costs.</q>");
Localization.Strings.set("#Achievement_NanoDominance", "Nano Dominance");
Localization.Strings.set("#Achievement_NanoDominanceDesc", "Have <b>50</b> cupcake generators. <q>Now most of the cupcakes we get from generators.</q>");
Localization.Strings.set("#Achievement_CoffeeLover", "Coffee Lover");
Localization.Strings.set("#Achievement_CoffeeLoverDesc", "Reach <b>macchiato</b> coffee.");
Localization.Strings.set("#Achievement_CoffeeExpert", "Coffee Expert");
Localization.Strings.set("#Achievement_CoffeeExpertDesc", "Reach <b>flat white</b> coffee. <q>Cupcakes taste better with coffee.</q>");
Localization.Strings.set("#Achievement_CoffeeLord", "Coffee Lord");
Localization.Strings.set("#Achievement_CoffeeLordDesc", "Reach <b>lungo</b> coffee.");
Localization.Strings.set("#Achievement_Cookies", "Cookies?!");
Localization.Strings.set("#Achievement_CookiesDesc", "Name your bakery using \"Cookie\" word. <q>We do not make cookies.</q>");
Localization.Strings.set("#Achievement_GodComplex", "God Complex");
Localization.Strings.set("#Achievement_GodComplexDesc", "Name your bakery \"Noobaz\". <q>Delusions of grandeur makes itself felt?</q>");
Localization.Strings.set("#Achievement_OpenSesame", "Open Sesame");
Localization.Strings.set("#Achievement_OpenSesameDesc", "Name your bakery \"OpenSesame\". <q>Didnt work, try another time.</q>");
Localization.Strings.set("#Achievement_BlackMesaWannaBe", "Black Mesa wanna be");
Localization.Strings.set("#Achievement_BlackMesaWannaBeDesc", "Buy the 70 Portals. <q>Be accurate with portals - one wrong universe or place and all will ruined...</q>");
Localization.Strings.set("#Achievement_Two", "01110100 01110111 01101111?!");
Localization.Strings.set("#Achievement_TwoDesc", "Buy <b>70</b> Cyber Prisms. <q>Whoa, what an awful dream. Ones and zeros everywhere. And I thought I saw a two.</q>");
Localization.Strings.set("#Achievement_Nice", "Nice");
Localization.Strings.set("#Achievement_NiceDesc", "Buy <b>69</b> Cupcake Generators. <q>When 69th generator was installed they all on one minute started showing \'Nice\' on its screens. Strange.</q>");
Localization.Strings.set("#Achievement_Robotization", "Robotization");
Localization.Strings.set("#Achievement_RobotizationDesc", "Buy <b>1</b> Robot Complex. <q>Many employees were fired due to the effectiveness of robotization.</q>");
Localization.Strings.set("#Achievement_CollectiveMind", "Collective Mind");
Localization.Strings.set("#Achievement_CollectiveMindDesc", "Buy <b>5</b> Robot Complexes.");
Localization.Strings.set('#Achievement_WorldFilled', 'World Filled With Cupcakes');
Localization.Strings.set('#Achievement_WorldFilledDesc', 'Bake <b>10,000,000,000</b> cupcakes. <q>The whole world is buying your cupcakes.</q>');
Localization.Strings.set('#Achievement_DevilMadeMe', 'Devil Made Me Do It');
Localization.Strings.set('#Achievement_DevilMadeMeDesc', 'Buy <b>Satanic Cupcake</b>');
Localization.Strings.set('#Achievement_InfiniteCupcakes', "Infinite Cupcakes");
Localization.Strings.set('#Achievement_InfiniteCupcakesDesc', "Bake <b>100,000,000,000</b> cupcakes. <q>There is no such place where there were no cupcakes!</q>");
// Localization.Strings.set('#Achievement_CodedToReality', "Coded To Reality");
// Localization.Strings.set('#Achievement_CodedToRealityDesc', "Buy <b>20</b> Cyber Prisms. <q>These cyber prisms are very useful, but they require a fairly large staff headquarters...</q>");
Localization.Strings.set('#Achievement_CloneConveyor', "Clone Conveyor");
Localization.Strings.set('#Achievement_CloneConveyorDesc', "Buy <b>30</b> Clone Machines. <q>Maybe start cloning clone machines?</q>");
Localization.Strings.set('#Achievement_ClickyClick', "Clicky Click");
Localization.Strings.set('#Achievement_ClickyClickDesc', "Click <b>20,000</b> times. <q>Too many clicks...</q>");
Localization.Strings.set('#Achievement_HellClicker', "Hell Clicker");
Localization.Strings.set('#Achievement_HellClickerDesc', "Click <b>30,000</b> times. <q>Have you broken your mouse yet?</q>");
Localization.Strings.set('#Achievement_SacredDelight', "Sacred Delight");
Localization.Strings.set('#Achievement_SacredDelightDesc', "Get <b>10</b> Heavenly Cupcakes. <q>Reset - Holy cause.</q>");
Localization.Strings.set('#Achievement_ParadiseConditions', "Paradise Conditions");
Localization.Strings.set('#Achievement_ParadiseConditionsDesc', "Get <b>30</b> Heavenly Cupcakes. <q>With such capital, you can live like in paradise!</q>");
Localization.Strings.set('#Achievement_AgainAndAgain', "Again And Again");
Localization.Strings.set('#Achievement_AgainAndAgainDesc', "Get <b>70</b> Heavenly Cupcakes. <q>Reset again and again and again and again...</q>");
Localization.Strings.set('#Achievement_EndlessCycle', "Endless Cycle");
Localization.Strings.set('#Achievement_EndlessCycleDesc', "Get <b>100</b> Heavenly Cupcakes. <q>Forward on an endless cycle of wealth!</q>");
Localization.Strings.set("#Achievement_CosmicConfectioner", "Cosmic Confectioner");
Localization.Strings.set("#Achievement_CosmicConfectionerDesc", "Buy <b>1</b> Cupcake Galaxy. <q>Your baking skills have reached cosmic proportions!</q>");
Localization.Strings.set("#Achievement_NebulaNavigator", "Nebula Navigator");
Localization.Strings.set("#Achievement_NebulaNavigatorDesc", "Buy <b>5</b> Cupcake Galaxies. <q>You've navigated through the vastness of space, discovering new cupcake realms!</q>");
Localization.Strings.set('#Achievement_LongHaul', "Long Haul");
Localization.Strings.set('#Achievement_LongHaulDesc', "Spend <b>5 days</b> in the game. <q>Eh, not so long.</q>");
// Localization.Strings.set("#Achievement_IntergalacticMaster", "Intergalactic Master");
// Localization.Strings.set("#Achievement_IntergalacticMasterDesc", "Buy <b>15</b> Cupcake Galaxies. <q>You've become the ultimate master of cupcake production across the cosmos!</q>");
Localization.Strings.set('#Achievement_Reincarnation', "Reincarnation");
Localization.Strings.set('#Achievement_ReincarnationDesc', "Get <b>200</b> Heavenly Cupcakes.");
Localization.Strings.set('#Achievement_DivineBaker', "Divine Baker");
Localization.Strings.set('#Achievement_DivineBakerDesc', "Get <b>500</b> Heavenly Cupcakes. <q>We can make even angels jealous!</q>");
Localization.Strings.set('#Achievement_CelestialCravings', "Celestial Cravings");
Localization.Strings.set('#Achievement_CelestialCravingsDesc', "Get <b>1,000</b> Heavenly Cupcakes.");
Localization.Strings.set('#Achievement_AngelsSweetTooth', "Angel\'s Sweet Tooth");
Localization.Strings.set('#Achievement_AngelsSweetToothDesc', "Get <b>2,000</b> Heavenly Cupcakes.");
Localization.Strings.set('#Achievement_EtherealMastery', "Ethereal Mastery");
Localization.Strings.set('#Achievement_EtherealMasteryDesc', "Get <b>5,000</b> Heavenly Cupcakes. <q>Thats a lot!</q>");
Localization.Strings.set('#Achievement_DivinePerfection', "Divine Perfection");
Localization.Strings.set('#Achievement_DivinePerfectionDesc', "Get <b>10,000</b> Heavenly Cupcakes. <q>We've reached absolute perfection!</q>");
Localization.Strings.set('#Achievement_MarshmallowRain', "Marshmallow Rain");
Localization.Strings.set('#Achievement_MarshmallowRainDesc', "Name yourself <b>MallowRain</b> and start <b>Marshmallow Rain</b>. <q>So many marshmallows...</q>");
Localization.Strings.set('#Achievement_JustPurrfect', "Just Purrfect");
Localization.Strings.set('#Achievement_JustPurrfectDesc', "Name yourself <b>Purrfect</b> and summon <b>The Cat</b>.");
Localization.Strings.set('#Achievement_CupcakeFell', "Cupcake Fell");
Localization.Strings.set('#Achievement_CupcakeFellDesc', "Name yourself <b>CupFell</b> and <b>drop the cupcake</b>.");
Localization.Strings.set("#Upgrade_ThousandFingers", "Thousand fingers");
Localization.Strings.set("#Upgrade_ThousandFingersDesc", "The mouse and cursors gain <b>+0.1</b> cupcakes for each non-cursor object owned.<q>clickity</q>");
Localization.Strings.set("#Upgrade_MillionFingers", "Million fingers");
Localization.Strings.set("#Upgrade_MillionFingersDesc", "The mouse and cursors gain <b>+0.5</b> cupcakes for each non-cursor object owned.<q>clickityclickity</q>");
Localization.Strings.set("#Upgrade_BillionFingers", "Billion fingers");
Localization.Strings.set("#Upgrade_BillionFingersDesc", "The mouse and cursors gain <b>+2</b> cupcakes for each non-cursor object owned.<q>clickityclickityclickity</q>");
Localization.Strings.set("#Upgrade_TrillionFingers", "Trillion fingers");
Localization.Strings.set("#Upgrade_TrillionFingersDesc", "The mouse and cursors gain <b>+10</b> cupcakes for each non-cursor object owned.<q>clickityclickityclickityclickity</q>");
Localization.Strings.set("#Upgrade_QuadrillionFingers", "Quadrillion fingers");
Localization.Strings.set("#Upgrade_QuadrillionFingersDesc", "The mouse and cursors gain <b>+20</b> cupcakes for each non-cursor object owned.<q>clickityclickityclickityclickityclick</q>");
Localization.Strings.set("#Upgrade_QuintillionFingers", "Quintillion fingers");
Localization.Strings.set("#Upgrade_QuintillionFingersDesc", "The mouse and cursors gain <b>+100</b> cupcakes for each non-cursor object owned.<q>man, just go click click click click click, it\'s real easy, man.</q>");
Localization.Strings.set("#Upgrade_PlasticMouse", "Plastic mouse");
Localization.Strings.set("#Upgrade_PlasticMouseDesc", "Clicking gains <b>+1% of your CpS</b>.");
Localization.Strings.set("#Upgrade_IronMouse", "Iron mouse");
Localization.Strings.set("#Upgrade_IronMouseDesc", "Clicking gains <b>+1% of your CpS</b>.");
Localization.Strings.set("#Upgrade_TitaniumMouse", "Titanium mouse");
Localization.Strings.set("#Upgrade_TitaniumMouseDesc", "Clicking gains <b>+1% of your CpS</b>.");
Localization.Strings.set("#Upgrade_AdamantiumMouse", "Adamantium mouse");
Localization.Strings.set("#Upgrade_AdamantiumMouseDesc", "Clicking gains <b>+1% of your CpS</b>.");
Localization.Strings.set("#Upgrade_VibraniumMouse", "Vibranium mouse");
Localization.Strings.set("#Upgrade_VibraniumMouseDesc", "Clicking gains <b>+1% of your CpS</b>.");
Localization.Strings.set("#Upgrade_ReinforcedIndexFinger", "Reinforced index finger");
Localization.Strings.set("#Upgrade_ReinforcedIndexFingerDesc", "The mouse gains <b>+1</b> cupcake per click.<br>Cursors gain <b>+0.1</b> base CpS.<q>prod prod</q>");
Localization.Strings.set("#Upgrade_CarpalTunnelPreventionCream", "Carpal tunnel prevention cream");
Localization.Strings.set("#Upgrade_Ambidextrous", "Ambidextrous");
Localization.Strings.set("#Upgrade_AmbidextrousDesc", "The mouse and cursors are <b>twice</b> as efficient.<q>Look ma, both hands!</q>");
Localization.Strings.set("#Upgrade_SpecializedChocolateChips", "Specialized chocolate chips");
Localization.Strings.set("#Upgrade_DesignerCocoaBeans", "Designer cocoa beans");
Localization.Strings.set("#Upgrade_UnderworldOvens", "Underworld ovens");
Localization.Strings.set("#Upgrade_ExoticNuts", "Exotic nuts");
Localization.Strings.set("#Upgrade_ArcaneSugar", "Arcane sugar");
Localization.Strings.set("#Upgrade_MonosodiumGlutamate", "Monosodium Glutamate");
Localization.Strings.set("#Upgrade_MonosodiumGlutamateDesc", "Gives <b>+100</b> to your base CpS. <q>This enhancer will make our cupcakes even tastier and better!</q>");
Localization.Strings.set("#Upgrade_SatanicRitual", "Satanic Ritual");
Localization.Strings.set("#Upgrade_SatanicRitualDesc", "cupcake production multiplier <b>+15%</b>. <q>We need to move on, since science is powerless, lets turn to higher powers.");
Localization.Strings.set("#Upgrade_ResearchCenters", "Research Centers");
Localization.Strings.set("#Upgrade_ResearchCentersDesc", "cupcakes production multiplier <b>+300</b>. <q>These centers help a lot in the scientific part, so that more and more efforts can be put into making cupcakes.</q>");
Localization.Strings.set("#Upgrade_KittenHelpers", "Kitten helpers");
Localization.Strings.set("#Upgrade_KittenWorkers", "Kitten workers");
Localization.Strings.set("#Upgrade_KittenEngineers", "Kitten engineers");
Localization.Strings.set("#Upgrade_KittenOverseers", "Kitten overseers");
Localization.Strings.set("#Upgrade_ElderCovenant", "Elder Covenant");
Localization.Strings.set("#Upgrade_ElderCovenantDesc", "[Switch]<br>Puts a permanent end to the elders\' wrath, at the price of 5% of your CpS.");
Localization.Strings.set("#Upgrade_RevokeElderCovenant", "Revoke Elder Covenant");
Localization.Strings.set("#Upgrade_RevokeElderCovenantDesc", "[Switch]<br>You will get 5% of your CpS back, but the bakertriarchs will return.");
Localization.Strings.set("#Upgrade_GetLucky", "Get lucky");
Localization.Strings.set("#Upgrade_GetLuckyDesc", "Lemon cupcake effects last <b>twice as long</b>.<q>I\'m up all night to get cupcakes.</q>");
Localization.Strings.set("#Upgrade_LuckyDay", "Lucky day");
Localization.Strings.set("#Upgrade_LuckyDayDesc", "Lemon cupcakes appear <b>twice as often</b> and last <b>twice as long</b>.<q>Ooh... a lemon cupcake!</q>");
Localization.Strings.set("#Upgrade_Serendipity", "Serendipity");
Localization.Strings.set("#Upgrade_SerendipityDesc", "Lemon cupcakes appear <b>twice as often</b> and last <b>twice as long</b><q>It\'s my lucky day!</q>.");
Localization.Strings.set("#Upgrade_GoldHoard", "Gold hoard");
Localization.Strings.set("#Upgrade_GoldHoardDesc", "Lemon cupcakes appear <b>really often</b>.");
Localization.Strings.set("#Upgrade_Neuromancy", "Neuromancy");
Localization.Strings.set("#Upgrade_NeuromancyDesc", "Can toggle upgrades on and off at will in the stats menu.");
Localization.Strings.set("#Upgrade_FarmerBakers", "Farmer bakers");
Localization.Strings.set("#Upgrade_WorkerBakers", "Worker bakers");
Localization.Strings.set("#Upgrade_CFactoryrBakers", "C-Factoryr bakers");
Localization.Strings.set("#Upgrade_CosmicBakers", "Cosmic bakers");
Localization.Strings.set("#Upgrade_AlteredBakers", "Altered bakers");
Localization.Strings.set("#Upgrade_RitualRollingPins", "Ritual rolling pins");
Localization.Strings.set("#Upgrade_OneMind", "One mind");
Localization.Strings.set("#Upgrade_CommunalBrainsweep", "Communal brainsweep");
Localization.Strings.set("#Upgrade_ElderPact", "Elder Pact");
Localization.Strings.set("#Upgrade_PruneJuice", "Prune juice");
Localization.Strings.set("#Upgrade_PruneJuiceDesc", "Bakers are <b>twice</b> as efficient.<q>Gets me going.</q>");
Localization.Strings.set("#Upgrade_SalaryIncrease", "Salary Increase");
Localization.Strings.set("#Upgrade_SalaryIncreaseDesc", "Bakers are <b>twice</b> as efficient. <q>The higher the salary, the higher the efficiency!</q>");
Localization.Strings.set("#Upgrade_EMailFromBaker", "E-mail from Baker");
Localization.Strings.set("#Upgrade_EMailFromBakerDesc", "Baker gain <b>+0.3</b> base CpS.<q>Click click click</q>");
Localization.Strings.set("#Upgrade_SteelPlatedPins", "Steel-plated pins");
Localization.Strings.set("#Upgrade_SteelPlatedPinsDesc", "Baker are <b>twice</b> as efficient.");
Localization.Strings.set("#Upgrade_NewDough", "New dough");
Localization.Strings.set("#Upgrade_NewDoughDesc", "Baker are <b>twice</b> as efficient.<q>Great dough!</q>");
Localization.Strings.set("#Upgrade_SpareParts", "Spare parts");
Localization.Strings.set("#Upgrade_SparePartsDesc", "Robot Bakers gain <b>+0.5</b> base CpS.");
Localization.Strings.set("#Upgrade_AI", "AI");
Localization.Strings.set("#Upgrade_AIDesc", "Robot Bakers are <b>twice</b> as efficient.<q>New APPLE technology.</q>");
Localization.Strings.set("#Upgrade_ImprovedConnection", "Improved Connection");
Localization.Strings.set("#Upgrade_ImprovedConnectionDesc", "Robot Bakers are <b>twice</b> as efficient.<q>Faster Internet!</q>");
Localization.Strings.set("#Upgrade_NewFuel", "New fuel");
Localization.Strings.set("#Upgrade_NewFuelDesc", "Techno furnace gain <b>+4</b> base CpS.");
Localization.Strings.set("#Upgrade_IncreasedVoltage", "Increased voltage");
Localization.Strings.set("#Upgrade_IncreasedVoltageDesc", "Techno furnace are <b>twice</b> as efficient.<q>2x faster!</q>");
Localization.Strings.set("#Upgrade_UpdatedFurnaceMaterial", "Updated furnace material");
Localization.Strings.set("#Upgrade_UpdatedFurnaceMaterialDesc", "Techno furnace are <b>twice</b> as efficient.<q>2x stronger!</q>");
Localization.Strings.set("#Upgrade_ProductionOver9000", "Production over 9000");
Localization.Strings.set("#Upgrade_ProductionOver9000Desc", "C-Factories gain <b>+10</b> base CpS.");
Localization.Strings.set("#Upgrade_MolecularPhysics", "Molecular Physics");
Localization.Strings.set("#Upgrade_MolecularPhysicsDesc", "Atomic Cupcakes gain <b>+30</b> base CpS.");
Localization.Strings.set("#Upgrade_NewTechnology", "New technology");
Localization.Strings.set("#Upgrade_NewTechnologyDesc", "Atomic Cupcakes are <b>twice</b> as efficient.<q>We created over 1 million cupcakes from 1 chair.</q>");
Localization.Strings.set("#Upgrade_Antimony", "Antimony");
Localization.Strings.set("#Upgrade_AntimonyDesc", "Alchemy labs gain <b>+80</b> base CpS.<q>Actually worth a lot of mony.</q>");
Localization.Strings.set("#Upgrade_EssenceOfDough", "Essence of dough");
Localization.Strings.set("#Upgrade_EssenceOfDoughDesc", "Alchemy labs are <b>twice</b> as efficient.<q>Extracted through the 5 ancient steps of alchemical baking.</q>");
Localization.Strings.set("#Upgrade_NewCivilization", "New Civilization");
Localization.Strings.set("#Upgrade_NewCivilizationDesc", "CupPlanets gain <b>+1,666</b> base CpS.<q>Hole new civilization!</q>");
Localization.Strings.set("#Upgrade_FastProcessing", "Fast Processing");
Localization.Strings.set("#Upgrade_FastProcessingDesc", "Cyber prism gain <b>+1000</b> base CpS.<q>Faster quantum processors.</q>");
Localization.Strings.set("#Upgrade_CyberNet", "CyberNet");
Localization.Strings.set("#Upgrade_CyberNetDesc", "Cyber prism are <b>twice</b> as efficient.<q>One control panel for all?..</q>");
Localization.Strings.set("#Upgrade_CyberBakers", "Cyber Bakers");
Localization.Strings.set("#Upgrade_CyberBakersDesc", "Cyber prism are <b>twice</b> as efficient.<q>Bakers can now work on the other side!</q>");
Localization.Strings.set("#Upgrade_NewWorlds", "New Worlds");
Localization.Strings.set("#Upgrade_NewWorldsDesc", "Portals gain <b>+5000</b> base CpS.<q>The first experiments were successful!</q>");
Localization.Strings.set("#Upgrade_QuantumTransfer", "Quantum Transfer");
Localization.Strings.set("#Upgrade_QuantumTransferDesc", "Portals are <b>twice</b> as efficient.<q>So many worlds for new factories.</q>");
Localization.Strings.set("#Upgrade_NewDiscoveries", "New Discoveries");
Localization.Strings.set("#Upgrade_NewDiscoveriesDesc", "Cupcake Generators gain <b>+10000</b> base CpS. <q>Our research has gone very far. Cupcakes out of thin air - profit without loss. I love this technology.</q>");
Localization.Strings.set("#Upgrade_StabilizationTechnology", "Stabilization Technology");
Localization.Strings.set("#Upgrade_StabilizationTechnologyDesc", "Cupcake Generators are <b>twice</b> as efficient. <q>This technology will make generators 100% safe and stable.</q>");
Localization.Strings.set("#Upgrade_GeneticallyModifiedCupcakes", "Genetically-modified cupcakes");
Localization.Strings.set("#Upgrade_GeneticallyModifiedCupcakesDesc", "Robot Bakers are <b>twice</b> as efficient.<q>All-natural mutations.</q>");
Localization.Strings.set("#Upgrade_RadiumReactors", "Radium reactors");
Localization.Strings.set("#Upgrade_RadiumReactorsDesc", "Techno furnances are <b>twice</b> as efficient.<q>Gives your cupcakes a healthy glow.</q>");
Localization.Strings.set("#Upgrade_CupcakeEngineers", "Cupcake engineers");
Localization.Strings.set("#Upgrade_CupcakeEngineersDesc", "You gain <b>more CpS</b> the more coffee you have.<q>Engineering future, full of cupcakes.</q>");
Localization.Strings.set("#Upgrade_LemonFlavoredCupcake", "Lemon-flavored Cupcake");
Localization.Strings.set("#Upgrade_LemonFlavoredCupcakeDesc", "cupcake production multiplier <b>+15%</b>.");
Localization.Strings.set("#Upgrade_CyanCupcake", "Cyan Cupcake");
Localization.Strings.set("#Upgrade_CyanCupcakeDesc", "cupcake production multiplier <b>+15%</b>.");
Localization.Strings.set("#Upgrade_BlackberryCupcake", "Blackberry cupcake");
Localization.Strings.set("#Upgrade_BlackberryCupcakeDesc", "cupcake production multiplier <b>+15%</b>.");
Localization.Strings.set("#Upgrade_SNUSBattery", "S.N.U.S. Battery");
Localization.Strings.set("#Upgrade_SNUSBatteryDesc", "Cyber prisms are <b>twice</b> as efficient. <q>SuperNanoUltraSpeed Battery? Such a stupid naming...</q>");
Localization.Strings.set("#Upgrade_ElderCalm", "Elder calm");
Localization.Strings.set("#Upgrade_SacrificialRollingPins", "Sacrificial rolling pins");
Localization.Strings.set("#Upgrade_SacrificialRollingPinsDesc", "Elder pledge last <b>twice</b> as long.");
Localization.Strings.set("#Upgrade_CupcakeOverseers", "Cupcake overseers");
Localization.Strings.set("#Upgrade_CupcakeOverseersDesc", "You gain <b>more CpS</b> the more coffee you have.<q>my purrpose is to serve you, sir</q>");
Localization.Strings.set("#Upgrade_NewHorizons", "New Horizons");
Localization.Strings.set("#Upgrade_NewHorizonsDesc", "Portals are <b>twice</b> as efficient. <q>The more new dimensions we open, the more portals we need!</q>");
Localization.Strings.set("#Upgrade_TernaryCode", "Ternary Code");
Localization.Strings.set("#Upgrade_TernaryCodeDesc", "Cyber prisms are <b>twice</b> as efficient. <q>The binary code behind, its time to move on.</q>");
Localization.Strings.set("#Upgrade_FasterGenerators", "Faster Generators");
Localization.Strings.set("#Upgrade_FasterGeneratorsDesc", "Cupcake Generators are <b>twice</b> as efficient.");
Localization.Strings.set("#Upgrade_Galactus", "Galactus");
Localization.Strings.set("#Upgrade_GalactusDesc", "cupcake production multiplier <b>+50%</b> <q>Wow, that thing is huge!</q>");
Localization.Strings.set("#Upgrade_SellingMedia", "Selling Media");
Localization.Strings.set("#Upgrade_SellingMediaDesc", "cupcake production multiplier <b>+50%</b> <q>Media is pretty easy to buy.</q>");
Localization.Strings.set("#Upgrade_CupcakeStringTheoryBasedDimensions", "Cupcake-String Theory based Dimensions");
Localization.Strings.set("#Upgrade_CupcakeStringTheoryBasedDimensionsDesc", "Portals are <b>twice</b> as efficient. <q>By new research has been discovered whole universes from cupcakes!</q>");
Localization.Strings.set("#Upgrade_CupcakeGPT", "CupcakeGPT");
Localization.Strings.set("#Upgrade_CupcakeGPTDesc", "Cyber Prism are <b>twice</b> as efficient. <q>By newest research has been created first strong AI, producing the binary code!</q>");
Localization.Strings.set("#Upgrade_SpecialCupcakePhysics", "Special Cupcake Physics");
Localization.Strings.set("#Upgrade_SpecialCupcakePhysicsGPTDesc", "Cupcake Generators are <b>twice</b> as efficient. <q>Science has been pushed by bakes. What a sensation!</q>");
Localization.Strings.set("#Upgrade_AdvancedOrganicChemistryTheory", "Advanced Organic Chemistry Theory");
Localization.Strings.set("#Upgrade_AdvancedOrganicChemistryTheoryDesc", "Twice up the Clone Machine efficiency. <q>By <s>slaving</s> cooperation with important scientist has been developed the AOCT - Advanced Organic Chemistry Theory.</q>");
Localization.Strings.set("#Upgrade_NowFrom4815162342Grams", "Now from 4.815162342 grams");
Localization.Strings.set("#Upgrade_NowFrom4815162342GramsDesc", "Twice up the Clone Machine efficiency. <q>By new developed substance - The Monomer - Clone Machines now can produce one cupcake from 4.815162342 grams of substance. Yes, we calculated.</q>");
Localization.Strings.set("#Upgrade_FabergeAccuracyMechanisms", "Faberge-accuracy mechanisms");
Localization.Strings.set("#Upgrade_FabergeAccuracyMechanismsDesc", "Quaters up the Clone Machine efficency. <q>Best masters from world updating your mechanisms for reaching ridiculous 95% of efficiency!</q>");
Localization.Strings.set("#Upgrade_ChemicalAdditiveGamma2", "Chemical Additive \"Gamma-2\"");
Localization.Strings.set("#Upgrade_ChemicalAdditiveGamma2Desc", "cupcake production multiplier <b>+65%</b> <q>This new chemical additive will be slightly addictive, which will increase sales, and it also improves the taste!</q>");
Localization.Strings.set("#Upgrade_ImprovedRobots", "Improved Robots");
Localization.Strings.set("#Upgrade_ImprovedRobotsDesc", "Robot Complex are <b>twice</b> as efficient. <q>Better, Smarter, Faster...</q>");
Localization.Strings.set("#Upgrade_ImprovedControlSystem", "Improved Control System");
Localization.Strings.set("#Upgrade_ImprovedControlSystemDesc", "Robot Complex are <b>twice</b> as efficient. <q>Now it has become much more convenient to control the complex.</q>");
Localization.Strings.set("#Upgrade_NewInvestments", "New Investments");
Localization.Strings.set("#Upgrade_NewInvestmentsDesc", "Cupcake production multiplier <b>+75%</b> <q>Ah, new investments! How wonderful that we can now invest our precious cupcakes into something utterly useless and incomprehensible. Because, of course, instead of enjoying the taste of their delights, let's rather have them work for us like little soulless worker bees. Now that's what I call a true culinary experience!</q>");
Localization.Strings.set("#Upgrade_CyberSlavery", "Cyber Slavery");
Localization.Strings.set("#Upgrade_CyberSlaveryDesc", "Robot Complex are <b>twice</b> as efficient. <q>With the help of cybertechnologies it is easier to influence the minds of people.</q>");
Localization.Strings.set("#Upgrade_LaborUnion", "Labor Union");
Localization.Strings.set("#Upgrade_LaborUnionDesc", "Bakers are <b>twice</b> as efficient. <q>The Labor Union will help unite bakers and make them work better!</q>");
Localization.Strings.set("#Upgrade_StrawberryCupcake", "Strawberry Cupcake");
Localization.Strings.set("#Upgrade_StrawberryCupcakeDesc", "cupcake production multiplier <b>+20%</b>");
Localization.Strings.set("#Upgrade_CosmicCupcake", "Cosmic Cupcake");
Localization.Strings.set("#Upgrade_CosmicCupcakeDesc", "cupcake production multiplier <b>+40%</b> <q>This cupcake was created using space technology.</q>");
Localization.Strings.set('#Upgrade_CurrantCupcake', "Currant Cupcake");
Localization.Strings.set('#Upgrade_CurrantCupcakeDesc', "cupcake production multiplier <b>+10%</b>");
Localization.Strings.set('#Upgrade_RaspberryCupcake', "Raspberry Cupcake");
Localization.Strings.set('#Upgrade_RaspberryCupcakeDesc', "cupcake production multiplier <b>+10%</b>");
Localization.Strings.set('#Upgrade_VanillaCupcake', "Vanilla Cupcake");
Localization.Strings.set('#Upgrade_VanillaCupcakeDesc', "cupcake production multiplier <b>+10%</b> <q>They are simply perfect for those who seek nothing special.</q>");
Localization.Strings.set('#Upgrade_StarCupcake', "Star Cupcake");
Localization.Strings.set('#Upgrade_StarCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Star cupcakes! They are so special, like a shooting star in a world of boundless flavor! Imagine your taste receptors being dazzled by sparkling stars that, of course, have no effect on the taste whatsoever.</q>");
Localization.Strings.set('#Upgrade_Marshmallow', "Vanilla Marshmallow");
Localization.Strings.set('#Upgrade_MarshmallowDesc', "cupcake production multiplier <b>+20%</b> <q>It turns out that marshmallows go well with coffee.</q>");
Localization.Strings.set('#Upgrade_FractalCookie', "Fractal Cookie");
Localization.Strings.set('#Upgrade_FractalCookieDesc', "cupcake production multiplier <b>+20%</b> <q>We don't seem to make cookies, do we?</q>");
Localization.Strings.set('#Upgrade_ChocolateCupcake', "Chocolate Cupcake");
Localization.Strings.set('#Upgrade_ChocolateCupcakeDesc', "cupcake production multiplier <b>+20%</b>");
Localization.Strings.set('#Upgrade_SatanicCupcake', "Satanic Cupcake");
Localization.Strings.set('#Upgrade_SatanicCupcakeDesc', "cupcake production multiplier <b>+20%</b> and also summons the <b>eye of the devil</b> and opens <b>blood coffee</b> <q>Baked with dark forces that help increase cupcake production.</q>");
Localization.Strings.set('#Upgrade_MusicCupcake', "Music Cupcake");
Localization.Strings.set('#Upgrade_MusicCupcakeDesc', "cupcake production multiplier <b>+20%</b>");
Localization.Strings.set('#Upgrade_IndustrialCupcake', "Industrial Cupcake");
Localization.Strings.set('#Upgrade_IndustrialCupcakeDesc', "cupcake production multiplier <b>+20%</b>");
Localization.Strings.set('#Upgrade_BinaryCupcake', "Binary Cupcake");
Localization.Strings.set('#Upgrade_BinaryCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Binary code inside a cupcake? What a great idea!</q>");
Localization.Strings.set('#Upgrade_EnergyCupcake', "Energy Cupcake");
Localization.Strings.set('#Upgrade_EnergyCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>A charged cupcake is a good stimulant!</q>");
Localization.Strings.set('#Upgrade_BlackHoleCupcake', "Black Hole Cupcake");
Localization.Strings.set('#Upgrade_BlackHoleCupcakeDesc', "cupcake production multiplier <b>+40%</b> <q>Just a cupcake with a beautiful design... However, it can absorb objects?..</q>");
Localization.Strings.set('#Upgrade_FrostCupcake', "Frost Cupcake");
Localization.Strings.set('#Upgrade_FrostCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>This cupcake is pretty cold... Well, cupcake and ice cream in one!</q>");
Localization.Strings.set('#Upgrade_CursorCupcake', "Cursor Cupcake");
Localization.Strings.set('#Upgrade_CursorCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>More clicks - more cupcakes!</q>");
Localization.Strings.set('#Upgrade_LimeCupcake', "Lime Cupcake");
Localization.Strings.set('#Upgrade_LimeCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Ah, lime cupcakes, a wonderful combination of exquisite artificial color and subtle absence of real lime flavor. They will be such a lovely reminder of how important it is to not only look fresh and appetizing but also be completely devoid of any meaning on the inside.</q>");
Localization.Strings.set('#Upgrade_BritishCupcake', "British Cupcake");
Localization.Strings.set('#Upgrade_BritishCupcakeDesc', "cupcake production multiplier <b>+40%</b> <q>Well, hopefully the themed cupcake will boost sales in the UK.</q>");
Localization.Strings.set('#Upgrade_OrangeCupcake', "Orange Cupcake");
Localization.Strings.set('#Upgrade_OrangeCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Oh, sure, orange cupcakes! Because, as we all know, nothing makes cupcakes tastier than artificial color and absolutely no real orange flavor. Just a fantastic choice for those who want to try something that doesn't resemble real orange at all!</q>");
Localization.Strings.set('#Upgrade_AstronomyCupcake', "Astronomy Cupcake");
Localization.Strings.set('#Upgrade_AstronomyCupcakeDesc', "cupcake production multiplier <b>+40%</b> <q>Wow, stars looks so real!</q>");
Localization.Strings.set('#Upgrade_AtomicCupcake', "Atomic Cupcake");
Localization.Strings.set('#Upgrade_AtomicCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Atomic Energy has never tasted so good!</q>");
Localization.Strings.set('#Upgrade_QuantumUncertaintyCupcake', "Quantum Uncertainty Cupcake");
Localization.Strings.set('#Upgrade_QuantumUncertaintyCupcakeDesc', "cupcake production multiplier <b>+20%</b>");
Localization.Strings.set('#Upgrade_DieselpunkCupcake', "Dieselpunk Cupcake");
Localization.Strings.set('#Upgrade_DieselpunkCupcakeDesc', "cupcake production multiplier <b>+20%</b>");
Localization.Strings.set('#Upgrade_CloudNineBoost', "Cloud Nine Boost");
Localization.Strings.set('#Upgrade_CloudNineBoostDesc', "cupcake production multiplier <b>+50%</b> <q>Get ready for cloud nine taste sensations!</q>");
Localization.Strings.set('#Upgrade_HeavenlyHands', "Heavenly Hands");
Localization.Strings.set('#Upgrade_HeavenlyHandsDesc', "cupcake production multiplier <b>+60%</b> <q>Our team has been blessed with celestial strength to ensure top notch service.</q>");
Localization.Strings.set('#Upgrade_DivineDeliverySystem', "Divine Delivery System");
Localization.Strings.set('#Upgrade_DivineDeliverySystemDesc', "cupcake production multiplier <b>+70%</b> <q>It's like magic, how fast our cupcakes get delivered now.</q>");
Localization.Strings.set('#Upgrade_FoodScience', "Food Science");
Localization.Strings.set('#Upgrade_FoodScienceDesc', "cupcake production multiplier <b>+20%</b> <q>Let's take culinary arts to the next level!</q>");
Localization.Strings.set('#Upgrade_RoboticsUpgrade', "Robotics Upgrade");
Localization.Strings.set('#Upgrade_RoboticsUpgradeDesc', "cupcake production multiplier <b>+20%</b> <q>Why rely solely on human labor when robots can do it faster AND better?</q>");
Localization.Strings.set('#Upgrade_SyntheticBiology', "Synthetic Biology");
Localization.Strings.set('#Upgrade_SyntheticBiologyDesc', "cupcake production multiplier <b>+20%</b> <q>We didn't reinvent the wheel; we synthesized an entirely new dessert vehicle!</q>");
Localization.Strings.set('#Upgrade_BakingMastery', "Baking Mastery");
Localization.Strings.set('#Upgrade_BakingMasteryDesc', "cupcake production multiplier <b>+20%</b> <q>Become a master of the baking arts and produce cupcakes like never before!</q>");
Localization.Strings.set('#Upgrade_FrostingInnovation', "Frosting Innovation");
Localization.Strings.set('#Upgrade_FrostingInnovationDesc', "cupcake production multiplier <b>+20%</b> <q>Revolutionize the cupcake industry with innovative new frosting techniques!</q>");
Localization.Strings.set('#Upgrade_FlavorFusion', "Flavor Fusion");
Localization.Strings.set('#Upgrade_FlavorFusionDesc', "cupcake production multiplier <b>+20%</b> <q>Combine unexpected flavors to create a taste sensation that will have customers lining up around the block!</q>");
Localization.Strings.set('#Upgrade_AdvancedBaking', "Advanced Baking");
Localization.Strings.set('#Upgrade_AdvancedBakingDesc', "cupcake production multiplier <b>+40%</b> <q>Let's take our baking skills to the next level!</q>");
Localization.Strings.set('#Upgrade_SunshineCoastCupcake', "Sunshine Coast Cupcake");
Localization.Strings.set('#Upgrade_SunshineCoastCupcakeDesc', "cupcake production multiplier <b>+30%</b> <q>What a lovely Sunshine Coast Cupcake! Because nothing can be better than a cupcake that reminds you of the sunny coast. Add a sprinkle of sand and little umbrellas, and you'll feel like a true traveler without leaving your kitchen. Immerse yourself in an imaginary vacation included!</q>");
Localization.Strings.set('#Upgrade_MidnightMagicCupcake', "Midnight Magic Cupcake");
Localization.Strings.set('#Upgrade_MidnightMagicCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Oh, Midnight Magic Cupcake! How mysteriously it sounds! Tell me, are you sure this cupcake won't summon magic and open a portal to another dimension?</q>");
Localization.Strings.set('#Upgrade_BerryDelightCupcake', "Berry Delight Cupcake");
Localization.Strings.set('#Upgrade_BerryDelightCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Oh, Berry Delight Cupcake! How original! Clearly, the world was in dire need of another berry-flavored cupcake. But, perhaps, let's add even more sweetness to our lives. After all, who needs boundaries when it comes to cupcakes?</q>");
Localization.Strings.set('#Upgrade_GalacticCupcake', "Galactic Cupcake");
Localization.Strings.set('#Upgrade_GalacticCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>Embark on a cosmic journey with this stellar cupcake that will take your taste buds to new galaxies!</q>");
Localization.Strings.set("#Upgrade_WarpSpeedBaking", "Warp Speed Baking");
Localization.Strings.set("#Upgrade_WarpSpeedBakingDesc", "Cupcake Galaxies are <b>twice</b> as efficient. <q>Harness the power of warp speed to bake cupcakes in the blink of an eye!</q>");
Localization.Strings.set("#Upgrade_CelestialCupcakeBoost", "Celestial Cupcake Boost");
Localization.Strings.set("#Upgrade_CelestialCupcakeBoostDesc", "Cupcake Galaxies are <b>twice</b> as efficient. <q>The whole galaxy works for you!</q>");
Localization.Strings.set('#Upgrade_InterdimensionalTrade', "Interdimensional Trade");
Localization.Strings.set('#Upgrade_InterdimensionalTradeDesc', "cupcake production multiplier <b>+50%</b> and unlocks <b>Dimensional Hole</b> <q>Unlock the secrets of the multiverse and watch as your cupcake production transcends dimensions!</q>");
Localization.Strings.set('#Upgrade_FreshMintCupcake', "Fresh Mint Cupcake");
Localization.Strings.set('#Upgrade_FreshMintCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>A refreshing minty delight!</q>");
Localization.Strings.set('#Upgrade_WickedCupcake', "Wicked Cupcake");
Localization.Strings.set('#Upgrade_WickedCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>A devilishly delicious treat!</q>");
Localization.Strings.set('#Upgrade_JapaneseCupcake', "Japanese Cupcake");
Localization.Strings.set('#Upgrade_JapaneseCupcakeDesc', "cupcake production multiplier <b>+20%</b> <q>日本市場向けの特別なカップケーキ。</q>");
Localization.Strings.set('#Upgrade_ImprovedCrystallineBoiler', "Improved Crystalline Boiler");
Localization.Strings.set('#Upgrade_ImprovedCrystallineBoilerDesc', "Techno furnances are <b>twice</b> as efficient. <q>The crystalline boiler provides a stable and powerful source of energy for the furnace, accelerating the baking process and increasing productivity.</q>");
Localization.Strings.set('#Upgrade_AutomaticСonfectioneryСontroller', "Automatic Confectionery Controller");
Localization.Strings.set('#Upgrade_AutomaticСonfectioneryСontrollerDesc', "Techno furnances are <b>twice</b> as efficient. <q>The controller optimizes the temperature, time, and ingredient proportions, ensuring the perfect preparation of each cupcake.</q>");
Localization.Strings.set('#Upgrade_OceanCupcake', "Ocean Cupcake");
Localization.Strings.set('#Upgrade_OceanCupcakeDesc', "cupcake production multiplier <b>+20%</b>. <q>\"The waves of sweetness are hidden in the ocean of cupcakes, and only those who boldly dive into the sweet depths find magic in every crumb.\" - This is what we will write on the box!</q>");
Localization.Strings.set('#Upgrade_SpringCupcake', "Spring Cupcake");
Localization.Strings.set('#Upgrade_SpringCupcakeDesc', "cupcake production multiplier <b>+20%</b>. <q>Ah, spring... A time when flowers bloom, birds sing, and everyone craves more cupcakes!</q>");
Localization.Strings.set('#Upgrade_FrostyShiningCupcake', "Frosty Shining Cupcake");
Localization.Strings.set('#Upgrade_FrostyShiningCupcakeDesc', "cupcake production multiplier <b>+20%</b>. <q>Oh, yes, of course, add even more shiny crystals to my cupcakes! Because, as we know, nothing makes cupcakes tastier than a glossy surface that adds absolutely no flavor to them. Just fabulous!</q>");
Localization.Strings.set('#Upgrade_BlackberryDonut', "Blackberry Donut");
Localization.Strings.set('#Upgrade_BlackberryDonutDesc', "cupcake production multiplier <b>+20%</b> <q>Why don't we sell donuts? That's a great idea! Variety is always good!</q>");
Localization.Strings.set('#Upgrade_StrawberryDonut', "Strawberry Donut");
Localization.Strings.set('#Upgrade_StrawberryDonutDesc', "cupcake production multiplier <b>+20%</b>.");
Localization.Strings.set('#Upgrade_LimeDonut', "Lime Donut");
Localization.Strings.set('#Upgrade_LimeDonutDesc', "cupcake production multiplier <b>+20%</b>. <q>I think we're starting to repeat ourselves.</q>");
Localization.Strings.set('#Upgrade_CupcakeCookie', "Cupcake Cookie");
Localization.Strings.set('#Upgrade_CupcakeCookieDesc', "cupcake production multiplier <b>+20%</b>. <q>Heh, cookie pretends to be a cupcake?</q>");
Localization.Strings.set('#Upgrade_CandyCoconutCupcake', "Candy-Coconut Cupcake");
Localization.Strings.set('#Upgrade_CandyCoconutCupcakeDesc', "cupcake production multiplier <b>+20%</b>.");
Localization.Strings.set("#Building_Cursor", "Cursor");
Localization.Strings.set("#Building_CursorNames", "cursor|cursors|clicked");
Localization.Strings.set("#Building_CursorDesc", "Autoclicks once every 10 seconds.");
Localization.Strings.set("#Building_Baker", "Baker");
Localization.Strings.set("#Building_BakerNames", "Baker|Baker|baked");
Localization.Strings.set("#Building_BakerDesc", "A nice communnity to make more cupcakes.");
Localization.Strings.set("#Building_RobotBaker", "Robot Baker");
Localization.Strings.set("#Building_RobotBakerNames", "robot baker|robot bakers|cooked");
Localization.Strings.set("#Building_RobotBakerDesc", "Robot bakers - great technology!");
Localization.Strings.set("#Building_TechnoFurnace", "Techno Furnace");
Localization.Strings.set("#Building_TechnoFurnaceNames", "techno furnance|techno furnance|mass-produced");
Localization.Strings.set("#Building_TechnoFurnaceDesc", "Produces large quantities of cupcakes.");
Localization.Strings.set("#Building_CFactory", "C-Factory");
Localization.Strings.set("#Building_CFactoryNames", "C-Factory|C-Factories|C-Factoryd");
Localization.Strings.set("#Building_CFactoryDesc", "C class factories.");
Localization.Strings.set("#Building_AtomicCupcake", "Atomic Cupcake");
Localization.Strings.set("#Building_AtomicCupcakeNames", "atomic-cupcake|atomic-cupcakes|generated");
Localization.Strings.set("#Building_AtomicCupcakeDesc", "Generate cupcakes from atoms.");
Localization.Strings.set("#Building_AlchemyLab", "Alchemy Lab");
Localization.Strings.set("#Building_AlchemyLabNames", "alchemy lab|alchemy labs|transmuted");
Localization.Strings.set("#Building_AlchemyLabDesc", "Turns gold into cupcakes!");
Localization.Strings.set("#Building_CupPlanet", "CupPlanet");
Localization.Strings.set("#Building_CupPlanetNames", "cupplanet|cupplanets|retrieved");
Localization.Strings.set("#Building_CupPlanetDesc", "New Cupcake Planet");
Localization.Strings.set("#Building_CloneMachine", "Clone Machine");
Localization.Strings.set("#Building_CloneMachineNames", "clone machine|clone machines|recovered");
Localization.Strings.set("#Building_CloneMachineDesc", "Clone cupcakes.");
Localization.Strings.set("#Building_CyberPrism", "Cyber Prism");
Localization.Strings.set("#Building_CyberPrismNames", "cyber prism|cyber prism|generated");
Localization.Strings.set("#Building_CyberPrismDesc", "Creates cupcakes from binary code.");
Localization.Strings.set("#Building_Portal", "Portal");
Localization.Strings.set("#Building_PortalNames", "portal|portals|gave");
Localization.Strings.set("#Building_PortalDesc", "Gives cupcakes from other dimensions.");
Localization.Strings.set("#Building_CupcakeGen", "Cupcake Gen");
Localization.Strings.set("#Building_CupcakeGenNames", "cupcake gen|cupcake gens|generated");
Localization.Strings.set("#Building_CupcakeGenDesc", "Generate cupcakes with nanotechnology.");
Localization.Strings.set("#Building_RobotComplex", "Robot Complex");
Localization.Strings.set("#Building_RobotComplexNames", "robot complex|robot complexes|produced");
Localization.Strings.set("#Building_RobotComplexDesc", "A complete automated efficient complex.");
Localization.Strings.set('#Building_CupcakeGalaxy', "Cupcake Galaxy");
Localization.Strings.set("#Building_CupcakeGalaxyNames", "cupcake galaxy|cupcake galaxies|produced");
Localization.Strings.set("#Building_CupcakeGalaxyDesc", "Your own galaxy that makes cupcakes.");
Localization.Strings.set("#DarkChoc_Frenzy", "Frenzy : cupcake production x15 for {0} seconds!");
Localization.Strings.set("#DarkChoc_Multiply", "Lucky! {0} cupcakes!");
Localization.Strings.set("#DarkChoc_Ruin", "Ruin! Lost {0} cupcakes!");
Localization.Strings.set("#DarkChoc_ElderFrenzy", "Elder frenzy : cupcake production x666 for {0} seconds!");
Localization.Strings.set("#DarkChoc_Clot", "Clot : cupcake production halved for {0} seconds!");
Localization.Strings.set("#DarkChoc_ClickFrenzy", "Click frenzy! Clicking power x777 for {0} seconds!");
Localization.Strings.set("#DarkChoc_Chain", "cupcake chain : +{0} cupcakes!");
Localization.Strings.set("#GoldCupcake_Frenzy", "Frenzy : cupcake production x7 for {0} seconds!");
Localization.Strings.set("#GoldCupcake_Multiply", "Lucky! {0} cupcakes!");
Localization.Strings.set("#GoldCupcake_Ruin", "Ruin! Lost {0} cupcakes!");
Localization.Strings.set("#GoldCupcake_ElderFrenzy", "Elder frenzy : cupcake production x666 for {0} seconds!");
Localization.Strings.set("#GoldCupcake_Clot", "Clot : cupcake production halved for {0} seconds!");
Localization.Strings.set("#GoldCupcake_ClickFrenzy", "Click frenzy! Clicking power x777 for {0} seconds!");
Localization.Strings.set("#GoldCupcake_Chain", "cupcake chain : +{0} cupcakes!");
Localization.Strings.set("#Time_Days", " days");
Localization.Strings.set("#Time_OneDay", "1 day");
Localization.Strings.set("#Time_Hours", " hours");
Localization.Strings.set("#Time_OneHour", "1 hour");
Localization.Strings.set("#Time_Minutes", " minutes");
Localization.Strings.set("#Time_OneMinute", "1 minute");
Localization.Strings.set("#Time_Secconds", " secconds");
Localization.Strings.set("#Time_OneSeccond", "1 seccond");
Localization.Strings.set("#UI_PrefsMenu", "Menu");
Localization.Strings.set("#UI_PrefsGeneral", "General");
Localization.Strings.set("#UI_PrefsSaveBtnName", "Save");
Localization.Strings.set("#UI_PrefsSaveBtnDesc", "Save manually (the game autosaves every 60 seconds)");
Localization.Strings.set("#UI_PrefsExportSaveBtnName", "Export save");
Localization.Strings.set("#UI_PrefsImportSaveBtnName", "Import save");
Localization.Strings.set("#UI_PrefsExportImportSaveBtnDesc", "You can use this to backup your save or to transfer it to another computer");
Localization.Strings.set("#UI_PrefsChangeBGBtnName", "Change BG");
Localization.Strings.set("#UI_PrefsChangeBGBtnDesc", "Change bg to your own");
Localization.Strings.set("#UI_PrefsResetBtnName", "Reset");
Localization.Strings.set("#UI_PrefsResetBtnDesc", "Reset (you will keep achievements and get prestige)");
Localization.Strings.set("#UI_PrefsHardResetBtnName", "Delete save");
Localization.Strings.set("#UI_PrefsHardResetBtnDesc", "Delete all your progress, including your achievements and prestige");
Localization.Strings.set("#UI_PrefsSettings", "Settings");
Localization.Strings.set("#UI_PrefsFancyON", "Fancy graphics ON");
Localization.Strings.set("#UI_PrefsFancyOFF", "Fancy graphics OFF");
Localization.Strings.set("#UI_PrefsParticlesON", "Particles ON");
Localization.Strings.set("#UI_PrefsParticlesOFF", "Particles OFF");
Localization.Strings.set("#UI_PrefsNumbersON", "Numbers ON");
Localization.Strings.set("#UI_PrefsNumbersOFF", "Numbers OFF");
Localization.Strings.set("#UI_PrefsMusicON", "Music ON");
Localization.Strings.set("#UI_PrefsMusicOFF", "Music OFF");
Localization.Strings.set("#UI_PrefsCoffeeON", "Coffee ON");
Localization.Strings.set("#UI_PrefsCoffeeOFF", "Coffee OFF");
Localization.Strings.set("#UI_PrefsOfflineModeON", "Offline mode ON");
Localization.Strings.set("#UI_PrefsOfflineModeOFF", "Offline mode OFF");
Localization.Strings.set("#UI_PrefsOfflineModeDesc", "(note : this disables update notifications)");
Localization.Strings.set("#UI_LogUpdates", "Updates");
Localization.Strings.set("#UI_StatsUpgrade", "[Upgrade]");
Localization.Strings.set("#UI_StatsPurchased", "[Purchased]");
Localization.Strings.set("#UI_StatsAchievement", "[Achievement]");
Localization.Strings.set("#UI_StatsUnlocked", "[Unlocked]");
Localization.Strings.set("#UI_StatsShadow", "[Shadow]");
Localization.Strings.set("#UI_StatsCoffeeCappuccino", "cappuccino");
Localization.Strings.set("#UI_StatsCoffeeLungo", "lungo");
Localization.Strings.set("#UI_StatsCoffeeFlatWhite", "flat white");
Localization.Strings.set("#UI_StatsCoffeeMacchiato", "macchiato");
Localization.Strings.set("#UI_StatsCoffeeRaffCoffee", "raff coffee");
Localization.Strings.set("#UI_StatsCoffeeEspresso", "espresso");
Localization.Strings.set("#UI_StatsCoffeeRistretto", "ristretto");
Localization.Strings.set("#UI_StatsCoffeeLatte", "latte");
Localization.Strings.set("#UI_StatsWrathAwoken", "awoken");
Localization.Strings.set("#UI_StatsWrathDispleased", "displeased");
Localization.Strings.set("#UI_StatsWrathAngered", "angered");
Localization.Strings.set("#UI_StatsWrathAppeased", "appeased");
Localization.Strings.set("#UI_StatsStatistics", "Statistics");
Localization.Strings.set("#UI_StatsGeneral", "General");
Localization.Strings.set("#UI_StatsInBank", "<b>cupcakes in bank :</b> <div class=\"price plain\">{0}</div>");
Localization.Strings.set("#UI_StatsTotal", "<b>cupcakes baked (all time) :</b> <div class=\"price plain\">{0}</div>");
Localization.Strings.set("#UI_StatsGameStarted", "<b>Game started :</b> {0} ago");
Localization.Strings.set("#UI_StatsForfeited", "<b>cupcakes forfeited by resetting :</b> <div class=\"price plain\">{0}</div>");
Localization.Strings.set("#UI_StatsBuildingsOwned", "<b>Buildings owned :</b> {0}");
Localization.Strings.set("#UI_StatsPerSeccond", "<b>cupcakes per second :</b> {0} <small>(multiplier : {1}%)</small>");
Localization.Strings.set("#UI_StatsPerClick", "<b>cupcakes per click :</b> {0}");
Localization.Strings.set("#UI_StatsCupcakeClicks", "<b>Cupcake clicks :</b> {0}");
Localization.Strings.set("#UI_StatsHandMadeCupcakes", "<b>Hand-made cupcakes :</b> {0}");
Localization.Strings.set("#UI_StatsLemonCupcake", "<b>Lemon cupcake clicks :</b> {0}");
Localization.Strings.set("#UI_StatsDarkChoc", "<b>Dark chocolate cupcake clicks :</b> {0}");
Localization.Strings.set("#UI_StatsVersion", "<b>Running version :</b> {0}");
Localization.Strings.set("#UI_StatsSpecial", "Special");
Localization.Strings.set("#UI_StatsResearch", "<b>Research :</b> {0} remaining");
Localization.Strings.set("#UI_StatsBakertriarchs", "<b>Bakertriarchs status :</b> {0}");
Localization.Strings.set("#UI_StatsPledge", "<b>Pledge :</b> {0} remaining");
Localization.Strings.set("#UI_StatsClickMastery", "<b>Click Mastery : </b> {0} <small>(Click Mastery Rank give you more cupcakes)</small>");
Localization.Strings.set("#UI_StatsPrestige", "Prestige");
Localization.Strings.set("#UI_StatsPrestigeDesc", "<small>(Note : each heavenly cupcake grants you +2% CpS multiplier. You can gain more chips by resetting with a lot of cupcakes.)</small>");
Localization.Strings.set("#UI_StatsHeavenlyCupcake", " heavenly cupcake");
Localization.Strings.set("#UI_StatsUpgradesUnlockedLabel", "Upgrades unlocked");
Localization.Strings.set("#UI_StatsUpgradesUnlocked", "<b>Unlocked :</b> {0}/{1} ({2}%)");
Localization.Strings.set("#UI_StatsCupcakes", "<b>cupcakes</b>");
Localization.Strings.set("#UI_StatsAchievementsLabel", "Achievements");
Localization.Strings.set("#UI_StatsAchievementsUnlocked", "<b>Unlocked :</b> {0}/{1} ({2}%)");
Localization.Strings.set("#UI_StatsCoffeeProcent", "<b>Coffee :</b> {0}% ({1}) <small>(Note : you gain coffee through achievements. coffee can unlock unique upgrades over time.)</small>");
Localization.Strings.set("#UI_StatsShadowAchievements", "<b>Shadow achievements</b> <small>(These are feats that are either unfair or difficult to attain. They do not give coffee.)</small>");
Localization.Strings.set("#UI_Mods", "Mods");
Localization.Strings.set("#UI_ModLoadingLabel", "Mod Loading");
Localization.Strings.set("#UI_ModLoadBtnName", "Load Mod");
Localization.Strings.set("#UI_ModLoadBtnDesc", "Load Mod from file (Mod can also be updated on more larger version)");
Localization.Strings.set("#UI_ModSampleDownload", "Download Sample Mod");
Localization.Strings.set("#UI_ModDocumentation","Documentation");
Localization.Strings.set("#UI_ModDocumentationLbl","See Cupcake Clicker Documentation");
Localization.Strings.set("#UI_LocalizMods", "Localization Mods");
Localization.Strings.set("#UI_MusicPackMods", "Music Packs");
Localization.Strings.set("#UI_ModsLoaded", "Loaded mods (Total: {0})");
Localization.Strings.set("#UI_ClickMasteryNoRank", "No Rank");
Localization.Strings.set("#UI_ClickMasteryRank", "Rank {0} ({1})");
Localization.Strings.set("#UI_ClickMasteryAchieved", "Click Mastery:<br>Rank {0} achieved!</br>");
Localization.Strings.set("#UI_ClickMasteryRecruit", "Recruit");
Localization.Strings.set("#UI_ClickMasteryClickNinja", "Click Ninja");
Localization.Strings.set("#UI_ClickMasteryMaster", "Master");
Localization.Strings.set("#UI_ClickMasterySensei", "Sensei");
Localization.Strings.set("#UI_ClickMasteryLegend", "Legend");
Localization.Strings.set("#UI_ClickMasteryLegendaryRank", "Legendary Rank {0}");
Localization.Strings.set("#UI_CupcakeOne", "cupcake");
Localization.Strings.set("#UI_CupcakePlural", "cupcakes");
Localization.Strings.set("#UI_CupcakesPerSecconds", "<div style=\"font-size:50%;\">per second : {0}</div>");
Localization.Strings.set("#UI_GameName", "Cupcake Clicker");
Localization.Strings.set("#Ticker_Backer1", "<q>Moist cupcakes.</q><sig>Baker</sig>");
Localization.Strings.set("#Ticker_Backer2", "<q>So tasty...</q><sig>Baker</sig>");
Localization.Strings.set("#Ticker_Backer3", "<q>Good dough...</q><sig>Baker</sig>");
Localization.Strings.set("#Ticker_Backer4", "<q>Freshly baked!</q><sig>Baker</sig>");
Localization.Strings.set("#Ticker_Backer5", "<q>Interesting...</q><sig>Baker</sig>");
Localization.Strings.set("#Ticker_Backer6", "<q>Love cupcakes...</q><sig>Baker</sig>");
Localization.Strings.set("#Ticker_RobotBacker1", "News : New robot bakers are on sale!");
Localization.Strings.set("#Ticker_RobotBacker2", "News : A new patch has been released for robot bakers!");
Localization.Strings.set("#Ticker_RobotBacker3", "You found a couple of bugs in random Robot Baker.");
Localization.Strings.set("#Ticker_RobotBacker4", "News : Robots now replacing humans on all cooking places!");
Localization.Strings.set("#Ticker_RobotBacker5", "News : Robots earned the skill of cooking with LoveР’В®!");
Localization.Strings.set("#Ticker_AtomicCupcake1", "News : new chocolate planet found, becomes target of cupcake-trading spaceships!");
Localization.Strings.set("#Ticker_AtomicCupcake2", "News : massive chocolate planet found with 99.8% certified pure dark chocolate core!");
Localization.Strings.set("#Ticker_AtomicCupcake3", "News : space tourism booming as distant planets attract more bored millionaires!");
Localization.Strings.set("#Ticker_AtomicCupcake4", "News : chocolate-based organisms found on distant planet!");
Localization.Strings.set("#Ticker_AtomicCupcake5", "News : ancient baking artifacts found on distant planet; \"terrifying implications\", experts say.");
Localization.Strings.set("#Ticker_AtomicCupcake6", "News : atoms in watchable universe is ending - the scientists looking for fast interstellar travel way.");
Localization.Strings.set("#Ticker_AtomicCupcake7", "News : efficiency of production of cupcakes is 99.99%. Increadible!");
Localization.Strings.set("#Ticker_AlchemyLab1", "News : national gold reserves dwindle as more and more of the precious C-Factoryral is turned to cupcakes!");
Localization.Strings.set("#Ticker_AlchemyLab2", "News : chocolate jewelry found fashionable, gold and diamonds \"just a fad\", says specialist.");
Localization.Strings.set("#Ticker_AlchemyLab3", "News : silver found to also be transmutable into white chocolate!");
Localization.Strings.set("#Ticker_AlchemyLab4", "News : defective alchemy lab shut down, found to convert cupcakes to useless gold.");
Localization.Strings.set("#Ticker_AlchemyLab5", "News : alchemy-made cupcakes shunned by purists!");
Localization.Strings.set("#Ticker_AlchemyLab6", "News : super-technologies found in ancient jewish shelters. They have been found to be the most powerful alchemy lab in world!");
Localization.Strings.set("#Ticker_AlchemyLab7", "News : alchemy-made cupcakes is now new standart for rich mens meal!");
Localization.Strings.set("#Ticker_CupPlanet1", "News : cupcakes explore space faster than humans.");
Localization.Strings.set("#Ticker_CupPlanet2", "News : a habitable planet has been found, now cupcakes are supplied to it.");
Localization.Strings.set("#Ticker_CupPlanet3", "News : new civilization of frogs on Kepler 22-B has been found, now cupcakes are supplied to it. <s>This is not slavery if they happy...</s>");
Localization.Strings.set("#Ticker_CupPlanet4", "News : The journalist investigating the Kepler 22-B slavery has been found dead. Data was burned. Police is not giving answers...");
Localization.Strings.set("#Ticker_CupPlanet5", "News : profits from the supply of cupcakes to other planets reaches record levels!");
Localization.Strings.set("#Ticker_CupPlanet6", "News : some not very advanced extraterrestrial civilizations worship us thanks to cupcakes.");
Localization.Strings.set("#Ticker_CloneMachine1", "News : as scientists say, the appearance of a clone machine advances science for many years to come.");
Localization.Strings.set("#Ticker_CloneMachine2", "News : economists estimate that clone machines will cut costs to near zero.");
Localization.Strings.set("#Ticker_CloneMachine3", "News : scientists claim that clone machines may violate ethical standards.");
Localization.Strings.set("#Ticker_CloneMachine4", "News : With the help of clone machines, scientists were able to clone an animal.");
Localization.Strings.set("#Ticker_CloneMachine5", "Some of the clone machines look defective.");
Localization.Strings.set("#Ticker_CloneMachine6", "News : scientists say, the appearance of a clone machine advances science for many years.");
Localization.Strings.set("#Ticker_CloneMachine7", "News : 1 from 100 cloned animals have very unique and terrifying mutations, and aggressive behavior.");
Localization.Strings.set("#Ticker_CyberPrism1", "News: Cyber Prisms are launched, so far only as a test.");
Localization.Strings.set("#Ticker_CyberPrism2", "News: Cyber Prisms can act as an excellent infinite storage or prison.");
Localization.Strings.set("#Ticker_CyberPrism3", "News: Many states have expressed a desire to buy Cyber Prisms.");
Localization.Strings.set("#Ticker_CyberPrism4", "News : The worlds first case of a human being entering the Cyber Prism has been recorded.");
Localization.Strings.set("#Ticker_CyberPrism5", "News: Almost all prisons have been replaced with Cyber Prisms.");
Localization.Strings.set("#Ticker_CyberPrism6", "News: A high level of radioactive background has been detected around the laboratories with Cyber Prisms.");
Localization.Strings.set("#Ticker_CyberPrism7", "News : the light it self now cost more than cupcake that produced from it.");
Localization.Strings.set("#Ticker_CyberPrism8", "News : many planets now supplied by artificial suns, whereas real sun light generates cupcakes.");
Localization.Strings.set("#Ticker_Portal1", "News : nation worried as more and more unsettling creatures emerge from dimensional portals!");
Localization.Strings.set("#Ticker_Portal2", "News : dimensional portals involved in city-engulfing disaster!");
Localization.Strings.set("#Ticker_Portal3", "News : tourism to cupcakeverse popular with bored teenagers! Casualty rate as high as 73%!");
Localization.Strings.set("#Ticker_Portal4", "News : cupcakeverse portals suspected to cause fast aging and obsession with baking, says study.");
Localization.Strings.set("#Ticker_Portal5", "News : \"do not settle near portals,\" says specialist; \"your children will become strange and corrupted inside.\"");
Localization.Strings.set("#Ticker_Portal6", "News : The anxiety of the public subsided, because so far the alien species are only enslaved and cannot oppose anything!");
Localization.Strings.set("#Ticker_Portal7", "News : In developed countries, interdimensional tourism began to emerge!");
Localization.Strings.set("#Ticker_Portal8", "News : Thanks to portals, more and more universes are opening up!");
Localization.Strings.set("#Ticker_Portal9", "News : the alternative human civilization in the appearence of SUMMA corporation has been found.");
Localization.Strings.set("#Ticker_Portal10", "News : the war between our universe and 6874BS-H has been going on for 1 century.");
Localization.Strings.set("#Ticker_Interdim1", "News : The project of \"interuniversal highway\" was recently approved.");
Localization.Strings.set("#Ticker_Interdim2", "News : {0} is having some trouble building the \"interuniversal highway\", but things should get better soon.");
Localization.Strings.set("#Ticker_Interdim3", "News : The \"interuniversal highway\" is successfully operating and connecting many different universes.");
Localization.Strings.set("#Ticker_Interdim4", "News : Dangerous universes were found, the highways to which were closed and sealed.");
Localization.Strings.set("#Ticker_Interdim5", "News : \"The interuniverse highway is very useful, it will provide contact and trade with other universes, which can be infinite.\" - {0} says.");
Localization.Strings.set("#Ticker_CupcakeGen1", "News: Cupcake generators can not only make a scientific breakthrough, but also reduce costs thousands of times.");
Localization.Strings.set("#Ticker_CupcakeGen2", "News: Economists pissed off by cupcake generators. \"This could seriously bring down the financial market,\" economists say.");
Localization.Strings.set("#Ticker_CupcakeGen3", "News: Cupcake makers are 100% safe, as is nano technology.");
Localization.Strings.set("#Ticker_CupcakeGen4", "News: \"These nanotechnologies are amazing. They can help in medicine and much more!\", scientists say.");
Localization.Strings.set("#Ticker_CupcakeGen5", "News: \"Its impossible to be near these labs! These generators are constantly making noise!\" one of the workers says.");
Localization.Strings.set("#Ticker_CupcakeGen6", "News: \"We are working on a nanoparticle generator. This will be another breakthrough,\" says the scientist.");
Localization.Strings.set("#Ticker_CupcakeGen7", "News: \"After working with these generators, my head hurts like hell!\" says one worker.");
Localization.Strings.set("#Ticker_CupcakeGen8", "News : one senator tells, that cupcakes can be used to make cupcakes. He explains it: \"Nanomachines, son!\".");
Localization.Strings.set("#Ticker_CupcakeGen9", "News : one worker\'s head is exploded, while his working on genetor repairing. Nanomachines has deviating from original program.");
Localization.Strings.set("#Ticker_CupcakeGalaxy1", "News: Incredible success - billions of cupcakes collected in the universe!");
Localization.Strings.set("#Ticker_CupcakeGalaxy2", "News: The revolutionary idea of a galaxy of slave planets leads to astonishing success!");
Localization.Strings.set("#Ticker_CupcakeGalaxy3", "News: Tension in Cupcake Galaxies - the demand for freedom rises, the {0} faces challenges!");
Localization.Strings.set("#Ticker_CupcakeGalaxy4", "News: {0} Forces Victory - Cupcake Galaxies Uprisings Suppressed with Military Intervention and Cupcake Nazis!");
Localization.Strings.set("#Ticker_GalaxyBaker1", "<q>You made the world hell.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker2", "<q>You are disgusting.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker3", "<q>Nothing is eternal.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker4", "<q>Keep destroying this world.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker5", "<q>It's all your fault.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker6", "<q>Great time for a RESET, don't you think?</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker7", "<q>There is nothing left for you.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker8", "<q>Leave.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker9", "<q>So many people you have gathered around you without any higher purpose.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker10", "<q>You'd better stop.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker11", "<q>What will people do without work?</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_GalaxyBaker12", "<q>You get on my nerves.</q><sig>Baker #13</sig>");
Localization.Strings.set("#Ticker_NewsAnimals", "newts|penguins|scorpions|axolotls|puffins|porpoises|blowfish|horses|crayfish|slugs|humpback whales|nurse sharks|giant squids|polar bears|fruit bats|frogs|sea squirts|velvet worms|mole rats|paramecia|nematodes|tardigrades|giraffes|cats|dogs");
Localization.Strings.set("#Ticker_NewsAnimalEffects1", "increase lifespan|sensibly increase intelligence|reverse aging|decrease hair loss|prevent arthritis|cure blindness");
Localization.Strings.set("#Ticker_NewsAnimalEffects2", "more docile|more handsome|nicer|less hungry|more pragmatic|tastier");
Localization.Strings.set("#Ticker_News", "News : ");
Localization.Strings.set("#Ticker_NewsAnimals1", "cupcakes found to {0} in {1}!");
Localization.Strings.set("#Ticker_NewsAnimals2", "cupcakes found to make {0} {1}!");
Localization.Strings.set("#Ticker_NewsAnimals3", "cupcakes tested on {0}, found to have no ill effects.");
Localization.Strings.set("#Ticker_NewsAnimals4", "cupcakes unexpectedly popular among {0}!");
Localization.Strings.set("#Ticker_NewsAnimals5", "unsightly lumps found on {0}!");
Localization.Strings.set("#Ticker_NewsAnimals6", "new species of {0} discovered in distant country; \"yup, tastes like cupcakes\", says biologist.");
Localization.Strings.set("#Ticker_NewsAnimals7", "cupcakes go well with roasted {0}, says controversial chef.");
Localization.Strings.set("#Ticker_NewsCelebrity1", "I'm all about cupcakes");
Localization.Strings.set("#Ticker_NewsCelebrity2", "I just can't stop eating cupcakes. I think I seriously need help");
Localization.Strings.set("#Ticker_NewsCelebrity3", "I guess I have a cupcake problem");
Localization.Strings.set("#Ticker_NewsCelebrity4", "I'm not addicted to cupcakes. That\'s just speculation by fans with too much free time");
Localization.Strings.set("#Ticker_NewsCelebrity5", "my upcoming album contains 3 songs about cupcakes");
Localization.Strings.set("#Ticker_NewsCelebrity6", "I've had dreams about cupcakes 3 nights in a row now. I'm a bit worried honestly");
Localization.Strings.set("#Ticker_NewsCelebrity7", "cupcakes are what help me get up in the morning");
Localization.Strings.set("#Ticker_NewsCelebrity8", "accusations of cupcake abuse are only vile slander");
Localization.Strings.set("#Ticker_NewsCelebrity9", "cupcakes really helped me when I was feeling low");
Localization.Strings.set("#Ticker_NewsCelebrity10", "cupcakes are the secret behind my perfect skin");
Localization.Strings.set("#Ticker_NewsCelebrity11", "cupcakes helped me stay sane while filming my upcoming movie");
Localization.Strings.set("#Ticker_NewsCelebrity12", "cupcakes helped me stay thin and healthy");
Localization.Strings.set("#Ticker_NewsCelebrity13", "I'll say one word, just one : cupcakes");
Localization.Strings.set("#Ticker_NewsCelebrity14", "alright, I'll say it - I've never eaten a single cupcake in my life");
Localization.Strings.set("#Ticker_NewsCelebrityReveals", "\", reveals celebrity.");
Localization.Strings.set("#Ticker_NewsDoctors1", "doctors recommend twice-daily consumption of fresh cupcakes.");
Localization.Strings.set("#Ticker_NewsDoctors2", "doctors warn against chocolate chip-snorting teen fad.");
Localization.Strings.set("#Ticker_NewsDoctors3", "doctors advise against new cupcake-free fad diet.");
Localization.Strings.set("#Ticker_NewsDoctors4", "doctors warn mothers about the dangers of \"home-made cupcakes\".");
Localization.Strings.set("#Ticker_NewsRandomChoose1", "cough drops|broccoli|smoked herring|cheese|video games|stable jobs|relationships|time travel|cat videos|tango|fashion|television|nuclear warfare|whatever it is we ate before|politics|oxygen|lamps");
Localization.Strings.set("#Ticker_NewsRandomChoose2", "twerking|that darn rap music|video-games|lack of cupcakes|mysterious ghostly entities|aliens|parents|schools|comic-books|cupcake-snorting fad");
Localization.Strings.set("#Ticker_NewsRandomChoose3", "cupcake-flavored popcorn pretty damn popular; \"we kinda expected that\", say scientists.|cupcake-flavored cereals break all known cereal-related records|cupcakes popular among all age groups, including fetuses, says study.|cupcake-flavored popcorn sales exploded during screening of Grandmothers II : The Moistening.");
Localization.Strings.set("#Ticker_NewsRandomChoose4", "eternal life|infinite riches|eternal youth|eternal beauty|curing baldness|world peace|solving world hunger|ending all wars world-wide|making contact with extraterrestrial life|mind-reading|better living|better eating|more interesting TV shows|faster-than-light travel|quantum baking|chocolaty goodness|gooder thoughtness");
Localization.Strings.set("#Ticker_NewsRandom1", "News : scientist predicts imC-Factorynt cupcake-related \"end of the world\"; becomes joke among peers.");
Localization.Strings.set("#Ticker_NewsRandom2", "News : man robs bank, buys cupcakes.");
Localization.Strings.set("#Ticker_NewsRandom3", "News : what makes cupcakes taste so right? \"Probably all the [*****] they put in them\", says anonymous tipper.");
Localization.Strings.set("#Ticker_NewsRandom4", "News : man found allergic to cupcakes; \"what a weirdo\", says family.");
Localization.Strings.set("#Ticker_NewsRandom5", "News : foreign politician involved in cupcake-smuggling scandal.");
Localization.Strings.set("#Ticker_NewsRandom6", "News : cupcakes now more popular than {0}, says study.");
Localization.Strings.set("#Ticker_NewsRandom7", "News : obesity epidemic strikes nation; experts blame {0.}");
Localization.Strings.set("#Ticker_NewsRandom8", "News : cupcake shortage strikes town, people forced to eat cupcakes; \"just not the same\", concedes mayor.");
Localization.Strings.set("#Ticker_NewsRandom9", "News : \"you gotta admit, all this cupcake stuff is a bit ominous\", says confused idiot.");
Localization.Strings.set("#Ticker_NewsRandom10", "News : movie cancelled from lack of actors; \"everybody's at home eating cupcakes\", laments director.");
Localization.Strings.set("#Ticker_NewsRandom11", "News : comedian forced to cancel cupcake routine due to unrelated indigestion.");
Localization.Strings.set("#Ticker_NewsRandom12", "News : new cupcake-based religion sweeps the nation.");
Localization.Strings.set("#Ticker_NewsRandom13", "News : around the world, groups of Nazis obsessed with cupcakes began to appear.");
Localization.Strings.set("#Ticker_NewsRandom14", "News : cupcakes started serving in school cafeterias.");
Localization.Strings.set("#Ticker_NewsRandom15", "News : fossil records show cupcake-based organisms prevalent during Cambrian explosion, scientists say.");
Localization.Strings.set("#Ticker_NewsRandom16", "News : mysterious illegal cupcakes seized; \"tastes terrible\", says police.");
Localization.Strings.set("#Ticker_NewsRandom17", "News : man found dead after ingesting cupcake; investigators favor \"mafia snitch\" hypothesis.");
Localization.Strings.set("#Ticker_NewsRandom18", "News : \"the universe pretty much loops on itself,\" suggests researcher; \"it's cupcakes all the way down.\"");
Localization.Strings.set("#Ticker_NewsRandom19", "News : minor cupcake-related incident turns whole town to ashes; neighboring cities asked to chip in for reconstruction.");
Localization.Strings.set("#Ticker_NewsRandom20", "News : is our media controlled by the cupcake industry? This could very well be the case, says crackpot conspiracy theorist.");
Localization.Strings.set("#Ticker_NewsRandom21", "News : {0}");
Localization.Strings.set("#Ticker_NewsRandom22", "News : all-cupcake restaurant opening downtown. Dishes such as braised cupcakes, cupcake thermidor, and for dessert : crepes.");
Localization.Strings.set("#Ticker_NewsRandom23", "News : cupcakes could be the key to {0}, say scientists.");
Localization.Strings.set("#Ticker_NewsBakeryState1", "You feel like making cupcakes. But nobody wants to eat your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState2", "Your first batch goes to the trash. The neighborhood raccoon barely touches it.");
Localization.Strings.set("#Ticker_NewsBakeryState3", "Your family accepts to try some of your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState4", "Your cupcakes are popular in the neighborhood.");
Localization.Strings.set("#Ticker_NewsBakeryState5", "People are starting to talk about your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState6", "Your cupcakes are talked about for miles around.");
Localization.Strings.set("#Ticker_NewsBakeryState7", "Your cupcakes are renowned in the whole town!");
Localization.Strings.set("#Ticker_NewsBakeryState8", "Your cupcakes bring all the boys to the yard.");
Localization.Strings.set("#Ticker_NewsBakeryState9", "Your cupcakes now have their own website!");
Localization.Strings.set("#Ticker_NewsBakeryState10", "Your cupcakes are worth a lot of money.");
Localization.Strings.set("#Ticker_NewsBakeryState11", "Your cupcakes sell very well in distant countries.");
Localization.Strings.set("#Ticker_NewsBakeryState12", "Your cupcakes have been made into a brand of marijuana cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState13", "People come from very far away to get a taste of your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState14", "Kings and queens from all over the world are enjoying your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState15", "There are now museums dedicated to your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState16", "A national day has been created in honor of your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState17", "Your cupcakes have been named a part of the world wonders.");
Localization.Strings.set("#Ticker_NewsBakeryState18", "History books now include a whole chapter about your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState19", "Your cupcakes have been placed under government surveillance.");
Localization.Strings.set("#Ticker_NewsBakeryState20", "The whole planet is enjoying your cupcakes!");
Localization.Strings.set("#Ticker_NewsBakeryState21", "Companies all over the world are interested in your cupcake recipes.");
Localization.Strings.set("#Ticker_NewsBakeryState22", "Civilizations outside the solar system are interested in your cupcakes.");
Localization.Strings.set("#Ticker_NewsBakeryState23", "Civilizations from all over the galaxy come to earth to taste your cupcakes.");
Localization.Strings.set("#Tooltip_NameBar", "<span class=\"price\">{0}</span></div><div class=\"name\">{1}</div><small>[owned : {2}</small>]");
Localization.Strings.set("#Coffee_Classic", "Classic Coffee");
Localization.Strings.set("#Coffee_Classic_Desc", "Default Coffee");
Localization.Strings.set("#Coffee_Coconut", "Coconut Coffee");
Localization.Strings.set("#Coffee_Coconut_Desc", "Bake 500000000000 cupcakes for all time");
Localization.Strings.set("#Coffee_Coconut_Desc_Unlock", "Bake 500000000000 cupcakes for all time");
Localization.Strings.set("#Coffee_Fire", "Fire Coffee");
Localization.Strings.set("#Coffee_Fire_Desc", "Click cupcake 15000 times");
Localization.Strings.set("#Coffee_Fire_Desc_Unlock", "Click cupcake 15000 times");
Localization.Strings.set("#Coffee_BlueFire", "Blue Fire Coffee");
Localization.Strings.set("#Coffee_BlueFire_Desc", "Get 10 heavenly chips");
Localization.Strings.set("#Coffee_BlueFire_Desc_Unlock", "Get 10 heavenly cupcakes");
Localization.Strings.set("#Coffee_Golden", "Golden Coffee");
Localization.Strings.set("#Coffee_Golden_Desc", "Bake 1500000000000 cupcakes for all time");
Localization.Strings.set("#Coffee_Golden_Desc_Unlock", "Bake 1500000000000 cupcakes for all time");
Localization.Strings.set("#Coffee_Space", "Space Coffee");
Localization.Strings.set("#Coffee_Space_Desc", "Get 36 heavenly cupcakes");
Localization.Strings.set("#Coffee_Space_Desc_Unlock", "Get 36 heavenly cupcakes");
Localization.Strings.set("#Coffee_Blood", "Blood Coffee");
Localization.Strings.set("#Coffee_Blood_Desc", "Buy Satanic Cupcake");
Localization.Strings.set("#Coffee_Blood_Desc_Unlock", "Buy Satanic Cupcake");
Localization.Strings.set("#Coffee_BlackSpace", "Black Space Coffee");
Localization.Strings.set("#Coffee_BlackSpace_Desc", "Click 25000 times and buy <b>Black Hole Cupcake</b>");
Localization.Strings.set("#Coffee_BlackSpace_Desc_Unlock", "Click 25000 times and buy <b>Black Hole Cupcake</b>");
Localization.Strings.set("#UI_FeaturedMods", "Featured Mods");
Localization.Strings.set("#UI_ModTools", "Tools");
Localization.Strings.set("#FM_DonutModLabel", "Replaces cupcake with donut.");
Localization.Strings.set("#FM_AutoBuyLabel", "Automatically buys a profitable structure.");
Localization.Strings.set("#FM_AutoGCLabel", "Automatically clicks on gold and chocolate cupcakes.");
Localization.Strings.set("#FM_BSMLabel", "More information about the game.");
Localization.Strings.set("#FM_UALLabel", "Full localization of the game in the Ukrainian language.");
Localization.Strings.set('#FM_CCHLabel', "Allows you to change the sprite of the cupcake to anything you want.");
Localization.Strings.set("#FM_CupModCrLabel", "This tool will allow you to quickly and easily create your own complete mod.");
Localization.Strings.set("#FM_HCMLabel", "Brings hellish style to the game.");
Localization.Strings.set("#FM_PFMLabel", "Pizza face is approaching.");
Localization.Strings.set("#FM_DEMLabel", "Ultra hardcore mod. Remember - <b>DONT LOOK AT HIM</b>.");
Localization.Strings.set("#FM_CSMLabel", "Snake Game right in Cupcake Clicker!");
Localization.Strings.set("#FM_PCLabel", "With this mod you can draw directly on the game screen! (Press D for draw mode and E for erase mode (does not work if drawing is off)).");
Localization.Strings.set("#FM_CIMLabel", "Space Invaders right in Cupcake Clicker!");
Localization.Strings.set("#FM_MCMLabel", "Clicking on a stationary target is easy, but what about a moving one?");
Localization.Strings.set("#FM_CTMLabel", "Cupcake Clicker but Bullet Hell.");
Localization.Strings.set("#FM_MARLabel", "Adds falling marshmallows to interact with.");
Localization.Strings.set("#FM_GELLabel", "Full localization of the game in the German language.");
Localization.Strings.set("#FM_FRLLabel", "Full localization of the game in the French language.");
Localization.Strings.set("#FM_MailText", "If you have a cool mod - send it to me on discord or mail: <b>Noobaz13@yandex.ru</b>");
Localization.Strings.set("#GC_CreateButton", "Create Gift Code");
Localization.Strings.set("#GC_CreateButtonLabel", "Convert a certain number of cupcakes into a gift code.");
Localization.Strings.set("#GC_UseButton", "Use Gift Code");
Localization.Strings.set("#GC_UseButtonLabel", "Enter the code and get a certain number of cupcakes. Works only once.");
Localization.Strings.set("#GC_HowMuch", "How many cupcakes do you want to transfer? (Under 10 trillion)");
Localization.Strings.set("#GC_Nope", "Error! You entered an invalid code!");
Localization.Strings.set("#GC_Used", "You have already used this code.");
Localization.Strings.set("#GC_Yes", "You received {0} cupcakes from a gift!");
Localization.Strings.set("#GC_EnterCode", "Enter the gift code.");
Localization.Strings.set("#GC_NotEnough", "You don't have enough cupcakes.");
Localization.Strings.set("#GC_HowError", "Error! You entered an invalid number!");
/*=====================================================================================
MISC HELPER FUNCTIONS
=======================================================================================*/
/**
* Function to display a popup window with a text input prompt.
*
* @param {string} title1 - The title of the window.
* @param {string} text1 - The text displayed in the window.
* @param {boolean} showCancelButton1 - Specifies whether the cancel button should be displayed.
* @param {boolean} closeOnConfirm1 - Specifies whether the window should close after the confirm button is clicked.
* @param {string} inputPlaceholder1 - The placeholder text displayed in the input field.
* @param {string} inputError - The error message displayed when trying to submit an empty value.
* @param {function} onEnd - The function called after the user enters a value.
* @param {string} inputValue1 - The initial value displayed in the input field.
* @returns {void}
*/
function CupcakePrompt(title1, text1, showCancelButton1, closeOnConfirm1, inputPlaceholder1, inputError, onEnd, inputValue1) {
swal({
title: title1,
text: text1,
type: "input",
showCancelButton: showCancelButton1,
closeOnConfirm: closeOnConfirm1,
animation: "slide-from-top",
inputPlaceholder: inputPlaceholder1,
inputValue: inputValue1
},
/**
* Callback function called after the user enters a value.
*
* @param {string} inputValue - The value entered by the user.
* @returns {void}
*/
function (inputValue) {
if (inputValue === false) {
return false;
}
if (inputValue === "") {
swal.showInputError(inputError);
return false;
}
//eval(onEnd);
onEnd(inputValue);
});
}
/**
* Gets element by ID (analog for $ from jQuery)
* @param {string} what Element ID
* @returns {HTMLElement}
*/
function l(what) { return document.getElementById(what); }
/**
* Choosing random element from array
* @param {Array<any>} arr Target array
* @returns {any}
*/
function choose(arr) { return arr[Math.floor(Math.random() * arr.length)]; }
/**
* Gets random int in defined range
* @param {number} min Low bound
* @param {number} max High bound
* @returns {number}
*/
function getRandomInt(min, max) {
min = Math.ceil(min);
max = Math.floor(max);
return Math.floor(Math.random() * (max - min + 1)) + min;
}
/**
* Plays sound from certian file
* @param {string} sound Path to the sound file
*/
function PlaySound(sound) {
var cupsound = new Audio(sound);
cupsound.play();
}
/**
* Formats string, wich format is '{1} {} - {0}'. Python like, but simpler
* @returns {string}
*/
String.prototype.format = function()
{
let s = this;
for (let i = 0; i < arguments.length; i++) {
let reg = new RegExp("\\{" + i + "\\}", "gm");
s = s.replace(reg, arguments[i]);
}
return s;
}
/**
* Same as 'String.format', but formats from array and with offset
* @param {Array<any>} args Format arguments
* @param {number} offset Format arguments offset in array
* @returns {string}
*/
String.prototype.vformat = function(args, offset = 0)
{
let s = this;
for (let i = offset; i < args.length; i++) {
let reg = new RegExp("\\{" + (i - offset) + "\\}", "gm");
s = s.replace(reg, args[i]);
}
return s;
}
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function (needle) {
for (var i = 0; i < this.length; i++) {
if (this[i] === needle) {
return i;
}
}
return -1;
}
}
/**
* Shuffles the array
* @param {Array<any>} array Target array
* @returns {Array<any>}
*/
function shuffle(array) {
var counter = array.length, temp, index;
// While there are elements in the array
while (counter--) {
// Pick a random index
index = (Math.random() * counter) | 0;
// And swap the last element with it
temp = array[counter];
array[counter] = array[index];
array[index] = temp;
}
return array;
}
/**
* Beautifies the number, turns 9999999 into 9,999,999
* @param {number} what Target number
* @param {number} floats Chars after comma
* @returns {string}
*/
function Beautify(what, floats = 0)
{
let str = '';
what = Math.round(what * 100000) / 100000;//get rid of weird rounding errors
if (floats > 0) {
let floater = what - Math.floor(what);
floater = Math.round(floater * 100000) / 100000;//get rid of weird rounding errors
let floatPresent = floater ? 1 : 0;
floater = (floater.toString() + '0000000').slice(2, 2 + floats);//yes this is hacky (but it works)
str = Beautify(Math.floor(what)) + (floatPresent ? ('.' + floater) : '');
}
else {
what = Math.floor(what);
what = (what + '').split('').reverse();
for (let i in what) {
if (i % 3 == 0 && i > 0) str = ',' + str;
str = what[i] + str;
}
}
return str;
}
/**
* Translates UTF8 string to Base64
* @param {string} str Target string
* @returns {string}
*/
function utf8_to_b64(str) {
try {
return Base64.encode(unescape(encodeURIComponent(str)));
//return window.btoa(unescape(encodeURIComponent( str )));
}
catch (err) {
//Popup('There was a problem while encrypting to base64.<br>('+err+')');
return '';
}
}
/**
* Adds event to the element
* @param {Node} html_element Target element
* @param {string} event_name Target Event
* @param {Function} event_function Callback Function
*/
function AddEvent(html_element, event_name, event_function) {
if (html_element.attachEvent) //Internet Explorer
html_element.attachEvent("on" + event_name, function () { event_function.call(html_element); });
else if (html_element.addEventListener) //Firefox & company
html_element.addEventListener(event_name, event_function, false); //don't need the 'call' trick because in FF everything already works in the right way
}
/**
* Translates Base64 string to UTF8
* @param {string} str Target string
* @returns {string}
*/
function b64_to_utf8(str) {
try {
return decodeURIComponent(escape(Base64.decode(str)));
//return decodeURIComponent(escape(window.atob( str )));
}
catch (err) {
//Popup('There was a problem while decrypting from base64.<br>('+err+')');
return '';
}
}
/**
* Compress a sequence like [0,1,1,0,1,0]... into a number like 54.
* @param {Array<any>} arr Source data
* @returns {number}
*/
function CompressBin(arr)
{
var str = '';
var arr2 = arr.slice(0);
arr2.unshift(1);
arr2.push(1);
arr2.reverse();
for (var i in arr2) {
str += arr2[i];
}
str = parseInt(str, 2);
return str;
}
/**
* uncompress a number like 54 to a sequence like [0,1,1,0,1,0].
* @param {number} num Source data
* @returns {Array<any>}
*/
function UncompressBin(num)
{
var arr = num.toString(2);
arr = arr.split('');
arr.reverse();
arr.shift();
arr.pop();
return arr;
}
/**
* Compresses array. We have to compress in smaller chunks to avoid getting into scientific notation
* @param {Array<any>} arr Source data
* @returns {Array<any>}
*/
function CompressLargeBin(arr)
{
var arr2 = arr.slice(0);
var thisBit = [];
var bits = [];
for (var i in arr2) {
thisBit.push(arr2[i]);
if (thisBit.length >= 50) {
bits.push(CompressBin(thisBit));
thisBit = [];
}
}
if (thisBit.length > 0) bits.push(CompressBin(thisBit));
arr2 = bits.join(';');
return arr2;
}
/**
* Uncomresses array
* @param {Array<any>} arr Source data
* @returns {Array<any>}
*/
function UncompressLargeBin(arr) {
var arr2 = arr.split(';');
var bits = [];
for (var i in arr2) {
bits.push(UncompressBin(parseInt(arr2[i])));
}
arr2 = [];
for (var i in bits) {
for (var ii in bits[i]) arr2.push(bits[i][ii]);
}
return arr2;
}
//seeded random function, courtesy of http://davidbau.com/archives/2010/01/30/random_seeds_coded_hints_and_quintillions.html
(function (a, b, c, d, e, f) { function k(a) { var b, c = a.length, e = this, f = 0, g = e.i = e.j = 0, h = e.S = []; for (c || (a = [c++]); d > f;)h[f] = f++; for (f = 0; d > f; f++)h[f] = h[g = j & g + a[f % c] + (b = h[f])], h[g] = b; (e.g = function (a) { for (var b, c = 0, f = e.i, g = e.j, h = e.S; a--;)b = h[f = j & f + 1], c = c * d + h[j & (h[f] = h[g = j & g + b]) + (h[g] = b)]; return e.i = f, e.j = g, c })(d) } function l(a, b) { var e, c = [], d = (typeof a)[0]; if (b && "o" == d) for (e in a) try { c.push(l(a[e], b - 1)) } catch (f) { } return c.length ? c : "s" == d ? a : a + "\0" } function m(a, b) { for (var d, c = a + "", e = 0; c.length > e;)b[j & e] = j & (d ^= 19 * b[j & e]) + c.charCodeAt(e++); return o(b) } function n(c) { try { return a.crypto.getRandomValues(c = new Uint8Array(d)), o(c) } catch (e) { return [+new Date, a, a.navigator.plugins, a.screen, o(b)] } } function o(a) { return String.fromCharCode.apply(0, a) } var g = c.pow(d, e), h = c.pow(2, f), i = 2 * h, j = d - 1; c.seedrandom = function (a, f) { var j = [], p = m(l(f ? [a, o(b)] : 0 in arguments ? a : n(), 3), j), q = new k(j); return m(o(q.S), b), c.random = function () { for (var a = q.g(e), b = g, c = 0; h > a;)a = (a + c) * d, b *= d, c = q.g(1); for (; a >= i;)a /= 2, b /= 2, c >>>= 1; return (a + c) / b }, p }, m(c.random(), b) })(this, [], Math, 256, 6, 52);
/**
* Mod file opening event listner
* @param {Event} e Event element
* @returns {void}
*/
function readLocalFile(e) {
var file = e.target.files[0];
if (!file) {
return;
}
var reader = new FileReader();
reader.onload = function (e) {
var contents = e.target.result;
Game.ModAPI.LoadMod(contents);
};
reader.readAsText(file);
}
/**
* Checks collision of two elements
* @param {HTMLElement} div1 First element
* @param {HTMLElement} div2 Second element
* @returns {boolean}
*/
function CheckCollision(div1, div2) {
//alert('COLLISION!');
var rect1 = div1.getBoundingClientRect();
var rect2 = div2.getBoundingClientRect();
if (
rect1.right >= rect2.left &&
rect1.left <= rect2.right &&
rect1.bottom >= rect2.top &&
rect1.top <= rect2.bottom
) {
return true;
} else return false;
}
/**
* Encodes string with Caesar Cipher
* @param {string} str Target string
* @param {number} shift Cipher shift
* @returns {string}
*/
function caesarCipher(str, shift) {
shift = ((shift % 26) + 26) % 26;
const chars = str.split("");
const encrypted = chars.map((char) => {
const charCode = char.charCodeAt(0);
if (/[a-zA-Z]/.test(char)) {
let baseCharCode;
if (char >= "a" && char <= "z") {
baseCharCode = "a".charCodeAt(0);
} else {
baseCharCode = "A".charCodeAt(0);
}
const shiftedCharCode = ((charCode - baseCharCode + shift) % 26) + baseCharCode;
return String.fromCharCode(shiftedCharCode);
}
return char;
});
return encrypted.join("");
}
/**
* Decodes string with Caesar Cipher
* @param {string} str Source string
* @param {number} shift Cipher shift
* @returns {string}
*/
function caesarDecipher(str, shift) {
shift = ((shift % 26) + 26) % 26;
const chars = str.split("");
const decrypted = chars.map((char) => {
const charCode = char.charCodeAt(0);
if (/[a-zA-Z]/.test(char)) {
let baseCharCode;
if (char >= "a" && char <= "z") {
baseCharCode = "a".charCodeAt(0);
} else {
baseCharCode = "A".charCodeAt(0);
}
const shiftedCharCode = ((charCode - baseCharCode - shift + 26) % 26) + baseCharCode;
return String.fromCharCode(shiftedCharCode);
}
return char;
});
return decrypted.join("");
}
/**
* Evals the custom JS code with custom scope
* @param {Object} scope Object contains the scope
* @param {string} script String with js code
* @returns {any}
*/
function scopeEval(scope, script) {
return Function(script).bind(scope)(); // '"use strict"; ' +
}
/*=====================================================================================
GAME INITIALIZATION
=======================================================================================*/
/**
* Contains all core game functions and classes
* @namespace Game
*/
/**
* Contains all functions and classes for Mods working
* @namespace Game.ModAPI
*/
const Game = {};
/**
* Launchs game
* @returns {void}
*/
Game.Launch = function () {
/**
* Indicates the game is fully initialized
* @type {number}
*/
Game.ready = 0;
Game.ModAPI = {};
/**
* Launches ModAPI
* @returns {void}
*/
Game.LaunchModAPI = function () {
/**
* Map of loaded mods. Key - ModID, value - Mod object
* @type {Map}
*/
Game.ModAPI.ModsLoaded = new Map();
Game.ModAPI.ModInfo = ["None", null];
/**
* Loads mod, opens file choose dialog
* @returns {void}
*/
Game.ModAPI.LoadModFile = function () {
const f = document.createElement('input');
f.style.display = 'none';
f.type = 'file';
f.name = 'file';
f.addEventListener('change', readLocalFile);
document.body.appendChild(f);
f.click();
document.body.removeChild(f);
};
/**
* Loads mod by it code
* @param {string} modCode
* @returns {void}
*/
Game.ModAPI.LoadMod = function (modCode) {
scopeEval(Game, modCode);
if (Game.ModAPI.ModInfo[0] !== "None" && Game.ModAPI.ModInfo[1]?.Init && Game.ModAPI.ModInfo[1].ID && Game.ModAPI.ModInfo[1].Name) {
const modLoaded = Game.ModAPI.ModsLoaded.has(Game.ModAPI.ModInfo[0]);
const mod = Game.ModAPI.ModInfo[1];
if (!mod.Init) {
console.error("Mod load error: Can't find Init function!");
return;
}
if (!mod.ID || !mod.Name) {
console.error("Mod load error: Can't find ID or Name fields!");
return;
}
let updating = false;
if (modLoaded) {
const loadedMod = Game.ModAPI.ModsLoaded.get(Game.ModAPI.ModInfo[0]);
loadedMod.Version ??= "1.0";
if (mod.Version !== undefined)
updating = mod.Version > loadedMod.Version;
if (!updating) {
Game.Popup("#ModAPI_AlredyLoaded", Game.ModAPI.ModInfo[0]);
return;
}
}
if (updating)
Game.WriteSave();
mod.Init();
mod.modCode = modCode;
Game.ModAPI.ModsLoaded.set(Game.ModAPI.ModInfo[0], mod);
if (updating)
Game.LoadSave(undefined, false); // Hack, 'cause first argument - exported save data
Game.Popup("#ModAPI_AlredyLoaded", `${mod.Name} v${mod.Version ?? '1.0'}`);
}
else {
console.error("Mod load error: no mod in file!");
}
Game.ModAPI.ModInfo = ["None", null];
};
/**
* Unloads mod by its ID, reloads the page
* @param {string} modID ID of the Mod
* @returns {void}
*/
Game.ModAPI.UnloadModByID = function (modID) {
if (!Game.ModAPI.ModsLoaded.has(modID)) {
Game.Popup("#ModAPI_NotLoaded", modID);
return;
}
Game.ModAPI.ModsLoaded.delete(modID);
if (localStorage[modID] !== undefined)
localStorage.removeItem(modID);
Game.WriteSave();
window.location.reload();
};
};
/**
* Inits game
* @returns {void}
*/
Game.Init = function () {
Game.ready = 1;
l('javascriptError').innerHTML = '<div style="padding:64px 128px;"><div class="title">Loading...</div></div>';
/*=====================================================================================
VARIABLES AND PRESETS
=======================================================================================*/
/** Ticker varible
* @type {number}
*/
Game.T = 0;
/** FPS of the game. If increased - games speeds up
* @type {number}
*/
Game.fps = 30;
Game.Updt = 0;
/**
* Version of the game
* @type {number}
*/
Game.version = 2.772;
/**
* Indicates, if game is in beta
* @type {number}
*/
Game.beta = 0;
l('versionNumber').innerHTML = 'v ' + Game.version + (Game.beta ? ' <span style="color:#ff0;">beta</span>' : '');
//latency compensator stuff
/**
* Current time
* @type {number}
*/
Game.time = new Date().getTime();
Game.accumulatedDelay = 0;
//console.log("Code: VAXJOKESARECRINGE");
Game.catchupLogic = 0;
Game.clickStr = Game.touchEvents ? 'ontouchend' : 'onclick';
Game.SelectedCoffee = "coffeewave";
/**
* Name of the current coffee. Name in statistics
* @type {string}
*/
Game.coffeeName = '';
Game.ChocolateCoffee = false;
Game.coffeeFire = false;
Game.coffeeBlueFire = false;
Game.coffeeGold = false;
Game.coffeeStars = false;
Game.coffeeBlood = false;
Game.coffeeBlackSpace = false;
Game.CanCoffeeCollide = false;
/**
* Marshmallow mode flag
* @type {boolean}
*/
Game.Marhmall = false;
/**
* Kitten mode flag
* @type {boolean}
*/
Game.Kitten = false;
/**
* Cupcake Fall flag
* @type {boolean}
*/
Game.CFell = false;
/**
* Cupcake sprite div
* @type {HTMLElement}
*/
Game.bigcupcakeDiv = l('bigcupcake');
/**
* Coffee sprite div
* @type {HTMLElement}
*/
Game.coffeeDiv = l('coffeeLayer2');
/**
* Cosmic collapse unlock flag
* @type {number}
*/
Game.CosmicCollapse = 0;
/**
* Satanic cupcake unlock flag
* @type {number}
*/
Game.satcupbought = 0;
/**
* Industrial cupcake unlock flag
* @type {number}
*/
Game.indcup = 0;
/**
* Music cupcake unlock flag
* @type {number}
*/
Game.muscup = 0;
/**
* Binary cupcake unlock flag
* @type {number}
*/
Game.bincup = 0;
/**
* All cupcakes earned during gameplay
* @type {number}
*/
Game.cupcakesEarned = 0;
/**
* Current count of cupcakes
* @type {number}
*/
Game.cupcakes = 0;
/**
* Current display count of cupcakes
* @type {number}
*/
Game.cupcakesd = 0;
/**
* Cupcakes per second (to recalculate with every new purchase)
* @type {number}
*/
Game.cupcakesPs = 1;
/**
* Cupcakes lost to resetting
* @type {number}
*/
Game.cupcakesReset = 0;
/**
* Frenzy flag, as long as >0, cupcake production is multiplied by frenzyPower
* @type {number}
*/
Game.frenzy = 0;
/**
* Power of Frenzy effect
* @type {number}
*/
Game.frenzyPower = 1;
/**
* Click frenzy flag, as long as >0, mouse clicks get 777x more cupcakes
* @type {number}
*/
Game.clickFrenzy = 0;
/**
* Count of click on cupcake, +1 for each click on the cupcake
* @type {number}
*/
Game.cupcakeClicks = 0;
/**
* Count of click on golden cupcakes, +1 for each golden cupcake clicked
* @type {number}
*/
Game.goldenClicks = 0;
/**
* Count of click on chocolate cupcakes, +1 for each dark chocolate cupcake clicked
* @type {number}
*/
Game.darkchocClicks = 0;
/**
* Count of missed golden cupcake, +1 for each golden cupcake missed
* @type {number}
*/
Game.missedGoldenClicks = 0;
/**
* All the cupcakes made from clicking the cupcake
* @type {number}
*/
Game.handmadecupcakes = 0;
/**
* You can a little bit for each achievement; 0-1 : coffee; 1-2 : chocolate coffee; 2-3 : raspberry coffee
* @type {number}
*/
Game.coffeeProgress = 0;
/**
* Coffee height, between 0 and 1 (although should never go above 0.5)
* @type {number}
*/
Game.coffeeH = Game.coffeeProgress / 2;
/**
* Coffee height display
* @type {number}
*/
Game.coffeeHd = 0;
/**
* Custom coffee : 0=plain, 1=chocolate...
* @type {number}
*/
Game.coffeeType = -1;
/**
* Custom background : 0=blue, 1=red...
* @type {number}
*/
Game.backgroundType = -1;
/**
* Cool stuff that carries over beyond resets
* @type {any}
*/
Game.prestige = [];
/**
* Elder wrath target
* @type {number}
*/
Game.elderWrath = 0;
/**
* Elder wrath now
* @type {number}
*/
Game.elderWrathD = 0;
/**
* @type {number}
*/
Game.pledges = 0;
/**
* @type {number}
*/
Game.pledgeT = 0;
Game.researchT = 0;
Game.nextResearch = 0;
/**
* Dev mode flag
* @type {boolean}
*/
Game.DEV = false;
var giftCodes = new Array('kostyl');
/**
* Background image (bakers and such)
* @type {string}
*/
Game.bg = '';
/**
* Fading to background
* @type {string}
*/
Game.bgFade = '';
/**
* Background ratio (0 - not faded, 1 - fully faded)
* @type {number}
*/
Game.bgR = 0;
/**
* Background ratio displayed
* @type {number}
*/
Game.bgRd = 0;
Game.startDate = parseInt(new Date().getTime());
/**
* Custom string in Menu section
* @type {string}
*/
Game.CustomMenu = "";
/**
* Custom string in Stats section
* @type {string}
*/
Game.CustomStats = "";
/**
* Custom string in Logs section
* @type {string}
*/
Game.CustomLogs = "";
/**
* Custom string in Mods section
* @type {string}
*/
Game.CustomMods = "";
/**
* Date when save is created
* @type {number}
*/
Game.gamestart = 0;
/**
* Game prefs
* @type {any}
*/
Game.prefs = [];
/**
* Sets prefs to default
* @returns {void}
*/
Game.DefaultPrefs = function () {
Game.prefs.particles = 1;
Game.prefs.numbers = 1;
Game.prefs.autosave = 1;
Game.prefs.autoupdate = 1;
Game.prefs.coffee = 1;
Game.prefs.fancy = 1;
Game.prefs.music = 1;
}
Game.DefaultPrefs();
/**
* Window width
* @type {number}
*/
Game.windowW = window.innerWidth;
/**
* Window height
* @type {number}
*/
Game.windowH = window.innerHeight;
window.addEventListener('resize', function (event) {
Game.windowW = window.innerWidth;
Game.windowH = window.innerHeight;
});
/**
* Checks if time is elapsed
* @param {any} toim Target time
* @param {any} ourtoim Checking time
* @returns {boolean}
*/
Game.checktime = function(toim, ourtoim) {
let tim = toim.split(' ');
try {
let iloveniggers = ourtoim.split(' ');
if (tim[1] == iloveniggers[1] && parseInt(iloveniggers[0]) >= parseInt(tim[0])) {
return true;
}
return false;
} catch(e) {
return false;
}
}
/*=====================================================================================
BAKERY NAME
=======================================================================================*/
/**
* Gets up random bakery name
* @returns {string}
*/
Game.RandomBakeryName = function () {
return (Math.random() > 0.05 ? (choose(['Magic', 'Fantastic', 'Fancy', 'Sassy', 'Snazzy', 'Pretty', 'Cute', 'Pirate', 'Ninja', 'Zombie', 'Robot', 'Radical', 'Urban', 'Cool', 'Hella', 'Sweet', 'Awful', 'Double', 'Triple', 'Turbo', 'Techno', 'Disco', 'Electro', 'Dancing', 'Wonder', 'Mutant', 'Space', 'Science', 'Medieval', 'Future', 'Captain', 'Bearded', 'Lovely', 'Tiny', 'Big', 'Fire', 'Water', 'Frozen', 'Metal', 'Plastic', 'Solid', 'Liquid', 'Moldy', 'Shiny', 'Happy', 'Slimy', 'Tasty', 'Delicious', 'Hungry', 'Greedy', 'Lethal', 'Professor', 'Doctor', 'Power', 'Chocolate', 'Crumbly', 'Choklit', 'Righteous', 'Glorious', 'Mnemonic', 'Psychic', 'Frenetic', 'Hectic', 'Crazy', 'Royal', 'El', 'Von']) + ' ') : 'Mc') + choose(['cupcake', 'Biscuit', 'Muffin', 'Scone', 'Cupcake', 'Pancake', 'Chip', 'Sprocket', 'Gizmo', 'Puppet', 'Mitten', 'Sock', 'Teapot', 'Mystery', 'Baker', 'Cook', 'baker', 'Click', 'Clicker', 'Spaceship', 'Factory', 'Portal', 'Machine', 'Experiment', 'Monster', 'Panic', 'Burglar', 'Bandit', 'Booty', 'Potato', 'Pizza', 'Burger', 'Sausage', 'Meatball', 'Spaghetti', 'Macaroni', 'Kitten', 'Puppy', 'Giraffe', 'Zebra', 'Parrot', 'Dolphin', 'Duckling', 'Sloth', 'Turtle', 'Goblin', 'Pixie', 'Gnome', 'Computer', 'Pirate', 'Ninja', 'Zombie', 'Robot']);
}
Game.GetBakeryName = function () { return Game.RandomBakeryName(); }
Game.bakeryName = Game.GetBakeryName();
Game.bakeryNameL = l('bakeryName');
Game.bakeryNameL.innerHTML = Game.bakeryName + '\'s bakery';
/**
* Sets up name of the bakery
* @param {string} what
*/
Game.bakeryNameSet = function (what) {
Game.bakeryName = what;
Game.bakeryName = Game.bakeryName.substring(0, 28);
Game.bakeryNameRefresh();
}
Game.bakeryNameRefresh = function () {
Game.bakeryNameL.innerHTML = Game.bakeryName + '\'s bakery';
}
Game.bakeryNamePrompt = function () {
var namee = CupcakePrompt('Name Your Bakery', 'Input Bakery Name:', true, true,
"Name without 's bakery", "Enter your bakery name",
function(inputValue) {
if (inputValue != null) {
Game.bakeryNameSet(inputValue);
let chname = inputValue.toLowerCase();
if (chname.includes('noobaz')) {
Game.Win('#Achievement_GodComplex');
}
if (chname.includes('cookie')) {
Game.Win('#Achievement_Cookies');
}
if (chname.includes('opensesame')) {
Game.Win('#Achievement_OpenSesame');
}
if (chname.includes('mallowrain')) {
if (Game.Marhmall == false) {
StartTheRain();
}
Game.Win('#Achievement_MarshmallowRain');
}
if (chname.includes('purrfect')) {
if (Game.Kitten == false) {
KittenStart();
Game.Popup("Kitten Activated!");
}
Game.Win('#Achievement_JustPurrfect');
}
if (chname.includes('cupfell')) {
if (Game.CFell == false) {
Game.CupDrop();
}
Game.Win('#Achievement_CupcakeFell');
}
if (Game.bakeryName.includes('BADBLIGGIES')) {
Game.DEV = true;
Game.Popup("DEV ACCESS GRANTED!");
}
}
} , null);
}
AddEvent(Game.bakeryNameL, 'click', Game.bakeryNamePrompt);
/*=====================================================================================
UPDATE CHECKER (broken?)
=======================================================================================*/
Game.CheckUpdates = function () {
ajax('server.php?q=checkupdate', Game.CheckUpdatesResponse);
}
Game.CheckUpdatesResponse = function (response) {
var r = response.split('|');
if (parseFloat(r[0]) > Game.version) {
var str = Localization.GetText("#Game_NewVersion").format(r[0]);
if (r[1]) str += Localization.GetText("#Game_UpdateNote").format(r[1]);
str += Localization.GetText("#Game_RefreshIt");
l('alert').innerHTML = str;
l('alert').style.display = 'block';
}
}
/*=====================================================================================
SAVE
=======================================================================================*/
/**
* Opens the expot save prompt
* @returns {void}
*/
Game.ExportSave = function () {
var save = CupcakePrompt('Export Save', "Copy this text and keep it somewhere safe!", true, true,
"Your Save Code", "Here your save code", function(inputValue){}, Game.WriteSave(1));
}
/**
* Opens the import save prompt
* @returns {void}
*/
Game.ImportSave = function () {
var save = CupcakePrompt("Import Save", 'Please paste in the text that was given to you on save export.', true, true,
"Your Save Code", "Enter Your Save Code",
function(inputValue){if (inputValue && inputValue != '') Game.LoadSave(inputValue); Game.WriteSave();}, null);
}
/**
* Saves the game
* @param {boolean} exporting=false Exporting flag. If false - saves gamedata in cookie and not returns. If true - returns the save data
* @returns {string|undefined}
*/
Game.WriteSave = function (exporting)//guess what we'e using to save the game?
{
var str = '';
str += Game.version + '|';
str += '|';//just in case we need some more stuff here
str +=//save stats
parseInt(Game.startDate) + ';' +
(Game.bakeryName) +
'|';
str +=//prefs
(Game.prefs.particles ? '1' : '0') +
(Game.prefs.numbers ? '1' : '0') +
(Game.prefs.autosave ? '1' : '0') +
(Game.prefs.autoupdate ? '1' : '0') +
(Game.prefs.coffee ? '1' : '0') +
(Game.prefs.fancy ? '1' : '0') +
(Game.prefs.music ? '1' : '0') +
'|';
try {
str += parseFloat(Math.floor(Game.cupcakes)) + ';' +
parseFloat(Math.floor(Game.cupcakesEarned)) + ';' +
parseInt(Math.floor(Game.cupcakeClicks)) + ';' +
parseInt(Math.floor(Game.goldenClicks)) + ';' +
parseInt(Math.floor(Game.darkchocClicks)) + ';' +
parseFloat(Math.floor(Game.handmadecupcakes)) + ';' +
parseInt(Math.floor(Game.missedGoldenClicks)) + ';' +
parseInt(Math.floor(Game.backgroundType)) + ';' +
parseInt(Math.floor(Game.Updt)) + ';' +
parseInt(Math.floor(Game.coffeeType)) + ';' +
parseFloat(Math.floor(Game.cupcakesReset)) + ';' +
parseInt(Math.floor(Game.elderWrath)) + ';' +
parseInt(Math.floor(Game.pledges)) + ';' +
parseInt(Math.floor(Game.pledgeT)) + ';' +
parseInt(Math.floor(Game.nextResearch)) + ';' +
parseInt(Math.floor(Game.researchT)) + ';' +
parseInt(Math.floor(zero)) + ';' +
parseInt(Math.floor(one)) + ';' +
parseInt(Math.floor(two)) + ';' +
parseInt(Math.floor(three)) + ';' +
parseInt(Math.floor(Game.satcupbought)) + ';' +
parseInt(Math.floor(Game.muscup)) + ';' +
parseInt(Math.floor(Game.indcup)) + ';' +
parseInt(Math.floor(Game.bincup)) + ';' +
// Game.ChocolateCoffee + ';' +
// Game.coffeeFire + ';' +
// Game.coffeeBlueFire + ';' +
// Game.coffeeGold + ';' +
// Game.coffeeStars + ';' +
//parseInt(Math.floor(Game.prestige['Heavenly Cupcakes']))+';'+
'|';//cupcakes
} catch (err) {
str += parseFloat(Math.floor(Game.cupcakes)) + ';' +
parseFloat(Math.floor(Game.cupcakesEarned)) + ';' +
parseInt(Math.floor(Game.cupcakeClicks)) + ';' +
parseInt(Math.floor(Game.goldenClicks)) + ';' +
parseInt(Math.floor(Game.darkchocClicks)) + ';' +
parseFloat(Math.floor(Game.handmadecupcakes)) + ';' +
parseInt(Math.floor(Game.missedGoldenClicks)) + ';' +
parseInt(Math.floor(Game.backgroundType)) + ';' +
parseInt(Math.floor(Game.Updt)) + ';' +
parseInt(Math.floor(Game.coffeeType)) + ';' +
parseFloat(Math.floor(Game.cupcakesReset)) + ';' +
parseInt(Math.floor(Game.elderWrath)) + ';' +
parseInt(Math.floor(Game.pledges)) + ';' +
parseInt(Math.floor(Game.pledgeT)) + ';' +
parseInt(Math.floor(Game.nextResearch)) + ';' +
parseInt(Math.floor(Game.researchT)) + ';' +
parseInt(Math.floor(zero)) + ';' +
parseInt(Math.floor(one)) + ';' +
parseInt(Math.floor(two)) + ';' +
parseInt(Math.floor(three)) + ';' +
// Game.ChocolateCoffee + ';' +
// Game.coffeeFire + ';' +
// Game.coffeeBlueFire + ';' +
// Game.coffeeGold + ';' +
// Game.coffeeStars + ';' +
'|';//cupcakes
}
for (var i in Game.Objects)//buildings
{
var me = Game.Objects[i];
str += me.amount + ',' + me.bought + ',' + Math.floor(me.totalcupcakes) + ',' + me.specialUnlocked + ';';
}
str += '|';
var toCompress = [];
for (var i in Game.Upgrades)//upgrades
{
var me = Game.Upgrades[i];
toCompress.push(Math.min(me.unlocked, 1), Math.min(me.bought, 1));
}
toCompress = CompressLargeBin(toCompress);
str += toCompress;
str += '|';
var toCompress = [];
for (var i in Game.Achievements)//achievements
{
var me = Game.Achievements[i];
toCompress.push(Math.min(me.won));
}
toCompress = CompressLargeBin(toCompress);
str += toCompress;
str += '|';
str += 'kostyl';
// ACHTUNG! THE CODE BELOW IS USED TO BE AFTER ALL SAVES!
str += "|";
// Mods save.
let modData = '';
{
for(let mod of Game.ModAPI.ModsLoaded.values())
{
modData += mod.ID + '|';
modData += escape(utf8_to_b64(mod.modCode)) + ";";
str += mod.ID + ",";
}
str = str.slice(0, -1) + '|';
}
localStorage.setItem('mods', utf8_to_b64(modData));
for(let mod of Game.ModAPI.ModsLoaded.values())
{
if(mod.OnSave != undefined)
{
str += mod.ID + '=';
str += escape(mod.OnSave());
str += ";";
}
}
str = str.slice(0, -1) + '|';
if (exporting) {
str = escape(utf8_to_b64(str) + '!END!');
return str;
}
else {
//that's right
//we're using cookie files
//yeah I went there
var now = new Date();//we storin dis for 5 years, people
now.setFullYear(now.getFullYear() + 5);//mmh stale cookie files
str = utf8_to_b64(str) + '!END!';
str = 'CupcakeClickerGame=' + escape(str) + '; expires=' + now.toUTCString() + ';';
document.cookie = str;//aaand save
if (document.cookie.indexOf('CupcakeClickerGame') < 0) Game.Popup("#Game_SaveError");
else Game.Popup("#Game_SaveOK");
}
}
/*=====================================================================================
LOAD
=======================================================================================*/
/**
* Loads save
* @param {string?} data Save data. If not present - loads from cookies
* @param {boolean} loadMods=true - If false - doesn't loads mods from localStorage
* @returns {void}
*/
Game.LoadSave = function (data, loadMods = true) {
var str = '';
// Loading mods from cache
if(loadMods)
{
if(localStorage['mods'])
{
str = unescape(localStorage['mods']);
str = b64_to_utf8(str);
const mods = str.split(';');
mods.forEach(mod => {
let splt = mod.split('|');
if(splt.length < 2)
return;
let ID = splt[0];
let code = b64_to_utf8(unescape(splt[1]));
console.log('Loading mod with id "' + ID + '" from cache...');
Game.ModAPI.LoadMod(code);
});
}
}
str = '';
if (data) str = unescape(data);
else if (document.cookie.indexOf('CupcakeClickerGame') >= 0) str = unescape(document.cookie.split('CupcakeClickerGame=')[1]);//get cookie here
if (str != '') {
var version = 0;
var oldstr = str.split('|');
if (oldstr[0] < 1) { }
else {
str = str.split('!END!')[0];
str = b64_to_utf8(str);
}
if (str != '') {
var spl = '';
str = str.split('|');
version = parseFloat(str[0]);
if (version >= 1 && version > Game.version) {
alert('Error : you are attempting to load a save from a later version (v.' + version + '; you are using v.' + Game.version + ').');
return;
}
else if (version >= 1) {
spl = str[2].split(';');//save stats
console.log(spl);
Game.startDate = parseInt(spl[0]);
Game.bakeryName = spl[1] ? spl[1] : Game.GetBakeryName();
Game.bakeryNameRefresh();
spl = str[3].split('');//prefs
Game.prefs.particles = parseInt(spl[0]);
Game.prefs.numbers = parseInt(spl[1]);
Game.prefs.autosave = parseInt(spl[2]);
Game.prefs.autoupdate = spl[3] ? parseInt(spl[3]) : 1;
Game.prefs.coffee = spl[4] ? parseInt(spl[4]) : 1;
Game.prefs.fancy = parseInt(spl[5]); if (Game.prefs.fancy) Game.removeClass('noFancy'); else if (!Game.prefs.fancy) Game.addClass('noFancy');
Game.prefs.music = parseInt(spl[6]);
spl = str[4].split(';');//cupcakes
Game.cupcakes = parseFloat(spl[0]); Game.cupcakesEarned = parseFloat(spl[1]);
Game.cupcakeClicks = spl[2] ? parseInt(spl[2]) : 0;
Game.goldenClicks = spl[3] ? parseInt(spl[3]) : 0;
Game.darkchocClicks = spl[4] ? parseInt(spl[4]) : 0;
Game.handmadecupcakes = spl[5] ? parseFloat(spl[5]) : 0;
Game.missedGoldenClicks = spl[6] ? parseInt(spl[6]) : 0;
Game.backgroundType = spl[7] ? parseInt(spl[7]) : 0;
Game.Updt = spl[8] ? parseInt(spl[8]) : 0;
Game.coffeeType = spl[9] ? parseInt(spl[9]) : 0;
console.log(Game.coffeeType);
Game.cupcakesReset = spl[10] ? parseFloat(spl[10]) : 0;
Game.elderWrath = spl[11] ? parseInt(spl[11]) : 0;
Game.pledges = spl[12] ? parseInt(spl[12]) : 0;
Game.pledgeT = spl[13] ? parseInt(spl[13]) : 0;
Game.nextResearch = spl[14] ? parseInt(spl[14]) : 0;
Game.researchT = spl[15] ? parseInt(spl[15]) : 0;
zero = spl[16] ? parseInt(spl[16]) : 0;
one = spl[17] ? parseInt(spl[17]) : 0;
two = spl[18] ? parseInt(spl[18]) : 0;
three = spl[19] ? parseInt(spl[19]) : 0;
Game.satcupbought = spl[20] ? parseInt(spl[20]) : 0;
Game.muscup = spl[21] ? parseInt(spl[21]) : 0;
Game.indcup = spl[22] ? parseInt(spl[22]) : 0;
Game.bincup = spl[23] ? parseInt(spl[23]) : 0;
// Game.ChocolateCoffee = spl[20] ? Boolean(spl[20]) : false;
// Game.coffeeFire = spl[21] ? Boolean(spl[21]) : false;
// Game.coffeeBlueFire = spl[22] ? Boolean(spl[22]) : false;
// Game.coffeeGold = spl[23] ? Boolean(spl[23]) : false;
// Game.coffeeStars = spl[24] ? Boolean(spl[24]) : false;
// try {
// Game.prestige['Heavenly Cupcakes']=spl[18]?parseInt(spl[18]):0;
// } catch(e) {
// console.log('bruh');
// }
spl = str[5].split(';');//buildings
Game.BuildingsOwned = 0;
for (var i in Game.ObjectsById) {
var me = Game.ObjectsById[i];
if (spl[i]) {
var mestr = spl[i].toString().split(',');
me.amount = parseInt(mestr[0]); me.bought = parseInt(mestr[1]); me.totalcupcakes = parseInt(mestr[2]); me.specialUnlocked = parseInt(mestr[3]);
Game.BuildingsOwned += me.amount;
}
else {
me.unlocked = 0; me.bought = 0; me.totalcupcakes = 0;
}
}
if (version < 1.035)//old non-binary algorithm
{
spl = str[6].split(';');//upgrades
Game.UpgradesOwned = 0;
for (var i in Game.UpgradesById) {
var me = Game.UpgradesById[i];
if (spl[i]) {
var mestr = spl[i].split(',');
me.unlocked = parseInt(mestr[0]); me.bought = parseInt(mestr[1]);
if (me.bought) Game.UpgradesOwned++;
}
else {
me.unlocked = 0; me.bought = 0;
}
}
if (str[7]) spl = str[7].split(';'); else spl = [];//achievements
Game.AchievementsOwned = 0;
for (var i in Game.AchievementsById) {
var me = Game.AchievementsById[i];
if (spl[i]) {
var mestr = spl[i].split(',');
me.won = parseInt(mestr[0]);
}
else {
me.won = 0;
}
if (me.won && me.hide != 3) Game.AchievementsOwned++;
}
}
else {
if (str[6]) spl = str[6]; else spl = [];//upgrades
spl = UncompressLargeBin(spl);
Game.UpgradesOwned = 0;
for (var i in Game.UpgradesById) {
var me = Game.UpgradesById[i];
if (spl[i * 2]) {
var mestr = [spl[i * 2], spl[i * 2 + 1]];
me.unlocked = parseInt(mestr[0]); me.bought = parseInt(mestr[1]);
if (me.bought) Game.UpgradesOwned++;
}
else {
me.unlocked = 0; me.bought = 0;
}
}
if (str[7]) spl = str[7]; else spl = [];//achievements
spl = UncompressLargeBin(spl);
Game.AchievementsOwned = 0;
for (var i in Game.AchievementsById) {
var me = Game.AchievementsById[i];
if (spl[i]) {
var mestr = [spl[i]];
me.won = parseInt(mestr[0]);
}
else {
me.won = 0;
}
if (me.won && me.hide != 3) Game.AchievementsOwned++;
}
}
for (var i in Game.ObjectsById) {
var me = Game.ObjectsById[i];
if (me.buyFunction) me.buyFunction();
me.setSpecial(0);
if (me.special) me.special();
me.refresh();
}
// Loading mod data (old saves - skipping)
if(str.length > 9 && Game.ModAPI.ModsLoaded.size > 0)
{
let mods = str[9].split(',');
let keys = Array.from(Game.ModAPI.ModsLoaded.keys());
for(let mod of mods)
{
if(keys.indexOf(mod) < 0)
{
if(confirm('Warning! In loaded save has been finded mod named with ID "' + mod + '", but mod is not loaded. Do you want to load save anyway? (Standart Cupcake Clicker data will be loaded anyway)'))
{
Game.Popup("#ModAPI_LoadContinueWithout", mod);
}
else
{
alert("Load this save when all mods have been loaded (save the game before at least one time)");
Game.ExportSave();
}
}
}
if(str.length > 10)
{
let mods_data = str[10].split(';');
for(let i = 0; i < mods_data.length; i++)
{
let mod_data = mods_data[i].split('=');
if(mod_data.length < 2)
continue;
let mod = Game.ModAPI.ModsLoaded.get(mod_data[0]);
if(mod != undefined)
{
if(mod.OnLoad != undefined)
{
mod.OnLoad(unescape(mod_data[1]));
}
}
}
}
}
}
else//importing old version save
{
/*
Game.startDate=parseInt(new Date().getTime());
Game.cupcakes=parseInt(str[1]);
Game.cupcakesEarned=parseInt(str[1]);
for (var i in Game.ObjectsById)
{
var me=Game.ObjectsById[i];
me.amount=0;me.bought=0;me.totalcupcakes=0;
me.refresh();
}
for (var i in Game.UpgradesById)
{
var me=Game.UpgradesById[i];
me.unlocked=0;me.bought=0;
}
var moni=0;
moni+=15*Math.pow(1.1,parseInt(str[2]));
moni+=100*Math.pow(1.1,parseInt(str[4]));
moni+=500*Math.pow(1.1,parseInt(str[6]));
moni+=2000*Math.pow(1.1,parseInt(str[8]));
moni+=7000*Math.pow(1.1,parseInt(str[10]));
moni+=50000*Math.pow(1.1,parseInt(str[12]));
moni+=1000000*Math.pow(1.1,parseInt(str[14]));
if (parseInt(str[16])) moni+=123456789*Math.pow(1.1,parseInt(str[16]));
alert('Imported old save from version '+version+'; recovered '+Beautify(Game.cupcakes)+' cupcakes, and converted buildings back to '+Beautify(moni)+' cupcakes.');
Game.cupcakes+=moni;
Game.cupcakesEarned+=moni;
*/
alert('Sorry, you can\'t import saves from the old version anymore.');
return;
}
Game.goldencupcake.reset();
Game.darkchoccupcake.reset();
Game.prestige = [];
//Game.Upgrades['#Achievement_ElderPledge'].basePrice=Math.pow(8,Math.min(Game.pledges+2,13));
Game.RebuildUpgrades();
Game.TickerAge = 0;
Game.elderWrathD = 0;
Game.frenzy = 0;
Game.frenzyPower = 1;
Game.clickFrenzy = 0;
Game.recalculateGains = 1;
Game.storeToRebuild = 1;
Game.upgradesToRebuild = 1;
Game.Popup("#Game_LoadedOK");
}
}
}
/*=====================================================================================
RESET
=======================================================================================*/
/**
* Resets the game
* @param {boolean?} bypass - Bypass prestige
*/
Game.Reset = function (bypass) {
if (bypass || confirm(Localization.GetText("#Game_ResetConfirm"))) {
if (!bypass) {
if (Game.cupcakesEarned >= 1000000) Game.Win('#Achievement_Sacrifice');
if (Game.cupcakesEarned >= 1000000000) Game.Win('#Achievement_Oblivion');
if (Game.cupcakesEarned >= 1000000000000) Game.Win('#Achievement_From scratch');
if (Game.cupcakesEarned >= 1000000000000000) Game.Win('#Achievement_Nihilism');
}
Game.cupcakesReset += Game.cupcakesEarned;
Game.cupcakes = 0;
Game.cupcakesEarned = 0;
Game.cupcakeClicks = 0;
//Game.goldenClicks=0;
//Game.missedGoldenClicks=0;
Game.handmadecupcakes = 0;
Game.backgroundType = -1;
Game.coffeeType = -1;
Game.frenzy = 0;
Game.frenzyPower = 1;
Game.clickFrenzy = 0;
Game.pledges = 0;
Game.pledgeT = 0;
Game.elderWrath = 0;
Game.nextResearch = 0;
Game.researchT = 0;
//Game.Upgrades['#Achievement_ElderPledge'].basePrice=Math.pow(8,Math.min(Game.pledges+2,13));
for (var i in Game.ObjectsById) {
var me = Game.ObjectsById[i];
me.amount = 0; me.bought = 0; me.totalcupcakes = 0; me.specialUnlocked = 0;
me.setSpecial(0);
me.refresh();
}
for (var i in Game.UpgradesById) {
var me = Game.UpgradesById[i];
me.unlocked = 0; me.bought = 0;
}
/*
for (var i in Game.AchievementsById)
{
var me=Game.AchievementsById[i];
me.won=0;
}*/
//Game.DefaultPrefs();
Game.BuildingsOwned = 0;
Game.UpgradesOwned = 0;
Game.RebuildUpgrades();
Game.TickerAge = 0;
Game.recalculateGains = 1;
Game.storeToRebuild = 1;
Game.upgradesToRebuild = 1;
Game.startDate = parseInt(new Date().getTime());
Game.goldencupcake.reset();
Game.darkchoccupcake.reset();
Game.Popup("#Game_ResetDone");
if (!bypass) {
var prestige = 0;
if (Game.prestige.ready) prestige = Game.prestige['Heavenly Cupcakes'];
Game.prestige = [];
Game.CalculatePrestige();
prestige = Game.prestige['Heavenly Cupcakes'] - prestige;
if (prestige != 0) Game.Popup("#Game_PrestigeEarn", prestige);
}
PlaySound('https://cdn.discordapp.com/attachments/1105095523616170024/1132316642039320725/charging.mp3');
//PlaySound('https://cdn.discordapp.com/attachments/1105095523616170024/1132318093507559594/cupreset.mp3');
}
}
/**
* Deletes save
* @returns {void}
*/
Game.HardReset = function () {
if (confirm(Localization.GetText("#Game_ResetHard"))) {
if (confirm(Localization.GetText("#Game_ResetHardReally"))) {
for (var i in Game.AchievementsById) {
var me = Game.AchievementsById[i];
me.won = 0;
}
Game.AchievementsOwned = 0;
Game.goldenClicks = 0;
Game.darkchocClicks = 0;
Game.missedGoldenClicks = 0;
Game.Reset(1);
Game.cupcakesReset = 0;
Game.prestige = [];
Game.CalculatePrestige();
}
}
}
Game.UpdateReset = function () {
for (var i in Game.AchievementsById) {
var me = Game.AchievementsById[i];
me.won = 0;
}
Game.AchievementsOwned = 0;
Game.goldenClicks = 0;
Game.darkchocClicks = 0;
Game.missedGoldenClicks = 0;
Game.Reset(1);
Game.cupcakesReset = 0;
Game.prestige = [];
Game.CalculatePrestige();
}
/*=====================================================================================
CUPCAKE ECONOMICS
=======================================================================================*/
/**
* Gives cupcakes
* @param {number} howmuch How much cupcake to give
*/
Game.Earn = function (howmuch) {
Game.cupcakes += howmuch;
Game.cupcakesEarned += howmuch;
}
/**
* Takes cupcakes
* @param {number} howmuch How much cupcake to take
*/
Game.Spend = function (howmuch) {
Game.cupcakes -= howmuch;
}
/**
* Gets the Mouse CPS with all buff from achievments
* @returns {number}
*/
Game.mouseCps = function () {
var add = 0;
if (Game.Has('#Upgrade_ThousandFingers')) add += 0.1;
if (Game.Has('#Upgrade_MillionFingers')) add += 0.5;
if (Game.Has('#Upgrade_BillionFingers')) add += 2;
if (Game.Has('#Upgrade_TrillionFingers')) add += 10;
if (Game.Has('#Upgrade_QuadrillionFingers')) add += 20;
if (Game.Has('#Upgrade_QuintillionFingers')) add += 100;
var num = 0;
for (var i in Game.Objects) { if (Game.Objects[i].name != '#Building_Cursor') num += Game.Objects[i].amount; }
add = add * num;
if (Game.Has('#Upgrade_PlasticMouse')) add += Game.cupcakesPs * 0.01;
if (Game.Has('#Upgrade_IronMouse')) add += Game.cupcakesPs * 0.01;
if (Game.Has('#Upgrade_TitaniumMouse')) add += Game.cupcakesPs * 0.01;
if (Game.Has('#Upgrade_AdamantiumMouse')) add += Game.cupcakesPs * 0.01;
if (Game.Has('#Upgrade_VibraniumMouse')) add += Game.cupcakesPs * 0.01;
var mult = 1;
if (Game.clickFrenzy > 0) mult *= 777;
return mult * Game.ComputeCps(1, Game.Has('#Upgrade_ReinforcedIndexFinger'), Game.Has('#Upgrade_CarpalTunnelPreventionCream') + Game.Has('#Upgrade_Ambidextrous'), add);
}
/**
* Computed Mouse CPS
* @type {number}
*/
Game.computedMouseCps = 1;
/**
* Global CPS
* @type {number}
*/
Game.globalCpsMult = 1;
Game.lastClick = 0;
Game.autoclickerDetected = 0;
SelectParticlePos = function() {
let res = 100;
let minus = getRandomInt(0, 1);
if (minus == 0) {
res *= (-1);
}
res -= getRandomInt(10, 100);
}
// function ClickparticleAdd(event) {
// const particle = document.createElement('div');
// particle.className = 'Clparticle';
// particle.style.left = event.clientX + 'px';
// particle.style.top = event.clientY + 'px';
// document.body.appendChild(particle);
// setTimeout(() => {
// particle.remove();
// }, 1000);
// }
// document.addEventListener('click', ClickparticleAdd);
/**
* Clicks on cupcake
* @returns {void}
*/
Game.Clickcupcake = function () {
var now = performance.now();
if (now - Game.lastClick < 1000 / 250) {
return;
}
var cps = Game.computedMouseCps;
if (now - Game.lastClick < 1000 / 15) {
Game.autoclickerDetected += Game.fps;
if (Game.autoclickerDetected >= Game.fps * 5) {
Game.Win('#Achievement_UncannyClicker');
}
}
if (bgplaying == 0) {
Game.BgMusic();
bgplaying = 1;
}
Game.Earn(cps);
var clicksound = new Audio(choose(['https://cdn.discordapp.com/attachments/1105095523616170024/1111210818084818975/69880c1f5e57698.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1111210804356853760/10e1076dfd6c701.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1111210786686259210/d9960b6b2c1ec5f.mp3']));
clicksound.oncanplay = function() {
requestAnimationFrame(function() {
clicksound.play();
});
}
Game.handmadecupcakes += cps;
if (Game.prefs.particles) {
Game.cupcakeParticleAdd();
// ClickparticleAdd(Game.mouseX, Game.mouseY);
}
if (Game.prefs.numbers) {
Game.cupcakeNumberAdd('+' + Beautify(cps, 1));
}
Game.cupcakeClicks++;
Game.lastClick = now;
}
/*window.onload = function(){
l('bigcupcake').onclick=Game.Clickcupcake;
};*/
l('bigcupcake').onclick = Game.Clickcupcake;
/**
* Mouse X
* @type {number}
*/
Game.mouseX = 0;
/**
* Mouse Y
* @type {number}
*/
Game.mouseY = 0;
Game.globalpageX = 0;
Game.globalpageY = 0;
Game.GetMouseCoords = function (e) {
var posx = 0;
var posy = 0;
if (!e) var e = window.event;
if (e.pageX || e.pageY) {
posx = e.pageX;
posy = e.pageY;
Game.globalpageX = e.pageX;
Game.globalpageY = e.pageY;
}
else if (e.clientX || e.clientY) {
posx = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;
posy = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;
}
var el = l('sectionLeft');
var x = 0;
var y = 0;
while (el && !isNaN(el.offsetLeft) && !isNaN(el.offsetTop)) {
x += el.offsetLeft - el.scrollLeft;
y += el.offsetTop - el.scrollTop;
el = el.offsetParent;
}
Game.mouseX = posx - x;
Game.mouseY = posy - y;
}
/**
* Calculates amount of prestige from cupcakes count
* @param {number} cupcakes Count of cupcakes to calculate
* @returns {number}
*/
Game.HowMuchPrestige = function (cupcakes) {
var prestige = cupcakes / 10000000000;
//prestige=Math.max(0,Math.floor(Math.pow(prestige,0.5)));//old version
prestige = Math.max(0, Math.floor((-1 + Math.pow(1 + 8 * prestige, 0.5)) / 2));//geometric progression
return prestige;
}
/**
* Calculates prestige
* @returns {void}
*/
Game.CalculatePrestige = function () {
var prestige = Game.HowMuchPrestige(Game.cupcakesReset);
Game.prestige = [];
Game.prestige['Heavenly Cupcakes'] = prestige;
Game.prestige.ready = 1;
}
AddEvent(document, 'mousemove', Game.GetMouseCoords);
/*=====================================================================================
CPS RECALCULATOR
=======================================================================================*/
Game.recalculateGains = 1;
Game.Rank_multiplier = 0;
Game.ChrCps = 0;
// Game.CalculateGains = function () {
// let mult = 1;
// const upgrades = Object.values(Game.Upgrades);
// const objects = Object.values(Game.Objects);
// const cupcakeUpgrades = [
// '#Upgrade_SpecializedChocolateChips',
// '#Upgrade_DesignerCocoaBeans',
// '#Upgrade_UnderworldOvens',
// '#Upgrade_ExoticNuts',
// '#Upgrade_ArcaneSugar',
// ];
// const heavenlyUpgrades = [
// '#Upgrade_CloudNineBoost',
// '#Upgrade_HeavenlyHands',
// '#Upgrade_DivineDeliverySystem',
// ];
// const cupcakeMultUpgrades = [
// '#Upgrade_SatanicCupcake',
// '#Upgrade_MusicCupcake',
// '#Upgrade_IndustrialCupcake',
// '#Upgrade_BinaryCupcake',
// '#Upgrade_StrawberryCupcake',
// '#Upgrade_CosmicCupcake',
// '#Upgrade_CurrantCupcake',
// '#Upgrade_RaspberryCupcake',
// '#Upgrade_VanillaCupcake',
// '#Upgrade_StarCupcake',
// '#Upgrade_Marshmallow',
// '#Upgrade_FractalCookie',
// '#Upgrade_ChocolateCupcake',
// '#Upgrade_EnergyCupcake',
// '#Upgrade_BlackHoleCupcake',
// '#Upgrade_FrostCupcake',
// '#Upgrade_LimeCupcake',
// '#Upgrade_BritishCupcake',
// '#Upgrade_OrangeCupcake',
// '#Upgrade_AstronomyCupcake',
// '#Upgrade_AtomicCupcake',
// '#Upgrade_QuantumUncertaintyCupcake',
// '#Upgrade_DieselpunkCupcake',
// ];
// const otherMultUpgrades = [
// '#Upgrade_FoodScience',
// '#Upgrade_RoboticsUpgrade',
// '#Upgrade_SyntheticBiology',
// '#Upgrade_BakingMastery',
// '#Upgrade_FrostingInnovation',
// '#Upgrade_FlavorFusion',
// ];
// const coolerOtherUpgrades = [
// '#Upgrade_AdvancedBaking',
// ];
// upgrades.forEach((upgrade) => {
// if (upgrade.bought > 0) {
// if (cupcakeUpgrades.includes(upgrade.name) && Game.Has(upgrade.displayName)) {
// mult += upgrade.power * 0.01;
// }
// if (upgrade.type === 'multip' && Game.Has(upgrade.displayName)) {
// mult += upgrade.power * 1;
// }
// }
// });
// mult += Game.Rank_multiplier + Game.Has('#Upgrade_MonosodiumGlutamate') + 100;
// //HEAVENLY MULT
// mult += Game.Has('#Upgrade_CloudNineBoost') * (mult / 100) * 50;
// mult += Game.Has('#Upgrade_HeavenlyHands') * (mult / 100) * 60;
// mult += Game.Has('#Upgrade_DivineDeliverySystem') * (mult / 100) * 70;
// //CUPCAKES MULT
// mult += Game.Has('#Upgrade_SatanicCupcake') * (mult / 100) * 50;
// mult += Game.Has('#Upgrade_MusicCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_IndustrialCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_BinaryCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_StrawberryCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_CosmicCupcake') * (mult / 100) * 40;
// mult += Game.Has('#Upgrade_CurrantCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_RaspberryCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_VanillaCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_StarCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_Marshmallow') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_FractalCookie') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_ChocolateCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_EnergyCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_BlackHoleCupcake') * (mult / 100) * 40;
// mult += Game.Has('#Upgrade_FrostCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_LimeCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_BritishCupcake') * (mult / 100) * 400;
// mult += Game.Has('#Upgrade_OrangeCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_AstronomyCupcake') * (mult / 100) * 40;
// mult += Game.Has('#Upgrade_AtomicCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_QuantumUncertaintyCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_DieselpunkCupcake') * (mult / 100) * 20;
// otherMultUpgrades.forEach((upgrade) => {
// if (Game.Has(upgrade)) {
// mult += (mult / 100) * 20;
// }
// });
// coolerOtherUpgrades.forEach((upgrade) => {
// if (Game.Has(upgrade)) {
// mult += (mult / 100) * 40;
// }
// });
// mult += Game.Has('#Upgrade_SatanicRitual') + 200;
// mult += Game.Has('#Upgrade_ResearchCenters') + 300;
// mult += Game.ChrCps;
// if (!Game.prestige.ready) {
// Game.CalculatePrestige();
// }
// mult += parseInt(Game.prestige['Heavenly Cupcakes']) * 0.02;
// for (var i in Game.Objects) {
// var me = Game.Objects[i];
// me.storedCps = (typeof (me.cps) == 'function' ? me.cps() : me.cps);
// me.storedTotalCps = me.amount * me.storedCps;
// Game.cupcakesPs += me.storedTotalCps;
// }
// if (Game.Has('#Upgrade_KittenHelpers')) {
// mult *= 1 + Game.coffeeProgress * 0.05;
// }
// if (Game.Has('#Upgrade_KittenWorkers')) {
// mult *= 1 + Game.coffeeProgress * 0.1;
// }
// if (Game.Has('#Upgrade_KittenEngineers')) {
// mult *= 1 + Game.coffeeProgress * 0.2;
// }
// if (Game.Has('#Upgrade_KittenOverseers')) {
// mult *= 1 + Game.coffeeProgress * 0.3;
// }
// if (Game.frenzy > 0) {
// mult *= Game.frenzyPower;
// }
// if (Game.Has('#Upgrade_ElderCovenant')) {
// mult *= 0.95;
// }
// Game.globalCpsMult = mult;
// Game.cupcakesPs = totalCps * Game.globalCpsMult;
// for (let i = 0; i < Game.cpsAchievs.length; i += 2) {
// if (Game.cupcakesPs >= Game.cpsAchievs[i + 1]) {
// Game.Win(Game.cpsAchievs[i]);
// }
// }
// Game.computedMouseCps = Game.mouseCps();
// Game.recalculateGains = 0;
// };
/**
* Calculates gains
* @returns {void}
*/
Game.CalculateGains = function () {
Game.cupcakesPs = 0;
var mult = 1;
for (var i in Game.Upgrades) {
var me = Game.Upgrades[i];
if (me.bought > 0) {
if (me.type == 'cupcake' && Game.Has(me.displayName)) mult += me.power * 0.01;
if (me.type == 'multip' && Game.Has(me.displayName)) mult += me.power * 1;
}
}
mult += Game.Rank_multiplier;
Game.Rank_multiplier = 0;
mult += Game.Has('#Upgrade_SpecializedChocolateChips') * 0.01;
mult += Game.Has('#Upgrade_DesignerCocoaBeans') * 0.02;
mult += Game.Has('#Upgrade_UnderworldOvens') * 0.03;
mult += Game.Has('#Upgrade_ExoticNuts') * 0.04;
mult += Game.Has('#Upgrade_ArcaneSugar') * 0.05;
mult += Game.Has('#Upgrade_MonosodiumGlutamate') + 100;
// //HEAVENLY MULT
// mult += Game.Has('#Upgrade_CloudNineBoost') * (mult / 100) * 50;
// mult += Game.Has('#Upgrade_HeavenlyHands') * (mult / 100) * 60;
// mult += Game.Has('#Upgrade_DivineDeliverySystem') * (mult / 100) * 70;
// //CUPCAKES MULT
// mult += Game.Has('#Upgrade_SatanicCupcake') * (mult / 100) * 50;
// mult += Game.Has('#Upgrade_MusicCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_IndustrialCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_BinaryCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_StrawberryCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_CosmicCupcake') * (mult / 100) * 40;
// mult += Game.Has('#Upgrade_CurrantCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_RaspberryCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_VanillaCupcake') * (mult / 100) * 10;
// mult += Game.Has('#Upgrade_StarCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_Marshmallow') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_FractalCookie') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_ChocolateCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_EnergyCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_BlackHoleCupcake') * (mult / 100) * 40;
// mult += Game.Has('#Upgrade_FrostCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_LimeCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_BritishCupcake') * (mult / 100) * 400;
// mult += Game.Has('#Upgrade_OrangeCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_AstronomyCupcake') * (mult / 100) * 40;
// mult += Game.Has('#Upgrade_AtomicCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_QuantumUncertaintyCupcake') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_DieselpunkCupcake') * (mult / 100) * 20;
// //OTHER MULT
// mult += Game.Has('#Upgrade_FoodScience') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_RoboticsUpgrade') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_SyntheticBiology') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_BakingMastery') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_FrostingInnovation') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_FlavorFusion') * (mult / 100) * 20;
// mult += Game.Has('#Upgrade_AdvancedBaking') * (mult / 100) * 40;
//HEAVENLY MULT
mult += Game.Has('#Upgrade_CloudNineBoost') * 50;
mult += Game.Has('#Upgrade_HeavenlyHands') * 60;
mult += Game.Has('#Upgrade_DivineDeliverySystem') * 70;
//CUPCAKES MULT
mult += Game.Has('#Upgrade_SatanicCupcake') * 50;
mult += Game.Has('#Upgrade_MusicCupcake') * 10;
mult += Game.Has('#Upgrade_IndustrialCupcake') * 10;
mult += Game.Has('#Upgrade_BinaryCupcake') * 10;
mult += Game.Has('#Upgrade_StrawberryCupcake') * 10;
mult += Game.Has('#Upgrade_CosmicCupcake') * 40;
mult += Game.Has('#Upgrade_CurrantCupcake') * 10;
mult += Game.Has('#Upgrade_RaspberryCupcake') * 10;
mult += Game.Has('#Upgrade_VanillaCupcake') * 10;
mult += Game.Has('#Upgrade_StarCupcake') * 20;
mult += Game.Has('#Upgrade_Marshmallow') * 20;
mult += Game.Has('#Upgrade_FractalCookie') * 20;
mult += Game.Has('#Upgrade_ChocolateCupcake') * 20;
mult += Game.Has('#Upgrade_EnergyCupcake') * 20;
mult += Game.Has('#Upgrade_BlackHoleCupcake') * 40;
mult += Game.Has('#Upgrade_FrostCupcake') * 20;
mult += Game.Has('#Upgrade_LimeCupcake') * 20;
mult += Game.Has('#Upgrade_BritishCupcake') * 400;
mult += Game.Has('#Upgrade_OrangeCupcake') * 20;
mult += Game.Has('#Upgrade_AstronomyCupcake') * 40;
mult += Game.Has('#Upgrade_AtomicCupcake') * 20;
mult += Game.Has('#Upgrade_QuantumUncertaintyCupcake') * 20;
mult += Game.Has('#Upgrade_DieselpunkCupcake') * 20;
mult += Game.Has('#Upgrade_SunshineCoastCupcake') * 30;
mult += Game.Has('#Upgrade_MidnightMagicCupcake') * 20;
mult += Game.Has('#Upgrade_BerryDelightCupcake') * 20;
mult += Game.Has('#Upgrade_GalacticCupcake') * 20;
mult += Game.Has('#Upgrade_FreshMintCupcake') * 20;
mult += Game.Has('#Upgrade_WickedCupcake') * 20;
mult += Game.Has('#Upgrade_JapaneseCupcake') * 20;
mult += Game.Has('#Upgrade_OceanCupcake') * 20;
mult += Game.Has('#Upgrade_SpringCupcake') * 20;
mult += Game.Has('#Upgrade_FrostyShiningCupcake') * 20;
mult += Game.Has('#Upgrade_BlackberryDonut') * 20;
mult += Game.Has('#Upgrade_StrawberryDonut') * 20;
mult += Game.Has('#Upgrade_LimeDonut') * 20;
mult += Game.Has('#Upgrade_CupcakeCookie') * 20;
mult += Game.Has('#Upgrade_CandyCoconutCupcake') * 20;
//OTHER MULT
mult += Game.Has('#Upgrade_FoodScience') * 20;
mult += Game.Has('#Upgrade_RoboticsUpgrade') * 20;
mult += Game.Has('#Upgrade_SyntheticBiology') * 20;
mult += Game.Has('#Upgrade_BakingMastery') * 20;
mult += Game.Has('#Upgrade_FrostingInnovation') * 20;
mult += Game.Has('#Upgrade_FlavorFusion') * 20;
mult += Game.Has('#Upgrade_AdvancedBaking') * 40;
mult += Game.Has('#Upgrade_InterdimensionalTrade') * 50;
mult += Game.ClickMastery * 10;
mult += Game.Has('#Upgrade_SatanicRitual') + 200;
mult += Game.Has('#Upgrade_ResearchCenters') + 300;
mult += Game.ChrCps;
if (!Game.prestige.ready) Game.CalculatePrestige();
mult += parseInt(Game.prestige['Heavenly Cupcakes']) * 0.02;
for (var i in Game.Objects) {
var me = Game.Objects[i];
me.storedCps = (typeof (me.cps) == 'function' ? me.cps() : me.cps);
me.storedTotalCps = me.amount * me.storedCps;
Game.cupcakesPs += me.storedTotalCps;
}
if (Game.Has('#Upgrade_KittenHelpers')) mult *= (1 + Game.coffeeProgress * 0.05);
if (Game.Has('#Upgrade_KittenWorkers')) mult *= (1 + Game.coffeeProgress * 0.1);
if (Game.Has('#Upgrade_KittenEngineers')) mult *= (1 + Game.coffeeProgress * 0.2);
if (Game.Has('#Upgrade_KittenOverseers')) mult *= (1 + Game.coffeeProgress * 0.3);
if (Game.frenzy > 0) mult *= Game.frenzyPower;
if (Game.Has('#Upgrade_ElderCovenant')) mult *= 0.95;
Game.globalCpsMult = mult;
Game.cupcakesPs *= Game.globalCpsMult;
for (var i = 0; i < Game.cpsAchievs.length / 2; i++) {
if (Game.cupcakesPs >= Game.cpsAchievs[i * 2 + 1]) Game.Win(Game.cpsAchievs[i * 2]);
}
Game.computedMouseCps = Game.mouseCps();
Game.recalculateGains = 0;
}
/*=====================================================================================
GALACTUS
=======================================================================================*/
// Game.galactus = { x: 0, y: 0, life: 0, delay: 0, dur: 13, toDie: 1, wrath: 0, chain: 0, last: '' };
// Game.galactus.reset = function () {
// Game.galactus.life = 0;
// Game.galactus.delay = 0;
// Game.galactus.dur = 5;
// Game.galactus.toDie = 1;
// Game.galactus.last = '';
// Game.galactus.chain = 0;
// }
// Game.galactus.spawn = function () {
// if (Game.galactus.delay != 0 || Game.galactus.life != 0) Game.Win('#Achievement_CheatedCupcakesTasteAwful');
// var me = l('galactus');
// var r = Math.floor(Math.random() * 360);
// me.style.transform = 'rotate(' + r + 'deg)';
// me.style.mozTransform = 'rotate(' + r + 'deg)';
// me.style.webkitTransform = 'rotate(' + r + 'deg)';
// me.style.msTransform = 'rotate(' + r + 'deg)';
// me.style.oTransform = 'rotate(' + r + 'deg)';
// var screen = l('game').getBoundingClientRect();
// Game.galactus.x = Math.floor(Math.random() * (screen.right - screen.left - 128) + screen.left + 64) - 64;
// Game.galactus.y = Math.floor(Math.random() * (screen.bottom - screen.top - 128) + screen.top + 64) - 64;
// me.style.left = Game.galactus.x + 'px';
// me.style.top = Game.galactus.y + 'px';
// me.style.display = 'block';
// var dur = 13;
// if (Game.galactus.chain > 0) dur = 6;
// Game.galactus.dur = dur;
// Game.galactus.life = Game.fps * Game.galactus.dur;
// me.toDie = 0;
// }
// Game.galactus.update = function () {
// if (Game.galactus.delay == 0 && Game.galactus.life == 0) Game.galactus.spawn();
// if (Game.galactus.life > 0) {
// Game.galactus.life--;
// l('galactus').style.opacity = 1 - Math.pow((Game.galactus.life / (Game.fps * Game.galactus.dur)) * 2 - 1, 4);
// if (Game.galactus.life == 0 || Game.galactus.toDie == 1) {
// if (Game.galactus.life == 0) Game.galactus.chain = 0;
// var m = (5 + Math.floor(Math.random() * 10));
// if (Game.galactus.chain > 0) m = 0.05;
// Game.galactus.delay = Math.ceil(Game.fps * 60 * m);
// l('galactus').style.display = 'none';
// Game.galactus.toDie = 0;
// Game.galactus.life = 0;
// }
// }
// if (Game.galactus.delay > 0) Game.galactus.delay--;
// }
// Game.galactus.choose = function () {
// var list = [];
// if (Game.goldencupcake.wrath > 0) list.push('clot', 'multiply cupcakes', 'ruin cupcakes');
// else list.push('frenzy', 'multiply cupcakes');
// if (Game.galactus.wrath > 0 && Math.random() < 0.3) list.push('blood frenzy', 'chain cupcake');
// else if (Math.random() < 0.01 && Game.cupcakesEarned >= 100000) list.push('chain cupcake');
// if (Math.random() < 0.05) list.push('click frenzy');
// if (Game.galactus.last != '' && Math.random() < 0.8 && list.indexOf(Game.galactus.last) != -1) list.splice(list.indexOf(Game.galactus.last), 1);//80% chance to force a different one
// var choice = choose(list);
// return choice;
// }
// Game.galactus.click = function () {
// if (Game.galactus.life > 0) {
// Game.galactus.toDie = 1;
// Game.galactusClicks++;
// l('galactus').style.display = 'none';
// var choice = Game.galactus.choose();
// if (Game.galactus.chain > 0) choice = 'chain cupcake';
// Game.galactus.last = choice;
// if (choice != 'chain cupcake') Game.galactus.chain = 0;
// switch (choice) {
// case 'frenzy':
// var time = 200;
// Game.frenzy = Game.fps * time;
// Game.frenzyPower = 20;
// Game.recalculateGains = 1;
// Game.Popup('Frenzy : cupcake production x20 for ' + time + ' seconds!');
// break;
// case 'multiply cupcakes':
// var moni = Math.min(Game.cupcakes * 0.1, Game.cupcakesPs * 60 * 20) + 13;//add 10% to cupcakes owned (+13), or 20 minutes of cupcake production - whichever is lowest
// Game.Earn(moni);
// Game.Popup('Lucky! +' + Beautify(moni) + ' cupcakes!');
// break;
// case 'ruin cupcakes':
// var moni = Math.min(Game.cupcakes * 0.05, Game.cupcakesPs * 60 * 10) + 13;//lose 5% of cupcakes owned (-13), or 10 minutes of cupcake production - whichever is lowest
// moni = Math.min(Game.cupcakes, moni);
// Game.Spend(moni);
// Game.Popup('Ruin! Lost ' + Beautify(moni) + ' cupcakes!');
// break;
// case 'blood frenzy':
// var time = 6 + 6 * Game.Has('#Upgrade_GetLucky');
// Game.frenzy = Game.fps * time;//*2;//we shouldn't need *2 but I keep getting reports of it lasting only 3 seconds
// Game.frenzyPower = 666;
// Game.recalculateGains = 1;
// Game.Popup('Elder frenzy : cupcake production x666 for ' + time + ' seconds!');
// break;
// case 'clot':
// var time = 66 + 66 * Game.Has('#Upgrade_GetLucky');
// Game.frenzy = Game.fps * time;
// Game.frenzyPower = 0.5;
// Game.recalculateGains = 1;
// Game.Popup('Clot : cupcake production halved for ' + time + ' seconds!');
// break;
// case 'click frenzy':
// var time = 70;
// Game.clickFrenzy = Game.fps * time;
// Game.recalculateGains = 1;
// Game.Popup('Click frenzy! Clicking power x777 for ' + time + ' seconds!');
// break;
// case 'chain cupcake':
// Game.galactus.chain++;
// var moni = '';
// for (var i = 0; i < Game.galactus.chain; i++) { moni += '6'; }
// moni = parseInt(moni);
// Game.Popup('cupcake chain : +' + Beautify(moni) + ' cupcakes!');
// if ((Math.random() < 0.1 || Game.galactus.chain > 12 || moni >= Game.cupcakes * 1) && Game.galactus.chain > 4) Game.galactus.chain = 0;
// Game.Earn(moni);
// break;
// }
// }
// }
// l('galactus').onclick = Game.galactus.click;
/*=====================================================================================
DARK CHOCOLATE CUPCAKE
=======================================================================================*/
/** @namespace Game.darkchoccupcake */
Game.darkchoccupcake = { x: 0, y: 0, life: 0, delay: 0, dur: 13, toDie: 1, wrath: 0, chain: 0, last: '' };
/**
* Resets Dark Choc Cupcake
* @returns {void}
*/
Game.darkchoccupcake.reset = function () {
Game.darkchoccupcake.life = 0;
Game.darkchoccupcake.delay = 0;
Game.darkchoccupcake.dur = 5;
Game.darkchoccupcake.toDie = 1;
Game.darkchoccupcake.last = '';
Game.darkchoccupcake.chain = 0;
}
/**
* Spawns Dark Choc Cupcake
* @returns {void}
*/
Game.darkchoccupcake.spawn = function () {
if (Game.darkchoccupcake.delay != 0 || Game.darkchoccupcake.life != 0) Game.Win('#Achievement_CheatedCupcakesTasteAwful');
var me = l('darkchoccupcake');
me.style.background = 'url("img/darkCupcake.png")';
var r = Math.floor(Math.random() * 360);
me.style.transform = 'rotate(' + r + 'deg)';
me.style.mozTransform = 'rotate(' + r + 'deg)';
me.style.webkitTransform = 'rotate(' + r + 'deg)';
me.style.msTransform = 'rotate(' + r + 'deg)';
me.style.oTransform = 'rotate(' + r + 'deg)';
var screen = l('game').getBoundingClientRect();
Game.darkchoccupcake.x = Math.floor(Math.random() * (screen.right - screen.left - 128) + screen.left + 64) - 64;
Game.darkchoccupcake.y = Math.floor(Math.random() * (screen.bottom - screen.top - 128) + screen.top + 64) - 64;
me.style.left = Game.darkchoccupcake.x + 'px';
me.style.top = Game.darkchoccupcake.y + 'px';
me.style.display = 'block';
var dur = 13;
if (Game.darkchoccupcake.chain > 0) dur = 6;
Game.darkchoccupcake.dur = dur;
Game.darkchoccupcake.life = Game.fps * Game.darkchoccupcake.dur;
me.toDie = 0;
}
/**
* Updates Dark Choc Cupcake
* @returns {void}
*/
Game.darkchoccupcake.update = function () {
if (Game.darkchoccupcake.delay == 0 && Game.darkchoccupcake.life == 0) Game.darkchoccupcake.spawn();
if (Game.darkchoccupcake.life > 0) {
Game.darkchoccupcake.life--;
l('darkchoccupcake').style.opacity = 1 - Math.pow((Game.darkchoccupcake.life / (Game.fps * Game.darkchoccupcake.dur)) * 2 - 1, 4);
if (Game.darkchoccupcake.life == 0 || Game.darkchoccupcake.toDie == 1) {
if (Game.darkchoccupcake.life == 0) Game.darkchoccupcake.chain = 0;
var m = (5 + Math.floor(Math.random() * 10));
if (Game.darkchoccupcake.chain > 0) m = 0.05;
Game.darkchoccupcake.delay = Math.ceil(Game.fps * 60 * m);
setTimeout(function() {
l('darkchoccupcake').style.display = 'none';
}, 50);
Game.darkchoccupcake.toDie = 0;
Game.darkchoccupcake.life = 0;
}
}
if (Game.darkchoccupcake.delay > 0) Game.darkchoccupcake.delay--;
}
/**
* Chooses effect for Dark Choc Cupcake
* @returns {void}
*/
Game.darkchoccupcake.choose = function () {
var list = [];
if (Game.goldencupcake.wrath > 0) list.push('clot', 'multiply cupcakes', 'ruin cupcakes');
else list.push('frenzy', 'multiply cupcakes');
if (Game.darkchoccupcake.wrath > 0 && Math.random() < 0.3) list.push('blood frenzy', 'chain cupcake');
else if (Math.random() < 0.01 && Game.cupcakesEarned >= 100000) list.push('chain cupcake');
if (Math.random() < 0.05) list.push('click frenzy');
if (Game.darkchoccupcake.last != '' && Math.random() < 0.8 && list.indexOf(Game.darkchoccupcake.last) != -1) list.splice(list.indexOf(Game.darkchoccupcake.last), 1);//80% chance to force a different one
var choice = choose(list);
return choice;
}
/**
* Clicks on Dark Choc Cupcake
* @returns {void}
*/
Game.darkchoccupcake.click = function () {
if (Game.darkchoccupcake.life > 0) {
Game.darkchoccupcake.toDie = 1;
Game.darkchocClicks++;
if (Game.darkchocClicks >= 5) Game.Win('#Achievement_ChocolateLover');
else if (Game.darkchocClicks >= 10) Game.Win('#Achievement_ChocolateFan');
else if (Game.darkchocClicks >= 20) Game.Win('#Achievement_ChocolateFrenzy');
l('darkchoccupcake').style.background = "url('img/sparkles.png')";
//l('darkchoccupcake').style.display = 'none';
var choice = Game.darkchoccupcake.choose();
if (Game.darkchoccupcake.chain > 0) choice = 'chain cupcake';
Game.darkchoccupcake.last = choice;
if (choice != 'chain cupcake') Game.darkchoccupcake.chain = 0;
switch (choice) {
case 'frenzy':
var time = 150;
Game.frenzy += Game.fps * time;
Game.frenzyPower += 15;
Game.recalculateGains = 1;
Game.Popup("#DarkChoc_Frenzy", time);
break;
case 'multiply cupcakes':
var moni = Math.min(Game.cupcakes * 0.1, Game.cupcakesPs * 60 * 20) + 13;//add 10% to cupcakes owned (+13), or 20 minutes of cupcake production - whichever is lowest
Game.Earn(moni);
Game.Popup("#DarkChoc_Multiply", Beautify(moni));
break;
case 'ruin cupcakes':
var moni = Math.min(Game.cupcakes * 0.05, Game.cupcakesPs * 60 * 10) + 13;//lose 5% of cupcakes owned (-13), or 10 minutes of cupcake production - whichever is lowest
moni = Math.min(Game.cupcakes, moni);
Game.Spend(moni);
Game.Popup("#DarkChoc_Ruin", Beautify(moni));
break;
case 'blood frenzy':
var time = 6 + 6 * Game.Has('#Upgrade_GetLucky');
Game.frenzy += Game.fps * time;//*2;//we shouldn't need *2 but I keep getting reports of it lasting only 3 seconds
Game.frenzyPower += 666;
Game.recalculateGains = 1;
Game.Popup("#DarkChoc_ElderFrenzy", time);
break;
case 'clot':
var time = 66 + 66 * Game.Has('#Upgrade_GetLucky');
Game.frenzy += Game.fps * time;
Game.frenzyPower += 0.5;
Game.recalculateGains = 1;
Game.Popup("#DarkChoc_Clot", time);
break;
case 'click frenzy':
var time = 70;
Game.clickFrenzy += Game.fps * time;
Game.recalculateGains = 1;
Game.Popup("#DarkChoc_Clot", time);
break;
case 'chain cupcake':
Game.darkchoccupcake.chain++;
var moni = '';
for (var i = 0; i < Game.darkchoccupcake.chain; i++) { moni += '6'; }
moni = parseInt(moni);
Game.Popup("#DarkChoc_Chain", Beautify(moni));
if ((Math.random() < 0.1 || Game.darkchoccupcake.chain > 12 || moni >= Game.cupcakes * 1) && Game.darkchoccupcake.chain > 4) Game.darkchoccupcake.chain = 0;
Game.Earn(moni);
break;
}
}
}
l('darkchoccupcake').onclick = Game.darkchoccupcake.click;
/*=====================================================================================
GOLDEN CUPCAKE
=======================================================================================*/
/** @namespace Game.goldencupcake */
Game.goldencupcake = { x: 0, y: 0, life: 0, delay: 0, dur: 13, toDie: 1, wrath: 0, chain: 0, last: '' };
var goldensound = new Audio('https://cdn.discordapp.com/attachments/880491676244795465/1053035597851267102/shimmerClick.mp3');
var chrhave = false;
/**
* Resets the Golden Cupcake
* @returns {void}
*/
Game.goldencupcake.reset = function () {
Game.goldencupcake.life = 0;
Game.goldencupcake.delay = 0;
Game.goldencupcake.dur = 13;
Game.goldencupcake.toDie = 1;
Game.goldencupcake.last = '';
Game.goldencupcake.chain = 0;
}
/**
* Spawns the Golden Cupcake
* @returns {void}
*/
Game.goldencupcake.spawn = function () {
if (Game.goldencupcake.delay != 0 || Game.goldencupcake.life != 0) Game.Win('#Achievement_CheatedCupcakesTasteAwful');
var me = l('goldencupcake');
if ((Game.elderWrath == 1 && Math.random() < 0.33) || (Game.elderWrath == 2 && Math.random() < 0.66) || (Game.elderWrath == 3)) {
Game.goldencupcake.wrath = 1;
me.style.background = 'url(img/wrathcupcake.png)';
}
else {
Game.goldencupcake.wrath = 0;
me.style.background = 'url(img/goldcupcake.png)';
}
var r = Math.floor(Math.random() * 360);
me.style.transform = 'rotate(' + r + 'deg)';
me.style.mozTransform = 'rotate(' + r + 'deg)';
me.style.webkitTransform = 'rotate(' + r + 'deg)';
me.style.msTransform = 'rotate(' + r + 'deg)';
me.style.oTransform = 'rotate(' + r + 'deg)';
var screen = l('game').getBoundingClientRect();
Game.goldencupcake.x = Math.floor(Math.random() * (screen.right - screen.left - 128) + screen.left + 64) - 64;
Game.goldencupcake.y = Math.floor(Math.random() * (screen.bottom - screen.top - 128) + screen.top + 64) - 64;
me.style.left = Game.goldencupcake.x + 'px';
me.style.top = Game.goldencupcake.y + 'px';
me.style.display = 'block';
var dur = 13;
if (Game.Has('#Upgrade_LuckyDay')) dur *= 2;
if (Game.Has('#Upgrade_Serendipity')) dur *= 2;
if (Game.goldencupcake.chain > 0) dur = 6;
Game.goldencupcake.dur = dur;
Game.goldencupcake.life = Game.fps * Game.goldencupcake.dur;
me.toDie = 0;
PlaySound("https://cdn.discordapp.com/attachments/1105095523616170024/1105095831717154816/chime.mp3");
}
/**
* Updates the Golden Cupcake
* @returns {void}
*/
Game.goldencupcake.update = function () {
if (Game.goldencupcake.delay == 0 && Game.goldencupcake.life == 0) Game.goldencupcake.spawn();
if (Game.goldencupcake.life > 0) {
Game.goldencupcake.life--;
l('goldencupcake').style.opacity = 1 - Math.pow((Game.goldencupcake.life / (Game.fps * Game.goldencupcake.dur)) * 2 - 1, 4);
if (Game.goldencupcake.life == 0 || Game.goldencupcake.toDie == 1) {
if (Game.goldencupcake.life == 0) Game.goldencupcake.chain = 0;
var m = (5 + Math.floor(Math.random() * 10));
if (Game.Has('#Upgrade_LuckyDay')) m /= 2;
if (Game.Has('#Upgrade_Serendipity')) m /= 2;
if (Game.goldencupcake.chain > 0) m = 0.05;
//Gold Hoard breaks golden cupcakes lol, I fix it later
//if (Game.Has('#Upgrade_GoldHoard')) m = 0.01;
Game.goldencupcake.delay = Math.ceil(Game.fps * 60 * m);
setTimeout(function() {
l('goldencupcake').style.display = 'none';
}, 50);
if (Game.goldencupcake.toDie == 0) Game.missedGoldenClicks++;
Game.goldencupcake.toDie = 0;
Game.goldencupcake.life = 0;
}
}
if (Game.goldencupcake.delay > 0) Game.goldencupcake.delay--;
}
/**
* Chooses effect of Golden Cupcake
* @returns {void}
*/
Game.goldencupcake.choose = function () {
var list = [];
if (Game.goldencupcake.wrath > 0) list.push('clot', 'multiply cupcakes', 'ruin cupcakes');
else list.push('frenzy', 'multiply cupcakes');
if (Game.goldencupcake.wrath > 0 && Math.random() < 0.3) list.push('blood frenzy', 'chain cupcake');
else if (Math.random() < 0.01 && Game.cupcakesEarned >= 100000) list.push('chain cupcake');
if (Math.random() < 0.05) list.push('click frenzy');
if (Game.goldencupcake.last != '' && Math.random() < 0.8 && list.indexOf(Game.goldencupcake.last) != -1) list.splice(list.indexOf(Game.goldencupcake.last), 1);//80% chance to force a different one
var choice = choose(list);
return choice;
}
/**
* Clicks on Golden Cupcake
* @returns {void}
*/
Game.goldencupcake.click = function () {
if (Game.goldencupcake.life > 0) {
Game.goldencupcake.toDie = 1;
goldensound.play();
Game.goldenClicks++;
if (chrhave == false) {
var chrcodee = choose(['yes', 'no']);
}
if (chrcodee == 'yes') {
// Game.Popup('Code: 2023');
chrhave = true;
}
if (Game.goldenClicks >= 1) Game.Win('#Achievement_LemonCupcake');
if (Game.goldenClicks >= 7) Game.Win('#Achievement_LuckyCupcake');
if (Game.goldenClicks >= 27) Game.Win('#Achievement_AStrokeOfLuck');
if (Game.goldenClicks >= 77) Game.Win('#Achievement_HugeLuck');
if (Game.goldenClicks >= 777) Game.Win('#Achievement_Leprechaun');
if (Game.goldenClicks >= 7777) Game.Win('#Achievement_BlackCatsPaw');
if (Game.goldenClicks >= 7) Game.Unlock('#Upgrade_LuckyDay');
if (Game.goldenClicks >= 27) Game.Unlock('#Upgrade_Serendipity');
if (Game.goldenClicks >= 77) Game.Unlock('#Upgrade_GetLucky');
l('goldencupcake').style.background = "url('img/sparkles.png')";
// setTimeout(function() {
// l('goldencupcake').style.display = 'none';
// }, 1000);
var choice = Game.goldencupcake.choose();
if (Game.goldencupcake.chain > 0) choice = 'chain cupcake';
Game.goldencupcake.last = choice;
if (choice != 'chain cupcake') Game.goldencupcake.chain = 0;
switch (choice) {
case 'frenzy':
var time = 77 + 77 * Game.Has('#Upgrade_GetLucky');
Game.frenzy += Game.fps * time;
Game.frenzyPower += 7;
Game.recalculateGains = 1;
Game.Popup("#GoldCupcake_Frenzy", time);
break;
case 'multiply cupcakes':
var moni = Math.min(Game.cupcakes * 0.1, Game.cupcakesPs * 60 * 20) + 13;//add 10% to cupcakes owned (+13), or 20 minutes of cupcake production - whichever is lowest
Game.Earn(moni);
Game.Popup("#GoldCupcake_Multiply", Beautify(moni));
break;
case 'ruin cupcakes':
var moni = Math.min(Game.cupcakes * 0.05, Game.cupcakesPs * 60 * 10) + 13;//lose 5% of cupcakes owned (-13), or 10 minutes of cupcake production - whichever is lowest
moni = Math.min(Game.cupcakes, moni);
Game.Spend(moni);
Game.Popup("#GoldCupcake_Ruin", Beautify(moni));
break;
case 'blood frenzy':
var time = 6 + 6 * Game.Has('#Upgrade_GetLucky');
Game.frenzy += Game.fps * time;//*2;//we shouldn't need *2 but I keep getting reports of it lasting only 3 seconds
Game.frenzyPower += 666;
Game.recalculateGains = 1;
Game.Popup("#GoldCupcake_ElderFrenzy", time);
break;
case 'clot':
var time = 66 + 66 * Game.Has('#Upgrade_GetLucky');
Game.frenzy += Game.fps * time;
Game.frenzyPower += 0.5;
Game.recalculateGains = 1;
Game.Popup("#GoldCupcake_Clot", time);
break;
case 'click frenzy':
var time = 13 + 13 * Game.Has('#Upgrade_GetLucky');
Game.clickFrenzy += Game.fps * time;
Game.recalculateGains = 1;
Game.Popup("#GoldCupcake_ClickFrenzy", time);
break;
case 'chain cupcake':
Game.goldencupcake.chain++;
var moni = '';
for (var i = 0; i < Game.goldencupcake.chain; i++) { moni += '6'; }
moni = parseInt(moni);
Game.Popup("#GoldCupcake_Chain", Beautify(moni));
if ((Math.random() < 0.1 || Game.goldencupcake.chain > 12 || moni >= Game.cupcakes * 1) && Game.goldencupcake.chain > 4) Game.goldencupcake.chain = 0;
Game.Earn(moni);
break;
}
}
}
/*window.onload = function(){
// your code
};*/
l('goldencupcake').onclick = Game.goldencupcake.click;
/*=====================================================================================
EYE OF THE DEVIL
=====================================================================================*/
/** @namespace Game.devileye */
Game.devileye = { x: 0, y: 0, life: 0, delay: 0, dur: 13, toDie: 1, wrath: 0, chain: 0, last: '' };
var devilsound = new Audio('https://cdn.discordapp.com/attachments/1105095523616170024/1107208720385052682/devileyeclick.mp3');
var chrhave = false;
/**
* Resets the Devil Eye
* @returns {void}
*/
Game.devileye.reset = function () {
Game.devileye.life = 0;
Game.devileye.delay = 0;
Game.devileye.dur = 5;
Game.devileye.toDie = 1;
Game.devileye.last = '';
Game.devileye.chain = 0;
}
/**
* Spawns the Devil Eye
* @returns {void}
*/
Game.devileye.spawn = function () {
var me = l('devileye');
if ((Game.elderWrath == 1 && Math.random() < 0.33) || (Game.elderWrath == 2 && Math.random() < 0.66) || (Game.elderWrath == 3)) {
Game.devileye.wrath = 1;
}
else {
Game.devileye.wrath = 0;
me.style.background = 'url(img/devileye.png)';
}
var r = Math.floor(Math.random() * 360);
me.style.transform = 'rotate(' + r + 'deg)';
me.style.mozTransform = 'rotate(' + r + 'deg)';
me.style.webkitTransform = 'rotate(' + r + 'deg)';
me.style.msTransform = 'rotate(' + r + 'deg)';
me.style.oTransform = 'rotate(' + r + 'deg)';
var screen = l('game').getBoundingClientRect();
Game.devileye.x = Math.floor(Math.random() * (screen.right - screen.left - 128) + screen.left + 64) - 64;
Game.devileye.y = Math.floor(Math.random() * (screen.bottom - screen.top - 128) + screen.top + 64) - 64;
me.style.left = Game.devileye.x + 'px';
me.style.top = Game.devileye.y + 'px';
me.style.display = 'block';
var dur = 5;
if (Game.devileye.chain > 0) dur = 6;
Game.devileye.dur = dur;
Game.devileye.life = Game.fps * Game.devileye.dur;
me.toDie = 0;
PlaySound("https://cdn.discordapp.com/attachments/1105095523616170024/1107208720032743454/devileyeappear.mp3");
}
/**
* Updates the Devil Eye
* @returns {void}
*/
Game.devileye.update = function () {
if (Game.devileye.delay == 0 && Game.devileye.life == 0 && Game.Has('#Upgrade_SatanicCupcake')) Game.devileye.spawn();
if (Game.devileye.life > 0) {
Game.devileye.life--;
l('devileye').style.opacity = 1 - Math.pow((Game.devileye.life / (Game.fps * Game.devileye.dur)) * 2 - 1, 4);
if (Game.devileye.life == 0 || Game.devileye.toDie == 1) {
if (Game.devileye.life == 0) Game.devileye.chain = 0;
var m = (6 + Math.floor(Math.random() * 10));
if (Game.devileye.chain > 0) m = 0.05;
Game.devileye.delay = Math.ceil(Game.fps * 60 * m);
//Game.devileye.delay = 10;
Game.devileye.toDie = 0;
Game.devileye.life = 0;
}
}
if (Game.devileye.delay > 0) Game.devileye.delay--;
}
/**
* Chooses effect of Devil Eye
* @returns {void}
*/
Game.devileye.choose = function () {
var list = [];
if (Game.devileye.wrath > 0) list.push('clot', 'multiply cupcakes', 'ruin cupcakes');
else list.push('frenzy', 'multiply cupcakes');
if (Game.devileye.wrath > 0 && Math.random() < 0.3) list.push('blood frenzy', 'chain cupcake');
else if (Math.random() < 0.01 && Game.cupcakesEarned >= 100000) list.push('chain cupcake');
if (Math.random() < 0.05) list.push('click frenzy');
if (Game.devileye.last != '' && Math.random() < 0.8 && list.indexOf(Game.devileye.last) != -1) list.splice(list.indexOf(Game.devileye.last), 1);//80% chance to force a different one
var choice = choose(list);
return choice;
}
/**
* Clicks on Devil Eye
* @returns {void}
*/
Game.devileye.click = function () {
if (Game.devileye.life > 0) {
Game.devileye.toDie = 1;
devilsound.play();
// setTimeout(function() {
// l('devileye').style.display = 'none';
// }, 1000);
l('devileye').style.display = 'none';
var choice = Game.devileye.choose();
if (Game.devileye.chain > 0) choice = 'chain cupcake';
Game.devileye.last = choice;
if (choice != 'chain cupcake') Game.devileye.chain = 0;
switch (choice) {
case 'frenzy':
var time = 50;
Game.frenzy += Game.fps * time;
Game.frenzyPower += 20;
Game.recalculateGains = 1;
Game.Popup("Satanic Frenzy : cupcake production x20 for {0} seconds!", time);
break;
case 'multiply cupcakes':
var moni = Math.min(Game.cupcakes * 0.1, Game.cupcakesPs * 60 * 20) + 23;//add 10% to cupcakes owned (+13), or 20 minutes of cupcake production - whichever is lowest
Game.Earn(moni);
Game.Popup("#GoldCupcake_Multiply", Beautify(moni));
break;
case 'ruin cupcakes':
var moni = Math.min(Game.cupcakes * 0.05, Game.cupcakesPs * 60 * 10) + 33;//lose 5% of cupcakes owned (-13), or 10 minutes of cupcake production - whichever is lowest
moni = Math.min(Game.cupcakes, moni);
Game.Spend(moni);
Game.Popup("#GoldCupcake_Ruin", Beautify(moni));
break;
case 'blood frenzy':
var time = 6 + 6 * Game.Has('#Upgrade_GetLucky');
Game.frenzy += Game.fps * time;
Game.frenzyPower += 666;
Game.recalculateGains = 1;
Game.Popup("#GoldCupcake_ElderFrenzy", time);
break;
case 'clot':
var time = 66 + 66 * Game.Has('#Upgrade_GetLucky');
Game.frenzy += Game.fps * time;
Game.frenzyPower += 0.5;
Game.recalculateGains = 1;
Game.Popup("#GoldCupcake_Clot", time);
break;
case 'click frenzy':
var time = 23 + 13 * Game.Has('#Upgrade_GetLucky');
Game.clickFrenzy = Game.fps * time;
Game.recalculateGains = 1;
Game.Popup("#GoldCupcake_ClickFrenzy", time);
break;
case 'chain cupcake':
Game.devileye.chain++;
var moni = '';
for (var i = 0; i < Game.devileye.chain; i++) { moni += '6'; }
moni = parseInt(moni);
Game.Popup("#GoldCupcake_Chain", Beautify(moni));
if ((Math.random() < 0.1 || Game.devileye.chain > 12 || moni >= Game.cupcakes * 1) && Game.devileye.chain > 4) Game.devileye.chain = 0;
Game.Earn(moni);
break;
}
}
}
/*window.onload = function(){
// your code
};*/
l('devileye').onclick = Game.devileye.click;
/*=====================================================================================
PARTICLES
=======================================================================================*/
/**
* Falling cupcakes
* @type {Array<any>}
*/
Game.cupcakeParticles = [];
var str = '';
for (var i = 0; i < 40; i++) {
Game.cupcakeParticles[i] = { x: 0, y: 0, life: -1 };
str += '<div id="cupcakeParticle' + i + '" class="cupcakeParticle"></div>';
}
l('cupcakeShower').innerHTML = str;
/**
* Updates the particles
* @returns {void}
*/
Game.cupcakeParticlesUpdate = function () {
for (var i in Game.cupcakeParticles) {
var me = Game.cupcakeParticles[i];
if (me.life != -1) {
me.y += me.life * 0.5 + Math.random() * 0.5;
me.life++;
var el = me.l;
el.style.left = Math.floor(me.x) + 'px';
el.style.top = Math.floor(me.y) + 'px';
el.style.opacity = 1 - (me.life / (Game.fps * 2));
if (me.life >= Game.fps * 2) {
me.life = -1;
me.l.style.opacity = 0;
}
}
}
}
/**
* Add particle
* @returns {void}
*/
Game.cupcakeParticleAdd = function () {
//pick the first free (or the oldest) particle to replace it
if (Game.prefs.particles) {
var highest = 0;
var highestI = 0;
for (var i in Game.cupcakeParticles) {
if (Game.cupcakeParticles[i].life == -1) { highestI = i; break; }
if (Game.cupcakeParticles[i].life > highest) {
highest = Game.cupcakeParticles[i].life;
highestI = i;
}
}
var i = highestI;
var rect = l('cupcakeShower').getBoundingClientRect();
var x = Math.floor(Math.random() * (rect.right - rect.left));
var y = -32;
var me = Game.cupcakeParticles[i];
if (!me.l) me.l = l('cupcakeParticle' + i);
me.life = 0;
me.x = x;
me.y = y;
var r = Math.floor(Math.random() * 360);
me.l.style.backgroundPosition = (Math.floor(Math.random() * 8) * 64) + 'px 0px';
me.l.style.transform = 'rotate(' + r + 'deg)';
me.l.style.mozTransform = 'rotate(' + r + 'deg)';
me.l.style.webkitTransform = 'rotate(' + r + 'deg)';
me.l.style.msTransform = 'rotate(' + r + 'deg)';
me.l.style.oTransform = 'rotate(' + r + 'deg)';
}
}
/**
* Rising numbers
* @type {Array<any>}
*/
Game.cupcakeNumbers = [];
var str = '';
for (var i = 0; i < 20; i++) {
Game.cupcakeNumbers[i] = { x: 0, y: 0, life: -1, text: '' };
str += '<div id="cupcakeNumber' + i + '" class="cupcakeNumber title"></div>';
}
l('cupcakeNumbers').innerHTML = str;
/**
* Update numbers
* @returns {void}
*/
Game.cupcakeNumbersUpdate = function () {
for (var i in Game.cupcakeNumbers) {
var me = Game.cupcakeNumbers[i];
if (me.life != -1) {
me.y -= me.life * 0.5 + Math.random() * 0.5;
me.life++;
var el = me.l;
el.style.left = Math.floor(me.x) + 'px';
el.style.top = Math.floor(me.y) + 'px';
el.style.opacity = 1 - (me.life / (Game.fps * 1));
//l('cupcakeNumber'+i).style.zIndex=(1000+(Game.fps*1-me.life));
if (me.life >= Game.fps * 1) {
me.life = -1;
me.l.style.opacity = 0;
}
}
}
}
/**
* Adds rising number with text)
* @param {string} text Text of label
* @returns {void}
*/
Game.cupcakeNumberAdd = function (text) {
//pick the first free (or the oldest) particle to replace it
var highest = 0;
var highestI = 0;
for (var i in Game.cupcakeNumbers) {
if (Game.cupcakeNumbers[i].life == -1) { highestI = i; break; }
if (Game.cupcakeNumbers[i].life > highest) {
highest = Game.cupcakeNumbers[i].life;
highestI = i;
}
}
var i = highestI;
var x = -100 + (Math.random() - 0.5) * 40;
var y = 0 + (Math.random() - 0.5) * 40;
var me = Game.cupcakeNumbers[i];
if (!me.l) me.l = l('cupcakeNumber' + i);
me.life = 0;
me.x = x;
me.y = y;
me.text = text;
me.l.innerHTML = text;
me.l.style.left = Math.floor(Game.cupcakeNumbers[i].x) + 'px';
me.l.style.top = Math.floor(Game.cupcakeNumbers[i].y) + 'px';
}
/**
* Generic particles
* @type {Array<any>}
*/
Game.particles = [];
/**
* Y axis of generic particles
* @type {number}
*/
Game.particlesY = 0;
var str = '';
for (var i = 0; i < 20; i++) {
Game.particles[i] = { x: 0, y: 0, life: -1, text: '' };
str += '<div id="particle' + i + '" class="particle title"></div>';
}
l('particles').innerHTML = str;
/**
* Update generic particles
* @returns {void}
*/
Game.particlesUpdate = function () {
Game.particlesY = 0;
for (var i in Game.particles) {
var me = Game.particles[i];
if (me.life != -1) {
Game.particlesY += 64;//me.l.clientHeight;
var y = me.y - (1 - Math.pow(1 - me.life / (Game.fps * 4), 10)) * 50;
//me.y=me.life*0.25+Math.random()*0.25;
me.life++;
var el = me.l;
el.style.left = Math.floor(-200 + me.x) + 'px';
el.style.bottom = Math.floor(-y) + 'px';
el.style.opacity = 1 - (me.life / (Game.fps * 4));
if (me.life >= Game.fps * 4) {
me.life = -1;
el.style.opacity = 0;
el.style.display = 'none';
}
}
}
}
/**
* Adds generic particle
* @param {string} text Text of particle
* @param {boolean} el
* @returns {void}
*/
Game.particlesAdd = function (text, el) {
//pick the first free (or the oldest) particle to replace it
var highest = 0;
var highestI = 0;
for (var i in Game.particles) {
if (Game.particles[i].life == -1) { highestI = i; break; }
if (Game.particles[i].life > highest) {
highest = Game.particles[i].life;
highestI = i;
}
}
var i = highestI;
var x = (Math.random() - 0.5) * 40;
var y = 0;//+(Math.random()-0.5)*40;
if (!el) {
var rect = l('game').getBoundingClientRect();
var x = Math.floor((rect.left + rect.right) / 2);
var y = Math.floor((rect.bottom));
x += (Math.random() - 0.5) * 40;
y += 0;//(Math.random()-0.5)*40;
}
var me = Game.particles[i];
if (!me.l) me.l = l('particle' + i);
me.life = 0;
me.x = x;
me.y = y - Game.particlesY;
me.text = text;
me.l.innerHTML = text;
me.l.style.left = Math.floor(Game.particles[i].x - 200) + 'px';
me.l.style.bottom = Math.floor(-Game.particles[i].y) + 'px';
me.l.style.display = 'block';
Game.particlesY += 60;
}
/**
* Shows popup with some text (text will be localized by key if one is specified)
* @param {string} text
* @param {...any[]} argumets
* @returns {void}
*/
Game.Popup = function (text) {
Game.particlesAdd(Localization.GetText(text).vformat(arguments, 1));
}
Game.veil = 1;
Game.veilOn = function () {
//l('sectionMiddle').style.display='none';
l('sectionRight').style.display = 'none';
l('backgroundLayer2').style.background = '#000 url(img/darkNoise.png)';
Game.veil = 1;
}
Game.veilOff = function () {
//l('sectionMiddle').style.display='block';
l('sectionRight').style.display = 'block';
l('backgroundLayer2').style.background = 'transparent';
Game.veil = 0;
}
/*=====================================================================================
DEV FUNCTIONS
=====================================================================================*/
/**
* Dev function. Applies certain amount of cupcake with some mode
* @param {any} amount Amount of cupcake to apply
* @param {any} mode Mode of apply. 0 - Add, 1 - Multiply, 2 - Subtract, 3 - Divide
* @returns {void}
*/
Game.AddCupcake = function(amount, mode) {
if (mode == 0) {
Game.cupcakes += amount;
} else if (mode == 1) {
Game.cupcakes *= amount;
} else if (mode == 2) {
Game.cupcakes -= amount;
} else if (mode == 3) {
Game.cupcakes /= amount;
}
}
/**
* Sets the delay to show of GC/DCC to zero.
* @param {any} mode 0 - GC, 1 - DCC
* @returns {void}
*/
Game.AbuseGC = function(mode) {
if (mode == 0) {
setInterval(function() {
Game.goldenCookie.delay = 0;
}, 0);
} else if (mode == 1) {
setInterval(function() {
Game.darkchoccupcake.delay = 0;
}, 0);
}
}
/**
* Opens prompt with achieve entering
* @returns {void}
*/
Game.GetAchieve = function() {
let achieve = CupcakePrompt("Get Achievement", "What Achievement do you need?", true, true,
"Achievement Name", "Enter Achievement Name", function(inputValue){Game.Win(inputValue);}, null);
}
/**
* Opens prompt with new cupcake img url entering
* @returns {void}
*/
Game.ChangeCupcake = function() {
let newcup = CupcakePrompt("Cupcake Changer", "URL to cupcake image", true, true,
"URL to Cupcake", "Enter image URL", function(inputValue){l('bigcupcake').style.background = "url('"+inputValue+"')";}, null);
}
/*=====================================================================================
COFFEE SELECT
=====================================================================================*/
/**
* Changes coffee
* @param {string} coffee coffee name
* @returns {void}
*/
Game.ChangeCoffee=function(coffee) {
Game.SelectedCoffee = coffee;
}
/*=====================================================================================
CHANGE CUPCAKE SHINE
=====================================================================================*/
ShineChange = function(imageUrl) {
let cupcakeShine = document.getElementById('cupcakeShine');
cupcakeShine.style.backgroundImage = 'url(' + imageUrl + ')';
}
/*=====================================================================================
GIFT CODE
=====================================================================================*/
giftEnc = function(str) {
let encrypted = '';
for (let i = 0; i < str.length; i++) {
let charCode = str.charCodeAt(i);
charCode += 5;
encrypted += String.fromCharCode(charCode);
}
//encrypted = caesarCipher(encrypted, 4);
return encrypted;
}
giftDec = function(str) {
let decrypted = '';
for (let i = 0; i < str.length; i++) {
let charCode = str.charCodeAt(i);
charCode -= 5;
decrypted += String.fromCharCode(charCode);
}
// decrypted = caesarDecipher(decrypted, 4);
// console.log(decrypted);
// console.log(b64_to_utf8(decrypted));
return decrypted;
}
useGiftCode = function() {
var code = prompt(Localization.GetText('#GC_EnterCode'));
//console.log(code.length);
if (code != null && code.length <= 32) {
code = giftDec(code);
if (!giftCodes.includes(code)) {
giftCodes.push(code);
code = b64_to_utf8(code);
var cupcakesToAdd = parseInt(code.split('|')[1]);
Game.Earn(cupcakesToAdd);
console.log(giftCodes);
Game.Popup('#GC_Yes', cupcakesToAdd.toString());
} else {
Game.Popup('#GC_Used');
}
} else {
Game.Popup('#GC_Nope');
}
}
createGiftCode = function() {
var howmuch = prompt(Localization.GetText('#GC_HowMuch'));
if (howmuch > Game.cupcakes && howmuch < 10000000000000) {
Game.Popup('#GC_NotEnough');
} else if (howmuch > 0 && howmuch < 10000000000000) {
var code = '';
code += getRandomInt(100, 999) + '|';
code += howmuch.toString() + '|';
Game.cupcakes -= howmuch;
code += getRandomInt(100, 999);
giftCodes.push(utf8_to_b64(code));
alert(giftEnc(utf8_to_b64(code)));
} else {
Game.Popup('#GC_HowError');
}
}
gcprint = function(){
console.log(giftCodes);
}
/*=====================================================================================
MENUS
=======================================================================================*/
Game.cssClasses = [];
/**
* Add CSS class to 'game' HTML Element
* @param {string} what CSS class
* @returns {void}
*/
Game.addClass = function (what) { if (Game.cssClasses.indexOf(what) == -1) Game.cssClasses.push(what); Game.updateClasses(); }
/**
* Removes CSS class to 'game' HTML Element
* @param {string} what CSS class
* @returns {void}
*/
Game.removeClass = function (what) { var i = Game.cssClasses.indexOf(what); if (i != -1) { Game.cssClasses.splice(i, 1); } Game.updateClasses(); }
/**
* Updates CSS classes to 'game' HTML Element
* @returns {void}
*/
Game.updateClasses = function () { var str = ''; for (var i in Game.cssClasses) { str += Game.cssClasses[i] + ' '; } l('game').className = str; }
Game.WriteButton = function (prefName, button, on, off, callback) {
return '<a class="option" id="' + button + '" onclick="Game.Toggle(\'' + prefName + '\',\'' + button + '\',\'' + on + '\',\'' + off + '\');' + (callback || '') + '">' + (Game.prefs[prefName] ? on : off) + '</a>';
}
Game.Toggle = function (prefName, button, on, off) {
if (Game.prefs[prefName]) {
l(button).innerHTML = off;
l(button).className = '';
Game.prefs[prefName] = 0;
}
else {
l(button).innerHTML = on;
l(button).className = 'enabled';
Game.prefs[prefName] = 1;
}
}
Game.ToggleFancy = function () {
if (Game.prefs.fancy) Game.removeClass('noFancy');
else if (!Game.prefs.fancy) Game.addClass('noFancy');
}
Game.onMenu = '';
/**
* Shows menu by name
* @param {string} what Menu name
* @returns {void}
*/
Game.ShowMenu = function (what) {
if (!what) what = '';
if (Game.onMenu == '' && what != '') Game.addClass('onMenu');
else if (Game.onMenu != '' && what != Game.onMenu) Game.addClass('onMenu');
else if (what == Game.onMenu) { Game.removeClass('onMenu'); what = ''; }
Game.onMenu = what;
Game.UpdateMenu();
}
/**
* Beautifies the time
* @param {number} time Time number
* @param {number} detail Detalisation. 2 - Days, 3 - Hours, 4 - Minutes, 5 - Secconds
* @returns {string}
*/
Game.sayTime = function (time, detail) {
var str = '';
var detail = detail || 0;
time = Math.floor(time);
if (time >= Game.fps * 60 * 60 * 24 * 2 && detail < 2) str = Beautify(time / (Game.fps * 60 * 60 * 24)) + Localization.GetText("#Time_Days");
else if (time >= Game.fps * 60 * 60 * 24 && detail < 2) str = Localization.GetText("#Time_OneDay");
else if (time >= Game.fps * 60 * 60 * 2 && detail < 3) str = Beautify(time / (Game.fps * 60 * 60)) + Localization.GetText("#Time_Hours");
else if (time >= Game.fps * 60 * 60 && detail < 3) str = Localization.GetText("#Time_OneHour");
else if (time >= Game.fps * 60 * 2 && detail < 4) str = Beautify(time / (Game.fps * 60)) + Localization.GetText("#Time_Minutes");
else if (time >= Game.fps * 60 && detail < 4) str = Localization.GetText("#Time_OneMinute");
else if (time >= Game.fps * 2 && detail < 5) str = Beautify(time / (Game.fps)) + Localization.GetText("#Time_Secconds");
else if (time >= Game.fps && detail < 5) str = Localization.GetText("#Time_OneSeccond");
return str;
}
/**
* Toggles the music
* @param {Audio} audioobj Object of custom audio
* @returns {void}
*/
Game.ToggleMusic = function (audioobj) {
if (Game.prefs.music === 1) {
Game.prefs.music = 0;
var bgmusic = audioobj;
bgmusic.pause();
} else {
Game.prefs.music = 1;
Game.BgMusic();
}
}
/**
* Invokes change BG image prompt
* @returns {void}
*/
Game.ChangeBG = function () {
// var newbg = CupcakePrompt("Background Changer", "Enter Image URL", true, true,
// "Image URL", "Image URL", function(inputValue){
// var repeatOption = CupcakePrompt("Background Changer","Repeat option (R(repeat), RX(repeat-x), RY(repeat-y), NR(no-repeat))", true, true,
// "Repeat Option", "Repeat Option", function(repVal){
// if (newbg != "" && (repVal.toLowerCase() == "repeat" || repVal == "R")) {
// l('backgroundLayer1').style.background = 'url("' + inputValue + '") ' + repVal;
// } else if (newbg != "" && (repVal.toLowerCase() == "repeat-x" || repVal == "RX")) {
// l('backgroundLayer1').style.background = 'url("' + inputValue + '") ' + repVal;
// l('backgroundLayer1').style.backgroundRepeat = "repeat-x";
// l('backgroundLayer1').style.backgroundSize = "contain";
// } else if (newbg != "" && (repVal.toLowerCase() == "repeat-y" || repVal == "RY")) {
// l('backgroundLayer1').style.background = 'url("' + inputValue + '") ' + repVal;
// l('backgroundLayer1').style.backgroundRepeat = "repeat-y";
// l('backgroundLayer1').style.backgroundSize = "contain";
// } else if (newbg != "") {
// l('backgroundLayer1').style.background = 'url("' + inputValue + '")';
// l('backgroundLayer1').style.backgroundPosition = 'center';
// l('backgroundLayer1').style.backgroundSize = 'cover';
// } else {
// alert('ERROR! No such image.');
// }
// }, null);
// }, null);
var newbg = CupcakePrompt("Background Changer", "Enter Image URL", true, true,
"Image URL", "Image URL", function(inputValue){
l('backgroundLayer1').style.background = 'url("' + inputValue + '")';
l('backgroundLayer1').style.backgroundPosition = 'center';
l('backgroundLayer1').style.backgroundSize = 'cover';
}, null);
}
/**
* Updates the menu
* @returns {void}
*/
Game.UpdateMenu = function () {
var str = '';
if (Game.onMenu != '') {
str += '<div style="position:absolute;top:8px;right:8px;cursor:pointer;font-size:16px;" onclick="Game.ShowMenu(Game.onMenu);">X</div>';
}
if (Game.onMenu == 'prefs') {
str += `<div class="section">${Localization.GetText("#UI_PrefsMenu")}</div>` +
'<div class="subsection">' +
`<div class="title">${Localization.GetText("#UI_PrefsGeneral")}</div>` +
`<div class="listing"><a class="option" onclick="Game.WriteSave();">${Localization.GetText("#UI_PrefsSaveBtnName")}</a><label>${Localization.GetText("#UI_PrefsSaveBtnDesc")}</label></div>` +
`<div class="listing"><a class="option" onclick="Game.ExportSave();">${Localization.GetText("#UI_PrefsExportSaveBtnName")}</a><a class="option" onclick="Game.ImportSave();">${Localization.GetText("#UI_PrefsImportSaveBtnName")}</a><label>${Localization.GetText("#UI_PrefsExportImportSaveBtnDesc")}</label></div>` +
`<div class="listing"><a class="option" onclick="Game.ChangeBG();">${Localization.GetText("#UI_PrefsChangeBGBtnName")}</a><label>${Localization.GetText("#UI_PrefsChangeBGBtnDesc")}</label></div>` +
// `<div class="listing"><a class="option" onclick="createGiftCode();">${Localization.GetText('#GC_CreateButton')}</a><label>${Localization.GetText('#GC_CreateButtonLabel')}</div>` +
// `<div class="listing"><a class="option" onclick="useGiftCode();">${Localization.GetText('#GC_UseButton')}</a><label>${Localization.GetText('#GC_UseButtonLabel')}</div>` +
//'<div class="listing"><span class="warning" style="font-size:12px;">[Note : importing saves from earlier versions than 1.0 will be disabled beyond September 1st, 2013.]</span></div>'+
`<div class="listing"><a class="option warning" onclick="Game.Reset();">${Localization.GetText("#UI_PrefsResetBtnName")}</a><label>${Localization.GetText("#UI_PrefsResetBtnDesc")}</label></div>` +
`<div class="listing"><a class="option warning" onclick="Game.HardReset();">${Localization.GetText("#UI_PrefsHardResetBtnName")}</a><label>${Localization.GetText("#UI_PrefsHardResetBtnDesc")}</label></div>` +
`<div class="title">${Localization.GetText("#UI_PrefsSettings")}</div>` +
'<div class="listing">' +
Game.WriteButton('fancy', 'fancyButton', Localization.GetText("#UI_PrefsFancyON"), Localization.GetText("#UI_PrefsFancyOFF"), 'Game.ToggleFancy();') +
Game.WriteButton('particles', 'particlesButton', Localization.GetText("#UI_PrefsParticlesON"), Localization.GetText("#UI_PrefsParticlesOFF")) +
Game.WriteButton('numbers', 'numbersButton', Localization.GetText("#UI_PrefsNumbersON"), Localization.GetText("#UI_PrefsNumbersOFF")) +
Game.WriteButton('Music', 'musicButton', Localization.GetText("#UI_PrefsMusicOFF"), Localization.GetText("#UI_PrefsMusicON"), 'Game.ToggleMusic(bgmusic);') +
//Game.WriteButton('cupcakes','cupcakesButton','Cupcake 1','Cupcake 2')+
Game.WriteButton('coffee', 'coffeeButton', Localization.GetText("#UI_PrefsCoffeeON"), Localization.GetText("#UI_PrefsCoffeeOFF")) +
'</div>' +
'<div class="listing">' + Game.WriteButton('autoupdate', 'autoupdateButton', Localization.GetText("#UI_PrefsOfflineModeOFF"), Localization.GetText("#UI_PrefsOfflineModeON")) + `<label>${Localization.GetText("#UI_PrefsOfflineModeDesc")}</label></div>`+
`<div class="title">Coffee Select</div>`+
`<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeWave');">${Localization.GetText("#Coffee_Classic")}</a><label>${Localization.GetText("#Coffee_Classic_Desc")}</label></div>`;
//'<div class="listing">'+Game.WriteButton('autosave','autosaveButton','Autosave ON','Autosave OFF')+'</div>'
if (Game.ChocolateCoffee == true) {
str += `<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeCoconut');">${Localization.GetText("#Coffee_Coconut")}</a><label>${Localization.GetText("#Coffee_Coconut_Desc_Unlock")}</label></div>`;
} else {
str += `<div class="listing"><a class="option warning">${Localization.GetText("#Coffee_Coconut")}</a><label>${Localization.GetText("#Coffee_Coconut_Desc")}</label></div>`;
}
if (Game.coffeeFire == true) {
str += `<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeFire');">${Localization.GetText("#Coffee_Fire")}</a><label>${Localization.GetText("#Coffee_Fire_Desc_Unlock")}</label></div>`;
} else {
str += `<div class="listing"><a class="option warning">${Localization.GetText("#Coffee_Fire")}</a><label>${Localization.GetText("#Coffee_Fire_Desc")}</label></div>`;
}
if (Game.coffeeBlueFire == true) {
str += `<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeBlueFire');">${Localization.GetText("#Coffee_BlueFire")}</a><label>${Localization.GetText("#Coffee_BlueFire_Desc_Unlock")}</label></div>`;
} else {
str += `<div class="listing"><a class="option warning">${Localization.GetText("#Coffee_BlueFire")}</a><label>${Localization.GetText("#Coffee_BlueFire_Desc")}</label></div>`;
}
if (Game.coffeeGold == true) {
str += `<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeGold');">${Localization.GetText("#Coffee_Golden")}</a><label>${Localization.GetText("#Coffee_Golden_Desc_Unlock")}</label></div>`;
} else {
str += `<div class="listing"><a class="option warning">${Localization.GetText("#Coffee_Golden")}</a><label>${Localization.GetText("#Coffee_Golden_Desc")}</label></div>`;
}
if (Game.coffeeStars == true) {
str += `<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeStars');">${Localization.GetText("#Coffee_Space")}</a><label>${Localization.GetText("#Coffee_Space_Desc_Unlock")}</label></div>`;
} else {
str += `<div class="listing"><a class="option warning">${Localization.GetText("#Coffee_Space")}</a><label>${Localization.GetText("#Coffee_Space_Desc")}</label></div>`;
}
if (Game.coffeeBlood == true) {
str += `<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeBlood');">${Localization.GetText("#Coffee_Blood")}</a><label>${Localization.GetText("#Coffee_Blood_Desc_Unlock")}</label></div>`;
} else {
str += `<div class="listing"><a class="option warning">${Localization.GetText("#Coffee_Blood")}</a><label>${Localization.GetText("#Coffee_Blood_Desc")}</label></div>`;
}
if (Game.coffeeBlackSpace == true) {
str += `<div class="listing"><a class="option" onclick="Game.ChangeCoffee('coffeeBlackSpace');">${Localization.GetText("#Coffee_BlackSpace")}</a><label>${Localization.GetText("#Coffee_BlackSpace_Desc_Unlock")}</label></div>`;
} else {
str += `<div class="listing"><a class="option warning">${Localization.GetText("#Coffee_BlackSpace")}</a><label>${Localization.GetText("#Coffee_BlackSpace_Desc")}</b></label></div>`;
}
if (Game.DEV == true) {
str += `<div class="title">[DEV] DEV MENU</div>`+
`<div class="listing"><a class="option" onclick="Game.AddCupcake(10, 0);">+10 cupcakes</a><label>Get 10 cupcakes</label></div>`+
`<div class="listing"><a class="option" onclick="Game.AddCupcake(2, 1);">cupcakes * 2</a><label>GUESS WHAT DAT THING DO</label></div>`+
`<div class="listing"><a class="option" onclick="Game.AddCupcake(10, 1);">cupcakes * 10</a></div>`+
`<div class="listing"><a class="option" onclick="Game.AddCupcake(10, 2);">-10 cupcakes</a></div>`+
`<div class="listing"><a class="option" onclick="Game.AddCupcake(2, 3);">cupcakes / 2</a></div>`+
`<div class="listing"><a class="option" onclick="Game.AddCupcake(10, 3);">cupcakes / 10</a></div>`+
`<div class="listing"><a class="option" onclick="Game.RuinTheFun();">Ruin The Fun</a><label>Get everything</label></div>`+
`<div class="listing"><a class="option" onclick="Game.AbuseGC(0);">Abuse GC</a><label>golden cupcakes instant spawn</label></div>`+
`<div class="listing"><a class="option" onclick="Game.AbuseGC(1);">Abuse DCC</a><label>dark chocolate cupcake instant spawn</label></div>`+
`<div class="listing"><a class="option" onclick="Game.goldencupcake.spawn();">Spawn Golden Cupcake</a></div>`+
`<div class="listing"><a class="option" onclick="Game.darkchoccupcake.spawn();">Spawn DC cupcake</a></div>`+
`<div class="listing"><a class="option" onclick="alert(Game.HowMuchPrestige(Game.cupcakesEarned));">How Much Prestige</a></div>`+
`<div class="listing"><a class="option" onclick="Game.GetAchieve();">Get Any Achievement</a></div>`+
// `<div class="title">[DEV] FUN MENU</div>`+
// `<div class="listing"><a class="option" onclick="Game.ChangeCupcake();">Change Cupcake</a></div>`+
// `<div class="listing"><a class="option" onclick="alert("BARK");">bark</a></div>`+
`</div>`;
} else {
str += `</div>`;
}
str += Game.CustomMenu;
}
else if (Game.onMenu == 'log') {
str += `<div class="section">${Localization.GetText("#UI_LogUpdates")}</div>` +
Game.CustomLogs +
'<div class="subsection">' +
'<div class="title">02/09/2023:</div>' +
'<div class="listing">- Added new prompt/alert window!</div>' +
'</div><div class="subsection">' +
'<div class="title">30/08/2023:</div>' +
'<div class="listing">- Separated <b>localization</b> and <b>music mods</b> from <b>feature mods</b>!</div>' +
'</div><div class="subsection">' +
'<div class="title">29/08/2023:</div>' +
'<div class="listing">- Added new track to OST!</div>' +
'<div class="listing">- Added new easter egg!</div>' +
'</div><div class="subsection">' +
'<div class="title">28/08/2023:</div>' +
'<div class="listing">- Added new upgrades!</div>' +
'<div class="listing">- Added <b>The Cat</b>!</div>' +
'</div><div class="subsection">' +
'<div class="title">26/08/2023:</div>' +
'<div class="listing">- Added Marshmallow Rain!</div>' +
'<div class="listing">- New Achievement!</div>' +
'<div class="listing">- New store tiles sprite!</div>' +
'</div><div class="subsection">' +
'<div class="title">19/08/2023:</div>' +
'<div class="listing">- Now if you click on one bonus and then on another, the effects will stack and not be replaced!</div>' +
'</div><div class="subsection">' +
'<div class="title">01/08/2023:</div>' +
'<div class="listing">- More News Tickers Added!</div>' +
'</div><div class="subsection">' +
'<div class="title">28/07/2023:</div>' +
'<div class="listing">- Now in your mods when adding achievements or upgrades you can upload your own icons via URL! (just write the link where you usually write the coordinates of the icons).</div>' +
'<div class="listing">- Added new track to OST!</div>' +
'</div><div class="subsection">' +
'<div class="title">26/07/2023:</div>' +
'<div class="listing">- Added new frenzy effect!</div>' +
'<div class="listing">- Added new track to OST!</div>' +
'</div><div class="subsection">' +
'<div class="title">20/07/2023:</div>' +
'<div class="listing">- Now you can add content to menus through mods!</div>' +
'</div><div class="subsection">' +
'<div class="title">07/07/2023:</div>' +
'<div class="listing">- Cupcake Galaxy Added!</div>' +
'</div><div class="subsection">' +
'<div class="title">30/06/2023:</div>' +
'<div class="listing">- Cyber Prism and Clone Machine sprites updated!</div>' +
'<div class="listing">- Added more upgrades!</div>' +
'</div><div class="subsection">' +
'<div class="title">24/06/2023:</div>' +
'<div class="listing">- Fixed Music Button and Change BG!</div>' +
'<div class="listing">- Added more upgrades!</div>' +
'</div><div class="subsection">' +
'<div class="title">16/06/2023:</div>' +
'<div class="listing">- Added Heavenly Upgrades!</div>' +
'<div class="listing">- Updated OST!</div>' +
'</div><div class="subsection">' +
'<div class="title">29/05/2023:</div>' +
'<div class="listing">- Updated OST!</div>' +
'<div class="listing">- New clone machine achievements!</div>' +
'<div class="listing">- New cupcakes!</div>' +
'</div><div class="subsection">' +
'<div class="title">25/05/2023:</div>' +
'<div class="listing">- OST and SFX updated!</div>' +
'<div class="listing">- New achievements and cupcakes!</div>' +
'</div><div class="subsection">' +
'<div class="title">20/05/2023:</div>' +
'<div class="listing">- Game optimized!</div>' +
'</div><div class="subsection">' +
'<div class="title">17/05/2023:</div>' +
'<div class="listing">- Fixed couple of bugs.</div>' +
'</div><div class="subsection">' +
'<div class="title">14/05/2023:</div>' +
'<div class="listing">- New blood coffee!</div>' +
'<div class="listing">- Added satanic cupcake!</div>' +
'<div class="listing">- Added new achievements and <b>EYE OF THE DEVIL</b>!</div>' +
'</div><div class="subsection">' +
'<div class="title">10/05/2023:</div>' +
'<div class="listing">- More cool sprites!</div>' +
'<div class="listing">- Buildings redrawn!</div>' +
'<div class="listing">- New cupcakes and upgrades!</div>' +
'</div><div class="subsection">' +
'<div class="title">07/05/2023:</div>' +
'<div class="listing">- New OST!</div>' +
'<div class="listing">- More Coffee!</div>' +
'</div><div class="subsection">' +
'<div class="title">04/05/2023:</div>' +
'<div class="listing">- Sprites updated!</div>' +
'<div class="listing">- News fixed!</div>' +
'</div><div class="subsection">' +
'<div class="title">20/04/2023:</div>' +
'<div class="listing">- Now you can use any language you want in your bakery name!</div>' +
'<div class="listing">- Mod icons added!</div>' +
'</div><div class="subsection">' +
'<div class="title">19/04/2023:</div>' +
'<div class="listing">- UI Design changed!</div>' +
'</div><div class="subsection">' +
'<div class="title">18/04/2023:</div>' +
'<div class="listing">- Version 2.2!</div>' +
'<div class="listing">- Mods added!</div>' +
'</div><div class="subsection">' +
'<div class="title">13/04/2023:</div>' +
'<div class="listing">- Version 2.1!</div>' +
'<div class="listing">- Robot Complex added!</div>' +
'<div class="listing">- New achievements and OST!</div>' +
'</div><div class="subsection">' +
'<div class="title">01/04/2023:</div>' +
'<div class="listing">- Added prestige.</div>' +
'<div class="listing">- Save system fixed.</div>' +
'</div><div class="subsection">' +
'<div class="title">25/03/2023:</div>' +
'<div class="listing">- Added more shadow achievements.</div>' +
'</div><div class="subsection">' +
'<div class="title">10/03/2023:</div>' +
'<div class="listing">- New lemon cupcake timer!</div>' +
'<div class="listing">- New Upgrades!</div>' +
'</div><div class="subsection">' +
'<div class="title">04/03/2023:</div>' +
'<div class="listing">- Updated sprites!</div>' +
'<div class="listing">- Re-balanced!</div>' +
'</div><div class="subsection">' +
'<div class="title">27/02/2023:</div>' +
'<div class="listing">- New CUPCAKE sprite!</div>' +
'<div class="listing">- Now you can change bg!</div>' +
'</div><div class="subsection">' +
'<div class="title">31/01/2023:</div>' +
'<div class="listing">- New OST!</div>' +
'</div><div class="subsection">' +
'<div class="title">22/01/2023:</div>' +
'<div class="listing">- Fixed balance!</div>' +
'<div class="listing">- New achievements added!</div>' +
'</div><div class="subsection">' +
'<div class="title">09/01/2023:</div>' +
'<div class="listing">- Cupcake Generator added!</div>' +
'<div class="listing">- Shop Items BG added!</div>' +
'</div><div class="subsection">' +
'<div class="title">27/12/2022:</div>' +
'<div class="listing">- New christmas update!</div>' +
'<div class="listing">- Couple of bugs fixed!</div>' +
'</div><div class="subsection">' +
'<div class="title">21/12/2022:</div>' +
'<div class="listing">- Portal and portal achievements/upgrades added!</div>' +
'<div class="listing">- Some bugs fixed!</div>' +
'</div><div class="subsection">' +
'<div class="title">16/12/2022:</div>' +
'<div class="listing">- Added background music!</div>' +
'<div class="listing">- Cupcake Clicker 1st anniversary!</div>' +
'</div><div class="subsection">' +
'<div class="title">15/12/2022:</div>' +
'<div class="listing">- Added sound effects!</div>' +
'<div class="listing">- Prestige and reset achievements added!</div>' +
'<div class="listing">- Fixed some bugs!</div>' +
'</div><div class="subsection">' +
'<div class="title">7/12/2022:</div>' +
'<div class="listing">- Mastery System added!</div>' +
'<div class="listing">- New cupcakes added!</div>' +
'<div class="listing">- Couple of bugs fixed!</div>' +
'</div><div class="subsection">' +
'<div class="title">4/12/2022:</div>' +
'<div class="listing">- Cyber Prism added!</div>' +
'<div class="listing">- New achievements added!</div>' +
'</div><div class="subsection">' +
'<div class="title">1/12/2022:</div>' +
'<div class="listing">- Coffee system updated!</div>' +
'<div class="listing">- New effects added!</div>' +
'<div class="listing">- Tooltips for upgrades added!</div>' +
'</div><div class="subsection">' +
'<div class="title">30/11/2022:</div>' +
'<div class="listing">- Dark chocolate cupcakes added!</div>' +
'<div class="listing">- Updates menu added!</div>' +
'<div class="listing">- New achievements added!</div>' +
'<div class="listing">- Bakery Name can be saved now!</div>' +
'<div class="listing">- Optimized cloud save!' +
'</div><div class="subsection">' +
'<div class="title">29/11/2022:</div>' +
'<div class="listing">- New click effects added!</div>' +
'<div class="listing">- Ability to change your bakery name added!</div>' +
'<div class="listing">- Tooltip error fixed!</div>' +
'<div class="listing">- Perfect and Lemon cupcakes updated!</div>' +
'</div>'
;
}
else if (Game.onMenu == 'stats') {
var buildingsOwned = 0;
buildingsOwned = Game.BuildingsOwned;
var upgrades = '';
var cupcakeUpgrades = '';
var upgradesTotal = 0;
var upgradesOwned = 0;
var list = [];
for (var i in Game.Upgrades)//sort the upgrades
{
list.push(Game.Upgrades[i]);
}
var sortMap = function (a, b) {
if (a.order > b.order) return 1;
else if (a.order < b.order) return -1;
else return 0;
}
list.sort(sortMap);
for (var i in list) {
var str2 = '';
var me = list[i];
if (typeof(me.icon) != 'string') {
if (!Game.Has('#Upgrade_Neuromancy')) {
if (me.bought > 0 && me.hide != 3) {
str2 += '<div class="crate upgrade enabled" ' + Game.getTooltip(
'<div style="min-width:200px;"><div style="float:middle;"><span class="price">' + Beautify(Math.round(me.basePrice)) + `</span></div><small>${Localization.GetText("#UI_StatsUpgrade")} ${Localization.GetText("#UI_StatsPurchased")}</small><div class="name">` + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'middle') + ' style="background-position:' + (-me.icon[0] * 48 + 6) + 'px ' + (-me.icon[1] * 48 + 6) + 'px;"></div>';
upgradesOwned++;
}
}
else {
str2 += '<div onclick="Game.UpgradesById[' + me.id + '].toggle();" class="crate upgrade' + (me.bought > 0 ? ' enabled' : '') + '" ' + Game.getTooltip(
'<div style="min-width:200px;"><div style="float:middle;"><span class="price">' + Beautify(Math.round(me.basePrice)) + `</span></div><small>${Localization.GetText("#UI_StatsUpgrade")}` + (me.bought > 0 ? ` [${Localization.GetText("#UI_StatsPurchased")}]` : '') + '</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-position:' + (-me.icon[0] * 48 + 6) + 'px ' + (-me.icon[1] * 48 + 6) + 'px;"></div>';
upgradesOwned++;
}
} else {
if (!Game.Has('#Upgrade_Neuromancy')) {
if (me.bought > 0 && me.hide != 3) {
str2 += '<div class="crate upgrade enabled" ' + Game.getTooltip(
'<div style="min-width:200px;"><div style="float:middle;"><span class="price">' + Beautify(Math.round(me.basePrice)) + `</span></div><small>${Localization.GetText("#UI_StatsUpgrade")} ${Localization.GetText("#UI_StatsPurchased")}</small><div class="name">` + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'middle') + ' style="background-image: url(\''+me.icon+'\'); background-position:' + 7 + 'px ' + 7 + 'px;"></div>';
upgradesOwned++;
}
}
else {
str2 += '<div onclick="Game.UpgradesById[' + me.id + '].toggle();" class="crate upgrade' + (me.bought > 0 ? ' enabled' : '') + '" ' + Game.getTooltip(
'<div style="min-width:200px;"><div style="float:middle;"><span class="price">' + Beautify(Math.round(me.basePrice)) + `</span></div><small>${Localization.GetText("#UI_StatsUpgrade")}` + (me.bought > 0 ? ` [${Localization.GetText("#UI_StatsPurchased")}]` : '') + '</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-image: url(\''+me.icon+'\'); background-position:' + 7 + 'px ' + 7 + 'px;"></div>';
upgradesOwned++;
}
}
if (me.hide != 3) upgradesTotal++;
if (me.type == 'cupcake') cupcakeUpgrades += str2; else upgrades += str2;
}
var achievements = '';
var shadowAchievements = '';
var achievementsOwned = 0;
var achievementsTotal = 0;
var list = [];
for (var i in Game.Achievements)//sort the achievements
{
list.push(Game.Achievements[i]);
}
var sortMap = function (a, b) {
if (a.order > b.order) return 1;
else if (a.order < b.order) return -1;
else return 0;
}
list.sort(sortMap);
for (var i in list) {
var me = list[i];
if (!me.disabled && me.hide != 3 || me.won > 0) achievementsTotal++;
if (typeof(me.icon) != 'string') {
if (me.won > 0 && me.hide == 3) {
shadowAchievements += '<div class="crate achievement enabled" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")} ${Localization.GetText("#UI_StatsUnlocked")}` + (me.hide == 3 ? ` ${Localization.GetText("#UI_StatsShadow")}` : '') + '</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-position:' + (-me.icon[0] * 48 + 6) + 'px ' + (-me.icon[1] * 48 + 6) + 'px;"></div>';
achievementsOwned++;
}
else if (me.won > 0) {
achievements += '<div class="crate achievement enabled" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")} ${Localization.GetText("#UI_StatsUnlocked")}` + (me.hide == 3 ? ` ${Localization.GetText("#UI_StatsShadow")}` : '') + '</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-position:' + (-me.icon[0] * 48 + 6) + 'px ' + (-me.icon[1] * 48 + 6) + 'px;"></div>';
achievementsOwned++;
}
else if (me.hide == 0) {//onclick="Game.Win(\''+me.displayName+'\');"
achievements += '<div class="crate achievement" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")}</small><div class="name">` + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-position:' + (-me.icon[0] * 48 + 6) + 'px ' + (-me.icon[1] * 48 + 6) + 'px;"></div>';
}
else if (me.hide == 1) {//onclick="Game.Win(\''+me.displayName+'\');"
achievements += '<div class="crate achievement" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")}</small><div class="name">` + me.displayName + '</div><div class="description">???</div></div>'
, 0, 0, 'bottom-right') + ' style="background-position:' + (-0 * 48 + 6) + 'px ' + (-7 * 48 + 6) + 'px;"></div>';
}
else if (me.hide == 2) {//onclick="Game.Win(\''+me.displayName+'\');"
achievements += '<div class="crate achievement" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")}</small><div class="name">???</div><div class="description">???</div></div>`
, 0, 0, 'bottom-right') + ' style="background-position:' + (-0 * 48 + 6) + 'px ' + (-7 * 48 + 6) + 'px;"></div>';
}
} else {
if (me.won > 0 && me.hide == 3) {
shadowAchievements += '<div class="crate achievement enabled" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")} ${Localization.GetText("#UI_StatsUnlocked")}` + (me.hide == 3 ? ` ${Localization.GetText("#UI_StatsShadow")}` : '') + '</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-image: url(\''+me.icon+'\'); background-position:' + 7 + 'px ' + 7 + 'px;"></div>';
achievementsOwned++;
}
else if (me.won > 0) {
achievements += '<div class="crate achievement enabled" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")} ${Localization.GetText("#UI_StatsUnlocked")}` + (me.hide == 3 ? ` ${Localization.GetText("#UI_StatsShadow")}` : '') + '</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-image: url(\''+me.icon+'\'); background-position:' + 7 + 'px ' + 7 + 'px;"></div>';
achievementsOwned++;
}
else if (me.hide == 0) {//onclick="Game.Win(\''+me.displayName+'\');"
achievements += '<div class="crate achievement" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")}</small><div class="name">` + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 0, 0, 'bottom-right') + ' style="background-image: url(\''+me.icon+'\'); background-position:' + 7 + 'px ' + 7 + 'px;"></div>';
}
else if (me.hide == 1) {//onclick="Game.Win(\''+me.displayName+'\');"
achievements += '<div class="crate achievement" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")}</small><div class="name">` + me.displayName + '</div><div class="description">???</div></div>'
, 0, 0, 'bottom-right') + ' style="background-position:' + (-0 * 48 + 6) + 'px ' + (-7 * 48 + 6) + 'px;"></div>';
}
else if (me.hide == 2) {//onclick="Game.Win(\''+me.displayName+'\');"
achievements += '<div class="crate achievement" ' + Game.getTooltip(
`<div style="min-width:200px;"><small>${Localization.GetText("#UI_StatsAchievement")}</small><div class="name">???</div><div class="description">???</div></div>`
, 0, 0, 'bottom-right') + ' style="background-position:' + (-0 * 48 + 6) + 'px ' + (-7 * 48 + 6) + 'px;"></div>';
}
}
}
Game.coffeeName = Localization.GetText("#UI_StatsCoffeeCappuccino");
if (Game.coffeeProgress >= 3.5) Game.coffeeName = Localization.GetText("#UI_StatsCoffeeLungo");
else if (Game.coffeeProgress >= 3.0) Game.coffeeName = Localization.GetText("#UI_StatsCoffeeFlatWhite");
else if (Game.coffeeProgress >= 2.5) Game.coffeeName = Localization.GetText("#UI_StatsCoffeeMacchiato");
else if (Game.coffeeProgress >= 2.0) Game.coffeeName = Localization.GetText("#UI_StatsCoffeeRaffCoffee");
else if (Game.coffeeProgress >= 1.5) Game.coffeeName = Localization.GetText("#UI_StatsCoffeeEspresso");
else if (Game.coffeeProgress >= 1.0) Game.coffeeName = Localization.GetText("#UI_StatsCoffeeRistretto");
else if (Game.coffeeProgress >= 0.5) Game.coffeeName = Localization.GetText("#UI_StatsCoffeeLatte");
var researchStr = Game.sayTime(Game.researchT);
var pledgeStr = Game.sayTime(Game.pledgeT);
var wrathStr = '';
if (Game.cupcakeClicks >= 2000) Game.CMastery();
if (Game.elderWrath == 1) wrathStr = Localization.GetText("#UI_StatsWrathAwoken");
else if (Game.elderWrath == 2) wrathStr = Localization.GetText("#UI_StatsWrathDispleased");
else if (Game.elderWrath == 3) wrathStr = Localization.GetText("#UI_StatsWrathAngered");
else if (Game.elderWrath == 0 && Game.pledges > 0) wrathStr = Localization.GetText("#UI_StatsWrathAppeased");
var date = new Date();
date.setTime(new Date().getTime() - Game.startDate);
date = Game.sayTime(date.getTime() / 1000 * Game.fps);
Game.gamestart = date;
str += `<div class="section">${Localization.GetText("#UI_StatsStatistics")}</div>` +
Game.CustomStats +
'<div class="subsection">' +
`<div class="title">${Localization.GetText("#UI_StatsGeneral")}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsInBank").format(Beautify(Game.cupcakes))}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsTotal").format(Beautify(Game.cupcakesEarned))} </div>` +
(Game.cupcakesReset > 0 ? `<div class="listing">${Localization.GetText("#UI_StatsForfeited").format(Beautify(Game.cupcakesReset))} </div>` : '') +
`<div class="listing">${Localization.GetText("#UI_StatsGameStarted").format(date)}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsBuildingsOwned").format(Beautify(buildingsOwned))}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsPerSeccond").format(Beautify(Game.cupcakesPs, 1), Beautify(Math.round(Game.globalCpsMult * 100), 1))}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsPerClick").format(Beautify(Game.computedMouseCps, 1))}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsCupcakeClicks").format(Beautify(Game.cupcakeClicks))}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsHandMadeCupcakes").format(Beautify(Game.handmadecupcakes))}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsLemonCupcake").format(Beautify(Game.goldenClicks))}</div>` +//' <span class="hidden">(<b>Missed golden cupcakes :</b> '+Beautify(Game.missedGoldenClicks)+')</span></div>'+
`<div class="listing">${Localization.GetText("#UI_StatsDarkChoc").format(Beautify(Game.darkchocClicks))}</div>` +
`<br><div class="listing">${Localization.GetText("#UI_StatsVersion").format(Game.version)}</div>` +
((researchStr != '' || wrathStr != '' || pledgeStr != '' || Game.ClickMasteryStr != '') ? (
'</div><div class="subsection">' +
`<div class="title">${Localization.GetText("#UI_StatsSpecial")}</div>` +
(researchStr != '' ? `<div class="listing">${Localization.GetText("#UI_StatsResearch").format(researchStr)}</div>` : '') +
(wrathStr != '' ? `<div class="listing">${Localization.GetText("#UI_StatsBakertriarchs").format(wrathStr)}</div>` : '') +
(pledgeStr != '' ? `<div class="listing">${Localization.GetText("#UI_StatsPledge").format(pledgeStr)}</div>` : '') +
(Game.ClickMasteryStr != '' ? `<div class="listing">${Localization.GetText("#UI_StatsClickMastery").format(Game.ClickMasteryStr)}</div>` : '') +
''
) : '') +
/*((Game.prestigue!=0)?(
'</div><div class="subsection">'+
'<>'))*/
/*((Game.ClickMasteryStr!='')?(
'</div><div class="subsection">'+
'<div class="title">Mastery</div>'+
+
''
):'')+*/
(Game.prestige['Heavenly Cupcakes'] > 0 ? (
'</div><div class="subsection">' +
`<div class="title">${Localization.GetText("#UI_StatsPrestige")}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsPrestigeDesc")}</div>` +
'<div class="listing"><div class="icon" style="background-position:' + (-19 * 48) + 'px ' + (-7 * 48) + 'px;"></div> <span style="vertical-align:100%;"><span class="title" style="font-size:22px;">' + Game.prestige['Heavenly Cupcakes'] + Localization.GetText("#UI_StatsHeavenlyCupcake") + (Game.prestige['Heavenly Cupcakes'] == 1 ? '' : 's') + '</span> (+' + (Game.prestige['Heavenly Cupcakes'] * 2) + '% CpS)</span></div>') : '') +
'</div><div class="subsection">' +
`<div class="title">${Localization.GetText("#UI_StatsUpgradesUnlockedLabel")}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsUpgradesUnlocked").format(upgradesOwned, upgradesTotal, Math.round((upgradesOwned / upgradesTotal) * 100))}</div>` +
'<div class="listing" style="overflow-y:hidden;">' + upgrades + '</div>' +
(cupcakeUpgrades != '' ? (`<div class="listing">${Localization.GetText("#UI_StatsCupcakes")}</div>` +
'<div class="listing" style="overflow-y:hidden;">' + cupcakeUpgrades + '</div>') : '') +
'</div><div class="subsection" style="padding-bottom:128px;">' +
`<div class="title">${Localization.GetText("#UI_StatsAchievementsLabel")}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsAchievementsUnlocked").format(achievementsOwned, achievementsTotal, Math.round((achievementsOwned / achievementsTotal) * 100))}</div>` +
`<div class="listing">${Localization.GetText("#UI_StatsCoffeeProcent").format(Math.round(Game.coffeeProgress * 100), Game.coffeeName)}</div>` +
'<div class="listing" style="overflow-y:hidden;">' + achievements + '</div>' +
(shadowAchievements != '' ? (
`<div class="listing">${Localization.GetText("#UI_StatsShadowAchievements")}</div>` +
'<div class="listing" style="overflow-y:hidden;">' + shadowAchievements + '</div>'
) : '') +
'</div>'
;
}
else if (Game.onMenu == 'mods') {
function loadedMods()
{
let res = [];
for (let element of Game.ModAPI.ModsLoaded.values()) {
let iconElement = '';
if(element.IconURL != undefined)
iconElement = `<img src="${element.IconURL}" height=16 width=16 />`;
res.push(`<div class="listing" style="position: relative; left: 10px; font-size: 15px;">` +
`${iconElement} <b>${element.Name} (${element.Version != undefined ? ` v${element.Version}` : 'v1.0'})</b>` +
`<a class="option" onclick="Game.ModAPI.UnloadModByID('${element.ID}');" style="position: relative; left: 20px;">Delete mod</a>` +
`</div>`)
}
return res;
}
str += '' +
`<div class="section">${Localization.GetText("#UI_Mods")}</div>` +
'<div class="subsection">' +
`<div class="title">${Localization.GetText("#UI_ModLoadingLabel")}</div>` +
`<div class="listing"><a class="option" onclick="Game.ModAPI.LoadModFile();">${Localization.GetText("#UI_ModLoadBtnName")}</a><label>${Localization.GetText("#UI_ModLoadBtnDesc")}</label></div>` +
`<div class="listing"><a class="option" href="EasterCakeMod.js" download>${Localization.GetText("#UI_ModSampleDownload")}</a></div>` +
`<div class="listing"><a class="option" href="ForDoc/docs/index.html">${Localization.GetText("#UI_ModDocumentation")}</a><label>${Localization.GetText("#UI_ModDocumentationLbl")}</label></div>` +
'</div>' +
'<div class="subsection">' +
`<div class="title">${Localization.GetText("#UI_ModsLoaded").format(Game.ModAPI.ModsLoaded.size)}</div>` +
loadedMods().join('\n') +
'</div>' +
'<div class="subsection">' +
`<div class="title">${Localization.GetText('#UI_FeaturedMods')}</div>` +
`<div class="listing"><a class="option" href="featmods/DonutMod.js" download>Donut Mod</a><label>${Localization.GetText("#FM_DonutModLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/AutoBuy.js" download>AutoBuy</a><label>${Localization.GetText("#FM_AutoBuyLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/AutoGC.js" download>AutoGoldenCupcakes</a><label>${Localization.GetText("#FM_AutoGCLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/BetterStatsMod.js" download>BetterStatsMod</a><label>${Localization.GetText("#FM_BSMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/newUAmod.js" download><img src="img/updated.gif"> UA Localization</a><label>${Localization.GetText("#FM_UALLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/CupCh.js" download>Cupcake Changer</a><label>${Localization.GetText("#FM_CCHLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/HellCoreMod.js" download>Hell Core Mod</a><label>${Localization.GetText("#FM_HCMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/PizzaFaceMod.js" download>Pizza Face Mod</a><label>${Localization.GetText("#FM_PFMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/DevilEyeMod.js" download>Devil Eye Mod</a><label>${Localization.GetText("#FM_DEMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/CupSnakeMod.js" download>Cupcake Snake Mod</a><label>${Localization.GetText("#FM_CSMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/Paint.Cup.js" download>Paint.Cup</a><label>${Localization.GetText("#FM_PCLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/CupcakeInvadersMod.js" download>Cupcake Invaders Mod</a><label>${Localization.GetText("#FM_CIMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/MovingCupcakeMod.js" download>Moving Cupcake Mod</a><label>${Localization.GetText("#FM_MCMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/CupTaleMod.js" download>CupcakeTale Mod</a><label>${Localization.GetText("#FM_CTMLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/Marshmallows.js" download><img src="img/new2.gif"> Marshmallows</a><label>${Localization.GetText("#FM_MARLabel")}</label></div>` +
`<br>` +
`<div class="listing">${Localization.GetText("#FM_MailText")}</div>` +
'</div>' +
'<div class="subsection">' +
`<div class="title">${Localization.GetText('#UI_LocalizMods')}</div>` +
`<div class="listing"><a class="option" href="featmods/newUAmod.js" download><img src="img/updated.gif"> UA Localization</a><label>${Localization.GetText("#FM_UALLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/GERlocalizMod.js" download><img src="img/new2.gif"> German Localization</a><label>${Localization.GetText("#FM_GELLabel")}</label></div>` +
`<div class="listing"><a class="option" href="featmods/FRlocMod.js" download><img src="img/new2.gif"> French localization</a><label>${Localization.GetText("#FM_FRLLabel")}</label></div>` +
`</div>` +
`<div class="subsection">` +
`<div class="title">${Localization.GetText('#UI_MusicPackMods')}</div>` +
`<div class="listing"><a class="option" href="featmods/CupAmbMod.js" download>Cupcake Ambience Mod</a></div>` +
`<div class="listing"><a class="option" href="featmods/UltrakillMusicKit.js" download><img src="img/new2.gif"> Ultrakill Music Kit</a></div>` +
`</div>` +
'<div class="subsection">' +
`<div class="title">${Localization.GetText('#UI_ModTools')}</div>` +
`<div class="listing"><a class="option" href="https://cdn.discordapp.com/attachments/1128684875042529442/1128684904520093826/CupcakeModCreator.zip" download>Cupcake Mod Creator</a><label>${Localization.GetText("#FM_CupModCrLabel")}</label></div>` +
'</div>' +
'</div>';
str += Game.CustomMods;
}
l('menu').innerHTML = str;
}
l('prefsButton').onclick = function () { Game.ShowMenu('prefs'); };
l('statsButton').onclick = function () { Game.ShowMenu('stats'); };
l('logButton').onclick = function () { Game.ShowMenu('log'); };
l('modsButton').onclick = function () { Game.ShowMenu('mods'); };
/*=====================================================================================
MARSHMALLOWS CODE
=====================================================================================*/
/**
* Gets random arbitrary
* @param {number} min Lower bound
* @param {number} max High bound
* @returns {number}
*/
const getRandomArbitrary = (min, max) => Math.random() * (max - min) + min;
/**
* Gets random boolean
* @param {number} trueChance Chance of retrning true from 0 to 100
* @returns {boolean}
*/
const getRandomBoolean = (trueChance = 50) => Math.random() < 100 / trueChance;
var globalFriction = 0.2;
var globalGravity = 0.9;
var sectionLeft = null;
var spawnedMarshmallows = 0;
class PhysObject {
position = { x: 0, y: 0 };
size = { width: 0, height: 0 };
velocity = { x: 0, y: 0 };
gravityScale = 1.0;
frictionScale = 1.0;
sprite = null;
bounceCoefficient = 0;
updatePhysics = true;
userData = null;
constructor(x, y, width, height, params = null) {
this.position = { x: x, y: y };
this.size = { width: width, height: height };
if (params) {
if (params.hasOwnProperty('sprite'))
this.sprite = params.sprite;
if (params.hasOwnProperty('sprite'))
this.bounceCoefficient = params.bounceCoefficient;
}
}
destructor() {
if (this.sprite)
this.sprite.parentElement.removeChild(this.sprite);
}
Update() {
if (this.updatePhysics) {
this.velocity.x *= 1 - globalFriction * this.frictionScale;
this.velocity.y += globalGravity * this.gravityScale;
if (this.position.x + this.velocity.x <= 0 ||
this.position.x + this.velocity.x > sectionLeft.offsetWidth - this.size.width)
this.velocity.x = -this.velocity.x * this.bounceCoefficient;
this.position.x += this.velocity.x;
this.position.y += this.velocity.y;
if (this.position.x >= sectionLeft.offsetWidth - this.size.width)
this.position.x = sectionLeft.offsetWidth - this.size.width;
else if (this.position.x <= 0)
this.position.x = 0;
}
this.sprite.style.left = `${this.position.x}px`;
this.sprite.style.top = `${this.position.y}px`;
}
GetVelocity() {
return this.velocity;
}
SetVelocityX(x) {
this.velocity.x = x;
}
SetVelocityY(y) {
this.velocity.y = y;
}
SetX(x) {
this.position.x = x;
}
SetY(y) {
this.position.y = y;
}
SetGravityScale(scale = 1.0) {
this.gravityScale = scale;
}
SetFrictionScale(scale = 1.0) {
this.frictionScale = scale;
}
UpdatePhysics(update) {
this.updatePhysics = update;
}
GetUpdatePhysics() {
return this.updatePhysics;
}
}
const BaseMarshmallowGravityScale = 0.3;
const BaseMarshmallowAirFrictionScale = 0.6;
var marobj = [];
var currentHeldMarshmallow = null;
var mouseDeltas = { dx: 0, dy: 0 };
var coffeeElement = null;
/**
* Spawns marshmallow
* @param {number} x
* @param {number} y
* @returns {void}
*/
SpawnMarshmallow = function(x, y) {
if (spawnedMarshmallows >= 10) {
return;
}
spawnedMarshmallows++;
const width = 62;
const height = 59;
const shift = [
{ x: 1, y: 2 },
{ x: 65, y: 2 },
{ x: 129, y: 2 },
];
const choosedType = getRandomInt(0, 2);
const rotation = getRandomInt(0, 359);
const rotationDir = getRandomBoolean() ? -1 : 1;
const marshmallow = document.createElement('div');
marshmallow.style.position = 'absolute';
marshmallow.style.left = `${x}px`;
marshmallow.style.top = `${y}px`;
marshmallow.style.width = `${width}px`;
marshmallow.style.height = `${height}px`;
marshmallow.style.transform = `rotate(${rotation}deg)`;
marshmallow.style.zIndex = '50';
marshmallow.style.background = `url('img/marshmallows.png') no-repeat -${shift[choosedType].x}px -${shift[choosedType].y}px`;
marshmallow.addEventListener('mousedown', (event) => {
if (currentHeldMarshmallow)
return;
const element = event.currentTarget;
const physObject = marobj.find((value) => value.sprite == element);
if (!physObject)
return;
physObject.UpdatePhysics(false);
currentHeldMarshmallow = physObject;
});
sectionLeft.appendChild(marshmallow);
const physObj = new PhysObject(x, y, width, height, { sprite: marshmallow, bounceCoefficient: 0.8 });
physObj.userData = { rotationDir: rotationDir, coffeeEnter: false };
physObj.SetGravityScale(BaseMarshmallowGravityScale);
physObj.SetFrictionScale(BaseMarshmallowAirFrictionScale);
marobj.push(physObj);
}
MarshUpdateEnd = function() {
const sectionLeftHeight = sectionLeft.offsetHeight;
const coffeeHeight = coffeeElement.offsetHeight;
marobj.forEach((object, index, array) => {
object.Update();
const rotPrev = parseInt(object.sprite.style.transform.match(/rotate\(([^deg)]+)/)[1], 10);
object.sprite.style.transform = `rotate(${rotPrev + object.userData.rotationDir * 3}deg)`;
if (object.position.y > sectionLeftHeight + object.size.height) {
object.SetY(-2);
object.SetX(getRandomArbitrary(0, sectionLeft.offsetWidth));
object.SetVelocityY(getRandomArbitrary(5, 10));
}
if (object.position.y >= sectionLeftHeight - coffeeHeight) {
if (!object.userData.coffeeEnter) {
object.userData.coffeeEnter = true;
object.SetVelocityY(object.GetVelocity().y / 20);
}
const procent = object.position.y / coffeeHeight;
const opacityProcent = ((sectionLeftHeight - object.position.y) / coffeeHeight) * 130;
object.SetGravityScale(BaseMarshmallowGravityScale / procent);
object.sprite.style.opacity = `${opacityProcent}%`;
} else {
if (object.userData.coffeeEnter)
object.userData.coffeeEnter = false;
object.sprite.style.opacity = '100%';
object.SetGravityScale(BaseMarshmallowGravityScale);
}
});
}
/**
* Starts the marshmallow rain
* @returns {void}
*/
StartTheRain = function() {
Game.Marhmall = true;
sectionLeft = l('sectionLeft');
coffeeElement = l('coffee');
coffeeLayer1Element = l('coffeeLayer1');
coffeeLayer2Element = l('coffeeLayer2');
coffeeElement.style.opacity = '80%';
l('cupcakeShower').style.opacity = '30%';
sectionLeft.addEventListener('mousemove', (event) => {
if (!currentHeldMarshmallow)
return;
mouseDeltas.dx = event.movementX;
mouseDeltas.dy = event.movementY;
const rect = sectionLeft.getBoundingClientRect();
currentHeldMarshmallow.SetX(event.clientX - rect.left - currentHeldMarshmallow.size.width / 2);
currentHeldMarshmallow.SetY(event.clientY - rect.top - currentHeldMarshmallow.size.height / 2);
});
sectionLeft.addEventListener('mouseup', (event) => {
if (!currentHeldMarshmallow)
return;
currentHeldMarshmallow.UpdatePhysics(true);
currentHeldMarshmallow.SetVelocityX(mouseDeltas.dx * 2);
currentHeldMarshmallow.SetVelocityY(mouseDeltas.dy * 0.7);
currentHeldMarshmallow = null;
});
setInterval(() => {
const x = getRandomArbitrary(0, sectionLeft.offsetWidth);
const y = -100;
SpawnMarshmallow(x, y);
}, 500);
}
/*=====================================================================================
CAT MINIGAME
=====================================================================================*/
/**
* Function that starts the kitten game.
* @function KittenStart
*/
KittenStart = function() {
/**
* The number of clicks on the kitten.
* @type {number}
*/
var catclicks = 0;
/**
* Text displaying the number of clicks on the kitten.
* @type {number}
*/
var catCountText = 0;
/**
* Maximum X and Y coordinates for random kitten movement.
* @type {number}
*/
var maxX = 0;
/**
* @type {number}
*/
var maxY = 0;
/**
* Function to move the kitten to a random position on the screen.
* @function moveDiv
*/
moveDiv = function() {
/**
* Random value for X coordinate.
* @type {number}
*/
var newRandomX = Math.floor(Math.random() * maxX);
/**
* Random value for Y coordinate.
* @type {number}
*/
var newRandomY = Math.floor(Math.random() * maxY);
newDiv.style.transition = 'left 1s, top 1s';
newDiv.style.left = newRandomX + 'px';
newDiv.style.top = newRandomY + 'px';
}
/**
* Function called when the kitten is clicked.
* @function CatClick
*/
CatClick = function() {
if (catclicks != 100) {
catclicks++;
} else {
catclicks = 0;
Game.Earn(Game.cupcakes / 3);
Game.Popup('Cat Luck! You received ' + Math.floor(Game.cupcakes / 3) + ' cupcakes!');
PlaySound('https://cdn.discordapp.com/attachments/1128684875042529442/1145675119755264041/jg-032316-sfx-cat-meow.mp3');
}
moveDiv();
catCountText.nodeValue = ' : ' + catclicks;
}
/**
* Creating elements to display the kitten.
* @type {HTMLElement}
*/
var newDiv = document.createElement('div');
newDiv.id = 'funnycat';
/**
* Creating the kitten image.
* @type {HTMLImageElement}
*/
var img = document.createElement('img');
img.src = 'https://media.discordapp.net/attachments/1128684875042529442/1145663644076605452/cupcat1.gif';
newDiv.appendChild(img);
/**
* Getting the parent element to place the kitten.
* @type {HTMLElement}
*/
var sectionLeft = document.getElementById('sectionLeft');
sectionLeft.appendChild(newDiv);
newDiv.style.position = 'absolute';
img.style.animation = 'swing 2s infinite ease-in-out';
newDiv.style.zIndex = '99999999';
/**
* Getting the size of the parent element to limit kitten movement.
* @type {DOMRect}
*/
var sectionLeftRect = sectionLeft.getBoundingClientRect();
maxX = (sectionLeftRect.width - 50) - newDiv.offsetWidth;
maxY = (sectionLeftRect.height - 40) - newDiv.offsetHeight;
var randomX = Math.floor(Math.random() * maxX);
var randomY = Math.floor(Math.random() * maxY);
/**
* Creating an element to display the number of clicks on the kitten.
* @type {HTMLElement}
*/
var catCountDiv = document.createElement('div');
catCountDiv.id = 'catcount';
catCountDiv.style.position = 'absolute';
catCountDiv.style.top = '10px';
catCountDiv.style.right = '10px';
catCountDiv.style.backgroundColor = 'rgba(0, 0, 0, 0.5)';
catCountDiv.style.borderRadius = '5px';
catCountDiv.style.padding = '5px';
catCountDiv.style.color = 'white';
catCountDiv.style.display = 'flex';
catCountDiv.style.alignItems = 'center';
catCountDiv.style.zIndex = '999999999';
/**
* Creating an image to display the number of clicks on the kitten.
* @type {HTMLImageElement}
*/
var catCountImg = document.createElement('img');
catCountImg.src = 'https://media.discordapp.net/attachments/1128684875042529442/1145663644076605452/cupcat1.gif';
catCountImg.width = '32';
catCountImg.height = '32';
/**
* Text node to display the number of clicks on the kitten.
* @type {Text}
*/
var catCountText = document.createTextNode(' : ' + catclicks);
catCountDiv.style.fontSize = '20px';
catCountDiv.appendChild(catCountImg);
catCountDiv.appendChild(catCountText);
sectionLeft.appendChild(catCountDiv);
newDiv.style.left = randomX + 'px';
newDiv.style.top = randomY + 'px';
newDiv.addEventListener('click', CatClick);
/**
* Kitten animation.
* @type {string}
*/
var keyframes = `@keyframes swing {
0% {
transform: rotate(0deg);
}
25% {
transform: rotate(15deg);
}
50% {
transform: rotate(-15deg);
}
75% {
transform: rotate(15deg);
}
100% {
transform: rotate(0deg);
}
}`;
var styleSheet = document.createElement('style');
styleSheet.innerHTML = keyframes;
document.head.appendChild(styleSheet);
}
/*=====================================================================================
CUPCAKE DROPOUT
=====================================================================================*/
/**
* Drops the cupcake and performs animation effects.
* @function
* @name Game.CupDrop
* @memberof Game
* @returns {void}
*/
Game.CupDrop = function() {
// Get the big cupcake element
var bigCupcake = document.getElementById('bigcupcake');
// Rotate the big cupcake by 35 degrees with a transition of 0.3 seconds
bigCupcake.style.transform = 'rotate(35deg)';
bigCupcake.style.transition = 'transform 0.3s';
// After a delay of 300 milliseconds
setTimeout(function() {
// Rotate the big cupcake by 45 degrees with a longer transition of 1 second
bigCupcake.style.transform = 'rotate(45deg)';
bigCupcake.style.transition = 'transform 1s';
}, 300);
// After a delay of 1300 milliseconds
setTimeout(function() {
// Move the big cupcake down by the height of the viewport with a transition of 0.5 seconds
bigCupcake.style.transform = 'translateY(100vh)';
bigCupcake.style.transition = 'transform 0.5s';
// Create a new style element for the shake animation
var style = document.createElement('style');
style.innerHTML = `
@keyframes shake {
0% { transform: translate(1px, 1px) rotate(0deg); }
10% { transform: translate(-1px, -2px) rotate(-1deg); }
20% { transform: translate(-3px, 0px) rotate(1deg); }
30% { transform: translate(3px, 2px) rotate(0deg); }
40% { transform: translate(1px, -1px) rotate(1deg); }
50% { transform: translate(-1px, 2px) rotate(-1deg); }
60% { transform: translate(-3px, 1px) rotate(0deg); }
70% { transform: translate(3px, 1px) rotate(-1deg); }
80% { transform: translate(-1px, -1px) rotate(1deg); }
90% { transform: translate(1px, 2px) rotate(0deg); }
100% { transform: translate(1px, -2px) rotate(-1deg); }
}
`;
// Append the style element to the document's head
document.head.appendChild(style);
// Apply the shake animation to the body element with a duration of 0.5 seconds
document.body.style.animation = 'shake 0.5s';
// Set the animation iteration count to infinite
document.body.style.animationIterationCount = 'infinite';
// After a delay of 1000 milliseconds
setTimeout(function() {
// Reset the animation properties of the body element
document.body.style.animation = '';
document.body.style.animationIterationCount = '';
// Scroll the window back to the initial position
window.scrollTo(0, initialPosition);
// Remove the style element from the document's head
document.head.removeChild(style);
}, 1000);
}, 1300);
}
/*=====================================================================================
TOOLTIP CODE 2.0
=====================================================================================*/
/** @namespace Game.tooltip */
Game.tooltip = { text: '', x: 0, y: 0, origin: 0, on: 0 };
/**
* Draw tooltip
* @param {HTMLElement} from
* @param {string} text
* @param {number} x
* @param {number} y
* @param {string} origin left, bottom-right, middle
* @returns {void}
*/
Game.tooltip.draw = function (from, text, x, y, origin) {
this.text = text;
this.x = x;
this.y = y;
this.origin = origin;
var tt = l('tooltip');
var tta = l('tooltipAnchor');
tta.style.display = 'block';
var rect = from.getBoundingClientRect();
//var screen=tta.parentNode.getBoundingClientRect();
var x = 0, y = 0;
tt.style.left = 'auto';
tt.style.top = 'auto';
tt.style.right = 'auto';
tt.style.bottom = 'auto';
tta.style.left = 'auto';
tta.style.top = 'auto';
tta.style.right = 'auto';
tta.style.bottom = 'auto';
tt.style.width = 'auto';
tt.style.height = 'auto';
if (this.origin == 'left') {
x = rect.left;
y = rect.top;
tt.style.right = '0';
tt.style.top = '0';
}
else if (this.origin == 'bottom-right') {
x = rect.right;
y = rect.bottom;
tt.style.right = '0';
tt.style.top = '0';
}
// else if (this.origin=='middle')
// {
// x=rect.right;
// y=rect.top;
// tta.style.right='300'+'px';
// tta.style.top='100'+'px';
// tt.innerHTML=unescape(text);
// this.on=1;
// }
else if (this.origin == 'middle') {
x = rect.left;
y = rect.top;
//tta.style.left=(Game.mouseX-1500).toString()+'px';
tta.style.left=(Game.mouseX+470)+'px';
//tta.style.left = 'auto';
//tta.style.right='auto';
tta.style.top = (Game.mouseY + 30) + 'px';
//tta.style.bottom=(Game.mouseY)+'px';
tt.innerHTML = unescape(text);
this.on = 1;
}
/*else {alert('Tooltip anchor '+this.origin+' needs to be implemented');}
tta.style.left=Math.floor(x+this.x)+'px';
tta.style.top=Math.floor(y-32+this.y)+'px';
tt.innerHTML=unescape(text);
this.on=1;*/
}
/**
* Hides the tooltip
* @returns {void}
*/
Game.tooltip.hide = function () {
l('tooltipAnchor').style.display = 'none';
this.on = 0;
}
Game.getTooltip = function (text, x, y, origin) {
origin = (origin ? origin : 'middle');
return 'onMouseOut="Game.tooltip.hide();" onMouseOver="Game.tooltip.draw(this,\'' + escape(text) + '\',' + x + ',' + y + ',\'' + 'middle' + '\');"';
}
/*=====================================================================================
TOOLTIP CODE OLD
=======================================================================================*/
// Game.tooltip = { text: '', x: 0, y: 0, origin: 0, on: 0 };
// Game.tooltip.draw = function (from, text, x, y, origin) {
// this.text = text;
// this.x = x;
// this.y = y;
// this.origin = origin;
// var tt = l('tooltip');
// var tta = l('tooltipAnchor');
// tta.style.display = 'block';
// var rect = from.getBoundingClientRect();
// //var screen=tta.parentNode.getBoundingClientRect();
// var x = 0, y = 0;
// tt.style.left = 'auto';
// tt.style.top = 'auto';
// tt.style.right = 'auto';
// tt.style.bottom = 'auto';
// tta.style.left = 'auto';
// tta.style.top = 'auto';
// tta.style.right = 'auto';
// tta.style.bottom = 'auto';
// tt.style.width = 'auto';
// tt.style.height = 'auto';
// if (this.origin == 'left') {
// x = rect.left;
// y = rect.top;
// tt.style.right = '0';
// tt.style.top = '0';
// }
// else if (this.origin == 'bottom-right') {
// x = rect.right;
// y = rect.bottom;
// tt.style.right = '0';
// tt.style.top = '0';
// }
// else if (this.origin=='middle')
// {
// x=rect.right;
// y=rect.top;
// tta.style.right='300'+'px';
// tta.style.top='100'+'px';
// tt.innerHTML=unescape(text);
// this.on=1;
// }
// else if (this.origin == 'middle') {
// x = rect.right;
// y = rect.top;
// //tta.style.left=(Game.mouseX-1500).toString()+'px';
// //tta.style.right=(Game.mouseX)+'px';
// tta.style.right = 'auto';
// //tta.style.right='auto';
// tta.style.top = (Game.mouseY + 20) + 'px';
// //tta.style.bottom=(Game.mouseY)+'px';
// tt.innerHTML = unescape(text);
// this.on = 1;
// }
// /*else {alert('Tooltip anchor '+this.origin+' needs to be implemented');}
// tta.style.left=Math.floor(x+this.x)+'px';
// tta.style.top=Math.floor(y-32+this.y)+'px';
// tt.innerHTML=unescape(text);
// this.on=1;*/
// }
// Game.tooltip.hide = function () {
// l('tooltipAnchor').style.display = 'none';
// this.on = 0;
// }
// Game.getTooltip = function (text, x, y, origin) {
// origin = (origin ? origin : 'middle');
// return 'onMouseOut="Game.tooltip.hide();" onMouseOver="Game.tooltip.draw(this,\'' + escape(text) + '\',' + x + ',' + y + ',\'' + 'middle' + '\');"';
// }
/*=====================================================================================
NEWS TICKER
=======================================================================================*/
/**
* Current news label
* @type {string}
*/
Game.Ticker = '';
/**
* Current life of ticker
* @type {number}
*/
Game.TickerAge = 0;
Game.TickerN = 0;
/**
* Sets new news label
* @returns {void}
*/
Game.getNewTicker = function () {
var list = [];
if (Game.TickerN % 2 == 0 || Game.cupcakesEarned >= 10100000000) {
if (Game.Objects['#Building_Baker'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_Backer1"),
Localization.GetText("#Ticker_Backer2"),
Localization.GetText("#Ticker_Backer3"),
Localization.GetText("#Ticker_Backer4")
]));
if (Game.Objects['#Building_Baker'].amount >= 1 && Game.pledges > 0 && Game.elderWrath == 0) list.push(choose([
Localization.GetText("#Ticker_Backer5"),
Localization.GetText("#Ticker_Backer6")
]));
if (Game.Objects['#Building_RobotBaker'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_RobotBacker1"),
Localization.GetText("#Ticker_RobotBacker2"),
Localization.GetText("#Ticker_RobotBacker3")
]));
if (Game.Objects['#Building_RobotBaker'].amount > 20) list.push(choose([
Localization.GetText("#Ticker_RobotBacker4"),
Localization.GetText("#Ticker_RobotBacker5"),
]));
if (Game.Objects['#Building_AtomicCupcake'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_AtomicCupcake1"),
Localization.GetText("#Ticker_AtomicCupcake2"),
Localization.GetText("#Ticker_AtomicCupcake3"),
Localization.GetText("#Ticker_AtomicCupcake4"),
Localization.GetText("#Ticker_AtomicCupcake5")
]));
if (Game.Objects['#Building_AtomicCupcake'].amount > 20) list.push(choose([
Localization.GetText("#Ticker_AtomicCupcake6"),
Localization.GetText("#Ticker_AtomicCupcake7")
]));
if (Game.Objects['#Building_AlchemyLab'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_AlchemyLab1"),
Localization.GetText("#Ticker_AlchemyLab2"),
Localization.GetText("#Ticker_AlchemyLab3"),
Localization.GetText("#Ticker_AlchemyLab4"),
Localization.GetText("#Ticker_AlchemyLab5")
]));
if (Game.Objects['#Building_AlchemyLab'].amount > 20) list.push(choose([
Localization.GetText("#Ticker_AlchemyLab6"),
Localization.GetText("#Ticker_AlchemyLab7")
]));
if (Game.Objects['#Building_CupPlanet'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_CupPlanet1"),
Localization.GetText("#Ticker_CupPlanet2")
]));
if (Game.Objects['#Building_CupPlanet'].amount > 20) list.push(choose([
Localization.GetText("#Ticker_CupPlanet3"),
Localization.GetText("#Ticker_CupPlanet4")
]));
if (Game.Objects['#Building_CupPlanet'].amount > 50) list.push(choose([
Localization.GetText("#Ticker_CupPlanet5"),
Localization.GetText("#Ticker_CupPlanet6")
]));
if (Game.Objects['#Building_CloneMachine'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_CloneMachine1"),
Localization.GetText("#Ticker_CloneMachine2")
]));
if (Game.Objects['#Building_CloneMachine'].amount > 50) list.push(choose([
Localization.GetText("#Ticker_CloneMachine3"),
Localization.GetText("#Ticker_CloneMachine4"),
Localization.GetText("#Ticker_CloneMachine5")
]));
if (Game.Objects['#Building_CloneMachine'].amount > 70) list.push(choose([
Localization.GetText("#Ticker_CloneMachine6"),
Localization.GetText("#Ticker_CloneMachine7")
]));
if (Game.Objects['#Building_CyberPrism'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_CyberPrism1"),
Localization.GetText("#Ticker_CyberPrism2"),
Localization.GetText("#Ticker_CyberPrism3"),
Localization.GetText("#Ticker_CyberPrism4")
]));
if (Game.Objects['#Building_CyberPrism'].amount > 50) list.push(choose([
Localization.GetText("#Ticker_CyberPrism5"),
Localization.GetText("#Ticker_CyberPrism6")
]));
if (Game.Objects['#Building_CyberPrism'].amount > 70) list.push(choose([
Localization.GetText("#Ticker_CyberPrism7"),
Localization.GetText("#Ticker_CyberPrism8")
]));
if (Game.Objects['#Building_Portal'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_Portal1"),
Localization.GetText("#Ticker_Portal2"),
Localization.GetText("#Ticker_Portal3"),
Localization.GetText("#Ticker_Portal4"),
Localization.GetText("#Ticker_Portal5"),
Localization.GetText("#Ticker_Interdim1"),
Localization.GetText("#Ticker_Interdim2").format(Game.bakeryName)
]));
if (Game.Objects['#Building_Portal'].amount > 50) list.push(choose([
Localization.GetText("#Ticker_Portal6"),
Localization.GetText("#Ticker_Portal7"),
Localization.GetText("#Ticker_Portal8")
]));
if (Game.Objects['#Building_Portal'].amount > 70) list.push(choose([
Localization.GetText("#Ticker_Portal9"),
Localization.GetText("#Ticker_Portal10")
]));
if (Game.Objects['#Building_Portal'].amount > 12 && Game.cupcakesEarned > 1_000_000_000_000) list.push(choose([
Localization.GetText("#Ticker_Interdim3"),
Localization.GetText("#Ticker_Interdim4"),
Localization.GetText("#Ticker_Interdim5").format(Game.bakeryName)
]));
if (Game.Objects['#Building_CupcakeGen'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_CupcakeGen1"),
Localization.GetText("#Ticker_CupcakeGen2")
]));
if (Game.Objects['#Building_CupcakeGen'].amount > 50) list.push(choose([
Localization.GetText("#Ticker_CupcakeGen3"),
Localization.GetText("#Ticker_CupcakeGen4"),
Localization.GetText("#Ticker_CupcakeGen5"),
Localization.GetText("#Ticker_CupcakeGen6"),
Localization.GetText("#Ticker_CupcakeGen7")
]));
if (Game.Objects['#Building_CupcakeGen'].amount > 70) list.push(choose([
Localization.GetText("#Ticker_CupcakeGen8"),
Localization.GetText("#Ticker_CupcakeGen9")
]));
if (Game.Objects['#Building_CupcakeGalaxy'].amount > 0) list.push(choose([
Localization.GetText("#Ticker_CupcakeGalaxy1"),
Localization.GetText("#Ticker_CupcakeGalaxy2")
]));
if (Game.Objects['#Building_CupcakeGalaxy'].amount > 0 && Game.Objects['#Building_Baker'] > 13) list.push(choose([
Localization.GetText("#Ticker_GalaxyBaker1"),
Localization.GetText("#Ticker_GalaxyBaker2"),
Localization.GetText("#Ticker_GalaxyBaker3"),
Localization.GetText("#Ticker_GalaxyBaker4"),
Localization.GetText("#Ticker_GalaxyBaker5")
]));
if (Game.Objects['#Building_CupcakeGalaxy'].amount > 5) list.push(choose([
Localization.GetText("#Ticker_CupcakeGalaxy3").format(Game.bakeryName),
Localization.GetText("#Ticker_CupcakeGalaxy4").format(Game.bakeryName)
]));
if (Game.cupcakesEarned >= 10_000_000_000_000) list.push(choose([
Localization.GetText("#Ticker_GalaxyBaker6"),
Localization.GetText("#Ticker_GalaxyBaker8"),
Localization.GetText("#Ticker_GalaxyBaker7"),
Localization.GetText("#Ticker_GalaxyBaker12")
]));
if (Game.Objects['#Building_Baker'].amount >= 150) list.push(choose([
Localization.GetText("#Ticker_GalaxyBaker9"),
Localization.GetText("#Ticker_GalaxyBaker10")
]));
if (Game.Objects['#Building_RobotBaker'].amount >= 100 && Game.Objects['#Building_RobotComplex'].amount >= 10) list.push(choose([
Localization.GetText("#Ticker_GalaxyBaker11"),
Localization.GetText("#Ticker_GalaxyBaker12")
]));
/*if (Game.HasAchiev('Base 10')) list.push('News : cupcake manufacturer completely forgoes common sense, lets OCD drive building decisions!');
if (Game.HasAchiev('#Achievement_FromScratch')) list.push('News : follow the tear-jerking, riches-to-rags story about a local cupcake manufacturer who decided to give it all up!');
if (Game.HasAchiev('A world filled with cupcakes')) list.push('News : known universe now jammed with cupcakes! No vacancies!');
if (Game.HasAchiev('#Upgrade_Serendipity')) list.push('News : local cupcake manufacturer becomes luckiest being alive!');*/
/*if (Game.Has('Cupcake helpers')) list.push('News : faint laughingg heard around local cupcake facilities; suggests new ingredient being tested.');
if (Game.Has('Cupcake workers')) list.push('News : chemicals were seen in the river next to local cupcake facilities.');
if (Game.Has('#Upgrade_CupcakeEngineers')) list.push('News : "Fusion reactor circuits have been spotted at the 100th floor of the local cupcake facility." - says the insider.');
if (Game.Has('#Upgrade_CupcakeOverseers')) list.push('News : "Huge flashes of flame and lightning were near the local cupcake facility!" - says a passer-by.');
*/
var animals = Localization.GetText("#Ticker_NewsAnimals").split('|');
var effects1 = Localization.GetText("#Ticker_NewsAnimalEffects1").split('|');
var effects2 = Localization.GetText("#Ticker_NewsAnimalEffects2").split('|');
if (Game.cupcakesEarned >= 10000) list.push(
Localization.GetText("#Ticker_News") + choose([
Localization.GetText("#Ticker_NewsAnimals1").format(choose(effects1), choose(animals)),
Localization.GetText("#Ticker_NewsAnimals2").format(choose(animals), choose(effects2)),
Localization.GetText("#Ticker_NewsAnimals3").format(choose(animals)),
Localization.GetText("#Ticker_NewsAnimals4").format(choose(animals)),
Localization.GetText("#Ticker_NewsAnimals5").format(choose(animals)),
Localization.GetText("#Ticker_NewsAnimals6").format(choose(animals)),
Localization.GetText("#Ticker_NewsAnimals7").format(choose(animals))
]),
Localization.GetText("#Ticker_News") + "\"" + choose([
Localization.GetText("#Ticker_NewsCelebrity1"),
Localization.GetText("#Ticker_NewsCelebrity2"),
Localization.GetText("#Ticker_NewsCelebrity3"),
Localization.GetText("#Ticker_NewsCelebrity4"),
Localization.GetText("#Ticker_NewsCelebrity5"),
Localization.GetText("#Ticker_NewsCelebrity6"),
Localization.GetText("#Ticker_NewsCelebrity7"),
Localization.GetText("#Ticker_NewsCelebrity8"),
Localization.GetText("#Ticker_NewsCelebrity9"),
Localization.GetText("#Ticker_NewsCelebrity10"),
Localization.GetText("#Ticker_NewsCelebrity11"),
Localization.GetText("#Ticker_NewsCelebrity12"),
Localization.GetText("#Ticker_NewsCelebrity13"),
Localization.GetText("#Ticker_NewsCelebrity14"),
]) + Localization.GetText("#Ticker_NewsCelebrityReveals"),
Localization.GetText("#Ticker_News") + choose([Localization.GetText("#Ticker_NewsDoctors1"), Localization.GetText("#Ticker_NewsDoctors2"), Localization.GetText("#Ticker_NewsDoctors3"), Localization.GetText("#Ticker_NewsDoctors4")]),
choose([
Localization.GetText("#Ticker_NewsRandom1"),
Localization.GetText("#Ticker_NewsRandom2"),
Localization.GetText("#Ticker_NewsRandom3"),
Localization.GetText("#Ticker_NewsRandom4"),
Localization.GetText("#Ticker_NewsRandom5"),
Localization.GetText("#Ticker_NewsRandom8"),
Localization.GetText("#Ticker_NewsRandom9"),
Localization.GetText("#Ticker_NewsRandom10"),
Localization.GetText("#Ticker_NewsRandom11"),
Localization.GetText("#Ticker_NewsRandom12"),
Localization.GetText("#Ticker_NewsRandom13"),
Localization.GetText("#Ticker_NewsRandom14"),
Localization.GetText("#Ticker_NewsRandom15"),
Localization.GetText("#Ticker_NewsRandom16"),
Localization.GetText("#Ticker_NewsRandom17"),
Localization.GetText("#Ticker_NewsRandom18"),
Localization.GetText("#Ticker_NewsRandom19"),
Localization.GetText("#Ticker_NewsRandom20"),
Localization.GetText("#Ticker_NewsRandom22")
])
);
};
if (list.length == 0) {
if (Game.cupcakesEarned < 5) list.push(Localization.GetText("#Ticker_NewsBakeryState1"));
else if (Game.cupcakesEarned < 50) list.push(Localization.GetText("#Ticker_NewsBakeryState2"));
else if (Game.cupcakesEarned < 100) list.push(Localization.GetText("#Ticker_NewsBakeryState3"));
else if (Game.cupcakesEarned < 500) list.push(Localization.GetText("#Ticker_NewsBakeryState4"));
else if (Game.cupcakesEarned < 1000) list.push(Localization.GetText("#Ticker_NewsBakeryState5"));
else if (Game.cupcakesEarned < 3000) list.push(Localization.GetText("#Ticker_NewsBakeryState6"));
else if (Game.cupcakesEarned < 6000) list.push(Localization.GetText("#Ticker_NewsBakeryState7"));
else if (Game.cupcakesEarned < 10000) list.push(Localization.GetText("#Ticker_NewsBakeryState8"));
else if (Game.cupcakesEarned < 20000) list.push(Localization.GetText("#Ticker_NewsBakeryState9"));
else if (Game.cupcakesEarned < 30000) list.push(Localization.GetText("#Ticker_NewsBakeryState10"));
else if (Game.cupcakesEarned < 40000) list.push(Localization.GetText("#Ticker_NewsBakeryState11"));
else if (Game.cupcakesEarned < 42069) list.push(Localization.GetText("#Ticker_NewsBakeryState12"));
else if (Game.cupcakesEarned < 60000) list.push(Localization.GetText("#Ticker_NewsBakeryState13"));
else if (Game.cupcakesEarned < 80000) list.push(Localization.GetText("#Ticker_NewsBakeryState14"));
else if (Game.cupcakesEarned < 100000) list.push(Localization.GetText("#Ticker_NewsBakeryState15"));
else if (Game.cupcakesEarned < 200000) list.push(Localization.GetText("#Ticker_NewsBakeryState16"));
else if (Game.cupcakesEarned < 300000) list.push(Localization.GetText("#Ticker_NewsBakeryState17"));
else if (Game.cupcakesEarned < 450000) list.push(Localization.GetText("#Ticker_NewsBakeryState18"));
else if (Game.cupcakesEarned < 600000) list.push(Localization.GetText("#Ticker_NewsBakeryState19"));
else if (Game.cupcakesEarned < 1000000) list.push(Localization.GetText("#Ticker_NewsBakeryState20"));
else if (Game.cupcakesEarned < 10000000) list.push(Localization.GetText("#Ticker_NewsBakeryState21"));
else if (Game.cupcakesEarned < 13000000) list.push(Localization.GetText("#Ticker_NewsBakeryState22"));
else if (Game.cupcakesEarned < 15000000) list.push(Localization.GetText("#Ticker_NewsBakeryState23"));
/*else if (Game.cupcakesEarned<5000000) list.push('Strange creatures from neighboring planets wish to try your cupcakes.');
else if (Game.cupcakesEarned<10000000) list.push('Elder gods from the whole cosmos have awoken to taste your cupcakes.');
else if (Game.cupcakesEarned<30000000) list.push('Beings from other dimensions lapse into existence just to get a taste of your cupcakes.');
else if (Game.cupcakesEarned<100000000) list.push('Your cupcakes have achieved sentience.');
else if (Game.cupcakesEarned<300000000) list.push('The universe has now turned into cupcake dough, to the molecular level.');
else if (Game.cupcakesEarned<1000000000) list.push('Your cupcakes are rewriting the fundamental laws of the universe.');
else if (Game.cupcakesEarned<10000000000) list.push('A local news station runs a 10-minute segment about your cupcakes. Success!<br><span style="font-size:50%;">(you win a cupcake)</span>');
else if (Game.cupcakesEarned<10100000000) list.push('it\'s time to stop playing');//only show this for 100 millions (it's funny for a moment)*/
}
Game.TickerAge = Game.fps * 10;
Game.Ticker = choose(list);
Game.TickerN++;
}
/**
* Draw the news label
* @returns {void}
*/
Game.TickerDraw = function () {
var str = '';
var o = 0;
if (Game.Ticker != '') {
if (Game.TickerAge < Game.fps * 1 && 1 == 2)//too bad this doesn't work well with html tags
{
str = Game.Ticker.substring(0, (Game.Ticker + '<').indexOf('<'));
str = str.substring(0, str.length * Math.min(1, Game.TickerAge / (Game.fps * 1)));
}
else str = Game.Ticker;
//o=Math.min(1,Game.TickerAge/(Game.fps*0.5));//*Math.min(1,1-(Game.TickerAge-Game.fps*9.5)/(Game.fps*0.5));
}
else {
console.log(Game.Ticker);
}
//l('commentsText').style.opacity=o;
l('commentsText').innerHTML = str;
//'<div style="font-size:70%;"><span onclick="Game.Earn(1000);">add 1,000</span> | <span onclick="Game.Earn(1000000);">add 1,000,000</span></div>';
}
/*=====================================================================================
BUILDINGS CODE
=======================================================================================*/
/**
* Store rebuild flag
* @type {number}
*/
Game.storeToRebuild = 1;
/**
* Coefficient of price increase
* @type {number}
*/
Game.priceIncrease = 1.15;
/**
* All registred objects
* @type {Object}
*/
Game.Objects = [];
/**
* All registred objects (Array)
* @type {Array<Game.Object>}
*/
Game.ObjectsById = [];
Game.ObjectsN = 0;
/**
* All registred objects
* @type {Object}
*/
Game.BuildingsOwned = 0;
var buysound = new Audio(choose(['https://cdn.discordapp.com/attachments/880491676244795465/1053027697099538603/buy1.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1053027697653190716/buy2.wav']));
var sellsound = new Audio('https://cdn.discordapp.com/attachments/880491676244795465/1053027697401536553/sell1.wav');
/**
* Constructor of Object class
* @class
* @param {string} name Name of object
* @param {string} commonName Single|Plural|ActiomName
* @param {string} desc Description of object
* @param {string|Function} pic Path to picture or function that provides it
* @param {string} icon Path to building icon image
* @param {string} background Path to background image
* @param {number} price Price of Object
* @param {number} cps CPS that Object Provides
* @param {Function?} drawFunction Custom draw callback
* @param {Function?} buyFunction Custom buy function
*/
Game.Object = function (name, commonName, desc, pic, icon, background, price, cps, drawFunction, buyFunction) {
this.id = Game.ObjectsN;
this.name = name;
this.displayName = Localization.GetText(this.name);
this.localizationCommonName = commonName;
commonName = Localization.GetText(this.localizationCommonName).split('|');
this.single = commonName[0];
this.plural = commonName[1];
this.actionName = commonName[2];
this.desc = Localization.GetText(desc);
this.basePrice = price;
this.price = this.basePrice;
this.cps = cps;
this.totalcupcakes = 0;
this.storedCps = 0;
this.storedTotalCps = 0;
this.pic = pic;
this.icon = icon;
this.background = background;
this.buyFunction = buyFunction;
this.drawFunction = drawFunction;
this.special = null;//special is a function that should be triggered when the object's special is unlocked, or on load (if it's already unlocked). For example, creating a new dungeon.
this.onSpecial = 0;//are we on this object's special screen (dungeons etc)?
this.specialUnlocked = 0;
this.specialDrawFunction = null;
this.drawSpecialButton = null;
this.amount = 0;
this.bought = 0;
/**
* Buies the Object
* @returns {void}
*/
this.buy = function () {
var price = this.basePrice * Math.pow(Game.priceIncrease, this.amount);
if (Game.cupcakes >= price) {
Game.Spend(price);
this.amount++;
buysound.play();
this.bought++;
price = this.basePrice * Math.pow(Game.priceIncrease, this.amount);
this.price = price;
if (this.buyFunction) this.buyFunction();
if (this.drawFunction) this.drawFunction();
Game.storeToRebuild = 1;
Game.recalculateGains = 1;
if (this.amount == 1 && this.id != 0) l('row' + this.id).className = 'row enabled';
Game.BuildingsOwned++;
}
}
/**
* Sells the Object
* @returns {void}
*/
this.sell = function () {
var price = this.basePrice * Math.pow(Game.priceIncrease, this.amount);
price = Math.floor(price * 0.5);
if (this.amount > 0) {
//Game.Earn(price);
Game.cupcakes += price;
sellsound.play();
this.amount--;
price = this.basePrice * Math.pow(Game.priceIncrease, this.amount);
this.price = price;
if (this.sellFunction) this.sellFunction();
if (this.drawFunction) this.drawFunction();
Game.storeToRebuild = 1;
Game.recalculateGains = 1;
Game.BuildingsOwned--;
}
}
this.setSpecial = function (what)
{
if (what == 1) this.onSpecial = 1;
else this.onSpecial = 0;
if (this.id != 0) {
if (this.onSpecial) {
l('rowSpecial' + this.id).style.display = 'block';
if (this.specialDrawFunction) this.specialDrawFunction();
}
else {
l('rowSpecial' + this.id).style.display = 'none';
if (this.drawFunction) this.drawFunction();
}
}
}
this.unlockSpecial = function () {
if (this.specialUnlocked == 0) {
this.specialUnlocked = 1;
this.setSpecial(0);
if (this.special) this.special();
this.refresh();
}
}
/**
* Gets tooltip for this object
* @returns {string}
*/
this.tooltip = function () {
var me = this;
var desc = me.desc;
var name = me.displayName;
if (Game.season == 'fools') {
if (!Game.foolIcons[me.displayName]) {
name = Game.foolNames['Unknown'];
desc = Game.foolDescs['Unknown'];
}
else {
name = Game.foolNames[me.displayName];
desc = Game.foolDescs[me.displayName];
}
}
if (me.locked) {
name = '???';
desc = '';
}
//if (l('rowInfo'+me.id) && Game.drawT%10==0) l('rowInfoContent'+me.id).innerHTML='• '+me.amount+' '+(me.amount==1?me.single:me.plural)+'<br>• producing '+Beautify(me.storedTotalCps,1)+' '+(me.storedTotalCps==1?'cupcake':'cupcakes')+' per second<br>• total : '+Beautify(me.totalcupcakes)+' '+(Math.floor(me.totalcupcakes)==1?'cupcake':'cupcakes')+' '+me.actionName;
return '<div style="min-width:100px;"><div style="float:right;">' + Localization.GetText("#Tooltip_NameBar").format(Beautify(Math.round(me.price)), name, me.amount) +
'<div class="description">' + desc + '</div>' +
(me.totalcupcakes > 0 ? (
'<div class="data">' +
(me.amount > 0 ? '• each ' + me.single + ' produces <b>' + Beautify((me.storedTotalCps / me.amount) * Game.globalCpsMult, 1) + '</b> ' + ((me.storedTotalCps / me.amount) * Game.globalCpsMult == 1 ? 'cupcake' : 'cupcakes') + ' per second<br>' : '') +
'• ' + me.amount + ' ' + (me.amount == 1 ? me.single : me.plural) + ' producing <b>' + Beautify(me.storedTotalCps * Game.globalCpsMult, 1) + '</b> ' + (me.storedTotalCps * Game.globalCpsMult == 1 ? 'cupcake' : 'cupcakes') + ' per second<br>' +
'• <b>' + Beautify(me.totalcupcakes) + '</b> ' + (Math.floor(me.totalcupcakes) == 1 ? 'cupcake' : 'cupcakes') + ' ' + me.actionName + ' so far</div>'
) : '') +
'</div>';
}
/**
* Refreshes the Object
* @returns {void}
*/
this.refresh = function () {
this.price = this.basePrice * Math.pow(Game.priceIncrease, this.amount);
if (this.amount == 0 && this.id != 0) l('row' + this.id).className = 'row';
else if (this.amount > 0 && this.id != 0) l('row' + this.id).className = 'row enabled';
if (this.drawFunction && !this.onSpecial) this.drawFunction();
//else if (this.specialDrawFunction && this.onSpecial) this.specialDrawFunction();
}
if (this.id != 0)//draw it
{
var str = '<div class="row" id="row' + this.id + '"><div class="separatorBottom"></div><div class="content"><div id="rowBackground' + this.id + '" class="background" style="background:url(img/' + this.background + '.png) repeat-x;"><div class="backgroundLeft"></div><div class="backgroundRight"></div></div><div class="objects" id="rowObjects' + this.id + '"> </div></div><div class="special" id="rowSpecial' + this.id + '"></div><div class="specialButton" id="rowSpecialButton' + this.id + '"></div><div class="info" id="rowInfo' + this.id + '"><div class="infoContent" id="rowInfoContent' + this.id + '"></div><div><a onclick="Game.ObjectsById[' + this.id + '].sell();">Sell 1</a></div></div></div>';
l('rows').innerHTML = l('rows').innerHTML + str;
}
/**
* Update localization for this object
* @returns {void}
*/
this.UpdateLocale = function () {
this.displayName = Localization.GetText(this.name);
commonName = Localization.GetText(this.localizationCommonName).split('|');
this.single = commonName[0];
this.plural = commonName[1];
this.actionName = commonName[2];
this.desc = Localization.GetText(desc);
}
Game.Objects[this.name] = this;
Game.ObjectsById[this.id] = this;
Game.ObjectsN++;
return this;
}
Game.NewDrawFunction = function (pic, xVariance, yVariance, w, shift, heightOffset) {
//pic : either 0 (the default picture will be used), a filename (will be used as override), or a function to deterC-Factory a filename
//xVariance : the pictures will have a random horizontal shift by this many pixels
//yVariance : the pictures will have a random vertical shift by this many pixels
//w : how many pixels between each picture (or row of pictures)
//shift : if >1, arrange the pictures in rows containing this many pictures
//heightOffset : the pictures will be displayed at this height, +32 pixels
return function () {
if (pic == 0 && typeof (pic) != 'function') pic = this.pic;
shift = shift || 1;
heightOffset = heightOffset || 0;
var bgW = 0;
var str = '';
var offX = 0;
var offY = 0;
if (this.drawSpecialButton && this.specialUnlocked) {
l('rowSpecialButton' + this.id).style.display = 'block';
l('rowSpecialButton' + this.id).innerHTML = this.drawSpecialButton();
str += '<div style="width:50px;height:128px;">' + this.drawSpecialButton() + '</div>';
l('rowInfo' + this.id).style.paddingLeft = (8 + 128) + 'px';
offX += 128;
}
for (var i = 0; i < this.amount; i++) {
if (shift != 1) {
var x = Math.floor(i / shift) * w + ((i % shift) / shift) * w + Math.floor((Math.random() - 0.5) * xVariance) + offX;
var y = 32 + heightOffset + Math.floor((Math.random() - 0.5) * yVariance) + ((-shift / 2) * 32 / 2 + (i % shift) * 32 / 2) + offY;
}
else {
var x = i * w + Math.floor((Math.random() - 0.5) * xVariance) + offX;
var y = 32 + heightOffset + Math.floor((Math.random() - 0.5) * yVariance) + offY;
}
var usedPic = (typeof (pic) == 'function' ? pic() : pic);
str += '<div class="object" style="background:url(img/' + usedPic + '.png);left:' + x + 'px;top:' + y + 'px;z-index:' + Math.floor(1000 + y) + ';"></div>';
bgW = Math.max(bgW, x + 64);
}
bgW += offX;
l('rowObjects' + this.id).innerHTML = str;
l('rowBackground' + this.id).style.width = bgW + 'px';
}
}
/**
* Rebuild store
* @returns {void}
*/
Game.RebuildStore = function ()//redraw the store from scratch
{
var str = '';
for (var i in Game.Objects) {
var me = Game.Objects[i];
str += '<div class="product" ' + Game.getTooltip(
'<div style="min-width:150px;"><div style="float:right;"><span class="price">' + Beautify(Math.round(me.price)) + '</span></div><div class="name">' + me.displayName + '</div>' + '<small>[owned : ' + me.amount + '</small>]<div class="description">' + me.desc + '</div></div>'
, 0, 0, 'left') + ' onclick="Game.ObjectsById[' + me.id + '].buy();" id="product' + me.id + '"><div class="icon" style="background-image:url(img/' + me.icon + '.png);"></div><div class="content"><div class="title">' + me.displayName + '</div><span class="price">' + Beautify(Math.round(me.price)) + '</span>' + (me.amount > 0 ? ('<div class="title owned">' + me.amount + '</div>') : '') + '</div></div>';
}
l('products').innerHTML = str;
Game.storeToRebuild = 0;
}
/**
* Computes CPS
* @param {number} base Base CPS
* @param {number} add Add part (+)
* @param {number} mult Mult part (*)
* @param {number} bonus Bonus part (all + )
* @returns {number}
*/
Game.ComputeCps = function (base, add, mult, bonus) {
if (!bonus) bonus = 0;
return ((base + add) * (Math.pow(2, mult)) + bonus);
}
//define objects
new Game.Object('#Building_Cursor', '#Building_CursorNames', '#Building_CursorDesc', 'cursor', 'cursoricon', '', 15, function () {
var add = 0;
if (Game.Has('#Upgrade_ThousandFingers')) add += 0.1;
if (Game.Has('#Upgrade_MillionFingers')) add *= 0.5;
if (Game.Has('#Upgrade_BillionFingers')) add *= 2;
if (Game.Has('#Upgrade_TrillionFingers')) add *= 5;
if (Game.Has('#Upgrade_QuadrillionFingers')) add *= 10;
if (Game.Has('#Upgrade_QuintillionFingers')) add *= 20;
var num = 0;
for (var i in Game.Objects) { if (Game.Objects[i].name != '#Building_Cursor') num += Game.Objects[i].amount; }
add = add * num;
return Game.ComputeCps(0.1, Game.Has('#Upgrade_ReinforcedIndexFinger') * 0.1, Game.Has('#Upgrade_CarpalTunnelPreventionCream') + Game.Has('#Upgrade_Ambidextrous'), add) * 0.06;
}, function () {//draw function for cursors
var str = '';
for (var i = 0; i < this.amount; i++) {
/*//old
var x=Math.floor(Math.sin((i/this.amount)*Math.PI*2)*132)-16;
var y=Math.floor(Math.cos((i/this.amount)*Math.PI*2)*132)-16;
var r=Math.floor(-(i/this.amount)*360);
*/
//layered
var n = Math.floor(i / 50);
var a = ((i + 0.5 * n) % 50) / 50;
var x = Math.floor(Math.sin(a * Math.PI * 2) * (140 + n * 16)) - 16;
var y = Math.floor(Math.cos(a * Math.PI * 2) * (140 + n * 16)) - 16;
var r = Math.floor(-(a) * 360);
str += '<div class="cursor" id="cursor' + i + '" style="left:' + x + 'px;top:' + y + 'px;transform:rotate(' + r + 'deg);-moz-transform:rotate(' + r + 'deg);-webkit-transform:rotate(' + r + 'deg);-ms-transform:rotate(' + r + 'deg);-o-transform:rotate(' + r + 'deg);"></div>';
}
l('cupcakeCursors').innerHTML = str;
if (!l('rowInfo' + this.id)) l('sectionLeftInfo').innerHTML = '<div class="info" id="rowInfo' + this.id + '"><div class="infoContent" id="rowInfoContent' + this.id + '"></div><div><a onclick="Game.ObjectsById[' + this.id + '].sell();">Sell 1</a></div></div>';
}, function () {
if (this.amount >= 1) Game.Unlock(['#Upgrade_ReinforcedIndexFinger', '#Upgrade_CarpalTunnelPreventionCream']);
if (this.amount >= 10) Game.Unlock('#Upgrade_Ambidextrous');
if (this.amount >= 20) Game.Unlock('#Upgrade_ThousandFingers');
if (this.amount >= 40) Game.Unlock('#Upgrade_MillionFingers');
if (this.amount >= 80) Game.Unlock('#Upgrade_BillionFingers');
if (this.amount >= 120) Game.Unlock('#Upgrade_TrillionFingers');
if (this.amount >= 160) Game.Unlock('#Upgrade_QuadrillionFingers');
if (this.amount >= 200) Game.Unlock('#Upgrade_QuintillionFingers');
if (this.amount >= 1) Game.Win('#Achievement_Click'); if (this.amount >= 2) Game.Win('#Achievement_DoubleClick'); if (this.amount >= 50) Game.Win('#Achievement_MouseWheel'); if (this.amount >= 100) Game.Win('#Achievement_OfMiceAndMen'); if (this.amount >= 200) Game.Win('#Achievement_TheDigital');
});
Game.SpecialbakerUnlock = 15;
new Game.Object('#Building_Baker', '#Building_BakerNames', '#Building_BakerDesc', '#Building_Baker', 'bakerIcon2', 'buildBG', 100, function () {
var mult = 0;
if (Game.Has('#Upgrade_FarmerBakers')) mult++;
if (Game.Has('#Upgrade_WorkerBakers')) mult++;
if (Game.Has('#Upgrade_CFactoryrBakers')) mult++;
if (Game.Has('#Upgrade_CosmicBakers')) mult++;
if (Game.Has('#Upgrade_TransmutedBakers')) mult++;
if (Game.Has('#Upgrade_AlteredBakers')) mult++;
if (Game.Has('#Upgrade_bakersBakers')) mult++;
if (Game.Has('#Upgrade_Antibakers')) mult++;
if (Game.Has('#Upgrade_BingoCenterResearchFacility')) mult += 2;
if (Game.Has('#Upgrade_RitualRollingPins')) mult++;
var add = 0;
if (Game.Has('#Upgrade_OneMind')) add += Game.Objects['#Building_Baker'].amount * 0.02;
if (Game.Has('#Upgrade_CommunalBrainsweep')) add += Game.Objects['#Building_Baker'].amount * 0.02;
if (Game.Has('#Upgrade_ElderPact')) add += Game.Objects['#Building_Portal'].amount * 0.05;
return Game.ComputeCps(0.5, Game.Has('Forwards from baker') * 0.3 + add, Game.Has('Steel-plated pins') + Game.Has('Lubricated dentures') + Game.Has('#Upgrade_PruneJuice') + Game.Has('#Upgrade_SalaryIncrease') + Game.Has('#Upgrade_LaborUnion') + mult) * 0.1;
}, Game.NewDrawFunction(function () {
var list = ['#Building_Baker'];
if (Game.Has('#Upgrade_FarmerBakers')) list.push('farmerbaker');
if (Game.Has('#Upgrade_WorkerBakers')) list.push('workerbaker');
if (Game.Has('#Upgrade_CFactoryrBakers')) list.push('C-Factoryrbaker');
if (Game.Has('#Upgrade_CosmicBakers')) list.push('cosmicbaker');
if (Game.Has('#Upgrade_TransmutedBakers')) list.push('transmutedbaker');
if (Game.Has('#Upgrade_AlteredBakers')) list.push('alteredbaker');
if (Game.Has('#Upgrade_bakersBakers')) list.push('bakersbaker');
if (Game.Has('#Upgrade_Antibakers')) list.push('antibaker');
return choose(list);
}, 8, 8, 32, 3, 16), function () {
if (this.amount >= 1) Game.Unlock(['#Upgrade_EMailFromBaker', '#Upgrade_SteelPlatedPins']); if (this.amount >= 10) Game.Unlock('#Upgrade_NewDough'); if (this.amount >= 50) Game.Unlock('#Upgrade_SalaryIncrease'); if (this.amount >= 100) Game.Unlock('#Upgrade_LaborUnion');
if (this.amount >= 1) Game.Win('#Achievement_BusinessStarts'); if (this.amount >= 50) Game.Win('#Achievement_Professional'); if (this.amount >= 100) Game.Win('#Achievement_UltimateBakery');
});
Game.Objects['#Building_Baker'].sellFunction = function () {
Game.Win('#Achievement_JustWrong');
if (this.amount == 0) {
Game.Lock('#Achievement_ElderPledge');
Game.pledgeT = 0;
}
};
new Game.Object('#Building_RobotBaker', '#Building_RobotBakerNames', '#Building_RobotBakerDesc', 'robot baker', 'farmIcon', 'buildBG', 2500, function () {
return Game.ComputeCps(2, Game.Has('Cheap hoes') * 0.2, Game.Has('Fertilizer') + Game.Has('Cupcake trees') + Game.Has('#Upgrade_GeneticallyModifiedCupcakes')) * 0.1;
}, Game.NewDrawFunction(0, 16, 16, 64, 2, 32), function () {
if (this.amount >= 1) Game.Unlock(['#Upgrade_SpareParts', 'Trashkies']); if (this.amount >= 10) Game.Unlock('#Upgrade_AI'); if (this.amount >= 50) Game.Unlock('#Upgrade_ImprovedConnection');
if (this.amount >= 1) Game.Win('#Achievement_SkynetAttacks'); if (this.amount >= 50) Game.Win('#Achievement_SmartBakery'); if (this.amount >= 100) Game.Win('#Achievement_UltimateTechnology'); if (this.amount >= 150) Game.Win('#Achievement_Automation'); if (this.amount >= 160) Game.Win('#Achievement_ProgressInScience'); if (this.amount >= 170) Game.Win('#Achievement_MachineLearning');
});
new Game.Object('#Building_TechnoFurnace', '#Building_TechnoFurnaceNames', '#Building_TechnoFurnaceDesc', 'factory', 'factoryIcon', 'buildBG', 30000, function () {
return Game.ComputeCps(3, Game.Has('#Upgrade_NewFuel') * 0.2, Game.Has('#Upgrade_IncreasedVoltage') + Game.Has('#Upgrade_UpdatedFurnaceMaterial') + Game.Has('#Upgrade_ImprovedCrystallineBoiler'));
}, Game.NewDrawFunction(0, 32, 2, 64, 1, -22), function () {
if (this.amount >= 1) Game.Unlock(['#Upgrade_NewFuel', '#Upgrade_IncreasedVoltage']); if (this.amount >= 10) Game.Unlock('#Upgrade_UpdatedFurnaceMaterial'); if (this.amount >= 50) Game.Unlock('#Upgrade_ImprovedCrystallineBoiler');
if (this.amount >= Game.SpecialbakerUnlock && Game.Objects['#Building_Baker'].amount > 0) Game.Unlock('#Upgrade_WorkerBakers');
if (this.amount >= 1) Game.Win('#Achievement_ProductionChain'); if (this.amount >= 50) Game.Win('#Achievement_IndustrialRevolution'); if (this.amount >= 100) Game.Win('#Achievement_GlobalWarming');
});
new Game.Object('#Building_CFactory', '#Building_CFactoryNames', '#Building_CFactoryDesc', '#Building_CFactory', 'mineIcon', 'buildBG', 100000, function () {
return Game.ComputeCps(5, Game.Has('Sugar gas') * 0.5, Game.Has('Megadrill') + Game.Has('Ultradrill') + Game.Has('Ultimadrill'));
}, Game.NewDrawFunction(0, 16, 16, 64, 2, 24), function () {
if (this.amount >= 1) Game.Unlock('#Upgrade_ProductionOver9000')//,'Megadrill']);if (this.amount>=10) Game.Unlock('Ultradrill');if (this.amount>=50) Game.Unlock('Ultimadrill');
if (this.amount >= Game.SpecialbakerUnlock && Game.Objects['#Building_Baker'].amount > 0) Game.Unlock('#Upgrade_CFactoryrBakers');
if (this.amount >= 1) Game.Win('#Achievement_Conveyor'); if (this.amount >= 100) Game.Win('#Achievement_Fabricology'); if (this.amount >= 150) Game.Win('#Achievement_ProductionOptimization');
});
new Game.Object('#Building_AtomicCupcake', '#Building_AtomicCupcakeNames', '#Building_AtomicCupcakeDesc', '#Building_AtomicCupcake', 'shipmentIcon', 'buildBG', 1000000, function () {
return Game.ComputeCps(10, Game.Has('Vanilla nebulae') * 0.6, Game.Has('Wormholes') + Game.Has('Frequent flyer') + Game.Has('Warp drive'));
}, Game.NewDrawFunction(0, 32, 32, 64, 1), function () {
if (this.amount >= 10) Game.Unlock('#Upgrade_MolecularPhysics'); if (this.amount >= 50) Game.Unlock('#Upgrade_NewTechnology');//if (this.amount>=50) Game.Unlock('Warp drive');
if (this.amount >= Game.SpecialbakerUnlock && Game.Objects['#Building_Baker'].amount > 0) Game.Unlock('#Upgrade_CosmicBakers');
if (this.amount >= 1) Game.Win('#Achievement_MolecularPhysics'); if (this.amount >= 50) Game.Win('#Achievement_AtomicProgression'); if (this.amount >= 100) Game.Win('#Achievement_AtomicDominance');
});
// Game.Objects['#Building_AtomicCupcake'].displayName = '<span style="font-size:75%;">Atomic Cupcake</span>'
new Game.Object('#Building_AlchemyLab', '#Building_AlchemyLabNames', '#Building_AlchemyLabDesc', 'alchemylab', 'alchemylabIcon2', 'buildBG', 15000000, function () {
return Game.ComputeCps(50, Game.Has('#Upgrade_Antimony') * 0.7, Game.Has('#Upgrade_EssenceOfDough') + Game.Has('True chocolate') + Game.Has('Ambrosia'));
}, Game.NewDrawFunction(0, 16, 16, 64, 2, 16), function () {
if (this.amount >= 1) Game.Unlock(['#Upgrade_Antimony', '#Upgrade_EssenceOfDough']); if (this.amount >= 10) Game.Unlock('True chocolate'); if (this.amount >= 50) Game.Unlock('Ambrosia');
if (this.amount >= Game.SpecialbakerUnlock && Game.Objects['#Building_Baker'].amount > 0) Game.Unlock('#Upgrade_TransmutedBakers');
if (this.amount >= 1) Game.Win('#Achievement_Transmutation'); if (this.amount >= 50) Game.Win('#Achievement_Transmogrification'); if (this.amount >= 100) Game.Win('#Achievement_GoldMember');
});
new Game.Object('#Building_CupPlanet', '#Building_CupPlanetNames', '#Building_CupPlanetDesc', 'cupplanet', 'portalIcon', 'buildBG', 30666666, function () {
return Game.ComputeCps(100, Game.Has('Ancient tablet') * 1.1, Game.Has('Insane oatling workers') + Game.Has('Soul bond') + Game.Has('Sanity dance'));
}, Game.NewDrawFunction(0, 32, 32, 64, 2), function () {
if (this.amount >= 1) Game.Unlock(['#Upgrade_NewCivilization']);//if (this.amount>=10) Game.Unlock('Soul bond');if (this.amount>=50) Game.Unlock('Sanity dance');
if (this.amount >= Game.SpecialbakerUnlock && Game.Objects['#Building_Baker'].amount > 0) Game.Unlock('#Upgrade_AlteredBakers');
if (this.amount >= 1) Game.Win('A whole new world'); if (this.amount >= 50) Game.Win('#Achievement_PlanetColonization'); if (this.amount >= 100) Game.Win('#Achievement_GalacticDomination');
});
new Game.Object('#Building_CloneMachine', '#Building_CloneMachineNames', '#Building_CloneMachineDesc', 'timemachine', 'newclone', 'buildBG', 1234567890, function () {
return Game.ComputeCps(200, Game.Has('Flux capacitors') * 1.2, Game.Has('Time paradox resolver') + Game.Has('Quantum conundrum') + Game.Has('Causality enforcer') + Game.Has('#Upgrade_AdvancedOrganicChemistryTheory') + Game.Has('#Upgrade_NowFrom4815162342Grams') + Game.Has('#Upgrade_FabergeAccuracyMechanisms') * 2);
}, Game.NewDrawFunction(0, 32, 32, 64, 1), function () {
if (this.amount >= 1) Game.Unlock(['Flux capacitors', 'Time paradox resolver']); if (this.amount >= 10) Game.Unlock(['Quantum conundrum', '#Upgrade_AdvancedOrganicChemistryTheory']); if (this.amount >= 30) Game.Unlock('#Upgrade_NowFrom4815162342Grams'); if (this.amount >= 50) Game.Unlock(['Causality enforcer', '#Upgrade_FabergeAccuracyMechanisms']);
if (this.amount >= Game.SpecialbakerUnlock && Game.Objects['#Building_Baker'].amount > 0) Game.Unlock('#Upgrade_bakersBakers');
if (this.amount >= 1) Game.Win('#Achievement_EasyBaking');if (this.amount >= 30) Game.Win('#Achievement_CloneConveyor');
});
new Game.Object('#Building_CyberPrism', '#Building_CyberPrismNames', '#Building_CyberPrismDesc', 'cyberprism', 'newprism', 'buildBG', 15006007000, function () {
return Game.ComputeCps(500, Game.Has('#Upgrade_FastProcessing') * 10, Game.Has('#Upgrade_CyberNet') + Game.Has('#Upgrade_CyberBakers') + Game.Has('#Upgrade_SNUSBattery') + Game.Has('#Upgrade_TernaryCode') + Game.Has('#Upgrade_CupcakeGPT')) * 2;
}, Game.NewDrawFunction(0, 32, 32, 64, 1), function () {
if (this.amount >= 1) Game.Unlock('#Upgrade_FastProcessing'); if (this.amount >= 10) Game.Unlock('#Upgrade_CyberNet'); if (this.amount >= 20) Game.Unlock('#Upgrade_CyberBakers'); if (this.amount >= 30) Game.Unlock('#Upgrade_SNUSBattery'); if (this.amount >= 35) Game.Unlock('#Upgrade_TernaryCode'); if (this.amount >= 50) Game.Unlock('#Upgrade_CupcakeGPT');
if (this.amount >= 1) Game.Win('#Achievement_CyberSpace'); if (this.amount >= 10) Game.Win('#Achievement_CyberneticMind'); if (this.amount >= 50) Game.Win('#Achievement_TrueSciFi'); if (this.amount >= 70) Game.Win('#Achievement_Two')
});
/*new Game.Object('#Building_Portal', 'portal|portals|gave', 'Gives cupcakes from other dimensions.', 'electroporticon','electroportBackground',10999998,function(){
return Game.ComputeCps(20996,Game.Has('#Upgrade_NewWorlds')*21100,Game.Has('#Upgrade_QuantumTransfer'));
},Game.NewDrawFunction(0,32,32,64,1),function(){
if (this.amount>=10) Game.Unlock('#Upgrade_NewWorlds');if (this.amount>=50) Game.Unlock('#Upgrade_QuantumTransfer');
if (this.amount>=1) Game.Win('#Achievement_Invader');if (this.amount>=20) Game.Win('#Achievement_GlobalConqueror');
});*/
new Game.Object('#Building_Portal', '#Building_PortalNames', '#Building_PortalDesc', 'portal', 'electroporticon', 'buildBG', 100000999998, function () {
return Game.ComputeCps(1000, Game.Has('#Upgrade_NewWorlds') * 10.5, Game.Has('#Upgrade_QuantumTransfer'), Game.Has('#Upgrade_NewHorizons') + Game.Has('#Upgrade_CupcakeStringTheoryBasedDimensions')) * 2;
}, Game.NewDrawFunction(0, 32, 32, 64, 1), function () {
if (this.amount >= 10) Game.Unlock('#Upgrade_NewWorlds'); if (this.amount >= 20) Game.Unlock('#Upgrade_QuantumTransfer'); if (this.amount >= 30) Game.Unlock('#Upgrade_NewHorizons'); if (this.amount >= 50) Game.Unlock('#Upgrade_CupcakeStringTheoryBasedDimensions');
if (this.amount >= 1) Game.Win('#Achievement_Invader'); if (this.amount >= 20) Game.Win('#Achievement_GlobalConqueror'); if (this.amount >= 50) Game.Win('#Achievement_CupcakesFromAcrossTheMultiverse'); if (this.amount >= 70) Game.Win('#Achievement_BlackMesaWannaBe');
});
new Game.Object('#Building_CupcakeGen', '#Building_CupcakeGenNames', '#Building_CupcakeGenDesc', 'cupcakegen', 'CupGen', 'buildBG', 300111222333, function () {
return Game.ComputeCps(5000, Game.Has('#Upgrade_NewDiscoveries') * 11.1, Game.Has('#Upgrade_StabilizationTechnology'), Game.Has('#Upgrade_FasterGenerators') * 2 + Game.Has('#Upgrade_SpecialCupcakePhysics')) * 2;
}, Game.NewDrawFunction(0, 32, 32, 64, 1), function () {
if (this.amount >= 10) Game.Unlock('#Upgrade_NewDiscoveries'); if (this.amount >= 20) Game.Unlock('#Upgrade_StabilizationTechnology'); if (this.amount >= 30) Game.Unlock('#Upgrade_FasterGenerators'); if (this.amount >= 50) Game.Unlock('#Upgrade_SpecialCupcakePhysics');
if (this.amount >= 1) Game.Win('#Achievement_ANewWordInScience'); if (this.amount >= 20) Game.Win('#Achievement_CupcakesOutOfThinAir'); if (this.amount >= 50) Game.Win('#Achievement_NanoDominance'); if (this.amount >= 69) Game.Win('#Achievement_Nice');
});
new Game.Object('#Building_RobotComplex', '#Building_RobotComplexNames', '#Building_RobotComplexDesc', 'robotcomplex', 'robotcomplexIcon', 'buildBG', 700100200300, function () {
return Game.ComputeCps(10000, Game.Has('#Upgrade_ImprovedRobots') * 16.2, Game.Has('#Upgrade_ImprovedControlSystem')) * 2;
}, Game.NewDrawFunction(0, 32, 32, 64, 1), function () {
if (this.amount >= 5) Game.Unlock('#Upgrade_ImprovedRobots'); if (this.amount >= 10) Game.Unlock('#Upgrade_ImprovedControlSystem'); if (this.amount >= 15) Game.Unlock('#Upgrade_CyberSlavery'); if (this.amount >= 20) Game.Unlock('#Upgrade_LaborUnion');
if (this.amount >= 1) Game.Win('#Achievement_Robotization'); if (this.amount >= 5) Game.Win('#Achievement_CollectiveMind'); //if (this.amount >= 50) Game.Win('#Achievement_NanoDominance'); if (this.amount >= 69) Game.Win('#Achievement_Nice');
});
new Game.Object('#Building_CupcakeGalaxy', '#Building_CupcakeGalaxyNames', '#Building_CupcakeGalaxyDesc', 'cupcakegalaxy', 'cupdimensionicon', 'buildBG', 950000000000, function () {
return Game.ComputeCps(20000, Game.Has('#Upgrade_WarpSpeedBaking') * 16.2, Game.Has('#Upgrade_CelestialCupcakeBoost')) * 2;
}, Game.NewDrawFunction(0, 32, 32, 64, 1), function () {
if (this.amount >= 2) Game.Unlock('#Upgrade_WarpSpeedBaking'); if (this.amount >= 10) Game.Unlock('#Upgrade_CelestialCupcakeBoost');
if (this.amount >= 1) Game.Win('#Achievement_CosmicConfectioner'); if (this.amount >= 5) Game.Win('#Achievement_NebulaNavigator');
});
/*=====================================================================================
UPGRADES CODE
=======================================================================================*/
/**
* Rebuild upgrades flag
* @type {number}
*/
Game.upgradesToRebuild = 1;
/**
* All registred upgrades
* @type {Array<Game.Object>}
*/
Game.Upgrades = [];
/**
* All registred upgrades (Array)
* @type {Array<Game.Object>}
*/
Game.UpgradesById = [];
Game.UpgradesN = 0;
Game.UpgradesInStore = [];
/**
* How much upgrades user owns
* @type {number}
*/
Game.UpgradesOwned = 0;
var updrsound = ["https://cdn.discordapp.com/attachments/1105095523616170024/1105095778545975306/buy1.mp3", "https://cdn.discordapp.com/attachments/1105095523616170024/1105095778915057704/buy2.mp3", "https://cdn.discordapp.com/attachments/1105095523616170024/1105095779292565534/buy3.mp3", "https://cdn.discordapp.com/attachments/1105095523616170024/1105095779770712125/buy4.mp3"];
/**
* Upgrade class
* @class
* @param {string} name Name of Upgrade
* @param {string} desc Description of Upgrade
* @param {number} price Price of Upgrade
* @param {string} icon Path to icon image
* @param {number} hide 0=show, 3=hide (1-2 : I have no idea)
* @param {Function?} buyFunction Custom buy function
*/
Game.Upgrade = function (name, desc, price, icon, hide, buyFunction) {
this.id = Game.UpgradesN;
this.name = name;
this.displayName = Localization.GetText(name);
this.desc = Localization.GetText(desc);
this.basePrice = price;
this.icon = icon;
this.buyFunction = buyFunction;
/*this.unlockFunction=unlockFunction;
this.unlocked=(this.unlockFunction?0:1);*/
this.unlocked = 0;
this.bought = 0;
this.hide = hide;//0=show, 3=hide (1-2 : I have no idea)
this.order = this.id;
if (order) this.order = order + this.id * 0.001;
this.type = '';
if (type) this.type = type;
this.power = 0;
if (power) this.power = power;
/**
* Returns price of Upgrade
* @returns {number}
*/
this.getPrice = function () {
var price = this.basePrice;
if (Game.Has('Toy workshop')) price *= 0.95;
if (Game.Has('Santa\'s dominion')) price *= 0.98;
if (Game.Has('Faberge egg')) price *= 0.99;
return Math.ceil(price);
}
/**
* Buies the Upgrade
* @returns {void}
*/
this.buy = function () {
var cancelPurchase = 0;
if (this.clickFunction) cancelPurchase = !this.clickFunction();
if (!cancelPurchase) {
var price = this.basePrice;
if (Game.cupcakes >= price && !this.bought) {
Game.Spend(price);
PlaySound(choose(updrsound));
this.bought = 1;
if (this.buyFunction) this.buyFunction();
Game.upgradesToRebuild = 1;
Game.recalculateGains = 1;
Game.UpgradesOwned++;
}
}
}
/**
* Cheating only
* @returns {void}
*/
this.toggle = function ()//cheating only
{
if (!this.bought) {
this.bought = 1;
if (this.buyFunction) this.buyFunction();
Game.upgradesToRebuild = 1;
Game.recalculateGains = 1;
Game.UpgradesOwned++;
}
else {
this.bought = 0;
Game.upgradesToRebuild = 1;
Game.recalculateGains = 1;
Game.UpgradesOwned--;
}
Game.UpdateMenu();
}
/**
* Updates localization for Upgrade
* @returns {void}
*/
this.UpdateLocale = function () {
this.displayName = Localization.GetText(name);
this.desc = Localization.GetText(desc);
}
Game.Upgrades[this.name] = this;
Game.UpgradesById[this.id] = this;
Game.UpgradesN++;
return this;
}
/**
* Unlocks the Upgrade
* @param {string} what Upgrade name
* @returns {void}
*/
Game.Unlock = function (what) {
if (typeof what === 'string') {
if (Game.Upgrades[what]) {
if (Game.Upgrades[what].unlocked == 0) {
Game.Upgrades[what].unlocked = 1;
Game.upgradesToRebuild = 1;
Game.recalculateGains = 1;
}
}
}
else { for (var i in what) { Game.Unlock(what[i]); } }
}
/**
* Locks the Upgrade
* @param {string} what Upgrade name
* @returns {void}
*/
Game.Lock = function (what) {
if (typeof what === 'string') {
if (Game.Upgrades[what]) {
Game.Upgrades[what].unlocked = 0;
Game.Upgrades[what].bought = 0;
Game.upgradesToRebuild = 1;
if (Game.Upgrades[what].bought == 1) {
Game.UpgradesOwned--;
}
Game.recalculateGains = 1;
}
}
else { for (var i in what) { Game.Lock(what[i]); } }
}
/**
* Returns ownes the Upgrade
* @param {any} what
* @returns {boolean}
*/
Game.Has = function (what) {
return (Game.Upgrades[what] ? Game.Upgrades[what].bought : 0);
}
/**
* Recalculates upgrades
* @returns {void}
*/
Game.RebuildUpgrades = function ()//recalculate the upgrades you can buy
{
Game.upgradesToRebuild = 0;
var list = [];
for (var i in Game.Upgrades) {
var me = Game.Upgrades[i];
if (!me.bought) {
if (me.unlocked) list.push(me);
}
}
var sortMap = function (a, b) {
if (a.basePrice > b.basePrice) return 1;
else if (a.basePrice < b.basePrice) return -1;
else return 0;
}
list.sort(sortMap);
Game.UpgradesInStore = [];
for (var i in list) {
Game.UpgradesInStore.push(list[i]);
}
var str = '';
for (var i in Game.UpgradesInStore) {
//if (!Game.UpgradesInStore[i]) break;
var me = Game.UpgradesInStore[i];
if (typeof(me.icon) != 'string') {
if (me.hide != 1) {
str += '<div class="crate upgrade" ' + Game.getTooltip(
//'<b>'+me.displayName+'</b>'+me.desc
'<div style="min-width:200px;"><div style="float:right;"><span class="price">' + Beautify(Math.round(me.getPrice())) + '</span></div><small>[Upgrade]</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 'store') + ' ' + Game.clickStr + '="Game.UpgradesById[' + me.id + '].buy();" id="upgrade' + i + '" style="' + (me.icon[2] ? 'background-image:url(' + me.icon[2] + ');' : '') + 'background-position:' + (-me.icon[0] * 48 + 6) + 'px ' + (-me.icon[1] * 48 + 6) + 'px;"></div>';
} else {
str += '<div class="crate upgrade" ' + Game.getTooltip(
//'<b>'+me.displayName+'</b>'+me.desc
'<div style="min-width:200px;"><div style="float:right;"><span class="price">' + Beautify(Math.round(me.getPrice())) + '</span></div><small>[Upgrade]</small><small style="color: #00deff">[Heavenly]</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 'store') + ' ' + Game.clickStr + '="Game.UpgradesById[' + me.id + '].buy();" id="upgrade' + i + '" style="' + (me.icon[2] ? 'background-image:url(' + me.icon[2] + ');' : '') + 'background-position:' + (-me.icon[0] * 48 + 6) + 'px ' + (-me.icon[1] * 48 + 6) + 'px;"></div>';
}
} else {
if (me.hide != 1) {
str += '<div class="crate upgrade" ' + Game.getTooltip(
//'<b>'+me.displayName+'</b>'+me.desc
'<div style="min-width:200px;"><div style="float:right;"><span class="price">' + Beautify(Math.round(me.getPrice())) + '</span></div><small>[Upgrade]</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 'store') + ' ' + Game.clickStr + '="Game.UpgradesById[' + me.id + '].buy();" id="upgrade' + i + '" style="background-image: url(\''+me.icon+'\'); background-position:' + 7 + 'px ' + 7 + 'px;"></div>';
} else {
str += '<div class="crate upgrade" ' + Game.getTooltip(
//'<b>'+me.displayName+'</b>'+me.desc
'<div style="min-width:200px;"><div style="float:right;"><span class="price">' + Beautify(Math.round(me.getPrice())) + '</span></div><small>[Upgrade]</small><small style="color: #00deff">[Heavenly]</small><div class="name">' + me.displayName + '</div><div class="description">' + me.desc + '</div></div>'
, 'store') + ' ' + Game.clickStr + '="Game.UpgradesById[' + me.id + '].buy();" id="upgrade' + i + '" style="background-image: url(\''+me.icon+'\'); background-position:' + 7 + 'px ' + 7 + 'px;"></div>';
}
}
}
l('upgrades').innerHTML = str;
}
var tier1 = 10;
var tier2 = 100;
var tier3 = 1000;
var tier4 = 10000;
var type = '';
var power = 0;
//define upgrades
//WARNING : do NOT add new upgrades in between, this breaks the saves. Add them at the end !
var order = 100;//this is used to set the order in which the items are listed
new Game.Upgrade('#Upgrade_ReinforcedIndexFinger', '#Upgrade_ReinforcedIndexFingerDesc', 100, [0, 0]);
new Game.Upgrade('#Upgrade_CarpalTunnelPreventionCream', 'The mouse and cursors are <b>twice</b> as efficient.<q>My hand hurts.</q>', 400, [0, 0]);
new Game.Upgrade('#Upgrade_Ambidextrous', '#Upgrade_AmbidextrousDesc', 10000, [0, 6]);
new Game.Upgrade('#Upgrade_ThousandFingers', '#Upgrade_ThousandFingersDesc', 500000, [0, 6]);
new Game.Upgrade('#Upgrade_MillionFingers', '#Upgrade_MillionFingersDesc', 50000000, [1, 6]);
new Game.Upgrade('#Upgrade_BillionFingers', '#Upgrade_BillionFingersDesc', 500000000, [2, 6]);
new Game.Upgrade('#Upgrade_TrillionFingers', '#Upgrade_TrillionFingersDesc', 5000000000, [3, 6]);
order = 200;
new Game.Upgrade('#Upgrade_EMailFromBaker', '#Upgrade_EMailFromBakerDesc', Game.Objects['#Building_Baker'].basePrice * tier1, [1, 0]);
new Game.Upgrade('#Upgrade_SteelPlatedPins', '#Upgrade_SteelPlatedPinsDesc', Game.Objects['#Building_Baker'].basePrice * tier2, [1, 0]);
new Game.Upgrade('#Upgrade_NewDough', '#Upgrade_NewDoughDesc', Game.Objects['#Building_Baker'].basePrice * tier3, [1, 1]);
order = 300;
new Game.Upgrade('#Upgrade_SpareParts', '#Upgrade_SparePartsDesc', Game.Objects['#Building_RobotBaker'].basePrice * tier1, [2, 0]);
new Game.Upgrade('#Upgrade_AI', '#Upgrade_AIDesc', Game.Objects['#Building_RobotBaker'].basePrice * tier2, [2, 0]);
new Game.Upgrade('#Upgrade_ImprovedConnection', '#Upgrade_ImprovedConnectionDesc', Game.Objects['#Building_RobotBaker'].basePrice * tier3, [2, 1]);
order = 400;
new Game.Upgrade('#Upgrade_NewFuel', '#Upgrade_NewFuelDesc', Game.Objects['#Building_TechnoFurnace'].basePrice * tier1, [4, 0]);
new Game.Upgrade('#Upgrade_IncreasedVoltage', '#Upgrade_IncreasedVoltageDesc', Game.Objects['#Building_TechnoFurnace'].basePrice * tier2, [4, 0]);
new Game.Upgrade('#Upgrade_UpdatedFurnaceMaterial', '#Upgrade_UpdatedFurnaceMaterialDesc', Game.Objects['#Building_TechnoFurnace'].basePrice * tier3, [4, 1]);
order = 500;
new Game.Upgrade('#Upgrade_ProductionOver9000', '#Upgrade_ProductionOver9000Desc', Game.Objects['#Building_CFactory'].basePrice * tier1, [3, 0]);
//new Game.Upgrade('Megadrill','C-Factorys are <b>twice</b> as efficient.',Game.Objects['#Building_CFactory'].basePrice*tier2,[3,0]);
//new Game.Upgrade('Ultradrill','C-Factorys are <b>twice</b> as efficient.',Game.Objects['#Building_CFactory'].basePrice*tier3,[3,1]);
order = 600;
new Game.Upgrade('#Upgrade_MolecularPhysics', '#Upgrade_MolecularPhysicsDesc', Game.Objects['#Building_AtomicCupcake'].basePrice * tier1, [5, 0]);
new Game.Upgrade('#Upgrade_NewTechnology', '#Upgrade_NewTechnologyDesc', Game.Objects['#Building_AtomicCupcake'].basePrice * tier2, [5, 0]);
//new Game.Upgrade('Frequent flyer','Atomic Cupcakes are <b>twice</b> as efficient.<q>Come back soon!</q>',Game.Objects['#Building_AtomicCupcake'].basePrice*tier3,[5,1]);
order = 700;
new Game.Upgrade('#Upgrade_Antimony', '#Upgrade_AntimonyDesc', Game.Objects['#Building_AlchemyLab'].basePrice * tier1, [6, 0]);
new Game.Upgrade('#Upgrade_EssenceOfDough', '#Upgrade_EssenceOfDoughDesc', Game.Objects['#Building_AlchemyLab'].basePrice * tier2, [6, 0]);
//new Game.Upgrade('True chocolate','Alchemy labs are <b>twice</b> as efficient.<q>The purest form of cacao.</q>',Game.Objects['#Building_AlchemyLab'].basePrice*tier3,[6,1]);
order = 800;
new Game.Upgrade('#Upgrade_NewCivilization', '#Upgrade_NewCivilizationDesc', Game.Objects['#Building_CupPlanet'].basePrice * tier1, [24, 3]);
/*new Game.Upgrade('Insane oatling workers','Portals are <b>twice</b> as efficient.<q>ARISE, MY MINIONS!</q>',Game.Objects['#Building_Portal'].basePrice*tier2,[7,0]);
new Game.Upgrade('Soul bond','Portals are <b>twice</b> as efficient.<q>So I just sign up and get more cupcakes? Sure, whatever!</q>',Game.Objects['#Building_Portal'].basePrice*tier3,[7,1]);
order=900;
new Game.Upgrade('Flux capacitors','Time machines gain <b>+9,876</b> base CpS.<q>Bake to the future.</q>',1234567890,[8,0]);
new Game.Upgrade('Time paradox resolver','Time machines are <b>twice</b> as efficient.<q>No more fooling around with your own grandmother!</q>',9876543210,[8,0]);
new Game.Upgrade('Quantum conundrum','Time machines are <b>twice</b> as efficient.<q>It\'s full of stars!</q>',98765456789,[8,1]);*/
order = 1000;
new Game.Upgrade('#Upgrade_FastProcessing', '#Upgrade_FastProcessingDesc', 1999999999, [11, 3]);
new Game.Upgrade('#Upgrade_CyberNet', '#Upgrade_CyberNetDesc', 399999999999, [12, 3]);
new Game.Upgrade('#Upgrade_CyberBakers', '#Upgrade_CyberBakersDesc', 5999999999, [13, 3]);
order = 1300;
new Game.Upgrade('#Upgrade_NewWorlds', '#Upgrade_NewWorldsDesc', 30000000000, [13, 0]);
new Game.Upgrade('#Upgrade_QuantumTransfer', '#Upgrade_QuantumTransferDesc', 100000000000, [13, 1]);
order = 1400;
new Game.Upgrade('#Upgrade_NewDiscoveries', '#Upgrade_NewDiscoveriesDesc', 300000000000, [0, 4]);
new Game.Upgrade('#Upgrade_StabilizationTechnology', '#Upgrade_StabilizationTechnologyDesc', 400000000000, [1, 4]);
/*order=20000;
new Game.Upgrade('Cupcake helpers','You gain <b>more CpS</b> the more coffee you have.<q>may I help you</q>',9000000,[1,7]);
new Game.Upgrade('Cupcake workers','You gain <b>more CpS</b> the more coffee you have.<q>Can I work in your company?</q>',9000000000,[2,7]);*/
/*order=10000;
type='cupcake';power=5;
new Game.Upgrade('Oatmeal raisin cupcakes','cupcake production multiplier <b>+5%</b>.<q>No raisin to hate these.</q>',99999999,[0,3]);
new Game.Upgrade('Peanut butter cupcakes','cupcake production multiplier <b>+5%</b>.',99999999,[1,3]);
new Game.Upgrade('Plain cupcakes','cupcake production multiplier <b>+5%</b>.<q>Meh.</q>',99999999,[2,3]);
new Game.Upgrade('Coconut cupcakes','cupcake production multiplier <b>+5%</b>.',999999999,[3,3]);
new Game.Upgrade('White chocolate cupcakes','cupcake production multiplier <b>+5%</b>.',999999999,[4,3]);
new Game.Upgrade('Macadamia nut cupcakes','cupcake production multiplier <b>+5%</b>.',999999999,[5,3]);
power=10;new Game.Upgrade('Double-chip cupcakes','cupcake production multiplier <b>+10%</b>.',99999999999,[6,3]);
power=5;new Game.Upgrade('Sugar cupcakes','cupcake production multiplier <b>+5%</b>.',99999999,[7,3]);
power=10;new Game.Upgrade('White chocolate macadamia nut cupcakes','cupcake production multiplier <b>+10%</b>.',99999999999,[8,3]);
new Game.Upgrade('All-chocolate cupcakes','cupcake production multiplier <b>+10%</b>.',99999999999,[9,3]);
type='';power=0;*/
order = 100;
new Game.Upgrade('#Upgrade_QuadrillionFingers', '#Upgrade_QuadrillionFingersDesc', 50000000000, [3, 6]);
order = 200; new Game.Upgrade('#Upgrade_PruneJuice', '#Upgrade_PruneJuiceDesc', Game.Objects['#Building_Baker'].basePrice * tier4, [1, 2]);
order = 300; new Game.Upgrade('#Upgrade_GeneticallyModifiedCupcakes', '#Upgrade_GeneticallyModifiedCupcakesDesc', Game.Objects['#Building_RobotBaker'].basePrice * tier4, [2, 2]);
order = 400; new Game.Upgrade('#Upgrade_RadiumReactors', '#Upgrade_RadiumReactorsDesc', Game.Objects['#Building_TechnoFurnace'].basePrice * tier4, [4, 2]);
//order=500;new Game.Upgrade('Ultimadrill','C-Factorys are <b>twice</b> as efficient.<q>Pierce the heavens, etc.</q>',Game.Objects['#Building_CFactory'].basePrice*tier4,[3,2]);
/*order=600;new Game.Upgrade('Warp drive','Atomic Cupcakes are <b>twice</b> as efficient.<q>Shifting over to warp drive</q>',Game.Objects['#Building_AtomicCupcake'].basePrice*tier4,[5,2]);
order=700;new Game.Upgrade('Ambrosia','Alchemy labs are <b>twice</b> as efficient.',Game.Objects['#Building_AlchemyLab'].basePrice*tier4,[6,2]);
order=800;new Game.Upgrade('Sanity dance','Portals are <b>twice</b> as efficient.<q>We can change if we want to.<br>We can leave our brains behind.</q>',Game.Objects['#Building_Portal'].basePrice*tier4,[7,2]);
order=900;new Game.Upgrade('Causality enforcer','Time machines are <b>twice</b> as efficient.<q>What happened, happened.</q>',1234567890000,[8,2]);*/
order = 5000;
new Game.Upgrade('#Upgrade_LuckyDay', '#Upgrade_LuckyDayDesc', 777777777, [10, 0]);
new Game.Upgrade('#Upgrade_Serendipity', '#Upgrade_SerendipityDesc', 77777777777, [10, 1]);
order = 20000;
new Game.Upgrade('#Upgrade_CupcakeEngineers', '#Upgrade_CupcakeEngineersDesc', 9000000000000, [3, 7]);
order = 32100;
new Game.Upgrade('#Upgrade_ResearchCenters', '#Upgrade_ResearchCentersDesc', 50000000, [3, 4]);
/*order=10000;
type='cupcake';power=15;
new Game.Upgrade('Dark chocolate-coated cupcakes','cupcake production multiplier <b>+15%</b>.',999999999999,[10,3]);
new Game.Upgrade('White chocolate-coated cupcakes','cupcake production multiplier <b>+15%</b>.',999999999999,[11,3]);
type='';power=0;*/
/*order=250;
new Game.Upgrade('#Upgrade_FarmerBakers','bakers are <b>twice</b> as efficient.<q>A nice baker to farm more cupcakes.</q>',Game.Objects['#Building_RobotBaker'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});
new Game.Upgrade('#Upgrade_WorkerBakers','bakers are <b>twice</b> as efficient.<q>A nice baker to manufacture more cupcakes.</q>',Game.Objects['#Building_TechnoFurnace'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});*/
//new Game.Upgrade('#Upgrade_CFactoryrBakers','bakers are <b>twice</b> as efficient.<q>A nice baker to C-Factory more cupcakes.</q>',Game.Objects['#Building_CFactory'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});
//new Game.Upgrade('#Upgrade_CosmicBakers','bakers are <b>twice</b> as efficient.<q>A nice baker to transport cupcakes from the cupcake planet</q>',Game.Objects['#Building_AtomicCupcake'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});
//new Game.Upgrade('#Upgrade_TransmutedBakers','bakers are <b>twice</b> as efficient.<q>A nice baker to transmute more cupcakes.</q>',Game.Objects['#Building_AlchemyLab'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});
//new Game.Upgrade('#Upgrade_AlteredBakers','bakers are <b>twice</b> as efficient.<q>A nIcE baker To SpAwN iN mOrE cupcakes.</q>',Game.Objects['#Building_Portal'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});
//new Game.Upgrade('#Upgrade_bakersBakers','bakers are <b>twice</b> as efficient.<q>A nice baker to bring in cupcakes from the past.</q>',Game.Objects['Time machine'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});
/*order=15000;
Game.baseResearchTime=Game.fps*60*30;
Game.SetResearch=function(what,time)
{
if (Game.Upgrades[what])
{
Game.researchT=Game.Has('Ultrascience')?Game.fps*5:Game.baseResearchTime;
Game.nextResearch=Game.Upgrades[what].id;
Game.Popup('Research has begun.');
}
}
new Game.Upgrade('#Upgrade_BingoCenterResearchFacility','baker-operated science lab and leisure club.<br>bakers are <b>4 times</b> as efficient.<br><b>Regularly unlocks new upgrades</b>.',100000000000,[11,9],function(){Game.SetResearch('#Upgrade_SpecializedChocolateChips');});
new Game.Upgrade('#Upgrade_SpecializedChocolateChips','[Research]<br>cupcake production multiplier <b>+1%</b>.<q>Computer-generated chocolate chips. Computer chips, if you will.</q>',10000000000,[0,9],function(){Game.SetResearch('#Upgrade_DesignerCocoaBeans');});
new Game.Upgrade('#Upgrade_DesignerCocoaBeans','[Research]<br>cupcake production multiplier <b>+2%</b>.<q>Now more aerodynamic than ever!</q>',20000000000,[1,9],function(){Game.SetResearch('#Upgrade_RitualRollingPins');});
new Game.Upgrade('#Upgrade_RitualRollingPins','[Research]<br>bakers are <b>twice</b> as efficient.<q>The result of years of scientific research!</q>',40000000000,[2,9],function(){Game.SetResearch('#Upgrade_UnderworldOvens');});
new Game.Upgrade('#Upgrade_UnderworldOvens','[Research]<br>cupcake production multiplier <b>+3%</b>.<q>Powered by science, of course!</q>',80000000000,[3,9],function(){Game.SetResearch('#Upgrade_OneMind');});
new Game.Upgrade('#Upgrade_OneMind','[Research]<br>Each baker gains <b>+1 base CpS for each 50 bakers</b>.<div class="warning">Note : the grandmothers are growing restless. Do not encourage them.</div><q>We are one. We are many.</q>',160000000000,[4,9],function(){Game.elderWrath=1;Game.SetResearch('#Upgrade_ExoticNuts');});
Game.Upgrades['#Upgrade_OneMind'].clickFunction=function(){return confirm('Warning : purchasing this will have unexpected, and potentially undesirable results!\nIt\'s all downhill from here. You have been warned!\nPurchase anyway?');};
new Game.Upgrade('#Upgrade_ExoticNuts','[Research]<br>cupcake production multiplier <b>+4%</b>.<q>You\'ll go crazy over these!</q>',320000000000,[5,9],function(){Game.SetResearch('#Upgrade_CommunalBrainsweep');});
new Game.Upgrade('#Upgrade_CommunalBrainsweep','[Research]<br>Each baker gains another <b>+1 base CpS for each 50 bakers</b>.<div class="warning">Note : proceeding any further in scientific research may have unexpected results. You have been warned.</div><q>We fuse. We merge. We grow.</q>',640000000000,[6,9],function(){Game.elderWrath=2;Game.SetResearch('#Upgrade_ArcaneSugar');});
new Game.Upgrade('#Upgrade_ArcaneSugar','[Research]<br>cupcake production multiplier <b>+5%</b>.<q>Tastes like insects, ligaments, and molasses.</q>',1280000000000,[7,9],function(){Game.SetResearch('#Upgrade_ElderPact');});
new Game.Upgrade('#Upgrade_ElderPact','[Research]<br>Each baker gains <b>+1 base CpS for each 20 portals</b>.<div class="warning">Note : this is a bad idea.</div><q>squirm crawl slither writhe<br>today we rise</q>',2560000000000,[8,9],function(){Game.elderWrath=3;});
new Game.Upgrade('#Achievement_ElderPledge','[Repeatable]<br>Contains the wrath of the elders, at least for a while.',1,[9,9],function()
{
Game.elderWrath=0;
Game.pledges++;
Game.pledgeT=Game.fps*60*(Game.Has('#Upgrade_SacrificialRollingPins')?60:30);
Game.Upgrades['#Achievement_ElderPledge'].basePrice=Math.pow(8,Math.min(Game.pledges+2,13));
Game.Unlock('#Upgrade_ElderCovenant');
});
Game.Upgrades['#Achievement_ElderPledge'].hide=3;*/
order = 150;
new Game.Upgrade('#Upgrade_PlasticMouse', '#Upgrade_PlasticMouseDesc', 50000, [11, 0]);
new Game.Upgrade('#Upgrade_IronMouse', '#Upgrade_IronMouseDesc', 5000000, [11, 0]);
new Game.Upgrade('#Upgrade_TitaniumMouse', '#Upgrade_TitaniumMouseDesc', 500000000, [11, 1]);
new Game.Upgrade('#Upgrade_AdamantiumMouse', '#Upgrade_AdamantiumMouseDesc', 50000000000, [11, 2]);
new Game.Upgrade('#Upgrade_VibraniumMouse', '#Upgrade_VibraniumMouseDesc', 500000000000, [8, 4]);
order = 1150;
new Game.Upgrade('#Upgrade_LemonFlavoredCupcake', '#Upgrade_LemonFlavoredCupcakeDesc', 1234567, [23, 3]);
order = 1250;
new Game.Upgrade('#Upgrade_CyanCupcake', '#Upgrade_CyanCupcakeDesc', 19191919, [22, 3]);
/*order=210;
type='cupcake';power=10;
//new Game.Upgrade('Eclipse cupcakes','cupcake production multiplier <b>+15%</b>.<q>Look to the cupcake.</q>',9999999999999,[0,4]);
//new Game.Upgrade('Zebra cupcakes','cupcake production multiplier <b>+15%</b>.',9999999999999,[1,4]);
type='';power=0;*/
order = 100;
new Game.Upgrade('#Upgrade_QuintillionFingers', '#Upgrade_QuintillionFingersDesc', 50000000000000, [3, 6]);
order = 40000;
new Game.Upgrade('#Upgrade_GoldHoard', '#Upgrade_GoldHoardDesc', 7, [10, 1]);//debug purposes only
Game.Upgrades['#Upgrade_GoldHoard'].hide = 3;
order = 10000;
new Game.Upgrade('#Upgrade_BlackberryCupcake', '#Upgrade_BlackberryCupcakeDesc', 999999999, [7, 3]);
order = 10500;
new Game.Upgrade('#Upgrade_SatanicRitual', '#Upgrade_SatanicRitualDesc', 900000000000, [9, 4]);
order = 10500;
new Game.Upgrade('#Upgrade_MonosodiumGlutamate', '#Upgrade_MonosodiumGlutamateDesc', 99999999999, [2, 4]);
order = 10600;
new Game.Upgrade('#Upgrade_SNUSBattery', '#Upgrade_SNUSBatteryDesc', 59999999999, [11, 4]);
order=10650;
new Game.Upgrade('#Upgrade_OrangeCupcake', '#Upgrade_OrangeCupcakeDesc', 50000000, [9, 13]);
order = 15000;
new Game.Upgrade('#Upgrade_ElderCovenant', '#Upgrade_ElderCovenantDesc', 6666666666666, [8, 9], function () {
Game.pledgeT = 0;
Game.Lock('Upgrade_RevokeElderCovenant');
Game.Unlock('Upgrade_RevokeElderCovenant');
Game.Lock('#Achievement_ElderPledge');
Game.Win('#Upgrade_ElderCalm');
});
Game.Upgrades['#Upgrade_ElderCovenant'].hide = 3;
new Game.Upgrade('#Upgrade_RevokeElderCovenant', '#Upgrade_RevokeElderCovenantDesc', 6666666666, [8, 9], function () {
Game.Lock('#Upgrade_ElderCovenant');
Game.Unlock('#Upgrade_ElderCovenant');
});
Game.Upgrades['#Upgrade_RevokeElderCovenant'].hide = 3;
order = 5000;
new Game.Upgrade('#Upgrade_GetLucky', '#Upgrade_GetLuckyDesc', 77777777777777, [10, 2]);
order = 15000;
new Game.Upgrade('#Upgrade_SacrificialRollingPins', '#Upgrade_SacrificialRollingPinsDesc', 2888888888888, [2, 9]);
/*/order=10000;
type='cupcake';power=15;
new Game.Upgrade('Snickerdoodles','Cupcake production multiplier <b>+15%</b>.',99999999999999,[2,4]);
new Game.Upgrade('Stroopwafels','Cupcake production multiplier <b>+15%</b>.<q>If it ain\'t dutch, it ain\'t much.</q>',99999999999999,[3,4]);
new Game.Upgrade('Macaroons','Cupcake production multiplier <b>+15%</b>.',99999999999999,[4,4]);
type='';power=0;*/
// order = 40000;
// new Game.Upgrade('#Upgrade_Neuromancy', '#Upgrade_NeuromancyDesc', 7, [4, 9]);//debug purposes only
// Game.Upgrades['#Upgrade_Neuromancy'].hide = 3;
/*order=10000;
type='cupcake';power=15;
/*new Game.Upgrade('Empire biscuits','cupcake production multiplier <b>+15%</b>.',99999999999999,[5,4]);
new Game.Upgrade('British tea biscuits','cupcake production multiplier <b>+15%</b>.',99999999999999,[6,4]);
new Game.Upgrade('Chocolate british tea biscuits','cupcake production multiplier <b>+15%</b>.',99999999999999,[7,4]);
new Game.Upgrade('Round british tea biscuits','cupcake production multiplier <b>+15%</b>.',99999999999999,[8,4]);
new Game.Upgrade('Round chocolate british tea biscuits','cupcake production multiplier <b>+15%</b>.',99999999999999,[9,4]);
new Game.Upgrade('Round british tea biscuits with heart motif','cupcake production multiplier <b>+15%</b>.',99999999999999,[10,4]);
new Game.Upgrade('Round chocolate british tea biscuits with heart motif','cupcake production multiplier <b>+15%</b>.<q>Quite.</q>',99999999999999,[11,4]);
type='';power=0;*/
/*order=1000;
new Game.Upgrade('Sugar bosons','Antimatter condensers gain <b>+99,999</b> base CpS.',Game.Objects['Antimatter condenser'].basePrice*tier1,[13,0]);
new Game.Upgrade('String theory','Antimatter condensers are <b>twice</b> as efficient.',Game.Objects['Antimatter condenser'].basePrice*tier2,[13,0]);
new Game.Upgrade('Large macaron collider','Antimatter condensers are <b>twice</b> as efficient.<q>How singular!</q>',Game.Objects['Antimatter condenser'].basePrice*tier3,[13,1]);
new Game.Upgrade('Big bang bake','Antimatter condensers are <b>twice</b> as efficient.<q>And that\'s how it all began.</q>',Game.Objects['Antimatter condenser'].basePrice*tier4,[13,2]);*/
order = 250;
//new Game.Upgrade('#Upgrade_Antibakers','bakers are <b>twice</b> as efficient.',Game.Objects['Antimatter condenser'].basePrice*tier2,[10,9],function(){Game.Objects['#Building_Baker'].drawFunction();});
/*order=10000;
type='cupcake';power=20;
//new Game.Upgrade('Madeleines','cupcake production multiplier <b>+20%</b>.<q>Unforgettable!</q>',199999999999999,[12,3]);
new Game.Upgrade('Palmiers','Cupcake production multiplier <b>+20%</b>.',199999999999999,[13,3]);
//new Game.Upgrade('Palets','cupcake production multiplier <b>+20%</b>.',199999999999999,[12,4]);
new Game.Upgrade('Sablés','Cupcake production multiplier <b>+20%</b>.',199999999999999,[13,4]);
type='';power=0;*/
order = 20000;
new Game.Upgrade('#Upgrade_CupcakeOverseers', '#Upgrade_CupcakeOverseersDesc', 900000000000000, [8, 7]);
order = 32200;
new Game.Upgrade('#Upgrade_NewHorizons', '#Upgrade_NewHorizonsDesc', 300000000000, [15, 4]);
order = 32300;
new Game.Upgrade('#Upgrade_TernaryCode', '#Upgrade_TernaryCodeDesc', 250000000000, [16, 4]);
order = 32400;
new Game.Upgrade('#Upgrade_FasterGenerators', '#Upgrade_FasterGeneratorsDesc', 800000000000, [17, 4]);
type = 'multip'; power = 50;
order = 32500;
new Game.Upgrade('#Upgrade_Galactus', '#Upgrade_GalactusDesc', 1500000000000, [19, 10]);
order = 32600;
new Game.Upgrade('#Upgrade_SellingMedia', '#Upgrade_SellingMediaDesc', 255000000000, [15, 9]);
type = ''; power = 0;
order = 32700;
new Game.Upgrade('#Upgrade_CupcakeStringTheoryBasedDimensions', '#Upgrade_CupcakeStringTheoryBasedDimensionsDesc', 1000000000000, [18, 4]);
order = 32800;
new Game.Upgrade('#Upgrade_CupcakeGPT', '#Upgrade_CupcakeGPTDesc', 1000000000000, [19, 4]);
order = 32900;
new Game.Upgrade('#Upgrade_SpecialCupcakePhysics', '#Upgrade_SpecialCupcakePhysicsGPTDesc', 1000000000000, [20, 4]);
order = 33000;
new Game.Upgrade('#Upgrade_AdvancedOrganicChemistryTheory', '#Upgrade_AdvancedOrganicChemistryTheoryDesc', Game.Objects['#Building_CloneMachine'].basePrice, [6, 9]);
order = 33100;
new Game.Upgrade('#Upgrade_NowFrom4815162342Grams', '#Upgrade_NowFrom4815162342GramsDesc', Game.Objects['#Building_CloneMachine'].basePrice * tier1 * 4, [17, 12]);
order = 33200;
new Game.Upgrade('#Upgrade_FabergeAccuracyMechanisms', '#Upgrade_FabergeAccuracyMechanismsDesc', Game.Objects['#Building_CloneMachine'].basePrice * tier3 / 2, [14, 12]);
type = 'multip'; power = 65;
order = 33300;
new Game.Upgrade('#Upgrade_ChemicalAdditiveGamma2', '#Upgrade_ChemicalAdditiveGamma2Desc', 300000000000, [5, 12]);
type = ''; power = 0;
order = 33400;
new Game.Upgrade('#Upgrade_SalaryIncrease', '#Upgrade_SalaryIncreaseDesc', 10500000000, [14, 10]);
order = 33500;
new Game.Upgrade('#Upgrade_ImprovedRobots', '#Upgrade_ImprovedRobotsDesc', Game.Objects['#Building_RobotComplex'].basePrice * tier1, [15, 10]);
order = 33600;
new Game.Upgrade('#Upgrade_ImprovedControlSystem', '#Upgrade_ImprovedControlSystemDesc', Game.Objects['#Building_RobotComplex'].basePrice * tier1 + 200000000000, [16, 10]);
type='multip'; power = 75;
order = 33700;
new Game.Upgrade('#Upgrade_NewInvestments', '#Upgrade_NewInvestmentsDesc', 500000000000, [14, 8]);
type=''; power=0;
order=33800;
new Game.Upgrade('#Upgrade_CyberSlavery', '#Upgrade_CyberSlaveryDesc', Game.Objects['#Building_RobotComplex'].basePrice * tier1 + 300000000000, [17, 10]);
order=33900;
new Game.Upgrade('#Upgrade_LaborUnion', '#Upgrade_LaborUnionDesc', Game.Objects['#Building_Baker'].basePrice * tier1 + 10000000, [18, 10]);
order=34000;
type='multip'; power = 75;
new Game.Upgrade('#Upgrade_StrawberryCupcake', '#Upgrade_StrawberryCupcakeDesc', 20000000, [5, 16]);
type=''; power=0;
order=34100;
type='multip'; power = 200;
new Game.Upgrade('#Upgrade_CosmicCupcake', '#Upgrade_CosmicCupcakeDesc', 10000000000, [6, 16]);
type=''; power=0;
order=34200;
type='multip'; power = 150;
new Game.Upgrade('#Upgrade_CurrantCupcake', '#Upgrade_CurrantCupcakeDesc', 10500000000, [6, 15]);
type=''; power=0;
order=34300;
type='multip'; power = 150;
new Game.Upgrade('#Upgrade_RaspberryCupcake', '#Upgrade_RaspberryCupcakeDesc', 11000000000, [3, 15]);
type=''; power=0;
order=34400;
type='multip'; power = 100;
new Game.Upgrade('#Upgrade_VanillaCupcake', '#Upgrade_VanillaCupcakeDesc', 25000000000, [2, 16]);
new Game.Upgrade('#Upgrade_StarCupcake', '#Upgrade_StarCupcakeDesc', 30000000000, [1, 16]);
type=''; power=0;
order=34500;
type='multip'; power = 70;
new Game.Upgrade('#Upgrade_Marshmallow', '#Upgrade_MarshmallowDesc', 26000000000, [0, 12]);
type=''; power=0;
order=34600;
type='multip'; power = 70;
new Game.Upgrade('#Upgrade_FractalCookie', "#Upgrade_FractalCookieDesc", 35000000000, [1, 12]);
type=''; power=0;
order=34600;
type='multip'; power = 70;
new Game.Upgrade('#Upgrade_ChocolateCupcake', "#Upgrade_ChocolateCupcakeDesc", 30000000000, [0, 15]);
type=''; power=0;
order=34700;
new Game.Upgrade('#Upgrade_SatanicCupcake', "#Upgrade_SatanicCupcakeDesc", 60000000000, [0, 14]);
order=34800;
new Game.Upgrade('#Upgrade_MusicCupcake', "#Upgrade_MusicCupcakeDesc", 80000000000, [1, 14]);
order=34800;
new Game.Upgrade('#Upgrade_IndustrialCupcake', "#Upgrade_IndustrialCupcakeDesc", 100000000000, [2, 14]);
order=34900;
new Game.Upgrade('#Upgrade_BinaryCupcake', "#Upgrade_BinaryCupcakeDesc", 120000000000, [3, 14]);
order=35000;
new Game.Upgrade('#Upgrade_EnergyCupcake', '#Upgrade_EnergyCupcakeDesc', 130000000000, [1, 13]);
order=35100;
new Game.Upgrade('#Upgrade_BlackHoleCupcake', '#Upgrade_BlackHoleCupcakeDesc', 140000000000, [2, 13]);
order=35200;
new Game.Upgrade('#Upgrade_FrostCupcake', '#Upgrade_FrostCupcakeDesc', 150000000000, [3, 13]);
order=35300;
new Game.Upgrade('#Upgrade_CursorCupcake', '#Upgrade_CursorCupcakeDesc', 160000000000, [7, 13]);
order=35400;
new Game.Upgrade('#Upgrade_LimeCupcake', '#Upgrade_LimeCupcakeDesc', 170000000000, [6, 14]);
order=35500;
new Game.Upgrade('#Upgrade_BritishCupcake', '#Upgrade_BritishCupcakeDesc', 180000000000, [8, 13]);
order=35600;
new Game.Upgrade('#Upgrade_AstronomyCupcake', '#Upgrade_AstronomyCupcakeDesc', 90000000000, [10, 13]);
order=35700;
new Game.Upgrade('#Upgrade_AtomicCupcake', '#Upgrade_AtomicCupcakeDesc', 200000000, [12, 13]);
new Game.Upgrade('#Upgrade_QuantumUncertaintyCupcake', '#Upgrade_QuantumUncertaintyCupcakeDesc', 65000000000, [11, 13]);
new Game.Upgrade('#Upgrade_DieselpunkCupcake', '#Upgrade_DieselpunkCupcakeDesc', 70000000000, [13, 13]);
order=35800;
new Game.Upgrade('#Upgrade_CloudNineBoost', '#Upgrade_CloudNineBoostDesc', 1_000_000, [13, 14], 1);
new Game.Upgrade('#Upgrade_HeavenlyHands', '#Upgrade_HeavenlyHandsDesc', 100_000_000, [14, 14], 1);
new Game.Upgrade('#Upgrade_DivineDeliverySystem', '#Upgrade_DivineDeliverySystemDesc', 1_000_000_000, [14, 13], 1);
order=35900;
new Game.Upgrade('#Upgrade_FoodScience', '#Upgrade_FoodScienceDesc', 570_000_000, [15, 13]);
new Game.Upgrade('#Upgrade_RoboticsUpgrade', '#Upgrade_RoboticsUpgradeDesc', 590_000_000, [16, 13]);
new Game.Upgrade('#Upgrade_SyntheticBiology', '#Upgrade_SyntheticBiologyDesc', 610_000_000, [17, 13]);
order=36000;
new Game.Upgrade('#Upgrade_BakingMastery', '#Upgrade_BakingMasteryDesc', 620_000_000, [15, 14]);
new Game.Upgrade('#Upgrade_FrostingInnovation', '#Upgrade_FrostingInnovationDesc', 630_000_000, [16, 14]);
new Game.Upgrade('#Upgrade_FlavorFusion', '#Upgrade_FlavorFusionDesc', 640_000_000, [17, 14]);
order=36100;
new Game.Upgrade('#Upgrade_AdvancedBaking', '#Upgrade_AdvancedBakingDesc', 700_000_000, [18, 13]);
order=36200;
new Game.Upgrade('#Upgrade_SunshineCoastCupcake', '#Upgrade_SunshineCoastCupcakeDesc', 750_000_000, [10, 12]);
new Game.Upgrade('#Upgrade_MidnightMagicCupcake', '#Upgrade_MidnightMagicCupcakeDesc', 850_000_000, [9, 12]);
new Game.Upgrade('#Upgrade_BerryDelightCupcake', '#Upgrade_BerryDelightCupcakeDesc', 950_000_000, [8, 12]);
new Game.Upgrade('#Upgrade_GalacticCupcake', '#Upgrade_GalacticCupcakeDesc', 1_000_000_000, [18, 7]);
order=36300;
new Game.Upgrade('#Upgrade_WarpSpeedBaking', '#Upgrade_WarpSpeedBakingDesc', 1_000_000_000_000, [6, 17]);
new Game.Upgrade('#Upgrade_CelestialCupcakeBoost', '#Upgrade_CelestialCupcakeBoostDesc', 2_000_000_000_000, [7, 17]);
order=36400;
new Game.Upgrade('#Upgrade_InterdimensionalTrade', '#Upgrade_InterdimensionalTradeDesc', 900_000_000_000, [8, 17]);
order=36500;
new Game.Upgrade('#Upgrade_FreshMintCupcake', '#Upgrade_FreshMintCupcakeDesc', 1_500_000_000, [12, 12]);
new Game.Upgrade('#Upgrade_WickedCupcake', '#Upgrade_WickedCupcakeDesc', 5_000_000_000, [7, 15]);
new Game.Upgrade('#Upgrade_JapaneseCupcake', '#Upgrade_JapaneseCupcakeDesc', 10_000_000_000, [18, 14]);
order=36600;
new Game.Upgrade('#Upgrade_OceanCupcake', '#Upgrade_OceanCupcakeDesc', 20_000_000_000, [19, 14]);
new Game.Upgrade('#Upgrade_SpringCupcake', '#Upgrade_SpringCupcakeDesc', 70_000_000_000, [20, 14]);
order=36700;
new Game.Upgrade('#Upgrade_ImprovedCrystallineBoiler', '#Upgrade_ImprovedCrystallineBoilerDesc', 1_000_000_000, [21, 14]);
new Game.Upgrade('#Upgrade_AutomaticСonfectioneryСontroller', '#Upgrade_AutomaticСonfectioneryСontrollerDesc', 10_000_000_000, [22, 14]);
order=36800;
new Game.Upgrade('#Upgrade_FrostyShiningCupcake', '#Upgrade_FrostyShiningCupcakeDesc', 120_000_000_000, [23, 14]);
order=36900;
new Game.Upgrade('#Upgrade_BlackberryDonut', '#Upgrade_BlackberryDonutDesc', 2_000_000_000, [24, 14]);
new Game.Upgrade('#Upgrade_StrawberryDonut', '#Upgrade_StrawberryDonutDesc', 4_000_000_000, [25, 14]);
new Game.Upgrade('#Upgrade_LimeDonut', '#Upgrade_LimeDonutDesc', 8_000_000_000, [24, 15]);
order=37000;
new Game.Upgrade('#Upgrade_CupcakeCookie', '#Upgrade_CupcakeCookieDesc', 10_000_000_000, [7, 16]);
new Game.Upgrade('#Upgrade_CandyCoconutCupcake', '#Upgrade_CandyCoconutCupcakeDesc', 14_000_000_000, [8, 16]);
/*=====================================================================================
ACHIEVEMENTS CODE
=======================================================================================*/
/**
* All registred achievements
* @type {Object}
*/
Game.Achievements = [];
/**
* All registred achievements (Array)
* @type {Array<Game.Achievement>}
*/
Game.AchievementsById = [];
Game.AchievementsN = 0;
/**
* Count of owned achievements
* @type {number}
*/
Game.AchievementsOwned = 0;
/**
* Achievement class
* @class
* @param {string} name Name of Achievement
* @param {string} desc Description of Achievement
* @param {string} icon Path to icon image
* @param {number} hide Hide levels : 0=show, 1=hide description, 2=hide, 3=secret (doesn't count toward achievement total)
*/
Game.Achievement = function (name, desc, icon, hide) {
this.id = Game.AchievementsN;
this.name = name;
this.displayName = Localization.GetText(name);
this.desc = Localization.GetText(desc);
this.icon = icon;
this.won = 0;
this.disabled = 0;
this.hide = hide || 0;//hide levels : 0=show, 1=hide description, 2=hide, 3=secret (doesn't count toward achievement total)
this.order = this.id;
if (order) this.order = order + this.id * 0.001;
/**
* Updates the localization for Achievement
* @returns {void}
*/
this.UpdateLocale = function() {
this.displayName = Localization.GetText(name);
this.desc = Localization.GetText(desc);
}
Game.Achievements[this.name] = this;
Game.AchievementsById[this.id] = this;
Game.AchievementsN++;
return this;
}
/**
* Unlocks Achievement by name
* @param {string} what Achievement name
* @returns {void}
*/
Game.Win = function (what) {
if (typeof what === 'string') {
if (Game.Achievements[what]) {
if (Game.Achievements[what].won == 0) {
Game.Achievements[what].won = 1;
Game.Popup("#Achievement_UnlockLabel", Game.Achievements[what].displayName);
if (Game.Achievements[what].hide != 3) Game.AchievementsOwned++;
Game.recalculateGains = 1;
}
}
}
else { for (var i in what) { Game.Win(what[i]); } }
}
/**
* Check for Achievement owning by name
* @param {string} what Name of Achievement
* @returns {void}
*/
Game.HasAchiev = function (what) {
return (Game.Achievements[what] ? Game.Achievements[what].won : 0);
}
//define achievements
//WARNING : do NOT add new achievements in between, this breaks the saves. Add them at the end !
var order = 100;//this is used to set the order in which the items are listed
//new Game.Achievement('name','description',[0,0]);
Game.moneyAchievs = [
'Wake and bake', 1,
'Making some dough', 100,
'So baked right now', 1000,
'Fledgling bakery', 10000,
'Affluent bakery', 100000,
'World-famous bakery', 1000000,
'Cosmic bakery', 10000000,
];
for (var i = 0; i < Game.moneyAchievs.length / 2; i++) {
var pic = [Math.min(10, i), 5];
if (i == 15) pic = [11, 5];
new Game.Achievement(Game.moneyAchievs[i * 2], 'Bake <b>' + Beautify(Game.moneyAchievs[i * 2 + 1]) + '</b> cupcake' + (Game.moneyAchievs[i * 2 + 1] == 1 ? '' : 's') + '.', pic, 2);
}
new Game.Achievement('#Achievement_WorldFilled', '#Achievement_WorldFilledDesc', [4, 16], 2);
new Game.Achievement('#Achievement_InfiniteCupcakes', '#Achievement_InfiniteCupcakesDesc', [4, 13], 2);
order = 200;
Game.cpsAchievs = [
'Casual baking', 1,
'Hardcore baking', 10,
'Steady tasty stream', 100,
'Cupcake monster', 1000,
'Mass producer', 10000,
'Cupcake vortex', 100000,
'Cupcake pulsar', 1000000,
];
for (var i = 0; i < Game.cpsAchievs.length / 2; i++) {
var pic = [i, 5];
new Game.Achievement(Game.cpsAchievs[i * 2], 'Bake <b>' + Beautify(Game.cpsAchievs[i * 2 + 1]) + '</b> cupcake' + (Game.cpsAchievs[i * 2 + 1] == 1 ? '' : 's') + ' per second.', pic, 2);
}
order = 30000;
new Game.Achievement('#Achievement_Sacrifice', '#Achievement_SacrificeDesc', [11, 6], 2);
new Game.Achievement('#Achievement_Oblivion', '#Achievement_OblivionDesc', [11, 6], 2);
new Game.Achievement('#Achievement_FromScratch', '#Achievement_FromScratchDesc', [11, 6], 2);
order = 31000;
new Game.Achievement('#Achievement_Neverclick', '#Achievement_NeverclickDesc', [12, 0], 3);
order = 1000;
new Game.Achievement('#Achievement_Clicktastic', '#Achievement_ClicktasticDesc', [11, 0]);
new Game.Achievement('#Achievement_Clickathlon', '#Achievement_ClickathlonDesc', [11, 1]);
new Game.Achievement('#Achievement_Clickolympics', '#Achievement_ClickolympicsDesc', [11, 1]);
new Game.Achievement('#Achievement_Clickorama', '#Achievement_ClickoramaDesc', [11, 2]);
order = 1050;
new Game.Achievement('#Achievement_Click', '#Achievement_ClickDesc', [0, 0]);
new Game.Achievement('#Achievement_DoubleClick', '#Achievement_DoubleClickDesc', [0, 6]);
new Game.Achievement('#Achievement_MouseWheel', '#Achievement_MouseWheelDesc', [1, 6]);
new Game.Achievement('#Achievement_OfMiceAndMen', '#Achievement_OfMiceAndMenDesc', [2, 6]);
new Game.Achievement('#Achievement_TheDigital', '#Achievement_TheDigitalDesc', [3, 6]);
order = 1100;
new Game.Achievement('#Achievement_JustWrong', '#Achievement_JustWrongDesc', [10, 9], 2);
new Game.Achievement('#Achievement_BusinessStarts', '#Achievement_BusinessStartsDesc', [1, 0]);
new Game.Achievement('#Achievement_Professional', '#Achievement_ProfessionalDesc', [1, 1]);
new Game.Achievement('#Achievement_UltimateBakery', '#Achievement_UltimateBakeryDesc', [1, 2]);
order = 1200;
new Game.Achievement('#Achievement_SkynetAttacks', '#Achievement_SkynetAttacksDesc', [2, 0]);
new Game.Achievement('#Achievement_SmartBakery', '#Achievement_SmartBakeryDesc', [2, 1]);
new Game.Achievement('#Achievement_UltimateTechnology', '#Achievement_UltimateTechnologyDesc', [2, 2]);
order = 1300;
new Game.Achievement('#Achievement_ProductionChain', '#Achievement_ProductionChainDesc', [4, 0]);
new Game.Achievement('#Achievement_IndustrialRevolution', '#Achievement_IndustrialRevolutionDesc', [4, 1]);
new Game.Achievement('#Achievement_GlobalWarming', '#Achievement_GlobalWarmingDesc', [4, 2]);
order = 1400;
new Game.Achievement('#Achievement_Conveyor', '#Achievement_ConveyorDesc', [3, 0]);
//new Game.Achievement('Excavation site','Have <b>50</b> C-Factorys.',[3,1]);
//new Game.Achievement('Hollow the planet','Have <b>100</b> C-Factorys.',[3,2]);
order = 1500;
new Game.Achievement('#Achievement_MolecularPhysics', '#Achievement_MolecularPhysicsDesc', [5, 0]);
new Game.Achievement('#Achievement_AtomicProgression', '#Achievement_AtomicProgressionDesc', [5, 1]);
new Game.Achievement('#Achievement_AtomicDominance', '#Achievement_AtomicDominanceDesc', [5, 2]);
order = 1600;
new Game.Achievement('#Achievement_Transmutation', '#Achievement_TransmutationDesc', [6, 0]);
new Game.Achievement('#Achievement_Transmogrification', '#Achievement_TransmogrificationDesc', [6, 1]);
new Game.Achievement('#Achievement_GoldMember', '#Achievement_GoldMemberDesc', [6, 2]);
/*order=1700;
new Game.Achievement('A whole new world','Have <b>1</b> cupplanet.',[7,0]);
new Game.Achievement('Now you\'re thinking','Have <b>50</b> cupplanets.',[7,1]);
new Game.Achievement('Dimensional shift','Have <b>100</b> cupplanets.',[7,2]);*/
order = 1700;
new Game.Achievement('#Achievement_PlanetColonization', '#Achievement_PlanetColonizationDesc', [24, 3]);
new Game.Achievement('#Achievement_GalacticDomination', '#Achievement_GalacticDominationDesc', [10, 4]);
order = 1800;
new Game.Achievement('#Achievement_EasyBaking', '#Achievement_EasyBakingDesc', [4, 14]);
//new Game.Achievement('#Achievement_CodedToReality', '#Achievement_CodedToRealityDesc', [6, 13]);
new Game.Achievement('#Achievement_CloneConveyor', '#Achievement_CloneConveyorDesc', [5, 14]);
order = 10000;
new Game.Achievement('#Achievement_LemonCupcake', '#Achievement_LemonCupcakeDesc', [10, 0], 1);
new Game.Achievement('#Achievement_LuckyCupcake', '#Achievement_LuckyCupcakeDesc', [10, 1], 1);
new Game.Achievement('#Achievement_AStrokeOfLuck', '#Achievement_AStrokeOfLuckDesc', [10, 1], 1);
order = 30200;
new Game.Achievement('#Achievement_CheatedCupcakesTasteAwful', '#Achievement_CheatedCupcakesTasteAwfulDesc', [10, 6], 3);
order = 30001;
new Game.Achievement('#Achievement_UncannyClicker', '#Achievement_UncannyClickerDesc', [12, 0], 2);
order = 5000;
new Game.Achievement('#Achievement_Builder', '#Achievement_BuilderDesc', [4, 6], 1);
new Game.Achievement('#Achievement_Architect', '#Achievement_ArchitectDesc', [5, 6], 1);
order = 5500;
new Game.Achievement('#Achievement_Automation', '#Achievement_AutomationDesc', [16, 3]);
order = 5600;
new Game.Achievement('#Achievement_ProgressInScience', '#Achievement_ProgressInScienceDesc', [17, 3], 1);
order = 5700;
new Game.Achievement('#Achievement_MachineLearning', '#Achievement_MachineLearningDesc', [18, 3], 1);
// order=5800;
// new Game.Achievement('Merry Christmas!', 'Find <b>christmas code</b>. <q>Merry Christmas!</q>',[19,3]);
order = 5900;
new Game.Achievement('#Achievement_Fabricology', '#Achievement_FabricologyDesc', [20, 3]);
order = 5910;
new Game.Achievement('#Achievement_ProductionOptimization', '#Achievement_ProductionOptimizationDesc', [21, 3]);
order = 6000;
new Game.Achievement('#Achievement_Enhancer', '#Achievement_EnhancerDesc', [9, 0], 1);
new Game.Achievement('#Achievement_Augmenter', '#Achievement_AugmenterDesc', [9, 1], 1);
order = 11000;
new Game.Achievement('#Achievement_CupcakeDunker', '#Achievement_CupcakeDunkerDesc', [4, 7], 2);
order = 10000;
new Game.Achievement('#Achievement_HugeLuck', '#Achievement_HugeLuckDesc', [25, 3], 1);
order = 31000;
new Game.Achievement('#Achievement_TrueNeverclick', '#Achievement_TrueNeverclickDesc', [12, 0], 3);
order = 31100;
new Game.Achievement('#Achievement_ChocolateLover', '#Achievement_ChocolateLoverDesc', [11, 7], 1);
order = 31200;
new Game.Achievement('#Achievement_ChocolateFan', '#Achievement_ChocolateFanDesc', [11, 8], 1);
order = 31300;
new Game.Achievement('#Achievement_ChocolateFrenzy', '#Achievement_ChocolateFrenzyDesc', [12, 8], 1);
order = 31400;
new Game.Achievement('#Achievement_CupcakeMaster', '#Achievement_CupcakeMasterDesc', [8, 3], 2);
order = 31500;
new Game.Achievement('#Achievement_GodOfCupcakes', '#Achievement_GodOfCupcakesDesc', [9, 3], 2);
order = 5000;
new Game.Achievement('#Achievement_Engineer', '#Achievement_EngineerDesc', [6, 6], 1);
order = 10000;
new Game.Achievement('#Achievement_Leprechaun', '#Achievement_LeprechaunDesc', [10, 2], 1);
new Game.Achievement('#Achievement_BlackCatsPaw', '#Achievement_BlackCatsPawDesc', [10, 2], 3);
order = 30000;
new Game.Achievement('#Achievement_Nihilism', '#Achievement_NihilismDesc', [11, 6], 2);
new Game.Achievement('#Achievement_Galactus', '#Achievement_GalactusDesc', [11, 6], 2);
order = 6000;
new Game.Achievement('#Achievement_Upgrader', '#Achievement_UpgraderDesc', [9, 2], 1);
order = 6100;
new Game.Achievement('#Achievement_SkilledClicker', '#Achievement_SkilledClickerDesc', [2, 3]);
order = 6200;
new Game.Achievement('#Achievement_ClickRecruit', '#Achievement_ClickRecruitDesc', [3, 3]);
order = 6300;
new Game.Achievement('#Achievement_SpeedyClicker', '#Achievement_SpeedyClickerDesc', [4, 3], 1);
order = 6400;
new Game.Achievement('#Achievement_ClickMaster', '#Achievement_ClickMasterDesc', [5, 3], 1);
order = 6500;
new Game.Achievement('#Achievement_ClickSensei', '#Achievement_ClickSenseiDesc', [6, 3], 2);
order = 7000;
new Game.Achievement('#Achievement_Centennial', '#Achievement_CentennialDesc', [14, 3]);
order = 8000;
new Game.Achievement('#Achievement_CyberSpace', '#Achievement_CyberSpaceDesc', [11, 3]);
order = 8100;
new Game.Achievement('#Achievement_CyberneticMind', '#Achievement_CyberneticMindDesc', [12, 3]);
order = 8200;
new Game.Achievement('#Achievement_TrueSciFi', "#Achievement_TrueSciFiDesc", [13, 3]);
order = 8300;
new Game.Achievement('#Achievement_Invader', '#Achievement_InvaderDesc', [13, 0]);
order = 8400;
new Game.Achievement('#Achievement_GlobalConqueror', '#Achievement_GlobalConquerorDesc', [13, 1]);
order = 8450;
new Game.Achievement('#Achievement_CupcakesFromAcrossTheMultiverse', '#Achievement_CupcakesFromAcrossTheMultiverseDesc', [13, 2]);
order = 8500;
new Game.Achievement('#Achievement_ANewWordInScience', '#Achievement_ANewWordInScienceDesc', [0, 4]);
order = 8600;
new Game.Achievement('#Achievement_CupcakesOutOfThinAir', '#Achievement_CupcakesOutOfThinAirDesc', [1, 4]);
order = 8700;
new Game.Achievement('#Achievement_NanoDominance', '#Achievement_NanoDominanceDesc', [4, 4]);
order = 8800;
new Game.Achievement('#Achievement_CoffeeLover', '#Achievement_CoffeeLoverDesc', [5, 4]);
order = 8850;
new Game.Achievement('#Achievement_CoffeeExpert', '#Achievement_CoffeeExpertDesc', [6, 4], 2);
order = 8890;
new Game.Achievement('#Achievement_CoffeeLord', '#Achievement_CoffeeLordDesc', [7, 4], 2);
order = 31600;
new Game.Achievement('#Achievement_Cookies', '#Achievement_CookiesDesc', [12, 4], 3);
order = 31700;
new Game.Achievement('#Achievement_GodComplex', '#Achievement_GodComplexDesc', [13, 4], 3);
order = 31800;
new Game.Achievement('#Achievement_OpenSesame', '#Achievement_OpenSesameDesc', [14, 4], 3);
order = 31900;
new Game.Achievement('#Achievement_BlackMesaWannaBe', '#Achievement_BlackMesaWannaBeDesc', [15, 4], 2);
order = 32000;
new Game.Achievement('#Achievement_Two', '#Achievement_TwoDesc', [16, 4], 2);
order = 32100;
new Game.Achievement('#Achievement_Nice', '#Achievement_NiceDesc', [17, 4], 2);
order = 32200;
new Game.Achievement('#Achievement_Robotization', '#Achievement_RobotizationDesc', [15, 10]);
order=32300;
new Game.Achievement('#Achievement_CollectiveMind', '#Achievement_CollectiveMindDesc', [16, 10]);
order=32400;
new Game.Achievement('#Achievement_DevilMadeMe', '#Achievement_DevilMadeMeDesc', [0, 13], 2);
order=32500;
new Game.Achievement('#Achievement_ClickyClick', '#Achievement_ClickyClickDesc', [7, 14], 2);
order=32600;
new Game.Achievement('#Achievement_HellClicker', '#Achievement_HellClickerDesc', [8, 14], 2);
order=32700;
new Game.Achievement('#Achievement_SacredDelight', '#Achievement_SacredDelightDesc', [9, 14]);
new Game.Achievement('#Achievement_ParadiseConditions', '#Achievement_ParadiseConditionsDesc', [10, 14], 2);
new Game.Achievement('#Achievement_AgainAndAgain', '#Achievement_AgainAndAgainDesc', [11, 14], 2);
new Game.Achievement('#Achievement_EndlessCycle', '#Achievement_EndlessCycleDesc', [12, 14], 2);
order=32800;
new Game.Achievement('#Achievement_CosmicConfectioner', '#Achievement_CosmicConfectionerDesc', [4, 17]);
new Game.Achievement('#Achievement_NebulaNavigator', '#Achievement_NebulaNavigatorDesc', [5, 17]);
order=32900;
new Game.Achievement('#Achievement_LongHaul', '#Achievement_LongHaulDesc', [3, 17], 2);
order=33000;
new Game.Achievement('#Achievement_Reincarnation', '#Achievement_ReincarnationDesc', [8, 15], 2);
new Game.Achievement('#Achievement_DivineBaker', '#Achievement_DivineBakerDesc', [9, 15], 2);
new Game.Achievement('#Achievement_CelestialCravings', '#Achievement_CelestialCravingsDesc', [10, 15], 2);
new Game.Achievement('#Achievement_AngelsSweetTooth', '#Achievement_AngelsSweetToothDesc', [11, 15], 2);
new Game.Achievement('#Achievement_EtherealMastery', '#Achievement_EtherealMasteryDesc', [12, 15], 2);
new Game.Achievement('#Achievement_DivinePerfection', '#Achievement_DivinePerfectionDesc', [13, 15], 2);
order=33100;
new Game.Achievement('#Achievement_MarshmallowRain', '#Achievement_MarshmallowRainDesc', [9, 17], 3);
order=33200;
new Game.Achievement('#Achievement_JustPurrfect', '#Achievement_JustPurrfectDesc', [9, 16], 3);
order=33300;
new Game.Achievement('#Achievement_CupcakeFell', '#Achievement_CupcakeFellDesc', [10, 16], 3);
/**
* Ruins the fun)
* @returns {void}
*/
Game.RuinTheFun = function () {
for (var i in Game.Upgrades) {
Game.Unlock(Game.Upgrades[i].name);
Game.Upgrades[i].bought++;
if (Game.Upgrades[i].buyFunction) Game.Upgrades[i].buyFunction();
}
for (var i in Game.Achievements) {
Game.Win(Game.Achievements[i].name);
}
Game.Earn(9999999999999);
Game.upgradesToRebuild = 1;
Game.recalculateGains = 1;
}
/*=====================================================================================
BAKERPOCALYPSE
=======================================================================================*/
/**
* Updates bakerpocalypse
* @deprecated
* @returns {void}
*/
Game.Updatebakerpocalypse = function () {
if (Game.Has('#Upgrade_ElderCovenant') || Game.Objects['#Building_Baker'].amount == 0) Game.elderWrath = 0;
else if (Game.pledgeT > 0)//if the pledge is active, lower it
{
Game.pledgeT--;
if (Game.pledgeT == 0)//did we reach 0? make the pledge purchasable again
{
Game.Lock('#Achievement_ElderPledge');
Game.Unlock('#Achievement_ElderPledge');
Game.elderWrath = 1;
}
}
else {
if (Game.Has('#Upgrade_OneMind') && Game.elderWrath == 0) {
Game.elderWrath = 1;
}
if (Math.random() < 0.001 && Game.elderWrath < Game.Has('#Upgrade_OneMind') + Game.Has('#Upgrade_CommunalBrainsweep') + Game.Has('#Upgrade_ElderPact')) {
Game.elderWrath++;//have we already pledged? make the elder wrath shift between different stages
}
if (Game.Has('#Upgrade_ElderPact') && Game.Upgrades['#Achievement_ElderPledge'].unlocked == 0) {
Game.Lock('#Achievement_ElderPledge');
Game.Unlock('#Achievement_ElderPledge');
}
}
Game.elderWrathD += ((Game.elderWrath + 1) - Game.elderWrathD) * 0.001;//slowly fade to the target wrath state
}
/**
* Draws bakerpocalypse
* @deprecated
* @returns {void}
*/
Game.Drawbakerpocalypse = function () {
Game.defaultBg = 'bgBlue';
//handle background
if (Math.abs((Game.elderWrath + 1) - Game.elderWrathD) > 0.1) {
if (Game.elderWrathD < 1) {
Game.bgR = 0;
if (Game.bg != Game.defaultBg || Game.bgFade != Game.defaultBg) {
Game.bg = Game.defaultBg;
Game.bgFade = Game.defaultBg;
// l('backgroundLayer1').style.background = 'url(img/' + Game.bg + '.jpg)';
// l('backgroundLayer2').style.background = 'url(img/' + Game.bgFade + '.jpg)';
// l('backgroundLayer1').style.backgroundSize = 'auto';
// l('backgroundLayer2').style.backgroundSize = 'auto';
}
}
else if (Game.elderWrathD >= 1 && Game.elderWrathD < 2) {
Game.bgR = (Game.elderWrathD - 1) / 1;
if (Game.bg != Game.defaultBg || Game.bgFade != 'bakers1') {
Game.bg = Game.defaultBg;
Game.bgFade = 'bakers1';
// l('backgroundLayer1').style.background = 'url(img/' + Game.bg + '.jpg)';
// l('backgroundLayer2').style.background = 'url(img/' + Game.bgFade + '.jpg)';
// l('backgroundLayer1').style.backgroundSize = 'auto';
// l('backgroundLayer2').style.backgroundSize = '512px';
}
}
else if (Game.elderWrathD >= 2 && Game.elderWrathD < 3) {
Game.bgR = (Game.elderWrathD - 2) / 1;
if (Game.bg != 'bakers1' || Game.bgFade != 'bakers2') {
Game.bg = 'bakers1';
Game.bgFade = 'bakers2';
// l('backgroundLayer1').style.background = 'url(img/' + Game.bg + '.jpg)';
// l('backgroundLayer2').style.background = 'url(img/' + Game.bgFade + '.jpg)';
// l('backgroundLayer1').style.backgroundSize = '512px';
// l('backgroundLayer2').style.backgroundSize = '512px';
}
}
else if (Game.elderWrathD >= 3 && Game.elderWrathD < 4) {
Game.bgR = (Game.elderWrathD - 3) / 1;
if (Game.bg != 'bakers2' || Game.bgFade != 'bakers3') {
Game.bg = 'bakers2';
Game.bgFade = 'bakers3';
// l('backgroundLayer1').style.background = 'url(img/' + Game.bg + '.jpg)';
// l('backgroundLayer2').style.background = 'url(img/' + Game.bgFade + '.jpg)';
// l('backgroundLayer1').style.backgroundSize = '512px';
// l('backgroundLayer2').style.backgroundSize = '512px';
}
}
Game.bgRd += (Game.bgR - Game.bgRd) * 0.5;
// l('backgroundLayer2').style.opacity = Game.bgR;
//why are these so slow (maybe replaceable with a large canvas)
/*var x=Math.sin(Game.T*0.2)*Math.random()*8;
var y=Math.sin(Game.T*0.2)*Math.random()*8;
l('backgroundLayer1').style.backgroundPosition=Math.floor(x)+'px '+Math.floor(y)+'px';
l('backgroundLayer2').style.backgroundPosition=Math.floor(x)+'px '+Math.floor(y)+'px';*/
}
};
/*=====================================================================================
DUNGEONS (unfinished)
=======================================================================================*/
LaunchDungeons();
/*=====================================================================================
INITIALIZATION END; GAME READY TO LAUNCH
=======================================================================================*/
/*=====================================================================================
INITIALIZING MODS; NOT LOADING SAVE BEFORE MODS
=======================================================================================*/
Game.LaunchModAPI();
Game.LoadSave();
Game.UpdateLocale();
Game.ready = 1;
l('javascriptError').innerHTML = '';
l('javascriptError').style.display = 'none';
Game.Loop();
}
/**
* Update localization of all registred objects
*/
Game.UpdateLocale = function() {
Object.keys(Game.Upgrades).forEach(upgrade => {
Game.Upgrades[upgrade].UpdateLocale();
});
Object.keys(Game.Achievements).forEach(achievement => {
Game.Achievements[achievement].UpdateLocale();
});
Object.keys(Game.Objects).forEach(object => {
Game.Objects[object].UpdateLocale();
});
}
/*=====================================================================================
CLICK MASTERY
=======================================================================================*/
/**
* Target for new click mastery rank
* @type {number}
*/
Game.Needto = 2000;
/**
* Current click mastery
* @type {number}
*/
Game.ClickMastery = 0;
/**
* Click rank string
* @type {string}
*/
Game.ClickRank = '';
/**
* Click mastery string
* @type {string}
*/
Game.ClickMasteryStr = '';
/**
* Process click mastery
* @returns {void}
*/
Game.CMastery = function () {
if (Game.cupcakeClicks >= Game.Needto) {
Game.ClickMastery++;
Game.GetRank();
if (Game.ClickMastery == 0) {
Game.ClickMasteryStr = Localization.GetText("#UI_ClickMasteryNoRank");
}
else {
Game.ClickMasteryStr = Localization.GetText("#UI_ClickMasteryRank").format(Game.NumtoRome(Game.ClickMastery), Game.ClickRank);
Game.cupcakesPs = Game.cupcakesPs + Game.Needto * 1.5;
//Game.Rank_multiplier=Game.Needto*1.5;
//Game.CalculateGains();
Game.Popup("#UI_ClickMasteryAchieved", Game.NumtoRome(Game.ClickMastery));
}
Game.Needto = Game.Needto * 2;
}
}
/**
* Updates click rank
* @returns {void}
*/
Game.GetRank = function () {
if (Game.ClickMastery == 1) Game.ClickRank = Localization.GetText("#UI_ClickMasteryRecruit");
else if (Game.ClickMastery == 3) Game.ClickRank = Localization.GetText("#UI_ClickMasteryClickNinja");
else if (Game.ClickMastery == 4) Game.ClickRank = Localization.GetText("#UI_ClickMasteryMaster");
else if (Game.ClickMastery == 5) Game.ClickRank = Localization.GetText("#UI_ClickMasterySensei");
else if (Game.ClickMastery == 7) Game.ClickRank = Localization.GetText("#UI_ClickMasteryLegend");
else if (Game.ClickMastery >= 7) Game.ClickRank = Localization.GetText("#UI_ClickMasteryLegendaryRank").format(Game.NumtoRome(Game.ClickMastery - (Game.ClickMastery - 1)));
}
/**
* Decimal number to Rome view
* @param {number} num
* @returns {string}
*/
Game.NumtoRome = function (num) {
var lookup = { M: 1000, CM: 900, D: 500, CD: 400, C: 100, XC: 90, L: 50, XL: 40, X: 10, IX: 9, V: 5, IV: 4, I: 1 }, roman = '', i;
for (i in lookup) {
while (num >= lookup[i]) {
roman += i;
num -= lookup[i];
}
}
return roman;
}
/*=====================================================================================
BG MUSIC
=======================================================================================*/
var bgplaying = 0;
// Game.BgMusic = function () {
// if (Game.prefs.music = 1) {
// //var muse = choose(['https://cdn.discordapp.com/attachments/880491676244795465/1053301441789448282/hard_baking.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1053301504372637746/factory.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1053301571871584306/cupcake.mp3']);
// //var muse = choose(['https://cdn.discordapp.com/attachments/1054839079239417866/1070000433415848027/clickfrenzy.mp3', 'https://cdn.discordapp.com/attachments/1054839079239417866/1070000433046757406/lemoncupcake.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1081569238965289020/cupverse.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1089242915848585256/cupsong.mp3']);
// var muse = choose(['https://cdn.discordapp.com/attachments/1105095523616170024/1111320786175787118/EternalClicking.mp3',
// 'https://cdn.discordapp.com/attachments/1105095523616170024/1124769507064430752/Cupcake_Groove.mp3',
// 'https://cdn.discordapp.com/attachments/1105095523616170024/1126091706706706433/Frosty_Delight.mp3',
// 'https://cdn.discordapp.com/attachments/1105095523616170024/1127237627125436426/Chinese_Cupcake.mp3',
// 'https://cdn.discordapp.com/attachments/1105095523616170024/1133788016184397834/LoFi_Lounge_for_Cupcake-holics.mp3',
// 'https://cdn.discordapp.com/attachments/880491676244795465/1134513352538865814/LoFi_Lounge_for_Cupcake-maniacs.mp3',
// 'https://cdn.discordapp.com/attachments/1105095523616170024/1140720123540418560/Cosmic_Sweetness.mp3']);
// bgmusic = new Audio(muse);
// //var bgmusic = new Audio('https://cdn.discordapp.com/attachments/880491676244795465/1058814760470188042/Y2mate.mx_-_Lofi_Christmas_Music_10_min_Chill_Out_128_kbps_1.mp3');
// bgmusic.addEventListener('ended', function () {
// Game.BgMusic();
// });
// bgmusic.play();
// }
// }
/**
* Plays background audio
* @return {void}
*/
Game.BgMusic = function () {
//var muse = choose(['https://cdn.discordapp.com/attachments/880491676244795465/1053301441789448282/hard_baking.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1053301504372637746/factory.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1053301571871584306/cupcake.mp3']);
//var muse = choose(['https://cdn.discordapp.com/attachments/1054839079239417866/1070000433415848027/clickfrenzy.mp3', 'https://cdn.discordapp.com/attachments/1054839079239417866/1070000433046757406/lemoncupcake.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1081569238965289020/cupverse.mp3', 'https://cdn.discordapp.com/attachments/880491676244795465/1089242915848585256/cupsong.mp3']);
var muse = choose(['https://cdn.discordapp.com/attachments/1105095523616170024/1111320786175787118/EternalClicking.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1124769507064430752/Cupcake_Groove.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1126091706706706433/Frosty_Delight.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1127237627125436426/Chinese_Cupcake.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1133788016184397834/LoFi_Lounge_for_Cupcake-holics.mp3',
'https://cdn.discordapp.com/attachments/880491676244795465/1134513352538865814/LoFi_Lounge_for_Cupcake-maniacs.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1140720123540418560/Cosmic_Sweetness.mp3',
'https://cdn.discordapp.com/attachments/1105095523616170024/1146036217922715648/Hardcore_Baking.mp3']);
bgmusic = new Audio(muse);
//var bgmusic = new Audio('https://cdn.discordapp.com/attachments/880491676244795465/1058814760470188042/Y2mate.mx_-_Lofi_Christmas_Music_10_min_Chill_Out_128_kbps_1.mp3');
bgmusic.addEventListener('ended', function () {
Game.BgMusic();
});
bgmusic.play();
}
/*=====================================================================================
CHRISTMAS CODE
=======================================================================================*/
var chrcodes = ['VAXJOKESARECRINGE', '2023', 'Lemon99Cupcake', 'AIREVOLUTIONIS2999NEAR'];
var zero = false;
var one = false;
var two = false;
var three = false;
/**
* Opens up Christmas Code prompts
* @returns {void}
*/
Game.ChrCode = function () {
var input = prompt('Input Christmas Code:');
if (input == chrcodes[0] && zero == false) { Game.Popup('+12345678900 cupcakes!'); Game.cupcakesEarned += 12345678901; Game.cupcakes += 12345678900; zero = true; }
if (input == chrcodes[1] && one == false) { Game.Popup('+1234567 cupcakes per second!'); Game.ChrCps += 1234567; Game.CalculateGains(); one = true; }
if (input == chrcodes[2] && two == false) { Game.Popup('Merry Christmas!'); Game.Win('Merry Christmas!'); two = true; }
if (input == chrcodes[3] && three == false) { Game.Popup('+9999999998 cupcakes!'); Game.cupcakesEarned += 9999999999; Game.cupcakes += 9999999998; three = true; }
}
/*=====================================================================================
LOGIC
=======================================================================================*/
/**
* Process logic
* @returns {void}
*/
Game.Logic = function () {
for(let mod of Game.ModAPI.ModsLoaded.values())
{
if(mod.OnLogicStart != undefined)
{
mod.OnLogicStart();
}
}
Game.Updatebakerpocalypse();
if (Game.cupcakeClicks >= 2000) Game.CMastery();
if (CheckCollision(l('coffeeLayer2'), l('bigcupcake')) == false) {
Game.CanCoffeeCollide = true;
}
if (Game.ready) {
if (Game.CanCoffeeCollide == true) {
if (CheckCollision(l('coffeeLayer2'), l('bigcupcake'))) {
Game.Win('#Achievement_CupcakeDunker');
}
}
}
//if (Game.cupcakeClicks>=5000) Game.CMastery();
//handle coffee and coffee accessories
Game.coffeeProgress = Game.AchievementsOwned / 25;
if (Game.coffeeProgress >= 0.5) Game.Unlock('#Upgrade_KittenHelpers');
if (Game.coffeeProgress >= 1) Game.Unlock('#Upgrade_KittenWorkers');
if (Game.coffeeProgress >= 2) Game.Unlock('#Upgrade_KittenEngineers');
if (Game.coffeeProgress >= 3) Game.Unlock('#Upgrade_KittenOverseers');
Game.coffeeH = Math.min(1, Game.coffeeProgress) * 0.35;
Game.coffeeHd += (Game.coffeeH - Game.coffeeHd) * 0.02;
if (Game.autoclickerDetected > 0) Game.autoclickerDetected--;
if (!Game.bakeryName.includes('BADBLIGGIES')) {
Game.DEV = false;
}
if (Game.ChocolateCoffee == false && Game.cupcakesEarned >= 500000000000) {
Game.ChocolateCoffee = true;
}
if (Game.coffeeFire == false && Game.cupcakeClicks >= 15000) {
Game.coffeeFire = true;
}
if (Game.coffeeBlueFire == false && Game.prestige['Heavenly Cupcakes'] >= 10) {
Game.coffeeBlueFire = true;
}
if (Game.coffeeGold == false && Game.cupcakesEarned >= 1500000000000) {
Game.coffeeGold = true;
}
if (Game.coffeeStars == false && Game.prestige['Heavenly Cupcakes'] >= 36) {
Game.coffeeStars = true;
}
if (Game.coffeeBlackSpace == false && Game.cupcakeClicks >= 25000 && Game.Has('#Upgrade_BlackHoleCupcake')) {
Game.coffeeBlackSpace = true;
}
if (Game.Has('#Upgrade_SatanicCupcake')) {
Game.coffeeBlood = true;
}
if (Game.ChocolateCoffee == false && Game.coffeeFire == false && Game.coffeeBlueFire == false && Game.coffeeGold == false && Game.coffeeStars == false && Game.coffeeBlood == false) {
Game.ChangeCoffee('coffeewave');
}
if (Game.SelectedCoffee == '') {
Game.ChangeCoffee('coffeewave');
}
if (Game.Has('#Upgrade_SatanicCupcake') && Game.satcupbought == 0) {
Game.devileye.spawn();
setTimeout(function() {
Game.devileye.spawn();
}, 100);
Game.satcupbought = 1;
}
if (Game.Has('#Upgrade_MusicCupcake') && Game.muscup == 0) {
PlaySound('https://cdn.discordapp.com/attachments/1105095523616170024/1107741385391624263/61ea56bd2ff29fc.mp3');
Game.muscup++;
Game.WriteSave();
}
if (Game.Has('#Upgrade_IndustrialCupcake') && Game.indcup == 0) {
PlaySound('https://cdn.discordapp.com/attachments/1105095523616170024/1107739858442670171/24a50b1cd09f0b86.mp3');
Game.indcup++;
Game.WriteSave();
}
if (Game.Has('#Upgrade_BinaryCupcake') && Game.bincup == 0) {
PlaySound('https://cdn.discordapp.com/attachments/1105095523616170024/1108057076455981186/687f78a3fab82a7.mp3');
Game.bincup++;
Game.WriteSave();
}
if (Game.Has('#Upgrade_InterdimensionalTrade')) {
ShineChange('img/blackhole.png');
}
if (Game.coffeeName == Localization.GetText("#UI_StatsCoffeeMacchiato")) {
Game.Win('#Achievement_CoffeeLover');
}
if (Game.coffeeName == Localization.GetText("#UI_StatsCoffeeFlatWhite")) {
Game.Win('#Achievement_CoffeeExpert');
}
if (Game.coffeeName == Localization.GetText("#UI_StatsCoffeeLungo")) {
Game.Win('#Achievement_CoffeeLord');
}
//TIME ACHIEVEMENTS HERE
if (Game.checktime('5 days', Game.gamestart)) {
Game.Win('#Achievement_LongHaul');
}
/*handle research
if (Game.researchT>0)
{
Game.researchT--;
}
if (Game.researchT==0 && Game.nextResearch)
{
Game.Unlock(Game.UpgradesById[Game.nextResearch].name);
Game.Popup('Researched : '+Game.UpgradesById[Game.nextResearch].name);
Game.nextResearch=0;
Game.researchT=-1;
}*/
//handle cupcakes
if (Game.recalculateGains) Game.CalculateGains();;
Game.Earn(Game.cupcakesPs / Game.fps);//add cupcakes per second
//var cps=Game.cupcakesPs+Game.cupcakes*0.01;//exponential cupcakes
//Game.Earn(cps/Game.fps);//add cupcakes per second
for (var i in Game.Objects) {
var me = Game.Objects[i];
me.totalcupcakes += me.storedTotalCps / Game.fps;
}
if (Game.cupcakes && Game.T % Math.ceil(Game.fps / Math.min(10, Game.cupcakesPs)) == 0 && Game.prefs.numbers) Game.cupcakeParticleAdd();//cupcake shower
if (Game.frenzy > 0) {
l('effecteffects').style.visibility = 'visible';
l('effectcounter').style.visibility = 'visible';
l('goldenef').style.visibility = 'visible';
Game.frenzy--;
//var secss = Math.floor((Game.frenzy/1000) % 60);
var secss = (Game.frenzy / Game.fps).toFixed(0);
var effectstr = secss.toString();
l('effectcounter').innerHTML = '<h1 id="effecttext">' + effectstr + '</h1>';
if (Game.frenzy == 0) {
l('effecteffects').style.visibility = 'hidden';
l('effectcounter').style.visibility = 'hidden';
l('goldenef').style.visibility = 'hidden';
Game.recalculateGains = 1;
}
}
if (Game.clickFrenzy > 0) {
l('effecteffects').style.visibility = 'visible';
l('effectcounter').style.visibility = 'visible';
l('goldenef').style.visibility = 'visible';
Game.clickFrenzy--;
var secss = (Game.clickFrenzy / Game.fps).toFixed(0);
var effectstr = secss.toString();
l('effectcounter').innerHTML = '<h1 id="effecttext">' + effectstr + '</h1>';
if (Game.clickFrenzy == 0) {
l('effecteffects').style.visibility = 'hidden';
l('effectcounter').style.visibility = 'hidden';
l('goldenef').style.visibility = 'hidden';
Game.recalculateGains = 1;
}
}
if (Game.T % (Game.fps * 5) == 0 && Game.ObjectsById.length > 0)//check some achievements and upgrades
{
//if (Game.Has('#Upgrade_ArcaneSugar') && !Game.Has('#Upgrade_ElderPact')) Game.Unlock('#Upgrade_ElderPact');//temporary fix for something stupid I've done
//if (Game.Objects['#Building_TechnoFurnace'].amount>=50 && Game.Objects['#Building_TechnoFurnace'].specialUnlocked==0) {Game.Objects['#Building_TechnoFurnace'].unlockSpecial();Game.Popup('You have unlocked the factory dungeons!');}
if (isNaN(Game.cupcakes)) { Game.cupcakes = 0; Game.cupcakesEarned = 0; Game.recalculateGains = 1; }
if (Game.cupcakesEarned >= 9999999) Game.Unlock(['Oatmeal raisin cupcakes', 'Peanut butter cupcakes', 'Plain cupcakes', 'Sugar cupcakes']);
if (Game.cupcakesEarned >= 99999999) Game.Unlock(['Coconut cupcakes', 'White chocolate cupcakes', 'Macadamia nut cupcakes']);
if (Game.cupcakesEarned >= 999999999) Game.Unlock(['Double-chip cupcakes', 'White chocolate macadamia nut cupcakes', 'All-chocolate cupcakes']);
if (Game.cupcakesEarned >= 9999999999) Game.Unlock(['Dark chocolate-coated cupcakes', 'White chocolate-coated cupcakes']);
if (Game.cupcakesEarned >= 200000000000) Game.Unlock('#Upgrade_ChemicalAdditiveGamma2');
if (Game.cupcakesEarned >= 99999999999) Game.Unlock(['Eclipse cupcakes', 'Zebra cupcakes']);
if (Game.cupcakesEarned >= 999999999999) Game.Unlock(['Snickerdoodles', 'Stroopwafels', 'Macaroons']);
if (Game.cupcakesEarned >= 80000000000) Game.Unlock('#Upgrade_MonosodiumGlutamate');
if (Game.cupcakesEarned >= 800000000000) Game.Unlock('#Upgrade_SatanicRitual');
if (Game.cupcakesEarned >= 200000000000) Game.Unlock('#Upgrade_SellingMedia');
if (Game.cupcakesEarned >= 1000000000000) Game.Unlock('#Upgrade_Galactus');
if (Game.cupcakesEarned >= 100000000) Game.Unlock('#Upgrade_AtomicCupcake');
if (Game.cupcakesEarned >= 30000000) {
Game.Unlock('#Upgrade_ResearchCenters');
Game.Unlock('#Upgrade_OrangeCupcake');
}
if (Game.cupcakesEarned >= 10000000) Game.Unlock('#Upgrade_StrawberryCupcake');
if (Game.cupcakesEarned >= 5000000000) Game.Unlock('#Upgrade_CosmicCupcake');
if (Game.cupcakesEarned >= 6000000000) Game.Unlock('#Upgrade_RaspberryCupcake');
if (Game.cupcakesEarned >= 7000000000) Game.Unlock('#Upgrade_CurrantCupcake');
if (Game.cupcakesEarned >= 30000000000) Game.Unlock('#Upgrade_SNUSBattery');
if (Game.cupcakesEarned >= 40000000000) {
Game.Unlock('#Upgrade_SatanicCupcake');
Game.Unlock('#Upgrade_QuantumUncertaintyCupcake');
Game.Unlock('#Upgrade_DieselpunkCupcake');
}
if (Game.cupcakesEarned >= 70000000000) {
Game.Unlock('#Upgrade_MusicCupcake');
Game.Unlock('#Upgrade_AstronomyCupcake');
}
if (Game.cupcakesEarned >= 90000000000) Game.Unlock('#Upgrade_IndustrialCupcake');
if (Game.cupcakesEarned >= 160000000000) {
Game.Unlock('#Upgrade_CursorCupcake');
Game.Unlock('#Upgrade_BritishCupcake');
}
if (Game.cupcakesEarned >= 110000000000) {
Game.Unlock('#Upgrade_BinaryCupcake');
Game.Unlock('#Upgrade_EnergyCupcake');
Game.Unlock('#Upgrade_BlackHoleCupcake');
}
if (Game.cupcakesEarned >= 130000000000) Game.Unlock('#Upgrade_LimeCupcake');
if (Game.cupcakesEarned >= 15000000000) {
Game.Unlock('#Upgrade_VanillaCupcake');
Game.Unlock('#Upgrade_Marshmallow');
}
if (Game.cupcakesEarned >= 20000000000) {
Game.Unlock('#Upgrade_StarCupcake');
Game.Unlock('#Upgrade_ChocolateCupcake');
}
if (Game.prestige['Heavenly Cupcakes'] >= 5) {
Game.Unlock('#Upgrade_CloudNineBoost');
}
if (Game.prestige['Heavenly Cupcakes'] >= 15) {
Game.Unlock('#Upgrade_HeavenlyHands');
}
if (Game.prestige['Heavenly Cupcakes'] >= 30) {
Game.Unlock('#Upgrade_DivineDeliverySystem');
}
if (Game.cupcakesEarned >= 500000000) {
Game.Unlock('#Upgrade_FoodScience');
Game.Unlock('#Upgrade_RoboticsUpgrade');
Game.Unlock('#Upgrade_SyntheticBiology');
}
//HERE FOR NEW UPGRADES
if (Game.cupcakesEarned >= 600000000) {
Game.Unlock('#Upgrade_BakingMastery');
Game.Unlock('#Upgrade_FrostingInnovation');
Game.Unlock('#Upgrade_FlavorFusion');
}
if (Game.cupcakesEarned >= 700000000) {
Game.Unlock('#Upgrade_AdvancedBaking');
Game.Unlock('#Upgrade_SunshineCoastCupcake');
}
if (Game.cupcakesEarned >= 800000000) {
Game.Unlock('#Upgrade_MidnightMagicCupcake');
Game.Unlock('#Upgrade_InterdimensionalTrade');
}
if (Game.cupcakesEarned >= 900000000) {
Game.Unlock('#Upgrade_BerryDelightCupcake');
Game.Unlock('#Upgrade_GalacticCupcake');
}
if (Game.cupcakesEarned >= 1000000000) {
Game.Unlock('#Upgrade_FreshMintCupcake');
Game.Unlock('#Upgrade_BlackberryDonut');
}
if (Game.cupcakesEarned >= 3000000000) {
Game.Unlock('#Upgrade_WickedCupcake');
Game.Unlock('#Upgrade_JapaneseCupcake');
Game.Unlock('#Upgrade_StrawberryDonut');
}
if (Game.cupcakesEarned >= 6000000000) {
Game.Unlock('#Upgrade_LimeDonut');
}
if (Game.cupcakesEarned >= 15000000000) {
Game.Unlock('#Upgrade_OceanCupcake');
}
if (Game.cupcakesEarned >= 50000000000) {
Game.Unlock('#Upgrade_SpringCupcake');
}
if (Game.cupcakesEarned >= 110000000000) {
Game.Unlock('#Upgrade_FrostyShiningCupcake');
}
if (Game.cupcakesEarned >= 9000000000) {
Game.Unlock('#Upgrade_CupcakeCookie');
Game.Unlock('#Upgrade_CandyCoconutCupcake');
}
if (Game.cupcakesEarned >= 25000000000) Game.Unlock('#Upgrade_FractalCookie');
if (Game.cupcakesEarned >= 10000000000) {
Game.Win('#Achievement_WorldFilled');
if (Game.CosmicCollapse < 1) {
Game.CosmicCollapse = 1;
//Game.goldencupcake.spawn();
Game.goldencupcake.delay = 0;
PlaySound("https://cdn.discordapp.com/attachments/1105095523616170024/1105097739274035322/thud.mp3");
}
}
if (Game.cupcakesEarned >= 100000000000) Game.Win('#Achievement_InfiniteCupcakes');
if (Game.Has('#Upgrade_SatanicCupcake')) {
Game.Win('#Achievement_DevilMadeMe');
}
if (Game.cupcakesEarned >= 999999999999 && Game.Has('Snickerdoodles') && Game.Has('Stroopwafels') && Game.Has('Macaroons')) {
Game.Unlock('Empire biscuits');
if (Game.Has('Empire biscuits')) Game.Unlock('British tea biscuits');
if (Game.Has('British tea biscuits')) Game.Unlock('Chocolate british tea biscuits');
if (Game.Has('Chocolate british tea biscuits')) Game.Unlock('Round british tea biscuits');
if (Game.Has('Round british tea biscuits')) Game.Unlock('Round chocolate british tea biscuits');
if (Game.Has('Round chocolate british tea biscuits')) Game.Unlock('Round british tea biscuits with heart motif');
if (Game.Has('Round british tea biscuits with heart motif')) Game.Unlock('Round chocolate british tea biscuits with heart motif');
}
if (Game.cupcakesEarned >= 9999999999999) Game.Unlock(['Madeleines', 'Palmiers', 'Palets', 'Sablés']);
for (var i = 0; i < Game.moneyAchievs.length / 2; i++) {
if (Game.cupcakesEarned >= Game.moneyAchievs[i * 2 + 1]) Game.Win(Game.moneyAchievs[i * 2]);
}
var buildingsOwned = 0;
var oneOfEach = 1;
var mathematician = 1;
var base10 = 1;
var centennial = 1;
for (var i in Game.Objects) {
buildingsOwned += Game.Objects[i].amount;
if (!Game.HasAchiev('One with everything')) { if (Game.Objects[i].amount == 0) oneOfEach = 0; }
if (!Game.HasAchiev('Mathematician')) { if (Game.Objects[i].amount < Math.min(128, Math.pow(2, (Game.ObjectsById.length - Game.Objects[i].id) - 1))) mathematician = 0; }
if (!Game.HasAchiev('Base 10')) { if (Game.Objects[i].amount < (Game.ObjectsById.length - Game.Objects[i].id) * 10) base10 = 0; }
if (!Game.HasAchiev('#Achievement_Centennial')) { if (Game.Objects[i].amount < 100) centennial = 0; }
}
if (oneOfEach == 1) Game.Win('One with everything');
if (mathematician == 1) Game.Win('Mathematician');
if (base10 == 1) Game.Win('Base 10');
if (centennial == 1) Game.Win('#Achievement_Centennial');
if (Game.cupcakesEarned >= 1000000 && Game.cupcakeClicks <= 15) Game.Win('#Achievement_Neverclick');
if (Game.cupcakesEarned >= 1000000 && Game.cupcakeClicks <= 0) Game.Win('#Achievement_TrueNeverclick');
if (Game.cupcakeClicks >= 2000) Game.Win('#Achievement_SkilledClicker');
if (Game.cupcakeClicks >= 5000) Game.Win('#Achievement_ClickRecruit');
if (Game.cupcakeClicks >= 11000) {
Game.Win('#Achievement_SpeedyClicker');
//Game.ClickMastery++;
}
if (Game.cupcakeClicks >= 23000) Game.Win('#Achievement_ClickMaster');
if (Game.cupcakeClicks >= 50000) Game.Win('#Achievement_ClickSensei');
if (Game.handmadecupcakes >= 1000) { Game.Win('#Achievement_Clicktastic'); Game.Unlock('#Upgrade_PlasticMouse'); }
if (Game.handmadecupcakes >= 100000) { Game.Win('#Achievement_Clickathlon'); Game.Unlock('#Upgrade_IronMouse'); }
if (Game.handmadecupcakes >= 10000000) { Game.Win('#Achievement_Clickolympics'); Game.Unlock('#Upgrade_TitaniumMouse'); }
if (Game.handmadecupcakes >= 1000000000) { Game.Win('#Achievement_Clickorama'); Game.Unlock('#Upgrade_AdamantiumMouse'); }
if (Game.handmadecupcakes >= 1500000000) { Game.Unlock('#Upgrade_VibraniumMouse'); }
if (Game.cupcakes >= 1000000000000) { Game.Win('#Achievement_CupcakeMaster'); }
if (Game.cupcakes >= 10000000000000) { Game.Win('#Achievement_GodOfCupcakes'); }
if (Game.cupcakeClicks >= 20000) Game.Win('#Achievement_ClickyClick');
if (Game.cupcakeClicks >= 30000) Game.Win('#Achievement_HellClicker');
if (Game.cupcakesEarned < Game.cupcakes) Game.Win('#Achievement_CheatedCupcakesTasteAwful');
if (buildingsOwned >= 100) Game.Win('#Achievement_Builder');
if (buildingsOwned >= 400) Game.Win('#Achievement_Architect');
if (buildingsOwned >= 800) Game.Win('#Achievement_Engineer');
if (Game.UpgradesOwned >= 20) Game.Win('#Achievement_Enhancer');
if (Game.UpgradesOwned >= 50) Game.Win('#Achievement_Augmenter');
if (Game.UpgradesOwned >= 100) Game.Win('#Achievement_Upgrader');
//HEAVENLY ACHIEVEMENTS
if (Game.prestige['Heavenly Cupcakes'] >= 10) Game.Win('#Achievement_SacredDelight');
if (Game.prestige['Heavenly Cupcakes'] >= 30) Game.Win('#Achievement_ParadiseConditions');
if (Game.prestige['Heavenly Cupcakes'] >= 70) Game.Win('#Achievement_AgainAndAgain');
if (Game.prestige['Heavenly Cupcakes'] >= 100) Game.Win('#Achievement_EndlessCycle');
if (Game.prestige['Heavenly Cupcakes'] >= 200) Game.Win('#Achievement_Reincarnation');
if (Game.prestige['Heavenly Cupcakes'] >= 500) Game.Win('#Achievement_DivineBaker');
if (Game.prestige['Heavenly Cupcakes'] >= 1000) Game.Win('#Achievement_CelestialCravings');
if (Game.prestige['Heavenly Cupcakes'] >= 2000) Game.Win('#Achievement_AngelsSweetTooth');
if (Game.prestige['Heavenly Cupcakes'] >= 5000) Game.Win('#Achievement_EtherealMastery');
if (Game.prestige['Heavenly Cupcakes'] >= 10000) Game.Win('#Achievement_DivinePerfection');
if (!Game.HasAchiev('Elder') && Game.Has('#Upgrade_FarmerBakers') && Game.Has('#Upgrade_WorkerBakers') && Game.Has('#Upgrade_CFactoryrBakers') && Game.Has('#Upgrade_CosmicBakers') && Game.Has('#Upgrade_TransmutedBakers') && Game.Has('#Upgrade_AlteredBakers') && Game.Has('#Upgrade_bakersBakers')) Game.Win('Elder');
if (Game.Objects['#Building_Baker'].amount >= 6 && !Game.Has('#Upgrade_BingoCenterResearchFacility') && Game.HasAchiev('Elder')) Game.Unlock('#Upgrade_BingoCenterResearchFacility');
if (Game.pledges > 0) Game.Win('Elder nap');
if (Game.pledges >= 5) Game.Win('Elder slumber');
if (Game.pledges >= 10) Game.Unlock('#Upgrade_SacrificialRollingPins');
if (!Game.HasAchiev('cupcake-dunker') && l('bigcupcake').getBoundingClientRect().bottom > l('coffee').getBoundingClientRect().top + 16 && Game.coffeeProgress > 0.1) Game.Win('cupcake-dunker');
}
//MARSH HERE
if (Game.Marhmall == true) {
MarshUpdateEnd();
}
Game.cupcakesd += (Game.cupcakes - Game.cupcakesd) * 0.3;
if (Game.storeToRebuild) Game.RebuildStore();
if (Game.upgradesToRebuild) Game.RebuildUpgrades();
if (Game.T % (Game.fps) == 0) document.title = Beautify(Game.cupcakes) + ' ' + (Game.cupcakes == 1 ? Localization.GetText("#UI_CupcakeOne") : Localization.GetText("#UI_CupcakePlural")) + ' - ' + Localization.GetText("#UI_GameName");
Game.TickerAge--;
if (Game.TickerAge <= 0 || Game.Ticker == '') Game.getNewTicker();
var veilLimit = 0;//10;
if (Game.veil == 1 && Game.cupcakesEarned >= veilLimit) Game.veilOff();
else if (Game.veil == 0 && Game.cupcakesEarned < veilLimit) Game.veilOn();
Game.goldencupcake.update();
Game.darkchoccupcake.update();
Game.devileye.update();
if (Game.T % (Game.fps * 60) == 0 && Game.T > Game.fps * 10 && Game.prefs.autosave) Game.WriteSave();
if (Game.T % (Game.fps * 60 * 30) == 0 && Game.T > Game.fps * 10 && Game.prefs.autoupdate) Game.CheckUpdates();
Game.T++;
for(let mod of Game.ModAPI.ModsLoaded.values())
{
if(mod.OnLogicEnd != undefined)
{
mod.OnLogicEnd();
}
}
}
/*=====================================================================================
DRAW
=======================================================================================*/
/**
* Draws all game stuff
* @returns {void}
*/
Game.Draw = function () {
for(let mod of Game.ModAPI.ModsLoaded.values())
{
if(mod.OnDrawStart != undefined)
{
mod.OnDrawStart();
}
}
if (Math.floor(Game.T % Game.fps / 4) == 0) Game.Drawbakerpocalypse();
//handle coffee and coffee accessories
if (Game.prefs.coffee) {
var x = Math.floor((Game.T * 2 + Math.sin(Game.T * 0.1) * 2 + Math.sin(Game.T * 0.03) * 2 - (Game.coffeeH - Game.coffeeHd) * 2000) % 480);
var y = 0;
var m1 = l('coffeeLayer1');
var m2 = l('coffeeLayer2');
m1.style.backgroundPosition = x + 'px ' + y + 'px';
m2.style.backgroundPosition = x + 'px ' + y + 'px';
l('coffee').style.height = (Game.coffeeHd * 100) + '%';
var m1o = 1;
var m2o = 0;
var m1i = Game.SelectedCoffee;
var m2i = Game.SelectedCoffee;
if (Game.coffeeProgress < 1) { m1o = 1; m1i = Game.SelectedCoffee; m2i = Game.SelectedCoffee; }
else if (Game.coffeeProgress < 2) { m1o = 1 - (Game.coffeeProgress - 1); m1i = Game.SelectedCoffee; m2i = Game.SelectedCoffee; }
else if (Game.coffeeProgress < 3) { m1o = 1 - (Game.coffeeProgress - 2); m1i = m1i = Game.SelectedCoffee; m2i = Game.SelectedCoffee; }
else { m1o = 1; m1i = Game.SelectedCoffee; m2i = Game.SelectedCoffee; }
m2o = 1 - m1o;
if (m1.style.backgroundImage != 'url(img/' + m1i + '.png') m1.style.backgroundImage = 'url(img/' + m1i + '.png)';
if (m2.style.backgroundImage != 'url(img/' + m2i + '.png') m2.style.backgroundImage = 'url(img/' + m2i + '.png)';
m1.style.opacity = m1o;
m2.style.opacity = m2o;
}
if (Game.prefs.particles) {
//shine
var r = Math.floor((Game.T * 0.5) % 360);
var me = l('cupcakeShine');
me.style.transform = 'rotate(' + r + 'deg)';
me.style.mozTransform = 'rotate(' + r + 'deg)';
me.style.webkitTransform = 'rotate(' + r + 'deg)';
me.style.msTransform = 'rotate(' + r + 'deg)';
me.style.oTransform = 'rotate(' + r + 'deg)';
//cursors
var r = ((-Game.T * 0.05) % 360);
var me = l('cupcakeCursors');
me.style.transform = 'rotate(' + r + 'deg)';
me.style.mozTransform = 'rotate(' + r + 'deg)';
me.style.webkitTransform = 'rotate(' + r + 'deg)';
me.style.msTransform = 'rotate(' + r + 'deg)';
me.style.oTransform = 'rotate(' + r + 'deg)';
}
//handle cursors
if (Game.prefs.particles) {
var amount = Game.Objects['#Building_Cursor'].amount;
for (var i = 0; i < amount; i++) {
var me = l('cursor' + i);
/*
var w=132;
w+=Math.pow(Math.sin(((Game.T*0.05+(i/amount)*Game.fps)%Game.fps)/Game.fps*Math.PI*3),2)*15+5;
var x=Math.floor(Math.sin((i/amount)*Math.PI*2)*w)-16;
var y=Math.floor(Math.cos((i/amount)*Math.PI*2)*w)-16;
*/
var n = Math.floor(i / 50);
var a = ((i + 0.5 * n) % 50) / 50;
var w = 0;
w = (Math.sin(Game.T * 0.025 + (((i + n * 12) % 25) / 25) * Math.PI * 2));
if (w > 0.997) w = 1.5;
else if (w > 0.994) w = 0.5;
else w = 0;
w *= -4;
//w+=Math.pow(Math.sin(((Game.T*0.05+(i/amount)*Game.fps)%Game.fps)/Game.fps*Math.PI*3),2)*15+5;
var x = (Math.sin(a * Math.PI * 2) * (140 + n * 16 + w)) - 16;
var y = (Math.cos(a * Math.PI * 2) * (140 + n * 16 + w)) - 16;
var r = Math.floor(-(a) * 360);
me.style.left = x + 'px';
me.style.top = y + 'px';
}
}
//handle cupcakes
if (Game.prefs.particles) {
if (Game.elderWrathD <= 1.5) {
if (Game.cupcakesPs >= 1000) l('cupcakeShower').style.backgroundImage = 'url(img/cupcakeShower3.png)';
else if (Game.cupcakesPs >= 500) l('cupcakeShower').style.backgroundImage = 'url(img/cupcakeShower2.png)';
else if (Game.cupcakesPs >= 50) l('cupcakeShower').style.backgroundImage = 'url(img/cupcakeShower1.png)';
else l('cupcakeShower').style.backgroundImage = 'none';
l('cupcakeShower').style.backgroundPosition = '0px ' + (Math.floor(Game.T * 2) % 512) + 'px';
}
if (Game.elderWrathD >= 1 && Game.elderWrathD < 1.5) l('cupcakeShower').style.opacity = 1 - ((Game.elderWrathD - 1) / 0.5);
}
var unit = (Math.round(Game.cupcakesd) == 1 ? ' ' + Localization.GetText("#UI_CupcakeOne") : ' ' + Localization.GetText("#UI_CupcakePlural"));
if (Math.round(Game.cupcakesd).toString().length > 11) unit = '<br>' + Localization.GetText("#UI_CupcakePlural");
l('cupcakes').innerHTML = Beautify(Math.round(Game.cupcakesd)) + unit + Localization.GetText("#UI_CupcakesPerSecconds").format(Beautify(Game.cupcakesPs, 1));//display cupcake amount
/*
var el=l('bigcupcake');
var s=Math.pow(Math.min(1,Game.cupcakes/100000),0.5)*1+0.5;
el.style.transform='scale('+s+')';
el.style.mozTransform='scale('+s+')';
el.style.webkitTransform='scale('+s+')';
el.style.msTransform='scale('+s+')';
el.style.oTransform='scale('+s+')';
*/
Game.TickerDraw();
for (var i in Game.Objects) {
var me = Game.Objects[i];
//make products full-opacity if we can buy them
if (Game.cupcakes >= me.price) l('product' + me.id).className = 'product enabled'; else l('product' + me.id).className = 'product disabled';
//update object info
if (l('rowInfo' + me.id) && Game.T % 5 == 0) l('rowInfoContent' + me.id).innerHTML = '• ' + me.amount + ' ' + (me.amount == 1 ? me.single : me.plural) + '<br>• producing ' + Beautify(me.storedTotalCps, 1) + ' ' + (me.storedTotalCps == 1 ? 'cupcake' : 'cupcakes') + ' per second<br>• total : ' + Beautify(me.totalcupcakes) + ' ' + (Math.floor(me.totalcupcakes) == 1 ? 'cupcake' : 'cupcakes') + ' ' + me.actionName;
}
//make upgrades full-opacity if we can buy them
for (var i in Game.UpgradesInStore) {
var me = Game.UpgradesInStore[i];
if (Game.cupcakes >= me.getPrice()) l('upgrade' + i).className = 'crate upgrade enabled'; else l('upgrade' + i).className = 'crate upgrade disabled';
}
if (Math.floor(Game.T % Game.fps / 2) == 0) Game.UpdateMenu();
for(let mod of Game.ModAPI.ModsLoaded.values())
{
if(mod.OnDrawEnd != undefined)
{
mod.OnDrawEnd();
}
}
// They all calculates opacity and shifting so it's not drawing functions (explanation for modmakers)
Game.cupcakeParticlesUpdate();
Game.cupcakeNumbersUpdate();
Game.particlesUpdate();
}
/*=====================================================================================
MAIN LOOP
=======================================================================================*/
/**
* Main game loop
* @returns {void}
*/
Game.Loop = function () {
if (Game.Updt == 0) {
Game.UpdateReset();
Game.Updt = 1;
}
//update game logic !
Game.catchupLogic = 0;
Game.Logic();
Game.catchupLogic = 1;
//latency compensator
Game.accumulatedDelay += ((new Date().getTime() - Game.time) - 1000 / Game.fps);
Game.accumulatedDelay = Math.min(Game.accumulatedDelay, 1000 * 5);//don't compensate over 5 seconds; if you do, something's probably very wrong
Game.time = new Date().getTime();
while (Game.accumulatedDelay > 0) {
Game.Logic();
Game.accumulatedDelay -= 1000 / Game.fps;//as long as we're detecting latency (slower than target fps), execute logic (this makes drawing slower but makes the logic behave closer to correct target fps)
}
Game.catchupLogic = 0;
Game.Draw();
setTimeout(Game.Loop, 1000 / Game.fps);
}
}
/*=====================================================================================
LAUNCH THIS THING
=======================================================================================*/
Game.Launch();
window.onload = function () {
if (!Game.ready) Game.Init();
};