MCPcopy Create free account
hub / github.com/candybox2/candybox2.github.io / unequipIfEquipped

Method unequipIfEquipped

code/main/Game.ts:377–387  ·  view source on GitHub ↗
(savingName: string, type: EqItemType)

Source from the content-addressed store, hash-verified

375 }
376
377 public unequipIfEquipped(savingName: string, type: EqItemType): void{
378 switch(type){
379 case EqItemType.WEAPON: if(this.selectedEqItems["weapon"] != null && this.selectedEqItems["weapon"].getSavingName() == savingName) Saving.saveString("gameWeaponSelected", "inventorySpecialNothingWeapon"); break;
380 case EqItemType.HAT: if(this.selectedEqItems["hat"] != null && this.selectedEqItems["hat"].getSavingName() == savingName) Saving.saveString("gameHatSelected", "inventorySpecialNothingHat"); break;
381 case EqItemType.BODYARMOUR: if(this.selectedEqItems["bodyArmour"] != null && this.selectedEqItems["bodyArmour"].getSavingName() == savingName) Saving.saveString("gameBodyArmourSelected", "inventorySpecialNothingBodyArmour"); break;
382 case EqItemType.GLOVES: if(this.selectedEqItems["gloves"] != null && this.selectedEqItems["gloves"].getSavingName() == savingName) Saving.saveString("gameGlovesSelected", "inventorySpecialNothingGloves"); break;
383 case EqItemType.BOOTS: if(this.selectedEqItems["boots"] != null && this.selectedEqItems["boots"].getSavingName() == savingName) Saving.saveString("gameBootsSelected", "inventorySpecialNothingBoots"); break;
384 }
385
386 this.emptyAndFillSelectedEqItemsArray();
387 }
388
389 public updatePlace(): void{
390 this.displayPlace();

Callers 1

enchantMethod · 0.45

Calls 2

getSavingNameMethod · 0.45

Tested by

no test coverage detected