Changes to how critical hits function for melee attacks. Removed ability for explosions to crit. Velorite sceptre now functions as healing staff.

This commit is contained in:
Sam 2020-08-18 18:31:50 -05:00 committed by Monty Marz
parent 55d126861f
commit 9d2fe79a78
3 changed files with 7 additions and 7 deletions

View File

@ -14,5 +14,5 @@
"apple_shroom_curry": (("common.items.food.apple_mushroom_curry", 1), [("common.items.food.mushroom", 8), ("common.items.food.coconut", 1), ("common.items.food.apple", 4), ("common.items.crafting_tools.mortar_pestle", 0)]),
"apples_stick": (("common.items.food.apple_stick", 1),[("common.items.crafting_ing.twigs", 2), ("common.items.food.apple", 2)]),
"mushroom_stick": (("common.items.food.mushroom_stick", 1),[("common.items.crafting_ing.twigs", 2), ("common.items.food.mushroom", 3)]),
"velorte_sceptre": (("common.items.weapons.staff.sceptre_velorite_0", 1),[("common.items.crafting_ing.twigs", 20), ("common.items.ore.veloritefrag", 10), ("common.items.crafting_ing.shiny_gem", 4), ("common.items.crafting_tools.craftsman_hammer", 0)]),
"velorite_sceptre": (("common.items.weapons.staff.sceptre_velorite_0", 1),[("common.items.crafting_ing.twigs", 20), ("common.items.ore.veloritefrag", 10), ("common.items.crafting_ing.shiny_gem", 4), ("common.items.crafting_tools.craftsman_hammer", 0)]),
}

View File

@ -22,8 +22,9 @@ impl Damage {
match self.source {
DamageSource::Melee => {
// Critical hit
let mut critdamage = 0.0;
if rand::random() {
self.healthchange *= 1.2;
critdamage = self.healthchange * 0.3;
}
// Block
if block {
@ -33,6 +34,9 @@ impl Damage {
let damage_reduction = loadout.get_damage_reduction();
self.healthchange *= 1.0 - damage_reduction;
// Critical damage applies after armor for melee
self.healthchange += critdamage;
// Min damage
if (damage_reduction - 1.0).abs() > f32::EPSILON && self.healthchange > -10.0 {
self.healthchange = -10.0;
@ -57,10 +61,6 @@ impl Damage {
}
},
DamageSource::Explosion => {
// Critical hit
if rand::random() {
self.healthchange *= 1.2;
}
// Block
if block {
self.healthchange *= 1.0 - BLOCK_EFFICIENCY

View File

@ -78,7 +78,7 @@ impl State {
use common::comp::item::{tool::ToolKind, ItemKind};
if let ItemKind::Tool(kind) = kind {
if let ToolKind::Staff(kind) = &kind.kind {
kind != "Sceptre"
kind != "Sceptre" && kind != "SceptreVelorite"
} else if let ToolKind::Debug(kind) = &kind.kind {
kind == "Boost"
} else {