mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Separated knockback out from basicmelee. Added weapon for cyclops boss to use, and added 1 ability to it.
This commit is contained in:
parent
43398afa0c
commit
66b0fee3c7
13
assets/common/items/npc_weapons/npcweapon/cyclops_hammer.ron
Normal file
13
assets/common/items/npc_weapons/npcweapon/cyclops_hammer.ron
Normal file
@ -0,0 +1,13 @@
|
||||
Item(
|
||||
name: "Cyclops Hammer",
|
||||
description: "Wielded by a mighty cyclops.",
|
||||
kind: Tool(
|
||||
(
|
||||
kind: NpcWeapon("CyclopsHammer"),
|
||||
stats: (
|
||||
equip_time_millis: 500,
|
||||
power: 1.00,
|
||||
),
|
||||
)
|
||||
),
|
||||
)
|
@ -519,6 +519,11 @@
|
||||
"voxel.weapon.shield.wood-0",
|
||||
(0.0, 0.0, 0.0), (-90.0, 90.0, 0.0), 2.4,
|
||||
),
|
||||
// Npc weapons (for test purposes, remove when done)
|
||||
Tool(NpcWeapon("CyclopsHammer")): VoxTrans(
|
||||
"voxel.weapon.npcweapon.cyclops_hammer",
|
||||
(2.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.1,
|
||||
),
|
||||
// Lanterns
|
||||
Lantern("Black0"): Png(
|
||||
"element.icons.lantern_black-0",
|
||||
|
@ -1,4 +1,9 @@
|
||||
({ //Swords
|
||||
({ // Npc weapons (for test purposes, remove when done)
|
||||
NpcWeapon("CyclopsHammer"): (
|
||||
vox_spec: ("weapon.npcweapon.cyclops_hammer", (-2.5, -7.5, -5.0)),
|
||||
color: None
|
||||
),
|
||||
//Swords
|
||||
Sword("BasicSword"): (
|
||||
vox_spec: ("weapon.sword.rusty_2h", (-1.5, -6.5, -4.0)),
|
||||
color: None
|
||||
|
BIN
assets/voxygen/voxel/weapon/npcweapon/cyclops_hammer.vox
(Stored with Git LFS)
Normal file
BIN
assets/voxygen/voxel/weapon/npcweapon/cyclops_hammer.vox
(Stored with Git LFS)
Normal file
Binary file not shown.
@ -50,6 +50,7 @@ pub enum CharacterAbility {
|
||||
buildup_duration: Duration,
|
||||
recover_duration: Duration,
|
||||
base_healthchange: i32,
|
||||
knockback: f32,
|
||||
range: f32,
|
||||
max_angle: f32,
|
||||
},
|
||||
@ -250,6 +251,7 @@ impl From<&CharacterAbility> for CharacterState {
|
||||
buildup_duration,
|
||||
recover_duration,
|
||||
base_healthchange,
|
||||
knockback,
|
||||
range,
|
||||
max_angle,
|
||||
energy_cost: _,
|
||||
@ -258,6 +260,7 @@ impl From<&CharacterAbility> for CharacterState {
|
||||
buildup_duration: *buildup_duration,
|
||||
recover_duration: *recover_duration,
|
||||
base_healthchange: *base_healthchange,
|
||||
knockback: *knockback,
|
||||
range: *range,
|
||||
max_angle: *max_angle,
|
||||
}),
|
||||
|
@ -16,6 +16,7 @@ pub enum ToolKind {
|
||||
Dagger(String),
|
||||
Staff(String),
|
||||
Shield(String),
|
||||
NpcWeapon(String),
|
||||
Debug(String),
|
||||
Farming(String),
|
||||
/// This is an placeholder item, it is used by non-humanoid npcs to attack
|
||||
@ -32,6 +33,7 @@ impl ToolKind {
|
||||
ToolKind::Dagger(_) => Hands::OneHand,
|
||||
ToolKind::Staff(_) => Hands::TwoHand,
|
||||
ToolKind::Shield(_) => Hands::OneHand,
|
||||
ToolKind::NpcWeapon(_) => Hands::TwoHand,
|
||||
ToolKind::Debug(_) => Hands::TwoHand,
|
||||
ToolKind::Farming(_) => Hands::TwoHand,
|
||||
ToolKind::Empty => Hands::OneHand,
|
||||
@ -53,6 +55,7 @@ pub enum ToolCategory {
|
||||
Dagger,
|
||||
Staff,
|
||||
Shield,
|
||||
NpcWeapon,
|
||||
Debug,
|
||||
Farming,
|
||||
Empty,
|
||||
@ -68,6 +71,7 @@ impl From<&ToolKind> for ToolCategory {
|
||||
ToolKind::Dagger(_) => ToolCategory::Dagger,
|
||||
ToolKind::Staff(_) => ToolCategory::Staff,
|
||||
ToolKind::Shield(_) => ToolCategory::Shield,
|
||||
ToolKind::NpcWeapon(_) => ToolCategory::NpcWeapon,
|
||||
ToolKind::Debug(_) => ToolCategory::Debug,
|
||||
ToolKind::Farming(_) => ToolCategory::Farming,
|
||||
ToolKind::Empty => ToolCategory::Empty,
|
||||
@ -141,6 +145,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(700),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
base_healthchange: (-120.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 20.0,
|
||||
},
|
||||
@ -157,6 +162,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(700),
|
||||
recover_duration: Duration::from_millis(150),
|
||||
base_healthchange: (-50.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 20.0,
|
||||
}],
|
||||
@ -202,6 +208,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(400),
|
||||
base_healthchange: (-50.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 20.0,
|
||||
},
|
||||
@ -220,6 +227,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(0),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
base_healthchange: (-10.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 5.0,
|
||||
max_angle: 20.0,
|
||||
},
|
||||
@ -228,6 +236,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(0),
|
||||
recover_duration: Duration::from_millis(1000),
|
||||
base_healthchange: (150.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 100.0,
|
||||
max_angle: 90.0,
|
||||
},
|
||||
@ -239,6 +248,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(0),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
base_healthchange: (-10.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 5.0,
|
||||
max_angle: 20.0,
|
||||
},
|
||||
@ -247,6 +257,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(0),
|
||||
recover_duration: Duration::from_millis(1000),
|
||||
base_healthchange: (350.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 100.0,
|
||||
max_angle: 90.0,
|
||||
},
|
||||
@ -258,6 +269,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
base_healthchange: (-40.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 20.0,
|
||||
},
|
||||
@ -324,11 +336,35 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(400),
|
||||
base_healthchange: (-40.0 * self.base_power()) as i32,
|
||||
knockback: 0.0,
|
||||
range: 3.0,
|
||||
max_angle: 120.0,
|
||||
},
|
||||
BasicBlock,
|
||||
],
|
||||
NpcWeapon(kind) => {
|
||||
if kind == "CyclopsHammer" {
|
||||
vec![BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(0),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
knockback: 20.0,
|
||||
base_healthchange: -200,
|
||||
range: 10.0,
|
||||
max_angle: 120.0,
|
||||
}]
|
||||
} else {
|
||||
vec![BasicMelee {
|
||||
energy_cost: 0,
|
||||
buildup_duration: Duration::from_millis(100),
|
||||
recover_duration: Duration::from_millis(300),
|
||||
base_healthchange: -10,
|
||||
knockback: 0.0,
|
||||
range: 1.0,
|
||||
max_angle: 30.0,
|
||||
}]
|
||||
}
|
||||
},
|
||||
Debug(kind) => {
|
||||
if kind == "Boost" {
|
||||
vec![
|
||||
@ -372,6 +408,7 @@ impl Tool {
|
||||
buildup_duration: Duration::from_millis(0),
|
||||
recover_duration: Duration::from_millis(1000),
|
||||
base_healthchange: -20,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 15.0,
|
||||
}],
|
||||
|
@ -70,6 +70,7 @@ impl LoadoutBuilder {
|
||||
buildup_duration: Duration::from_millis(600),
|
||||
recover_duration: Duration::from_millis(100),
|
||||
base_healthchange: -(body.base_dmg() as i32),
|
||||
knockback: 0.0,
|
||||
range: body.base_range(),
|
||||
max_angle: 20.0,
|
||||
}),
|
||||
|
@ -14,6 +14,8 @@ pub struct Data {
|
||||
pub recover_duration: Duration,
|
||||
/// Base damage (negative) or healing (positive)
|
||||
pub base_healthchange: i32,
|
||||
/// Knockback
|
||||
pub knockback: f32,
|
||||
/// Max range
|
||||
pub range: f32,
|
||||
/// Max angle (45.0 will give you a 90.0 angle window)
|
||||
@ -38,6 +40,7 @@ impl CharacterBehavior for Data {
|
||||
.unwrap_or_default(),
|
||||
recover_duration: self.recover_duration,
|
||||
base_healthchange: self.base_healthchange,
|
||||
knockback: self.knockback,
|
||||
range: self.range,
|
||||
max_angle: self.max_angle,
|
||||
exhausted: false,
|
||||
@ -50,13 +53,14 @@ impl CharacterBehavior for Data {
|
||||
max_angle: self.max_angle.to_radians(),
|
||||
applied: false,
|
||||
hit_count: 0,
|
||||
knockback: 0.0,
|
||||
knockback: self.knockback,
|
||||
});
|
||||
|
||||
update.character = CharacterState::BasicMelee(Data {
|
||||
buildup_duration: self.buildup_duration,
|
||||
recover_duration: self.recover_duration,
|
||||
base_healthchange: self.base_healthchange,
|
||||
knockback: self.knockback,
|
||||
range: self.range,
|
||||
max_angle: self.max_angle,
|
||||
exhausted: true,
|
||||
@ -70,6 +74,7 @@ impl CharacterBehavior for Data {
|
||||
.checked_sub(Duration::from_secs_f32(data.dt.0))
|
||||
.unwrap_or_default(),
|
||||
base_healthchange: self.base_healthchange,
|
||||
knockback: self.knockback,
|
||||
range: self.range,
|
||||
max_angle: self.max_angle,
|
||||
exhausted: true,
|
||||
|
@ -147,6 +147,7 @@ impl<'a> System<'a> for Sys {
|
||||
buildup_duration: Duration::from_millis(0),
|
||||
recover_duration: Duration::from_millis(400),
|
||||
base_healthchange: -40,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 15.0,
|
||||
}),
|
||||
@ -277,6 +278,7 @@ impl<'a> System<'a> for Sys {
|
||||
buildup_duration: Duration::from_millis(800),
|
||||
recover_duration: Duration::from_millis(200),
|
||||
base_healthchange: -100,
|
||||
knockback: 0.0,
|
||||
range: 3.5,
|
||||
max_angle: 60.0,
|
||||
}),
|
||||
|
@ -79,6 +79,7 @@ fn get_tool_kind(kind: &ToolKind) -> String {
|
||||
ToolKind::Shield(_) => "Shield".to_string(),
|
||||
ToolKind::Debug(_) => "Debug".to_string(),
|
||||
ToolKind::Farming(_) => "Farming".to_string(),
|
||||
ToolKind::NpcWeapon(_) => "NpcWeapon".to_string(),
|
||||
ToolKind::Empty => "Empty".to_string(),
|
||||
}
|
||||
}
|
||||
@ -94,6 +95,7 @@ fn get_tool_kind_kind(kind: &ToolKind) -> String {
|
||||
ToolKind::Shield(x) => x.clone(),
|
||||
ToolKind::Debug(x) => x.clone(),
|
||||
ToolKind::Farming(x) => x.clone(),
|
||||
ToolKind::NpcWeapon(x) => x.clone(),
|
||||
ToolKind::Empty => "".to_string(),
|
||||
}
|
||||
}
|
||||
|
@ -75,6 +75,7 @@ fn tool_desc(tool: &Tool, desc: &str) -> String {
|
||||
ToolKind::Dagger(_) => "Dagger",
|
||||
ToolKind::Staff(_) => "Staff",
|
||||
ToolKind::Shield(_) => "Shield",
|
||||
ToolKind::NpcWeapon(_) => "Npc Weapon",
|
||||
ToolKind::Debug(_) => "Debug",
|
||||
ToolKind::Farming(_) => "Farming Tool",
|
||||
ToolKind::Empty => "Empty",
|
||||
|
Loading…
Reference in New Issue
Block a user