[engine] PlanetGarden: How many weeds and petals a day shows; the gesture recognisers
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
/**
|
||||
* What the planet garden shows of her day (.agents/features/planet-garden.md G3). Pure: the
|
||||
* rose's key and the local day are parameters, so a replay shows the same weeds every time.
|
||||
*/
|
||||
import { petalsOn, seeded, weedsOn } from '../rose/rose.js';
|
||||
import type { LocalDay } from '../time/localDay.js';
|
||||
|
||||
/** How many weeds came up in the night: 2–4 on a day with weeds, else none. */
|
||||
export function weedsToday(seed: string, day: LocalDay): number {
|
||||
return weedsOn(seed, day) ? 2 + Math.floor(seeded(seed, day, 'weed-count') * 3) : 0;
|
||||
}
|
||||
|
||||
/** How many of her petals have fallen: 3–5 on a day with fallen petals, else none. */
|
||||
export function petalsToday(seed: string, day: LocalDay): number {
|
||||
return petalsOn(seed, day) ? 3 + Math.floor(seeded(seed, day, 'petal-count') * 3) : 0;
|
||||
}
|
||||
Reference in New Issue
Block a user