MemberWithdrewEvent
A member who fell back alone traded places in the marching order with the member they named.
Full documentation: MemberWithdrewEvent. Wire type: member_withdrew.
Default visibility: player
Message codes: battle.member.retreated, battle.member.withdrew
JSON Schema
{
"$defs": {
"Visibility": {
"description": "Who may see an event: the players, or only the referee.\n\nEvery event has one of these values, because in B/X the referee makes some rolls behind a screen. Filter\na log on it before you show anything to a player, or call\n`GameSession.view`, which builds the players' view and the referee's\nview for you. A narrator that plays the referee reads every event.\n\nA serialized event contains the lowercase value. The values stay fixed within a `schema_version`, the version\nstamp of the saved format.\n\nExamples:\n ```python\n from osrlib.core.events import DamageDealtEvent, HitPointsReportedEvent, Visibility\n\n log = [\n DamageDealtEvent(target_id=\"monster-0001\", amount=5),\n HitPointsReportedEvent(target_id=\"monster-0001\", current_hp=2, max_hp=7),\n ]\n shown = [event.code for event in log if event.visibility is Visibility.PLAYER]\n assert shown == [\"combat.damage.dealt\"] # the goblin's remaining hit points stay hidden\n ```",
"enum": [
"player",
"referee"
],
"title": "Visibility",
"type": "string"
}
},
"description": "A member who fell back alone traded places in the marching order with the member they named.\n\nEmitted by `ResolveBattleRound` in the party's\nmovement step, right after the withdrawing member's\n`MemberMovedEvent`.\n\nA member who makes a fighting withdrawal or a retreat alone can name another member in\n`replacement_id`. The two then\ntrade places in the marching order, and the session emits this event. The trade moves\nnobody on the range track. It decides who stands in front among members at the same\ndistance from a group who got there in the same round, and it's the marching order the\nparty keeps after the battle.\n\nThe trade happens only when the withdrawing member's move happens, and only while both\nmembers are alive. A member who can no longer move when the movement step comes doesn't\nfall back, so they don't trade places either, and the session emits neither event.\n\nRedraw a battle screen's marching order from this event, or read it again from\n`PlayerView.party`.",
"properties": {
"code": {
"title": "Code",
"type": "string",
"description": "What happened, like `combat.attack.hit`: two or more lowercase parts separated by dots. The first part is\nthe area of the rules the event comes from, like `combat` or `magic`.\n\nBranch on it, and pass the event to `format_message` to turn it into English.\nBuilding an event with a code in any other format raises a pydantic `ValidationError`."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "player",
"description": "Player visibility: the party sees its own marching order change."
},
"event_type": {
"const": "member_withdrew",
"default": "member_withdrew",
"title": "Event Type",
"type": "string",
"description": "The event type, `member_withdrew`, which identifies this class in serialized form."
},
"character_id": {
"title": "Character Id",
"type": "string",
"description": "The member who fell back, by party member id. They now have the replacement's place in the\nmarching order."
},
"replacement_id": {
"title": "Replacement Id",
"type": "string",
"description": "The member they named, by party member id. They now have the withdrawing member's place in\nthe marching order."
}
},
"required": [
"code",
"character_id",
"replacement_id"
],
"title": "MemberWithdrewEvent",
"type": "object"
}