diff --git a/src/assets/assets.ts b/src/assets/assets.ts index 11ac768..700e719 100644 --- a/src/assets/assets.ts +++ b/src/assets/assets.ts @@ -117,6 +117,7 @@ const images: Image[] = [ //temp image('temp/invwindow', 'invwindow'), + image('temp/shopwindow', 'shopwindow'), image('temp/lugia', 'lugia'), image('temp/protogen', 'protogen'), image('temp/triceratops', 'triceratops'), @@ -135,7 +136,7 @@ const images: Image[] = [ /* Spritesheets */ const spritesheets: SpriteSheet[] = [ //temp - spritesheet('temp/invbutton', 'invbutton', 128, 128), + spritesheet('temp/invbutton', 'invbutton', 240, 480), spritesheet('temp/fwbutton', 'fwbutton', 64, 262), spritesheet('temp/rock', 'rock', 100, 100), spritesheet('temp/coke', 'coke', 100, 100), @@ -157,6 +158,8 @@ const spritesheets: SpriteSheet[] = [ spritesheet('temp/greensparks', 'greenspark', 64, 64), spritesheet('temp/defaultsparks', 'defaultspark', 64, 64), spritesheet('temp/blankspr', 'blankspr', 100, 100), + spritesheet('temp/buybutton', 'buybutton', 120, 90), + spritesheet('temp/otter', 'otter', 1080, 1080), ]; /* Audios */ @@ -182,6 +185,8 @@ const audios: Audio[] = [ sound('bite', 'bite', 0.5), sound('doink', 'doink', 0.5), sound('slurp', 'slurp', 0.5), + sound('pickupcustomer', 'pickup', 0.5), + sound('dropcustomer', 'drop', 0.5), sound('tree/meme_explosion_sound', 'meme_explosion_sound', 0.5), ]; diff --git a/src/assets/images/temp/buybutton.png b/src/assets/images/temp/buybutton.png new file mode 100644 index 0000000..3a2ec35 Binary files /dev/null and b/src/assets/images/temp/buybutton.png differ diff --git a/src/assets/images/temp/invbutton.png b/src/assets/images/temp/invbutton.png index 8193665..1836cc5 100644 Binary files a/src/assets/images/temp/invbutton.png and b/src/assets/images/temp/invbutton.png differ diff --git a/src/assets/images/temp/otter.png b/src/assets/images/temp/otter.png new file mode 100644 index 0000000..d4a003d Binary files /dev/null and b/src/assets/images/temp/otter.png differ diff --git a/src/assets/images/temp/shopwindow.png b/src/assets/images/temp/shopwindow.png new file mode 100644 index 0000000..907a45e Binary files /dev/null and b/src/assets/images/temp/shopwindow.png differ diff --git a/src/assets/sounds/dropcustomer.mp3 b/src/assets/sounds/dropcustomer.mp3 new file mode 100644 index 0000000..e22d88c Binary files /dev/null and b/src/assets/sounds/dropcustomer.mp3 differ diff --git a/src/assets/sounds/pickupcustomer.mp3 b/src/assets/sounds/pickupcustomer.mp3 new file mode 100644 index 0000000..c18d01f Binary files /dev/null and b/src/assets/sounds/pickupcustomer.mp3 differ diff --git a/src/components/Customer.ts b/src/components/Customer.ts index 9fb890b..af64ae3 100644 --- a/src/components/Customer.ts +++ b/src/components/Customer.ts @@ -73,6 +73,8 @@ export class Customer extends Button { public itemList: number[]; public sprList: Phaser.GameObjects.Sprite[]; + private garchomp: boolean; + private testTimer: PatienceTimer; private eatDelay: number = 0; @@ -654,6 +656,22 @@ export class Customer extends Button { this.parseHappiness(); } + pauseClickable(){ + if(!(this.sprite.input!.enabled)) { + this.garchomp = true; + } else { + this.sprite.input!.enabled = false; + } + } + + resumeClickable(){ + if(this.garchomp) { + this.garchomp = false; + } else { + this.sprite.input!.enabled = true; + } + } + /* Getters */ get isWaiting(): boolean { diff --git a/src/components/Employee.ts b/src/components/Employee.ts index aae3ce0..69246c1 100644 --- a/src/components/Employee.ts +++ b/src/components/Employee.ts @@ -19,6 +19,8 @@ export class Employee extends Button { private sprite: Phaser.GameObjects.Sprite; // private graphics: Phaser.GameObjects.Graphics; + private linoone: boolean = false; + public startX: number; public startY: number; @@ -78,6 +80,11 @@ export class Employee extends Button { } this.currentCustomer = customer; + if(this.currentCustomer){ + if(this.currentCustomer.currentStation) { + this.currentCustomer.currentStation.taskHaste*=this.workSpeed; + } + } } walk(path: Phaser.Curves.Path) { @@ -140,6 +147,22 @@ export class Employee extends Button { } } + pauseClickable(){ + if(!(this.sprite.input!.enabled)){ + this.linoone = true; + } else { + this.sprite.input!.enabled = false; + } + } + + resumeClickable(){ + if(this.linoone) { + this.linoone = false; + } else { + this.sprite.input!.enabled = true; + } + } + // Only used when loading levels forceUpgrade(id: EmployeeId) { this.hasBeenPurchased = true; diff --git a/src/components/EmployeeData.ts b/src/components/EmployeeData.ts index 3877856..3e81076 100644 --- a/src/components/EmployeeData.ts +++ b/src/components/EmployeeData.ts @@ -132,7 +132,7 @@ export const EmployeeData: { [key in EmployeeId]: EmployeeInterface } = { name: "Raccoon employee", tier: 2, walkSpeed: 3, - workSpeed: 2, + workSpeed: 1.25, cost: 400, upgradeTo: EmployeeId.RaccoonGrayTier3, }, @@ -140,8 +140,8 @@ export const EmployeeData: { [key in EmployeeId]: EmployeeInterface } = { type: EmployeeType.RaccoonGray, name: "Raccoon employee", tier: 3, - walkSpeed: 5, - workSpeed: 3, + walkSpeed: 4, + workSpeed: 1.5, cost: 800, }, @@ -149,54 +149,54 @@ export const EmployeeData: { [key in EmployeeId]: EmployeeInterface } = { type: EmployeeType.RaccoonBrown, name: "Raccoon employee", tier: 1, - walkSpeed: 2, + walkSpeed: 2.5, workSpeed: 1, - cost: 300, + cost: 350, upgradeTo: EmployeeId.RaccoonBrownTier2, }, [EmployeeId.RaccoonBrownTier2]: { type: EmployeeType.RaccoonBrown, name: "Raccoon employee", tier: 2, - walkSpeed: 3, - workSpeed: 2, - cost: 400, + walkSpeed: 4, + workSpeed: 1.125, + cost: 475, upgradeTo: EmployeeId.RaccoonBrownTier3, }, [EmployeeId.RaccoonBrownTier3]: { type: EmployeeType.RaccoonBrown, name: "Raccoon employee", tier: 3, - walkSpeed: 5, - workSpeed: 3, - cost: 800, + walkSpeed: 5.5, + workSpeed: 1.25, + cost: 950, }, [EmployeeId.RaccoonYellowTier1]: { type: EmployeeType.RaccoonYellow, name: "Raccoon employee", tier: 1, - walkSpeed: 2, + walkSpeed: 1, workSpeed: 1, - cost: 300, + cost: 375, upgradeTo: EmployeeId.RaccoonYellowTier2, }, [EmployeeId.RaccoonYellowTier2]: { type: EmployeeType.RaccoonYellow, name: "Raccoon employee", tier: 2, - walkSpeed: 3, - workSpeed: 2, - cost: 400, + walkSpeed: 2.5, + workSpeed: 1.5, + cost: 525, upgradeTo: EmployeeId.RaccoonYellowTier3, }, [EmployeeId.RaccoonYellowTier3]: { type: EmployeeType.RaccoonYellow, name: "Raccoon employee", tier: 3, - walkSpeed: 5, - workSpeed: 3, - cost: 800, + walkSpeed: 4, + workSpeed: 2, + cost: 1050, }, [EmployeeId.RaccoonPurpleTier1]: { @@ -205,78 +205,78 @@ export const EmployeeData: { [key in EmployeeId]: EmployeeInterface } = { tier: 1, walkSpeed: 2, workSpeed: 1, - cost: 300, + cost: 600, upgradeTo: EmployeeId.RaccoonPurpleTier2, }, [EmployeeId.RaccoonPurpleTier2]: { type: EmployeeType.RaccoonPurple, name: "Raccoon employee", tier: 2, - walkSpeed: 3, - workSpeed: 2, - cost: 400, + walkSpeed: 3.5, + workSpeed: 1.5, + cost: 900, upgradeTo: EmployeeId.RaccoonPurpleTier3, }, [EmployeeId.RaccoonPurpleTier3]: { type: EmployeeType.RaccoonPurple, name: "Raccoon employee", tier: 3, - walkSpeed: 5, - workSpeed: 3, - cost: 800, + walkSpeed: 6, + workSpeed: 2, + cost: 1800, }, [EmployeeId.RaccoonGreenTier1]: { type: EmployeeType.RaccoonGreen, name: "Raccoon employee", - tier: 1, - walkSpeed: 2, + tier: 4, + walkSpeed: 3, workSpeed: 1, - cost: 300, + cost: 800, upgradeTo: EmployeeId.RaccoonGreenTier2, }, [EmployeeId.RaccoonGreenTier2]: { type: EmployeeType.RaccoonGreen, name: "Raccoon employee", tier: 2, - walkSpeed: 3, + walkSpeed: 6, workSpeed: 2, - cost: 400, + cost: 1600, upgradeTo: EmployeeId.RaccoonGreenTier3, }, [EmployeeId.RaccoonGreenTier3]: { type: EmployeeType.RaccoonGreen, name: "Raccoon employee", tier: 3, - walkSpeed: 5, + walkSpeed: 9, workSpeed: 3, - cost: 800, + cost: 2400, }, [EmployeeId.HumanTier1]: { type: EmployeeType.Human, name: "Human employee", tier: 1, - walkSpeed: 2, + walkSpeed: 1, workSpeed: 1, - cost: 1000, + cost: 2500, upgradeTo: EmployeeId.HumanTier2, }, [EmployeeId.HumanTier2]: { type: EmployeeType.Human, name: "Human employee", tier: 2, - walkSpeed: 3, - workSpeed: 2, - cost: 400, + walkSpeed: 1.25, + workSpeed: 1.05, + cost: 5000, upgradeTo: EmployeeId.HumanTier3, }, [EmployeeId.HumanTier3]: { type: EmployeeType.Human, name: "Human employee", tier: 3, - walkSpeed: 5, - workSpeed: 3, - cost: 800, + walkSpeed: 1.5, + workSpeed: 1.15, + cost: 9999, }, }; diff --git a/src/components/Inventory.ts b/src/components/Inventory.ts index e5755dc..7ad5619 100644 --- a/src/components/Inventory.ts +++ b/src/components/Inventory.ts @@ -170,6 +170,10 @@ export class Inventory extends Phaser.GameObjects.Container { } + buyItem(id: number, qt: number){ + this.itemList[id].quant += qt; + } + updateAmountText(id:number, i: number){ if(i > 0) { this.title.setText(this.itemList[id].name + " x" + i); diff --git a/src/components/ShopInventory.ts b/src/components/ShopInventory.ts new file mode 100644 index 0000000..d60dcae --- /dev/null +++ b/src/components/ShopInventory.ts @@ -0,0 +1,387 @@ +import { BaseScene } from "@/scenes/BaseScene"; +import { GameScene } from "@/scenes/GameScene"; +import { Item } from "./Item"; +import { SimpleButton } from "./elements/SimpleButton"; +import { ShopItem } from "./ShopItem"; +import { SnapType } from "./Item"; +import { BuyButton } from "./elements/BuyButton"; + +export class ShopInventory extends Phaser.GameObjects.Container { + public scene: GameScene; + public isOpen: boolean = false; + public itemList: Item[]; + public display: ShopItem[]; + public window: Phaser.GameObjects.Image; + public fwButton: SimpleButton; + + public buy1: BuyButton; + public buy5: BuyButton; + public buy10: BuyButton; + public buyall: BuyButton; + + public pricedisp: Phaser.GameObjects.Text; + public myinvdisp: Phaser.GameObjects.Text; + + public title: Phaser.GameObjects.Text; + public tdisplay: Phaser.GameObjects.Text; + private highlightIndex: number = -1; + private currentIndices: number[] = [0,8]; + private coordinates: number[][] = [ + [64,64], [148,64], [232,64], + [64,148], [148,148], [232,148], + [64,232], [148,232], [232,232], + ]; + constructor(scene:GameScene, x:number, y:number, stock:number[]){ + super(scene,x,y); + this.scene=scene; + this.itemList = [ + new Item(0,"rock",stock[0],1,["rock","cheap"],["cheap"],"Complimentary Pet Rock","A loving pet rock to cheer up any customer. Works modestly well.", SnapType.CUSTOMER, "doink"), + new Item(1,"coke",stock[1],10,["drug"],["illegal","cool"],"Sugar","A delicious white powder made from plants. Improves working speed a whole bunch!", SnapType.STATION, "chomp"), + new Item(2,"hotdog",stock[2],12,["raptor","meat","bread","skeleton","ketchup","mustard","gay"],["meat","elitist","gay","gluten"],"Hot Dog","A big wiener with sauce, to satisfy any meat lover. You can also buy a bacon-wrapped cheesy version for 69 kr.", SnapType.CUSTOMER, "chomp"), + new Item(3,"brocc",stock[3],12,["triceratops","veggie","healthy","stinky"],["veggie","healthy","stinky"],"Broccoli","This large stalk of free-range broccoli is perfect for vegans and herbivorous animals.", SnapType.CUSTOMER, "chomp"), + new Item(4,"usb",stock[4],15,["protogen","tech","metal","nerd"],["nerd","tech"],"Mini USB Drive", "Additional storage space in a compact unit. I wonder who would want this?", SnapType.CUSTOMER, "doink"), + new Item(5,"milk",stock[5],15,["dragon","horny","creamy","lactose","gay"],["horny","creamy","lactose","gay"],"Fresh Milk","Fresh, creamy milk for dragons to grow strong bones. Still warm and thick.", SnapType.CUSTOMER, "slurp"), + new Item(6,"snowglobe",stock[6],20,["lugia","kitsch","cold","ball"],["kitsch","cold","ball"],"Snowglobe","A cute little snowglobe. A certain type of customer might want this.", SnapType.CUSTOMER, "doink"), + new Item(7,"pocky",stock[7],20,["boykisser","weeb","cringe","sweet","chocolate"],["weeb","cringe","sweet"],"P*cky","Sweet snack made of edible sticks. There's a traditional game where you kiss while biting them. A favorite of virgins.", SnapType.CUSTOMER, "chomp"), + new Item(8,"hourglass",stock[8],30,["time","physics","glass"],["physics"],"Hourglass","Place on a workstation to fully turn back the time on a customer's patience. Might make it hard to work though...", SnapType.STATION, "doink"), + new Item(9,"hypnosis",stock[9],30,["hypno","horny","kinky","weird","psychic"],["horny","kinky","weird"],"Hypnosis","Uses a state of hypnosis to keep a customer's patience constant. You can't increase it any more either though.", SnapType.CUSTOMER, "doink"), + new Item(10,"polish",stock[10],50,["expensive","creamy","musky"],["expensive","musky"],"Extra-Premium Polish","Put this on a station to give scales a wonderful gloss and unique scent. Most customers love it, but comes at a premium.", SnapType.STATION, "slurp"), + new Item(11,"pillowtalk",stock[11],40,["horny","soft","cringe"],["horny","cringe"],"Pillow Talk","Instruct a station to talk to a customer alluringly and have them use more services. Good telemarketing is vital!", SnapType.STATION, "slurp"), + new Item(12,"shuriken",stock[12],25,["sharp","weeb","ninja","cringe","cool"],["cool","cringe","weeb","sharp"],"Shuriken","Equip a station to allow the stylists to critically strike when grooming! It's some type of mysterious fidget spinner that sharpens mental capabilites. ", SnapType.STATION, "meme_explosion_sound"), + ]; + this.display = []; + this.window = new Phaser.GameObjects.Image(this.scene,x,y,"shopwindow"); + this.window.setAlpha(0.85); + //this.window.setVisible(false); + this.window.setOrigin(-1,0); + this.add(this.window); + this.window.setDepth(1); + this.title = this.scene.addText({ + x: 75, + y: 760, + size: 30, + color: "#FFFFFF", + text: "", + }); + this.tdisplay = this.scene.addText({ + x: 75, + y: 845, + size: 25, + color: "#FFFFFF", + text: "", + }); + this.tdisplay.setWordWrapWidth(500); + this.add(this.title); + this.add(this.tdisplay); + this.fwButton = new SimpleButton(this.scene,580,400,"","fwbutton",10); + this.fwButton.on("click", ()=> {this.scroll()}); + this.add(this.fwButton); + this.scene.add.existing(this); + + this.buy1 = new BuyButton(this.scene, 390,602,"Buy 1", "buybutton", this, 1, 20); + this.buyall = new BuyButton(this.scene, 390,690,"Buy All", "buybutton", this, -99, 20); + this.buy5 = new BuyButton(this.scene, 520,602,"Buy 5", "buybutton", this, 5, 20); + this.buy10 = new BuyButton(this.scene, 520,690,"Buy 10", "buybutton", this, 10, 20); + + this.buy1.on("click", ()=> {this.buy(this.buy1.mode)}); + this.buy5.on("click", ()=> {this.buy(this.buy5.mode)}); + this.buy10.on("click", ()=> {this.buy(this.buy10.mode)}); + this.buyall.on("click", ()=> {this.buy(this.buyall.mode)}); + + this.add(this.buy1); + this.add(this.buy5); + this.add(this.buy10); + this.add(this.buyall); + + this.disableAllBuyButtons(); + + this.pricedisp = this.scene.addText({ + x: 80, + y: 594, + size: 24, + color: "#FFFFFF", + text: "", + }); + this.pricedisp.setVisible(false); + this.add(this.pricedisp); + + + this.myinvdisp= this.scene.addText({ + x: 80, + y: 682, + size: 24, + color: "#FFFFFF", + text: "", + }); + //this.myinvdisp.setVisible(false); + this.myinvdisp.setVisible(false); + this.add(this.myinvdisp); + + } + + unhighlight(){ + for(let p=0; p 0 || n == -99) { + if(n == -99) { + nr = this.itemList[this.highlightIndex].quant; + } + + let pr = nr*this.itemList[this.highlightIndex].price; + if(pr > this.scene.money) { + this.scene.sound.play("fail"); + return; + } + + this.scene.buyItem(this.highlightIndex,nr); + this.scene.removeMoney(pr); + this.itemList[this.highlightIndex].quant -= nr; + if(this.itemList[this.highlightIndex].quant <= 0){ + this.itemList[this.highlightIndex].quant = 0; + this.display[this.highlightIndex].shadow(); + this.updateButtons(this.highlightIndex); + this.hideInvDisp(); + this.clearPriceDisp(); + this.clearTextDisplays(); + } else { + this.display[this.highlightIndex].updateAmt(this.itemList[this.highlightIndex].quant); + this.updateButtons(this.highlightIndex); + this.updateInvDisp(this.highlightIndex); + this.updatePriceDisp(n); + } + } + } + + clearTextDisplays(){ + this.title.setVisible(false); + this.tdisplay.setVisible(false); + } + + updateInvDisp(id: number){ + this.myinvdisp.setVisible(true); + this.myinvdisp.setText("Owned: x" + this.scene.getAmountOwned(id)); + } + + hideInvDisp(){ + this.myinvdisp.setVisible(false); + } + + clearInvDisp(){ + this.myinvdisp.setText(""); + this.myinvdisp.setVisible(false); + } + + updatePriceDisp(qt: number){ + this.pricedisp.setColor("White"); + let qr = qt*this.itemList[this.highlightIndex].price; + if(this.highlightIndex > 0) { + if(qt == -99){ + qr = this.itemList[this.highlightIndex].quant*this.itemList[this.highlightIndex].price; + this.pricedisp.setVisible(true); + } else if (qt > 0) { + this.pricedisp.setVisible(true); + } else { + this.pricedisp.setVisible(false); + return; + } + if(qr > this.scene.money) { + this.pricedisp.setColor("Red"); + } + this.pricedisp.setText("Total: $"+qr); + } + } + + clearPriceDisp(){ + this.pricedisp.setColor("White"); + this.pricedisp.setText(""); + this.pricedisp.setVisible(false); + } + + updateButtons(id: number){ + let p = this.itemList[id].quant; + this.enableAllBuyButtons() + if(p <= 0) { + this.disableAllBuyButtons(); + } else { + if(p < 5) { + this.disableButton(this.buy5); + this.disableButton(this.buy10); + } else if (p < 10){ + this.disableButton(this.buy10); + } + } + } + + + updateInvText(id:number){ + this.myinvdisp.setText("Owned: x" + this.scene.getAmountOwned(id)); + } + + + + disableButton(B: SimpleButton){ + B.turnOff(); + B.setVisible(false); + } + + enableAllBuyButtons(){ + this.buy1.turnOn(); + this.buy1.setVisible(true); + this.buy5.turnOn(); + this.buy5.setVisible(true); + this.buy10.turnOn(); + this.buy10.setVisible(true); + this.buyall.turnOn(); + this.buyall.setVisible(true); + } + + + disableAllBuyButtons(){ + this.buy1.turnOff(); + this.buy1.setVisible(false); + this.buy5.turnOff(); + this.buy5.setVisible(false); + this.buy10.turnOff(); + this.buy10.setVisible(false); + this.buyall.turnOff(); + this.buyall.setVisible(false); + } + + populate(){ + //only run on init! + let rs = 0; + for(let np = this.currentIndices[0]; np < this.currentIndices[1]+1; np++){ + if(np < this.itemList.length){ + this.display.push(new ShopItem(this.scene,this.coordinates[rs][0], this.coordinates[rs][1], this, this.itemList[np].id, rs, this.itemList[np].spr, this.itemList[np].quant)); + if(this.itemList[np].quant <= 0) { + this.display[rs].shadow(); + } + this.add(this.display[rs]); + } + else { + this.display[rs] = new ShopItem(this.scene,this.coordinates[rs][0], this.coordinates[rs][1], this, -1, rs, "blankspr", 0); + this.add(this.display[rs]); + this.display[rs].shadow(); + } + rs++; + } + } + + repopulate(){ + let rs = 0; + this.display.forEach((sp) => sp.destroy()); + this.display = []; + for(let np = this.currentIndices[0]; np < this.currentIndices[1]+1; np++){ + if(np < this.itemList.length){ + this.display.push(new ShopItem(this.scene,this.coordinates[rs][0], this.coordinates[rs][1], this, this.itemList[np].id, rs, this.itemList[np].spr, this.itemList[np].quant)); + if(this.itemList[np].quant <= 0) { + this.display[rs].shadow(); + } + this.add(this.display[rs]); + } + else { + this.display.push(new ShopItem(this.scene,this.coordinates[rs][0], this.coordinates[rs][1], this, -1, rs, "blankspr", 0)); + this.display[rs].shadow(); + this.add(this.display[rs]); + } + rs++; + } + } + + toggle(){ + if(!this.isOpen) { + this.open(); + } else { + this.close(); + } + } + + close(){ + this.scene.sound.play("t_rustle"); + this.display.forEach((ib) => ib.destroy()); + this.setPosition(-650,0); + this.isOpen=false; + this.display = []; + this.window.setVisible(false); + this.title.setText(""); + this.tdisplay.setText(""); + this.currentIndices=[0,8]; + this.highlightIndex = -1; + this.clearInvDisp(); + this.disableAllBuyButtons(); + this.clearPriceDisp(); + } + + open(){ + this.scene.sound.play("t_rustle"); + this.window.setVisible(true); + //console.log("Open Processed"); + this.x = 0; + this.y = 0; + this.isOpen=true; + this.populate(); + this.clearInvDisp(); + this.disableAllBuyButtons(); + this.clearPriceDisp(); + } + + returnItem(id: number){ + this.itemList[id].quant++; + //console.log("STATE: " + this.isOpen + " ID: " + id + " HIGHLIGHT: " + this.highlightIndex); + if(this.isOpen){ + if((this.highlightIndex >=0) && (id==this.highlightIndex)){ + //this.scene.sound.play("meme_explosion_sound"); + this.updateAmountText(id,this.itemList[id].quant); + } + } + + } + + updateAmountText(id:number, i: number){ + if(i > 0) { + this.title.setText(this.itemList[id].name); + } else { + this.title.setText(""); + this.tdisplay.setText(""); + } + } + + scroll(){ + if(this.currentIndices[1] < this.itemList.length) { + let b = this.currentIndices[1] + 1; + let e = this.currentIndices[1] + 8; + this.currentIndices = [b,e]; + } else { + this.currentIndices = [0,8]; + } + this.title.setText(""); + this.tdisplay.setText(""); + this.scene.sound.play("button"); + this.clearPriceDisp(); + this.hideInvDisp(); + this.disableAllBuyButtons(); + this.repopulate(); + + } +} \ No newline at end of file diff --git a/src/components/ShopItem.ts b/src/components/ShopItem.ts new file mode 100644 index 0000000..4b3b707 --- /dev/null +++ b/src/components/ShopItem.ts @@ -0,0 +1,127 @@ +import { Item, SnapType } from "./Item"; +import { ShopInventory } from "./ShopInventory"; +import { Button } from "./elements/Button"; +import { BaseScene } from "@/scenes/BaseScene"; + +export class ShopItem extends Button { + public id: number; + public index: number; + public sprname: string; + public spr: Phaser.GameObjects.Sprite; + public default: number[]; + public state: number = 0; + public passivate: boolean = false; + public dragX: number; // Current drag position + public dragY: number; + public doingCuteThing: boolean; + private parent: ShopInventory; + public qt: number; + public qtDisp: Phaser.GameObjects.Text; + constructor(scene:BaseScene,x:number,y:number,parent: ShopInventory, id:number, index:number, spr:string, qt: number){ + super(scene,x,y); + this.parent = parent; + this.default = [x,y]; + this.id=id; + this.index=index; + this.sprname = spr; + this.spr = new Phaser.GameObjects.Sprite(this.scene,x,y,spr,0); + this.spr.setOrigin(0.5,0.5); + this.bindInteractive(this.spr, true); + this.add(this.spr); + this.parent.add(this); + this.setDepth(4); + this.qt = qt; + + this.qtDisp = this.scene.addText({ + x: x+30, + y: y+40, + size: 14, + color: "#FFFFFF", + text: "x" + qt, + }); + this.add(this.qtDisp); + } + + updateQt(qt: number){ + this.qtDisp.setText(""+qt); + } + + onDown( + pointer: Phaser.Input.Pointer, + localX: number, + localY: number, + event: Phaser.Types.Input.EventData + ) { + + super.onDown(pointer,localX,localY,event); + if(this.passivate){ + return; + } else { + this.parseClick(); + } + + } + + update(time: number, delta: number){ + if(this.state == 3) { + this.x = this.dragX-this.default[0]; + this.y = this.dragY-this.default[1]; + + /* + this.x += (this.dragX - this.x) * 0.5; + this.y += (this.dragY - this.y) * 0.5; + */ + } + /* + const factor = this.doingCuteThing ? 0.1 : 0.02; + const squish = 1.0 + factor * Math.sin((6 * time) / 1000); + this.setScale(1.0, squish); + */ + } + + parseClick(){ + if(this.state == 0) { + this.parent.unhighlight(); + this.select(); + this.parent.highlight(this.id); + } + } + + select(){ + this.state = 1; + this.spr.setFrame(1); + } + + unselect(){ + if(this.parent.itemList[this.id].quant <= 0){ + this.shadow(); + } else { + this.state = 0; + this.spr.setFrame(0); + this.passivate = false; + } + } + + updateAmt(n: number){ + this.qt = n; + this.qtDisp.setText("x"+this.qt); + } + + shadow(){ + this.spr.setFrame(2); + this.qtDisp.setText("x"+0); + this.qtDisp.setVisible(false); + this.passivate = true; + this.state = 2; + } + + unshadow(){ + this.state = 1; + this.spr.setFrame(1); + this.qtDisp.setText(""+0); + this.qtDisp.setVisible(false); + this.passivate = false; + } + + +} \ No newline at end of file diff --git a/src/components/Station.ts b/src/components/Station.ts index a23a0fe..9040c7f 100644 --- a/src/components/Station.ts +++ b/src/components/Station.ts @@ -33,6 +33,8 @@ export class Station extends Button { public appliedSprites: Phaser.GameObjects.Sprite[]; //public admissionFee: number; // Cost to use the station + private jolteon: boolean = false; + private cellSize: number; private spriteCont: Phaser.GameObjects.Container; private sprite: Phaser.GameObjects.Image; @@ -225,6 +227,22 @@ export class Station extends Button { this.sprite.input!.enabled = value; } + pauseClickable(){ + if(!(this.sprite.input!.enabled)){ + this.jolteon = true; + } else { + this.sprite.input!.enabled = false; + } + } + + resumeClickable(){ + if(this.jolteon) { + this.jolteon = false; + } else { + this.sprite.input!.enabled = true; + } + } + upgrade() { // this.scene.sound.play("upgrade"); diff --git a/src/components/elements/BuyButton.ts b/src/components/elements/BuyButton.ts new file mode 100644 index 0000000..3b8a26a --- /dev/null +++ b/src/components/elements/BuyButton.ts @@ -0,0 +1,35 @@ +import { BaseScene } from "@/scenes/BaseScene"; +import { SimpleButton } from "./SimpleButton"; +import { ShopInventory } from "../ShopInventory"; +import { GameScene } from "@/scenes/GameScene"; + + +export class BuyButton extends SimpleButton{ + public scene:GameScene; + public parent:ShopInventory; + private ONE: number = 1; + private FIVE: number = 5; + private TEN: number = 10; + private ALL: number = -99; + public mode: number = 1; + + constructor(scene: GameScene, x: number, y: number, v: string, spr: string, pr: ShopInventory, state: number, fsize: number = 40) { + super(scene,x,y,v,spr,fsize); + this.scene=scene; + this.parent = pr; + this.mode = state; + } + + onOver( pointer: Phaser.Input.Pointer, + localX: number, + localY: number, + event: Phaser.Types.Input.EventData){ + super.onOver(pointer,localX,localY,event); + this.parent.updatePriceDisp(this.mode); + } + + onOut(pointer: Phaser.Input.Pointer, event: Phaser.Types.Input.EventData) { + super.onOut(pointer,event); + this.parent.clearPriceDisp(); + } +} \ No newline at end of file diff --git a/src/components/elements/SimpleButton.ts b/src/components/elements/SimpleButton.ts index 932da97..24bda22 100644 --- a/src/components/elements/SimpleButton.ts +++ b/src/components/elements/SimpleButton.ts @@ -42,11 +42,13 @@ export class SimpleButton extends Button { } turnOff(){ + this.sprite.input!.enabled = false; this.disabled = true; this.resetState(); } turnOn(){ + this.sprite.input!.enabled = true; this.disabled = false; this.resetState(); } diff --git a/src/components/elements/SquishButton.ts b/src/components/elements/SquishButton.ts new file mode 100644 index 0000000..9d5dc1a --- /dev/null +++ b/src/components/elements/SquishButton.ts @@ -0,0 +1,166 @@ +import { BaseScene } from "@/scenes/BaseScene"; + +export class SquishButton extends Phaser.GameObjects.Container { + public scene: BaseScene; + private _hold: boolean; + private _hover: boolean; + protected blocked: boolean; + public liftSmooth: number; + public hoverSmooth: number; + public holdSmooth: number; + public category: number; + public aliveValue: number; + private hoverTween: Phaser.Tweens.Tween; + private holdTween: Phaser.Tweens.Tween; + public enabled: boolean; + public hitSprite:Phaser.GameObjects.Sprite; + + constructor(scene: BaseScene, x: number, y: number, spr:string) { + super(scene, x, y); + this.scene = scene; + scene.add.existing(this); + + this._hover = false; + this._hold = false; + this.blocked = false; + this.enabled = true; + + this.liftSmooth = 0; + this.hoverSmooth = 0; + this.holdSmooth = 0; + this.aliveValue = 0; + + this.hitSprite = new Phaser.GameObjects.Sprite(this.scene,0,0,spr); + this.bindInteractive(this.hitSprite); + this.hitSprite.input!.enabled = true; + this.add(this.hitSprite); + } + + bindInteractive( + gameObject: Phaser.GameObjects.GameObject, + draggable = false + ) { + gameObject.removeInteractive(); + gameObject + .setInteractive({ useHandCursor: true, draggable: draggable }) + .on("pointerout", this.onOut, this) + .on("pointerover", this.onOver, this) + .on("pointerdown", this.onDown, this) + .on("pointerup", this.onUp, this) + .on("dragstart", this.onDragStart, this) + .on("drag", this.onDrag, this) + .on("dragend", this.onDragEnd, this); + return gameObject; + } + + setOrigin(x: number, y: number){ + this.hitSprite.setOrigin(x,y); + } + + setFrame(n: number){ + this.hitSprite.setFrame(n); + } + + get hover(): boolean { + return this._hover; + } + + set hover(value: boolean) { + if (value != this._hover) { + if (this.hoverTween) { + this.hoverTween.stop(); + } + if (value) { + this.hoverTween = this.scene.tweens.add({ + targets: this, + hoverSmooth: { from: 0.0, to: 1.0 }, + ease: 'Cubic.Out', + duration: 100 + }); + } + else { + this.hoverTween = this.scene.tweens.add({ + targets: this, + hoverSmooth: { from: 1.0, to: 0.0 }, + ease: (v: number) => { + return Phaser.Math.Easing.Elastic.Out(v, 1.5, 0.5); + }, + duration: 500 + }); + } + } + + this._hover = value; + } + + get hold(): boolean { + return this._hold; + } + + set hold(value: boolean) { + if (value != this._hold) { + if (this.holdTween) { + this.holdTween.stop(); + } + if (value) { + this.holdTween = this.scene.tweens.add({ + targets: this, + holdSmooth: { from: 0.0, to: 1.0 }, + ease: 'Cubic.Out', + duration: 100 + }); + } + else { + this.holdTween = this.scene.tweens.add({ + targets: this, + holdSmooth: { from: 1.0, to: 0.0 }, + ease: (v: number) => { + return Phaser.Math.Easing.Elastic.Out(v, 1.5, 0.5); + }, + duration: 500 + }); + } + } + + this._hold = value; + } + + onOut(pointer: Phaser.Input.Pointer, event: Phaser.Types.Input.EventData) { + this.hover = false; + this.hold = false; + } + + onOver(pointer: Phaser.Input.Pointer, localX: number, localY: number, event: Phaser.Types.Input.EventData) { + this.hover = true; + } + + onDown(pointer: Phaser.Input.Pointer, localX: number, localY: number, event: Phaser.Types.Input.EventData) { + this.hold = true; + this.blocked = false; + this.emit("down"); + } + + onUp(pointer: Phaser.Input.Pointer, localX: number, localY: number, event: Phaser.Types.Input.EventData) { + if (this.hold && !this.blocked) { + this.hold = false; + this.emit('click'); + } + } + + onDragStart(pointer: Phaser.Input.Pointer, dragX: number, dragY: number) {} + + onDrag(pointer: Phaser.Input.Pointer, dragX: number, dragY: number) { + // this.hold = false; + // if (Math.abs(dragY) > 8) { + // this.hold = false; + // } + } + + onDragEnd(pointer: Phaser.Input.Pointer, dragX: number, dragY: number) {} + + + + block() { + this.blocked = true; + } +} \ No newline at end of file diff --git a/src/components/elements/ToggleButton.ts b/src/components/elements/ToggleButton.ts index c89e0be..82bf570 100644 --- a/src/components/elements/ToggleButton.ts +++ b/src/components/elements/ToggleButton.ts @@ -17,11 +17,13 @@ export class ToggleButton extends Button{ toggleForward(){ this.toggled = true; this.spr.setFrame(1); + console.log("FORWARD"); } toggleBackward(){ this.toggled = false; this.spr.setFrame(0); + console.log("REVERSE"); } } \ No newline at end of file diff --git a/src/scenes/GameScene.ts b/src/scenes/GameScene.ts index b17c816..33b5094 100644 --- a/src/scenes/GameScene.ts +++ b/src/scenes/GameScene.ts @@ -22,10 +22,9 @@ import { Intermission, Mode } from "@/components/Intermission"; import { SnapType } from "@/components/Item"; import { NavMesh } from "navmesh"; -import { - centerOnSubdividedCoord, - GenerateNavMesh, -} from "@/utils/NavMeshHelper"; +import { centerOnSubdividedCoord, GenerateNavMesh } from "@/utils/NavMeshHelper"; +import { Button } from "@/components/elements/Button"; +import { ShopInventory } from "@/components/ShopInventory"; enum GameState { Cutscene, @@ -47,10 +46,43 @@ export class GameScene extends BaseScene { private paused: boolean = false; private browsing: boolean = false; private inventory: Inventory; + private shopinventory: ShopInventory; private invButton: ToggleButton; private iHandler: ItemHandler; public activeItem: ItemButton; + private shopClicker: Button; + private ownerImage: Phaser.GameObjects.Sprite; + private shopSpeech: Phaser.GameObjects.Container; + private shopBubble: Phaser.GameObjects.Image; + private shopText: Phaser.GameObjects.Text; + + private noivern: string[] = ["Like I said, the prices are absolutely fair!", "My old job? I used to be a turret engineer~", + "If you encounter a special customer, use clues to figure out their needs!", "Have you heard of widgets? I might have one in stock.", + "It's alawys so hot in the dragonlands...", "Different customers will have different preferences!", + "That one's popular! Why not pick up a few for your salon?", "Some items can be only given to customers. Others are only equipped at stations.", + "Happy customers tip more! Give them things they like and tend to them quickly!", "Don't forget to upgrade your stations! A well equipped salon succeeds.", + "My favorite items? A tasty hot dog and a box of milk! And I love the widgets too!", "How's the weather been lately? I think it's lovely outside.", + "I saw lots of happy people by your salon! I hope it's doing well.", "Buy a lot and buy often! Think of it as an investment!"] + private viewedShopTutorial: boolean = false; + private shopTutorialText: string[] = ["Hey, going to leave already? Click the left tab and drop by!", "First time? Welcome to my little otter shop!", + "You can pick up all kinds of snacks, trinkets, and widgets here!", "They might be of help for your customers and stations!", + "I left some notes in the descriptions too, if you need any help.", "And you can hit the brown arrow to browse the other shelves!", + "The prices are totally fair, but make sure you have enough money!", "Once you're done, you can hit the tab again to close the shop!", + "Oh, and it works for your inventory too during the day!", "I'll look forward to your visits!"]; + private shopTutorialFrames: number[] = [0, 0, 1, 1, 2, 0, 2, 0, 0, 1]; + private shopTutorialIndex: number = 1; + private shopTutorialInitialized: boolean = false; + private tutorialTimer: number = 0; + private canProceed: boolean[] = [false,false,false]; + private dinonugget: number = 0; + private shopOpenCheck: boolean = false; + private shopOwnerState: number = -1; + private proceedButton: Button; + private hitRectangle: Phaser.GameObjects.Rectangle; + private cycleCount: number = 0; + + public effects: Effect[]; private navmesh: NavMesh; @@ -152,11 +184,21 @@ export class GameScene extends BaseScene { 0, [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10] ); + + this.shopinventory = new ShopInventory( + this, + -650, + 0, + [10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10] + ); + this.shopinventory.setDepth(2500); + this.invButton = new ToggleButton(this, 64, 540, "invbutton"); + this.invButton.setScale(0.5); this.invButton.setAlpha(0.85); this.add.existing(this.invButton); this.invButton.on("click", () => { - this.toggleInventory(); + this.togglePanel(); }); this.inventory.setDepth(800); this.invButton.setDepth(900); @@ -200,15 +242,60 @@ export class GameScene extends BaseScene { this.summaryOverlay.setVisible(false); }); + //shop + this.shopClicker = new Button(this,1460,540); + this.add.existing(this.shopClicker); + + this.ownerImage = new Phaser.GameObjects.Sprite(this,0,0,"otter"); + this.ownerImage.setOrigin(0.5,0.5); + this.shopClicker.add(this.ownerImage); + + this.shopClicker.bindInteractive(this.ownerImage); + this.shopClicker.on("click", ()=> this.proceedShopTutorial()); + this.ownerImage.input!.enabled = false; + this.shopSpeech = new Phaser.GameObjects.Container(this, 1010, 450); + this.add.existing(this.shopSpeech); + this.shopBubble = new Phaser.GameObjects.Image(this,0,0,"bubble"); + this.shopBubble.setScale(-3.5, 2.5); + this.shopBubble.setOrigin(0.5,0.5); + this.shopSpeech.add(this.shopBubble); + this.shopClicker.setDepth(1050); + this.shopSpeech.setDepth(1045); + this.shopText = this.addText({ + x: 0, + y: -20, + size: 40, + color: "#000000", + text: "", + }); + this.shopText.setWordWrapWidth(380); + this.shopText.setOrigin(0.5,0.5); + this.shopSpeech.add(this.shopText); + this.proceedButton = new Button(this,960,540); + this.hitRectangle = new Phaser.GameObjects.Rectangle(this,0,0,1980,1100,0x000000); + this.hitRectangle.setOrigin(0.5,0.5); + this.hitRectangle.setAlpha(0.001); + this.proceedButton.add(this.hitRectangle); + this.proceedButton.bindInteractive(this.hitRectangle); + this.add.existing(this.proceedButton); + this.proceedButton.setDepth(5000); + this.proceedButton.setVisible(false); + this.shopClicker.setVisible(false); + this.shopSpeech.setVisible(false); /* Init */ this.loadLevel(LevelId.Level1); this.setState(GameState.Shopping); // this.startDay(); this.intermission.fadeToGame(); // Comment this out to see cutscenes + + this.pauseInvButton(); } update(time: number, delta: number) { + if(!this.viewedShopTutorial || this.shopOwnerState == 2){ + this.updateShopTutorial(time,delta); + } if (this.browsing || this.paused) { this.activeItem.update(time, delta); if (this.activeItem.state == 3) { @@ -364,6 +451,13 @@ export class GameScene extends BaseScene { // Start a new day startDay() { + if((this.cycleCount > 0)) + { + if((!this.viewedShopTutorial)) { + this.beginShopTutorial(0); + return; + } + } this.setState(GameState.Day); this.day += 1; this.ui.setDay(this.day); @@ -403,6 +497,8 @@ export class GameScene extends BaseScene { //this.stations.forEach((s) => s.returnItems()); // Fix this later // this.employees.forEach((e) => e.walkTo(e.startX, e.startY)); + this.resumeInvButton(); + this.cycleCount++; this.setState(GameState.Shopping); } @@ -504,10 +600,12 @@ export class GameScene extends BaseScene { openInventory() { this.browsing = true; + this.pauseAllClickables(); this.tweens.pauseAll(); } closeInventory() { this.browsing = false; + this.resumeAllClickables(); this.tweens.resumeAll(); } @@ -589,6 +687,7 @@ export class GameScene extends BaseScene { // Picking up a customer customer.on("pickup", () => { + this.sound.play("pickup"); if (customer.currentStation) { // customer.currentStation.setCustomer(null); // customer.setStation(null); @@ -605,6 +704,7 @@ export class GameScene extends BaseScene { // Dropping a customer customer.on("drop", () => { + this.sound.play("drop"); let station = this.getClosestStation(customer); if (station) { // Let go of previous station @@ -825,6 +925,14 @@ export class GameScene extends BaseScene { customer.nextActivity(); } + togglePanel(){ + if(this.state === GameState.Shopping) { + this.toggleShop(); + } else { + this.toggleInventory(); + } + } + toggleInventory() { this.inventory.toggle(); if (this.inventory.isOpen) { @@ -838,6 +946,33 @@ export class GameScene extends BaseScene { } } + toggleShop(){ + this.shopinventory.toggle(); + if (this.shopinventory.isOpen) { + this.invButton.setPosition(714, 540); + this.invButton.toggleForward(); + this.openInventory(); + //console.log("VARIABLE STATE: "+this.shopOpenCheck) + if(this.shopTutorialInitialized == false) { + this.beginShopTutorial(1); + this.pauseInvButton(); + } + if(this.shopOpenCheck) { + this.shopOpenCheck = false; + this.pauseInvButton(); + this.proceedShopTutorial(); + } + //console.log(this.invButton); + //this.pauseInvButton(); + + + } else { + this.invButton.setPosition(64, 540); + this.invButton.toggleBackward(); + this.closeInventory(); + } + } + setActiveItem(i: ItemButton) { this.activeItem.destroy(); this.activeItem = i; @@ -930,6 +1065,21 @@ export class GameScene extends BaseScene { this.inventory.returnItem(id); } + buyItem(id: number, qt:number) { + this.inventory.buyItem(id, qt); + } + + + pauseInvButton(){ + this.invButton.spr.input!.enabled = false; + this.invButton.setAlpha(0.34); + } + + resumeInvButton(){ + this.invButton.spr.input!.enabled = true; + this.invButton.setAlpha(0.85); + } + parseCustomerItems(i: number, ct: Customer) { this.iHandler.processCustomerItem(this.inventory.itemList[i], ct); this.sound.play(this.inventory.itemList[i].sound); @@ -985,6 +1135,143 @@ export class GameScene extends BaseScene { return closestStation; } + removeMoney(n: number){ + this.money -= n; + this.ui.setMoney(this.money); + this.sound.play("cashmoney"); + /* + this.addEffect( + new TextEffect( + scene, + this.x - 70 + Math.random() * 80, + this.y - 80, + "+" + this.moneySpent + " €", + "yellow", + 40, + true, + "red", + 800, + 100, + 0.7, + 0 + ) + );*/ + } + + beginShopTutorial(n: number){ + this.shopTutorialIndex = n; + this.shopTutorialInitialized = false; + this.ownerImage.input!.enabled = false; + this.ownerImage.setFrame(this.shopTutorialFrames[n]); + this.shopText.setText(this.shopTutorialText[n]); + this.shopClicker.setVisible(true); + this.shopSpeech.setVisible(true); + this.shopSpeech.setAlpha(0); + this.tutorialTimer = 1000; + if(n > 0) { + this.pauseInvButton(); + } + } + + updateShopTutorial(t: number, d: number){ + + if(this.dinonugget > 0) { + this.dinonugget -= d; + //console.log("DINO NUGGET"); + if(this.dinonugget <= 0) { + this.shopClicker.setAlpha(0); + this.shopSpeech.setAlpha(0); + this.shopSpeech.setVisible(false); + this.shopClicker.setVisible(false); + this.shopOwnerState = -1 + } else { + this.shopClicker.setAlpha(this.dinonugget/300); + this.shopSpeech.setAlpha(this.dinonugget/300); + } + } + if(this.viewedShopTutorial){ + return; + } + if(!this.shopTutorialInitialized) { + if(this.tutorialTimer > 0) { + if((this.tutorialTimer > 300)) { + this.tutorialTimer -= d; + if(this.tutorialTimer <= 300) { + this.shopClicker.setPosition(1460, 540); + } else { + this.shopClicker.setPosition(1460,1480+-940*(1-((this.tutorialTimer-300)/700))); + } + } else if (this.tutorialTimer <= 300){ + this.tutorialTimer -= d; + if(this.tutorialTimer <= 0) { + this.shopSpeech.setAlpha(1); + this.shopTutorialInitialized = true; + this.ownerImage.input!.enabled = true; + if(this.shopTutorialIndex == 0){ + this.shopOpenCheck = true; + } + this.canProceed = [true,false,false]; + } + this.shopSpeech.setAlpha(1-(this.tutorialTimer/300)); + } + } + } else if (!this.viewedShopTutorial) { + if(this.tutorialTimer > 0) { + this.tutorialTimer -= d; + if(this.tutorialTimer <= 0){ + this.shopSpeech.setAlpha(1); + this.canProceed = [true,false,false]; + this.ownerImage.input!.enabled = true; + } else { + this.shopSpeech.setAlpha(1-(this.tutorialTimer/300)); + } + } + } + } + + proceedShopTutorial(){ + if(this.shopOpenCheck || (!this.canProceed)) { + return; + } + this.shopTutorialIndex++; + if(this.shopTutorialIndex < this.shopTutorialText.length) { + this.canProceed=[false,false,false]; + this.tutorialTimer=300; + this.shopSpeech.setAlpha(0); + this.shopText.setText(this.shopTutorialText[this.shopTutorialIndex]); + this.ownerImage.setFrame(this.shopTutorialFrames[this.shopTutorialIndex]); + this.ownerImage.input!.enabled = false; + } else { + this.completeShopTutorial(); + } + } + + completeShopTutorial(){ + this.canProceed=[false,false,false]; + this.ownerImage.input!.enabled = false; + this.viewedShopTutorial = true; + this.sound.play("meme_explosion_sound"); + this.dinonugget = 300; + this.shopOwnerState = 2; + this.resumeInvButton(); + } + + pauseAllClickables(){ + this.stations.forEach((s) => s.pauseClickable()); + this.customers.forEach((c) => c.pauseClickable()); + this.employees.forEach((e) => e.pauseClickable()); + } + + resumeAllClickables(){ + this.stations.forEach((s) => s.resumeClickable()); + this.customers.forEach((c) => c.resumeClickable()); + this.employees.forEach((e) => e.resumeClickable()); + } + + getAmountOwned(id: number){ + return this.inventory.itemList[id].quant; + } + veilInvButton() { this.invButton.setAlpha(0.17); }