diff --git a/assets/common/items/apple.ron b/assets/common/items/apple.ron index 7179502e22..0c44a094ce 100644 --- a/assets/common/items/apple.ron +++ b/assets/common/items/apple.ron @@ -2,11 +2,11 @@ Item( name: "Apple", description: "Red and juicy. -Restores 20 Health.", +Restores 2 Health.", kind: Consumable( kind: Apple, effect: Health(( - amount: 20, + amount: 2, cause: Item, )), ), diff --git a/assets/common/items/cheese.ron b/assets/common/items/cheese.ron index 6e0bbe751e..9cb95fcbf8 100644 --- a/assets/common/items/cheese.ron +++ b/assets/common/items/cheese.ron @@ -2,11 +2,11 @@ Item( name: "Dwarven Cheese", description: "Aromatic and nutritious. -Restores 40 Health.", +Restores 15 Health.", kind: Consumable( kind: Cheese, effect: Health(( - amount: 40, + amount: 15, cause: Item, )), ), diff --git a/assets/common/items/weapons/hammer_1.ron b/assets/common/items/weapons/hammer_1.ron index 9f31453a57..d38e03d6ea 100644 --- a/assets/common/items/weapons/hammer_1.ron +++ b/assets/common/items/weapons/hammer_1.ron @@ -6,7 +6,7 @@ Item( kind: Tool( ToolData ( kind: Hammer(BasicHammer), - equip_time_millis: 1000, + equip_time_millis: 600, ) ) ) diff --git a/assets/common/items/weapons/starter_axe.ron b/assets/common/items/weapons/starter_axe.ron index a534e2eaa4..b77ef73c7d 100644 --- a/assets/common/items/weapons/starter_axe.ron +++ b/assets/common/items/weapons/starter_axe.ron @@ -6,7 +6,7 @@ Item( kind: Tool( ToolData ( kind: Axe(BasicAxe), - equip_time_millis: 1000, + equip_time_millis: 700, ) ), ) diff --git a/assets/common/items/weapons/starter_hammer.ron b/assets/common/items/weapons/starter_hammer.ron index 3e3a55f6e3..77d9ef6812 100644 --- a/assets/common/items/weapons/starter_hammer.ron +++ b/assets/common/items/weapons/starter_hammer.ron @@ -6,7 +6,7 @@ Item( kind: Tool( ToolData ( kind: Hammer(BasicHammer), - equip_time_millis: 1000, + equip_time_millis: 600, ) ), ) diff --git a/common/src/comp/ability.rs b/common/src/comp/ability.rs index 0d2538aea5..0c6d3b7f63 100644 --- a/common/src/comp/ability.rs +++ b/common/src/comp/ability.rs @@ -56,34 +56,24 @@ impl CharacterAbility { match self { CharacterAbility::Roll => { data.physics.on_ground - && !data.physics.in_fluid && data.body.is_humanoid() && update .energy - .try_change_by(-200, EnergySource::Ability) - .is_ok() - }, - CharacterAbility::DashMelee { .. } => { - !data.physics.in_fluid - && update - .energy - .try_change_by(-300, EnergySource::Ability) - .is_ok() - }, - CharacterAbility::BasicMelee { energy_cost, .. } => { - !data.physics.in_fluid - && update - .energy - .try_change_by(-(*energy_cost as i32), EnergySource::Ability) - .is_ok() - }, - CharacterAbility::BasicRanged { energy_cost, .. } => { - !data.physics.in_fluid - && update - .energy - .try_change_by(-(*energy_cost as i32), EnergySource::Ability) + .try_change_by(-150, EnergySource::Ability) .is_ok() }, + CharacterAbility::DashMelee { .. } => update + .energy + .try_change_by(-700, EnergySource::Ability) + .is_ok(), + CharacterAbility::BasicMelee { energy_cost, .. } => update + .energy + .try_change_by(-(*energy_cost as i32), EnergySource::Ability) + .is_ok(), + CharacterAbility::BasicRanged { energy_cost, .. } => update + .energy + .try_change_by(-(*energy_cost as i32), EnergySource::Ability) + .is_ok(), _ => true, } } @@ -165,7 +155,8 @@ impl From<&CharacterAbility> for CharacterState { }), CharacterAbility::BasicBlock => CharacterState::BasicBlock, CharacterAbility::Roll => CharacterState::Roll(roll::Data { - remaining_duration: Duration::from_millis(300), + remaining_duration: Duration::from_millis(500), + was_wielded: false, // false by default. utils might set it to true }), CharacterAbility::TimedCombo { buildup_duration, diff --git a/common/src/comp/inventory/item.rs b/common/src/comp/inventory/item.rs index 78e99a9a54..90ce466ef8 100644 --- a/common/src/comp/inventory/item.rs +++ b/common/src/comp/inventory/item.rs @@ -70,7 +70,7 @@ impl ToolData { use ToolKind::*; match self.kind { - Sword(_) => vec![TripleStrike { base_damage: 7 }, DashMelee { + Sword(_) => vec![TripleStrike { base_damage: 5 }, DashMelee { buildup_duration: Duration::from_millis(500), recover_duration: Duration::from_millis(500), base_damage: 20, diff --git a/common/src/comp/stats.rs b/common/src/comp/stats.rs index 3e6d957fef..1c31af1187 100644 --- a/common/src/comp/stats.rs +++ b/common/src/comp/stats.rs @@ -135,7 +135,7 @@ impl Stats { } // TODO: Delete this once stat points will be a thing - pub fn update_max_hp(&mut self) { self.health.set_maximum(33 + 7 * self.level.amount); } + pub fn update_max_hp(&mut self) { self.health.set_maximum(52 + 3 * self.level.amount); } } impl Stats { diff --git a/common/src/states/basic_melee.rs b/common/src/states/basic_melee.rs index 03e7851b0d..c6e5af5a62 100644 --- a/common/src/states/basic_melee.rs +++ b/common/src/states/basic_melee.rs @@ -26,6 +26,7 @@ impl CharacterBehavior for Data { let mut update = StateUpdate::from(data); handle_move(data, &mut update); + handle_jump(data, &mut update); if self.buildup_duration != Duration::default() { // Build up diff --git a/common/src/states/roll.rs b/common/src/states/roll.rs index 6eed23d488..f2ca53ecf1 100644 --- a/common/src/states/roll.rs +++ b/common/src/states/roll.rs @@ -6,11 +6,13 @@ use crate::{ use std::time::Duration; use vek::Vec3; -const ROLL_SPEED: f32 = 17.0; +const ROLL_SPEED: f32 = 15.0; #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] pub struct Data { /// How long the state has until exiting pub remaining_duration: Duration, + /// Had weapon + pub was_wielded: bool, } impl CharacterBehavior for Data { @@ -31,7 +33,11 @@ impl CharacterBehavior for Data { if self.remaining_duration == Duration::default() { // Roll duration has expired update.vel.0 *= 0.3; - update.character = CharacterState::Idle {}; + if self.was_wielded { + update.character = CharacterState::Wielding; + } else { + update.character = CharacterState::Idle; + } } else { // Otherwise, tick down remaining_duration update.character = CharacterState::Roll(Data { @@ -39,6 +45,7 @@ impl CharacterBehavior for Data { .remaining_duration .checked_sub(Duration::from_secs_f32(data.dt.0)) .unwrap_or_default(), + was_wielded: self.was_wielded, }); } diff --git a/common/src/states/triple_strike.rs b/common/src/states/triple_strike.rs index 7f6104c257..d39f55416b 100644 --- a/common/src/states/triple_strike.rs +++ b/common/src/states/triple_strike.rs @@ -7,9 +7,9 @@ use std::time::Duration; use vek::vec::{Vec2, Vec3}; // In millis -const STAGE_DURATION: u64 = 600; +const STAGE_DURATION: u64 = 500; -const INITIAL_ACCEL: f32 = 200.0; +const INITIAL_ACCEL: f32 = 90.0; const BASE_SPEED: f32 = 25.0; #[derive(Copy, Clone, Debug, PartialEq, Serialize, Deserialize, Eq, Hash)] @@ -87,8 +87,13 @@ impl CharacterBehavior for Data { // Move player forward while in first third of each stage if update.vel.0.magnitude_squared() < BASE_SPEED.powf(2.0) { - update.vel.0 = - update.vel.0 + Vec2::broadcast(data.dt.0) * data.ori.0 * adjusted_accel; + update.vel.0 = update.vel.0 + + data.dt.0 + * (if data.physics.on_ground { + Vec3::new(0.0, 0.0, 500.0) // Jump upwards if on ground + } else { + Vec3::one() + } + adjusted_accel * Vec3::from(data.ori.0.xy())); let mag2 = update.vel.0.magnitude_squared(); if mag2 > BASE_SPEED.powf(2.0) { update.vel.0 = update.vel.0.normalized() * BASE_SPEED; @@ -115,7 +120,7 @@ impl CharacterBehavior for Data { max_angle: 180_f32.to_radians(), applied: false, hit_count: 0, - knockback: 7.0, + knockback: 20.0, }); CharacterState::TripleStrike(Data { diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 3e9113fc46..6af1a90168 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -53,7 +53,7 @@ fn basic_move(data: &JoinData, update: &mut StateUpdate) { } } - handle_orientation(data, update, 9.0); + handle_orientation(data, update, 20.0); } pub fn handle_orientation(data: &JoinData, update: &mut StateUpdate, strength: f32) { @@ -215,7 +215,14 @@ pub fn handle_dodge_input(data: &JoinData, update: &mut StateUpdate) { .and_then(|i| i.dodge_ability.as_ref()) .filter(|ability| ability.requirements_paid(data, update)) { - update.character = ability.into(); + if data.character.is_wield() { + update.character = ability.into(); + if let CharacterState::Roll(roll) = &mut update.character { + roll.was_wielded = true; + } + } else { + update.character = ability.into(); + } } } } diff --git a/common/src/sys/agent.rs b/common/src/sys/agent.rs index 2c9186b26d..750465c674 100644 --- a/common/src/sys/agent.rs +++ b/common/src/sys/agent.rs @@ -180,7 +180,7 @@ impl<'a> System<'a> for Sys { inputs.move_dir = Vec2::from(tgt_pos.0 - pos.0) .try_normalized() .unwrap_or(Vec2::unit_y()) - * 0.01; + * 0.7; inputs.primary.set_state(true); } else if dist_sqrd < MAX_CHASE_DIST.powf(2.0) || (dist_sqrd < SIGHT_DIST.powf(2.0) && !*been_close) diff --git a/common/src/sys/combat.rs b/common/src/sys/combat.rs index 33ae5d8073..c9c33ac8c9 100644 --- a/common/src/sys/combat.rs +++ b/common/src/sys/combat.rs @@ -113,40 +113,40 @@ impl<'a> System<'a> for Sys { && ori2.angle_between(pos_b2 - pos2) < attack.max_angle + (rad_b / pos2.distance(pos_b2)).atan() { // Weapon gives base damage - let mut healthchange = attack.base_healthchange; + let mut healthchange = attack.base_healthchange as f32; - // NPCs do less damage: - if agent_maybe.is_some() { - healthchange = (healthchange / 2).min(-1); - } + //// NPCs do less damage: + //if agent_maybe.is_some() { + // healthchange = (healthchange / 1.5).min(-1.0); + //} // Don't heal npc's hp - if agent_b_maybe.is_some() && healthchange > 0 { - healthchange = 0; + if agent_b_maybe.is_some() && healthchange > 0.0 { + healthchange = 0.0; } if rand::random() { - healthchange = (healthchange as f32 * 1.2) as i32; + healthchange = healthchange * 1.2; } // Block if character_b.is_block() && ori_b.0.angle_between(pos.0 - pos_b.0) < BLOCK_ANGLE.to_radians() / 2.0 { - healthchange = (healthchange as f32 * (1.0 - BLOCK_EFFICIENCY)) as i32 + healthchange = healthchange * (1.0 - BLOCK_EFFICIENCY) } server_emitter.emit(ServerEvent::Damage { uid: *uid_b, change: HealthChange { - amount: healthchange, + amount: healthchange as i32, cause: HealthSource::Attack { by: *uid }, }, }); if attack.knockback != 0.0 { - local_emitter.emit(LocalEvent::KnockUp { + local_emitter.emit(LocalEvent::ApplyForce { entity: b, - dir: ori.0, + dir: Vec3::slerp(ori.0, Vec3::new(0.0, 0.0, 1.0), 0.5), force: attack.knockback, }); } diff --git a/server/src/sys/terrain.rs b/server/src/sys/terrain.rs index bb5a58661f..16f863f776 100644 --- a/server/src/sys/terrain.rs +++ b/server/src/sys/terrain.rs @@ -209,8 +209,8 @@ impl<'a> System<'a> for Sys { ability1: Some(CharacterAbility::BasicMelee { energy_cost: 0, buildup_duration: Duration::from_millis(0), - recover_duration: Duration::from_millis(300), - base_healthchange: -2, + recover_duration: Duration::from_millis(400), + base_healthchange: -4, range: 3.5, max_angle: 60.0, }),