Fully separated sceptres from staves.

This commit is contained in:
Sam 2020-09-18 11:43:26 -05:00
parent 3e2e06f2f8
commit 3d6c26a3c7
17 changed files with 150 additions and 168 deletions

View File

@ -3,7 +3,7 @@ ItemDef(
description: "Heals your allies with the mystical Velorite aura.",
kind: Tool(
(
kind: Staff("SceptreVelorite"),
kind: Sceptre("SceptreVelorite"),
stats: (
equip_time_millis: 400,
power: 2.0,

View File

@ -3,7 +3,7 @@ ItemDef(
description: "Heals your allies with the power of nature.",
kind: Tool(
(
kind: Staff("Sceptre"),
kind: Sceptre("Sceptre"),
stats: (
equip_time_millis: 400,
power: 1.00,

View File

@ -3,7 +3,7 @@ ItemDef(
description: "Heals your allies with the power of nature.",
kind: Tool(
(
kind: Staff("StarterSceptre"),
kind: Sceptre("StarterSceptre"),
stats: (
equip_time_millis: 400,
power: 0.50,

View File

@ -506,15 +506,15 @@
(1.0, 0.0, 0.0), (-310., 90.0, 0.0), 1.2,
),
// Healing staff
Tool(Staff("Sceptre")): VoxTrans(
Tool(Sceptre("Sceptre")): VoxTrans(
"voxel.weapon.sceptre.wood-nature",
(1.0, -1.0, 0.0), (-310., 90.0, 0.0), 1.2,
),
Tool(Staff("StarterSceptre")): VoxTrans(
Tool(Sceptre("StarterSceptre")): VoxTrans(
"voxel.weapon.sceptre.wood-simple",
(0.0, -0.0, 0.0), (-310., 90.0, 0.0), 1.25,
),
Tool(Staff("SceptreVelorite")): VoxTrans(
Tool(Sceptre("SceptreVelorite")): VoxTrans(
"voxel.weapon.sceptre.ore-nature",
(1.0, -1.0, 0.0), (-310., 90.0, 0.0), 1.15,
),

View File

@ -547,15 +547,15 @@
color: None
),
// Healing staff
Staff("StarterSceptre"): (
Sceptre("StarterSceptre"): (
vox_spec: ("weapon.sceptre.wood-simple", (-1.0, -6.0, -6.0)),
color: None
),
Staff("Sceptre"): (
Sceptre("Sceptre"): (
vox_spec: ("weapon.sceptre.wood-nature", (-1.0, -6.0, -5.0)),
color: None
),
Staff("SceptreVelorite"): (
Sceptre("SceptreVelorite"): (
vox_spec: ("weapon.sceptre.ore-nature", (-2.0, -6.0, -5.0)),
color: None
),

View File

@ -16,6 +16,7 @@ pub enum ToolKind {
Bow(String),
Dagger(String),
Staff(String),
Sceptre(String),
Shield(String),
NpcWeapon(String),
Debug(String),
@ -33,6 +34,7 @@ impl ToolKind {
ToolKind::Bow(_) => Hands::TwoHand,
ToolKind::Dagger(_) => Hands::OneHand,
ToolKind::Staff(_) => Hands::TwoHand,
ToolKind::Sceptre(_) => Hands::TwoHand,
ToolKind::Shield(_) => Hands::OneHand,
ToolKind::NpcWeapon(_) => Hands::TwoHand,
ToolKind::Debug(_) => Hands::TwoHand,
@ -55,6 +57,7 @@ pub enum ToolCategory {
Bow,
Dagger,
Staff,
Sceptre,
Shield,
NpcWeapon,
Debug,
@ -71,6 +74,7 @@ impl From<&ToolKind> for ToolCategory {
ToolKind::Bow(_) => ToolCategory::Bow,
ToolKind::Dagger(_) => ToolCategory::Dagger,
ToolKind::Staff(_) => ToolCategory::Staff,
ToolKind::Sceptre(_) => ToolCategory::Sceptre,
ToolKind::Shield(_) => ToolCategory::Shield,
ToolKind::NpcWeapon(_) => ToolCategory::NpcWeapon,
ToolKind::Debug(_) => ToolCategory::Debug,
@ -299,128 +303,121 @@ impl Tool {
range: 3.5,
max_angle: 20.0,
}],
Staff(kind) => {
if kind == "Sceptre" || kind == "SceptreVelorite" || kind == "StarterSceptre" {
vec![
BasicBeam {
energy_cost: 0,
buildup_duration: Duration::from_millis(250),
recover_duration: Duration::from_millis(250),
beam_duration: Duration::from_secs(1),
base_hps: (60.0 * self.base_power()) as u32,
base_dps: (40.0 * self.base_power()) as u32,
tick_rate: 2.0,
range: 25.0,
max_angle: 1.0,
lifesteal_eff: 0.25,
energy_regen: 50,
energy_drain: 100,
},
BasicRanged {
energy_cost: 800,
holdable: true,
prepare_duration: Duration::from_millis(800),
recover_duration: Duration::from_millis(50),
projectile: Projectile {
hit_solid: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 0.2,
},
projectile::Effect::Vanish,
],
hit_entity: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 0.2,
},
projectile::Effect::Vanish,
],
time_left: Duration::from_secs(20),
owner: None,
ignore_group: true,
Sceptre(_) => vec![
BasicBeam {
energy_cost: 0,
buildup_duration: Duration::from_millis(250),
recover_duration: Duration::from_millis(250),
beam_duration: Duration::from_secs(1),
base_hps: (60.0 * self.base_power()) as u32,
base_dps: (40.0 * self.base_power()) as u32,
tick_rate: 2.0,
range: 25.0,
max_angle: 1.0,
lifesteal_eff: 0.25,
energy_regen: 50,
energy_drain: 100,
},
BasicRanged {
energy_cost: 800,
holdable: true,
prepare_duration: Duration::from_millis(800),
recover_duration: Duration::from_millis(50),
projectile: Projectile {
hit_solid: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 0.2,
},
projectile_body: Body::Object(object::Body::BoltNature),
projectile_light: Some(LightEmitter {
col: (0.0, 1.0, 0.0).into(),
..Default::default()
}),
projectile_gravity: Some(Gravity(1.0)),
projectile_speed: 25.0,
},
]
} else {
vec![
BasicMelee {
energy_cost: 0,
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,
},
BasicRanged {
energy_cost: 0,
holdable: false,
prepare_duration: Duration::from_millis(250),
recover_duration: Duration::from_millis(600),
projectile: Projectile {
hit_solid: vec![projectile::Effect::Vanish],
hit_entity: vec![
projectile::Effect::Damage((-40.0 * self.base_power()) as i32),
projectile::Effect::RewardEnergy(150),
projectile::Effect::Vanish,
],
time_left: Duration::from_secs(20),
owner: None,
ignore_group: true,
projectile::Effect::Vanish,
],
hit_entity: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 0.2,
},
projectile_body: Body::Object(object::Body::BoltFire),
projectile_light: Some(LightEmitter {
col: (0.85, 0.5, 0.11).into(),
..Default::default()
}),
projectile_gravity: None,
projectile_speed: 100.0,
},
BasicRanged {
energy_cost: 400,
holdable: true,
prepare_duration: Duration::from_millis(800),
recover_duration: Duration::from_millis(50),
projectile: Projectile {
hit_solid: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 1.0,
},
projectile::Effect::Vanish,
],
hit_entity: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 1.0,
},
projectile::Effect::Vanish,
],
time_left: Duration::from_secs(20),
owner: None,
ignore_group: true,
projectile::Effect::Vanish,
],
time_left: Duration::from_secs(20),
owner: None,
ignore_group: true,
},
projectile_body: Body::Object(object::Body::BoltNature),
projectile_light: Some(LightEmitter {
col: (0.0, 1.0, 0.0).into(),
..Default::default()
}),
projectile_gravity: Some(Gravity(1.0)),
projectile_speed: 25.0,
},
],
Staff(_) => vec![
BasicMelee {
energy_cost: 0,
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,
},
BasicRanged {
energy_cost: 0,
holdable: false,
prepare_duration: Duration::from_millis(250),
recover_duration: Duration::from_millis(600),
projectile: Projectile {
hit_solid: vec![projectile::Effect::Vanish],
hit_entity: vec![
projectile::Effect::Damage((-40.0 * self.base_power()) as i32),
projectile::Effect::RewardEnergy(150),
projectile::Effect::Vanish,
],
time_left: Duration::from_secs(20),
owner: None,
ignore_group: true,
},
projectile_body: Body::Object(object::Body::BoltFire),
projectile_light: Some(LightEmitter {
col: (0.85, 0.5, 0.11).into(),
..Default::default()
}),
projectile_gravity: None,
projectile_speed: 100.0,
},
BasicRanged {
energy_cost: 400,
holdable: true,
prepare_duration: Duration::from_millis(800),
recover_duration: Duration::from_millis(50),
projectile: Projectile {
hit_solid: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 1.0,
},
projectile_body: Body::Object(object::Body::BoltFireBig),
projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),
projectile_gravity: None,
projectile_speed: 100.0,
},
]
}
},
projectile::Effect::Vanish,
],
hit_entity: vec![
projectile::Effect::Explode {
power: 1.4 * self.base_power(),
percent_damage: 1.0,
},
projectile::Effect::Vanish,
],
time_left: Duration::from_secs(20),
owner: None,
ignore_group: true,
},
projectile_body: Body::Object(object::Body::BoltFireBig),
projectile_light: Some(LightEmitter {
col: (1.0, 0.75, 0.11).into(),
..Default::default()
}),
projectile_gravity: None,
projectile_speed: 100.0,
},
],
Shield(_) => vec![
BasicMelee {
energy_cost: 0,

View File

@ -78,6 +78,7 @@ fn get_tool_kind(kind: &ToolKind) -> String {
ToolKind::Bow(_) => "Bow".to_string(),
ToolKind::Dagger(_) => "Dagger".to_string(),
ToolKind::Staff(_) => "Staff".to_string(),
ToolKind::Sceptre(_) => "Sceptre".to_string(),
ToolKind::Shield(_) => "Shield".to_string(),
ToolKind::Debug(_) => "Debug".to_string(),
ToolKind::Farming(_) => "Farming".to_string(),
@ -94,6 +95,7 @@ fn get_tool_kind_kind(kind: &ToolKind) -> String {
ToolKind::Bow(x) => x.clone(),
ToolKind::Dagger(x) => x.clone(),
ToolKind::Staff(x) => x.clone(),
ToolKind::Sceptre(x) => x.clone(),
ToolKind::Shield(x) => x.clone(),
ToolKind::Debug(x) => x.clone(),
ToolKind::Farming(x) => x.clone(),

View File

@ -373,7 +373,7 @@ impl Animation for AlphaAnimation {
next.torso.orientation = Quaternion::rotation_z(0.0);
next.torso.scale = Vec3::one() / 11.0 * skeleton_attr.scaler;
},
Some(ToolKind::Staff(_)) => {
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.head.orientation =
Quaternion::rotation_x(staff * 0.2) * Quaternion::rotation_z(staff * 0.2);
next.l_hand.position = Vec3::new(11.0, 5.0, -4.0);

View File

@ -127,7 +127,7 @@ impl Animation for BlockAnimation {
* Quaternion::rotation_z(-0.85);
next.main.scale = Vec3::one();
},
Some(ToolKind::Staff(_)) => {
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.l_hand.position = Vec3::new(
-6.0 + wave_ultra_slow_cos * 1.0,
3.5 + wave_ultra_slow_cos * 0.5,

View File

@ -97,7 +97,7 @@ impl Animation for ChargeAnimation {
match active_tool_kind {
//TODO: Inventory
Some(ToolKind::Staff(_)) => {
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.l_hand.position = Vec3::new(11.0, 5.0, -4.0);
next.l_hand.orientation = Quaternion::rotation_x(1.27);
next.l_hand.scale = Vec3::one() * 1.05;

View File

@ -103,7 +103,7 @@ impl Animation for EquipAnimation {
Quaternion::rotation_x(0.0) * Quaternion::rotation_y(1.35 + 2.5);
next.control.scale = Vec3::one();
},
Some(ToolKind::Staff(_)) => {
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.l_hand.position = Vec3::new(1.0, -2.0, -5.0);
next.l_hand.orientation =
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.3);

View File

@ -65,7 +65,7 @@ impl Animation for ShootAnimation {
match active_tool_kind {
//TODO: Inventory
Some(ToolKind::Staff(_)) => {
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.l_hand.position = Vec3::new(11.0, 5.0, -4.0);
next.l_hand.orientation =
Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);

View File

@ -277,7 +277,7 @@ impl Animation for SwimWieldAnimation {
* Quaternion::rotation_z(u_slowalt * 0.08);
next.control.scale = Vec3::one();
},
Some(ToolKind::Staff(_)) => {
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.l_hand.position = Vec3::new(1.5, 0.5, -4.0);
next.l_hand.orientation =
Quaternion::rotation_x(1.47) * Quaternion::rotation_y(-0.3);

View File

@ -228,7 +228,7 @@ impl Animation for WieldAnimation {
* Quaternion::rotation_z(u_slowalt * 0.08);
next.control.scale = Vec3::one();
},
Some(ToolKind::Staff(_)) => {
Some(ToolKind::Staff(_)) | Some(ToolKind::Sceptre(_)) => {
next.l_hand.position = Vec3::new(11.0, 5.0, -4.0);
next.l_hand.orientation =
Quaternion::rotation_x(1.27) * Quaternion::rotation_y(0.0);

View File

@ -77,10 +77,8 @@ impl State {
.filter(|kind| {
use common::comp::item::{tool::ToolKind, ItemKind};
if let ItemKind::Tool(kind) = kind {
if let ToolKind::Staff(kind) = &kind.kind {
kind != "Sceptre"
&& kind != "SceptreVelorite"
&& kind != "StarterSceptre"
if let ToolKind::Staff(_) = &kind.kind {
true
} else if let ToolKind::Debug(kind) = &kind.kind {
kind == "Boost"
} else {

View File

@ -620,12 +620,8 @@ impl<'a> Widget for Skillbar<'a> {
ToolKind::Hammer(_) => self.imgs.twohhammer_m1,
ToolKind::Axe(_) => self.imgs.twohaxe_m1,
ToolKind::Bow(_) => self.imgs.bow_m1,
ToolKind::Staff(kind) => match kind.as_ref() {
"Sceptre" => self.imgs.heal_0,
"SceptreVelorite" => self.imgs.heal_0,
"StarterSceptre" => self.imgs.heal_0,
_ => self.imgs.staff_m1,
},
ToolKind::Sceptre(_) => self.imgs.heal_0,
ToolKind::Staff(_) => self.imgs.staff_m1,
ToolKind::Debug(kind) => match kind.as_ref() {
"Boost" => self.imgs.flyingrod_m1,
_ => self.imgs.nothing,
@ -703,12 +699,8 @@ impl<'a> Widget for Skillbar<'a> {
Some(ToolKind::Hammer(_)) => self.imgs.hammerleap,
Some(ToolKind::Axe(_)) => self.imgs.axespin,
Some(ToolKind::Bow(_)) => self.imgs.bow_m2,
Some(ToolKind::Staff(kind)) => match kind.as_ref() {
"Sceptre" => self.imgs.heal_bomb,
"SceptreVelorite" => self.imgs.heal_bomb,
"StarterSceptre" => self.imgs.heal_bomb,
_ => self.imgs.staff_m2,
},
Some(ToolKind::Sceptre(_)) => self.imgs.heal_bomb,
Some(ToolKind::Staff(_)) => self.imgs.staff_m2,
Some(ToolKind::Debug(kind)) => match kind.as_ref() {
"Boost" => self.imgs.flyingrod_m2,
_ => self.imgs.nothing,
@ -725,24 +717,16 @@ impl<'a> Widget for Skillbar<'a> {
Color::Rgba(0.3, 0.3, 0.3, 0.8)
}
},
Some(ToolKind::Staff(kind)) => match kind.as_ref() {
"Sceptre" => {
if self.energy.current() as f64 >= 400.0 {
Color::Rgba(1.0, 1.0, 1.0, 1.0)
} else {
Color::Rgba(0.3, 0.3, 0.3, 0.8)
}
},
"SceptreVelorite" => {
if self.energy.current() as f64 >= 400.0 {
Color::Rgba(1.0, 1.0, 1.0, 1.0)
} else {
Color::Rgba(0.3, 0.3, 0.3, 0.8)
}
},
_ => Color::Rgba(1.0, 1.0, 1.0, 1.0),
Some(ToolKind::Sceptre(_)) => {
if self.energy.current() as f64 >= 400.0 {
Color::Rgba(1.0, 1.0, 1.0, 1.0)
} else {
Color::Rgba(0.3, 0.3, 0.3, 0.8)
}
},
_ => {
Color::Rgba(1.0, 1.0, 1.0, 1.0)
},
_ => Color::Rgba(1.0, 1.0, 1.0, 1.0),
})
.set(state.ids.m2_content, ui);
// Slots

View File

@ -75,6 +75,7 @@ fn tool_desc(tool: &Tool, desc: &str) -> String {
ToolKind::Bow(_) => "Bow",
ToolKind::Dagger(_) => "Dagger",
ToolKind::Staff(_) => "Staff",
ToolKind::Sceptre(_) => "Sceptre",
ToolKind::Shield(_) => "Shield",
ToolKind::NpcWeapon(_) => "Npc Weapon",
ToolKind::Debug(_) => "Debug",