Gem Rings and small change to trading.

This commit is contained in:
Scott Williams 2021-06-26 02:44:02 +00:00 committed by Justin Shipsey
parent b66957bf74
commit 8d0a1ad7b4
22 changed files with 254 additions and 24 deletions

View File

@ -14,7 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- NPCs and animals can now make sounds in response to certain events
- Players can press H to greet others
- Ability to toggle chat visibility
- Added gem rings with various stat improvements.
### Changed
- Entity-entity pushback is no longer applied in forced movement states like rolling and leaping.

View File

@ -0,0 +1,17 @@
ItemDef(
name: "Amethyst Ring",
description: "A tin ring with an amethyst gem.",
kind: Armor((
kind: Ring("Amethyst"),
stats: (
protection: Normal(0.0),
poise_resilience: Normal(0.0),
energy_max: 0,
energy_reward: 0.025,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Moderate,
tags: [],
)

View File

@ -0,0 +1,17 @@
ItemDef(
name: "Diamond Ring",
description: "A gold ring with an expensive diamond.",
kind: Armor((
kind: Ring("Diamond"),
stats: (
protection: Normal(0.0),
poise_resilience: Normal(0.0),
energy_max: 0,
energy_reward: -0.05,
crit_power: 0.1,
stealth: 0.0,
),
)),
quality: Epic,
tags: [],
)

View File

@ -0,0 +1,17 @@
ItemDef(
name: "Emerald Ring",
description: "A cobalt ring with an emerald gem.",
kind: Armor((
kind: Ring("Emerald"),
stats: (
protection: Normal(0.0),
poise_resilience: Normal(0.0),
energy_max: 100,
energy_reward: 0.0,
crit_power: -0.025,
stealth: 0.0,
),
)),
quality: Moderate,
tags: [],
)

View File

@ -1,6 +1,6 @@
ItemDef(
name: "Gold Ring",
description: "Someone is surely missing it...",
description: "A plain gold ring... almost as if it is missing a gem.",
kind: Armor((
kind: Ring("Gold"),
stats: (

View File

@ -0,0 +1,17 @@
ItemDef(
name: "Ruby Ring",
description: "A silver ring with a ruby gem.",
kind: Armor((
kind: Ring("Ruby"),
stats: (
protection: Normal(0.0),
poise_resilience: Normal(0.0),
energy_max: -100,
energy_reward: 0.05,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: High,
tags: [],
)

View File

@ -0,0 +1,17 @@
ItemDef(
name: "Sapphire Ring",
description: "An iron ring with a sapphire gem.",
kind: Armor((
kind: Ring("Sapphire"),
stats: (
protection: Normal(0.0),
poise_resilience: Normal(0.0),
energy_max: 0,
energy_reward: 0.0,
crit_power: 0.05,
stealth: 0.0,
),
)),
quality: Moderate,
tags: [],
)

View File

@ -0,0 +1,17 @@
ItemDef(
name: "Topaz Ring",
description: "A copper ring with a topaz gem.",
kind: Armor((
kind: Ring("Topaz"),
stats: (
protection: Normal(0.0),
poise_resilience: Normal(0.0),
energy_max: 50,
energy_reward: 0.00,
crit_power: 0.0,
stealth: 0.0,
),
)),
quality: Moderate,
tags: [],
)

View File

@ -2,4 +2,5 @@
(1.0, Item("common.items.food.apple")),
(1.0, Item("common.items.food.coconut")),
(1.5, Item("common.items.food.mushroom")),
(1.0, Item("common.items.crafting_ing.honey")),
]

View File

@ -2,11 +2,10 @@
// Please keep it sorting by rarity so it's easier to reason about things
[
// Ores
// Uncomment when bug with crafting doesn't propagating can_sell will be fixed
// (0.03, Item("common.items.mineral.ore.gold")),
// (0.045, Item("common.items.mineral.ore.silver")),
// (0.1, Item("common.items.mineral.ore.bloodstone")),
// (0.2, Item("common.items.mineral.ore.cobalt")),
(0.03, Item("common.items.mineral.ore.gold")),
(0.045, Item("common.items.mineral.ore.silver")),
(0.1, Item("common.items.mineral.ore.bloodstone")),
(0.2, Item("common.items.mineral.ore.cobalt")),
(0.25, Item("common.items.mineral.ore.coal")),
(0.3, Item("common.items.mineral.ore.iron")),
(0.5, Item("common.items.mineral.ore.velorite")),
@ -32,6 +31,4 @@
(1.0, Item("common.items.food.meat.beast_small_raw")),
(1.2, Item("common.items.food.meat.fish_raw")),
(1.3, Item("common.items.food.meat.bird_raw")),
// Others
(1.0, Item("common.items.crafting_ing.honey")),
]

View File

@ -1748,6 +1748,54 @@
],
craft_sprite: Some(Anvil),
),
"diamond ring": (
output: ("common.items.armor.misc.ring.diamond", 1),
inputs: [
(Item("common.items.mineral.ingot.gold"), 1),
(Item("common.items.mineral.gem.diamond"), 1),
],
craft_sprite: Some(CraftingBench),
),
"ruby ring": (
output: ("common.items.armor.misc.ring.ruby", 1),
inputs: [
(Item("common.items.mineral.ingot.silver"), 1),
(Item("common.items.mineral.gem.ruby"), 1),
],
craft_sprite: Some(CraftingBench),
),
"emerald ring": (
output: ("common.items.armor.misc.ring.emerald", 1),
inputs: [
(Item("common.items.mineral.ingot.cobalt"), 1),
(Item("common.items.mineral.gem.emerald"), 1),
],
craft_sprite: Some(CraftingBench),
),
"sapphire ring": (
output: ("common.items.armor.misc.ring.sapphire", 1),
inputs: [
(Item("common.items.mineral.ingot.iron"), 1),
(Item("common.items.mineral.gem.sapphire"), 1),
],
craft_sprite: Some(CraftingBench),
),
"topaz ring": (
output: ("common.items.armor.misc.ring.topaz", 1),
inputs: [
(Item("common.items.mineral.ingot.copper"), 1),
(Item("common.items.mineral.gem.topaz"), 1),
],
craft_sprite: Some(CraftingBench),
),
"amethyst ring": (
output: ("common.items.armor.misc.ring.amethyst", 1),
inputs: [
(Item("common.items.mineral.ingot.tin"), 1),
(Item("common.items.mineral.gem.amethyst"), 1),
],
craft_sprite: Some(CraftingBench),
),
//"metal_blade": (
// output: ("common.items.crafting_ing.modular.damage.sword.metal_blade", 1),
// inputs: [

View File

@ -12,12 +12,44 @@
("common.items.consumable.potion_big", 100),
("common.items.food.apple_mushroom_curry", 100),
],
"endgame": [
// Biju
("common.items.armor.misc.neck.plain_1",1),
("common.items.armor.misc.ring.skull",1),
("common.items.armor.misc.ring.skull",1),
"jewellery": [
// TODO: remove duplicates and handle quantity of non-stackable items
// Necklace
("common.items.armor.misc.neck.plain_1",1),
("common.items.armor.misc.neck.shell",1),
// Rings
// With effects
("common.items.armor.misc.ring.diamond",1),
("common.items.armor.misc.ring.diamond",1),
("common.items.armor.misc.ring.ruby",1),
("common.items.armor.misc.ring.ruby",1),
("common.items.armor.misc.ring.emerald",1),
("common.items.armor.misc.ring.emerald",1),
("common.items.armor.misc.ring.sapphire",1),
("common.items.armor.misc.ring.sapphire",1),
("common.items.armor.misc.ring.topaz",1),
("common.items.armor.misc.ring.topaz",1),
("common.items.armor.misc.ring.amethyst",1),
("common.items.armor.misc.ring.amethyst",1),
// Without effects
("common.items.armor.misc.ring.scratched",1),
("common.items.armor.misc.ring.scratched",1),
("common.items.armor.misc.ring.gold",1),
("common.items.armor.misc.ring.gold",1),
("common.items.armor.misc.ring.skull",1),
("common.items.armor.misc.ring.skull",1),
],
"endgame": [
// Cultist weapons
("common.items.weapons.hammer.cultist_purp_2h-0",1),
("common.items.weapons.staff.cultist_staff",1),

View File

@ -2194,17 +2194,40 @@
// Rings
Armor(Ring("Scratched")): VoxTrans(
"voxel.armor.misc.ring.scratched",
(0.0, 0.0, 0.0), (30.0, 0.0, 0.0), 0.9,
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
Armor(Ring("Gold")): VoxTrans(
"voxel.armor.misc.ring.gold",
(0.0, 0.0, 0.0), (30.0, 0.0, 0.0), 0.9,
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
Armor(Ring("Topaz")): VoxTrans(
"voxel.armor.misc.ring.topaz",
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
Armor(Ring("Amethyst")): VoxTrans(
"voxel.armor.misc.ring.amethyst",
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
Armor(Ring("Sapphire")): VoxTrans(
"voxel.armor.misc.ring.sapphire",
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
Armor(Ring("Emerald")): VoxTrans(
"voxel.armor.misc.ring.emerald",
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
Armor(Ring("Ruby")): VoxTrans(
"voxel.armor.misc.ring.ruby",
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
Armor(Ring("Diamond")): VoxTrans(
"voxel.armor.misc.ring.diamond",
(0.0, 0.0, 0.0), (45.0, 20.0, 0.0), 0.9,
),
Armor(Ring("Skull")): VoxTrans(
"voxel.armor.misc.ring.skull",
(0.0, 0.0, 0.0), (30.0, 0.0, 0.0), 0.9,
(0.0, 0.0, 0.0), (45.0, 15.0, 0.0), 0.9,
),
// Necks
Armor(Neck("Plain0")): Png(
"element.items.neck-0",

BIN
assets/voxygen/voxel/armor/misc/ring/amethyst.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/armor/misc/ring/diamond.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/armor/misc/ring/emerald.vox (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/voxel/armor/misc/ring/ruby.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/armor/misc/ring/sapphire.vox (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

BIN
assets/voxygen/voxel/armor/misc/ring/topaz.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -376,11 +376,18 @@ impl TradePricing {
false
} else if recipe.material_cost < Self::UNAVAILABLE_PRICE {
let actual_cost = result.calculate_material_cost(recipe, &eqset);
let output_tradeable = recipe.input.iter().all(|(input, _)| {
result
.get_list_by_path(&input)
.iter()
.find(|(item, _, _)| item == input)
.map_or(false, |(_, _, tradeable)| *tradeable)
});
result.get_list_by_path_mut(&recipe.output).add(
&eqset,
&recipe.output,
(recipe.amount as f32) / actual_cost * Self::CRAFTING_FACTOR,
true,
output_tradeable,
);
false
} else {
@ -424,7 +431,9 @@ impl TradePricing {
Some(Self::COIN_ITEM.into())
} else {
let table = self.get_list(good);
if table.is_empty() {
if table.is_empty()
|| (selling && table.iter().filter(|(_, _, can_sell)| *can_sell).count() == 0)
{
warn!("Good: {:?}, was unreachable.", good);
return None;
}