feat(packages): ludic.session - a party's roster (slot 0 a port, the others as reported), the roles and who owns the world, the shared night, votes and a world-changing act asking the party; joins, leaves, roles, votes and the night as facts

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 07:45:26 +03:00
parent 12172d7b75
commit 79ed7a335b
12 changed files with 707 additions and 0 deletions

View file

@ -0,0 +1,47 @@
# where.ludic - who and where each player is; slot 0 answers through SessionLocal, live
export function ply_pid(p: int) -> int {
if p <= 0 or not ply_on(p) { return 0 }
return session__slot[p].pid
}
export function ply_name(p: int) -> string {
if p == 0 { return SessionLocal.name() }
if not ply_on(p) { return "" }
return session__slot[p].name
}
export function ply_x(p: int) -> float {
if p == 0 { return SessionLocal.x() }
return session__slot[p].x
}
export function ply_y(p: int) -> float {
if p == 0 { return SessionLocal.y() }
return session__slot[p].y
}
export function ply_z(p: int) -> float {
if p == 0 { return SessionLocal.z() }
return session__slot[p].z
}
export function ply_yaw(p: int) -> float {
if p == 0 { return SessionLocal.yaw() }
return session__slot[p].yaw
}
export function ply_speed(p: int) -> float {
if p == 0 { return SessionLocal.speed() }
return session__slot[p].speed
}
# how much a player's rest speeds the clock: their seat's or the ground's, 1 on their feet
export function ply_rest(p: int) -> float {
if p == 0 { return SessionLocal.rest() }
return session__slot[p].rest
}
export function ply_sleeping(p: int) -> bool {
if p == 0 { return session__me_sleeping }
return ply_on(p) and session__slot[p].sleeping
}