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

Method buyWeapon

code/main/SuperRPGMenu_Shop.ts:77–83  ·  view source on GitHub ↗
(weapon: string, damage: number, price: number)

Source from the content-addressed store, hash-verified

75 }
76
77 private buyWeapon(weapon: string, damage: number, price: number): void{
78 if(this.getSuperRPG().getCoins() >= price && this.getSuperRPG().getDamage() < damage){
79 this.getSuperRPG().setCoins(this.getSuperRPG().getCoins()-price);
80 this.getSuperRPG().setWeapon(weapon);
81 this.getSuperRPG().setDamage(damage);
82 }
83 }
84}

Callers

nothing calls this directly

Calls 6

getCoinsMethod · 0.80
getSuperRPGMethod · 0.80
getDamageMethod · 0.80
setCoinsMethod · 0.80
setWeaponMethod · 0.80
setDamageMethod · 0.80

Tested by

no test coverage detected