pub struct SavedCreature {Show 98 fields
pub common: GitCreatureCommon,
pub object_id: ObjectId,
pub ai_state: i32,
pub age: i32,
pub ambient_anim_state: u8,
pub animation: i32,
pub appearance_head: u8,
pub appearance_type: u16,
pub area_id: u32,
pub armor_class: i16,
pub body_bag: u8,
pub charisma: u8,
pub challenge_rating: f32,
pub classes: Vec<SavedClass>,
pub color_hair: u8,
pub color_skin: u8,
pub color_tattoo1: u8,
pub color_tattoo2: u8,
pub commandable: u8,
pub constitution: u8,
pub conversation: ResRef,
pub creation_script_fired: u8,
pub creature_size: i32,
pub current_force: i16,
pub current_hit_points: i16,
pub dead_selectable: u8,
pub deity: String,
pub description: GffLocalizedString,
pub detect_mode: u8,
pub dexterity: u8,
pub disarmable: u8,
pub duplicating_head: u8,
pub equipment: Vec<SavedItem>,
pub experience: u32,
pub faction_id: u16,
pub feats: Vec<u16>,
pub first_name: GffLocalizedString,
pub force_points: i16,
pub fort_save_throw: i8,
pub gender: u8,
pub gold: u32,
pub good_evil: u8,
pub hit_points: i16,
pub intelligence: u8,
pub interruptable: u8,
pub is_destroyable: u8,
pub is_pc: u8,
pub is_raiseable: u8,
pub inventory: Vec<SavedItem>,
pub joining_xp: i32,
pub last_name: GffLocalizedString,
pub listening: u8,
pub multiclass_level_up_in: u8,
pub max_force_points: i16,
pub max_hit_points: i16,
pub min1_hp: u8,
pub movement_rate: u8,
pub natural_ac: u8,
pub not_reorienting: u8,
pub is_disguised: u8,
pub party_interact: u8,
pub phenotype: i32,
pub plot: u8,
pub portrait_id: u16,
pub pregame_current: i16,
pub race: u8,
pub ref_save_throw: i8,
pub on_attacked: ResRef,
pub on_damaged: ResRef,
pub on_death: ResRef,
pub on_dialog: ResRef,
pub on_disturbed: ResRef,
pub on_end_dialog: ResRef,
pub on_end_round: ResRef,
pub on_heartbeat: ResRef,
pub on_blocked: ResRef,
pub on_notice: ResRef,
pub on_rested: ResRef,
pub on_spawn: ResRef,
pub on_spell: ResRef,
pub on_user_defined: ResRef,
pub skills: UtcSkills,
pub skill_points: u16,
pub sound_set_file: u16,
pub starting_package: u8,
pub stealth_mode: u8,
pub strength: u8,
pub subrace: String,
pub subrace_index: u8,
pub tag: String,
pub tail: u8,
pub use_backup_head: u8,
pub will_save_throw: i8,
pub wings: u8,
pub wisdom: u8,
pub fort_bonus: i16,
pub ref_bonus: i16,
pub will_bonus: i16,
}Expand description
A creature as stored inside a save game’s module GIT.
Fields§
§common: GitCreatureCommonThe 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.
object_id: ObjectIdRuntime object id (ObjectId).
ai_state: i32AI state (AIState).
age: i32Age (Age).
ambient_anim_state: u8Ambient animation state (AmbientAnimState).
animation: i32Current animation (Animation).
appearance_head: u8Head appearance (Appearance_Head).
appearance_type: u16Appearance row (Appearance_Type).
area_id: u32Runtime area id the creature belongs to (AreaId).
armor_class: i16Computed armour class (ArmorClass). Rebuilt on load from armour
tables, natural AC, the Dexterity modifier, feats and active effects.
body_bag: u8Corpse body-bag appearance (BodyBag).
charisma: u8Charisma (Cha).
challenge_rating: f32Challenge rating (ChallengeRating).
classes: Vec<SavedClass>Class levels and known powers (ClassList).
color_hair: u8Hair colour index (Color_Hair).
color_skin: u8Skin colour index (Color_Skin).
color_tattoo1: u8First tattoo colour index (Color_Tattoo1).
color_tattoo2: u8Second tattoo colour index (Color_Tattoo2).
commandable: u8Player-commandable flag (Commandable).
constitution: u8Constitution (Con).
conversation: ResRefDialogue this creature opens (Conversation). Not a script hook.
creation_script_fired: u8Spawn-script-fired flag (CreatnScrptFird).
creature_size: i32Creature size row (CreatureSize).
current_force: i16Current Force pool (CurrentForce).
current_hit_points: i16Live hit points (CurrentHitPoints).
dead_selectable: u8Corpse-selectable flag (DeadSelectable).
deity: StringDeity name (Deity).
description: GffLocalizedStringLocalized description (Description).
detect_mode: u8Detect mode (DetectMode). The loader reads the byte only to step
past it and resets every restored creature to mode 1.
dexterity: u8Dexterity (Dex).
disarmable: u8Disarmable flag (Disarmable).
duplicating_head: u8Head-duplication flag (DuplicatingHead).
equipment: Vec<SavedItem>Equipped items (Equip_ItemList).
Hand-written both ways because the element’s struct id is the equipment slot: the engine reads it off the header and no label repeats it, so a generated codec has nowhere to take it from and nothing to put it back.
experience: u32Accumulated experience (Experience).
faction_id: u16Faction id indexing the session faction table (FactionID).
feats: Vec<u16>Feat ids (FeatList).
first_name: GffLocalizedStringLocalized first name (FirstName).
force_points: i16Live Force points (ForcePoints).
fort_save_throw: i8Computed Fortitude save total (FortSaveThrow). Rebuilt on load.
gender: u8Gender row (Gender).
gold: u32Carried gold (Gold). Skipped on load for creatures currently in the
party, whose wealth lives in the shared party pool instead.
good_evil: u8Alignment on the light/dark axis (GoodEvil). The engine clamps this
to a maximum of 100.
hit_points: i16Base hit points carried from the template (HitPoints).
intelligence: u8Intelligence (Int).
interruptable: u8Interruptable flag (Interruptable).
is_destroyable: u8Destroyable flag (IsDestroyable).
is_pc: u8Player-character flag (IsPC).
is_raiseable: u8Raiseable flag (IsRaiseable).
inventory: Vec<SavedItem>Carried inventory (ItemList).
Every element is struct id 0, not its index. The two readings agree
on a one-item inventory and most of them hold one item, which is what
kept the wrong one standing; the multi-element lists in the save corpus
are all zero throughout.
joining_xp: i32Joining experience (JoiningXP). Read only by the fresh-spawn path,
so it resets to zero when a save is continued.
last_name: GffLocalizedStringLocalized last name (LastName).
listening: u8Listening flag (Listening).
multiclass_level_up_in: u8Multiclass level-up bookkeeping (MClassLevUpIn). Written on every
save and read by nothing.
max_force_points: i16Computed maximum Force points (MaxForcePoints).
max_hit_points: i16Computed maximum hit points (MaxHitPoints). Rebuilt on load from
class levels and the Constitution modifier, so an edit here does
nothing.
min1_hp: u8Minimum-one-hit-point flag (Min1HP).
movement_rate: u8Movement rate row (MovementRate). A blueprint spells this WalkRate.
natural_ac: u8Natural armour class (NaturalAC).
not_reorienting: u8Orientation-lock flag (NotReorienting).
is_disguised: u8Party-member disguise flag (PM_IsDisguised).
party_interact: u8Party-interaction flag (PartyInteract).
phenotype: i32Body-model phenotype (Phenotype).
plot: u8Plot-protection flag (Plot).
portrait_id: u16Portrait row (PortraitId). A snapshot carries only the id; a
blueprint additionally carries a Portrait resref.
pregame_current: i16Current-HP mirror (PregameCurrent). Written on every save and read
by nothing.
race: u8Race row (Race).
ref_save_throw: i8Computed Reflex save total (RefSaveThrow). Rebuilt on load.
on_attacked: ResRefOn-attacked script (ScriptAttacked).
on_damaged: ResRefOn-damaged script (ScriptDamaged).
on_death: ResRefOn-death script (ScriptDeath).
on_dialog: ResRefOn-dialogue script (ScriptDialogue).
on_disturbed: ResRefOn-disturbed script (ScriptDisturbed).
on_end_dialog: ResRefOn-end-dialog script (ScriptEndDialogu).
on_end_round: ResRefOn-end-round script (ScriptEndRound).
on_heartbeat: ResRefOn-heartbeat script (ScriptHeartbeat).
on_blocked: ResRefOn-blocked script (ScriptOnBlocked).
on_notice: ResRefOn-notice script (ScriptOnNotice).
on_rested: ResRefOn-rested script (ScriptRested).
on_spawn: ResRefOn-spawn script (ScriptSpawn).
on_spell: ResRefOn-spell-at script (ScriptSpellAt).
on_user_defined: ResRefOn-user-defined script (ScriptUserDefine).
skills: UtcSkillsSkill ranks (SkillList), in the fixed order the engine stores them.
The order is the meaning: index zero is computer use and index seven is treat injury, with no label naming which skill an element is. The element’s struct id carries nothing and is zero throughout.
skill_points: u16Unspent skill points (SkillPoints).
sound_set_file: u16Sound-set row (SoundSetFile).
starting_package: u8Starting package row (StartingPackage).
stealth_mode: u8Stealth mode (StealthMode).
strength: u8Strength (Str).
subrace: StringSubrace name (Subrace).
subrace_index: u8Subrace row (SubraceIndex).
tag: StringObject tag (Tag).
tail: u8Tail appearance (Tail). Hardcoded to zero on read; written anyway.
use_backup_head: u8Backup-head flag (UseBackupHead).
will_save_throw: i8Computed Will save total (WillSaveThrow). Rebuilt on load.
wings: u8Wing appearance (Wings). Hardcoded to zero on read; written anyway.
wisdom: u8Wisdom (Wis).
fort_bonus: i16Permanent Fortitude bonus (fortbonus). Read back on load.
ref_bonus: i16Permanent Reflex bonus (refbonus). Unlike the total above, this is
an input the engine reads back.
will_bonus: i16Permanent Will bonus (willbonus). Read back on load.
Implementations§
Source§impl SavedCreature
impl SavedCreature
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 SavedCreature
Maps each element of a list field through build, or yields nothing when
the field is absent or not a list.
impl SavedCreature
Maps each element of a list field through build, or yields nothing when
the field is absent or not a list.
Sourcepub fn read_element(structure: &GffStruct) -> Self
pub fn read_element(structure: &GffStruct) -> Self
Reads one saved creature.
Three lists the model unwraps rather than mirrors, which is why the derive supplies neither element half: the skills are a fixed-size positional array by name, and the feats and the per-class power lists are one-field elements the model holds as bare ids.
Sourcepub fn write_element(&self, structure: &mut GffStruct)
pub fn write_element(&self, structure: &mut GffStruct)
Writes one saved creature.
Trait Implementations§
Source§impl Clone for SavedCreature
impl Clone for SavedCreature
Source§fn clone(&self) -> SavedCreature
fn clone(&self) -> SavedCreature
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SavedCreature
impl Debug for SavedCreature
Source§impl Default for SavedCreature
impl Default for SavedCreature
Source§impl GitElement for SavedCreature
impl GitElement for SavedCreature
Source§impl HasSchema for SavedCreature
impl HasSchema for SavedCreature
Source§impl PartialEq for SavedCreature
impl PartialEq for SavedCreature
Source§fn eq(&self, other: &SavedCreature) -> bool
fn eq(&self, other: &SavedCreature) -> bool
self and other values to be equal, and is used by ==.