EncounterEndedEvent
The encounter is over, however it went.
Full documentation: EncounterEndedEvent. Wire type: encounter_ended.
Default visibility: player
Message codes: encounter.ended
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": "The encounter is over, however it went.\n\nEmitted when the monsters are beaten or turned, or when the party gets away from them.\nThe session goes back to `exploring`. The session then advances the clock to the start\nof the next turn, and to at least one full turn after the encounter opened, so time\npasses after this event even when the fight was short. The\n`MonsterDefeatedEvent`s and the\n`LootDroppedEvent` come before it.",
"properties": {
"code": {
"default": "encounter.ended",
"title": "Code",
"type": "string",
"description": "The message code, always `encounter.ended`. The ending is in `outcome`."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "player",
"description": "Player visibility: the party knows the encounter is behind it."
},
"event_type": {
"const": "encounter_ended",
"default": "encounter_ended",
"title": "Event Type",
"type": "string",
"description": "The event type, `encounter_ended`, which identifies this class in serialized form."
},
"outcome": {
"title": "Outcome",
"type": "string",
"description": "How it ended:\n\n- `\"victory\"`: the monsters were beaten.\n- `\"evaded\"`: the party got away before or during a fight.\n- `\"escaped\"`: the party got away at the end of a chase.\n- `\"turned\"`: undead were driven off.\n- `\"parley\"`: the party talked or paid its way past, through an\n `EndEncounter`.\n- `\"departed\"`: the party walked away from monsters that let it go, through an `EndEncounter`."
}
},
"required": [
"outcome"
],
"title": "EncounterEndedEvent",
"type": "object"
}