Added 1h hammers.

Fixed audio tests.
This commit is contained in:
Sam 2021-02-15 00:07:00 -05:00
parent 18309fe4c6
commit 411b4083b1
39 changed files with 485 additions and 22 deletions

View File

@ -3,7 +3,7 @@ ItemDef(
description: "The entire head of this club is forged from bronze alloy.",
kind: Tool((
kind: Hammer,
hands: OneHand,
hands: TwoHand,
stats: (
equip_time_millis: 500,
power: 1.0,

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Bloodsteel Mace",
description: "Infused with blood.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.6,
poise_strength: 1.0,
speed: 1.2,
),
)),
quality: High,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Scarlet Maul",
description: "Infused with blood.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.8,
poise_strength: 1.0,
speed: 1.0,
),
)),
quality: High,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Brass Block",
description: "Casted from brass.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.2,
poise_strength: 1.0,
speed: 0.8,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Bronze Cudgel",
description: "Forged from bronze.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.0,
poise_strength: 1.0,
speed: 1.0,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Blue Bludgeon",
description: "Forged from cobalt.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.6,
poise_strength: 1.0,
speed: 1.0,
),
)),
quality: High,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Cobalt Cudgel",
description: "Forged from cobalt.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.5,
poise_strength: 1.0,
speed: 1.1,
),
)),
quality: High,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Dwarven Hammer",
description: "Forged from iron.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.4,
poise_strength: 1.0,
speed: 0.8,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Iron Club",
description: "Forged from iron.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.3,
poise_strength: 1.0,
speed: 0.9,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Spiky Mace",
description: "Forged from iron.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.1,
poise_strength: 1.0,
speed: 1.1,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Bone Breaker",
description: "Forged from steel.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.5,
poise_strength: 1.0,
speed: 0.9,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Jeweled Bulawa",
description: "Inset with an amethyst.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.4,
poise_strength: 1.0,
speed: 1.0,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Ornamental Mace",
description: "Inlaid with gold.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.2,
poise_strength: 1.0,
speed: 1.2,
),
)),
quality: Moderate,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Spine Mace",
description: "Bone(s?)",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 0.7,
poise_strength: 1.0,
speed: 1.1,
),
)),
quality: Common,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Stone Hammer",
description: "Chiseled from stone.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 1.0,
poise_strength: 1.0,
speed: 0.8,
),
)),
quality: Common,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Stump Club",
description: "All that remains of a tree...",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 0.8,
poise_strength: 1.0,
speed: 0.8,
),
)),
quality: Low,
)

View File

@ -0,0 +1,15 @@
ItemDef(
name: "Wooden Cudgel",
description: "Carved from wood.",
kind: Tool((
kind: Hammer,
hands: OneHand,
stats: (
equip_time_millis: 500,
power: 0.5,
poise_strength: 1.0,
speed: 1.1,
),
)),
quality: Low,
)

View File

