Initial setup

This commit is contained in:
Sam 2024-01-25 20:10:26 -05:00
parent 8fd6216e39
commit 09b25d4f74
18 changed files with 185 additions and 692 deletions

View File

@ -193,10 +193,54 @@
), ),
Tool(Hammer): ( Tool(Hammer): (
guard: Some(Simple(None, "common.abilities.hammer.basic_guard")), guard: Some(Simple(None, "common.abilities.hammer.basic_guard")),
primary: Simple(None, "common.abilities.hammer.singlestrike"), primary: Simple(None, "common.abilities.hammer.basic_guard"),
secondary: Simple(None, "common.abilities.hammer.charged"), // primary: Simple(None, "common.abilities.hammer.solid_smash"),
secondary: Simple(None, "common.abilities.hammer.basic_guard"),
// secondary: Simple(None, "common.abilities.hammer.wide_wallop"),
abilities: [ abilities: [
Simple(Some(Hammer(UnlockLeap)), "common.abilities.hammer.leap"), // Simple(Hammer(ScornfulSwipe), "common.abilities.hammer.scornful_swipe"),
// Simple(Hammer(Tremor), "common.abilities.hammer.tremor"),
// Simple(Hammer(VigorousBash), "common.abilities.hammer.vigorous_bash"),
// Simple(Hammer(Retaliate), "common.abilities.hammer.retaliate"),
// Simple(Hammer(SpineCracker), "common.abilities.hammer.spine_cracker"),
// Simple(Hammer(Breach), "common.abilities.hammer.breach"),
// Contextualized(
// pseudo_id: "common.abilities.hammer.iron_tempest",
// abilities: [
// ((dual_wielding_same_kind: true), (Hammer(IronTempest), "common.abilities.hammer.dual_iron_tempest")),
// ((), (Hammer(IronTempest), "common.abilities.hammer.iron_tempest")),
// ],
// ),
// Contextualized(
// pseudo_id: "common.abilities.hammer.upheaval",
// abilities: [
// ((dual_wielding_same_kind: true), (Hammer(Upheaval), "common.abilities.hammer.dual_upheaval")),
// ((), (Hammer(Upheaval), "common.abilities.hammer.upheaval")),
// ],
// ),
// Simple(Hammer(Thunderclap), "common.abilities.hammer.thunderclap"),
// Simple(Hammer(SeismicShock), "common.abilities.hammer.seismic_shock"),
// Contextualized(
// pseudo_id: "common.abilities.hammer.heavy_whorl",
// abilities: [
// ((dual_wielding_same_kind: true), (Hammer(HeavyWhorl), "common.abilities.hammer.dual_heavy_whorl")),
// ((), (Hammer(HeavyWhorl), "common.abilities.hammer.heavy_whorl")),
// ],
// ),
// Contextualized(
// pseudo_id: "common.abilities.hammer.intercept",
// abilities: [
// ((dual_wielding_same_kind: true), (Hammer(Intercept), "common.abilities.hammer.dual_intercept")),
// ((), (Hammer(Intercept), "common.abilities.hammer.intercept")),
// ],
// ),
// Simple(Hammer(PileDriver), "common.abilities.hammer.pile_driver"),
// Simple(Hammer(LungPummel), "common.abilities.hammer.lung_pummel"),
// Simple(Hammer(HelmCrusher), "common.abilities.hammer.helm_crusher"),
// Simple(Hammer(Rampart), "common.abilities.hammer.rampart"),
// Simple(Hammer(Tenacity), "common.abilities.hammer.tenacity"),
// Simple(Hammer(Earthshaker), "common.abilities.hammer.earthshaker"),
// Simple(Hammer(Judgement), "common.abilities.hammer.judgement"),
], ],
), ),
Tool(Bow): ( Tool(Bow): (
@ -863,7 +907,7 @@
abilities: [], abilities: [],
), ),
Custom("Golf Club"): ( Custom("Golf Club"): (
primary: Simple(None, "common.abilities.hammer.singlestrike"), primary: Simple(None, "common.abilities.tool.golf_club.charged"),
secondary: Simple(None, "common.abilities.tool.golf_club.charged"), secondary: Simple(None, "common.abilities.tool.golf_club.charged"),
abilities: [], abilities: [],
), ),

View File

@ -1,26 +0,0 @@
ChargedMelee(
energy_cost: 1,
energy_drain: 30.0,
melee_constructor: (
kind: Bash(
damage: 0.0,
poise: 0.0,
knockback: 5.0,
energy_regen: 0.0,
),
scaled: Some((
kind: Bash(
damage: 20.0,
poise: 30.0,
knockback: 20.0,
energy_regen: 0.0,
))),
range: 3.5,
angle: 30.0,
multi_target: Some(Normal),
),
charge_duration: 1.0,
swing_duration: 0.12,
hit_timing: 0.2,
recover_duration: 0.3,
)

View File

@ -1,21 +0,0 @@
LeapMelee(
energy_cost: 35.0,
buildup_duration: 0.1,
movement_duration: 0.6,
swing_duration: 0.15,
recover_duration: 0.2,
melee_constructor: (
kind: Bash(
damage: 25.0,
poise: 40.0,
knockback: 25.0,
energy_regen: 0.0,
),
range: 4.5,
angle: 360.0,
multi_target: Some(Normal),
),
forward_leap_strength: 20.0,
vertical_leap_strength: 8.0,
specifier: None,
)

View File

