mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Balancing
This commit is contained in:
parent
8d1f93a2d1
commit
b9c85b9beb
@ -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,
|
||||
)),
|
||||
),
|
||||
|
@ -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,
|
||||
)),
|
||||
),
|
||||
|
@ -6,7 +6,7 @@ Item(
|
||||
kind: Tool(
|
||||
ToolData (
|
||||
kind: Hammer(BasicHammer),
|
||||
equip_time_millis: 1000,
|
||||
equip_time_millis: 600,
|
||||
)
|
||||
)
|
||||
)
|
||||
|
@ -6,7 +6,7 @@ Item(
|
||||
kind: Tool(
|
||||
ToolData (
|
||||
kind: Axe(BasicAxe),
|
||||
equip_time_millis: 1000,
|
||||
equip_time_millis: 700,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
@ -6,7 +6,7 @@ Item(
|
||||
kind: Tool(
|
||||
ToolData (
|
||||
kind: Hammer(BasicHammer),
|
||||
equip_time_millis: 1000,
|
||||
equip_time_millis: 600,
|
||||
)
|
||||
),
|
||||
)
|
||||
|
@ -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,
|
||||
|
@ -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,
|
||||
|
@ -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 {
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -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 {
|
||||
|
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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)
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
@ -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,
|
||||
}),
|
||||
|
Loading…
Reference in New Issue
Block a user