Unlock dodge roll iframes and staff explosion by default.

This commit is contained in:
Avi Weinstock 2021-04-17 19:45:43 -04:00
parent bf6c22462f
commit 0404250300
19 changed files with 62 additions and 151 deletions

View File

@ -60,6 +60,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- International keyboards can now display more key names on Linux and Windows instead of `Unknown`.
- There is now a brief period after a character leaves the world where they cannot rejoin until their data is saved
- Certain uses of client-authoritative physics now subject the player to server-authoritative physics.
- Dodge roll iframes and staff explosion are now unlocked by default, with points refunded for existing characters.
### Removed

View File

@ -4,7 +4,7 @@ BasicRanged(
recover_duration: 0.35,
projectile: Fireball(
damage: 100.0,
radius: 5.0,
radius: 4.0,
energy_regen: 50,
),
projectile_body: Object(BoltFire),

View File

@ -49,7 +49,7 @@
Bow(RCost): Some(2),
Staff(BDamage): Some(3),
Staff(BRegen): Some(2),
Staff(BRadius): Some(2),
Staff(BRadius): Some(3),
Staff(FRange): Some(2),
Staff(FDamage): Some(3),
Staff(FDrain): Some(2),

View File

@ -8,7 +8,6 @@
UnlockGroup(Weapon(Bow)),
UnlockGroup(Weapon(Staff)),
UnlockGroup(Weapon(Sceptre)),
Roll(ImmuneMelee),
Roll(Cost),
Roll(Strength),
Roll(Duration),
@ -83,7 +82,6 @@
Bow(RCost),
],
Weapon(Staff): [
Staff(BExplosion),
Staff(BDamage),
Staff(BRegen),
Staff(BRadius),

View File

@ -92,7 +92,7 @@
"hud.skill.st_flamethrower_damage_title" : "Miotacz ognia - obrażenia",
"hud.skill.st_flamethrower_damage" : "Zwiększa obrażenia o 30%{SP}",
"hud.skill.st_explosion_radius_title" : "Eksplozja - rozmiar",
"hud.skill.st_explosion_radius" : "Rozmiar ma znaczenie, szczególnie gdy walczysz z wieloma przeciwnikami,\nzwiększa wielkość eksplozji o 10%{SP}",
"hud.skill.st_explosion_radius" : "Rozmiar ma znaczenie, szczególnie gdy walczysz z wieloma przeciwnikami,\nzwiększa wielkość eksplozji o 15%{SP}",
"hud.skill.st_stamina_regen_title" : "Regeneracja Wytrzymałości",
"hud.skill.st_stamina_regen" : "Zwiększa regenerację Wytrzymałości o 20%{SP}",
"hud.skill.st_fireball_title" : "Kula ognia",

View File

@ -26,7 +26,7 @@
"hud.skill.unlck_sceptre_title": "Unlock Sceptre",
"hud.skill.unlck_sceptre": "Unlocks sceptre skill tree{SP}",
"hud.skill.dodge_title": "Dodge",
"hud.skill.dodge": "Dodging avoids melee attacks{SP}",
"hud.skill.dodge": "Dodge rolls are triggered with middle-click, and grant temporary immunity to melee attacks (iframes) while you're rolling.",
"hud.skill.roll_stamina_title": "Roll Stamina Cost",
"hud.skill.roll_stamina": "Rolling uses 10% less stamina{SP}",
"hud.skill.roll_speed_title": "Rolling Speed",
@ -94,15 +94,13 @@
"hud.skill.st_flamethrower_damage_title" : "Flamethrower Damage",
"hud.skill.st_flamethrower_damage" : "Increases damage by 30%{SP}",
"hud.skill.st_explosion_radius_title" : "Explosion Radius",
"hud.skill.st_explosion_radius" : "Bigger is better, increases explosion radius by 10%{SP}",
"hud.skill.st_explosion_radius" : "Bigger is better, increases explosion radius by 15%{SP}",
"hud.skill.st_stamina_regen_title" : "Stamina Regen",
"hud.skill.st_stamina_regen" : "Increases stamina gain by 20%{SP}",
"hud.skill.st_fireball_title" : "Fireball",
"hud.skill.st_fireball" : "Play fetch with the enemies",
"hud.skill.st_fireball" : "Shoots a fireball that explodes on impact",
"hud.skill.st_damage_title" : "Damage",
"hud.skill.st_damage" : "Increases damage by 20%{SP}",
"hud.skill.st_explosion_title" : "Explosion",
"hud.skill.st_explosion" : "When fire just isn't enough{SP}",
// Bow
"hud.skill.bow_projectile_speed_title" : "Projectile Speed",
"hud.skill.bow_projectile_speed" : "Allows you to shoot arrows further, faster, by 30%{SP}",

View File

@ -94,7 +94,7 @@
"hud.skill.st_flamethrower_damage_title" : "Daño del lanzallamas",
"hud.skill.st_flamethrower_damage" : "Aumenta el daño en un 30%{SP}",
"hud.skill.st_explosion_radius_title" : "Radio de explosión",
"hud.skill.st_explosion_radius" : "Más grande es mejor, aumenta el radio de explosión en un 10%{SP}",
"hud.skill.st_explosion_radius" : "Más grande es mejor, aumenta el radio de explosión en un 15%{SP}",
"hud.skill.st_stamina_regen_title" : "Regeneración de resistencia",
"hud.skill.st_stamina_regen" : "Aumenta la regeneración de resistencia en un 20%{SP}",
"hud.skill.st_fireball_title" : "Bola de fuego",

View File

@ -94,7 +94,7 @@
"hud.skill.st_flamethrower_damage_title" : "Dégâts des Flammes",
"hud.skill.st_flamethrower_damage" : "Augmente de 30% les dégâts{SP}",
"hud.skill.st_explosion_radius_title" : "Portée de l'Explosion",
"hud.skill.st_explosion_radius" : "Augmente la portée d'explosion de 10%{SP}",
"hud.skill.st_explosion_radius" : "Augmente la portée d'explosion de 15%{SP}",
"hud.skill.st_stamina_regen_title" : "Régénération d'Endurance des Boules de feu",
"hud.skill.st_stamina_regen" : "Augmente de 20% la régénération d'endurance{SP}",
"hud.skill.st_fireball_title" : "Boule de Feu",

View File

@ -94,7 +94,7 @@
"hud.skill.st_flamethrower_damage_title" : "フレームスロワー ダメージ",
"hud.skill.st_flamethrower_damage" : "ダメージを30%増加 {SP}",
"hud.skill.st_explosion_radius_title" : "エクスプロージョン 範囲",
"hud.skill.st_explosion_radius" : "大きいのはいいですよね。爆発半径を10%増加 {SP}",
"hud.skill.st_explosion_radius" : "大きいのはいいですよね。爆発半径を15%増加 {SP}",
"hud.skill.st_stamina_regen_title" : "スタミナ 再生",
"hud.skill.st_stamina_regen" : "スタミナ獲得量を20%増加 {SP}",
"hud.skill.st_fireball_title" : "ファイアーボール",

View File

@ -90,7 +90,7 @@
"hud.skill.st_flamethrower_damage_title" : "Dano do Lança Chamas",
"hud.skill.st_flamethrower_damage" : "Aumenta o dano em 30%{SP}",
"hud.skill.st_explosion_radius_title" : "Raio da Explosão",
"hud.skill.st_explosion_radius" : "Quanto maior melhor, e o raio da explosão é aumentado em 10%{SP}",
"hud.skill.st_explosion_radius" : "Quanto maior melhor, e o raio da explosão é aumentado em 15%{SP}",
"hud.skill.st_stamina_regen_title" : "Regeneração de stamina",
"hud.skill.st_stamina_regen" : "Aumenta o ganho de stamina em 20%{SP}",
"hud.skill.st_fireball_title" : "Bola de fogo",

View File

@ -101,7 +101,7 @@
"hud.skill.st_explosion_title" : "Вибухові снаряди",
"hud.skill.st_explosion" : "Коли просто вогню не достатньо{SP}",
"hud.skill.st_explosion_radius_title" : "Радіус вибуху",
"hud.skill.st_explosion_radius" : "Більше - краще, збільшує радіус вибуху снарядів на 10%{SP}",
"hud.skill.st_explosion_radius" : "Більше - краще, збільшує радіус вибуху снарядів на 15%{SP}",
"hud.skill.st_stamina_regen_title" : "Відновлення енергії",
"hud.skill.st_stamina_regen" : "Збільшує відновлення енергії від заподіяних ушкоджень на 20%{SP}",
"hud.skill.st_damage_title" : "Ушкодження снарядами",

View File

@ -94,7 +94,7 @@
"hud.skill.st_flamethrower_damage_title" : "伤害提升",
"hud.skill.st_flamethrower_damage" : "吐息造成的伤害提高30%{SP}",
"hud.skill.st_explosion_radius_title" : "爆破专家",
"hud.skill.st_explosion_radius" : "火球爆炸的半径扩大10%{SP}",
"hud.skill.st_explosion_radius" : "火球爆炸的半径扩大15%{SP}",
"hud.skill.st_stamina_regen_title" : "法力回复",
"hud.skill.st_stamina_regen" : "每次击中敌人回复的法力增加20%{SP}",
"hud.skill.st_fireball_title" : "火球术",

View File

@ -340,7 +340,7 @@ impl CharacterAbility {
movement_duration: 0.33,
recover_duration: 0.125,
roll_strength: 2.0,
immune_melee: false,
immune_melee: true,
}
}
@ -966,9 +966,6 @@ impl CharacterAbility {
BasicRanged {
ref mut projectile, ..
} => {
if !skillset.has_skill(Staff(BExplosion)) {
*projectile = projectile.fireball_to_firebolt();
}
let damage_level = skillset
.skill_level(Staff(BDamage))
.unwrap_or(None)
@ -983,7 +980,7 @@ impl CharacterAbility {
.unwrap_or(0);
let power = 1.2_f32.powi(damage_level.into());
let regen = 1.2_f32.powi(regen_level.into());
let range = 1.1_f32.powi(range_level.into());
let range = 1.15_f32.powi(range_level.into());
*projectile = projectile.modified_projectile(power, regen, range);
},
BasicBeam {
@ -1107,7 +1104,6 @@ impl CharacterAbility {
},
None => {
if let CharacterAbility::Roll {
ref mut immune_melee,
ref mut energy_cost,
ref mut roll_strength,
ref mut movement_duration,
@ -1115,7 +1111,6 @@ impl CharacterAbility {
} = self
{
use skills::RollSkill::*;
*immune_melee = skillset.has_skill(Skill::Roll(ImmuneMelee));
if let Ok(Some(level)) = skillset.skill_level(Skill::Roll(Cost)) {
*energy_cost *= 0.9_f32.powi(level.into());
}

View File

@ -54,10 +54,6 @@ pub enum ProjectileConstructor {
damage: f32,
radius: f32,
},
Firebolt {
damage: f32,
energy_regen: f32,
},
Possess,
}
@ -169,33 +165,6 @@ impl ProjectileConstructor {
ignore_group: true,
}
},
Firebolt {
damage,
energy_regen,
} => {
let energy = AttackEffect::new(None, CombatEffect::EnergyReward(energy_regen))
.with_requirement(CombatRequirement::AnyDamage);
let damage = AttackDamage::new(
Damage {
source: DamageSource::Energy,
value: damage,
},
Some(GroupTarget::OutOfGroup),
);
let attack = Attack::default()
.with_damage(damage)
.with_crit(crit_chance, crit_mult)
.with_effect(energy)
.with_combo_increment();
Projectile {
hit_solid: vec![Effect::Vanish],
hit_entity: vec![Effect::Attack(attack), Effect::Vanish],
time_left: Duration::from_secs(10),
owner,
ignore_group: true,
}
},
Possess => Projectile {
hit_solid: vec![Effect::Stick],
hit_entity: vec![Effect::Stick, Effect::Possess],
@ -235,32 +204,8 @@ impl ProjectileConstructor {
*damage *= power;
*radius *= range;
},
Firebolt {
ref mut damage,
ref mut energy_regen,
..
} => {
*damage *= power;
*energy_regen *= regen;
},
Possess => {},
}
self
}
pub fn fireball_to_firebolt(self) -> Self {
if let ProjectileConstructor::Fireball {
damage,
energy_regen,
radius: _,
} = self
{
ProjectileConstructor::Firebolt {
damage,
energy_regen: energy_regen * 2.0,
}
} else {
self
}
}
}

View File

@ -204,7 +204,6 @@ pub enum BowSkill {
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub enum StaffSkill {
// Basic ranged upgrades
BExplosion,
BDamage,
BRegen,
BRadius,
@ -248,7 +247,6 @@ pub enum GeneralSkill {
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize)]
pub enum RollSkill {
ImmuneMelee,
Cost,
Strength,
Duration,

View File

@ -246,7 +246,6 @@ impl SkillSetBuilder {
// Staff
Self::default()
.with_skill_group(SkillGroupKind::Weapon(ToolKind::Staff))
.with_skill(Skill::Staff(StaffSkill::BExplosion), None)
.with_skill(Skill::Staff(StaffSkill::BRegen), Some(1))
.with_skill(Skill::Staff(StaffSkill::BRadius), Some(1))
.with_skill(Skill::Staff(StaffSkill::FDamage), Some(1))
@ -318,7 +317,6 @@ impl SkillSetBuilder {
// Staff
Self::default()
.with_skill_group(SkillGroupKind::Weapon(ToolKind::Staff))
.with_skill(Skill::Staff(StaffSkill::BExplosion), None)
.with_skill(Skill::Staff(StaffSkill::FDamage), Some(1))
.with_skill(Skill::Staff(StaffSkill::FRange), Some(1))
.with_skill(Skill::Staff(StaffSkill::FDrain), Some(1))
@ -393,7 +391,6 @@ impl SkillSetBuilder {
// Staff
Self::default()
.with_skill_group(SkillGroupKind::Weapon(ToolKind::Staff))
.with_skill(Skill::Staff(StaffSkill::BExplosion), None)
.with_skill(Skill::Staff(StaffSkill::BDamage), Some(1))
.with_skill(Skill::Staff(StaffSkill::BRadius), Some(1))
.with_skill(Skill::Staff(StaffSkill::FDamage), Some(1))
@ -471,7 +468,6 @@ impl SkillSetBuilder {
// Staff
Self::default()
.with_skill_group(SkillGroupKind::Weapon(ToolKind::Staff))
.with_skill(Skill::Staff(StaffSkill::BExplosion), None)
.with_skill(Skill::Staff(StaffSkill::BDamage), Some(1))
.with_skill(Skill::Staff(StaffSkill::BRadius), Some(1))
.with_skill(Skill::Staff(StaffSkill::FDamage), Some(1))
@ -557,7 +553,6 @@ impl SkillSetBuilder {
// Staff
Self::default()
.with_skill_group(SkillGroupKind::Weapon(ToolKind::Staff))
.with_skill(Skill::Staff(StaffSkill::BExplosion), None)
.with_skill(Skill::Staff(StaffSkill::BDamage), Some(1))
.with_skill(Skill::Staff(StaffSkill::BRegen), Some(1))
.with_skill(Skill::Staff(StaffSkill::BRadius), Some(1))
@ -653,7 +648,6 @@ impl SkillSetBuilder {
// Staff
Self::default()
.with_skill_group(SkillGroupKind::Weapon(ToolKind::Staff))
.with_skill(Skill::Staff(StaffSkill::BExplosion), None)
.with_skill(Skill::Staff(StaffSkill::BDamage), Some(1))
.with_skill(Skill::Staff(StaffSkill::BRegen), Some(1))
.with_skill(Skill::Staff(StaffSkill::BRadius), Some(1))
@ -672,7 +666,6 @@ impl SkillSetBuilder {
},
Some(Mindflayer) => Self::default()
.with_skill_group(SkillGroupKind::Weapon(ToolKind::Staff))
.with_skill(Skill::Staff(StaffSkill::BExplosion), None)
.with_skill(Skill::Staff(StaffSkill::BDamage), Some(3))
.with_skill(Skill::Staff(StaffSkill::BRegen), Some(2))
.with_skill(Skill::Staff(StaffSkill::BRadius), Some(2))

View File

@ -0,0 +1,28 @@
-- Refund the existing skill points for ImmuneMelee/BExplosion.
-- A skill of level n has total cost (n*(n+1))/2, since it cost 1 for the
-- first, 2 for the second, and so on.
-- The formula is used here to make the updates copy-pastable for other migrations,
-- even though these two skills in particular only have 1 total point maximum.
-- COALESCE is used because skills can have NULL levels (and these two do, in fact).
UPDATE skill_group
SET available_sp = skill_group.available_sp +
((COALESCE(skill.level, 1) * (COALESCE(skill.level, 1) + 1)) / 2)
FROM skill
WHERE skill.entity_id = skill_group.entity_id
AND skill_group.skill_group_kind = 'General'
AND skill.skill = 'Roll ImmuneMelee';
UPDATE skill_group
SET available_sp = skill_group.available_sp +
((COALESCE(skill.level, 1) * (COALESCE(skill.level, 1) + 1)) / 2)
FROM skill
WHERE skill.entity_id = skill_group.entity_id
AND skill_group.skill_group_kind = 'Weapon Staff'
AND skill.skill = 'Staff BExplosion';
-- After refunding the points, delete the skills.
DELETE FROM skill WHERE skill = 'Staff BExplosion';
DELETE FROM skill WHERE skill = 'Roll ImmuneMelee';

View File

@ -105,7 +105,6 @@ pub fn skill_to_db_string(skill: comp::skills::Skill) -> String {
Bow(BowSkill::RGlide) => "Bow RGlide",
Bow(BowSkill::RArrows) => "Bow RArrows",
Bow(BowSkill::RCost) => "Bow RCost",
Staff(StaffSkill::BExplosion) => "Staff BExplosion",
Staff(StaffSkill::BDamage) => "Staff BDamage",
Staff(StaffSkill::BRegen) => "Staff BRegen",
Staff(StaffSkill::BRadius) => "Staff BRadius",
@ -130,7 +129,6 @@ pub fn skill_to_db_string(skill: comp::skills::Skill) -> String {
Sceptre(SceptreSkill::ADuration) => "Sceptre ADuration",
Sceptre(SceptreSkill::ARange) => "Sceptre ARange",
Sceptre(SceptreSkill::ACost) => "Sceptre ACost",
Roll(RollSkill::ImmuneMelee) => "Roll ImmuneMelee",
Roll(RollSkill::Cost) => "Roll Cost",
Roll(RollSkill::Strength) => "Roll Strength",
Roll(RollSkill::Duration) => "Roll Duration",
@ -232,7 +230,6 @@ pub fn db_string_to_skill(skill_string: &str) -> comp::skills::Skill {
"Bow RGlide" => Bow(BowSkill::RGlide),
"Bow RArrows" => Bow(BowSkill::RArrows),
"Bow RCost" => Bow(BowSkill::RCost),
"Staff BExplosion" => Staff(StaffSkill::BExplosion),
"Staff BDamage" => Staff(StaffSkill::BDamage),
"Staff BRegen" => Staff(StaffSkill::BRegen),
"Staff BRadius" => Staff(StaffSkill::BRadius),
@ -257,7 +254,6 @@ pub fn db_string_to_skill(skill_string: &str) -> comp::skills::Skill {
"Sceptre ADuration" => Sceptre(SceptreSkill::ADuration),
"Sceptre ARange" => Sceptre(SceptreSkill::ARange),
"Sceptre ACost" => Sceptre(SceptreSkill::ACost),
"Roll ImmuneMelee" => Roll(RollSkill::ImmuneMelee),
"Roll Cost" => Roll(RollSkill::Cost),
"Roll Strength" => Roll(RollSkill::Strength),
"Roll Duration" => Roll(RollSkill::Duration),

View File

@ -541,7 +541,7 @@ impl<'a> Widget for Diary<'a> {
SelectedSkillTree::Weapon(ToolKind::Axe) => 5,
SelectedSkillTree::Weapon(ToolKind::Hammer) => 5,
SelectedSkillTree::Weapon(ToolKind::Bow) => 3,
SelectedSkillTree::Weapon(ToolKind::Staff) => 5,
SelectedSkillTree::Weapon(ToolKind::Staff) => 4,
SelectedSkillTree::Weapon(ToolKind::Sceptre) => 5,
_ => 0,
};
@ -939,32 +939,17 @@ impl<'a> Widget for Diary<'a> {
events.push(Event::UnlockSkill(skill));
};
// Bottom left skills
let skill = Skill::Roll(ImmuneMelee);
if create_skill_button(
self.imgs.skill_dodge_skill,
state.skills_bot_l[0],
&self.skill_set,
skill,
self.fonts,
&get_skill_label(skill, &self.skill_set),
)
Button::image(self.imgs.skill_dodge_skill)
.w_h(74.0, 74.0)
.mid_top_with_margin_on(state.skills_bot_l[0], 3.0)
.with_tooltip(
self.tooltip_manager,
&self.localized_strings.get("hud.skill.dodge_title"),
&add_sp_cost_tooltip(
&self.localized_strings.get("hud.skill.dodge"),
skill,
&self.skill_set,
&self.localized_strings,
),
&diary_tooltip,
TEXT_COLOR,
)
.set(state.skill_general_roll_0, ui)
.was_clicked()
{
events.push(Event::UnlockSkill(skill));
};
.set(state.skill_general_roll_0, ui);
let skill = Skill::Roll(RollSkill::Cost);
if create_skill_button(
self.imgs.utility_cost_skill,
@ -2967,36 +2952,10 @@ impl<'a> Widget for Diary<'a> {
TEXT_COLOR,
)
.set(state.skill_staff_basic_0, ui);
let skill = Skill::Staff(BExplosion);
if create_skill_button(
self.imgs.magic_explosion_skill,
state.skills_top_l[1],
&self.skill_set,
skill,
self.fonts,
&get_skill_label(skill, &self.skill_set),
)
.with_tooltip(
self.tooltip_manager,
&self.localized_strings.get("hud.skill.st_explosion_title"),
&add_sp_cost_tooltip(
&self.localized_strings.get("hud.skill.st_explosion"),
skill,
&self.skill_set,
&self.localized_strings,
),
&diary_tooltip,
TEXT_COLOR,
)
.set(state.skill_staff_basic_1, ui)
.was_clicked()
{
events.push(Event::UnlockSkill(skill));
};
let skill = Skill::Staff(BDamage);
if create_skill_button(
self.imgs.magic_damage_skill,
state.skills_top_l[2],
state.skills_top_l[1],
&self.skill_set,
skill,
self.fonts,
@ -3014,7 +2973,7 @@ impl<'a> Widget for Diary<'a> {
&diary_tooltip,
TEXT_COLOR,
)
.set(state.skill_staff_basic_2, ui)
.set(state.skill_staff_basic_1, ui)
.was_clicked()
{
events.push(Event::UnlockSkill(skill));
@ -3022,7 +2981,7 @@ impl<'a> Widget for Diary<'a> {
let skill = Skill::Staff(BRegen);
if create_skill_button(
self.imgs.magic_energy_regen_skill,
state.skills_top_l[3],
state.skills_top_l[2],
&self.skill_set,
skill,
self.fonts,
@ -3042,7 +3001,7 @@ impl<'a> Widget for Diary<'a> {
&diary_tooltip,
TEXT_COLOR,
)
.set(state.skill_staff_basic_3, ui)
.set(state.skill_staff_basic_2, ui)
.was_clicked()
{
events.push(Event::UnlockSkill(skill));
@ -3050,7 +3009,7 @@ impl<'a> Widget for Diary<'a> {
let skill = Skill::Staff(BRadius);
if create_skill_button(
self.imgs.magic_radius_skill,
state.skills_top_l[4],
state.skills_top_l[3],
&self.skill_set,
skill,
self.fonts,
@ -3070,7 +3029,7 @@ impl<'a> Widget for Diary<'a> {
&diary_tooltip,
TEXT_COLOR,
)
.set(state.skill_staff_basic_4, ui)
.set(state.skill_staff_basic_3, ui)
.was_clicked()
{
events.push(Event::UnlockSkill(skill));