mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
An underwater thing
This commit is contained in:
parent
465a62a072
commit
04687aa0b2
@ -143,6 +143,42 @@
|
|||||||
central: ("empty"),
|
central: ("empty"),
|
||||||
),
|
),
|
||||||
|
|
||||||
|
custom_indices: {
|
||||||
|
1: Air(ChairSingle, 4),
|
||||||
|
2: Air(Helm, 0),
|
||||||
|
3: Air(Door, 4),
|
||||||
|
4: Air(Door, 0),
|
||||||
|
9: Air(CraftingBench, 0),
|
||||||
|
10: Air(Window1, 0),
|
||||||
|
11: Air(RepairBench, 0),
|
||||||
|
12: Air(DismantlingBench, 4),
|
||||||
|
13: Air(Window1, 2),
|
||||||
|
14: Air(Crate, 0),
|
||||||
|
15: Air(Cauldron, 2),
|
||||||
|
16: Air(Tent, 0),
|
||||||
|
17: Air(CookingPot, 0),
|
||||||
|
18: Air(WallLampSmall, 4),
|
||||||
|
19: Air(Lantern, 4),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Submarine: (
|
||||||
|
bone0: (
|
||||||
|
offset: (-5.5, -18.0, -4.5),
|
||||||
|
central: ("submarine.structure"),
|
||||||
|
),
|
||||||
|
bone1: (
|
||||||
|
offset: (-3.5, -1.0, -3.5),
|
||||||
|
central: ("submarine.prop"),
|
||||||
|
),
|
||||||
|
bone2: (
|
||||||
|
offset: (0.0, 0.0, 0.0),
|
||||||
|
central: ("empty"),
|
||||||
|
),
|
||||||
|
bone3: (
|
||||||
|
offset: (-3.5, -3.0, -3.5),
|
||||||
|
central: ("submarine.rudder"),
|
||||||
|
),
|
||||||
|
|
||||||
custom_indices: {
|
custom_indices: {
|
||||||
1: Air(ChairSingle, 4),
|
1: Air(ChairSingle, 4),
|
||||||
2: Air(Helm, 0),
|
2: Air(Helm, 0),
|
||||||
|
BIN
assets/common/voxel/submarine/prop.vox
(Stored with Git LFS)
Normal file
BIN
assets/common/voxel/submarine/prop.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/common/voxel/submarine/rudder.vox
(Stored with Git LFS)
Normal file
BIN
assets/common/voxel/submarine/rudder.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/common/voxel/submarine/structure.vox
(Stored with Git LFS)
Normal file
BIN
assets/common/voxel/submarine/structure.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -1098,6 +1098,7 @@ impl Body {
|
|||||||
ship::Body::SailBoat => [-2.0, -5.0, 4.0],
|
ship::Body::SailBoat => [-2.0, -5.0, 4.0],
|
||||||
ship::Body::Galleon => [-2.0, -5.0, 4.0],
|
ship::Body::Galleon => [-2.0, -5.0, 4.0],
|
||||||
ship::Body::Skiff => [1.0, -2.0, 2.0],
|
ship::Body::Skiff => [1.0, -2.0, 2.0],
|
||||||
|
ship::Body::Submarine => [1.0, -2.0, 2.0],
|
||||||
ship::Body::Volume => [0.0, 0.0, 0.0],
|
ship::Body::Volume => [0.0, 0.0, 0.0],
|
||||||
},
|
},
|
||||||
_ => [0.0, 0.0, 0.0],
|
_ => [0.0, 0.0, 0.0],
|
||||||
|
@ -9,16 +9,17 @@ use serde::{Deserialize, Serialize};
|
|||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
use vek::*;
|
use vek::*;
|
||||||
|
|
||||||
pub const ALL_BODIES: [Body; 5] = [
|
pub const ALL_BODIES: [Body; 6] = [
|
||||||
Body::DefaultAirship,
|
Body::DefaultAirship,
|
||||||
Body::AirBalloon,
|
Body::AirBalloon,
|
||||||
Body::SailBoat,
|
Body::SailBoat,
|
||||||
Body::Galleon,
|
Body::Galleon,
|
||||||
Body::Skiff,
|
Body::Skiff,
|
||||||
|
Body::Submarine,
|
||||||
];
|
];
|
||||||
|
|
||||||
pub const ALL_AIRSHIPS: [Body; 2] = [Body::DefaultAirship, Body::AirBalloon];
|
pub const ALL_AIRSHIPS: [Body; 2] = [Body::DefaultAirship, Body::AirBalloon];
|
||||||
pub const ALL_SHIPS: [Body; 3] = [Body::SailBoat, Body::Galleon, Body::Skiff];
|
pub const ALL_SHIPS: [Body; 4] = [Body::SailBoat, Body::Galleon, Body::Skiff, Body::Submarine];
|
||||||
|
|
||||||
make_case_elim!(
|
make_case_elim!(
|
||||||
body,
|
body,
|
||||||
@ -31,6 +32,7 @@ make_case_elim!(
|
|||||||
Galleon = 3,
|
Galleon = 3,
|
||||||
Volume = 4,
|
Volume = 4,
|
||||||
Skiff = 5,
|
Skiff = 5,
|
||||||
|
Submarine = 6,
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -61,6 +63,7 @@ impl Body {
|
|||||||
Body::SailBoat => Some("sail_boat.structure"),
|
Body::SailBoat => Some("sail_boat.structure"),
|
||||||
Body::Galleon => Some("galleon.structure"),
|
Body::Galleon => Some("galleon.structure"),
|
||||||
Body::Skiff => Some("skiff.structure"),
|
Body::Skiff => Some("skiff.structure"),
|
||||||
|
Body::Submarine => Some("submarine.structure"),
|
||||||
Body::Volume => None,
|
Body::Volume => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -72,6 +75,7 @@ impl Body {
|
|||||||
Body::SailBoat => Vec3::new(12.0, 32.0, 6.0),
|
Body::SailBoat => Vec3::new(12.0, 32.0, 6.0),
|
||||||
Body::Galleon => Vec3::new(14.0, 48.0, 10.0),
|
Body::Galleon => Vec3::new(14.0, 48.0, 10.0),
|
||||||
Body::Skiff => Vec3::new(7.0, 15.0, 10.0),
|
Body::Skiff => Vec3::new(7.0, 15.0, 10.0),
|
||||||
|
Body::Submarine => Vec3::new(2.0, 15.0, 2.0),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -104,6 +108,7 @@ impl Body {
|
|||||||
pub fn density(&self) -> Density {
|
pub fn density(&self) -> Density {
|
||||||
match self {
|
match self {
|
||||||
Body::DefaultAirship | Body::AirBalloon | Body::Volume => Density(AIR_DENSITY),
|
Body::DefaultAirship | Body::AirBalloon | Body::Volume => Density(AIR_DENSITY),
|
||||||
|
Body::Submarine => Density(WATER_DENSITY), // Neutrally buoyant
|
||||||
_ => Density(AIR_DENSITY * 0.95 + WATER_DENSITY * 0.05), /* Most boats should be very
|
_ => Density(AIR_DENSITY * 0.95 + WATER_DENSITY * 0.05), /* Most boats should be very
|
||||||
* buoyant */
|
* buoyant */
|
||||||
}
|
}
|
||||||
|
@ -12,7 +12,7 @@ use crate::{
|
|||||||
tool::{self, AbilityContext},
|
tool::{self, AbilityContext},
|
||||||
Hands, ItemKind, ToolKind,
|
Hands, ItemKind, ToolKind,
|
||||||
},
|
},
|
||||||
quadruped_low, quadruped_medium, quadruped_small,
|
quadruped_low, quadruped_medium, quadruped_small, ship,
|
||||||
skills::{Skill, SwimSkill, SKILL_MODIFIERS},
|
skills::{Skill, SwimSkill, SKILL_MODIFIERS},
|
||||||
theropod, Body, CharacterAbility, CharacterState, Density, InputAttr, InputKind,
|
theropod, Body, CharacterAbility, CharacterState, Density, InputAttr, InputKind,
|
||||||
InventoryAction, Melee, StateUpdate,
|
InventoryAction, Melee, StateUpdate,
|
||||||
@ -236,6 +236,7 @@ impl Body {
|
|||||||
match self {
|
match self {
|
||||||
Body::Object(_) => return None,
|
Body::Object(_) => return None,
|
||||||
Body::ItemDrop(_) => return None,
|
Body::ItemDrop(_) => return None,
|
||||||
|
Body::Ship(ship::Body::Submarine) => 2000.0 * self.mass().0,
|
||||||
Body::Ship(ship) if ship.has_water_thrust() => 500.0 * self.mass().0,
|
Body::Ship(ship) if ship.has_water_thrust() => 500.0 * self.mass().0,
|
||||||
Body::Ship(_) => return None,
|
Body::Ship(_) => return None,
|
||||||
Body::BipedLarge(_) => 120.0 * self.mass().0,
|
Body::BipedLarge(_) => 120.0 * self.mass().0,
|
||||||
|
@ -314,6 +314,7 @@ impl Vehicle {
|
|||||||
comp::ship::Body::SailBoat => 5.0,
|
comp::ship::Body::SailBoat => 5.0,
|
||||||
comp::ship::Body::Galleon => 6.0,
|
comp::ship::Body::Galleon => 6.0,
|
||||||
comp::ship::Body::Skiff => 6.0,
|
comp::ship::Body::Skiff => 6.0,
|
||||||
|
comp::ship::Body::Submarine => 4.0,
|
||||||
_ => 10.0,
|
_ => 10.0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -96,6 +96,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
|||||||
SailBoat => (0.0, 0.0, 0.0),
|
SailBoat => (0.0, 0.0, 0.0),
|
||||||
Galleon => (0.0, 0.0, 0.0),
|
Galleon => (0.0, 0.0, 0.0),
|
||||||
Skiff => (0.0, 0.0, 0.0),
|
Skiff => (0.0, 0.0, 0.0),
|
||||||
|
Submarine => (0.0, 0.0, 0.0),
|
||||||
Volume => (0.0, 0.0, 0.0),
|
Volume => (0.0, 0.0, 0.0),
|
||||||
},
|
},
|
||||||
bone1: match body {
|
bone1: match body {
|
||||||
@ -104,6 +105,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
|||||||
SailBoat => (0.0, 0.0, 0.0),
|
SailBoat => (0.0, 0.0, 0.0),
|
||||||
Galleon => (0.0, 0.0, 0.0),
|
Galleon => (0.0, 0.0, 0.0),
|
||||||
Skiff => (0.0, 0.0, 0.0),
|
Skiff => (0.0, 0.0, 0.0),
|
||||||
|
Submarine => (0.0, -15.0, 0.0),
|
||||||
Volume => (0.0, 0.0, 0.0),
|
Volume => (0.0, 0.0, 0.0),
|
||||||
},
|
},
|
||||||
bone2: match body {
|
bone2: match body {
|
||||||
@ -112,6 +114,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
|||||||
SailBoat => (0.0, 0.0, 0.0),
|
SailBoat => (0.0, 0.0, 0.0),
|
||||||
Galleon => (0.0, 0.0, 0.0),
|
Galleon => (0.0, 0.0, 0.0),
|
||||||
Skiff => (0.0, 0.0, 0.0),
|
Skiff => (0.0, 0.0, 0.0),
|
||||||
|
Submarine => (0.0, 0.0, 0.0),
|
||||||
Volume => (0.0, 0.0, 0.0),
|
Volume => (0.0, 0.0, 0.0),
|
||||||
},
|
},
|
||||||
bone3: match body {
|
bone3: match body {
|
||||||
@ -120,6 +123,7 @@ impl<'a> From<&'a Body> for SkeletonAttr {
|
|||||||
SailBoat => (0.0, 0.0, 0.0),
|
SailBoat => (0.0, 0.0, 0.0),
|
||||||
Galleon => (0.0, 0.0, 0.0),
|
Galleon => (0.0, 0.0, 0.0),
|
||||||
Skiff => (0.0, 0.0, 0.0),
|
Skiff => (0.0, 0.0, 0.0),
|
||||||
|
Submarine => (0.0, -18.0, 0.0),
|
||||||
Volume => (0.0, 0.0, 0.0),
|
Volume => (0.0, 0.0, 0.0),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user