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:
BIN
assets/voxygen/voxel/armor/belt/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/belt/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/belt/cloth_green_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/belt/cloth_green_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/belt/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/belt/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/chest/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/chest/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/chest/cloth_green_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/chest/cloth_green_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/chest/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/chest/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/foot/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/foot/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/foot/cloth_green_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/foot/cloth_green_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/foot/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/foot/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/hand/cloth_blue_0_left.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/hand/cloth_blue_0_left.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/hand/cloth_blue_0_right.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/hand/cloth_blue_0_right.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/hand/cloth_green_left_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/hand/cloth_green_left_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/hand/cloth_green_right_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/hand/cloth_green_right_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/hand/cloth_purple_0_left.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/hand/cloth_purple_0_left.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/hand/cloth_purple_0_right.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/hand/cloth_purple_0_right.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/pants/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/pants/cloth_blue_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/pants/cloth_green_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/pants/cloth_green_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/pants/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/pants/cloth_purple_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/cloth_blue_left_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/cloth_blue_left_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/cloth_blue_right_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/cloth_blue_right_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/cloth_green_left_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/cloth_green_left_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/cloth_green_right_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/cloth_green_right_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/cloth_purple_left_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/cloth_purple_left_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/armor/shoulder/cloth_purple_right_0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/armor/shoulder/cloth_purple_right_0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -125,6 +125,7 @@ pub struct ControllerInputs {
|
|||||||
pub wall_leap: Input,
|
pub wall_leap: Input,
|
||||||
pub respawn: Input,
|
pub respawn: Input,
|
||||||
pub toggle_wield: Input,
|
pub toggle_wield: Input,
|
||||||
|
pub swap_loadout: Input,
|
||||||
pub charge: Input,
|
pub charge: Input,
|
||||||
pub move_dir: Vec2<f32>,
|
pub move_dir: Vec2<f32>,
|
||||||
pub look_dir: Vec3<f32>,
|
pub look_dir: Vec3<f32>,
|
||||||
@ -151,6 +152,7 @@ impl ControllerInputs {
|
|||||||
self.wall_leap.tick(dt);
|
self.wall_leap.tick(dt);
|
||||||
self.respawn.tick(dt);
|
self.respawn.tick(dt);
|
||||||
self.toggle_wield.tick(dt);
|
self.toggle_wield.tick(dt);
|
||||||
|
self.swap_loadout.tick(dt);
|
||||||
self.charge.tick(dt);
|
self.charge.tick(dt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ fn swim_move(data: &JoinData, update: &mut StateUpdate) {
|
|||||||
if data.inputs.jump.is_pressed() && !data.inputs.jump.is_long_press(Duration::from_millis(600))
|
if data.inputs.jump.is_pressed() && !data.inputs.jump.is_long_press(Duration::from_millis(600))
|
||||||
{
|
{
|
||||||
update.vel.0.z =
|
update.vel.0.z =
|
||||||
(update.vel.0.z + data.dt.0 * GRAVITY * 1.25).min(BASE_HUMANOID_WATER_SPEED);
|
(update.vel.0.z + data.dt.0 * GRAVITY * 2.25).min(BASE_HUMANOID_WATER_SPEED);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ pub fn handle_climb(data: &JoinData, update: &mut StateUpdate) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Checks that player can `Glide` and updates `CharacterState` if so
|
/// Checks that player can Unwield and updates `CharacterState` if so
|
||||||
pub fn handle_unwield(data: &JoinData, update: &mut StateUpdate) {
|
pub fn handle_unwield(data: &JoinData, update: &mut StateUpdate) {
|
||||||
if let CharacterState::Wielding { .. } = update.character {
|
if let CharacterState::Wielding { .. } = update.character {
|
||||||
if data.inputs.toggle_wield.is_pressed() {
|
if data.inputs.toggle_wield.is_pressed() {
|
||||||
|
@ -160,6 +160,9 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings {
|
|||||||
map.entry(settings.game_buttons.toggle_wield)
|
map.entry(settings.game_buttons.toggle_wield)
|
||||||
.or_default()
|
.or_default()
|
||||||
.push(GameInput::ToggleWield);
|
.push(GameInput::ToggleWield);
|
||||||
|
map.entry(settings.game_buttons.swap_loadout)
|
||||||
|
.or_default()
|
||||||
|
.push(GameInput::SwapLoadout);
|
||||||
map.entry(settings.game_buttons.charge)
|
map.entry(settings.game_buttons.charge)
|
||||||
.or_default()
|
.or_default()
|
||||||
.push(GameInput::Charge);
|
.push(GameInput::Charge);
|
||||||
|
@ -319,6 +319,26 @@ impl PlayState for SessionState {
|
|||||||
Event::InputUpdate(GameInput::WallLeap, state) => {
|
Event::InputUpdate(GameInput::WallLeap, state) => {
|
||||||
self.inputs.wall_leap.set_state(state)
|
self.inputs.wall_leap.set_state(state)
|
||||||
},
|
},
|
||||||
|
Event::InputUpdate(GameInput::ToggleWield, state) => {
|
||||||
|
self.inputs.toggle_wield.set_state(state);
|
||||||
|
},
|
||||||
|
Event::InputUpdate(GameInput::SwapLoadout, state) => {
|
||||||
|
let mut client = self.client.borrow_mut();
|
||||||
|
let entity = client.entity();
|
||||||
|
let loadout = client
|
||||||
|
.state()
|
||||||
|
.read_storage::<comp::Loadout>()
|
||||||
|
.get(entity)
|
||||||
|
.cloned();
|
||||||
|
|
||||||
|
if let Some(loadout) = loadout {
|
||||||
|
let mut new_loadout = loadout.clone();
|
||||||
|
new_loadout.second_item = loadout.active_item;
|
||||||
|
new_loadout.active_item = loadout.second_item;
|
||||||
|
|
||||||
|
client.state_mut().write_component(entity, new_loadout);
|
||||||
|
}
|
||||||
|
},
|
||||||
Event::InputUpdate(GameInput::Mount, true) => {
|
Event::InputUpdate(GameInput::Mount, true) => {
|
||||||
let mut client = self.client.borrow_mut();
|
let mut client = self.client.borrow_mut();
|
||||||
if client.is_mounted() {
|
if client.is_mounted() {
|
||||||
@ -384,9 +404,6 @@ impl PlayState for SessionState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Event::InputUpdate(GameInput::ToggleWield, state) => {
|
|
||||||
self.inputs.toggle_wield.set_state(state)
|
|
||||||
},
|
|
||||||
Event::InputUpdate(GameInput::Charge, state) => {
|
Event::InputUpdate(GameInput::Charge, state) => {
|
||||||
self.inputs.charge.set_state(state);
|
self.inputs.charge.set_state(state);
|
||||||
},
|
},
|
||||||
|
@ -50,6 +50,7 @@ pub struct ControlSettings {
|
|||||||
pub respawn: KeyMouse,
|
pub respawn: KeyMouse,
|
||||||
pub interact: KeyMouse,
|
pub interact: KeyMouse,
|
||||||
pub toggle_wield: KeyMouse,
|
pub toggle_wield: KeyMouse,
|
||||||
|
pub swap_loadout: KeyMouse,
|
||||||
pub charge: KeyMouse,
|
pub charge: KeyMouse,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,6 +101,7 @@ impl Default for ControlSettings {
|
|||||||
respawn: KeyMouse::Key(VirtualKeyCode::Space),
|
respawn: KeyMouse::Key(VirtualKeyCode::Space),
|
||||||
interact: KeyMouse::Mouse(MouseButton::Right),
|
interact: KeyMouse::Mouse(MouseButton::Right),
|
||||||
toggle_wield: KeyMouse::Key(VirtualKeyCode::T),
|
toggle_wield: KeyMouse::Key(VirtualKeyCode::T),
|
||||||
|
swap_loadout: KeyMouse::Key(VirtualKeyCode::LAlt),
|
||||||
charge: KeyMouse::Key(VirtualKeyCode::Key1),
|
charge: KeyMouse::Key(VirtualKeyCode::Key1),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -183,6 +185,7 @@ pub mod con_settings {
|
|||||||
pub respawn: Button,
|
pub respawn: Button,
|
||||||
pub interact: Button,
|
pub interact: Button,
|
||||||
pub toggle_wield: Button,
|
pub toggle_wield: Button,
|
||||||
|
pub swap_loadout: Button,
|
||||||
pub charge: Button,
|
pub charge: Button,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,6 +271,7 @@ pub mod con_settings {
|
|||||||
respawn: Button::Simple(GilButton::RightTrigger2),
|
respawn: Button::Simple(GilButton::RightTrigger2),
|
||||||
interact: Button::Simple(GilButton::LeftTrigger2),
|
interact: Button::Simple(GilButton::LeftTrigger2),
|
||||||
toggle_wield: Button::Simple(GilButton::DPadLeft),
|
toggle_wield: Button::Simple(GilButton::DPadLeft),
|
||||||
|
swap_loadout: Button::Simple(GilButton::Unknown),
|
||||||
charge: Button::Simple(GilButton::Unknown),
|
charge: Button::Simple(GilButton::Unknown),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -49,6 +49,7 @@ pub enum GameInput {
|
|||||||
Interact,
|
Interact,
|
||||||
ToggleWield,
|
ToggleWield,
|
||||||
Charge,
|
Charge,
|
||||||
|
SwapLoadout,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Represents a key that the game menus recognise after input mapping
|
/// Represents a key that the game menus recognise after input mapping
|
||||||
@ -455,6 +456,9 @@ impl Window {
|
|||||||
map.entry(settings.controls.toggle_wield)
|
map.entry(settings.controls.toggle_wield)
|
||||||
.or_default()
|
.or_default()
|
||||||
.push(GameInput::ToggleWield);
|
.push(GameInput::ToggleWield);
|
||||||
|
map.entry(settings.controls.swap_loadout)
|
||||||
|
.or_default()
|
||||||
|
.push(GameInput::SwapLoadout);
|
||||||
map.entry(settings.controls.charge)
|
map.entry(settings.controls.charge)
|
||||||
.or_default()
|
.or_default()
|
||||||
.push(GameInput::Charge);
|
.push(GameInput::Charge);
|
||||||
|
Reference in New Issue
Block a user