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,
|
equip_time_secs: 0.25,
|
||||||
power: 1.2,
|
power: 1.2,
|
||||||
effect_power: 1.5,
|
effect_power: 1.5,
|
||||||
speed: 0.8,
|
speed: 0.9,
|
||||||
crit_chance: 0.1,
|
crit_chance: 0.1,
|
||||||
range: 1.0,
|
range: 1.0,
|
||||||
energy_efficiency: 0.7,
|
energy_efficiency: 0.7,
|
||||||
|
@ -8,7 +8,7 @@ ItemDef(
|
|||||||
equip_time_secs: 0.25,
|
equip_time_secs: 0.25,
|
||||||
power: 0.8,
|
power: 0.8,
|
||||||
effect_power: 0.8,
|
effect_power: 0.8,
|
||||||
speed: 1.25,
|
speed: 1.125,
|
||||||
crit_chance: 0.075,
|
crit_chance: 0.075,
|
||||||
range: 1.0,
|
range: 1.0,
|
||||||
energy_efficiency: 0.8,
|
energy_efficiency: 0.8,
|
||||||
|
@ -8,7 +8,7 @@ ItemDef(
|
|||||||
equip_time_secs: 0.25,
|
equip_time_secs: 0.25,
|
||||||
power: 0.9,
|
power: 0.9,
|
||||||
effect_power: 0.8,
|
effect_power: 0.8,
|
||||||
speed: 1.1,
|
speed: 1.05,
|
||||||
crit_chance: 0.12,
|
crit_chance: 0.12,
|
||||||
range: 1.0,
|
range: 1.0,
|
||||||
energy_efficiency: 1.5,
|
energy_efficiency: 1.5,
|
||||||
|
@ -8,7 +8,7 @@ ItemDef(
|
|||||||
equip_time_secs: 0.25,
|
equip_time_secs: 0.25,
|
||||||
power: 1.4,
|
power: 1.4,
|
||||||
effect_power: 0.8,
|
effect_power: 0.8,
|
||||||
speed: 0.9,
|
speed: 0.95,
|
||||||
crit_chance: 0.14,
|
crit_chance: 0.14,
|
||||||
range: 1.0,
|
range: 1.0,
|
||||||
energy_efficiency: 1.1,
|
energy_efficiency: 1.1,
|
||||||
|
@ -8,7 +8,7 @@ ItemDef(
|
|||||||
equip_time_secs: 0.25,
|
equip_time_secs: 0.25,
|
||||||
power: 1.2,
|
power: 1.2,
|
||||||
effect_power: 0.8,
|
effect_power: 0.8,
|
||||||
speed: 0.9,
|
speed: 0.95,
|
||||||
crit_chance: 0.12,
|
crit_chance: 0.12,
|
||||||
range: 1.3,
|
range: 1.3,
|
||||||
energy_efficiency: 1.1,
|
energy_efficiency: 1.1,
|
||||||
|
@ -8,7 +8,7 @@ ItemDef(
|
|||||||
equip_time_secs: 1.1,
|
equip_time_secs: 1.1,
|
||||||
power: 1.1,
|
power: 1.1,
|
||||||
effect_power: 1.1,
|
effect_power: 1.1,
|
||||||
speed: 0.9,
|
speed: 0.95,
|
||||||
crit_chance: 0.9,
|
crit_chance: 0.9,
|
||||||
range: 1.1,
|
range: 1.1,
|
||||||
energy_efficiency: 0.9,
|
energy_efficiency: 0.9,
|
||||||
|
@ -8,7 +8,7 @@ ItemDef(
|
|||||||
equip_time_secs: 0.9,
|
equip_time_secs: 0.9,
|
||||||
power: 0.9,
|
power: 0.9,
|
||||||
effect_power: 0.9,
|
effect_power: 0.9,
|
||||||
speed: 1.1,
|
speed: 1.05,
|
||||||
crit_chance: 1.1,
|
crit_chance: 1.1,
|
||||||
range: 0.9,
|
range: 0.9,
|
||||||
energy_efficiency: 1.1,
|
energy_efficiency: 1.1,
|
||||||
|
@ -139,43 +139,47 @@ impl Attack {
|
|||||||
mut emit: impl FnMut(ServerEvent),
|
mut emit: impl FnMut(ServerEvent),
|
||||||
mut emit_outcome: impl FnMut(Outcome),
|
mut emit_outcome: impl FnMut(Outcome),
|
||||||
) -> f32 {
|
) -> f32 {
|
||||||
let damage_reduction =
|
if damage.value > 0.0 {
|
||||||
Damage::compute_damage_reduction(Some(damage), target.inventory, target.stats, msm);
|
let damage_reduction =
|
||||||
let block_reduction = match source {
|
Damage::compute_damage_reduction(Some(damage), target.inventory, target.stats, msm);
|
||||||
AttackSource::Melee => {
|
let block_reduction = match source {
|
||||||
if let (Some(char_state), Some(ori)) = (target.char_state, target.ori) {
|
AttackSource::Melee => {
|
||||||
if ori.look_vec().angle_between(-*dir) < char_state.block_angle() {
|
if let (Some(char_state), Some(ori)) = (target.char_state, target.ori) {
|
||||||
if char_state.is_parry() {
|
if ori.look_vec().angle_between(-*dir) < char_state.block_angle() {
|
||||||
emit_outcome(Outcome::Block {
|
if char_state.is_parry() {
|
||||||
parry: true,
|
emit_outcome(Outcome::Block {
|
||||||
pos: target.pos,
|
parry: true,
|
||||||
uid: target.uid,
|
pos: target.pos,
|
||||||
});
|
uid: target.uid,
|
||||||
emit(ServerEvent::ParryHook {
|
});
|
||||||
defender: target.entity,
|
emit(ServerEvent::ParryHook {
|
||||||
attacker: attacker.map(|a| a.entity),
|
defender: target.entity,
|
||||||
});
|
attacker: attacker.map(|a| a.entity),
|
||||||
1.0
|
});
|
||||||
} else if let Some(block_strength) = char_state.block_strength() {
|
1.0
|
||||||
emit_outcome(Outcome::Block {
|
} else if let Some(block_strength) = char_state.block_strength() {
|
||||||
parry: false,
|
emit_outcome(Outcome::Block {
|
||||||
pos: target.pos,
|
parry: false,
|
||||||
uid: target.uid,
|
pos: target.pos,
|
||||||
});
|
uid: target.uid,
|
||||||
block_strength
|
});
|
||||||
|
block_strength
|
||||||
|
} else {
|
||||||
|
0.0
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
0.0
|
0.0
|
||||||
}
|
}
|
||||||
} else {
|
},
|
||||||
0.0
|
_ => 0.0,
|
||||||
}
|
};
|
||||||
},
|
1.0 - (1.0 - damage_reduction) * (1.0 - block_reduction)
|
||||||
_ => 0.0,
|
} else {
|
||||||
};
|
0.0
|
||||||
1.0 - (1.0 - damage_reduction) * (1.0 - block_reduction)
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn apply_attack(
|
pub fn apply_attack(
|
||||||
|
@ -872,7 +872,7 @@ impl CharacterAbility {
|
|||||||
buildup_duration: 0.05,
|
buildup_duration: 0.05,
|
||||||
movement_duration: 0.33,
|
movement_duration: 0.33,
|
||||||
recover_duration: 0.125,
|
recover_duration: 0.125,
|
||||||
roll_strength: 2.5,
|
roll_strength: 3.0,
|
||||||
attack_immunities: AttackImmunities {
|
attack_immunities: AttackImmunities {
|
||||||
melee: true,
|
melee: true,
|
||||||
projectiles: false,
|
projectiles: false,
|
||||||
@ -1085,7 +1085,7 @@ impl CharacterAbility {
|
|||||||
ChargedMelee {
|
ChargedMelee {
|
||||||
ref mut energy_cost,
|
ref mut energy_cost,
|
||||||
ref mut energy_drain,
|
ref mut energy_drain,
|
||||||
charge_duration: _,
|
ref mut charge_duration,
|
||||||
ref mut swing_duration,
|
ref mut swing_duration,
|
||||||
hit_timing: _,
|
hit_timing: _,
|
||||||
ref mut recover_duration,
|
ref mut recover_duration,
|
||||||
@ -1094,9 +1094,10 @@ impl CharacterAbility {
|
|||||||
meta: _,
|
meta: _,
|
||||||
} => {
|
} => {
|
||||||
*swing_duration /= stats.speed;
|
*swing_duration /= stats.speed;
|
||||||
|
*charge_duration /= stats.speed;
|
||||||
*recover_duration /= stats.speed;
|
*recover_duration /= stats.speed;
|
||||||
*energy_cost /= stats.energy_efficiency;
|
*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);
|
*melee_constructor = melee_constructor.adjusted_by_stats(stats);
|
||||||
},
|
},
|
||||||
ChargedRanged {
|
ChargedRanged {
|
||||||
@ -1109,7 +1110,7 @@ impl CharacterAbility {
|
|||||||
initial_knockback: _,
|
initial_knockback: _,
|
||||||
scaled_knockback: _,
|
scaled_knockback: _,
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
charge_duration: _,
|
ref mut charge_duration,
|
||||||
ref mut recover_duration,
|
ref mut recover_duration,
|
||||||
projectile_body: _,
|
projectile_body: _,
|
||||||
projectile_light: _,
|
projectile_light: _,
|
||||||
@ -1121,11 +1122,12 @@ impl CharacterAbility {
|
|||||||
*initial_damage *= stats.power;
|
*initial_damage *= stats.power;
|
||||||
*scaled_damage *= stats.power;
|
*scaled_damage *= stats.power;
|
||||||
*buildup_duration /= stats.speed;
|
*buildup_duration /= stats.speed;
|
||||||
|
*charge_duration /= stats.speed;
|
||||||
*recover_duration /= stats.speed;
|
*recover_duration /= stats.speed;
|
||||||
*initial_projectile_speed *= stats.range;
|
*initial_projectile_speed *= stats.range;
|
||||||
*scaled_projectile_speed *= stats.range;
|
*scaled_projectile_speed *= stats.range;
|
||||||
*energy_cost /= stats.energy_efficiency;
|
*energy_cost /= stats.energy_efficiency;
|
||||||
*energy_drain /= stats.energy_efficiency;
|
*energy_drain *= stats.speed / stats.energy_efficiency;
|
||||||
},
|
},
|
||||||
Shockwave {
|
Shockwave {
|
||||||
ref mut energy_cost,
|
ref mut energy_cost,
|
||||||
|
@ -152,7 +152,9 @@ impl<'a> Ingameable for Overhead<'a> {
|
|||||||
// - 1 Rect::new for mana
|
// - 1 Rect::new for mana
|
||||||
// If there are Buffs
|
// If there are Buffs
|
||||||
// - 1 Alignment Rectangle
|
// - 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
|
// If there's a speech bubble
|
||||||
// - 2 Text::new for speech bubble
|
// - 2 Text::new for speech bubble
|
||||||
// - 1 Image::new for icon
|
// - 1 Image::new for icon
|
||||||
@ -160,7 +162,9 @@ impl<'a> Ingameable for Overhead<'a> {
|
|||||||
self.info.map_or(0, |info| {
|
self.info.map_or(0, |info| {
|
||||||
2 + 1
|
2 + 1
|
||||||
+ if self.bubble.is_none() {
|
+ 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 {
|
} else {
|
||||||
0
|
0
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user