DeclarationFizzledEvent
A declared wand, staff, or rod use, a declared turning, or a declared melee attack failed before it took effect.
Full documentation: DeclarationFizzledEvent. Wire type: declaration_fizzled.
Default visibility: player
Message codes: battle.melee.fizzled, magic.device.fizzled, magic.turning.fizzled
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 declared wand, staff, or rod use, a declared turning, or a declared melee attack failed before it took effect.\n\nA `GameSession` reports it during a battle round. At the start of each\nround, every party member declares an action in a\n`BattleDeclaration`. A turning is a cleric's attempt to turn undead.\nDevice uses and turnings resolve in the round's magic phase, the step in which the party's spells, item uses,\nand turnings take effect. A staff's strike is the exception, described below. Just before\neach one resolves, the session checks it again. If a check the declaration passed at the start of the round\nnow fails, the declaration fizzles. Something earlier in the round caused the failure. For example, the group a\nwand was aimed at left the battle.\n\nA melee attack fizzles when the party's melee step comes and the attack has nothing left to strike, or the\nmember stands in the wrong place. The session judges a melee attack before the round starts, as if every move the\nround declares had happened. When the attack comes up, it resolves only if its group still has a living monster\nthe member can see to strike, and the member stands in the group's front rank within 5' of it. Something earlier\nin the round can change either. For example, the party's missiles or spells kill every monster in the group, the\nmonsters win initiative and the group runs before the member's `close`, or a member the session expected to step\nback can no longer move. Then the attack fizzles with the code `battle.melee.fizzled`. A group that has started to\nflee is an exception to the position check: a member who stood within 5' of it when the round was accepted still\ngets the attack, if the group has a monster left to strike and hasn't run out of the battle.\n\nA staff's strike for a charge, with the staff of power, striking, or wizardry, is a melee attack with a slow\nweapon. So it doesn't resolve in the magic phase. It comes up after both sides have acted, as a slow attack\ndoes, and it fizzles where a slow melee attack does. The session checks it when the party's melee step comes\nand again when the strike comes up, with a melee attack's checks and reasons. A strike is still a device use,\nso a strike that fizzles has the code `magic.device.fizzled`, with the staff in `item_id`. For example, the\nstrike's group ran out of the battle, or a quicker member killed the last monster in it that the member could\nsee.\n\nThe event's `actor_id` is the member who declared the action, `item_id` is the device, `group_id` is the group a\nmelee attack was aimed at, and `reason` is the rejection code of the check that failed.\n\nA fizzled declaration spends nothing. The device wasn't used, so it keeps its charge and isn't identified. Tell\nthe player the action failed, and that the device still has its charge. A fizzled melee attack makes no attack\nroll, so tell the player why the member didn't swing. When a cast or a scroll read fizzles,\nthe session reports a `SpellDisruptedEvent` instead, because the\nspell is lost.",
"properties": {
"code": {
"title": "Code",
"type": "string",
"description": "Which declaration fizzled: `magic.device.fizzled`, `magic.turning.fizzled`, or `battle.melee.fizzled`."
},
"visibility": {
"$ref": "#/$defs/Visibility",
"default": "player",
"description": "Player visibility: everyone sees the action fail."
},
"event_type": {
"const": "declaration_fizzled",
"default": "declaration_fizzled",
"title": "Event Type",
"type": "string",
"description": "The fixed string that identifies this event class in a serialized event."
},
"actor_id": {
"title": "Actor Id",
"type": "string",
"description": "The entity id of the member who declared the device use, the turning, or the melee attack."
},
"item_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Item Id",
"description": "On a `magic.device.fizzled` event, the device's instance id, as the declaration's `item_id` gave it.\n\nThe player already used this id, so it reveals nothing about a device that isn't identified. It's `None` on a\n`magic.turning.fizzled` or a `battle.melee.fizzled` event."
},
"group_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"default": null,
"title": "Group Id",
"description": "On a `battle.melee.fizzled` event, the id of the group the melee attack was aimed at, as the declaration's\n`target_group_id` gave it. It's `None` on the other codes."
},
"reason": {
"title": "Reason",
"type": "string",
"description": "Why the declaration fizzled: the code of the first check that failed when the session checked it again.\n\nAny check the declaration passed at the start of the round can fail, so read the code and don't assume a\ncause. Some codes you may see:\n\n- `combat.attack.out_of_reach`: the member who declared a melee attack, or a strike with a staff, is farther\n than 5' from its group when the blow comes up. Either one gets it too when its group ran out of the battle,\n wherever the member stood.\n- `battle.declaration.not_in_front_rank`: the member who declared a melee attack is within 5' of its group\n but not in its front rank when the attack comes up. A melee attack gets this code only when the member is\n within 5', and `combat.attack.out_of_reach` otherwise.\n- `battle.declaration.unknown_group`: the group a wand was aimed at left the battle.\n- `battle.declaration.no_target`: no living monster is left in the battle for a turning, or no living monster\n the member can see is left in the group a melee attack was aimed at, for example because the party's missiles\n or spells killed them earlier in the round. A melee attack gets this code wherever the member stands, whether\n or not the member closed, because the session checks for a target before it checks the member's position.\n\nMatch on it as you match on the code of a `Rejection`.\nThe rejection code reference explains each code."
}
},
"required": [
"code",
"actor_id",
"reason"
],
"title": "DeclarationFizzledEvent",
"type": "object"
}