Respond to review

- Add changelog
- Remove unused code
This commit is contained in:
juliancoffee 2024-03-20 16:01:11 +02:00
parent 7e4dcfd95a
commit c7cc287e89
13 changed files with 22 additions and 66 deletions

View File

@ -95,11 +95,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Plugin interface based on WASI 0.2 WIT, wasmtime executes these components.
- Balance changes; Smoother entity progression consisting of larger variety in (effective) health pools, DPS, entity flee_health alterations, and minor weight distribution changes for entity spawns.
- Made power of weapon tiers scale non-linearly.
- Sword Changes; Pommel Strike has been nerfed -> increased energy cost, increased _durations, and decreased poise damage. Heavy Sweep has been nerfed -> decreased poise damage and stun vulnerability damage. Pillar Thrust has been altered -> decreased maximum base damage with an increase in stun vulnerability damage.
- Sword Changes; Pommel Strike has been nerfed -> increased energy cost, increased durations, and decreased poise damage. Heavy Sweep has been nerfed -> decreased poise damage and stun vulnerability damage. Pillar Thrust has been altered -> decreased maximum base damage with an increase in stun vulnerability damage.
- Weapons block are based on poise.
- Wooden Shield recipe.
- Overhauled the visuals of several cave biomes.
- Dropped items now merge dynamically (including non-stackables).
- You no longer need to unlock health, energy and roll skills to get to max.
- Rolls now don't skip recovery, and instead have increased buildup during ability interrupts.
### Removed

View File

