mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
spit anim
This commit is contained in:
parent
269b1fcd00
commit
82df5f23c3
@ -2,7 +2,7 @@ BasicRanged(
|
||||
energy_cost: 0,
|
||||
buildup_duration: 0.8,
|
||||
recover_duration: 0.35,
|
||||
projectile: NecroticSphere(
|
||||
projectile: PoisonBall(
|
||||
damage: 26.0,
|
||||
radius: 5.0,
|
||||
energy_regen: 0,
|
||||
|
@ -271,8 +271,7 @@ fn default_main_tool(body: &Body) -> Item {
|
||||
| arthropod::Species::Antlion => Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.arthropodcharge",
|
||||
)),
|
||||
arthropod::Species::Cavespider
|
||||
=> Some(Item::new_from_asset_expect(
|
||||
arthropod::Species::Cavespider => Some(Item::new_from_asset_expect(
|
||||
"common.items.npc_weapons.unique.arthropodranged",
|
||||
)),
|
||||
_ => Some(Item::new_from_asset_expect(
|
||||
|
@ -61,6 +61,11 @@ pub enum ProjectileConstructor {
|
||||
radius: f32,
|
||||
min_falloff: f32,
|
||||
},
|
||||
PoisonBall {
|
||||
damage: f32,
|
||||
radius: f32,
|
||||
min_falloff: f32,
|
||||
},
|
||||
NecroticSphere {
|
||||
damage: f32,
|
||||
radius: f32,
|
||||
@ -223,6 +228,52 @@ impl ProjectileConstructor {
|
||||
is_point: true,
|
||||
}
|
||||
},
|
||||
PoisonBall {
|
||||
damage,
|
||||
radius,
|
||||
min_falloff,
|
||||
} => {
|
||||
let buff = AttackEffect::new(
|
||||
Some(GroupTarget::OutOfGroup),
|
||||
CombatEffect::Buff(CombatBuff {
|
||||
kind: BuffKind::Burning,
|
||||
dur_secs: 5.0,
|
||||
strength: CombatBuffStrength::DamageFraction(0.2 * buff_strength),
|
||||
chance: 1.0,
|
||||
}),
|
||||
)
|
||||
.with_requirement(CombatRequirement::AnyDamage);
|
||||
let damage = AttackDamage::new(
|
||||
Damage {
|
||||
source: DamageSource::Explosion,
|
||||
kind: DamageKind::Energy,
|
||||
value: damage,
|
||||
},
|
||||
Some(GroupTarget::OutOfGroup),
|
||||
);
|
||||
let attack = Attack::default()
|
||||
.with_damage(damage)
|
||||
.with_crit(crit_chance, crit_mult)
|
||||
.with_effect(buff);
|
||||
let explosion = Explosion {
|
||||
effects: vec![
|
||||
RadiusEffect::Attack(attack),
|
||||
RadiusEffect::TerrainDestruction(5.0),
|
||||
],
|
||||
radius,
|
||||
reagent: Some(Reagent::Purple),
|
||||
min_falloff,
|
||||
};
|
||||
Projectile {
|
||||
hit_solid: vec![Effect::Explode(explosion.clone()), Effect::Vanish],
|
||||
hit_entity: vec![Effect::Explode(explosion), Effect::Vanish],
|
||||
time_left: Duration::from_secs(10),
|
||||
owner,
|
||||
ignore_group: true,
|
||||
is_sticky: true,
|
||||
is_point: true,
|
||||
}
|
||||
},
|
||||
NecroticSphere {
|
||||
damage,
|
||||
radius,
|
||||
@ -432,6 +483,14 @@ impl ProjectileConstructor {
|
||||
*damage *= power;
|
||||
*radius *= range;
|
||||
},
|
||||
PoisonBall {
|
||||
ref mut damage,
|
||||
ref mut radius,
|
||||
..
|
||||
} => {
|
||||
*damage *= power;
|
||||
*radius *= range;
|
||||
},
|
||||
NecroticSphere {
|
||||
ref mut damage,
|
||||
ref mut radius,
|
||||
|
@ -11,8 +11,8 @@ pub mod summon;
|
||||
// Reexports
|
||||
pub use self::{
|
||||
alpha::AlphaAnimation, dash::DashAnimation, idle::IdleAnimation, jump::JumpAnimation,
|
||||
leapmelee::LeapMeleeAnimation, run::RunAnimation, shoot::ShootAnimation, stunned::StunnedAnimation,
|
||||
summon::SummonAnimation,
|
||||
leapmelee::LeapMeleeAnimation, run::RunAnimation, shoot::ShootAnimation,
|
||||
stunned::StunnedAnimation, summon::SummonAnimation,
|
||||
};
|
||||
|
||||
use super::{make_bone, vek::*, FigureBoneData, Offsets, Skeleton};
|
||||
|
@ -25,10 +25,10 @@ impl Animation for ShootAnimation {
|
||||
) -> Self::Skeleton {
|
||||
let mut next = (*skeleton).clone();
|
||||
|
||||
let (movement1, movement2) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time.powi(2), 0.0),
|
||||
Some(StageSection::Recover) => (1.0, anim_time),
|
||||
_ => (0.0, 0.0),
|
||||
let (movement1, movement2, twitch) = match stage_section {
|
||||
Some(StageSection::Buildup) => (anim_time.powf(0.25), 0.0, (anim_time * 30.0).sin()),
|
||||
Some(StageSection::Recover) => (1.0, anim_time, 1.0),
|
||||
_ => (0.0, 0.0, 0.0),
|
||||
};
|
||||
let pullback = 1.0 - movement2;
|
||||
let subtract = global_time - timer;
|
||||
@ -38,65 +38,50 @@ impl Animation for ShootAnimation {
|
||||
//let movement2 = mirror * movement2base * pullback;
|
||||
let movement1abs = movement1 * pullback;
|
||||
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
next.chest.orientation = Quaternion::rotation_x(0.0) * Quaternion::rotation_z(0.0);
|
||||
|
||||
next.chest.scale = Vec3::one() / s_a.scaler;
|
||||
next.chest.orientation = Quaternion::rotation_x(0.0)
|
||||
* Quaternion::rotation_z(0.0);
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation = Quaternion::rotation_x(movement1abs * 0.35 + twitch * -0.02)
|
||||
* Quaternion::rotation_y(0.0); //* Quaternion::rotation_z((movement1abs * 4.0 * PI).sin() * 0.02);
|
||||
|
||||
next.head.position = Vec3::new(0.0, s_a.head.0, s_a.head.1);
|
||||
next.head.orientation =
|
||||
Quaternion::rotation_x(
|
||||
movement1*0.35 ,
|
||||
) * Quaternion::rotation_y(
|
||||
0.0 ,
|
||||
) ;//* Quaternion::rotation_z((movement1abs * 4.0 * PI).sin() * 0.02);
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
|
||||
|
||||
next.chest.position = Vec3::new(0.0, s_a.chest.0, s_a.chest.1);
|
||||
next.mandible_l.position = Vec3::new(-s_a.mandible.0, s_a.mandible.1, s_a.mandible.2);
|
||||
next.mandible_r.position = Vec3::new(s_a.mandible.0, s_a.mandible.1, s_a.mandible.2);
|
||||
next.mandible_l.orientation = Quaternion::rotation_x(movement1abs * 0.5 + twitch * 0.2)
|
||||
* Quaternion::rotation_y(movement1abs * 0.5)
|
||||
* Quaternion::rotation_z(movement1abs * 0.5);
|
||||
next.mandible_r.orientation = Quaternion::rotation_x(movement1abs * 0.5 + twitch * 0.2)
|
||||
* Quaternion::rotation_y(movement1abs * -0.5)
|
||||
* Quaternion::rotation_z(movement1abs * -0.5);
|
||||
|
||||
next.mandible_l.position = Vec3::new(-s_a.mandible.0, s_a.mandible.1, s_a.mandible.2);
|
||||
next.mandible_r.position = Vec3::new(s_a.mandible.0, s_a.mandible.1, s_a.mandible.2);
|
||||
next.mandible_l.orientation = Quaternion::rotation_x(
|
||||
movement1abs * 0.5 ,
|
||||
) * Quaternion::rotation_y(
|
||||
movement1abs * 0.5 ,
|
||||
)* Quaternion::rotation_z(
|
||||
movement1abs * 0.5 ,
|
||||
);
|
||||
next.mandible_r.orientation = Quaternion::rotation_x(
|
||||
movement1abs * 0.5 ,
|
||||
) * Quaternion::rotation_y(
|
||||
movement1abs * -0.5 ,
|
||||
)* Quaternion::rotation_z(
|
||||
movement1abs * -0.5 ,
|
||||
);
|
||||
next.wing_fl.position = Vec3::new(-s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fr.position = Vec3::new(s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
|
||||
next.wing_fl.position = Vec3::new(-s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_fr.position = Vec3::new(s_a.wing_f.0, s_a.wing_f.1, s_a.wing_f.2);
|
||||
next.wing_bl.position = Vec3::new(-s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_br.position = Vec3::new(s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
|
||||
next.wing_bl.position = Vec3::new(-s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.wing_br.position = Vec3::new(s_a.wing_b.0, s_a.wing_b.1, s_a.wing_b.2);
|
||||
next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fl.orientation = Quaternion::rotation_z(s_a.leg_ori.0 + movement1abs * 0.4)
|
||||
* Quaternion::rotation_x(movement1abs * 1.0);
|
||||
next.leg_fr.orientation = Quaternion::rotation_z(-s_a.leg_ori.0 + movement1abs * -0.4)
|
||||
* Quaternion::rotation_x(movement1abs * 1.0);
|
||||
|
||||
next.leg_fl.position = Vec3::new(-s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fr.position = Vec3::new(s_a.leg_f.0, s_a.leg_f.1, s_a.leg_f.2);
|
||||
next.leg_fl.orientation = Quaternion::rotation_z(
|
||||
s_a.leg_ori.0 + movement1abs * 0.4 ,
|
||||
) * Quaternion::rotation_x(
|
||||
movement1abs * 1.0,
|
||||
);
|
||||
next.leg_fr.orientation = Quaternion::rotation_z(
|
||||
-s_a.leg_ori.0 + movement1abs * -0.4 ,
|
||||
) * Quaternion::rotation_x(
|
||||
movement1abs * 1.0,
|
||||
);
|
||||
next.leg_fcl.orientation = Quaternion::rotation_z(s_a.leg_ori.1 + movement1abs * 0.2)
|
||||
* Quaternion::rotation_y(movement1abs * 0.5);
|
||||
next.leg_fcr.orientation = Quaternion::rotation_z(-s_a.leg_ori.1 + movement1abs * -0.2)
|
||||
* Quaternion::rotation_y(movement1abs * -0.5);
|
||||
|
||||
next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
next.leg_fcr.position = Vec3::new(s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
next.leg_fcl.position = Vec3::new(-s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
next.leg_fcr.position = Vec3::new(s_a.leg_fc.0, s_a.leg_fc.1, s_a.leg_fc.2);
|
||||
|
||||
next.leg_bcl.position = Vec3::new(-s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
next.leg_bcr.position = Vec3::new(s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
next.leg_bcl.position = Vec3::new(-s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
next.leg_bcr.position = Vec3::new(s_a.leg_bc.0, s_a.leg_bc.1, s_a.leg_bc.2);
|
||||
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_bl.position = Vec3::new(-s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
next.leg_br.position = Vec3::new(s_a.leg_b.0, s_a.leg_b.1, s_a.leg_b.2);
|
||||
|
||||
next
|
||||
}
|
||||
|
@ -3448,6 +3448,7 @@ impl FigureMgr {
|
||||
&mut self.col_lights,
|
||||
body,
|
||||
inventory,
|
||||
(),
|
||||
tick,
|
||||
player_camera_mode,
|
||||
player_character_state,
|
||||
@ -5447,11 +5448,8 @@ impl FigureMgr {
|
||||
object_model_cache,
|
||||
ship_model_cache,
|
||||
golem_model_cache,
|
||||
<<<<<<< HEAD
|
||||
volume_model_cache,
|
||||
=======
|
||||
arthropod_model_cache,
|
||||
>>>>>>> 9b36d29d2 (Adds arthropod skeleton)
|
||||
states:
|
||||
FigureMgrStates {
|
||||
character_states,
|
||||
@ -5469,11 +5467,8 @@ impl FigureMgr {
|
||||
golem_states,
|
||||
object_states,
|
||||
ship_states,
|
||||
<<<<<<< HEAD
|
||||
volume_states,
|
||||
=======
|
||||
arthropod_states,
|
||||
>>>>>>> 9b36d29d2 (Adds arthropod skeleton)
|
||||
},
|
||||
} = self;
|
||||
let col_lights = &*col_lights_;
|
||||
|
Loading…
Reference in New Issue
Block a user