mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Removed stuff no longer needed after new method of crafting modular weapons.
This commit is contained in:
parent
e9885140c3
commit
33feee787b
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Axe",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,5 @@ ItemDef(
|
||||
weapon_name: "Battleaxe",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,7 +18,5 @@ ItemDef(
|
||||
weapon_name: "Greataxe",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Jagged Axe",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Great Mace",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,5 @@ ItemDef(
|
||||
weapon_name: "Ornate Axe",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,7 +18,5 @@ ItemDef(
|
||||
weapon_name: "Poleaxe",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Bow",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Composite Bow",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Greatbow",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Longbow",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Ornate Bow",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Shortbow",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Warbow",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,7 +18,5 @@ ItemDef(
|
||||
weapon_name: "Greathammer",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Great Mace",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Hammer",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,7 +18,5 @@ ItemDef(
|
||||
weapon_name: "Maul",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,8 +18,5 @@ ItemDef(
|
||||
weapon_name: "Ornate Hammer",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Spiked Mace",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Warhammer",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Hammer, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,7 +18,5 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Greatsword",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Katana",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Longsword",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Ornate Sword",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Sabre",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "Sawblade",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: One)),
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Zweihander",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Damage, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Held, hands: One)),
|
||||
ModularComponent((toolkind: Axe, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Axe, modkind: Held, hands: One)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,7 +18,5 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Bow, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Held, hands: One)),
|
||||
ModularComponent((toolkind: Hammer, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Hammer, modkind: Held, hands: One)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Arbor",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Cane",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Crook",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Crozier",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Grandsceptre",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Ornate Sceptre",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Sceptre",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sceptre, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Brand",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Grandstaff",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,7 +18,5 @@ ItemDef(
|
||||
weapon_name: "Long Pole",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Ornate Staff",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Pole",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Rod",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "Staff",
|
||||
)),
|
||||
quality: Modular,
|
||||
tags: [
|
||||
ModularComponent((toolkind: Staff, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,9 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Held, hands: One)),
|
||||
ModularComponent((toolkind: Sword, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Held, hands: One)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -18,8 +18,6 @@ ItemDef(
|
||||
weapon_name: "",
|
||||
)),
|
||||
quality: Direct(Common),
|
||||
tags: [
|
||||
ModularComponent((toolkind: Sword, modkind: Held, hands: Two)),
|
||||
],
|
||||
tags: [],
|
||||
)
|
||||
|
||||
|
@ -4,7 +4,7 @@ pub mod modular;
|
||||
pub mod tool;
|
||||
|
||||
// Reexports
|
||||
pub use modular::{ModularComponent, ModularComponentKind, ModularComponentTag};
|
||||
pub use modular::{ModularComponent, ModularComponentKind};
|
||||
pub use tool::{AbilitySet, AbilitySpec, Hands, MaterialStatManifest, Tool, ToolKind};
|
||||
|
||||
use crate::{
|
||||
@ -227,7 +227,6 @@ pub enum ItemTag {
|
||||
Leather,
|
||||
Material(Material),
|
||||
MaterialKind(MaterialKind),
|
||||
ModularComponent(ModularComponentTag),
|
||||
Cultist,
|
||||
Potion,
|
||||
Food,
|
||||
@ -242,7 +241,6 @@ impl TagExampleInfo for ItemTag {
|
||||
fn name(&self) -> Cow<'static, str> {
|
||||
match self {
|
||||
ItemTag::Material(material) => material.name(),
|
||||
ItemTag::ModularComponent(kind) => kind.name(),
|
||||
ItemTag::MaterialKind(material_kind) => Cow::Borrowed(material_kind.into()),
|
||||
ItemTag::Leather => Cow::Borrowed("leather"),
|
||||
ItemTag::Cultist => Cow::Borrowed("cultist"),
|
||||
@ -260,7 +258,6 @@ impl TagExampleInfo for ItemTag {
|
||||
fn exemplar_identifier(&self) -> Cow<'static, str> {
|
||||
match self {
|
||||
ItemTag::Material(_) => Cow::Borrowed("common.items.tag_examples.placeholder"),
|
||||
ItemTag::ModularComponent(tag) => tag.exemplar_identifier(),
|
||||
ItemTag::MaterialKind(_) => Cow::Borrowed("common.items.tag_examples.placeholder"),
|
||||
ItemTag::Leather => Cow::Borrowed("common.items.tag_examples.leather"),
|
||||
ItemTag::Cultist => Cow::Borrowed("common.items.tag_examples.cultist"),
|
||||
|
@ -1,12 +1,8 @@
|
||||
use super::{
|
||||
tool::{self, Hands},
|
||||
Item, ItemDesc, ItemKind, ItemName, ItemTag, RawItemDef, TagExampleInfo, ToolKind,
|
||||
};
|
||||
use crate::{
|
||||
assets::AssetExt,
|
||||
lottery::Lottery,
|
||||
recipe::{self, RawRecipe, RawRecipeBook, RawRecipeInput},
|
||||
Item, ItemDesc, ItemKind, ItemName, RawItemDef, ToolKind,
|
||||
};
|
||||
use crate::{assets::AssetExt, lottery::Lottery, recipe};
|
||||
use hashbrown::HashMap;
|
||||
use lazy_static::lazy_static;
|
||||
use serde::{Deserialize, Serialize};
|
||||
@ -32,7 +28,7 @@ impl ModularComponentKind {
|
||||
match tool {
|
||||
ToolKind::Sword | ToolKind::Axe | ToolKind::Hammer | ToolKind::Bow => Self::Damage,
|
||||
ToolKind::Staff | ToolKind::Sceptre => Self::Held,
|
||||
_ => unreachable!(),
|
||||
_ => unimplemented!(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -46,70 +42,6 @@ pub struct ModularComponent {
|
||||
pub weapon_name: String,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, Serialize, Deserialize)]
|
||||
pub struct ModularComponentTag {
|
||||
toolkind: ToolKind,
|
||||
modkind: ModularComponentKind,
|
||||
hands: Hands,
|
||||
}
|
||||
|
||||
impl TagExampleInfo for ModularComponentTag {
|
||||
fn name(&self) -> Cow<'static, str> {
|
||||
Cow::Owned(format!(
|
||||
"{} {}",
|
||||
self.hands.identifier_name().to_owned(),
|
||||
match self.modkind {
|
||||
ModularComponentKind::Damage => match self.toolkind {
|
||||
ToolKind::Sword => "sword blade",
|
||||
ToolKind::Axe => "axe head",
|
||||
ToolKind::Hammer => "hammer head",
|
||||
ToolKind::Bow => "bow limbs",
|
||||
ToolKind::Dagger => "dagger blade",
|
||||
ToolKind::Staff => "fire staff core",
|
||||
ToolKind::Sceptre => "nature sceptre core",
|
||||
// TODO: naming
|
||||
ToolKind::Spear => "spear damage component",
|
||||
ToolKind::Blowgun => "blowgun damage component",
|
||||
ToolKind::Shield => "shield damage component",
|
||||
ToolKind::Debug => "debug damage component",
|
||||
ToolKind::Farming => "farming damage component",
|
||||
ToolKind::Pick => "pickaxe head",
|
||||
ToolKind::Natural => "natural damage component",
|
||||
ToolKind::Empty => "empty damage component",
|
||||
},
|
||||
ModularComponentKind::Held => match self.toolkind {
|
||||
ToolKind::Sword => "sword hilt",
|
||||
ToolKind::Axe => "axe shaft",
|
||||
ToolKind::Hammer => "hammer shaft",
|
||||
ToolKind::Bow => "bow grip",
|
||||
ToolKind::Dagger => "dagger hilt",
|
||||
ToolKind::Staff => "fire staff grip",
|
||||
ToolKind::Sceptre => "nature sceptre grip",
|
||||
// TODO: naming
|
||||
ToolKind::Spear => "spear held component",
|
||||
ToolKind::Blowgun => "blowgun held component",
|
||||
ToolKind::Shield => "shield held component",
|
||||
ToolKind::Natural => "natural held component",
|
||||
ToolKind::Debug => "debug held component",
|
||||
ToolKind::Farming => "farming held component",
|
||||
ToolKind::Pick => "pickaxe handle",
|
||||
ToolKind::Empty => "empty held component",
|
||||
},
|
||||
}
|
||||
))
|
||||
}
|
||||
|
||||
fn exemplar_identifier(&self) -> Cow<'static, str> {
|
||||
Cow::Owned(format!(
|
||||
"{}.{}.{}.{}",
|
||||
TAG_EXAMPLES_PREFIX,
|
||||
self.modkind.identifier_name(),
|
||||
self.toolkind.identifier_name(),
|
||||
self.hands.identifier_name()
|
||||
))
|
||||
}
|
||||
}
|
||||
|
||||
const SUPPORTED_TOOLKINDS: [ToolKind; 6] = [
|
||||
ToolKind::Sword,
|
||||
ToolKind::Axe,
|
||||
@ -118,13 +50,8 @@ const SUPPORTED_TOOLKINDS: [ToolKind; 6] = [
|
||||
ToolKind::Staff,
|
||||
ToolKind::Sceptre,
|
||||
];
|
||||
const MODKINDS: [ModularComponentKind; 2] =
|
||||
[ModularComponentKind::Damage, ModularComponentKind::Held];
|
||||
|
||||
const WEAPON_PREFIX: &str = "common.items.weapons.modular";
|
||||
const TAG_EXAMPLES_PREFIX: &str = "common.items.tag_examples.modular";
|
||||
|
||||
const HANDS: [Hands; 2] = [Hands::One, Hands::Two];
|
||||
|
||||
fn make_weapon_def(toolkind: ToolKind) -> (String, RawItemDef) {
|
||||
let identifier = format!("{}.{}", WEAPON_PREFIX, toolkind.identifier_name());
|
||||
@ -147,123 +74,24 @@ fn make_weapon_def(toolkind: ToolKind) -> (String, RawItemDef) {
|
||||
(identifier, item)
|
||||
}
|
||||
|
||||
fn make_recipe_def(identifier: String, toolkind: ToolKind, hands: Hands) -> RawRecipe {
|
||||
let output = (identifier, 1);
|
||||
let mut inputs = Vec::new();
|
||||
for &modkind in &MODKINDS {
|
||||
let input = RawRecipeInput::Tag(ItemTag::ModularComponent(ModularComponentTag {
|
||||
toolkind,
|
||||
modkind,
|
||||
hands,
|
||||
}));
|
||||
inputs.push((input, 1, true));
|
||||
}
|
||||
RawRecipe {
|
||||
output,
|
||||
inputs,
|
||||
craft_sprite: None,
|
||||
}
|
||||
}
|
||||
|
||||
fn make_tagexample_def(
|
||||
toolkind: ToolKind,
|
||||
modkind: ModularComponentKind,
|
||||
hands: Hands,
|
||||
) -> (String, RawItemDef) {
|
||||
let identifier = format!(
|
||||
"{}.{}.{}.{}",
|
||||
TAG_EXAMPLES_PREFIX,
|
||||
modkind.identifier_name(),
|
||||
toolkind.identifier_name(),
|
||||
hands.identifier_name(),
|
||||
);
|
||||
let tag = ModularComponentTag {
|
||||
toolkind,
|
||||
modkind,
|
||||
hands,
|
||||
};
|
||||
// TODO: i18n
|
||||
let name = ItemName::Direct(format!("Any {}", tag.name()));
|
||||
let kind = ItemKind::TagExamples {
|
||||
// TODO: Iterate over components
|
||||
item_ids: Vec::new(),
|
||||
};
|
||||
|
||||
let item = RawItemDef {
|
||||
name,
|
||||
description: "".to_string(),
|
||||
kind,
|
||||
quality: super::QualityKind::Modular,
|
||||
tags: vec![ItemTag::ModularComponent(tag)],
|
||||
slots: 0,
|
||||
ability_spec: None,
|
||||
};
|
||||
(identifier, item)
|
||||
}
|
||||
|
||||
// Checks that modular weapons should exist for a given toolkind and hands
|
||||
// combination
|
||||
fn exists(tool: ToolKind, hands: Hands) -> bool {
|
||||
match tool {
|
||||
// Has both 1 handed and 2 handed variants
|
||||
ToolKind::Sword | ToolKind::Axe | ToolKind::Hammer => true,
|
||||
// Has only 2 handed variants
|
||||
ToolKind::Bow | ToolKind::Staff | ToolKind::Sceptre => matches!(hands, Hands::Two),
|
||||
// Modular weapons do not yet exist
|
||||
ToolKind::Dagger
|
||||
| ToolKind::Spear
|
||||
| ToolKind::Blowgun
|
||||
| ToolKind::Shield
|
||||
| ToolKind::Natural
|
||||
| ToolKind::Debug
|
||||
| ToolKind::Farming
|
||||
| ToolKind::Pick
|
||||
| ToolKind::Empty => false,
|
||||
}
|
||||
}
|
||||
|
||||
fn initialize_modular_assets() -> (HashMap<String, RawItemDef>, RawRecipeBook) {
|
||||
fn initialize_modular_assets() -> HashMap<String, RawItemDef> {
|
||||
let mut itemdefs = HashMap::new();
|
||||
let mut recipes = HashMap::new();
|
||||
for &toolkind in &SUPPORTED_TOOLKINDS {
|
||||
let (identifier, item) = make_weapon_def(toolkind);
|
||||
itemdefs.insert(identifier.clone(), item);
|
||||
for &hands in &HANDS {
|
||||
if exists(toolkind, hands) {
|
||||
let recipe = make_recipe_def(identifier.clone(), toolkind, hands);
|
||||
recipes.insert(
|
||||
format!("{}.{}", identifier.clone(), hands.identifier_name()),
|
||||
recipe,
|
||||
);
|
||||
for &modkind in &MODKINDS {
|
||||
let (identifier, item) = make_tagexample_def(toolkind, modkind, hands);
|
||||
itemdefs.insert(identifier, item);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
(itemdefs, RawRecipeBook(recipes))
|
||||
itemdefs
|
||||
}
|
||||
|
||||
lazy_static! {
|
||||
static ref ITEM_DEFS_AND_RECIPES: (HashMap<String, RawItemDef>, RawRecipeBook) =
|
||||
initialize_modular_assets();
|
||||
}
|
||||
|
||||
pub(crate) fn append_modular_recipes(recipes: &mut RawRecipeBook) {
|
||||
for (name, recipe) in ITEM_DEFS_AND_RECIPES.1.0.iter() {
|
||||
// avoid clobbering recipes from the filesystem, to allow overrides
|
||||
if !recipes.0.contains_key(name) {
|
||||
recipes.0.insert(name.clone(), recipe.clone());
|
||||
}
|
||||
}
|
||||
static ref ITEM_DEFS: HashMap<String, RawItemDef> = initialize_modular_assets();
|
||||
}
|
||||
|
||||
/// Synthesize modular assets programmatically, to allow for the following:
|
||||
/// - Allow the modular tag_examples to auto-update with the list of applicable
|
||||
/// components
|
||||
pub(super) fn synthesize_modular_asset(specifier: &str) -> Option<RawItemDef> {
|
||||
let ret = ITEM_DEFS_AND_RECIPES.0.get(specifier).cloned();
|
||||
let ret = ITEM_DEFS.get(specifier).cloned();
|
||||
tracing::trace!("synthesize_modular_asset({:?}) -> {:?}", specifier, ret);
|
||||
ret
|
||||
}
|
||||
|
@ -342,14 +342,7 @@ impl assets::Compound for RecipeBook {
|
||||
Ok((def, *amount, *is_mod_comp))
|
||||
}
|
||||
|
||||
let mut raw = cache.load::<RawRecipeBook>(specifier)?.cloned();
|
||||
|
||||
// Avoid showing purple-question-box recipes until the assets are added
|
||||
// (the `if false` is needed because commenting out the call will add a warning
|
||||
// that there are no other uses of append_modular_recipes)
|
||||
// if false {
|
||||
modular::append_modular_recipes(&mut raw);
|
||||
// }
|
||||
let raw = cache.load::<RawRecipeBook>(specifier)?.cloned();
|
||||
|
||||
let recipes = raw
|
||||
.0
|
||||
|
Loading…
Reference in New Issue
Block a user