@ -1,25 +0,0 @@
ComboMeleeDeprecated(
stage_data: [(
stage: 1,
base_damage: 15.0,
damage_increase: 0.75,
base_poise_damage: 0,
poise_damage_increase: 0,
knockback: 3.5,
range: 4.5,
angle: 50.0,
base_buildup_duration: 0.2,
base_swing_duration: 0.1,
hit_timing: 0.5,
base_recover_duration: 0.45,
forward_movement: 0.0,
damage_kind: Crushing,
)],
initial_energy_gain: 5.0,
max_energy_gain: 12.5,
energy_increase: 2.5,
speed_increase: 0.1,
max_speed_increase: 0.4,
scales_from_combo: 2,
ori_modifier: 1.0,
)

View File

@ -1,17 +1,4 @@
({ ({
Hammer(SsKnockback): 2,
Hammer(SsDamage): 3,
Hammer(SsRegen): 2,
Hammer(SsSpeed): 3,
Hammer(CDamage): 3,
Hammer(CKnockback): 3,
Hammer(CDrain): 2,
Hammer(CSpeed): 2,
Hammer(LDamage): 2,
Hammer(LCost): 2,
Hammer(LDistance): 2,
Hammer(LKnockback): 2,
Hammer(LRange): 2,
Bow(ProjSpeed): 2, Bow(ProjSpeed): 2,
Bow(CDamage): 3, Bow(CDamage): 3,
Bow(CRegen): 2, Bow(CRegen): 2,

View File

@ -37,11 +37,24 @@
Axe(Keelhaul): Any({Axe(Sunder): 1, Axe(Plunder): 1}), Axe(Keelhaul): Any({Axe(Sunder): 1, Axe(Plunder): 1}),
Axe(Bulkhead): Any({Axe(Sunder): 1, Axe(Plunder): 1}), Axe(Bulkhead): Any({Axe(Sunder): 1, Axe(Plunder): 1}),
Axe(Capsize): All({Axe(Bulkhead): 1}), Axe(Capsize): All({Axe(Bulkhead): 1}),
Hammer(LDamage): All({Hammer(UnlockLeap): 1}), Hammer(Tremor): All({Hammer(ScornfulSwipe): 1}),
Hammer(LCost): All({Hammer(UnlockLeap): 1}), Hammer(VigorousBash): All({Hammer(ScornfulSwipe): 1}),
Hammer(LDistance): All({Hammer(UnlockLeap): 1}), Hammer(Retaliate): Any({Hammer(Tremor): 1, Hammer(VigorousBash): 1}),
Hammer(LKnockback): All({Hammer(UnlockLeap): 1}), Hammer(SpineCracker): Any({Hammer(Tremor): 1, Hammer(VigorousBash): 1}),
Hammer(LRange): All({Hammer(UnlockLeap): 1}), Hammer(Breach): Any({Hammer(Tremor): 1, Hammer(VigorousBash): 1}),
Hammer(IronTempest): Any({Hammer(Retaliate): 1, Hammer(Breach): 1, Hammer(SpineCracker): 1, Hammer(HelmCrusher): 1, Hammer(LungPummel): 1, Hammer(PileDriver): 1}),
Hammer(Upheaval): Any({Hammer(Retaliate): 1, Hammer(Breach): 1, Hammer(SpineCracker): 1, Hammer(HelmCrusher): 1, Hammer(LungPummel): 1, Hammer(PileDriver): 1}),
Hammer(Thunderclap): Any({Hammer(IronTempest): 1, Hammer(Upheaval): 1}),
Hammer(SeismicShock): Any({Hammer(IronTempest): 1, Hammer(Upheaval): 1}),
Hammer(HeavyWhorl): All({Hammer(ScornfulSwipe): 1}),
Hammer(Intercept): All({Hammer(ScornfulSwipe): 1}),
Hammer(PileDriver): Any({Hammer(Intercept): 1, Hammer(HeavyWhorl): 1}),
Hammer(LungPummel): Any({Hammer(Intercept): 1, Hammer(HeavyWhorl): 1}),
Hammer(HelmCrusher): Any({Hammer(Intercept): 1, Hammer(HeavyWhorl): 1}),
Hammer(Rampart): Any({Hammer(Retaliate): 1, Hammer(Breach): 1, Hammer(SpineCracker): 1, Hammer(HelmCrusher): 1, Hammer(LungPummel): 1, Hammer(PileDriver): 1}),
Hammer(Tenacity): Any({Hammer(Retaliate): 1, Hammer(Breach): 1, Hammer(SpineCracker): 1, Hammer(HelmCrusher): 1, Hammer(LungPummel): 1, Hammer(PileDriver): 1}),
Hammer(Earthshaker): Any({Hammer(Tenacity): 1, Hammer(Rampart): 1}),
Hammer(Judgement): Any({Hammer(Tenacity): 1, Hammer(Rampart): 1}),
Bow(SDamage): All({Bow(UnlockShotgun): 1}), Bow(SDamage): All({Bow(UnlockShotgun): 1}),
Bow(SCost): All({Bow(UnlockShotgun): 1}), Bow(SCost): All({Bow(UnlockShotgun): 1}),
Bow(SArrows): All({Bow(UnlockShotgun): 1}), Bow(SArrows): All({Bow(UnlockShotgun): 1}),

View File

@ -62,20 +62,25 @@
Axe(Capsize), Axe(Capsize),
], ],
Weapon(Hammer): [ Weapon(Hammer): [
Hammer(SsKnockback), Hammer(ScornfulSwipe),
Hammer(SsDamage), Hammer(Tremor),
Hammer(SsSpeed), Hammer(VigorousBash),
Hammer(SsRegen), Hammer(Retaliate),
Hammer(CDamage), Hammer(SpineCracker),
Hammer(CKnockback), Hammer(Breach),
Hammer(CDrain), Hammer(IronTempest),
Hammer(CSpeed), Hammer(Upheaval),
Hammer(UnlockLeap), Hammer(Thunderclap),
Hammer(LDamage), Hammer(SeismicShock),
Hammer(LCost), Hammer(HeavyWhorl),
Hammer(LDistance), Hammer(Intercept),
Hammer(LKnockback), Hammer(PileDriver),
Hammer(LRange), Hammer(LungPummel),
Hammer(HelmCrusher),
Hammer(Rampart),
Hammer(Tenacity),
Hammer(Earthshaker),
Hammer(Judgement),
], ],
Weapon(Bow): [ Weapon(Bow): [
Bow(ProjSpeed), Bow(ProjSpeed),

View File

@ -1,12 +1,5 @@
([ ([
Group(Weapon(Hammer)), Group(Weapon(Hammer)),
// Single Strike, as single as you are Skill((Hammer(ScornfulSwipe), 1)),
Skill((Hammer(SsKnockback), 1)),
Skill((Hammer(SsDamage), 1)),
// Charged
Skill((Hammer(CDamage), 1)),
Skill((Hammer(CKnockback), 1)),
]) ])

View File

@ -1,16 +1,10 @@
([ ([
Group(Weapon(Hammer)), Group(Weapon(Hammer)),
// Single Strike, as single as you are Skill((Hammer(ScornfulSwipe), 1)),
Skill((Hammer(SsKnockback), 1)),
Skill((Hammer(SsDamage), 2)),
Skill((Hammer(SsRegen), 1)),
Skill((Hammer(SsSpeed), 1)),
// Charged
Skill((Hammer(CDamage), 1)),
Skill((Hammer(CKnockback), 1)),
Skill((Hammer(CDrain), 1)),
Skill((Hammer(CSpeed), 1)),
Skill((Hammer(Tremor), 1)),
Skill((Hammer(VigorousBash), 1)),
Skill((Hammer(Intercept), 1)),
Skill((Hammer(HeavyWhorl), 1)),
]) ])

View File

@ -1,21 +1,17 @@
([ ([
Group(Weapon(Hammer)), Group(Weapon(Hammer)),
// Single Strike, as single as you are Skill((Hammer(ScornfulSwipe), 1)),
Skill((Hammer(SsKnockback), 2)),
Skill((Hammer(SsDamage), 2)),
Skill((Hammer(SsRegen), 1)),
Skill((Hammer(SsSpeed), 1)),
// Charged Skill((Hammer(Tremor), 1)),
Skill((Hammer(CDamage), 2)), Skill((Hammer(VigorousBash), 1)),
Skill((Hammer(CKnockback), 1)), Skill((Hammer(Intercept), 1)),
Skill((Hammer(CDrain), 1)), Skill((Hammer(HeavyWhorl), 1)),
Skill((Hammer(CSpeed), 1)),
// Leap Skill((Hammer(Retaliate), 1)),
Skill((Hammer(UnlockLeap), 1)), Skill((Hammer(Breach), 1)),
Skill((Hammer(LDamage), 1)), Skill((Hammer(SpineCracker), 1)),
Skill((Hammer(LCost), 1)), Skill((Hammer(HelmCrusher), 1)),
Skill((Hammer(LDistance), 1)), Skill((Hammer(LungPummel), 1)),
Skill((Hammer(PileDriver), 1)),
]) ])

View File

@ -1,23 +1,22 @@
([ ([
Group(Weapon(Hammer)), Group(Weapon(Hammer)),
// Single Strike, as single as you are Skill((Hammer(ScornfulSwipe), 1)),
Skill((Hammer(SsKnockback), 2)),
Skill((Hammer(SsDamage), 2)),
Skill((Hammer(SsRegen), 2)),
Skill((Hammer(SsSpeed), 2)),
// Charged Skill((Hammer(Tremor), 1)),
Skill((Hammer(CDamage), 2)), Skill((Hammer(VigorousBash), 1)),
Skill((Hammer(CKnockback), 2)), Skill((Hammer(Intercept), 1)),
Skill((Hammer(CDrain), 2)), Skill((Hammer(HeavyWhorl), 1)),
Skill((Hammer(CSpeed), 2)),
// Leap Skill((Hammer(Retaliate), 1)),
Skill((Hammer(UnlockLeap), 1)), Skill((Hammer(Breach), 1)),
Skill((Hammer(LDamage), 1)), Skill((Hammer(SpineCracker), 1)),
Skill((Hammer(LCost), 1)), Skill((Hammer(HelmCrusher), 1)),
Skill((Hammer(LDistance), 1)), Skill((Hammer(LungPummel), 1)),
Skill((Hammer(LKnockback), 1)), Skill((Hammer(PileDriver), 1)),
Skill((Hammer(LRange), 1)),
Skill((Hammer(IronTempest), 1)),
Skill((Hammer(Upheaval), 1)),
Skill((Hammer(Tenacity), 1)),
Skill((Hammer(Rampart), 1)),
]) ])

View File

@ -1,23 +1,27 @@
([ ([
Group(Weapon(Hammer)), Group(Weapon(Hammer)),
// Single Strike, as single as you are Skill((Hammer(ScornfulSwipe), 1)),
Skill((Hammer(SsKnockback), 2)),
Skill((Hammer(SsDamage), 3)),
Skill((Hammer(SsRegen), 2)),
Skill((Hammer(SsSpeed), 3)),
// Charged Skill((Hammer(Tremor), 1)),
Skill((Hammer(CDamage), 3)), Skill((Hammer(VigorousBash), 1)),
Skill((Hammer(CKnockback), 3)), Skill((Hammer(Intercept), 1)),
Skill((Hammer(CDrain), 2)), Skill((Hammer(HeavyWhorl), 1)),
Skill((Hammer(CSpeed), 2)),
// Leap Skill((Hammer(Retaliate), 1)),
Skill((Hammer(UnlockLeap), 1)), Skill((Hammer(Breach), 1)),
Skill((Hammer(LDamage), 2)), Skill((Hammer(SpineCracker), 1)),
Skill((Hammer(LCost), 2)), Skill((Hammer(HelmCrusher), 1)),
Skill((Hammer(LDistance), 2)), Skill((Hammer(LungPummel), 1)),
Skill((Hammer(LKnockback), 2)), Skill((Hammer(PileDriver), 1)),
Skill((Hammer(LRange), 2)),
Skill((Hammer(IronTempest), 1)),
Skill((Hammer(Upheaval), 1)),
Skill((Hammer(Tenacity), 1)),
Skill((Hammer(Rampart), 1)),
Skill((Hammer(Thunderclap), 1)),
Skill((Hammer(SeismicShock), 1)),
Skill((Hammer(Judgement), 1)),
Skill((Hammer(Earthshaker), 1)),
]) ])

View File

@ -60,23 +60,26 @@
(Axe(Capsize), 1), (Axe(Capsize), 1),
// Hammer // Hammer
(UnlockGroup(Weapon(Hammer)), 1), (UnlockGroup(Weapon(Hammer)), 1),
(Hammer(ScornfulSwipe), 1),
(Hammer(Tremor), 1),
(Hammer(VigorousBash), 1),
(Hammer(Intercept), 1),
(Hammer(HeavyWhorl), 1),
(Hammer(Retaliate), 1),
(Hammer(Breach), 1),
(Hammer(SpineCracker), 1),
(Hammer(HelmCrusher), 1),
(Hammer(LungPummel), 1),
(Hammer(PileDriver), 1),
(Hammer(IronTempest), 1),
(Hammer(Upheaval), 1),
(Hammer(Tenacity), 1),
(Hammer(Rampart), 1),
(Hammer(Thunderclap), 1),
(Hammer(SeismicShock), 1),
(Hammer(Judgement), 1),
(Hammer(Earthshaker), 1),
(Hammer(SsKnockback), 2),
(Hammer(SsDamage), 3),
(Hammer(SsRegen), 2),
(Hammer(SsSpeed), 3),
(Hammer(CDamage), 3),
(Hammer(CKnockback), 3),
(Hammer(CDrain), 2),
(Hammer(CSpeed), 2),
(Hammer(UnlockLeap), 1),
(Hammer(LDamage), 2),
(Hammer(LCost), 2),
(Hammer(LDistance), 2),
(Hammer(LKnockback), 2),
(Hammer(LRange), 2),
// Bow // Bow
(UnlockGroup(Weapon(Bow)), 1), (UnlockGroup(Weapon(Bow)), 1),
@ -149,22 +152,6 @@
// Hammer // Hammer
(UnlockGroup(Weapon(Hammer)), 1), (UnlockGroup(Weapon(Hammer)), 1),
(Hammer(SsKnockback), 1),
(Hammer(SsDamage), 2),
(Hammer(SsRegen), 2),
(Hammer(SsSpeed), 2),
(Hammer(CDamage), 2),
(Hammer(CKnockback), 1),
(Hammer(CDrain), 2),
(Hammer(CSpeed), 2),
(Hammer(UnlockLeap), 1),
(Hammer(LDamage), 2),
(Hammer(LCost), 2),
(Hammer(LDistance), 1),
(Hammer(LKnockback), 2),
(Hammer(LRange), 2),
// Bow // Bow
(UnlockGroup(Weapon(Bow)), 1), (UnlockGroup(Weapon(Bow)), 1),
@ -232,7 +219,6 @@
// Hammer // Hammer
(UnlockGroup(Weapon(Hammer)), 1), (UnlockGroup(Weapon(Hammer)), 1),
(Hammer(UnlockLeap), 1),
// Bow // Bow
(UnlockGroup(Weapon(Bow)), 1), (UnlockGroup(Weapon(Bow)), 1),

View File

@ -1919,7 +1919,6 @@ impl CharacterAbility {
#[must_use = "method returns new ability and doesn't mutate the original value"] #[must_use = "method returns new ability and doesn't mutate the original value"]
pub fn adjusted_by_skills(mut self, skillset: &SkillSet, tool: Option<ToolKind>) -> Self { pub fn adjusted_by_skills(mut self, skillset: &SkillSet, tool: Option<ToolKind>) -> Self {
match tool { match tool {
Some(ToolKind::Hammer) => self.adjusted_by_hammer_skills(skillset),
Some(ToolKind::Bow) => self.adjusted_by_bow_skills(skillset), Some(ToolKind::Bow) => self.adjusted_by_bow_skills(skillset),
Some(ToolKind::Staff) => self.adjusted_by_staff_skills(skillset), Some(ToolKind::Staff) => self.adjusted_by_staff_skills(skillset),
Some(ToolKind::Sceptre) => self.adjusted_by_sceptre_skills(skillset), Some(ToolKind::Sceptre) => self.adjusted_by_sceptre_skills(skillset),
@ -1950,108 +1949,6 @@ impl CharacterAbility {
} }
} }
fn adjusted_by_hammer_skills(&mut self, skillset: &SkillSet) {
#![allow(clippy::enum_glob_use)]
use skills::{HammerSkill::*, Skill::Hammer};
match self {
CharacterAbility::ComboMeleeDeprecated {
ref mut speed_increase,
ref mut max_speed_increase,
ref mut stage_data,
ref mut max_energy_gain,
ref mut scales_from_combo,
..
} => {
let modifiers = SKILL_MODIFIERS.hammer_tree.single_strike;
if let Ok(level) = skillset.skill_level(Hammer(SsKnockback)) {
*stage_data = (*stage_data)
.iter()
.map(|s| s.modify_strike(modifiers.knockback.powi(level.into())))
.collect::<Vec<_>>();
}
let speed_segments = f32::from(Hammer(SsSpeed).max_level());
let speed_level = f32::from(skillset.skill_level(Hammer(SsSpeed)).unwrap_or(0));
*speed_increase *= speed_level / speed_segments;
*max_speed_increase *= speed_level / speed_segments;
let energy_level = skillset.skill_level(Hammer(SsRegen)).unwrap_or(0);
let stages = u16::try_from(stage_data.len())
.expect("number of stages can't be more than u16");
*max_energy_gain *= f32::from((energy_level + 1) * stages)
/ f32::from((Hammer(SsRegen).max_level() + 1) * stages);
*scales_from_combo = skillset.skill_level(Hammer(SsDamage)).unwrap_or(0).into();
},
CharacterAbility::ChargedMelee {
ref mut energy_drain,
ref mut charge_duration,
ref mut melee_constructor,
..
} => {
let modifiers = SKILL_MODIFIERS.hammer_tree.charged;
if let Some(MeleeConstructorKind::Bash {
ref mut damage,
ref mut knockback,
..
}) = melee_constructor.scaled.as_mut().map(|scaled| scaled.kind)
{
if let Ok(level) = skillset.skill_level(Hammer(CDamage)) {
*damage *= modifiers.scaled_damage.powi(level.into());
}
if let Ok(level) = skillset.skill_level(Hammer(CKnockback)) {
*knockback *= modifiers.scaled_knockback.powi(level.into());
}
}
if let Ok(level) = skillset.skill_level(Hammer(CDrain)) {
*energy_drain *= modifiers.energy_drain.powi(level.into());
}
if let Ok(level) = skillset.skill_level(Hammer(CSpeed)) {
let charge_time = 1.0 / modifiers.charge_rate;
*charge_duration *= charge_time.powi(level.into());
}
},
CharacterAbility::LeapMelee {
ref mut energy_cost,
ref mut forward_leap_strength,
ref mut vertical_leap_strength,
ref mut melee_constructor,
..
} => {
let modifiers = SKILL_MODIFIERS.hammer_tree.leap;
if let MeleeConstructorKind::Bash {
ref mut damage,
ref mut knockback,
..
} = melee_constructor.kind
{
if let Ok(level) = skillset.skill_level(Hammer(LDamage)) {
*damage *= modifiers.base_damage.powi(level.into());
}
if let Ok(level) = skillset.skill_level(Hammer(LKnockback)) {
*knockback *= modifiers.knockback.powi(level.into());
}
}
if let Ok(level) = skillset.skill_level(Hammer(LCost)) {
*energy_cost *= modifiers.energy_cost.powi(level.into());
}
if let Ok(level) = skillset.skill_level(Hammer(LDistance)) {
let strength = modifiers.leap_strength;
*forward_leap_strength *= strength.powi(level.into());
*vertical_leap_strength *= strength.powi(level.into());
}
if let Ok(level) = skillset.skill_level(Hammer(LRange)) {
melee_constructor.range += modifiers.range * f32::from(level);
}
},
_ => {},
}
}
fn adjusted_by_bow_skills(&mut self, skillset: &SkillSet) { fn adjusted_by_bow_skills(&mut self, skillset: &SkillSet) {
#![allow(clippy::enum_glob_use)] #![allow(clippy::enum_glob_use)]
use skills::{BowSkill::*, Skill::Bow}; use skills::{BowSkill::*, Skill::Bow};

View File

@ -135,7 +135,7 @@ impl SkillGroupKind {
pub fn skill_point_cost(self, level: u16) -> u32 { pub fn skill_point_cost(self, level: u16) -> u32 {
use std::f32::consts::E; use std::f32::consts::E;
match self { match self {
Self::Weapon(ToolKind::Sword | ToolKind::Axe) => { Self::Weapon(ToolKind::Sword | ToolKind::Axe | ToolKind::Hammer) => {
let level = level as f32; let level = level as f32;
((400.0 * (level / (level + 20.0)).powi(2) + 5.0 * E.powf(0.025 * level)) ((400.0 * (level / (level + 20.0)).powi(2) + 5.0 * E.powf(0.025 * level))
.min(u32::MAX as f32) as u32) .min(u32::MAX as f32) as u32)

View File

@ -80,23 +80,25 @@ pub enum AxeSkill {
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)] #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
pub enum HammerSkill { pub enum HammerSkill {
// Single strike upgrades ScornfulSwipe,
SsKnockback, Tremor,
SsDamage, VigorousBash,
SsSpeed, Retaliate,
SsRegen, SpineCracker,
// Charged melee upgrades Breach,
CDamage, IronTempest,
CKnockback, Upheaval,
CDrain, Thunderclap,
CSpeed, SeismicShock,
// Leap upgrades HeavyWhorl,
UnlockLeap, Intercept,
LDamage, PileDriver,
LCost, LungPummel,
LDistance, HelmCrusher,
LKnockback, Rampart,
LRange, Tenacity,
Earthshaker,
Judgement,
} }
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)] #[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
@ -211,7 +213,6 @@ impl Skill {
pub const SKILL_MODIFIERS: SkillTreeModifiers = SkillTreeModifiers::get(); pub const SKILL_MODIFIERS: SkillTreeModifiers = SkillTreeModifiers::get();
pub struct SkillTreeModifiers { pub struct SkillTreeModifiers {
pub hammer_tree: HammerTreeModifiers,
pub bow_tree: BowTreeModifiers, pub bow_tree: BowTreeModifiers,
pub staff_tree: StaffTreeModifiers, pub staff_tree: StaffTreeModifiers,
pub sceptre_tree: SceptreTreeModifiers, pub sceptre_tree: SceptreTreeModifiers,
@ -222,7 +223,6 @@ pub struct SkillTreeModifiers {
impl SkillTreeModifiers { impl SkillTreeModifiers {
const fn get() -> Self { const fn get() -> Self {
Self { Self {
hammer_tree: HammerTreeModifiers::get(),
bow_tree: BowTreeModifiers::get(), bow_tree: BowTreeModifiers::get(),
staff_tree: StaffTreeModifiers::get(), staff_tree: StaffTreeModifiers::get(),
sceptre_tree: SceptreTreeModifiers::get(), sceptre_tree: SceptreTreeModifiers::get(),
@ -232,52 +232,6 @@ impl SkillTreeModifiers {
} }
} }
pub struct HammerTreeModifiers {
pub single_strike: HammerStrikeModifiers,
pub charged: HammerChargedModifers,
pub leap: HammerLeapModifiers,
}
pub struct HammerStrikeModifiers {
pub knockback: f32,
}
pub struct HammerChargedModifers {
pub scaled_damage: f32,
pub scaled_knockback: f32,
pub energy_drain: f32,
pub charge_rate: f32,
}
pub struct HammerLeapModifiers {
pub base_damage: f32,
pub knockback: f32,
pub energy_cost: f32,
pub leap_strength: f32,
pub range: f32,
}
impl HammerTreeModifiers {
const fn get() -> Self {
Self {
single_strike: HammerStrikeModifiers { knockback: 1.25 },
charged: HammerChargedModifers {
scaled_damage: 1.1,
scaled_knockback: 1.15,
energy_drain: 0.95,
charge_rate: 1.1,
},
leap: HammerLeapModifiers {
base_damage: 1.15,
knockback: 1.15,
energy_cost: 0.85,
leap_strength: 1.05,
range: 0.25,
},
}
}
}
pub struct BowTreeModifiers { pub struct BowTreeModifiers {
pub universal: BowUniversalModifiers, pub universal: BowUniversalModifiers,
pub charged: BowChargedModifiers, pub charged: BowChargedModifiers,

View File

@ -278,74 +278,7 @@ impl<'a> AgentData<'a> {
read_data: &ReadData, read_data: &ReadData,
rng: &mut impl Rng, rng: &mut impl Rng,
) { ) {
enum ActionStateTimers { // TODO
TimerHandleHammerAttack = 0,
}
let has_leap = || {
self.skill_set
.has_skill(Skill::Hammer(HammerSkill::UnlockLeap))
};
let has_energy = |need| self.energy.current() > need;
let use_leap = |controller: &mut Controller| {
controller.push_basic_input(InputKind::Ability(0));
};
if attack_data.in_min_range() && attack_data.angle < 45.0 {
controller.inputs.move_dir = Vec2::zero();
if agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] > 4.0
{
controller.push_cancel_input(InputKind::Secondary);
agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] =
0.0;
} else if agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize]
> 3.0
{
controller.push_basic_input(InputKind::Secondary);
agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] +=
read_data.dt.0;
} else if has_leap() && has_energy(50.0) && rng.gen_bool(0.9) {
use_leap(controller);
agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] +=
read_data.dt.0;
} else {
controller.push_basic_input(InputKind::Primary);
agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] +=
read_data.dt.0;
}
} else {
self.path_toward_target(
agent,
controller,
tgt_data.pos.0,
read_data,
Path::Separate,
None,
);
if attack_data.dist_sqrd < 32.0f32.powi(2)
&& has_leap()
&& has_energy(50.0)
&& entities_have_line_of_sight(
self.pos,
self.body,
self.scale,
tgt_data.pos,
tgt_data.body,
tgt_data.scale,
read_data,
)
{
use_leap(controller);
}
if self.body.map(|b| b.is_humanoid()).unwrap_or(false)
&& attack_data.dist_sqrd < 16.0f32.powi(2)
&& rng.gen::<f32>() < 0.02
{
controller.push_basic_input(InputKind::Roll);
}
}
} }
pub fn handle_sword_attack( pub fn handle_sword_attack(
@ -4609,10 +4542,6 @@ impl<'a> AgentData<'a> {
enum ActionStateTimers { enum ActionStateTimers {
TimerHandleHammerAttack = 0, TimerHandleHammerAttack = 0,
} }
let has_leap = || {
self.skill_set
.has_skill(Skill::Hammer(HammerSkill::UnlockLeap))
};
let has_energy = |need| self.energy.current() > need; let has_energy = |need| self.energy.current() > need;
@ -4633,7 +4562,7 @@ impl<'a> AgentData<'a> {
controller.push_basic_input(InputKind::Secondary); controller.push_basic_input(InputKind::Secondary);
agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] += agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] +=
read_data.dt.0; read_data.dt.0;
} else if has_leap() && has_energy(50.0) && rng.gen_bool(0.9) { } else if has_energy(50.0) && rng.gen_bool(0.9) {
use_leap(controller); use_leap(controller);
agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] += agent.combat_state.timers[ActionStateTimers::TimerHandleHammerAttack as usize] +=
read_data.dt.0; read_data.dt.0;
@ -4653,7 +4582,6 @@ impl<'a> AgentData<'a> {
); );
if attack_data.dist_sqrd < 32.0f32.powi(2) if attack_data.dist_sqrd < 32.0f32.powi(2)
&& has_leap()
&& has_energy(50.0) && has_energy(50.0)
&& entities_have_line_of_sight( && entities_have_line_of_sight(
self.pos, self.pos,

View File

@ -86,23 +86,6 @@ widget_ids! {
skill_lock_imgs[], skill_lock_imgs[],
sword_bg, sword_bg,
axe_bg, axe_bg,
hammer_render,
skill_hammer_combo_0,
skill_hammer_combo_1,
skill_hammer_combo_2,
skill_hammer_combo_3,
skill_hammer_combo_4,
skill_hammer_charged_0,
skill_hammer_charged_1,
skill_hammer_charged_2,
skill_hammer_charged_3,
skill_hammer_charged_4,
skill_hammer_leap_0,
skill_hammer_leap_1,
skill_hammer_leap_2,
skill_hammer_leap_3,
skill_hammer_leap_4,
skill_hammer_leap_5,
bow_render, bow_render,
skill_bow_charged_0, skill_bow_charged_0,
skill_bow_charged_1, skill_bow_charged_1,
@ -1809,154 +1792,12 @@ impl<'a> Diary<'a> {
ui: &mut UiCell, ui: &mut UiCell,
mut events: Vec<Event>, mut events: Vec<Event>,
) -> Vec<Event> { ) -> Vec<Event> {
// Title text // use skills::HammerSkill::*;
let tree_title = &self.localized_strings.get_msg("common-weapons-hammer"); // let skill_buttons = &[
// ];
Text::new(tree_title) // self.handle_skill_buttons(skill_buttons, ui, &mut events, diary_tooltip,
.mid_top_with_margin_on(state.ids.content_align, 2.0) // state);
.font_id(self.fonts.cyri.conrod_id)
.font_size(self.fonts.cyri.scale(34))
.color(TEXT_COLOR)
.set(state.ids.tree_title_txt, ui);
// Number of skills per rectangle per weapon, start counting at 0
// Maximum of 9 skills/8 indices
let skills_top_l = 5;
let skills_top_r = 5;
let skills_bot_l = 6;
let skills_bot_r = 0;
self.setup_state_for_skill_icons(
state,
ui,
skills_top_l,
skills_top_r,
skills_bot_l,
skills_bot_r,
);
// Skill icons and buttons
use skills::HammerSkill::*;
// Hammer
Image::new(animate_by_pulse(
&self
.item_imgs
.img_ids_or_not_found_img(ItemKey::Simple("example_hammer".to_string())),
self.pulse,
))
.wh(ART_SIZE)
.middle_of(state.ids.content_align)
.color(Some(Color::Rgba(1.0, 1.0, 1.0, 1.0)))
.set(state.ids.hammer_render, ui);
use PositionSpecifier::MidTopWithMarginOn;
let skill_buttons = &[
// Top Left skills
// 5 1 6
// 3 0 4
// 8 2 7
SkillIcon::Descriptive {
title: "hud-skill-hmr_single_strike_title",
desc: "hud-skill-hmr_single_strike",
image: self.imgs.twohhammer_m1,
position: MidTopWithMarginOn(state.ids.skills_top_l[0], 3.0),
id: state.ids.skill_hammer_combo_0,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(SsKnockback),
image: self.imgs.physical_knockback_skill,
position: MidTopWithMarginOn(state.ids.skills_top_l[1], 3.0),
id: state.ids.skill_hammer_combo_1,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(SsDamage),
image: self.imgs.physical_damage_skill,
position: MidTopWithMarginOn(state.ids.skills_top_l[2], 3.0),
id: state.ids.skill_hammer_combo_2,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(SsSpeed),
image: self.imgs.physical_speed_skill,
position: MidTopWithMarginOn(state.ids.skills_top_l[3], 3.0),
id: state.ids.skill_hammer_combo_3,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(SsRegen),
image: self.imgs.physical_energy_regen_skill,
position: MidTopWithMarginOn(state.ids.skills_top_l[4], 3.0),
id: state.ids.skill_hammer_combo_4,
},
// Top right skills
SkillIcon::Descriptive {
title: "hud-skill-hmr_charged_melee_title",
desc: "hud-skill-hmr_charged_melee",
image: self.imgs.hammergolf,
position: MidTopWithMarginOn(state.ids.skills_top_r[0], 3.0),
id: state.ids.skill_hammer_charged_0,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(CKnockback),
image: self.imgs.physical_knockback_skill,
position: MidTopWithMarginOn(state.ids.skills_top_r[1], 3.0),
id: state.ids.skill_hammer_charged_1,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(CDamage),
image: self.imgs.physical_damage_skill,
position: MidTopWithMarginOn(state.ids.skills_top_r[2], 3.0),
id: state.ids.skill_hammer_charged_2,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(CDrain),
image: self.imgs.physical_energy_drain_skill,
position: MidTopWithMarginOn(state.ids.skills_top_r[3], 3.0),
id: state.ids.skill_hammer_charged_3,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(CSpeed),
image: self.imgs.physical_amount_skill,
position: MidTopWithMarginOn(state.ids.skills_top_r[4], 3.0),
id: state.ids.skill_hammer_charged_4,
},
// Bottom left skills
SkillIcon::Unlockable {
skill: Skill::Hammer(UnlockLeap),
image: self.imgs.hammerleap,
position: MidTopWithMarginOn(state.ids.skills_bot_l[0], 3.0),
id: state.ids.skill_hammer_leap_0,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(LDamage),
image: self.imgs.physical_damage_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_l[1], 3.0),
id: state.ids.skill_hammer_leap_1,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(LKnockback),
image: self.imgs.physical_knockback_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_l[2], 3.0),
id: state.ids.skill_hammer_leap_2,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(LCost),
image: self.imgs.physical_cost_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_l[3], 3.0),
id: state.ids.skill_hammer_leap_3,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(LDistance),
image: self.imgs.physical_distance_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_l[4], 3.0),
id: state.ids.skill_hammer_leap_4,
},
SkillIcon::Unlockable {
skill: Skill::Hammer(LRange),
image: self.imgs.physical_radius_skill,
position: MidTopWithMarginOn(state.ids.skills_bot_l[5], 3.0),
id: state.ids.skill_hammer_leap_5,
},
];
self.handle_skill_buttons(skill_buttons, ui, &mut events, diary_tooltip, state);
events events
} }
@ -2812,7 +2653,6 @@ fn skill_strings(skill: Skill) -> SkillStrings<'static> {
// general tree // general tree
Skill::UnlockGroup(s) => unlock_skill_strings(s), Skill::UnlockGroup(s) => unlock_skill_strings(s),
// weapon trees // weapon trees
Skill::Hammer(s) => hammer_skill_strings(s),
Skill::Bow(s) => bow_skill_strings(s), Skill::Bow(s) => bow_skill_strings(s),
Skill::Staff(s) => staff_skill_strings(s), Skill::Staff(s) => staff_skill_strings(s),
Skill::Sceptre(s) => sceptre_skill_strings(s), Skill::Sceptre(s) => sceptre_skill_strings(s),
@ -2865,81 +2705,6 @@ fn unlock_skill_strings(group: SkillGroupKind) -> SkillStrings<'static> {
} }
} }
fn hammer_skill_strings(skill: HammerSkill) -> SkillStrings<'static> {
let modifiers = SKILL_MODIFIERS.hammer_tree;
// Single strike upgrades
match skill {
HammerSkill::SsKnockback => SkillStrings::with_mult(
"hud-skill-hmr_single_strike_knockback_title",
"hud-skill-hmr_single_strike_knockback",
modifiers.single_strike.knockback,
),
HammerSkill::SsDamage => SkillStrings::plain(
"hud-skill-hmr_single_strike_damage_title",
"hud-skill-hmr_single_strike_damage",
),
HammerSkill::SsSpeed => SkillStrings::plain(
"hud-skill-hmr_single_strike_speed_title",
"hud-skill-hmr_single_strike_speed",
),
HammerSkill::SsRegen => SkillStrings::plain(
"hud-skill-hmr_single_strike_regen_title",
"hud-skill-hmr_single_strike_regen",
),
// Charged melee upgrades
HammerSkill::CDamage => SkillStrings::with_mult(
"hud-skill-hmr_charged_melee_damage_title",
"hud-skill-hmr_charged_melee_damage",
modifiers.charged.scaled_damage,
),
HammerSkill::CKnockback => SkillStrings::with_mult(
"hud-skill-hmr_charged_melee_knockback_title",
"hud-skill-hmr_charged_melee_knockback",
modifiers.charged.scaled_knockback,
),
HammerSkill::CDrain => SkillStrings::with_mult(
"hud-skill-hmr_charged_melee_nrg_drain_title",
"hud-skill-hmr_charged_melee_nrg_drain",
modifiers.charged.energy_drain,
),
HammerSkill::CSpeed => SkillStrings::with_mult(
"hud-skill-hmr_charged_rate_title",
"hud-skill-hmr_charged_rate",
modifiers.charged.charge_rate,
),
// Leap upgrades
HammerSkill::UnlockLeap => SkillStrings::plain(
"hud-skill-hmr_unlock_leap_title",
"hud-skill-hmr_unlock_leap",
),
HammerSkill::LDamage => SkillStrings::with_mult(
"hud-skill-hmr_leap_damage_title",
"hud-skill-hmr_leap_damage",
modifiers.leap.base_damage,
),
HammerSkill::LCost => SkillStrings::with_mult(
"hud-skill-hmr_leap_cost_title",
"hud-skill-hmr_leap_cost",
modifiers.leap.energy_cost,
),
HammerSkill::LDistance => SkillStrings::with_mult(
"hud-skill-hmr_leap_distance_title",
"hud-skill-hmr_leap_distance",
modifiers.leap.leap_strength,
),
HammerSkill::LKnockback => SkillStrings::with_mult(
"hud-skill-hmr_leap_knockback_title",
"hud-skill-hmr_leap_knockback",
modifiers.leap.knockback,
),
HammerSkill::LRange => SkillStrings::with_const_float(
"hud-skill-hmr_leap_radius_title",
"hud-skill-hmr_leap_radius",
modifiers.leap.range,
),
}
}
fn bow_skill_strings(skill: BowSkill) -> SkillStrings<'static> { fn bow_skill_strings(skill: BowSkill) -> SkillStrings<'static> {
let modifiers = SKILL_MODIFIERS.bow_tree; let modifiers = SKILL_MODIFIERS.bow_tree;
match skill { match skill {