mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Merge branch 'combat' of https://gitlab.com/veloren/veloren into combat
This commit is contained in:
@ -55,7 +55,10 @@ impl CharacterState {
|
|||||||
match self {
|
match self {
|
||||||
CharacterState::Wielding
|
CharacterState::Wielding
|
||||||
| CharacterState::BasicMelee(_)
|
| CharacterState::BasicMelee(_)
|
||||||
|
| CharacterState::BasicRanged(_)
|
||||||
|
| CharacterState::DashMelee(_)
|
||||||
| CharacterState::TimedCombo(_)
|
| CharacterState::TimedCombo(_)
|
||||||
|
| CharacterState::ChargeAttack(_)
|
||||||
| CharacterState::BasicBlock => true,
|
| CharacterState::BasicBlock => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
@ -66,6 +69,7 @@ impl CharacterState {
|
|||||||
CharacterState::BasicMelee(_)
|
CharacterState::BasicMelee(_)
|
||||||
| CharacterState::BasicRanged(_)
|
| CharacterState::BasicRanged(_)
|
||||||
| CharacterState::TimedCombo(_)
|
| CharacterState::TimedCombo(_)
|
||||||
|
| CharacterState::DashMelee(_)
|
||||||
| CharacterState::ChargeAttack(_) => true,
|
| CharacterState::ChargeAttack(_) => true,
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
|
@ -35,6 +35,7 @@ impl CharacterBehavior for Data {
|
|||||||
|
|
||||||
if self.initialize {
|
if self.initialize {
|
||||||
update.vel.0 = data.inputs.look_dir * 20.0;
|
update.vel.0 = data.inputs.look_dir * 20.0;
|
||||||
|
update.ori.0 = update.vel.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.buildup_duration != Duration::default() && data.physics.touch_entity.is_none() {
|
if self.buildup_duration != Duration::default() && data.physics.touch_entity.is_none() {
|
||||||
|
@ -54,10 +54,7 @@ fn basic_move(data: &JoinData, update: &mut StateUpdate) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Set direction based on move direction
|
// Set direction based on move direction
|
||||||
let ori_dir = if update.character.is_wield()
|
let ori_dir = if update.character.is_attack() || update.character.is_block() {
|
||||||
|| update.character.is_attack()
|
|
||||||
|| update.character.is_block()
|
|
||||||
{
|
|
||||||
Vec2::from(data.inputs.look_dir).normalized()
|
Vec2::from(data.inputs.look_dir).normalized()
|
||||||
} else {
|
} else {
|
||||||
Vec2::from(data.inputs.move_dir)
|
Vec2::from(data.inputs.move_dir)
|
||||||
@ -84,10 +81,7 @@ fn swim_move(data: &JoinData, update: &mut StateUpdate) {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Set direction based on move direction when on the ground
|
// Set direction based on move direction when on the ground
|
||||||
let ori_dir = if update.character.is_wield()
|
let ori_dir = if update.character.is_attack() || update.character.is_block() {
|
||||||
|| update.character.is_attack()
|
|
||||||
|| update.character.is_block()
|
|
||||||
{
|
|
||||||
Vec2::from(data.inputs.look_dir).normalized()
|
Vec2::from(data.inputs.look_dir).normalized()
|
||||||
} else {
|
} else {
|
||||||
Vec2::from(update.vel.0)
|
Vec2::from(update.vel.0)
|
||||||
|
Reference in New Issue
Block a user