цикл день-ночь, кролики, кровавая луна

This commit is contained in:
azykov@mail.ru
2026-09-04 20:31:53 +03:00
parent 982bbce813
commit 396a604671
17 changed files with 1061 additions and 171 deletions
+36 -1
View File
@@ -1,4 +1,13 @@
export type UpgradeId = 'moveSpeed' | 'chopSpeed' | 'logValue' | 'twigValue' | 'pickupRadius' | 'coinSpeed';
export type UpgradeId =
| 'moveSpeed'
| 'chopSpeed'
| 'logValue'
| 'twigValue'
| 'pickupRadius'
| 'coinSpeed'
| 'daySpeed'
| 'maxHealth'
| 'attackDamage';
export interface UpgradeDef {
id: UpgradeId;
@@ -61,6 +70,32 @@ export const UPGRADE_LIST: UpgradeDef[] = [
effectAtLevel: (level) => 1 / Math.pow(1.15, level - 1),
formatEffect: (v) => `${v.toFixed(2)} с/ресурс`,
},
{
id: 'daySpeed',
name: 'Скорость времени днём',
baseCost: 6,
costGrowth: 1.3,
// Game-hours per real second during morning/day/evening (16 game-hours by default spread
// over the default 10s day-phase of the 20s day-night cycle) — night has its own fixed speed.
effectAtLevel: (level) => 1.6 * Math.pow(1.15, level - 1),
formatEffect: (v) => `${v.toFixed(2)} ч/с`,
},
{
id: 'maxHealth',
name: 'Живучесть',
baseCost: 10,
costGrowth: 1.45,
effectAtLevel: (level) => 4 + level,
formatEffect: (v) => `${v} здоровья`,
},
{
id: 'attackDamage',
name: 'Сила удара по кролику',
baseCost: 8,
costGrowth: 1.4,
effectAtLevel: (level) => level,
formatEffect: (v) => `${v} урона/с`,
},
];
export const UPGRADES: Record<UpgradeId, UpgradeDef> = Object.fromEntries(