This repository has been archived on 2022-01-16. You can view files and clone it, but cannot push or open issues or pull requests.
2021-08-20 20:47:02 -05:00
|
|
|
/// <reference path="./Purchasable.ts" />
|
2021-08-20 17:12:32 -05:00
|
|
|
|
2021-08-20 20:47:02 -05:00
|
|
|
class Money extends Purchasable {
|
2021-08-20 17:12:32 -05:00
|
|
|
constructor (
|
|
|
|
public value: number,
|
|
|
|
) {
|
2021-08-20 23:00:24 -05:00
|
|
|
super('Money', 'Used to purchase goods and services.');
|
2021-08-21 12:45:58 -05:00
|
|
|
this.clickText = 'Collect Tithes';
|
|
|
|
this.clickDescription = 'Voluntary contributions from followers.';
|
2021-08-20 23:00:24 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public isUnlocked (state: GameState): boolean {
|
|
|
|
return true;
|
2021-08-20 17:12:32 -05:00
|
|
|
}
|
2021-08-21 10:44:53 -05:00
|
|
|
|
2021-08-21 12:45:58 -05:00
|
|
|
protected _incrementAmount (state: GameState): number {
|
|
|
|
const plorg: IResource = state.getResource('plorg');
|
|
|
|
if (plorg.value === 0) {
|
|
|
|
state.log('You have no followers to collect from!');
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
// each follower gives you $10
|
|
|
|
const tithings: number = plorg.value * 10;
|
|
|
|
state.log(`You collected $${state.formatNumber(tithings)} from ${state.formatNumber(plorg.value)} followers.`);
|
|
|
|
return tithings;
|
2021-08-21 10:44:53 -05:00
|
|
|
}
|
2021-08-20 17:12:32 -05:00
|
|
|
}
|