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:
Sam 2020-11-25 14:19:11 -06:00 committed by Marcel Märtens
parent 00175e866b
commit 6a6260daa1
15 changed files with 57 additions and 63 deletions

View File

@ -27,10 +27,10 @@ ComboMelee(
forward_movement: 0.25,
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
initial_energy_gain: 25,
max_energy_gain: 175,
energy_increase: 30,
speed_increase: 0.075,
max_speed_increase: 1.6,
is_interruptible: false,
)

View File

@ -1,6 +1,6 @@
SpinMelee(
buildup_duration: 100,
swing_duration: 250,
swing_duration: 300,
recover_duration: 100,
base_damage: 60,
knockback: 0.0,

View File

@ -1,11 +1,11 @@
BasicRanged(
energy_cost: 0,
buildup_duration: 200,
buildup_duration: 500,
recover_duration: 300,
projectile: Arrow(
damage: 40.0,
knockback: 10.0,
energy_regen: 50,
damage: 80.0,
knockback: 5.0,
energy_regen: 100,
),
projectile_body: Object(Arrow),
projectile_light: None,

View File

@ -1,8 +1,8 @@
ChargedRanged(
energy_cost: 1,
energy_drain: 300,
initial_damage: 40,
max_damage: 200,
initial_damage: 50,
max_damage: 250,
initial_knockback: 10.0,
max_knockback: 20.0,
speed: 1.0,

View File

@ -8,13 +8,13 @@ ComboMelee(
range: 4.5,
angle: 50.0,
base_buildup_duration: 600,
base_swing_duration: 60,
base_swing_duration: 150,
base_recover_duration: 300,
forward_movement: 0.0,
)],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
initial_energy_gain: 50,
max_energy_gain: 150,
energy_increase: 50,
speed_increase: 0.05,
max_speed_increase: 1.4,
is_interruptible: false,

View File

@ -1,12 +1,12 @@
DashMelee(
energy_cost: 200,
base_damage: 120,
energy_cost: 100,
base_damage: 80,
max_damage: 240,
base_knockback: 8.0,
max_knockback: 15.0,
range: 5.0,
angle: 45.0,
energy_drain: 500,
energy_drain: 600,
forward_speed: 4.0,
buildup_duration: 250,
charge_duration: 600,

View File

@ -1,11 +1,11 @@
SpinMelee(
buildup_duration: 750,
swing_duration: 500,
buildup_duration: 600,
swing_duration: 400,
recover_duration: 500,
base_damage: 140,
base_damage: 160,
knockback: 10.0,
range: 3.5,
energy_cost: 200,
energy_cost: 150,
is_infinite: false,
is_helicopter: false,
is_interruptible: true,

View File

@ -41,9 +41,9 @@ ComboMelee(
),
],
initial_energy_gain: 0,
max_energy_gain: 100,
energy_increase: 20,
speed_increase: 0.05,
max_energy_gain: 200,
energy_increase: 25,
speed_increase: 0.1,
max_speed_increase: 1.8,
is_interruptible: true,
)

View File

@ -154,11 +154,20 @@ impl Agent {
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 {
patrol_origin,
can_speak,
psyche: Psyche::from(body),
psyche: if no_flee {
Psyche { aggro: 1.0 }
} else {
Psyche::from(body)
},
..Default::default()
}
}

View File

@ -479,7 +479,11 @@ impl Body {
},
Body::Object(_) => 1,
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 {
quadruped_low::Species::Crocodile => 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)]
pub fn base_dmg(&self) -> u32 {
match self {

View File

@ -105,11 +105,15 @@ impl CharacterBehavior for Data {
&& update.energy.current() > 0
{
// Forward movement
let charge_frac = (self.timer.as_secs_f32()
/ self.static_data.charge_duration.as_secs_f32())
.min(1.0);
handle_forced_movement(
data,
&mut update,
ForcedMovement::Forward {
strength: self.static_data.forward_speed,
strength: self.static_data.forward_speed * charge_frac.sqrt(),
},
0.1,
);
@ -119,9 +123,6 @@ impl CharacterBehavior for Data {
if !self.exhausted {
// Hit attempt (also checks if player is moving)
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 {
source: DamageSource::Melee,
value: self.static_data.max_damage as f32,

View File

@ -62,13 +62,8 @@ impl CharacterBehavior for Data {
let mut update = StateUpdate::from(data);
if self.static_data.is_helicopter {
let delta_vel_z = if update.vel.0.z > 0.0 && update.vel.0.z <= 1.0 {
GRAVITY * data.dt.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;
let new_vel_z = update.vel.0.z + GRAVITY * data.dt.0 * 0.5;
update.vel.0 = Vec3::new(0.0, 0.0, new_vel_z) + data.inputs.move_dir * 5.0;
}
if !ability_key_is_pressed(data, self.static_data.ability_key) {

View File

@ -260,9 +260,8 @@ pub fn handle_destroy(server: &mut Server, entity: EcsEntity, cause: HealthSourc
const MAX_EXP_DIST: f32 = 150.0;
// Attacker gets same as exp of everyone else
const ATTACKER_EXP_WEIGHT: f32 = 1.0;
let mut exp_reward = (entity_stats.body_type.base_exp()
+ entity_stats.level.level() * entity_stats.body_type.base_exp_increase())
as f32;
let mut exp_reward = entity_stats.body_type.base_exp() as f32
* (1.0 + entity_stats.level.level() as f32 * 0.1);
// Distribute EXP to group
let positions = state.ecs().read_storage::<Pos>();

View File

@ -103,7 +103,7 @@ impl<'a> System<'a> for Sys {
health: comp::Health::new(body, 10),
loadout: entity.get_loadout(&ability_map),
body,
agent: Some(comp::Agent::new(None, true, &body)),
agent: Some(comp::Agent::new(None, true, &body, false)),
alignment: comp::Alignment::Npc,
scale: comp::Scale(1.0),
drop_item: None,

View File

@ -189,7 +189,12 @@ impl<'a> System<'a> for Sys {
health,
loadout,
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 {
None
},