pub struct SavedDoor {Show 43 fields
pub placement: Placement,
pub saves: SavingThrows,
pub lock: LockState,
pub portrait: SavedPortrait,
pub trap_detectable: bool,
pub trap_disarmable: bool,
pub trap_one_shot: bool,
pub trap_type: u8,
pub trap_detect_dc: u8,
pub trap_disarm_dc: u8,
pub trap_flag: u8,
pub on_closed: ResRef,
pub on_damaged: ResRef,
pub on_death: ResRef,
pub on_disarm: ResRef,
pub on_heartbeat: ResRef,
pub on_lock: ResRef,
pub on_melee_attacked: ResRef,
pub on_open: ResRef,
pub on_spell_cast_at: ResRef,
pub on_trap_triggered: ResRef,
pub on_unlock: ResRef,
pub on_user_defined: ResRef,
pub common: GitDoorCommon,
pub tag: String,
pub commandable: bool,
pub conversation: ResRef,
pub current_hp: i16,
pub description: GffLocalizedString,
pub faction: u32,
pub generic_type: u8,
pub hp: i16,
pub hardness: u8,
pub load_screen_id: u16,
pub loc_name: GffLocalizedString,
pub min1_hp: bool,
pub on_click: ResRef,
pub on_dialog: ResRef,
pub on_fail_to_open: ResRef,
pub open_state: u8,
pub plot: bool,
pub secret_door_dc: u8,
pub is_static: bool,
}Expand description
A door as stored inside a save game’s module GIT.
Fields§
§placement: PlacementPlacement, whose four labels sit at this object’s own level.
saves: SavingThrowsSaving throws, likewise flat on the object.
lock: LockStateLock state, likewise flat on the object.
portrait: SavedPortraitPortrait, as whichever of the two labels the object carries.
Declared per owner rather than shared: the audit parts Portrait and
PortraitId across doors, placeables and triggers on the absent axis.
Both halves are this type’s, because one member stands for two labels
and which one is written depends on the variant.
trap_detectable: boolWhether the trap can be spotted (TrapDetectable).
trap_disarmable: boolWhether the trap can be disarmed (TrapDisarmable).
trap_one_shot: boolWhether the trap fires once and clears (TrapOneShot).
trap_type: u8Trap row in traps.2da (TrapType).
trap_detect_dc: u8Difficulty of spotting the trap (TrapDetectDC).
trap_disarm_dc: u8Difficulty of disarming it (DisarmDC).
trap_flag: u8Whether a trap is present at all (TrapFlag).
on_closed: ResRefFired when the object closes (OnClosed).
on_damaged: ResRefFired when it takes damage (OnDamaged).
on_death: ResRefFired when it is destroyed (OnDeath).
on_disarm: ResRefFired when its trap is disarmed (OnDisarm).
on_heartbeat: ResRefFired on the object heartbeat (OnHeartbeat).
on_lock: ResRefFired when it is locked (OnLock).
on_melee_attacked: ResRefFired when it is struck in melee (OnMeleeAttacked).
on_open: ResRefFired when it opens (OnOpen).
on_spell_cast_at: ResRefFired when a spell targets it (OnSpellCastAt).
on_trap_triggered: ResRefFired when its trap goes off (OnTrapTriggered).
on_unlock: ResRefFired when it is unlocked (OnUnlock).
on_user_defined: ResRefFired on a user-defined event (OnUserDefined).
common: GitDoorCommonThe block both forms carry, which the list declares as its element.
No #[gff]: the arm contributes its parts to the split, and the
element is this block, so declaring it here too would make one label
two declarations. The arm’s own codec reads and writes it.
tag: StringObject tag (Tag).
commandable: boolAccepts scripted commands (Commandable).
conversation: ResRefAttached conversation (Conversation).
current_hp: i16Current hit points (CurrentHP).
description: GffLocalizedStringDescription (Description).
faction: u32Faction id (Faction).
generic_type: u8Generic door type (GenericType).
hp: i16Maximum hit points (HP).
hardness: u8Damage reduction (Hardness).
load_screen_id: u16Load screen shown across the transition (LoadScreenID).
loc_name: GffLocalizedStringDisplayed name (LocName).
min1_hp: boolCannot be reduced below 1 HP (Min1HP).
on_click: ResRefOnClick.
on_dialog: ResRefOnDialog.
on_fail_to_open: ResRefOnFailToOpen.
open_state: u8Open / closed / destroyed state (OpenState).
plot: boolPlot flag (Plot).
secret_door_dc: u8DC to spot a secret door (SecretDoorDC). Doors only.
is_static: boolStatic, non-interactive geometry (Static).
Implementations§
Source§impl SavedDoor
impl SavedDoor
Sourcepub const PARTS: &'static [&'static [Field]]
pub const PARTS: &'static [&'static [Field]]
This type’s schema in parts, which is what a container holding it references.
Own fields first, then one part per flattened child in the order they are declared.
Sourcepub fn read_declared(root: &GffStruct) -> Self
pub fn read_declared(root: &GffStruct) -> Self
Reads every declared field off root.
Absent fields take the entry’s own answer, so a fallback is derived from the declaration rather than restated beside it.
A field declaring a hand-written read is left at that answer for the view to overwrite.
Sourcepub fn write_declared(&self, root: &mut GffStruct)
pub fn write_declared(&self, root: &mut GffStruct)
Writes every declared field onto root, leaving out the ones
their entry says the engine’s own writer leaves out.
A field declaring a hand-written write is not touched here.
Source§impl SavedDoor
impl SavedDoor
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one element, resolving the portrait’s two labels into one value.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one element, emitting whichever portrait label the value uses.