mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'sam/small-fixes' into 'master'
Small fixes for sword See merge request veloren/veloren!3694
This commit is contained in:
commit
5709427e63
@ -8,7 +8,7 @@ ItemDef(
|
||||
equip_time_secs: 0.25,
|
||||
power: 1.2,
|
||||
effect_power: 1.5,
|
||||
speed: 0.8,
|
||||
speed: 0.9,
|
||||
crit_chance: 0.1,
|
||||
range: 1.0,
|
||||
energy_efficiency: 0.7,
|
||||
|
@ -8,7 +8,7 @@ ItemDef(
|
||||
equip_time_secs: 0.25,
|
||||
power: 0.8,
|
||||
effect_power: 0.8,
|
||||
speed: 1.25,
|
||||
speed: 1.125,
|
||||
crit_chance: 0.075,
|
||||
range: 1.0,
|
||||
energy_efficiency: 0.8,
|
||||
|
@ -8,7 +8,7 @@ ItemDef(
|
||||
equip_time_secs: 0.25,
|
||||
power: 0.9,
|
||||
effect_power: 0.8,
|
||||
speed: 1.1,
|
||||
speed: 1.05,
|
||||
crit_chance: 0.12,
|
||||
range: 1.0,
|
||||
energy_efficiency: 1.5,
|
||||
|
@ -8,7 +8,7 @@ ItemDef(
|
||||
equip_time_secs: 0.25,
|
||||
power: 1.4,
|
||||
effect_power: 0.8,
|
||||
speed: 0.9,
|
||||
speed: 0.95,
|
||||
crit_chance: 0.14,
|
||||
range: 1.0,
|
||||
energy_efficiency: 1.1,
|
||||
|
@ -8,7 +8,7 @@ ItemDef(
|
||||
equip_time_secs: 0.25,
|
||||
power: 1.2,
|
||||
effect_power: 0.8,
|
||||
speed: 0.9,
|
||||
speed: 0.95,
|
||||
crit_chance: 0.12,
|
||||
range: 1.3,
|
||||
energy_efficiency: 1.1,
|
||||
|
@ -8,7 +8,7 @@ ItemDef(
|
||||
equip_time_secs: 1.1,
|
||||
power: 1.1,
|
||||
effect_power: 1.1,
|
||||
speed: 0.9,
|
||||
speed: 0.95,
|
||||
crit_chance: 0.9,
|
||||
range: 1.1,
|
||||
energy_efficiency: 0.9,
|
||||
|
@ -8,7 +8,7 @@ ItemDef(
|
||||
equip_time_secs: 0.9,
|
||||
power: 0.9,
|
||||
effect_power: 0.9,
|
||||
speed: 1.1,
|
||||
speed: 1.05,
|
||||
crit_chance: 1.1,
|
||||
range: 0.9,
|
||||
energy_efficiency: 1.1,
|
||||
|
@ -139,43 +139,47 @@ impl Attack {
|
||||
mut emit: impl FnMut(ServerEvent),
|
||||
mut emit_outcome: impl FnMut(Outcome),
|
||||
) -> f32 {
|
||||
let damage_reduction =
|
||||
Damage::compute_damage_reduction(Some(damage), target.inventory, target.stats, msm);
|
||||
let block_reduction = match source {
|
||||
AttackSource::Melee => {
|
||||
if let (Some(char_state), Some(ori)) = (target.char_state, target.ori) {
|
||||
if ori.look_vec().angle_between(-*dir) < char_state.block_angle() {
|
||||
if char_state.is_parry() {
|
||||
emit_outcome(Outcome::Block {
|
||||
parry: true,
|
||||
pos: target.pos,
|
||||
uid: target.uid,
|
||||
});
|
||||
emit(ServerEvent::ParryHook {
|
||||
defender: target.entity,
|
||||
attacker: attacker.map(|a| a.entity),
|
||||
});
|
||||
1.0
|
||||
} else if let Some(block_strength) = char_state.block_strength() {
|
||||
emit_outcome(Outcome::Block {
|
||||
parry: false,
|
||||
pos: target.pos,
|
||||
uid: target.uid,
|
||||
});
|
||||
block_strength
|
||||
if damage.value > 0.0 {
|
||||
let damage_reduction =
|
||||
Damage::compute_damage_reduction(Some(damage), target.inventory, target.stats, msm);
|
||||
let block_reduction = match source {
|
||||
AttackSource::Melee => {
|
||||
if let (Some(char_state), Some(ori)) = (target.char_state, target.ori) {
|
||||
if ori.look_vec().angle_between(-*dir) < char_state.block_angle() {
|
||||
if char_state.is_parry() {
|
||||
emit_outcome(Outcome::Block {
|
||||
parry: true,
|
||||
pos: target.pos,
|
||||
uid: target.uid,
|
||||
});
|
||||
emit(ServerEvent::ParryHook {
|
||||
defender: target.entity,
|
||||
attacker: attacker.map(|a| a.entity),
|
||||
});
|
||||
1.0
|
||||
} else if let Some(block_strength) = char_state.block_strength() {
|
||||
emit_outcome(Outcome::Block {
|
||||
parry: false,
|
||||
pos: target.pos,
|
||||
uid: target.uid,
|
||||
});
|
||||
block_strength
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
},
|
||||
_ => 0.0,
|
||||
};
|
||||
1.0 - (1.0 - damage_reduction) * (1.0 - block_reduction)
|
||||
},
|
||||
_ => 0.0,
|
||||
};
|
||||
1.0 - (1.0 - damage_reduction) * (1.0 - block_reduction)
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
}
|
||||
|
||||
pub fn apply_attack(
|
||||
|
@ -872,7 +872,7 @@ impl CharacterAbility {
|
||||
buildup_duration: 0.05,
|
||||
movement_duration: 0.33,
|
||||
recover_duration: 0.125,
|
||||
roll_strength: 2.5,
|
||||
roll_strength: 3.0,
|
||||
attack_immunities: AttackImmunities {
|
||||
melee: true,
|
||||
projectiles: false,
|
||||
@ -1085,7 +1085,7 @@ impl CharacterAbility {
|
||||
ChargedMelee {
|
||||
ref mut energy_cost,
|
||||
ref mut energy_drain,
|
||||
charge_duration: _,
|
||||
ref mut charge_duration,
|
||||
ref mut swing_duration,
|
||||
hit_timing: _,
|
||||
ref mut recover_duration,
|
||||
@ -1094,9 +1094,10 @@ impl CharacterAbility {
|
||||
meta: _,
|
||||
} => {
|
||||
*swing_duration /= stats.speed;
|
||||
*charge_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*energy_cost /= stats.energy_efficiency;
|
||||
*energy_drain /= stats.energy_efficiency;
|
||||
*energy_drain *= stats.speed / stats.energy_efficiency;
|
||||
*melee_constructor = melee_constructor.adjusted_by_stats(stats);
|
||||
},
|
||||
ChargedRanged {
|
||||
@ -1109,7 +1110,7 @@ impl CharacterAbility {
|
||||
initial_knockback: _,
|
||||
scaled_knockback: _,
|
||||
ref mut buildup_duration,
|
||||
charge_duration: _,
|
||||
ref mut charge_duration,
|
||||
ref mut recover_duration,
|
||||
projectile_body: _,
|
||||
projectile_light: _,
|
||||
@ -1121,11 +1122,12 @@ impl CharacterAbility {
|
||||
*initial_damage *= stats.power;
|
||||
*scaled_damage *= stats.power;
|
||||
*buildup_duration /= stats.speed;
|
||||
*charge_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*initial_projectile_speed *= stats.range;
|
||||
*scaled_projectile_speed *= stats.range;
|
||||
*energy_cost /= stats.energy_efficiency;
|
||||
*energy_drain /= stats.energy_efficiency;
|
||||
*energy_drain *= stats.speed / stats.energy_efficiency;
|
||||
},
|
||||
Shockwave {
|
||||
ref mut energy_cost,
|
||||
|
@ -152,7 +152,9 @@ impl<'a> Ingameable for Overhead<'a> {
|
||||
// - 1 Rect::new for mana
|
||||
// If there are Buffs
|
||||
// - 1 Alignment Rectangle
|
||||
// - 10 + 10 Buffs and Timer Overlays (only if there is no speech bubble)
|
||||
// - 2 per buff (1 for buff and 1 for timer overlay) (only if there is no speech
|
||||
// bubble)
|
||||
// - 22 total with current max of 11 displayed buffs
|
||||
// If there's a speech bubble
|
||||
// - 2 Text::new for speech bubble
|
||||
// - 1 Image::new for icon
|
||||
@ -160,7 +162,9 @@ impl<'a> Ingameable for Overhead<'a> {
|
||||
self.info.map_or(0, |info| {
|
||||
2 + 1
|
||||
+ if self.bubble.is_none() {
|
||||
info.buffs.kinds.len().min(10) * 2
|
||||
2 * BuffIcon::icons_vec(info.buffs, info.char_state)
|
||||
.len()
|
||||
.min(11)
|
||||
} else {
|
||||
0
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user