mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added combo scaling to healing aura and allowed cultists to use it
This commit is contained in:
parent
b4ec433509
commit
b96bb6fc5d
@ -5,7 +5,7 @@ BasicAura(
|
||||
targets: InGroup,
|
||||
aura: (
|
||||
kind: Regeneration,
|
||||
strength: 4.0,
|
||||
strength: 2.0,
|
||||
duration: Some(10.0),
|
||||
category: Magical,
|
||||
),
|
||||
|
@ -64,8 +64,9 @@
|
||||
Sceptre(LLifesteal): Some(3),
|
||||
Sceptre(LRegen): Some(2),
|
||||
Sceptre(HHeal): Some(3),
|
||||
Sceptre(HCost): Some(2),
|
||||
Sceptre(HRange): Some(2),
|
||||
Sceptre(HDuration): Some(2),
|
||||
Sceptre(HCost): Some(2),
|
||||
Sceptre(AStrength): Some(2),
|
||||
Sceptre(ADuration): Some(2),
|
||||
Sceptre(ARange): Some(2),
|
||||
|
@ -101,8 +101,9 @@
|
||||
Sceptre(LLifesteal),
|
||||
Sceptre(LRegen),
|
||||
Sceptre(HHeal),
|
||||
Sceptre(HCost),
|
||||
Sceptre(HRange),
|
||||
Sceptre(HDuration),
|
||||
Sceptre(HCost),
|
||||
Sceptre(UnlockAura),
|
||||
Sceptre(AStrength),
|
||||
Sceptre(ADuration),
|
||||
|
@ -9,9 +9,9 @@
|
||||
|
||||
// Heal
|
||||
Skill((Sceptre(HHeal), Some(1))),
|
||||
Skill((Sceptre(HCost), Some(1))),
|
||||
Skill((Sceptre(HStrength), Some(1))),
|
||||
Skill((Sceptre(HRange), Some(1))),
|
||||
|
||||
Skill((Sceptre(HCost), Some(1))),
|
||||
// Ward
|
||||
Skill((Sceptre(UnlockAura), None)),
|
||||
Skill((Sceptre(AStrength), Some(1))),
|
||||
|
@ -1364,8 +1364,7 @@ impl CharacterAbility {
|
||||
if let Ok(Some(level)) = skillset.skill_level(Sceptre(HHeal)) {
|
||||
aura.strength *= 1.15_f32.powi(level.into());
|
||||
}
|
||||
if let Ok(Some(level)) = skillset.skill_level(Sceptre(ADuration)) {
|
||||
//TODO: make a proper healing duration ability
|
||||
if let Ok(Some(level)) = skillset.skill_level(Sceptre(HDuration)) {
|
||||
aura.duration.map(|dur| dur * 1.2_f32.powi(level.into()));
|
||||
}
|
||||
if let Ok(Some(level)) = skillset.skill_level(Sceptre(HRange)) {
|
||||
|
@ -478,8 +478,9 @@ pub enum SceptreSkill {
|
||||
LRegen,
|
||||
// Healing beam upgrades
|
||||
HHeal,
|
||||
HCost,
|
||||
HRange,
|
||||
HDuration,
|
||||
HCost,
|
||||
// Warding aura upgrades
|
||||
UnlockAura,
|
||||
AStrength,
|
||||
@ -499,6 +500,7 @@ impl Boost for SceptreSkill {
|
||||
// Healing beam upgrades
|
||||
Self::HHeal => 20.into(),
|
||||
Self::HRange => 20.into(),
|
||||
Self::HDuration => 20.into(),
|
||||
Self::HCost => (-20_i16).into(),
|
||||
// Warding aura upgrades
|
||||
Self::AStrength => 15.into(),
|
||||
|
@ -69,7 +69,7 @@ impl CharacterBehavior for Data {
|
||||
// Creates aura
|
||||
let targets =
|
||||
AuraTarget::from((Some(self.static_data.targets), Some(data.uid)));
|
||||
let aura = self.static_data.aura.to_aura(
|
||||
let mut aura = self.static_data.aura.to_aura(
|
||||
data.uid,
|
||||
self.static_data.range,
|
||||
Some(self.static_data.aura_duration),
|
||||
@ -80,11 +80,11 @@ impl CharacterBehavior for Data {
|
||||
match aura.aura_kind {
|
||||
AuraKind::Buff {
|
||||
kind: _,
|
||||
mut data,
|
||||
ref mut data,
|
||||
category: _,
|
||||
source: _,
|
||||
} => {
|
||||
data.strength *= 1.1_f32;
|
||||
data.strength *= 1.0 + (combo as f32).log(2.0_f32);
|
||||
},
|
||||
}
|
||||
update.server_events.push_front(ServerEvent::ComboChange {
|
||||
|
@ -122,8 +122,9 @@ pub fn skill_to_db_string(skill: comp::skills::Skill) -> String {
|
||||
Sceptre(SceptreSkill::LLifesteal) => "Sceptre LLifesteal",
|
||||
Sceptre(SceptreSkill::LRegen) => "Sceptre LRegen",
|
||||
Sceptre(SceptreSkill::HHeal) => "Sceptre HHeal",
|
||||
Sceptre(SceptreSkill::HCost) => "Sceptre HCost",
|
||||
Sceptre(SceptreSkill::HDuration) => "Sceptre HDuration",
|
||||
Sceptre(SceptreSkill::HRange) => "Sceptre HRange",
|
||||
Sceptre(SceptreSkill::HCost) => "Sceptre HCost",
|
||||
Sceptre(SceptreSkill::UnlockAura) => "Sceptre UnlockAura",
|
||||
Sceptre(SceptreSkill::AStrength) => "Sceptre AStrength",
|
||||
Sceptre(SceptreSkill::ADuration) => "Sceptre ADuration",
|
||||
|
@ -19,9 +19,9 @@ use common::{
|
||||
},
|
||||
skills::{AxeSkill, BowSkill, HammerSkill, SceptreSkill, Skill, StaffSkill, SwordSkill},
|
||||
Agent, Alignment, BehaviorCapability, BehaviorState, Body, CharacterAbility,
|
||||
CharacterState, ControlAction, ControlEvent, Controller, Energy, Health, HealthChange,
|
||||
InputKind, Inventory, InventoryAction, LightEmitter, MountState, Ori, PhysicsState, Pos,
|
||||
Scale, SkillSet, Stats, UnresolvedChatMsg, UtteranceKind, Vel,
|
||||
CharacterState, Combo, ControlAction, ControlEvent, Controller, Energy, Health,
|
||||
HealthChange, InputKind, Inventory, InventoryAction, LightEmitter, MountState, Ori,
|
||||
PhysicsState, Pos, Scale, SkillSet, Stats, UnresolvedChatMsg, UtteranceKind, Vel,
|
||||
},
|
||||
consts::GRAVITY,
|
||||
effect::{BuffEffect, Effect},
|
||||
@ -157,6 +157,7 @@ pub struct ReadData<'a> {
|
||||
world: ReadExpect<'a, Arc<world::World>>,
|
||||
rtsim_entities: ReadStorage<'a, RtSimEntity>,
|
||||
buffs: ReadStorage<'a, Buffs>,
|
||||
combos: ReadStorage<'a, Combo>,
|
||||
}
|
||||
|
||||
// This is 3.1 to last longer than the last damage timer (3.0 seconds)
|
||||
@ -2445,6 +2446,7 @@ impl<'a> AgentData<'a> {
|
||||
read_data: &ReadData,
|
||||
) {
|
||||
const DESIRED_ENERGY_LEVEL: u32 = 500;
|
||||
const DESIRED_COMBO_LEVEL: u32 = 8;
|
||||
// Logic to use abilities
|
||||
if attack_data.dist_sqrd > attack_data.min_attack_dist.powi(2)
|
||||
&& can_see_tgt(
|
||||
@ -2456,7 +2458,23 @@ impl<'a> AgentData<'a> {
|
||||
{
|
||||
// If far enough away, and can see target, check which skill is appropriate to
|
||||
// use
|
||||
if self
|
||||
if self.energy.current() > DESIRED_ENERGY_LEVEL
|
||||
&& match read_data.combos.get(*self.entity) {
|
||||
Some(combo) => combo.counter() >= DESIRED_COMBO_LEVEL,
|
||||
None => false,
|
||||
}
|
||||
&& !read_data.buffs.get(*self.entity).iter().any(|buff| {
|
||||
buff.iter_kind(BuffKind::Regeneration)
|
||||
.peekable()
|
||||
.peek()
|
||||
.is_some()
|
||||
})
|
||||
{
|
||||
// If have enough energy and combo to use healing aura, do so
|
||||
controller
|
||||
.actions
|
||||
.push(ControlAction::basic_input(InputKind::Secondary));
|
||||
} else if self
|
||||
.skill_set
|
||||
.has_skill(Skill::Sceptre(SceptreSkill::UnlockAura))
|
||||
&& self.energy.current() > DESIRED_ENERGY_LEVEL
|
||||
|
Loading…
Reference in New Issue
Block a user