2021-08-21 19:02:57 -05:00
|
|
|
/// <reference path="./Purchasable.ts" />
|
|
|
|
|
|
|
|
class CryptoCurrency extends Purchasable {
|
2021-09-12 13:58:57 -05:00
|
|
|
public readonly resourceKey = ResourceKey.cryptoCurrency;
|
|
|
|
|
2021-09-12 22:27:07 -05:00
|
|
|
constructor() {
|
2021-09-06 00:12:05 -05:00
|
|
|
super(
|
|
|
|
'FaithCoin',
|
2021-09-06 08:51:41 -05:00
|
|
|
'faithcoin',
|
|
|
|
'faithcoins',
|
2021-09-06 20:37:23 -05:00
|
|
|
"A crypto coin that can't be spent directly, but provides a steady stream of passive income.",
|
|
|
|
true
|
2021-09-06 12:02:38 -05:00
|
|
|
);
|
2021-08-22 11:51:16 -05:00
|
|
|
this.valueInWholeNumbers = false;
|
2021-08-21 19:02:57 -05:00
|
|
|
}
|
2021-09-05 14:45:37 -05:00
|
|
|
|
2021-09-12 22:27:07 -05:00
|
|
|
public cost = (state: GameState): ResourceNumber => {
|
|
|
|
const cost: ResourceNumber = {};
|
|
|
|
const market = state.resource.cryptoMarket;
|
|
|
|
if (market !== undefined) {
|
|
|
|
cost.money = market.value;
|
|
|
|
} else {
|
|
|
|
cost.money = state.config.cfgInitialCost.cryptoCurrency;
|
|
|
|
}
|
|
|
|
return cost;
|
|
|
|
};
|
|
|
|
|
|
|
|
public isUnlocked = (): boolean => true;
|
2021-09-06 22:44:00 -05:00
|
|
|
|
|
|
|
public max = (state: GameState): number =>
|
2021-09-05 20:43:11 -05:00
|
|
|
state.config.cfgInitialMax.cryptoCurrency ?? 0;
|
2021-08-21 19:02:57 -05:00
|
|
|
}
|