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
aa60081ec7
commit
572072608b
@ -11,7 +11,7 @@ ItemDef(
|
|||||||
poise_strength: 999.9,
|
poise_strength: 999.9,
|
||||||
speed: 1.0,
|
speed: 1.0,
|
||||||
crit_chance: 0.5,
|
crit_chance: 0.5,
|
||||||
range: 10.0,
|
range: 1.0,
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
@ -10,7 +10,7 @@ ItemDef(
|
|||||||
poise_strength: 999.9,
|
poise_strength: 999.9,
|
||||||
speed: 100.0,
|
speed: 100.0,
|
||||||
crit_chance: 0.5,
|
crit_chance: 0.5,
|
||||||
range: 10.0,
|
range: 1.0,
|
||||||
)),
|
)),
|
||||||
)),
|
)),
|
||||||
quality: Debug,
|
quality: Debug,
|
||||||
|
@ -15,5 +15,5 @@ ItemDef(
|
|||||||
)),
|
)),
|
||||||
quality: Low,
|
quality: Low,
|
||||||
tags: [],
|
tags: [],
|
||||||
ability_spec: None,
|
ability_spec: Some(Custom("Staff Simple")),
|
||||||
)
|
)
|
@ -110,7 +110,7 @@ mod tests {
|
|||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn tresolve() {
|
async fn tresolve() {
|
||||||
let args = resolve("google.com", false).await.expect("resolve failed");
|
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);
|
assert_eq!(args[0].port(), 14004);
|
||||||
|
|
||||||
let args = resolve("127.0.0.1", false).await.expect("resolve failed");
|
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 {
|
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::*;
|
use CharacterAbility::*;
|
||||||
match self {
|
match self {
|
||||||
BasicMelee {
|
BasicMelee {
|
||||||
@ -418,12 +414,12 @@ impl CharacterAbility {
|
|||||||
ref mut range,
|
ref mut range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*swing_duration /= speed;
|
*swing_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*base_damage *= power;
|
*base_damage *= stats.power;
|
||||||
*base_poise_damage *= poise_strength;
|
*base_poise_damage *= stats.poise_strength;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
},
|
},
|
||||||
BasicRanged {
|
BasicRanged {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -432,10 +428,10 @@ impl CharacterAbility {
|
|||||||
ref mut projectile_speed,
|
ref mut projectile_speed,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*projectile = projectile.modified_projectile(power, 1_f32, 1_f32);
|
*projectile = projectile.modified_projectile(stats.power, 1_f32, 1_f32);
|
||||||
*projectile_speed *= range_mult;
|
*projectile_speed *= stats.range;
|
||||||
},
|
},
|
||||||
RepeaterRanged {
|
RepeaterRanged {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -445,19 +441,19 @@ impl CharacterAbility {
|
|||||||
ref mut projectile_speed,
|
ref mut projectile_speed,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*shoot_duration /= speed;
|
*shoot_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*projectile = projectile.modified_projectile(power, 1_f32, 1_f32);
|
*projectile = projectile.modified_projectile(stats.power, 1_f32, 1_f32);
|
||||||
*projectile_speed *= range_mult;
|
*projectile_speed *= stats.range;
|
||||||
},
|
},
|
||||||
Boost {
|
Boost {
|
||||||
ref mut movement_duration,
|
ref mut movement_duration,
|
||||||
speed: ref mut boost_speed,
|
speed: ref mut boost_speed,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*movement_duration /= speed;
|
*movement_duration /= stats.speed;
|
||||||
*boost_speed *= power;
|
*boost_speed *= stats.power;
|
||||||
},
|
},
|
||||||
DashMelee {
|
DashMelee {
|
||||||
ref mut base_damage,
|
ref mut base_damage,
|
||||||
@ -470,14 +466,14 @@ impl CharacterAbility {
|
|||||||
ref mut range,
|
ref mut range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*base_damage *= power;
|
*base_damage *= stats.power;
|
||||||
*scaled_damage *= power;
|
*scaled_damage *= stats.power;
|
||||||
*base_poise_damage *= poise_strength;
|
*base_poise_damage *= stats.poise_strength;
|
||||||
*scaled_poise_damage *= poise_strength;
|
*scaled_poise_damage *= stats.poise_strength;
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*swing_duration /= speed;
|
*swing_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
},
|
},
|
||||||
BasicBlock {
|
BasicBlock {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -486,8 +482,8 @@ impl CharacterAbility {
|
|||||||
* Do we want angle to be adjusted by range? */
|
* Do we want angle to be adjusted by range? */
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
},
|
},
|
||||||
Roll {
|
Roll {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -495,9 +491,9 @@ impl CharacterAbility {
|
|||||||
ref mut recover_duration,
|
ref mut recover_duration,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*movement_duration /= speed;
|
*movement_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
},
|
},
|
||||||
ComboMelee {
|
ComboMelee {
|
||||||
ref mut stage_data, ..
|
ref mut stage_data, ..
|
||||||
@ -516,12 +512,12 @@ impl CharacterAbility {
|
|||||||
ref mut range,
|
ref mut range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*swing_duration /= speed;
|
*swing_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*base_damage *= power;
|
*base_damage *= stats.power;
|
||||||
*base_poise_damage *= poise_strength;
|
*base_poise_damage *= stats.poise_strength;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
},
|
},
|
||||||
SpinMelee {
|
SpinMelee {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -532,12 +528,12 @@ impl CharacterAbility {
|
|||||||
ref mut range,
|
ref mut range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*swing_duration /= speed;
|
*swing_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*base_damage *= power;
|
*base_damage *= stats.power;
|
||||||
*base_poise_damage *= poise_strength;
|
*base_poise_damage *= stats.poise_strength;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
},
|
},
|
||||||
ChargedMelee {
|
ChargedMelee {
|
||||||
ref mut initial_damage,
|
ref mut initial_damage,
|
||||||
@ -551,15 +547,15 @@ impl CharacterAbility {
|
|||||||
ref mut range,
|
ref mut range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*initial_damage *= power;
|
*initial_damage *= stats.power;
|
||||||
*scaled_damage *= power;
|
*scaled_damage *= stats.power;
|
||||||
*initial_poise_damage *= poise_strength;
|
*initial_poise_damage *= stats.poise_strength;
|
||||||
*scaled_poise_damage *= poise_strength;
|
*scaled_poise_damage *= stats.poise_strength;
|
||||||
*ability_speed *= speed;
|
*ability_speed *= stats.speed;
|
||||||
*charge_duration /= speed;
|
*charge_duration /= stats.speed;
|
||||||
*swing_duration /= speed;
|
*swing_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
},
|
},
|
||||||
ChargedRanged {
|
ChargedRanged {
|
||||||
ref mut initial_damage,
|
ref mut initial_damage,
|
||||||
@ -572,14 +568,14 @@ impl CharacterAbility {
|
|||||||
ref mut scaled_projectile_speed,
|
ref mut scaled_projectile_speed,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*initial_damage *= power;
|
*initial_damage *= stats.power;
|
||||||
*scaled_damage *= power;
|
*scaled_damage *= stats.power;
|
||||||
*ability_speed *= speed;
|
*ability_speed *= stats.speed;
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*charge_duration /= speed;
|
*charge_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*initial_projectile_speed *= range_mult;
|
*initial_projectile_speed *= stats.range;
|
||||||
*scaled_projectile_speed *= range_mult;
|
*scaled_projectile_speed *= stats.range;
|
||||||
},
|
},
|
||||||
Shockwave {
|
Shockwave {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -590,12 +586,12 @@ impl CharacterAbility {
|
|||||||
ref mut shockwave_duration,
|
ref mut shockwave_duration,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*swing_duration /= speed;
|
*swing_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*damage *= power;
|
*damage *= stats.power;
|
||||||
*poise_damage *= poise_strength;
|
*poise_damage *= stats.poise_strength;
|
||||||
*shockwave_duration *= range_mult;
|
*shockwave_duration *= stats.range;
|
||||||
},
|
},
|
||||||
BasicBeam {
|
BasicBeam {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -603,13 +599,16 @@ impl CharacterAbility {
|
|||||||
ref mut damage,
|
ref mut damage,
|
||||||
ref mut tick_rate,
|
ref mut tick_rate,
|
||||||
ref mut range,
|
ref mut range,
|
||||||
|
ref mut beam_duration,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*damage *= power;
|
*damage *= stats.power;
|
||||||
*tick_rate *= speed;
|
*tick_rate *= stats.speed;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
|
// Duration modified to keep velocity constant
|
||||||
|
*beam_duration *= stats.range;
|
||||||
},
|
},
|
||||||
BasicAura {
|
BasicAura {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -619,11 +618,11 @@ impl CharacterAbility {
|
|||||||
ref mut range,
|
ref mut range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*cast_duration /= speed;
|
*cast_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
aura.strength *= power;
|
aura.strength *= stats.power;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
},
|
},
|
||||||
HealingBeam {
|
HealingBeam {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -633,11 +632,11 @@ impl CharacterAbility {
|
|||||||
ref mut range,
|
ref mut range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*heal *= power;
|
*heal *= stats.power;
|
||||||
*tick_rate *= speed;
|
*tick_rate *= stats.speed;
|
||||||
*range *= range_mult;
|
*range *= stats.range;
|
||||||
},
|
},
|
||||||
Blink {
|
Blink {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -645,9 +644,9 @@ impl CharacterAbility {
|
|||||||
ref mut max_range,
|
ref mut max_range,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
*max_range *= range_mult;
|
*max_range *= stats.range;
|
||||||
},
|
},
|
||||||
BasicSummon {
|
BasicSummon {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -657,11 +656,11 @@ impl CharacterAbility {
|
|||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
// TODO: Figure out how/if power should affect this
|
// TODO: Figure out how/if power should affect this
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*cast_duration /= speed;
|
*cast_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
summon_distance.0 *= range_mult;
|
summon_distance.0 *= stats.range;
|
||||||
summon_distance.1 *= range_mult;
|
summon_distance.1 *= stats.range;
|
||||||
},
|
},
|
||||||
SelfBuff {
|
SelfBuff {
|
||||||
ref mut buff_strength,
|
ref mut buff_strength,
|
||||||
@ -670,10 +669,10 @@ impl CharacterAbility {
|
|||||||
ref mut recover_duration,
|
ref mut recover_duration,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
*buff_strength *= power;
|
*buff_strength *= stats.power;
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*cast_duration /= speed;
|
*cast_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
},
|
},
|
||||||
SpriteSummon {
|
SpriteSummon {
|
||||||
ref mut buildup_duration,
|
ref mut buildup_duration,
|
||||||
@ -683,11 +682,11 @@ impl CharacterAbility {
|
|||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
// TODO: Figure out how/if power should affect this
|
// TODO: Figure out how/if power should affect this
|
||||||
*buildup_duration /= speed;
|
*buildup_duration /= stats.speed;
|
||||||
*cast_duration /= speed;
|
*cast_duration /= stats.speed;
|
||||||
*recover_duration /= speed;
|
*recover_duration /= stats.speed;
|
||||||
summon_distance.0 *= range_mult;
|
summon_distance.0 *= stats.range;
|
||||||
summon_distance.1 *= range_mult;
|
summon_distance.1 *= stats.range;
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
self
|
self
|
||||||
|
Loading…
x
Reference in New Issue
Block a user