@ -140,8 +140,6 @@
],
// Just copypasta from max with random reductions
"middle": [
// General skills
// Sword
(UnlockGroup(Weapon(Sword)), 1),
@ -225,8 +223,6 @@
],
// Basic skill preset to unlock all abilities
"basic": [
// General skills
// Sword
(UnlockGroup(Weapon(Sword)), 1),

View File

@ -1917,8 +1917,7 @@ impl CharacterAbility {
Some(ToolKind::Staff) => self.adjusted_by_staff_skills(skillset),
Some(ToolKind::Sceptre) => self.adjusted_by_sceptre_skills(skillset),
Some(ToolKind::Pick) => self.adjusted_by_mining_skills(skillset),
None => self.adjusted_by_general_skills(skillset),
Some(_) => {},
None | Some(_) => {},
}
self
}
@ -1944,8 +1943,6 @@ impl CharacterAbility {
}
}
fn adjusted_by_general_skills(&mut self, _skillset: &SkillSet) {}
fn adjusted_by_hammer_skills(&mut self, skillset: &SkillSet) {
#![allow(clippy::enum_glob_use)]
use skills::{HammerSkill::*, Skill::Hammer};

View File

@ -1,4 +1,4 @@
use crate::{comp, consts::ENERGY_PER_LEVEL};
use crate::comp;
use serde::{Deserialize, Serialize};
use specs::{Component, DerefFlaggedStorage};
use std::ops::Mul;
@ -82,11 +82,8 @@ impl Energy {
self.current = self.current.min(self.maximum);
}
pub fn new(body: comp::Body, level: u16) -> Self {
let energy = u32::from(
body.base_energy()
.saturating_add(ENERGY_PER_LEVEL.saturating_mul(level)),
) * Self::SCALING_FACTOR_INT;
pub fn new(body: comp::Body) -> Self {
let energy = u32::from(body.base_energy()) * Self::SCALING_FACTOR_INT;
Energy {
current: energy,
base_max: energy,
@ -130,15 +127,6 @@ impl Energy {
}
}
pub fn update_max_energy(&mut self, body: comp::Body, level: u16) {
let old_max = self.base_max;
self.base_max = u32::from(
body.base_energy()
.saturating_add(ENERGY_PER_LEVEL.saturating_mul(level)),
) * Self::SCALING_FACTOR_INT;
self.current = (self.current + self.base_max - old_max).min(self.maximum);
}
pub fn refresh(&mut self) { self.current = self.maximum; }
}

View File

@ -1,6 +1,4 @@
use crate::{
combat::DamageContributor, comp, consts::HP_PER_LEVEL, resources::Time, uid::Uid, DamageSource,
};
use crate::{combat::DamageContributor, comp, resources::Time, uid::Uid, DamageSource};
use hashbrown::HashMap;
use serde::{Deserialize, Serialize};
use specs::{Component, DerefFlaggedStorage};
@ -117,11 +115,8 @@ impl Health {
self.current = self.current.min(self.maximum);
}
pub fn new(body: comp::Body, level: u16) -> Self {
let health = u32::from(
body.base_health()
.saturating_add(HP_PER_LEVEL.saturating_mul(level)),
) * Self::SCALING_FACTOR_INT;
pub fn new(body: comp::Body) -> Self {
let health = u32::from(body.base_health()) * Self::SCALING_FACTOR_INT;
Health {
current: health,
base_max: health,
@ -139,16 +134,6 @@ impl Health {
}
}
// TODO: Delete this once stat points will be a thing
pub fn update_max_hp(&mut self, body: comp::Body, level: u16) {
let old_max = self.base_max;
self.base_max = u32::from(
body.base_health()
.saturating_add(HP_PER_LEVEL.saturating_mul(level)),
) * Self::SCALING_FACTOR_INT;
self.current = (self.current + self.base_max - old_max).min(self.maximum);
}
/// Returns a boolean if the delta was not zero.
pub fn change_by(&mut self, change: HealthChange) -> bool {
let prev_health = i64::from(self.current);

View File

@ -11,14 +11,12 @@ use serde::{Deserialize, Serialize};
// SkillTree Modifiers below.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
pub enum Skill {
General(GeneralSkill),
Sword(SwordSkill),
Axe(AxeSkill),
Hammer(HammerSkill),
Bow(BowSkill),
Staff(StaffSkill),
Sceptre(SceptreSkill),
Roll(RollSkill),
Climb(ClimbSkill),
Swim(SwimSkill),
Pick(MiningSkill),
@ -162,12 +160,6 @@ pub enum SceptreSkill {
ACost,
}
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
pub enum GeneralSkill {}
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
pub enum RollSkill {}
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, Serialize, Deserialize, Ord, PartialOrd)]
pub enum ClimbSkill {
Cost,

View File

@ -31,10 +31,6 @@ pub const MIN_RECOMMENDED_TOKIO_THREADS: usize = 2;
pub const SOUND_TRAVEL_DIST_PER_VOLUME: f32 = 3.0;
// Stat increase per level (multiplied by 10 compared to what you'll see in UI)
pub const ENERGY_PER_LEVEL: u16 = 5;
pub const HP_PER_LEVEL: u16 = 5;
pub const TELEPORTER_RADIUS: f32 = 3.;
// Map settings

View File

@ -134,7 +134,7 @@ impl CharacterBehavior for Data {
.static_data
.summon_info
.has_health
.then(|| comp::Health::new(body, 0));
.then(|| comp::Health::new(body));
// Ray cast to check where summon should happen
let summon_frac =

View File

@ -64,7 +64,7 @@ mod tests {
.with(body.mass())
.with(body.density())
.with(body)
.with(Energy::new(body, 0))
.with(Energy::new(body))
.with(Controller::default())
.with(Poise::new(body))
.with(skill_set)

View File

@ -128,8 +128,8 @@ pub fn create_player(state: &mut State) -> Entity {
.with(Buffs::default())
.with(Combo::default())
.with(Auras::default())
.with(Energy::new(body, 0))
.with(Health::new(body, body.base_health()))
.with(Energy::new(body))
.with(Health::new(body))
.with(skill_set)
.with(Stats::empty(body))
.build()

View File

@ -1689,7 +1689,7 @@ fn handle_spawn(
comp::Ori::default(),
comp::Stats::new(get_npc_name(id, npc::BodyType::from_body(body)), body),
comp::SkillSet::default(),
Some(comp::Health::new(body, 0)),
Some(comp::Health::new(body)),
comp::Poise::new(body),
inventory,
body,
@ -1778,7 +1778,7 @@ fn handle_spawn_training_dummy(
let stats = comp::Stats::new("Training Dummy".to_string(), body);
let skill_set = comp::SkillSet::default();
let health = comp::Health::new(body, 0);
let health = comp::Health::new(body);
let poise = comp::Poise::new(body);
server

View File

@ -297,7 +297,7 @@ impl StateExt for State {
.with(body.collider())
.with(comp::Controller::default())
.with(body)
.with(comp::Energy::new(body, 0))
.with(comp::Energy::new(body))
.with(stats)
.with(if body.is_humanoid() {
comp::ActiveAbilities::default_limited(BASE_ABILITY_LIMIT)
@ -428,7 +428,7 @@ impl StateExt for State {
.with(comp::CharacterActivity::default())
// TODO: some of these are required in order for the character_behavior system to
// recognize a possesed airship; that system should be refactored to use `.maybe()`
.with(comp::Energy::new(ship.into(), 0))
.with(comp::Energy::new(ship.into()))
.with(comp::Stats::new("Airship".to_string(), body))
.with(comp::SkillSet::default())
.with(comp::ActiveAbilities::default())
@ -727,8 +727,8 @@ impl StateExt for State {
self.write_component_ignore_entity_dead(entity, body);
self.write_component_ignore_entity_dead(entity, body.mass());
self.write_component_ignore_entity_dead(entity, body.density());
self.write_component_ignore_entity_dead(entity, comp::Health::new(body, 0));
self.write_component_ignore_entity_dead(entity, comp::Energy::new(body, 0));
self.write_component_ignore_entity_dead(entity, comp::Health::new(body));
self.write_component_ignore_entity_dead(entity, comp::Energy::new(body));
self.write_component_ignore_entity_dead(entity, Poise::new(body));
self.write_component_ignore_entity_dead(entity, stats);
self.write_component_ignore_entity_dead(entity, active_abilities);
@ -773,7 +773,7 @@ impl StateExt for State {
ori,
stats,
comp::SkillSet::default(),
Some(comp::Health::new(body, 0)),
Some(comp::Health::new(body)),
Poise::new(body),
Inventory::with_loadout(
LoadoutBuilder::from_default(&body).build(),

View File

@ -498,7 +498,7 @@ impl SpawnEntityData {
inventory
};
let health = Some(comp::Health::new(body, 0));
let health = Some(comp::Health::new(body));
let poise = comp::Poise::new(body);
// Allow Humanoid, BirdMedium, and Parrot to speak