mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Removed energy refund on M2 attacks. Re-added custom heights on creatures. Tweaked movement on triple strike.
This commit is contained in:
parent
1c40218de9
commit
83a6e08c7a
@ -128,8 +128,30 @@ impl Body {
|
||||
}
|
||||
}
|
||||
|
||||
// Note: currently assumes sphericality
|
||||
pub fn height(&self) -> f32 { self.radius() * 2.0 }
|
||||
pub fn height(&self) -> f32 {
|
||||
match self {
|
||||
Body::Humanoid(humanoid) => match humanoid.species {
|
||||
humanoid::Species::Danari => 0.8,
|
||||
humanoid::Species::Dwarf => 0.9,
|
||||
humanoid::Species::Orc => 1.14,
|
||||
humanoid::Species::Undead => 0.95,
|
||||
_ => 1.0,
|
||||
},
|
||||
Body::QuadrupedSmall(_) => 0.6,
|
||||
Body::QuadrupedMedium(_) => 0.5,
|
||||
Body::Critter(_) => 0.4,
|
||||
Body::BirdMedium(_) => 1.2,
|
||||
Body::FishMedium(_) => 1.0,
|
||||
Body::Dragon(_) => 5.0,
|
||||
Body::BirdSmall(_) => 0.4,
|
||||
Body::FishSmall(_) => 0.4,
|
||||
Body::BipedLarge(_) => 4.0,
|
||||
Body::Golem(_) => 5.0,
|
||||
Body::QuadrupedLow(_) => 0.5,
|
||||
Body::Object(_) => 0.6,
|
||||
// _ => 0.5,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn base_health(&self) -> u32 {
|
||||
match self {
|
||||
|
@ -90,14 +90,6 @@ impl CharacterBehavior for Data {
|
||||
data.updater.remove::<Attacking>(data.entity);
|
||||
}
|
||||
|
||||
// Grant energy on successful hit
|
||||
if let Some(attack) = data.attacking {
|
||||
if attack.applied && attack.hit_count > 0 {
|
||||
data.updater.remove::<Attacking>(data.entity);
|
||||
update.energy.change_by(0, EnergySource::HitEnemy);
|
||||
}
|
||||
}
|
||||
|
||||
update
|
||||
}
|
||||
}
|
||||
|
@ -110,14 +110,6 @@ impl CharacterBehavior for Data {
|
||||
data.updater.remove::<Attacking>(data.entity);
|
||||
}
|
||||
|
||||
// Grant energy on successful hit
|
||||
if let Some(attack) = data.attacking {
|
||||
if attack.applied && attack.hit_count > 0 {
|
||||
data.updater.remove::<Attacking>(data.entity);
|
||||
update.energy.change_by(100, EnergySource::HitEnemy);
|
||||
}
|
||||
}
|
||||
|
||||
update
|
||||
}
|
||||
}
|
||||
|
@ -133,14 +133,6 @@ impl CharacterBehavior for Data {
|
||||
data.updater.remove::<Attacking>(data.entity);
|
||||
}
|
||||
|
||||
// Grant energy on successful hit
|
||||
if let Some(attack) = data.attacking {
|
||||
if attack.applied && attack.hit_count > 0 {
|
||||
data.updater.remove::<Attacking>(data.entity);
|
||||
update.energy.change_by(10, EnergySource::HitEnemy);
|
||||
}
|
||||
}
|
||||
|
||||
update
|
||||
}
|
||||
}
|
||||
|
@ -120,13 +120,14 @@ impl CharacterBehavior for Data {
|
||||
|
||||
// Move player forward while in first third of each stage
|
||||
if update.vel.0.magnitude_squared() < BASE_SPEED.powf(2.0) {
|
||||
update.vel.0 += data.dt.0
|
||||
* ( adjusted_accel * Vec3::from(data.ori.0.xy()));
|
||||
update.vel.0 += data.dt.0 * (adjusted_accel * Vec3::from(data.ori.0.xy()));
|
||||
let mag2 = update.vel.0.magnitude_squared();
|
||||
if mag2 > BASE_SPEED.powf(2.0) {
|
||||
update.vel.0 = update.vel.0.normalized() * BASE_SPEED;
|
||||
}
|
||||
};
|
||||
// update.vel.0 = Vec3::new(data.inputs.move_dir.x,
|
||||
// data.inputs.move_dir.y, 0.0) * 5.0;
|
||||
} else {
|
||||
handle_orientation(data, &mut update, 50.0);
|
||||
}
|
||||
@ -141,6 +142,8 @@ impl CharacterBehavior for Data {
|
||||
Stage::Third => (self.base_damage as f32 * 1.5) as u32,
|
||||
};
|
||||
|
||||
update.vel.0 = Vec3::new(data.inputs.move_dir.x, data.inputs.move_dir.y, 0.0) * 5.0;
|
||||
|
||||
// Try to deal damage in second half of stage
|
||||
data.updater.insert(data.entity, Attacking {
|
||||
base_healthchange: -(dmg as i32),
|
||||
@ -173,6 +176,8 @@ impl CharacterBehavior for Data {
|
||||
// Player messed up inputs, don't transition
|
||||
else { None };
|
||||
|
||||
update.vel.0 = Vec3::new(data.inputs.move_dir.x, data.inputs.move_dir.y, 0.0) * 5.0;
|
||||
|
||||
if let Some(stage) = next_stage {
|
||||
CharacterState::TripleStrike(Data {
|
||||
base_damage: self.base_damage,
|
||||
|
Loading…
Reference in New Issue
Block a user