mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Balancing feedback
This commit is contained in:
parent
6e2dff7136
commit
df0244c5e7
@ -4,7 +4,7 @@ SelfBuff(
|
||||
recover_duration: 0.1,
|
||||
buff_kind: Lifesteal,
|
||||
buff_strength: 0.3,
|
||||
buff_duration: Some(10.0),
|
||||
buff_duration: Some(12.0),
|
||||
energy_cost: 0,
|
||||
combo_cost: 10,
|
||||
combo_cost: 15,
|
||||
)
|
||||
|
@ -5,8 +5,8 @@ FinisherMelee(
|
||||
recover_duration: 0.4,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 50,
|
||||
poise: 125,
|
||||
damage: 40,
|
||||
poise: 100,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
),
|
||||
|
@ -4,7 +4,7 @@ RapidMelee(
|
||||
recover_duration: 0.1,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 8,
|
||||
damage: 7,
|
||||
poise: 5,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
@ -13,7 +13,7 @@ RapidMelee(
|
||||
angle: 10.0,
|
||||
simultaneous_hits: 2,
|
||||
),
|
||||
energy_cost: 5,
|
||||
energy_cost: 8,
|
||||
max_strikes: Some(5),
|
||||
move_modifier: 0.35,
|
||||
ori_modifier: 0.25,
|
||||
|
@ -4,7 +4,7 @@ RapidMelee(
|
||||
recover_duration: 0.1,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 8,
|
||||
damage: 7,
|
||||
poise: 5,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
@ -12,7 +12,7 @@ RapidMelee(
|
||||
range: 6.0,
|
||||
angle: 10.0,
|
||||
),
|
||||
energy_cost: 3,
|
||||
energy_cost: 4,
|
||||
max_strikes: Some(5),
|
||||
move_modifier: 0.35,
|
||||
ori_modifier: 0.25,
|
||||
|
@ -5,16 +5,16 @@ FinisherMelee(
|
||||
recover_duration: 0.3,
|
||||
melee_constructor: (
|
||||
kind: Hook(
|
||||
damage: 10,
|
||||
poise: 10,
|
||||
pull: 5,
|
||||
damage: 0,
|
||||
poise: 0,
|
||||
pull: 0,
|
||||
),
|
||||
scaled: Some(Hook(
|
||||
damage: 1,
|
||||
poise: 1,
|
||||
pull: 0.5,
|
||||
damage: 2,
|
||||
poise: 3,
|
||||
pull: 1,
|
||||
)),
|
||||
range: 3.0,
|
||||
range: 6.0,
|
||||
angle: 30.0,
|
||||
),
|
||||
minimum_combo: 1,
|
||||
|
@ -5,8 +5,8 @@ FinisherMelee(
|
||||
recover_duration: 0.2,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 75,
|
||||
poise: 25,
|
||||
damage: 60,
|
||||
poise: 20,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
),
|
||||
|
@ -3,7 +3,7 @@ ComboMelee2(
|
||||
(
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 20,
|
||||
damage: 16,
|
||||
poise: 10,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
@ -24,5 +24,5 @@ ComboMelee2(
|
||||
ori_modifier: 0.6,
|
||||
),
|
||||
],
|
||||
energy_cost_per_strike: 10,
|
||||
energy_cost_per_strike: 12,
|
||||
)
|
@ -5,7 +5,7 @@ FinisherMelee(
|
||||
recover_duration: 0.5,
|
||||
melee_constructor: (
|
||||
kind: Slash(
|
||||
damage: 60,
|
||||
damage: 50,
|
||||
poise: 5,
|
||||
knockback: 0,
|
||||
energy_regen: 0,
|
||||
|
@ -139,11 +139,11 @@ impl Attack {
|
||||
if damage.value > 0.0 {
|
||||
let attacker_penetration = attacker
|
||||
.and_then(|a| a.stats)
|
||||
.map_or(0.0, |s| s.mitigations_penetration)
|
||||
.map_or(0.0, |s| dbg!(s.mitigations_penetration))
|
||||
.clamp(0.0, 1.0);
|
||||
let raw_damage_reduction =
|
||||
Damage::compute_damage_reduction(Some(damage), target.inventory, target.stats, msm);
|
||||
let damage_reduction = (1.0 - attacker_penetration) * raw_damage_reduction;
|
||||
let damage_reduction = (1.0 - dbg!(attacker_penetration)) * dbg!(raw_damage_reduction);
|
||||
let block_reduction =
|
||||
if let (Some(char_state), Some(ori)) = (target.char_state, target.ori) {
|
||||
if ori.look_vec().angle_between(-*dir) < char_state.block_angle() {
|
||||
@ -175,7 +175,7 @@ impl Attack {
|
||||
} else {
|
||||
0.0
|
||||
};
|
||||
1.0 - (1.0 - damage_reduction) * (1.0 - block_reduction)
|
||||
1.0 - (1.0 - dbg!(damage_reduction)) * (1.0 - block_reduction)
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
|
@ -433,6 +433,16 @@ impl Ability {
|
||||
Ability::Empty => None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn is_from_tool(&self) -> bool {
|
||||
match self {
|
||||
Ability::ToolPrimary
|
||||
| Ability::ToolSecondary
|
||||
| Ability::MainWeaponAux(_)
|
||||
| Ability::OffWeaponAux(_) => true,
|
||||
Ability::SpeciesMovement | Ability::Empty => false,
|
||||
}
|
||||
}
|
||||
}
|
||||
#[derive(Copy, Clone, Serialize, Deserialize, Debug)]
|
||||
pub enum GuardAbility {
|
||||
@ -449,8 +459,6 @@ impl From<GuardAbility> for Ability {
|
||||
}
|
||||
}
|
||||
|
||||
// Only use for specifying to the front end what ability is being used, do not
|
||||
// actually use it for any logic in common or server
|
||||
#[derive(Copy, Clone, Serialize, Deserialize, Debug, PartialEq, Eq)]
|
||||
pub struct SpecifiedAbility {
|
||||
pub ability: Ability,
|
||||
|
@ -425,6 +425,7 @@ pub enum BuffCategory {
|
||||
PersistOnDeath,
|
||||
FromActiveAura(Uid, AuraKey),
|
||||
RemoveOnAttack,
|
||||
RemoveOnLoadoutChange,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
|
@ -1,6 +1,6 @@
|
||||
use crate::{
|
||||
comp::{
|
||||
buff::{Buff, BuffChange, BuffData, BuffKind, BuffSource},
|
||||
buff::{Buff, BuffCategory, BuffChange, BuffData, BuffKind, BuffSource},
|
||||
character_state::OutputEvents,
|
||||
CharacterState, StateUpdate,
|
||||
},
|
||||
@ -79,6 +79,16 @@ impl CharacterBehavior for Data {
|
||||
self.static_data.combo_cost as f32,
|
||||
)
|
||||
});
|
||||
let buff_cat_ids = if self
|
||||
.static_data
|
||||
.ability_info
|
||||
.ability
|
||||
.map_or(false, |a| a.ability.is_from_tool())
|
||||
{
|
||||
vec![BuffCategory::RemoveOnLoadoutChange]
|
||||
} else {
|
||||
Vec::new()
|
||||
};
|
||||
// Creates buff
|
||||
let buff = Buff::new(
|
||||
self.static_data.buff_kind,
|
||||
@ -86,7 +96,7 @@ impl CharacterBehavior for Data {
|
||||
self.static_data.buff_strength * scaling_factor,
|
||||
self.static_data.buff_duration,
|
||||
),
|
||||
Vec::new(),
|
||||
buff_cat_ids,
|
||||
BuffSource::Character { by: *data.uid },
|
||||
*data.time,
|
||||
Some(data.stats),
|
||||
|
@ -4,6 +4,7 @@ use crate::{
|
||||
comp::{
|
||||
ability::{AbilityInitEvent, AbilityMeta, Capability, SpecifiedAbility, Stance},
|
||||
arthropod, biped_large, biped_small, bird_medium,
|
||||
buff::{BuffCategory, BuffChange},
|
||||
character_state::OutputEvents,
|
||||
controller::InventoryManip,
|
||||
inventory::slot::{ArmorSlot, EquipSlot, Slot},
|
||||
@ -914,11 +915,7 @@ pub fn attempt_swap_equipped_weapons(
|
||||
.and_then(|inv| inv.equipped(EquipSlot::InactiveOffhand))
|
||||
.is_some()
|
||||
{
|
||||
// Reset combo to 0 after manipulating loadout
|
||||
output_events.emit_server(ServerEvent::ComboChange {
|
||||
entity: data.entity,
|
||||
change: -data.combo.map_or(0, |c| c.counter() as i32),
|
||||
});
|
||||
loadout_change_hook(data, output_events);
|
||||
update.swap_equipped_weapons = true;
|
||||
}
|
||||
}
|
||||
@ -1004,11 +1001,7 @@ pub fn handle_manipulate_loadout(
|
||||
update: &mut StateUpdate,
|
||||
inv_action: InventoryAction,
|
||||
) {
|
||||
// Reset combo to 0 after manipulating loadout
|
||||
output_events.emit_server(ServerEvent::ComboChange {
|
||||
entity: data.entity,
|
||||
change: -data.combo.map_or(0, |c| c.counter() as i32),
|
||||
});
|
||||
loadout_change_hook(data, output_events);
|
||||
match inv_action {
|
||||
InventoryAction::Use(slot @ Slot::Inventory(inv_slot)) => {
|
||||
// If inventory action is using a slot, and slot is in the inventory
|
||||
@ -1639,3 +1632,20 @@ impl ComboConsumption {
|
||||
impl Default for ComboConsumption {
|
||||
fn default() -> Self { Self::All }
|
||||
}
|
||||
|
||||
fn loadout_change_hook(data: &JoinData<'_>, output_events: &mut OutputEvents) {
|
||||
// Reset combo to 0
|
||||
output_events.emit_server(ServerEvent::ComboChange {
|
||||
entity: data.entity,
|
||||
change: -data.combo.map_or(0, |c| c.counter() as i32),
|
||||
});
|
||||
// Clear any buffs from equipped weapons
|
||||
output_events.emit_server(ServerEvent::Buff {
|
||||
entity: data.entity,
|
||||
buff_change: BuffChange::RemoveByCategory {
|
||||
all_required: vec![BuffCategory::RemoveOnLoadoutChange],
|
||||
any_required: vec![],
|
||||
none_required: vec![],
|
||||
},
|
||||
});
|
||||
}
|
||||
|
@ -694,7 +694,8 @@ fn execute_effect(
|
||||
stat.poise_damage_modifier *= p;
|
||||
},
|
||||
BuffEffect::MitigationsPenetration(mp) => {
|
||||
stat.mitigations_penetration *= mp;
|
||||
stat.mitigations_penetration =
|
||||
1.0 - ((1.0 - stat.mitigations_penetration) * (1.0 - *mp));
|
||||
},
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user