mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Weapon combat fixes:
- Modified energy and speed scaling of sword, axe, and hammer combo melees. - Nerfed bow basic attack knockback. Buffed bow damage and energy regen. - Corrected xp values for theropods. Removed unnecessary function for xp increase per level. - Guards no longer flee at low health. - Buffed sword spin. - Nerfed axe spin and sword dash moderately. - Dash now takes a little time to reach full speed. Sword M2 and hammer M1 damage values tweaked.
This commit is contained in:
parent
00175e866b
commit
6a6260daa1
@ -27,10 +27,10 @@ ComboMelee(
|
|||||||
forward_movement: 0.25,
|
forward_movement: 0.25,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
initial_energy_gain: 0,
|
initial_energy_gain: 25,
|
||||||
max_energy_gain: 100,
|
max_energy_gain: 175,
|
||||||
energy_increase: 20,
|
energy_increase: 30,
|
||||||
speed_increase: 0.05,
|
speed_increase: 0.075,
|
||||||
max_speed_increase: 1.6,
|
max_speed_increase: 1.6,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
)
|
)
|
@ -1,6 +1,6 @@
|
|||||||
SpinMelee(
|
SpinMelee(
|
||||||
buildup_duration: 100,
|
buildup_duration: 100,
|
||||||
swing_duration: 250,
|
swing_duration: 300,
|
||||||
recover_duration: 100,
|
recover_duration: 100,
|
||||||
base_damage: 60,
|
base_damage: 60,
|
||||||
knockback: 0.0,
|
knockback: 0.0,
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
BasicRanged(
|
BasicRanged(
|
||||||
energy_cost: 0,
|
energy_cost: 0,
|
||||||
buildup_duration: 200,
|
buildup_duration: 500,
|
||||||
recover_duration: 300,
|
recover_duration: 300,
|
||||||
projectile: Arrow(
|
projectile: Arrow(
|
||||||
damage: 40.0,
|
damage: 80.0,
|
||||||
knockback: 10.0,
|
knockback: 5.0,
|
||||||
energy_regen: 50,
|
energy_regen: 100,
|
||||||
),
|
),
|
||||||
projectile_body: Object(Arrow),
|
projectile_body: Object(Arrow),
|
||||||
projectile_light: None,
|
projectile_light: None,
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
ChargedRanged(
|
ChargedRanged(
|
||||||
energy_cost: 1,
|
energy_cost: 1,
|
||||||
energy_drain: 300,
|
energy_drain: 300,
|
||||||
initial_damage: 40,
|
initial_damage: 50,
|
||||||
max_damage: 200,
|
max_damage: 250,
|
||||||
initial_knockback: 10.0,
|
initial_knockback: 10.0,
|
||||||
max_knockback: 20.0,
|
max_knockback: 20.0,
|
||||||
speed: 1.0,
|
speed: 1.0,
|
||||||
|
@ -8,13 +8,13 @@ ComboMelee(
|
|||||||
range: 4.5,
|
range: 4.5,
|
||||||
angle: 50.0,
|
angle: 50.0,
|
||||||
base_buildup_duration: 600,
|
base_buildup_duration: 600,
|
||||||
base_swing_duration: 60,
|
base_swing_duration: 150,
|
||||||
base_recover_duration: 300,
|
base_recover_duration: 300,
|
||||||
forward_movement: 0.0,
|
forward_movement: 0.0,
|
||||||
)],
|
)],
|
||||||
initial_energy_gain: 0,
|
initial_energy_gain: 50,
|
||||||
max_energy_gain: 100,
|
max_energy_gain: 150,
|
||||||
energy_increase: 20,
|
energy_increase: 50,
|
||||||
speed_increase: 0.05,
|
speed_increase: 0.05,
|
||||||
max_speed_increase: 1.4,
|
max_speed_increase: 1.4,
|
||||||
is_interruptible: false,
|
is_interruptible: false,
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
DashMelee(
|
DashMelee(
|
||||||
energy_cost: 200,
|
energy_cost: 100,
|
||||||
base_damage: 120,
|
base_damage: 80,
|
||||||
max_damage: 240,
|
max_damage: 240,
|
||||||
base_knockback: 8.0,
|
base_knockback: 8.0,
|
||||||
max_knockback: 15.0,
|
max_knockback: 15.0,
|
||||||
range: 5.0,
|
range: 5.0,
|
||||||
angle: 45.0,
|
angle: 45.0,
|
||||||
energy_drain: 500,
|
energy_drain: 600,
|
||||||
forward_speed: 4.0,
|
forward_speed: 4.0,
|
||||||
buildup_duration: 250,
|
buildup_duration: 250,
|
||||||
charge_duration: 600,
|
charge_duration: 600,
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
SpinMelee(
|
SpinMelee(
|
||||||
buildup_duration: 750,
|
buildup_duration: 600,
|
||||||
swing_duration: 500,
|
swing_duration: 400,
|
||||||
recover_duration: 500,
|
recover_duration: 500,
|
||||||
base_damage: 140,
|
base_damage: 160,
|
||||||
knockback: 10.0,
|
knockback: 10.0,
|
||||||
range: 3.5,
|
range: 3.5,
|
||||||
energy_cost: 200,
|
energy_cost: 150,
|
||||||
is_infinite: false,
|
is_infinite: false,
|
||||||
is_helicopter: false,
|
is_helicopter: false,
|
||||||
is_interruptible: true,
|
is_interruptible: true,
|
||||||
|
@ -41,9 +41,9 @@ ComboMelee(
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
initial_energy_gain: 0,
|
initial_energy_gain: 0,
|
||||||
max_energy_gain: 100,
|
max_energy_gain: 200,
|
||||||
energy_increase: 20,
|
energy_increase: 25,
|
||||||
speed_increase: 0.05,
|
speed_increase: 0.1,
|
||||||
max_speed_increase: 1.8,
|
max_speed_increase: 1.8,
|
||||||
is_interruptible: true,
|
is_interruptible: true,
|
||||||
)
|
)
|
@ -154,11 +154,20 @@ impl Agent {
|
|||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn new(patrol_origin: Option<Vec3<f32>>, can_speak: bool, body: &Body) -> Self {
|
pub fn new(
|
||||||
|
patrol_origin: Option<Vec3<f32>>,
|
||||||
|
can_speak: bool,
|
||||||
|
body: &Body,
|
||||||
|
no_flee: bool,
|
||||||
|
) -> Self {
|
||||||
Agent {
|
Agent {
|
||||||
patrol_origin,
|
patrol_origin,
|
||||||
can_speak,
|
can_speak,
|
||||||
psyche: Psyche::from(body),
|
psyche: if no_flee {
|
||||||
|
Psyche { aggro: 1.0 }
|
||||||
|
} else {
|
||||||
|
Psyche::from(body)
|
||||||
|
},
|
||||||
..Default::default()
|
..Default::default()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -479,7 +479,11 @@ impl Body {
|
|||||||
},
|
},
|
||||||
Body::Object(_) => 1,
|
Body::Object(_) => 1,
|
||||||
Body::Golem(_) => 256,
|
Body::Golem(_) => 256,
|
||||||
Body::Theropod(_) => 2,
|
Body::Theropod(theropod) => match theropod.species {
|
||||||
|
theropod::Species::Archaeos => 90,
|
||||||
|
theropod::Species::Odonto => 80,
|
||||||
|
_ => 50,
|
||||||
|
},
|
||||||
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
Body::QuadrupedLow(quadruped_low) => match quadruped_low.species {
|
||||||
quadruped_low::Species::Crocodile => 10,
|
quadruped_low::Species::Crocodile => 10,
|
||||||
quadruped_low::Species::Alligator => 10,
|
quadruped_low::Species::Alligator => 10,
|
||||||
@ -498,25 +502,6 @@ impl Body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unreachable_patterns)]
|
|
||||||
pub fn base_exp_increase(&self) -> u32 {
|
|
||||||
match self {
|
|
||||||
Body::Humanoid(_) => 2,
|
|
||||||
Body::QuadrupedSmall(_) => 1,
|
|
||||||
Body::QuadrupedMedium(_) => 1,
|
|
||||||
Body::BirdMedium(_) => 1,
|
|
||||||
Body::FishMedium(_) => 1,
|
|
||||||
Body::Dragon(_) => 32,
|
|
||||||
Body::BirdSmall(_) => 1,
|
|
||||||
Body::FishSmall(_) => 1,
|
|
||||||
Body::BipedLarge(_) => 2,
|
|
||||||
Body::Object(_) => 0,
|
|
||||||
Body::Golem(_) => 12,
|
|
||||||
Body::Theropod(_) => 1,
|
|
||||||
Body::QuadrupedLow(_) => 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[allow(unreachable_patterns)]
|
#[allow(unreachable_patterns)]
|
||||||
pub fn base_dmg(&self) -> u32 {
|
pub fn base_dmg(&self) -> u32 {
|
||||||
match self {
|
match self {
|
||||||
|
@ -105,11 +105,15 @@ impl CharacterBehavior for Data {
|
|||||||
&& update.energy.current() > 0
|
&& update.energy.current() > 0
|
||||||
{
|
{
|
||||||
// Forward movement
|
// Forward movement
|
||||||
|
let charge_frac = (self.timer.as_secs_f32()
|
||||||
|
/ self.static_data.charge_duration.as_secs_f32())
|
||||||
|
.min(1.0);
|
||||||
|
|
||||||
handle_forced_movement(
|
handle_forced_movement(
|
||||||
data,
|
data,
|
||||||
&mut update,
|
&mut update,
|
||||||
ForcedMovement::Forward {
|
ForcedMovement::Forward {
|
||||||
strength: self.static_data.forward_speed,
|
strength: self.static_data.forward_speed * charge_frac.sqrt(),
|
||||||
},
|
},
|
||||||
0.1,
|
0.1,
|
||||||
);
|
);
|
||||||
@ -119,9 +123,6 @@ impl CharacterBehavior for Data {
|
|||||||
if !self.exhausted {
|
if !self.exhausted {
|
||||||
// Hit attempt (also checks if player is moving)
|
// Hit attempt (also checks if player is moving)
|
||||||
if update.vel.0.distance_squared(Vec3::zero()) > 1.0 {
|
if update.vel.0.distance_squared(Vec3::zero()) > 1.0 {
|
||||||
let charge_frac = (self.timer.as_secs_f32()
|
|
||||||
/ self.static_data.charge_duration.as_secs_f32())
|
|
||||||
.min(1.0);
|
|
||||||
let mut damage = Damage {
|
let mut damage = Damage {
|
||||||
source: DamageSource::Melee,
|
source: DamageSource::Melee,
|
||||||
value: self.static_data.max_damage as f32,
|
value: self.static_data.max_damage as f32,
|
||||||
|
@ -62,13 +62,8 @@ impl CharacterBehavior for Data {
|
|||||||
let mut update = StateUpdate::from(data);
|
let mut update = StateUpdate::from(data);
|
||||||
|
|
||||||
if self.static_data.is_helicopter {
|
if self.static_data.is_helicopter {
|
||||||
let delta_vel_z = if update.vel.0.z > 0.0 && update.vel.0.z <= 1.0 {
|
let new_vel_z = update.vel.0.z + GRAVITY * data.dt.0 * 0.5;
|
||||||
GRAVITY * data.dt.0
|
update.vel.0 = Vec3::new(0.0, 0.0, new_vel_z) + data.inputs.move_dir * 5.0;
|
||||||
} else {
|
|
||||||
0.0
|
|
||||||
};
|
|
||||||
update.vel.0 =
|
|
||||||
Vec3::new(0.0, 0.0, update.vel.0.z + delta_vel_z) + data.inputs.move_dir * 5.0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ability_key_is_pressed(data, self.static_data.ability_key) {
|
if !ability_key_is_pressed(data, self.static_data.ability_key) {
|
||||||
|
@ -260,9 +260,8 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
|
|||||||
const MAX_EXP_DIST: f32 = 150.0;
|
const MAX_EXP_DIST: f32 = 150.0;
|
||||||
// Attacker gets same as exp of everyone else
|
// Attacker gets same as exp of everyone else
|
||||||
const ATTACKER_EXP_WEIGHT: f32 = 1.0;
|
const ATTACKER_EXP_WEIGHT: f32 = 1.0;
|
||||||
let mut exp_reward = (entity_stats.body_type.base_exp()
|
let mut exp_reward = entity_stats.body_type.base_exp() as f32
|
||||||
+ entity_stats.level.level() * entity_stats.body_type.base_exp_increase())
|
* (1.0 + entity_stats.level.level() as f32 * 0.1);
|
||||||
as f32;
|
|
||||||
|
|
||||||
// Distribute EXP to group
|
// Distribute EXP to group
|
||||||
let positions = state.ecs().read_storage::<Pos>();
|
let positions = state.ecs().read_storage::<Pos>();
|
||||||
|
@ -103,7 +103,7 @@ impl<'a> System<'a> for Sys {
|
|||||||
health: comp::Health::new(body, 10),
|
health: comp::Health::new(body, 10),
|
||||||
loadout: entity.get_loadout(&ability_map),
|
loadout: entity.get_loadout(&ability_map),
|
||||||
body,
|
body,
|
||||||
agent: Some(comp::Agent::new(None, true, &body)),
|
agent: Some(comp::Agent::new(None, true, &body, false)),
|
||||||
alignment: comp::Alignment::Npc,
|
alignment: comp::Alignment::Npc,
|
||||||
scale: comp::Scale(1.0),
|
scale: comp::Scale(1.0),
|
||||||
drop_item: None,
|
drop_item: None,
|
||||||
|
@ -189,7 +189,12 @@ impl<'a> System<'a> for Sys {
|
|||||||
health,
|
health,
|
||||||
loadout,
|
loadout,
|
||||||
agent: if entity.has_agency {
|
agent: if entity.has_agency {
|
||||||
Some(comp::Agent::new(Some(entity.pos), can_speak, &body))
|
Some(comp::Agent::new(
|
||||||
|
Some(entity.pos),
|
||||||
|
can_speak,
|
||||||
|
&body,
|
||||||
|
matches!(config, Some(common::loadout_builder::LoadoutConfig::Guard)),
|
||||||
|
))
|
||||||
} else {
|
} else {
|
||||||
None
|
None
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user