mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Addressed review comments. Removed individual stat assignments.
This commit is contained in:
parent
e8e953ffab
commit
1c3bd13afa
@ -3,7 +3,7 @@ ItemDef(
|
||||
description: "Shouldn't this be a hammer?",
|
||||
kind: Tool(
|
||||
(
|
||||
kind: Sword,
|
||||
kind: Sword,
|
||||
hands: Two,
|
||||
stats: Direct((
|
||||
equip_time_secs: 0.0,
|
||||
@ -11,8 +11,8 @@ ItemDef(
|
||||
poise_strength: 999.9,
|
||||
speed: 1.0,
|
||||
crit_chance: 0.5,
|
||||
range: 10.0,
|
||||
)),
|
||||
range: 1.0,
|
||||
)),
|
||||
)
|
||||
),
|
||||
quality: Debug,
|
||||
|
@ -10,8 +10,8 @@ ItemDef(
|
||||
poise_strength: 999.9,
|
||||
speed: 100.0,
|
||||
crit_chance: 0.5,
|
||||
range: 10.0,
|
||||
)),
|
||||
range: 1.0,
|
||||
)),
|
||||
)),
|
||||
quality: Debug,
|
||||
tags: [],
|
||||
|
@ -15,5 +15,5 @@ ItemDef(
|
||||
)),
|
||||
quality: Low,
|
||||
tags: [],
|
||||
ability_spec: None,
|
||||
ability_spec: Some(Custom("Staff Simple")),
|
||||
)
|
@ -110,7 +110,7 @@ mod tests {
|
||||
#[tokio::test]
|
||||
async fn tresolve() {
|
||||
let args = resolve("google.com", false).await.expect("resolve failed");
|
||||
// assert!(args.len() == 1 || args.len() == 2);
|
||||
assert!(args.len() == 1 || args.len() == 2);
|
||||
assert_eq!(args[0].port(), 14004);
|
||||
|
||||
let args = resolve("127.0.0.1", false).await.expect("resolve failed");
|
||||
|
@ -403,10 +403,6 @@ impl CharacterAbility {
|
||||
}
|
||||
|
||||
pub fn adjusted_by_stats(mut self, stats: Stats) -> Self {
|
||||
let power = stats.power;
|
||||
let speed = stats.speed;
|
||||
let poise_strength = stats.poise_strength;
|
||||
let range_mult = stats.range;
|
||||
use CharacterAbility::*;
|
||||
match self {
|
||||
BasicMelee {
|
||||
@ -418,12 +414,12 @@ impl CharacterAbility {
|
||||
ref mut range,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*swing_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*base_damage *= power;
|
||||
*base_poise_damage *= poise_strength;
|
||||
*range *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*swing_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*base_damage *= stats.power;
|
||||
*base_poise_damage *= stats.poise_strength;
|
||||
*range *= stats.range;
|
||||
},
|
||||
BasicRanged {
|
||||
ref mut buildup_duration,
|
||||
@ -432,10 +428,10 @@ impl CharacterAbility {
|
||||
ref mut projectile_speed,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*projectile = projectile.modified_projectile(power, 1_f32, 1_f32);
|
||||
*projectile_speed *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*projectile = projectile.modified_projectile(stats.power, 1_f32, 1_f32);
|
||||
*projectile_speed *= stats.range;
|
||||
},
|
||||
RepeaterRanged {
|
||||
ref mut buildup_duration,
|
||||
@ -445,19 +441,19 @@ impl CharacterAbility {
|
||||
ref mut projectile_speed,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*shoot_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*projectile = projectile.modified_projectile(power, 1_f32, 1_f32);
|
||||
*projectile_speed *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*shoot_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*projectile = projectile.modified_projectile(stats.power, 1_f32, 1_f32);
|
||||
*projectile_speed *= stats.range;
|
||||
},
|
||||
Boost {
|
||||
ref mut movement_duration,
|
||||
speed: ref mut boost_speed,
|
||||
..
|
||||
} => {
|
||||
*movement_duration /= speed;
|
||||
*boost_speed *= power;
|
||||
*movement_duration /= stats.speed;
|
||||
*boost_speed *= stats.power;
|
||||
},
|
||||
DashMelee {
|
||||
ref mut base_damage,
|
||||
@ -470,14 +466,14 @@ impl CharacterAbility {
|
||||
ref mut range,
|
||||
..
|
||||
} => {
|
||||
*base_damage *= power;
|
||||
*scaled_damage *= power;
|
||||
*base_poise_damage *= poise_strength;
|
||||
*scaled_poise_damage *= poise_strength;
|
||||
*buildup_duration /= speed;
|
||||
*swing_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*range *= range_mult;
|
||||
*base_damage *= stats.power;
|
||||
*scaled_damage *= stats.power;
|
||||
*base_poise_damage *= stats.poise_strength;
|
||||
*scaled_poise_damage *= stats.poise_strength;
|
||||
*buildup_duration /= stats.speed;
|
||||
*swing_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*range *= stats.range;
|
||||
},
|
||||
BasicBlock {
|
||||
ref mut buildup_duration,
|
||||
@ -486,8 +482,8 @@ impl CharacterAbility {
|
||||
* Do we want angle to be adjusted by range? */
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*buildup_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
},
|
||||
Roll {
|
||||
ref mut buildup_duration,
|
||||
@ -495,9 +491,9 @@ impl CharacterAbility {
|
||||
ref mut recover_duration,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*movement_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*buildup_duration /= stats.speed;
|
||||
*movement_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
},
|
||||
ComboMelee {
|
||||
ref mut stage_data, ..
|
||||
@ -516,12 +512,12 @@ impl CharacterAbility {
|
||||
ref mut range,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*swing_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*base_damage *= power;
|
||||
*base_poise_damage *= poise_strength;
|
||||
*range *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*swing_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*base_damage *= stats.power;
|
||||
*base_poise_damage *= stats.poise_strength;
|
||||
*range *= stats.range;
|
||||
},
|
||||
SpinMelee {
|
||||
ref mut buildup_duration,
|
||||
@ -532,12 +528,12 @@ impl CharacterAbility {
|
||||
ref mut range,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*swing_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*base_damage *= power;
|
||||
*base_poise_damage *= poise_strength;
|
||||
*range *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*swing_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*base_damage *= stats.power;
|
||||
*base_poise_damage *= stats.poise_strength;
|
||||
*range *= stats.range;
|
||||
},
|
||||
ChargedMelee {
|
||||
ref mut initial_damage,
|
||||
@ -551,15 +547,15 @@ impl CharacterAbility {
|
||||
ref mut range,
|
||||
..
|
||||
} => {
|
||||
*initial_damage *= power;
|
||||
*scaled_damage *= power;
|
||||
*initial_poise_damage *= poise_strength;
|
||||
*scaled_poise_damage *= poise_strength;
|
||||
*ability_speed *= speed;
|
||||
*charge_duration /= speed;
|
||||
*swing_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*range *= range_mult;
|
||||
*initial_damage *= stats.power;
|
||||
*scaled_damage *= stats.power;
|
||||
*initial_poise_damage *= stats.poise_strength;
|
||||
*scaled_poise_damage *= stats.poise_strength;
|
||||
*ability_speed *= stats.speed;
|
||||
*charge_duration /= stats.speed;
|
||||
*swing_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*range *= stats.range;
|
||||
},
|
||||
ChargedRanged {
|
||||
ref mut initial_damage,
|
||||
@ -572,14 +568,14 @@ impl CharacterAbility {
|
||||
ref mut scaled_projectile_speed,
|
||||
..
|
||||
} => {
|
||||
*initial_damage *= power;
|
||||
*scaled_damage *= power;
|
||||
*ability_speed *= speed;
|
||||
*buildup_duration /= speed;
|
||||
*charge_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*initial_projectile_speed *= range_mult;
|
||||
*scaled_projectile_speed *= range_mult;
|
||||
*initial_damage *= stats.power;
|
||||
*scaled_damage *= stats.power;
|
||||
*ability_speed *= stats.speed;
|
||||
*buildup_duration /= stats.speed;
|
||||
*charge_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*initial_projectile_speed *= stats.range;
|
||||
*scaled_projectile_speed *= stats.range;
|
||||
},
|
||||
Shockwave {
|
||||
ref mut buildup_duration,
|
||||
@ -590,12 +586,12 @@ impl CharacterAbility {
|
||||
ref mut shockwave_duration,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*swing_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*damage *= power;
|
||||
*poise_damage *= poise_strength;
|
||||
*shockwave_duration *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*swing_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*damage *= stats.power;
|
||||
*poise_damage *= stats.poise_strength;
|
||||
*shockwave_duration *= stats.range;
|
||||
},
|
||||
BasicBeam {
|
||||
ref mut buildup_duration,
|
||||
@ -603,13 +599,16 @@ impl CharacterAbility {
|
||||
ref mut damage,
|
||||
ref mut tick_rate,
|
||||
ref mut range,
|
||||
ref mut beam_duration,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*damage *= power;
|
||||
*tick_rate *= speed;
|
||||
*range *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*damage *= stats.power;
|
||||
*tick_rate *= stats.speed;
|
||||
*range *= stats.range;
|
||||
// Duration modified to keep velocity constant
|
||||
*beam_duration *= stats.range;
|
||||
},
|
||||
BasicAura {
|
||||
ref mut buildup_duration,
|
||||
@ -619,11 +618,11 @@ impl CharacterAbility {
|
||||
ref mut range,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*cast_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
aura.strength *= power;
|
||||
*range *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*cast_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
aura.strength *= stats.power;
|
||||
*range *= stats.range;
|
||||
},
|
||||
HealingBeam {
|
||||
ref mut buildup_duration,
|
||||
@ -633,11 +632,11 @@ impl CharacterAbility {
|
||||
ref mut range,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*heal *= power;
|
||||
*tick_rate *= speed;
|
||||
*range *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*heal *= stats.power;
|
||||
*tick_rate *= stats.speed;
|
||||
*range *= stats.range;
|
||||
},
|
||||
Blink {
|
||||
ref mut buildup_duration,
|
||||
@ -645,9 +644,9 @@ impl CharacterAbility {
|
||||
ref mut max_range,
|
||||
..
|
||||
} => {
|
||||
*buildup_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*max_range *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
*max_range *= stats.range;
|
||||
},
|
||||
BasicSummon {
|
||||
ref mut buildup_duration,
|
||||
@ -657,11 +656,11 @@ impl CharacterAbility {
|
||||
..
|
||||
} => {
|
||||
// TODO: Figure out how/if power should affect this
|
||||
*buildup_duration /= speed;
|
||||
*cast_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
summon_distance.0 *= range_mult;
|
||||
summon_distance.1 *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*cast_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
summon_distance.0 *= stats.range;
|
||||
summon_distance.1 *= stats.range;
|
||||
},
|
||||
SelfBuff {
|
||||
ref mut buff_strength,
|
||||
@ -670,10 +669,10 @@ impl CharacterAbility {
|
||||
ref mut recover_duration,
|
||||
..
|
||||
} => {
|
||||
*buff_strength *= power;
|
||||
*buildup_duration /= speed;
|
||||
*cast_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
*buff_strength *= stats.power;
|
||||
*buildup_duration /= stats.speed;
|
||||
*cast_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
},
|
||||
SpriteSummon {
|
||||
ref mut buildup_duration,
|
||||
@ -683,11 +682,11 @@ impl CharacterAbility {
|
||||
..
|
||||
} => {
|
||||
// TODO: Figure out how/if power should affect this
|
||||
*buildup_duration /= speed;
|
||||
*cast_duration /= speed;
|
||||
*recover_duration /= speed;
|
||||
summon_distance.0 *= range_mult;
|
||||
summon_distance.1 *= range_mult;
|
||||
*buildup_duration /= stats.speed;
|
||||
*cast_duration /= stats.speed;
|
||||
*recover_duration /= stats.speed;
|
||||
summon_distance.0 *= stats.range;
|
||||
summon_distance.1 *= stats.range;
|
||||
},
|
||||
}
|
||||
self
|
||||
|
Loading…
Reference in New Issue
Block a user