mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Made naming of fields more explicit.
This commit is contained in:
parent
708cb12086
commit
d500a00414
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Axe Simple")),
|
||||
ability_spec: Some(Custom("Axe Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Axe Simple")),
|
||||
ability_spec: Some(Custom("Axe Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Staff Simple")),
|
||||
ability_spec: Some(Custom("Staff Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Staff Simple")),
|
||||
ability_spec: Some(Custom("Staff Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Staff Simple")),
|
||||
ability_spec: Some(Custom("Staff Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Staff Simple")),
|
||||
ability_spec: Some(Custom("Staff Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Bow Simple")),
|
||||
ability_spec: Some(Custom("Bow Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Hammer Simple")),
|
||||
ability_spec: Some(Custom("Hammer Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Hammer Simple")),
|
||||
ability_spec: Some(Custom("Hammer Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Hammer Simple")),
|
||||
ability_spec: Some(Custom("Hammer Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Hammer Simple")),
|
||||
ability_spec: Some(Custom("Hammer Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Hammer Simple")),
|
||||
ability_spec: Some(Custom("Hammer Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Hammer Simple")),
|
||||
ability_spec: Some(Custom("Hammer Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Legendary,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Mindflayer")),
|
||||
ability_spec: Some(Custom("Mindflayer")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Staff Simple")),
|
||||
ability_spec: Some(Custom("Staff Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Staff Simple")),
|
||||
ability_spec: Some(Custom("Staff Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Sword Simple")),
|
||||
ability_spec: Some(Custom("Sword Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Sword Simple")),
|
||||
ability_spec: Some(Custom("Sword Simple")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Beast Claws")),
|
||||
ability_spec: Some(Custom("Beast Claws")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Bird Large Breathe")),
|
||||
ability_spec: Some(Custom("Bird Large Breathe")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Bird Large Fire")),
|
||||
ability_spec: Some(Custom("Bird Large Fire")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Husk")),
|
||||
ability_spec: Some(Custom("Husk")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Low Basic")),
|
||||
ability_spec: Some(Custom("Quad Low Basic")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Low Beam")),
|
||||
ability_spec: Some(Custom("Quad Low Beam")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Low Breathe")),
|
||||
ability_spec: Some(Custom("Quad Low Breathe")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Low Quick")),
|
||||
ability_spec: Some(Custom("Quad Low Quick")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Low Ranged")),
|
||||
ability_spec: Some(Custom("Quad Low Ranged")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Low Tail")),
|
||||
ability_spec: Some(Custom("Quad Low Tail")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Med Basic")),
|
||||
ability_spec: Some(Custom("Quad Med Basic")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Med Basic")),
|
||||
ability_spec: Some(Custom("Quad Med Basic")),
|
||||
)
|
||||
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Med Charge")),
|
||||
ability_spec: Some(Custom("Quad Med Charge")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Med Hoof")),
|
||||
ability_spec: Some(Custom("Quad Med Hoof")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Med Jump")),
|
||||
ability_spec: Some(Custom("Quad Med Jump")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Med Quick")),
|
||||
ability_spec: Some(Custom("Quad Med Quick")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Quad Small Basic")),
|
||||
ability_spec: Some(Custom("Quad Small Basic")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Stone Golem")),
|
||||
ability_spec: Some(Custom("Stone Golem")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Theropod Basic")),
|
||||
ability_spec: Some(Custom("Theropod Basic")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Theropod Bird")),
|
||||
ability_spec: Some(Custom("Theropod Bird")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Theropod Charge")),
|
||||
ability_spec: Some(Custom("Theropod Charge")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Tidal Claws")),
|
||||
ability_spec: Some(Custom("Tidal Claws")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Turret")),
|
||||
ability_spec: Some(Custom("Turret")),
|
||||
)
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_set: Some(Custom("Wendigo Magic")),
|
||||
ability_spec: Some(Custom("Wendigo Magic")),
|
||||
)
|
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
|
@ -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,
|
||||
|
@ -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)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user