osrlib.crawl.party
The crawl party: marching order, group movement, and combat ranks.
The member list order is marching order — there is no separate order field to
desync; reorder swaps in place, and ReorderParty is the only command that
mutates it. Dead members stay in the party (their gear is carried state; excluding
them is a game decision via referee commands) but never count toward movement rate,
ranks, checks, or provisions.
Party
Bases: BaseModel
The adventuring party, in marching order.
member
Return the member with character_id.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
character_id
|
str
|
The member's entity id. |
required |
Returns:
| Type | Description |
|---|---|
Character
|
The character. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If no member has that id. |
movement_rate
ranks
Chunk the living members into combat ranks of width, in marching order.
The fallen collapse forward by construction: ranks derive from the living marching order each time they're read.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
width
|
int
|
The formation width (3 in a keyed area, 2 in corridor under the
|
required |
Returns:
| Type | Description |
|---|---|
list[list[Character]]
|
The ranks, front first. |
Raises:
| Type | Description |
|---|---|
ValueError
|
If |
reorder
Rewrite the marching order — ReorderParty's apply step.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
character_ids
|
Sequence[str]
|
Every member's id, in the new order (a permutation). |
required |
Raises:
| Type | Description |
|---|---|
ValueError
|
If the ids are not exactly the current membership. |