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:
commit
01264ce167
@ -2,11 +2,11 @@ Item(
|
||||
name: "Apple",
|
||||
description: "Red and juicy.
|
||||
|
||||
Restores 2 Health.",
|
||||
Restores 20 Health.",
|
||||
kind: Consumable(
|
||||
kind: Apple,
|
||||
effect: Health((
|
||||
amount: 2,
|
||||
amount: 20,
|
||||
cause: Item,
|
||||
)),
|
||||
),
|
||||
|
BIN
assets/voxygen/element/help.png
(Stored with Git LFS)
BIN
assets/voxygen/element/help.png
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-0.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-0.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-1.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-1.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-2.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt-2.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/projectile/fire-bolt.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/leaf.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/projectile/leaf.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/nature-bolt.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/projectile/nature-bolt.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/simple-arrow.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/projectile/simple-arrow.vox
(Stored with Git LFS)
Binary file not shown.
BIN
assets/voxygen/voxel/weapon/projectile/snake-arrow.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/weapon/projectile/snake-arrow.vox
(Stored with Git LFS)
Binary file not shown.
@ -55,6 +55,7 @@ pub enum Body {
|
||||
BoltFire = 49,
|
||||
ArrowSnake = 50,
|
||||
CampfireLit = 51,
|
||||
BoltFireBig = 52,
|
||||
}
|
||||
|
||||
impl Body {
|
||||
@ -64,7 +65,7 @@ impl Body {
|
||||
}
|
||||
}
|
||||
|
||||
const ALL_OBJECTS: [Body; 51] = [
|
||||
const ALL_OBJECTS: [Body; 52] = [
|
||||
Body::Arrow,
|
||||
Body::Bomb,
|
||||
Body::Scarecrow,
|
||||
@ -115,5 +116,6 @@ const ALL_OBJECTS: [Body; 51] = [
|
||||
Body::CarpetHumanSquircle,
|
||||
Body::CraftingBench,
|
||||
Body::BoltFire,
|
||||
Body::BoltFireBig,
|
||||
Body::ArrowSnake,
|
||||
];
|
||||
|
@ -118,6 +118,7 @@ impl ToolData {
|
||||
cause: HealthSource::Projectile { owner: None },
|
||||
}),
|
||||
projectile::Effect::Knockback(10.0),
|
||||
projectile::Effect::RewardEnergy(100),
|
||||
projectile::Effect::Vanish,
|
||||
],
|
||||
time_left: Duration::from_secs(15),
|
||||
@ -158,6 +159,7 @@ impl ToolData {
|
||||
amount: -1,
|
||||
cause: HealthSource::Projectile { owner: None },
|
||||
}),
|
||||
projectile::Effect::RewardEnergy(100),
|
||||
projectile::Effect::Vanish,
|
||||
],
|
||||
time_left: Duration::from_secs(20),
|
||||
@ -175,7 +177,7 @@ impl ToolData {
|
||||
energy_cost: 400,
|
||||
holdable: false,
|
||||
prepare_duration: Duration::from_millis(800),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
recover_duration: Duration::from_millis(50),
|
||||
projectile: Projectile {
|
||||
hit_ground: vec![
|
||||
projectile::Effect::Explode { power: 1.4 },
|
||||
@ -192,7 +194,7 @@ impl ToolData {
|
||||
time_left: Duration::from_secs(20),
|
||||
owner: None,
|
||||
},
|
||||
projectile_body: Body::Object(object::Body::BoltFire),
|
||||
projectile_body: Body::Object(object::Body::BoltFireBig),
|
||||
projectile_light: Some(LightEmitter {
|
||||
col: (0.72, 0.11, 0.11).into(),
|
||||
..Default::default()
|
||||
|
@ -7,6 +7,7 @@ use std::time::Duration;
|
||||
pub enum Effect {
|
||||
Damage(comp::HealthChange),
|
||||
Knockback(f32),
|
||||
RewardEnergy(u32),
|
||||
Explode { power: f32 },
|
||||
Vanish,
|
||||
Stick,
|
||||
|
@ -28,7 +28,7 @@ impl CharacterBehavior for Data {
|
||||
fn behavior(&self, data: &JoinData) -> StateUpdate {
|
||||
let mut update = StateUpdate::from(data);
|
||||
|
||||
handle_move(data, &mut update, 0.2);
|
||||
handle_move(data, &mut update, 0.3);
|
||||
handle_jump(data, &mut update);
|
||||
|
||||
if self.prepare_timer < self.prepare_duration
|
||||
|
@ -9,8 +9,8 @@ use vek::vec::Vec2;
|
||||
|
||||
pub const MOVEMENT_THRESHOLD_VEL: f32 = 3.0;
|
||||
const BASE_HUMANOID_ACCEL: f32 = 100.0;
|
||||
const BASE_HUMANOID_SPEED: f32 = 150.0;
|
||||
const NPC_HUMANOID_SPEED: f32 = 150.0;
|
||||
const BASE_HUMANOID_SPEED: f32 = 170.0;
|
||||
const NPC_HUMANOID_SPEED: f32 = 170.0;
|
||||
const BASE_HUMANOID_AIR_ACCEL: f32 = 15.0;
|
||||
const BASE_HUMANOID_AIR_SPEED: f32 = 8.0;
|
||||
const BASE_HUMANOID_WATER_ACCEL: f32 = 70.0;
|
||||
|
@ -1,5 +1,7 @@
|
||||
use crate::{
|
||||
comp::{projectile, HealthSource, Ori, PhysicsState, Pos, Projectile, Vel},
|
||||
comp::{
|
||||
projectile, Energy, EnergySource, HealthSource, Ori, PhysicsState, Pos, Projectile, Vel,
|
||||
},
|
||||
event::{EventBus, LocalEvent, ServerEvent},
|
||||
state::DeltaTime,
|
||||
sync::UidAllocator,
|
||||
@ -22,6 +24,7 @@ impl<'a> System<'a> for Sys {
|
||||
ReadStorage<'a, Vel>,
|
||||
WriteStorage<'a, Ori>,
|
||||
WriteStorage<'a, Projectile>,
|
||||
WriteStorage<'a, Energy>,
|
||||
);
|
||||
|
||||
fn run(
|
||||
@ -37,6 +40,7 @@ impl<'a> System<'a> for Sys {
|
||||
velocities,
|
||||
mut orientations,
|
||||
mut projectiles,
|
||||
mut energies,
|
||||
): Self::SystemData,
|
||||
) {
|
||||
let mut local_emitter = local_bus.emitter();
|
||||
@ -108,6 +112,15 @@ impl<'a> System<'a> for Sys {
|
||||
});
|
||||
}
|
||||
},
|
||||
projectile::Effect::RewardEnergy(energy) => {
|
||||
if let Some(energy_mut) = projectile
|
||||
.owner
|
||||
.and_then(|o| uid_allocator.retrieve_entity_internal(o.into()))
|
||||
.and_then(|o| energies.get_mut(o))
|
||||
{
|
||||
energy_mut.change_by(energy as i32, EnergySource::HitEnemy);
|
||||
}
|
||||
},
|
||||
projectile::Effect::Explode { power } => {
|
||||
server_emitter.emit(ServerEvent::Explosion {
|
||||
pos: pos.0,
|
||||
|
@ -194,7 +194,7 @@ pub fn handle_respawn(server: &Server, entity: EcsEntity) {
|
||||
|
||||
pub fn handle_explosion(server: &Server, pos: Vec3<f32>, power: f32, owner: Option<Uid>) {
|
||||
// Go through all other entities
|
||||
let hit_range = 2.0 * power;
|
||||
let hit_range = 3.0 * power;
|
||||
let ecs = &server.state.ecs();
|
||||
for (pos_b, ori_b, character_b, stats_b) in (
|
||||
&ecs.read_storage::<comp::Pos>(),
|
||||
|
@ -117,7 +117,7 @@ impl PlayState for CharSelectionState {
|
||||
global_state.window.renderer_mut(),
|
||||
self.client.borrow().get_tick(),
|
||||
humanoid_body.clone(),
|
||||
loadout,
|
||||
loadout.as_ref(),
|
||||
);
|
||||
|
||||
// Draw the UI to the screen.
|
||||
|
@ -333,9 +333,31 @@ impl CharSelectionUi {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn get_loadout(&mut self) -> Option<&comp::Loadout> {
|
||||
pub fn get_loadout(&mut self) -> Option<comp::Loadout> {
|
||||
match &mut self.mode {
|
||||
Mode::Select(_) => None,
|
||||
Mode::Select(characterdata) => {
|
||||
let loadout = comp::Loadout {
|
||||
active_item: characterdata
|
||||
.as_ref()
|
||||
.and_then(|d| d.tool.as_ref())
|
||||
.map(|tool| comp::ItemConfig {
|
||||
item: (*load_expect::<comp::Item>(&tool)).clone(),
|
||||
ability1: None,
|
||||
ability2: None,
|
||||
ability3: None,
|
||||
block_ability: None,
|
||||
dodge_ability: None,
|
||||
}),
|
||||
second_item: None,
|
||||
shoulder: None,
|
||||
chest: None,
|
||||
belt: None,
|
||||
hand: None,
|
||||
pants: None,
|
||||
foot: None,
|
||||
};
|
||||
Some(loadout)
|
||||
},
|
||||
Mode::Create { loadout, tool, .. } => {
|
||||
loadout.active_item = tool.map(|tool| comp::ItemConfig {
|
||||
item: (*load_expect::<comp::Item>(tool)).clone(),
|
||||
@ -345,7 +367,7 @@ impl CharSelectionUi {
|
||||
block_ability: None,
|
||||
dodge_ability: None,
|
||||
});
|
||||
Some(loadout)
|
||||
Some(loadout.clone())
|
||||
},
|
||||
}
|
||||
}
|
||||
|
@ -1869,7 +1869,8 @@ pub fn mesh_object(obj: object::Body) -> Mesh<FigurePipeline> {
|
||||
Body::Pouch => ("object.pouch", Vec3::new(-5.5, -4.5, 0.0)),
|
||||
Body::CraftingBench => ("object.crafting_bench", Vec3::new(-9.5, -7.0, 0.0)),
|
||||
Body::ArrowSnake => ("weapon.projectile.snake-arrow", Vec3::new(-1.5, -6.5, 0.0)),
|
||||
Body::BoltFire => ("weapon.projectile.fire-bolt", Vec3::new(-3.0, -5.5, -3.0)),
|
||||
Body::BoltFire => ("weapon.projectile.fire-bolt-0", Vec3::new(-3.0, -5.5, -3.0)),
|
||||
Body::BoltFireBig => ("weapon.projectile.fire-bolt-1", Vec3::new(-6.0, -6.0, -6.0)),
|
||||
};
|
||||
load_mesh(name, offset)
|
||||
}
|
||||
|
@ -365,7 +365,7 @@ impl Default for GameplaySettings {
|
||||
chat_transp: 0.4,
|
||||
crosshair_type: CrosshairType::Round,
|
||||
intro_show: Intro::Show,
|
||||
xp_bar: XpBar::OnGain,
|
||||
xp_bar: XpBar::Always,
|
||||
shortcut_numbers: ShortcutNumbers::On,
|
||||
bar_numbers: BarNumbers::Off,
|
||||
ui_scale: ScaleMode::RelativeToWindow([1920.0, 1080.0].into()),
|
||||
|
@ -628,7 +628,11 @@ pub fn block_from_structure(
|
||||
)
|
||||
.map(|e| e as u8),
|
||||
)),
|
||||
StructureBlock::Fruit => Some(Block::new(BlockKind::Apple, Rgb::new(194, 30, 37))),
|
||||
StructureBlock::Fruit => Some(if field.get(pos + structure_pos) % 3 > 0 {
|
||||
Block::empty()
|
||||
} else {
|
||||
Block::new(BlockKind::Apple, Rgb::new(194, 30, 37))
|
||||
}),
|
||||
StructureBlock::Chest => Some(if structure_seed % 10 < 7 {
|
||||
Block::empty()
|
||||
} else {
|
||||
|
@ -56,7 +56,7 @@ pub fn structure_gen<'a>(
|
||||
ForestKind::Palm => &PALMS,
|
||||
ForestKind::Savannah => &ACACIAS,
|
||||
ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 16 == 7 => &OAK_STUMPS,
|
||||
ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 8 == 7 => &FRUIT_TREES,
|
||||
ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 19 == 7 => &FRUIT_TREES,
|
||||
ForestKind::Oak if QUIRKY_RAND.get(st_seed) % 14 == 7 => &BIRCHES,
|
||||
ForestKind::Oak => &OAKS,
|
||||
ForestKind::Pine => &PINES,
|
||||
|
Loading…
Reference in New Issue
Block a user