@ -614,6 +614,71 @@
"voxel.weapon.hammer.cult_purp-0",
(2.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.1,
),
// 1h Hammers
Tool("common.items.weapons.hammer_1h.bloodsteel-0"): VoxTrans(
"voxel.weapon.hammer_1h.bloodsteel-0",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.bloodsteel-1"): VoxTrans(
"voxel.weapon.hammer_1h.bloodsteel-1",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.bronze-0"): VoxTrans(
"voxel.weapon.hammer_1h.bronze-0",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.bronze-1"): VoxTrans(
"voxel.weapon.hammer_1h.bronze-1",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.cobalt-0"): VoxTrans(
"voxel.weapon.hammer_1h.cobalt-0",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.cobalt-1"): VoxTrans(
"voxel.weapon.hammer_1h.cobalt-1",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.iron-0"): VoxTrans(
"voxel.weapon.hammer_1h.iron-0",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.iron-1"): VoxTrans(
"voxel.weapon.hammer_1h.iron-1",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.iron-2"): VoxTrans(
"voxel.weapon.hammer_1h.iron-2",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.steel-0"): VoxTrans(
"voxel.weapon.hammer_1h.steel-0",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.steel-1"): VoxTrans(
"voxel.weapon.hammer_1h.steel-1",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.steel-2"): VoxTrans(
"voxel.weapon.hammer_1h.steel-2",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.stone-0"): VoxTrans(
"voxel.weapon.hammer_1h.stone-0",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.stone-1"): VoxTrans(
"voxel.weapon.hammer_1h.stone-1",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.wood-0"): VoxTrans(
"voxel.weapon.hammer_1h.wood-0",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
Tool("common.items.weapons.hammer_1h.wood-1"): VoxTrans(
"voxel.weapon.hammer_1h.wood-1",
(1.0, -1.0, 0.0), (-135.0, 90.0, 0.0), 1.2,
),
// Staffs
Tool("common.items.weapons.staff.staff_1"): VoxTrans(
"voxel.weapon.staff.firestaff_starter",

View File

@ -510,6 +510,71 @@
vox_spec: ("weapon.hammer.craftsman", (-2.0, -5.0, -5.5)),
color: None
),*/
// 1h Hammers
"common.items.weapons.hammer_1h.bloodsteel-0": (
vox_spec: ("weapon.hammer_1h.bloodsteel-0", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.bloodsteel-1": (
vox_spec: ("weapon.hammer_1h.bloodsteel-1", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.bronze-0": (
vox_spec: ("weapon.hammer_1h.bronze-0", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.bronze-1": (
vox_spec: ("weapon.hammer_1h.bronze-1", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.cobalt-0": (
vox_spec: ("weapon.hammer_1h.cobalt-0", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.cobalt-1": (
vox_spec: ("weapon.hammer_1h.cobalt-1", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.iron-0": (
vox_spec: ("weapon.hammer_1h.iron-0", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.iron-1": (
vox_spec: ("weapon.hammer_1h.iron-1", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.iron-2": (
vox_spec: ("weapon.hammer_1h.iron-2", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.steel-0": (
vox_spec: ("weapon.hammer_1h.steel-0", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.steel-1": (
vox_spec: ("weapon.hammer_1h.steel-1", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.steel-2": (
vox_spec: ("weapon.hammer_1h.steel-2", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.stone-0": (
vox_spec: ("weapon.hammer_1h.stone-0", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.stone-1": (
vox_spec: ("weapon.hammer_1h.stone-1", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.wood-0": (
vox_spec: ("weapon.hammer_1h.wood-0", (-1.5, -5.0, -6.0)),
color: None
),
"common.items.weapons.hammer_1h.wood-1": (
vox_spec: ("weapon.hammer_1h.wood-1", (-1.5, -5.0, -6.0)),
color: None
),
// Daggers
"common.items.weapons.dagger.starter_dagger": (
vox_spec: ("weapon.dagger.dagger_rusty", (-1.5, -3.0, -3.0)),

BIN
assets/voxygen/voxel/weapon/hammer_1h/bloodsteel-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/bloodsteel-1.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/bronze-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/bronze-1.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/cobalt-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/cobalt-1.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/iron-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/iron-1.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/iron-2.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/steel-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/steel-1.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/steel-2.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/stone-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/stone-1.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/wood-0.vox (Stored with Git LFS) Normal file

Binary file not shown.

BIN
assets/voxygen/voxel/weapon/hammer_1h/wood-1.vox (Stored with Git LFS) Normal file

Binary file not shown.

View File

@ -99,7 +99,9 @@ impl CharacterBehavior for Data {
}
},
StageSection::Charge => {
if !ability_key_is_pressed(data, self.static_data.ability_info.key) && !self.exhausted {
if !ability_key_is_pressed(data, self.static_data.ability_info.key)
&& !self.exhausted
{
let charge_frac = (self.timer.as_secs_f32()
/ self.static_data.charge_duration.as_secs_f32())
.min(1.0);

View File

@ -97,7 +97,10 @@ impl CharacterBehavior for Data {
} else {
// Transitions to charge section of stage
update.character = CharacterState::DashMelee(Data {
auto_charge: !ability_key_is_pressed(data, self.static_data.ability_info.key),
auto_charge: !ability_key_is_pressed(
data,
self.static_data.ability_info.key,
),
timer: Duration::default(),
stage_section: StageSection::Charge,
..*self

View File

@ -412,7 +412,11 @@ pub fn handle_ability1_input(data: &JoinData, update: &mut StateUpdate) {
})
.filter(|ability| ability.requirements_paid(data, update))
{
update.character = (&ability, AbilityInfo::from_key(data, AbilityKey::Mouse1, false)).into();
update.character = (
&ability,
AbilityInfo::from_key(data, AbilityKey::Mouse1, false),
)
.into();
}
}
}
@ -455,7 +459,15 @@ pub fn handle_ability2_input(data: &JoinData, update: &mut StateUpdate) {
})
.filter(|ability| ability.requirements_paid(data, update))
{
update.character = (&ability, AbilityInfo::from_key(data, AbilityKey::Mouse2, matches!(equip_slot, EquipSlot::Offhand))).into();
update.character = (
&ability,
AbilityInfo::from_key(
data,
AbilityKey::Mouse2,
matches!(equip_slot, EquipSlot::Offhand),
),
)
.into();
}
}
}
@ -477,7 +489,11 @@ pub fn handle_ability3_input(data: &JoinData, update: &mut StateUpdate) {
})
.filter(|ability| ability.requirements_paid(data, update))
{
update.character = (&ability, AbilityInfo::from_key(data, AbilityKey::Skill1, false)).into();
update.character = (
&ability,
AbilityInfo::from_key(data, AbilityKey::Skill1, false),
)
.into();
}
}
}
@ -524,7 +540,15 @@ pub fn handle_ability4_input(data: &JoinData, update: &mut StateUpdate) {
})
.filter(|ability| ability.requirements_paid(data, update))
{
update.character = (&ability, AbilityInfo::from_key(data, AbilityKey::Skill2, matches!(equip_slot, EquipSlot::Offhand))).into();
update.character = (
&ability,
AbilityInfo::from_key(
data,
AbilityKey::Skill2,
matches!(equip_slot, EquipSlot::Offhand),
),
)
.into();
}
}
}
@ -546,28 +570,36 @@ pub fn handle_dodge_input(data: &JoinData, update: &mut StateUpdate) {
.filter(|ability| ability.requirements_paid(data, update))
{
if data.character.is_wield() {
update.character = (&ability, AbilityInfo::from_key(data, AbilityKey::Dodge, false)).into();
update.character = (
&ability,
AbilityInfo::from_key(data, AbilityKey::Dodge, false),
)
.into();
if let CharacterState::Roll(roll) = &mut update.character {
roll.was_wielded = true;
}
} else if data.character.is_stealthy() {
update.character = (&ability, AbilityInfo::from_key(data, AbilityKey::Dodge, false)).into();
update.character = (
&ability,
AbilityInfo::from_key(data, AbilityKey::Dodge, false),
)
.into();
if let CharacterState::Roll(roll) = &mut update.character {
roll.was_sneak = true;
}
} else {
update.character = (&ability, AbilityInfo::from_key(data, AbilityKey::Dodge, false)).into();
update.character = (
&ability,
AbilityInfo::from_key(data, AbilityKey::Dodge, false),
)
.into();
}
}
}
}
pub fn unwrap_tool_data<'a>(data: &'a JoinData, equip_slot: EquipSlot) -> Option<&'a Tool> {
if let Some(ItemKind::Tool(tool)) = data
.inventory
.equipped(equip_slot)
.map(|i| i.kind())
{
if let Some(ItemKind::Tool(tool)) = data.inventory.equipped(equip_slot).map(|i| i.kind()) {
Some(&tool)
} else {
None
@ -676,13 +708,21 @@ impl AbilityInfo {
let (tool, hand) = if from_offhand {
(tool_data.map(|t| t.kind), Some(HandInfo::OffHand))
} else {
(tool_data.map(|t| t.kind), tool_data.map(|t| HandInfo::from_main_tool(t)))
(
tool_data.map(|t| t.kind),
tool_data.map(|t| HandInfo::from_main_tool(t)),
)
};
Self { tool, hand, key }
}
/// For audio sfx test
pub fn empty_info() -> Self {
Self {
tool,
hand,
key,
tool: None,
hand: None,
key: AbilityKey::Mouse1,
}
}
}

View File

@ -78,7 +78,7 @@ fn maps_basic_melee() {
knockback: 0.0,
range: 1.0,
max_angle: 1.0,
ability_key: states::utils::AbilityKey::Mouse1,
ability_info: states::utils::AbilityInfo::empty_info(),
},
timer: Duration::default(),
stage_section: states::utils::StageSection::Buildup,
@ -132,7 +132,7 @@ fn matches_ability_stage() {
max_speed_increase: 0.8,
scales_from_combo: 2,
is_interruptible: true,
ability_key: states::utils::AbilityKey::Mouse1,
ability_info: states::utils::AbilityInfo::empty_info(),
},
stage: 1,
combo: 0,
@ -191,7 +191,7 @@ fn ignores_different_ability_stage() {
max_speed_increase: 0.8,
scales_from_combo: 2,
is_interruptible: true,
ability_key: states::utils::AbilityKey::Mouse1,
ability_info: states::utils::AbilityInfo::empty_info(),
},
stage: 1,
combo: 0,