@@ -35,37 +35,30 @@ interface ClickerCookieSaveData {
3535 // keyboard
3636 keyboardsBought : number ;
3737 keyboardCPSGain : number ;
38- keyboardUpgradeCost : number ;
3938 keyboardCPSGiven : number ;
4039 // grandpa
4140 grandpasBought : number ;
4241 grandpaCPSGain : number ;
43- grandpaUpgradeCost : number ;
4442 grandpaCPSGiven : number ;
4543 // ranch
4644 ranchesBought : number ;
4745 ranchCPSGain : number ;
48- ranchUpgradeCost : number ;
4946 ranchCPSGiven : number ;
5047 // television
5148 televisionsBought : number ;
5249 televisionCPSGain : number ;
53- televisionUpgradeCost : number ;
5450 televisionCPSGiven : number ;
5551 // worker
5652 workersBought : number ;
5753 workerCPSGain : number ;
58- workerUpgradeCost : number ;
5954 workerCPSGiven : number ;
6055 // wallet
6156 walletsBought : number ;
6257 walletCPSGain : number ;
63- walletUpgradeCost : number ;
6458 walletCPSGiven : number ;
6559 // church
6660 churchesBought : number ;
6761 churchCPSGain : number ;
68- churchUpgradeCost : number ;
6962 churchCPSGiven : number ;
7063
7164 /* upgrades */
@@ -131,56 +124,56 @@ export default class ClickerCookie extends Mod {
131124 // buildings and stuff
132125 this . BUILDINGS_DATA = {
133126 keyboard : {
134- name : "keyboard " ,
135- namePlural : "keyboards " ,
127+ name : "Keyboard " ,
128+ namePlural : "Keyboards " ,
136129 quote : "type in cookies" ,
137130 upgradeCost : 15 ,
138131 CPSGain : 0.1 ,
139132 img : "img/keyboard.png"
140133 } ,
141134 grandpa : {
142- name : "grandpa " ,
143- namePlural : "grandpas " ,
135+ name : "Grandpa " ,
136+ namePlural : "Grandpas " ,
144137 quote : "as long as gramps gets a cut" ,
145138 upgradeCost : 100 ,
146139 CPSGain : 1 ,
147140 img : "img/grandpa.png"
148141 } ,
149142 ranch : {
150- name : "ranch " ,
151- namePlural : "ranches " ,
143+ name : "Ranch " ,
144+ namePlural : "Ranches " ,
152145 quote : "not the dressing kind" ,
153146 upgradeCost : 1_100 ,
154147 CPSGain : 8 ,
155148 img : "img/ranch.png"
156149 } ,
157150 television : {
158- name : "television " ,
159- namePlural : "televisions " ,
151+ name : "Television " ,
152+ namePlural : "Televisions " ,
160153 quote : "hold infomercials on your cookies" ,
161154 upgradeCost : 12_000 ,
162155 CPSGain : 47 ,
163156 img : "img/tv.png"
164157 } ,
165158 worker : {
166- name : "worker " ,
167- namePlural : "workers " ,
159+ name : "Worker " ,
160+ namePlural : "Workers " ,
168161 quote : "cookies via manual labor" ,
169162 upgradeCost : 130_000 ,
170163 CPSGain : 260 ,
171164 img : "img/worker.png"
172165 } ,
173166 wallet : {
174- name : "wallet " ,
175- namePlural : "wallets " ,
167+ name : "Wallet " ,
168+ namePlural : "Wallets " ,
176169 quote : "more storage space for your vast amount of cookie income" ,
177170 upgradeCost : 1_400_000 ,
178171 CPSGain : 1_440 ,
179172 img : "img/wallet.png"
180173 } ,
181174 church : {
182- name : "church " ,
183- namePlural : "churches " ,
175+ name : "Church " ,
176+ namePlural : "Churches " ,
184177 quote : "pray to the almighty cookie gods" ,
185178 upgradeCost : 20_000_000 ,
186179 CPSGain : 7_800 ,
@@ -203,14 +196,6 @@ export default class ClickerCookie extends Mod {
203196 this . church = new Building ( this , this . BUILDINGS_DATA . church ) ;
204197 this . church . setVisibility ( false ) ;
205198
206- Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "keyboard" ) , this . keyboard ) ;
207- Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "grandpa" ) , this . grandpa ) ;
208- Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "ranch" ) , this . ranch ) ;
209- Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "television" ) , this . television ) ;
210- Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "worker" ) , this . worker ) ;
211- Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "wallet" ) , this . wallet ) ;
212- Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "church" ) , this . church ) ;
213-
214199 // upgrades
215200 this . UPGRADES_DATA = [
216201 // keyboard
@@ -577,11 +562,6 @@ export default class ClickerCookie extends Mod {
577562 }
578563 ] ;
579564
580- for ( const upgradeData of this . UPGRADES_DATA ) {
581- Handlers . UPGRADE . register ( new Identifier ( this . NAMESPACE , upgradeData . uid ) , new Upgrade ( this , upgradeData ) ) ;
582- }
583-
584- Mod . registerKooh ( "init" , ( ) => { this . init ( ) } ) ;
585565 Mod . registerKooh ( "click" , ( ) => { this . cookieClicked ( ) } ) ;
586566 Mod . registerKooh ( "loop" , ( ) => { this . gameLoop ( ) } ) ;
587567 Mod . registerKooh ( "cps" , ( ) => { this . cpsUpdate ( ) } ) ;
@@ -593,11 +573,23 @@ export default class ClickerCookie extends Mod {
593573 Handlers . UPGRADE . getFromIdentifier ( new Identifier ( this . NAMESPACE , "keyboard5" ) ) . desc = `Multiplys Keyboard and clicking ${ Handlers . CURRENTLY_CLICKED . getCurrentlyClicked ( ) . name . toLowerCase ( ) } production by 2` ;
594574
595575 Handlers . BUILDING . getFromIdentifier ( new Identifier ( this . NAMESPACE , "keyboard" ) ) . quote = `type in ${ Handlers . CURRENTLY_CLICKED . getCurrentlyClicked ( ) . namePlural . toLowerCase ( ) } ` ;
596- Handlers . BUILDING . getFromIdentifier ( new Identifier ( this . NAMESPACE , "television" ) ) . quote = `hold infomercials on your ${ Handlers . CURRENTLY_CLICKED . getCurrentlyClicked ( ) . name . toLowerCase ( ) } ` ;
576+ Handlers . BUILDING . getFromIdentifier ( new Identifier ( this . NAMESPACE , "television" ) ) . quote = `hold infomercials on your ${ Handlers . CURRENTLY_CLICKED . getCurrentlyClicked ( ) . namePlural . toLowerCase ( ) } ` ;
597577 } ) ;
598578 }
599579
600580 init ( ) {
581+ Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "keyboard" ) , this . keyboard ) ;
582+ Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "grandpa" ) , this . grandpa ) ;
583+ Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "ranch" ) , this . ranch ) ;
584+ Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "television" ) , this . television ) ;
585+ Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "worker" ) , this . worker ) ;
586+ Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "wallet" ) , this . wallet ) ;
587+ Handlers . BUILDING . register ( new Identifier ( this . NAMESPACE , "church" ) , this . church ) ;
588+
589+ for ( const upgradeData of this . UPGRADES_DATA ) {
590+ Handlers . UPGRADE . register ( new Identifier ( this . NAMESPACE , upgradeData . uid ) , new Upgrade ( this , upgradeData ) ) ;
591+ }
592+
601593 // Register personalization things (must be before save load because loading requires these to be registered to set them)
602594 Handlers . CURRENTLY_CLICKED . register ( new Identifier ( this . NAMESPACE , "cookie" ) , { name : "Cookie" , namePlural : "Cookies" , src : "img/cookie.png" } ) ;
603595 Handlers . CURRENTLY_CLICKED . register ( new Identifier ( this . NAMESPACE , "potato" ) , { name : "Potato" , namePlural : "Potatoes" , src : "img/potato.png" } ) ;
@@ -695,37 +687,30 @@ export default class ClickerCookie extends Mod {
695687 // keyboard
696688 keyboardsBought : this . keyboard . bought ,
697689 keyboardCPSGain : this . keyboard . CPSGain ,
698- keyboardUpgradeCost : this . keyboard . upgradeCost ,
699690 keyboardCPSGiven : this . keyboard . CPSGiven ,
700691 // grandpa
701692 grandpasBought : this . grandpa . bought ,
702693 grandpaCPSGain : this . grandpa . CPSGain ,
703- grandpaUpgradeCost : this . grandpa . upgradeCost ,
704694 grandpaCPSGiven : this . grandpa . CPSGiven ,
705695 // ranch
706696 ranchesBought : this . ranch . bought ,
707697 ranchCPSGain : this . ranch . CPSGain ,
708- ranchUpgradeCost : this . ranch . upgradeCost ,
709698 ranchCPSGiven : this . ranch . CPSGiven ,
710699 // television
711700 televisionsBought : this . television . bought ,
712701 televisionCPSGain : this . television . CPSGain ,
713- televisionUpgradeCost : this . television . upgradeCost ,
714702 televisionCPSGiven : this . television . CPSGiven ,
715703 // worker
716704 workersBought : this . worker . bought ,
717705 workerCPSGain : this . worker . CPSGain ,
718- workerUpgradeCost : this . worker . upgradeCost ,
719706 workerCPSGiven : this . worker . CPSGiven ,
720707 // wallet
721708 walletsBought : this . wallet . bought ,
722709 walletCPSGain : this . wallet . CPSGain ,
723- walletUpgradeCost : this . wallet . upgradeCost ,
724710 walletCPSGiven : this . wallet . CPSGiven ,
725711 // church
726712 churchesBought : this . church . bought ,
727713 churchCPSGain : this . church . CPSGain ,
728- churchUpgradeCost : this . church . upgradeCost ,
729714 churchCPSGiven : this . church . CPSGiven ,
730715
731716 /* upgrades */
@@ -756,37 +741,30 @@ export default class ClickerCookie extends Mod {
756741 // keyboard
757742 this . keyboard . bought = saveData . keyboardsBought ;
758743 this . keyboard . CPSGain = saveData . keyboardCPSGain ;
759- this . keyboard . upgradeCost = saveData . keyboardUpgradeCost ;
760744 this . keyboard . CPSGiven = saveData . keyboardCPSGiven ;
761745 // grandpa
762746 this . grandpa . bought = saveData . grandpasBought ;
763747 this . grandpa . CPSGain = saveData . grandpaCPSGain ;
764- this . grandpa . upgradeCost = saveData . grandpaUpgradeCost ;
765748 this . grandpa . CPSGiven = saveData . grandpaCPSGiven ;
766749 // ranch
767750 this . ranch . bought = saveData . ranchesBought ;
768751 this . ranch . CPSGain = saveData . ranchCPSGain ;
769- this . ranch . upgradeCost = saveData . ranchUpgradeCost ;
770752 this . ranch . CPSGiven = saveData . ranchCPSGiven ;
771753 // television
772754 this . television . bought = saveData . televisionsBought ;
773755 this . television . CPSGain = saveData . televisionCPSGain ;
774- this . television . upgradeCost = saveData . televisionUpgradeCost ;
775756 this . television . CPSGiven = saveData . televisionCPSGiven ;
776757 // worker
777758 this . worker . bought = saveData . workersBought ;
778759 this . worker . CPSGain = saveData . workerCPSGain ;
779- this . worker . upgradeCost = saveData . workerUpgradeCost ;
780760 this . worker . CPSGiven = saveData . workerCPSGiven ;
781761 // wallet
782762 this . wallet . bought = saveData . walletsBought ;
783763 this . wallet . CPSGain = saveData . walletCPSGain ;
784- this . wallet . upgradeCost = saveData . walletUpgradeCost ;
785764 this . wallet . CPSGiven = saveData . walletCPSGiven ;
786765 // church
787766 this . church . bought = saveData . churchesBought ;
788767 this . church . CPSGain = saveData . churchCPSGain ;
789- this . church . upgradeCost = saveData . churchUpgradeCost ;
790768 this . church . CPSGiven = saveData . churchCPSGiven ;
791769 // ...
792770
0 commit comments