feat(senses): walkers slide round still things, and lines of sight are the world's to answer
- ludic.wildlife: WildlifeWorld.push / pushed_x / pushed_z (defaults change nothing); a ground walker's step is slid clear of a still thing with a body from its species' size and scale, and a step that gets nowhere turns away as the water does. Birds are not pushed; no dice added. - ludic.npc: NpcWorld.push / pushed_x / pushed_z (a person 0.35 m round) in npc_walk, and NpcWorld.clear (default true), which npc_line_ok asks at 1 m so a detour does not cut a trunk. - ludic.aim: AimView.clear replaces AimView.ground and the ground march; the pick asks the line a body's width short of where the ray enters the thing (aim_clear_at(t, back)), so a solid thing does not hide itself. probe.ludic (the ground-agreement probe) and AimView.dry are gone. - ludic.photo: PhotoLens.clear replaces PhotoLens.ground, PhotoLens.trunk and the march. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
d2cd775309
commit
56e4b6d688
24 changed files with 230 additions and 152 deletions
|
|
@ -10,6 +10,9 @@ program WildlifeTest {
|
|||
water: fn fk_water
|
||||
forest: fn fk_forest
|
||||
sight: fn fk_sight
|
||||
push: fn fk_push
|
||||
pushed_x: fn fk_pushed_x
|
||||
pushed_z: fn fk_pushed_z
|
||||
players: fn fk_players
|
||||
player_on: fn fk_player_on
|
||||
player_x: fn fk_x
|
||||
|
|
@ -177,6 +180,25 @@ program WildlifeTest {
|
|||
expect(wildlife_seen(wildlife_st, 0))
|
||||
}
|
||||
|
||||
test "a walker slides round a trunk rather than through it" (wildlife_st: mut WildlifeState, wildlife_tests_fake_st: mut WildlifeTestsFakeState) {
|
||||
fk_setup(wildlife_st, wildlife_tests_fake_st)
|
||||
let a = deer_at(wildlife_st, 0.0, 0.0)
|
||||
wildlife_tests_fake_st.fk_trunk = true
|
||||
player_at(wildlife_tests_fake_st, 60.0, 0.0)
|
||||
wildlife_tests_fake_st.fk_blocked = true
|
||||
a.state = WILD_WANDER
|
||||
a.tx = 0.0
|
||||
a.tz = -100.0
|
||||
a.timer = 100.0
|
||||
var closest = 100.0
|
||||
for k in 0 .. 800 {
|
||||
wildlife_tick(wildlife_st, 0.05, 0.0)
|
||||
closest = Math.min(closest, Math.sqrt((a.x - 0.3) * (a.x - 0.3) + (a.z + 20.0) * (a.z + 20.0)))
|
||||
}
|
||||
expect(closest > 1.35)
|
||||
expect(a.z < -25.0)
|
||||
}
|
||||
|
||||
test "the record and the found ranges come back from the save section" (wildlife_st: mut WildlifeState, wildlife_tests_fake_st: mut WildlifeTestsFakeState) {
|
||||
fk_setup(wildlife_st, wildlife_tests_fake_st)
|
||||
wildlife_spawn(wildlife_st, 0.0, 0.0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue