49 lines
2.1 KiB
TypeScript
49 lines
2.1 KiB
TypeScript
/** Number of rabbits present on the map by a given day. */
|
|
export function rabbitsForDay(day: number): number {
|
|
return Math.max(0, 1 + Math.floor(day / 3));
|
|
}
|
|
|
|
/** How long a jump or strike action takes to play out. */
|
|
export const RABBIT_ACTION_DURATION = 0.5;
|
|
|
|
/** How long a rabbit pauses between actions (this is also when it decides its next one). */
|
|
export const RABBIT_PAUSE_DURATION = 0.5;
|
|
|
|
/** Max distance covered by a single jump. */
|
|
export const RABBIT_JUMP_DISTANCE = 27;
|
|
|
|
/** Peak height (px) of a jump's parabolic arc — same idea as a resource drop's arc when it flies
|
|
* off a chopped tree. */
|
|
export const RABBIT_JUMP_ARC_HEIGHT = 10;
|
|
|
|
/** By day, a rabbit won't choose a jump target closer than this to the character. */
|
|
export const RABBIT_MIN_DISTANCE_FROM_CHARACTER = 43;
|
|
|
|
/** How close the character must be, by night, for a rabbit to strike instead of jumping toward them. */
|
|
export const RABBIT_STRIKE_RANGE = 9;
|
|
|
|
/** How close the character must get to hit a rabbit. */
|
|
export const RABBIT_HIT_RADIUS = 13;
|
|
|
|
/** A rabbit's max HP (fixed — unlike the character's, there's no upgrade for it). */
|
|
export const RABBIT_MAX_HP = 3;
|
|
|
|
/** Damage dealt by a single completed strike (fixed — unlike the character's own attack damage,
|
|
* there's no upgrade for it). Multiple rabbits striking independently each deal this. */
|
|
export const RABBIT_STRIKE_DAMAGE = 1;
|
|
|
|
/** Random deviation (degrees, either side) from a direct line to the character for a night jump —
|
|
* "roughly toward" the character rather than a perfect beeline. */
|
|
export const RABBIT_NIGHT_JUMP_SPREAD_DEGREES = 30;
|
|
|
|
/** Rabbits (and their strike/hit ranges) are this much bigger during a blood moon. */
|
|
export const BLOOD_MOON_SIZE_MULTIPLIER = 2;
|
|
|
|
/** Rabbits deal this much more strike damage and have this much more max hp during a blood moon —
|
|
* a bigger jump than their (purely visual/reach) size multiplier above. */
|
|
export const BLOOD_MOON_COMBAT_MULTIPLIER = 3;
|
|
|
|
/** Seconds per hp of rabbit health regen (fixed — unlike the character's own regen, there's no
|
|
* upgrade for it). */
|
|
export const RABBIT_HEALTH_REGEN_INTERVAL = 3;
|