Made naming of fields more explicit.

This commit is contained in:
Sam 2021-05-01 09:25:38 -04:00
parent 708cb12086
commit d500a00414
46 changed files with 55 additions and 55 deletions

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Axe Simple")),
ability_spec: Some(Custom("Axe Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Axe Simple")),
ability_spec: Some(Custom("Axe Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Staff Simple")),
ability_spec: Some(Custom("Staff Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Staff Simple")),
ability_spec: Some(Custom("Staff Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Staff Simple")),
ability_spec: Some(Custom("Staff Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Staff Simple")),
ability_spec: Some(Custom("Staff Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Bow Simple")),
ability_spec: Some(Custom("Bow Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Hammer Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Hammer Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Hammer Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Hammer Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Hammer Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Hammer Simple")),
ability_spec: Some(Custom("Hammer Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Legendary,
tags: [],
ability_set: Some(Custom("Mindflayer")),
ability_spec: Some(Custom("Mindflayer")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Staff Simple")),
ability_spec: Some(Custom("Staff Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Staff Simple")),
ability_spec: Some(Custom("Staff Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Sword Simple")),
ability_spec: Some(Custom("Sword Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Sword Simple")),
ability_spec: Some(Custom("Sword Simple")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Beast Claws")),
ability_spec: Some(Custom("Beast Claws")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Bird Large Breathe")),
ability_spec: Some(Custom("Bird Large Breathe")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Bird Large Fire")),
ability_spec: Some(Custom("Bird Large Fire")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Husk")),
ability_spec: Some(Custom("Husk")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Low Basic")),
ability_spec: Some(Custom("Quad Low Basic")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Low Beam")),
ability_spec: Some(Custom("Quad Low Beam")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Low Breathe")),
ability_spec: Some(Custom("Quad Low Breathe")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Low Quick")),
ability_spec: Some(Custom("Quad Low Quick")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Low Ranged")),
ability_spec: Some(Custom("Quad Low Ranged")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Low Tail")),
ability_spec: Some(Custom("Quad Low Tail")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Med Basic")),
ability_spec: Some(Custom("Quad Med Basic")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Med Basic")),
ability_spec: Some(Custom("Quad Med Basic")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Med Charge")),
ability_spec: Some(Custom("Quad Med Charge")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Med Hoof")),
ability_spec: Some(Custom("Quad Med Hoof")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Med Jump")),
ability_spec: Some(Custom("Quad Med Jump")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Med Quick")),
ability_spec: Some(Custom("Quad Med Quick")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Quad Small Basic")),
ability_spec: Some(Custom("Quad Small Basic")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Stone Golem")),
ability_spec: Some(Custom("Stone Golem")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Theropod Basic")),
ability_spec: Some(Custom("Theropod Basic")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Theropod Bird")),
ability_spec: Some(Custom("Theropod Bird")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Theropod Charge")),
ability_spec: Some(Custom("Theropod Charge")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Tidal Claws")),
ability_spec: Some(Custom("Tidal Claws")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Turret")),
ability_spec: Some(Custom("Turret")),
)

View File

@ -15,5 +15,5 @@ ItemDef(
)),
quality: Low,
tags: [],
ability_set: Some(Custom("Wendigo Magic")),
ability_spec: Some(Custom("Wendigo Magic")),
)

View File

@ -278,7 +278,7 @@ pub struct ItemDef {
pub slots: u16,
/// Used to specify a custom ability set for a weapon. Leave None (or don't
/// include field in ItemDef) to use default ability set for weapon kind.
pub ability_set: Option<AbilitySpec>,
pub ability_spec: Option<AbilitySpec>,
}
impl PartialEq for ItemDef {
@ -307,7 +307,7 @@ impl TryFrom<(&Item, &AbilityMap, &MaterialStatManifest)> for ItemConfig {
let tool_default = ability_map
.get_ability_set(&AbilitySpec::Tool(tool.kind))
.cloned();
let abilities = if let Some(set_key) = item.ability_set() {
let abilities = if let Some(set_key) = item.ability_spec() {
if let Some(set) = ability_map.get_ability_set(set_key) {
set.clone().modified_by_tool(&tool, msm, &item.components)
} else {
@ -383,7 +383,7 @@ impl ItemDef {
quality,
tags,
slots,
ability_set: None,
ability_spec: None,
}
}
}
@ -424,7 +424,7 @@ impl assets::Compound for ItemDef {
quality,
tags,
slots,
ability_set,
ability_spec,
} = raw;
// Some commands like /give_item provide the asset specifier separated with \
@ -441,7 +441,7 @@ impl assets::Compound for ItemDef {
quality,
tags,
slots,
ability_set,
ability_spec,
})
}
}
@ -456,7 +456,7 @@ struct RawItemDef {
tags: Vec<ItemTag>,
#[serde(default)]
slots: u16,
ability_set: Option<AbilitySpec>,
ability_spec: Option<AbilitySpec>,
}
impl assets::Asset for RawItemDef {
@ -765,7 +765,7 @@ impl Item {
}))
}
pub fn ability_set(&self) -> Option<&AbilitySpec> { self.item_def.ability_set.as_ref() }
pub fn ability_spec(&self) -> Option<&AbilitySpec> { self.item_def.ability_spec.as_ref() }
}
/// Provides common methods providing details about an item definition

View File

@ -192,7 +192,7 @@ fn make_component_def(
quality,
tags: vec![ItemTag::ModularComponent(tag)],
slots: 0,
ability_set: None,
ability_spec: None,
};
(identifier, item)
}
@ -215,7 +215,7 @@ fn make_weapon_def(toolkind: ToolKind) -> (String, RawItemDef) {
quality,
tags: Vec::new(),
slots: 0,
ability_set: None,
ability_spec: None,
};
(identifier, item)
}
@ -268,7 +268,7 @@ fn make_tagexample_def(
quality,
tags: vec![ItemTag::ModularComponent(tag)],
slots: 0,
ability_set: None,
ability_spec: None,
};
(identifier, item)
}

View File

@ -1507,8 +1507,8 @@ impl<'a> AgentData<'a> {
.equipped(EquipSlot::Mainhand)
.as_ref()
.map(|item| {
if let Some(ability_set) = item.ability_set() {
match ability_set {
if let Some(ability_spec) = item.ability_spec() {
match ability_spec {
AbilitySpec::Custom(spec) => match spec.as_str() {
"Axe Simple" | "Sword Simple" => Tactic::Sword,
"Staff Simple" => Tactic::Staff,

View File

@ -731,7 +731,7 @@ impl FigureMgr {
.and_then(|i| i.equipped(equip_slot))
.map(|i| {
if let ItemKind::Tool(tool) = i.kind() {
(Some(tool.kind), Some(tool.hands), i.ability_set())
(Some(tool.kind), Some(tool.hands), i.ability_spec())
} else {
(None, None, None)
}