AdventureXpAwardEvent
The experience award for a trip to the dungeon: what the party earned and what each survivor gets.
Full documentation: AdventureXpAwardEvent. Wire type: adventure_xp_award.
Default visibility: player
Message codes: session.xp.adventure_award
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 experience award for a trip to the dungeon: what the party earned and what each survivor gets.\n\nEmitted by `TravelToTown` under the default\nruleset, where experience is awarded for making it back. Each survivor's\n`XpAwardedEvent` follows it, each followed by\na `CharacterLeveledUpEvent` when that\nmember gains a level.\n\nTreasure counts as the gain in the value of the party's coins, gems, and jewellery\nsince it left town, so goods still lying in the dungeon are worth nothing yet. The session\nemits no event when nobody came back alive or when the delve earned nothing.",
"properties": {
"code": {
"default": "session.xp.adventure_award",
"title": "Code",
"type": "string",
"description": "The message code, always `session.xp.adventure_award`."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "player",
"description": "Player visibility: the party sees what it earned."
},
"event_type": {
"const": "adventure_xp_award",
"default": "adventure_xp_award",
"title": "Event Type",
"type": "string",
"description": "The event type, `adventure_xp_award`, which identifies this class in serialized form."
},
"monster_xp": {
"title": "Monster Xp",
"type": "integer",
"description": "What the defeated creatures were worth, added up across the whole delve."
},
"treasure_xp": {
"title": "Treasure Xp",
"type": "integer",
"description": "What the recovered treasure was worth, one experience point per gold piece of value gained\nsince the party left town, and never less than zero."
},
"share": {
"title": "Share",
"type": "integer",
"description": "What each survivor receives: the total divided by the number of survivors, rounded down.\nWhen it rounds down to zero, no `XpAwardedEvent` follows."
},
"survivors": {
"items": {
"type": "string"
},
"title": "Survivors",
"type": "array",
"description": "The members who made it back, in marching order. The dead count toward the treasure that\ncame home but take no share."
}
},
"required": [
"monster_xp",
"treasure_xp",
"share",
"survivors"
],
"title": "AdventureXpAwardEvent",
"type": "object"
}