A line is cast at a point the FishingWorld port says is water (depth, or afloat), bait (asked, then said as FISHING_BAIT_USED for the game to take) halves the wait, the bite picks a species - a legend only on a lure, likelier in deep water and with skill, else an everyday one by weight - and the fight is a marker, a green band that moves above Relaxed and closes on Hard or for a fish whose data says so, a Gentle ring of one press, and a legend's runs and the line it takes back. Length and weight come from FishSpecies data. The package never draws, speaks or touches a pack; every step is a FishingFact (CAUGHT, BAIT_USED, LINE_SNAPPED, SLACK, MISSED, ...). Its dice are its own Rng. A legend on Gentle fights as a legend (the old ring lost him at once). Uses ludic.base only; thirteen tests over a fake lake. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
24 lines
1.4 KiB
Text
24 lines
1.4 KiB
Text
# ports.ludic - what a line asks the game: the water, the tackle, the angler
|
|
# the ladder of difficulty, by the numbers a game is likely to keep them in
|
|
export const FISHING_RELAXED: int = 0 # the window dead centre
|
|
export const FISHING_STANDARD: int = 1 # it moves each crossing
|
|
export const FISHING_HARD: int = 2 # it moves and closes
|
|
export const FISHING_GENTLE: int = 3 # no bar: a ring and one press (a legend still fights)
|
|
|
|
# Unbound, the angler is on the bank, has no bait or lure and no skill, waits the plain wait,
|
|
# holds a 0.12 window and plays Relaxed.
|
|
export port FishingWorld {
|
|
depth: fn(float, float) -> float # metres of water at a point (0: dry)
|
|
afloat: fn() -> bool = fn fishing_no # in a boat: every cast lands in deep water
|
|
has_bait: fn() -> bool = fn fishing_no
|
|
has_lure: fn() -> bool = fn fishing_no
|
|
skill: fn() -> float = fn fishing_zero # bigger fish, and a legend more often
|
|
bite_mult: fn() -> float = fn fishing_one # the wait, x
|
|
window: fn(int) -> float = fn fishing_plain_window # the green's half width for a species
|
|
level: fn() -> int = fn fishing_relaxed
|
|
}
|
|
function fishing_no() -> bool { return false }
|
|
function fishing_zero() -> float { return 0.0 }
|
|
function fishing_one() -> float { return 1.0 }
|
|
function fishing_plain_window(s: int) -> float { return 0.12 }
|
|
function fishing_relaxed() -> int { return FISHING_RELAXED }
|