Enum veloren_common::comp::ability::CharacterAbility
source · pub enum CharacterAbility {
Show 28 variants
BasicMelee {
energy_cost: f32,
buildup_duration: f32,
swing_duration: f32,
hit_timing: f32,
recover_duration: f32,
melee_constructor: MeleeConstructor,
ori_modifier: f32,
frontend_specifier: Option<FrontendSpecifier>,
meta: AbilityMeta,
},
BasicRanged {
energy_cost: f32,
buildup_duration: f32,
recover_duration: f32,
projectile: ProjectileConstructor,
projectile_body: Body,
projectile_light: Option<LightEmitter>,
projectile_speed: f32,
num_projectiles: Amount,
projectile_spread: f32,
damage_effect: Option<CombatEffect>,
move_efficiency: f32,
meta: AbilityMeta,
},
RepeaterRanged {Show 14 fields
energy_cost: f32,
buildup_duration: f32,
shoot_duration: f32,
recover_duration: f32,
max_speed: f32,
half_speed_at: u32,
projectile: ProjectileConstructor,
projectile_body: Body,
projectile_light: Option<LightEmitter>,
projectile_speed: f32,
damage_effect: Option<CombatEffect>,
properties_of_aoe: Option<ProjectileOffset>,
specifier: Option<FrontendSpecifier>,
meta: AbilityMeta,
},
Boost {
movement_duration: f32,
only_up: bool,
speed: f32,
max_exit_velocity: f32,
meta: AbilityMeta,
},
GlideBoost {
booster: Boost,
meta: AbilityMeta,
},
DashMelee {
energy_cost: f32,
energy_drain: f32,
forward_speed: f32,
buildup_duration: f32,
charge_duration: f32,
swing_duration: f32,
recover_duration: f32,
melee_constructor: MeleeConstructor,
ori_modifier: f32,
auto_charge: bool,
meta: AbilityMeta,
},
BasicBlock {
buildup_duration: f32,
recover_duration: f32,
max_angle: f32,
block_strength: f32,
parry_window: ParryWindow,
energy_cost: f32,
energy_regen: f32,
can_hold: bool,
blocked_attacks: AttackFilters,
meta: AbilityMeta,
},
Roll {
energy_cost: f32,
buildup_duration: f32,
movement_duration: f32,
recover_duration: f32,
roll_strength: f32,
attack_immunities: AttackFilters,
meta: AbilityMeta,
},
ComboMelee2 {
strikes: Vec<Strike<f32>>,
energy_cost_per_strike: f32,
specifier: Option<FrontendSpecifier>,
auto_progress: bool,
meta: AbilityMeta,
},
LeapMelee {
energy_cost: f32,
buildup_duration: f32,
movement_duration: f32,
swing_duration: f32,
recover_duration: f32,
melee_constructor: MeleeConstructor,
forward_leap_strength: f32,
vertical_leap_strength: f32,
damage_effect: Option<CombatEffect>,
specifier: Option<FrontendSpecifier>,
meta: AbilityMeta,
},
LeapShockwave {Show 20 fields
energy_cost: f32,
buildup_duration: f32,
movement_duration: f32,
swing_duration: f32,
recover_duration: f32,
damage: f32,
poise_damage: f32,
knockback: Knockback,
shockwave_angle: f32,
shockwave_vertical_angle: f32,
shockwave_speed: f32,
shockwave_duration: f32,
dodgeable: Dodgeable,
move_efficiency: f32,
damage_kind: DamageKind,
specifier: FrontendSpecifier,
damage_effect: Option<CombatEffect>,
forward_leap_strength: f32,
vertical_leap_strength: f32,
meta: AbilityMeta,
},
ChargedMelee {
energy_cost: f32,
energy_drain: f32,
buildup_strike: Option<(f32, MeleeConstructor)>,
charge_duration: f32,
swing_duration: f32,
hit_timing: f32,
recover_duration: f32,
melee_constructor: MeleeConstructor,
specifier: Option<FrontendSpecifier>,
damage_effect: Option<CombatEffect>,
custom_combo: Option<CustomCombo>,
meta: AbilityMeta,
},
ChargedRanged {Show 13 fields
energy_cost: f32,
energy_drain: f32,
projectile: ProjectileConstructor,
buildup_duration: f32,
charge_duration: f32,
recover_duration: f32,
projectile_body: Body,
projectile_light: Option<LightEmitter>,
initial_projectile_speed: f32,
scaled_projectile_speed: f32,
damage_effect: Option<CombatEffect>,
move_speed: f32,
meta: AbilityMeta,
},
Shockwave {Show 22 fields
energy_cost: f32,
buildup_duration: f32,
swing_duration: f32,
recover_duration: f32,
damage: f32,
poise_damage: f32,
knockback: Knockback,
shockwave_angle: f32,
shockwave_vertical_angle: f32,
shockwave_speed: f32,
shockwave_duration: f32,
dodgeable: Dodgeable,
move_efficiency: f32,
damage_kind: DamageKind,
specifier: FrontendSpecifier,
ori_rate: f32,
damage_effect: Option<CombatEffect>,
timing: Timing,
emit_outcome: bool,
minimum_combo: Option<u32>,
combo_consumption: ComboConsumption,
meta: AbilityMeta,
},
BasicBeam {Show 13 fields
buildup_duration: f32,
recover_duration: f32,
beam_duration: f64,
damage: f32,
tick_rate: f32,
range: f32,
max_angle: f32,
damage_effect: Option<CombatEffect>,
energy_regen: f32,
energy_drain: f32,
ori_rate: f32,
specifier: FrontendSpecifier,
meta: AbilityMeta,
},
BasicAura {
buildup_duration: f32,
cast_duration: f32,
recover_duration: f32,
targets: GroupTarget,
auras: Vec<AuraBuffConstructor>,
aura_duration: Option<Secs>,
range: f32,
energy_cost: f32,
scales_with_combo: bool,
specifier: Option<Specifier>,
meta: AbilityMeta,
},
StaticAura {
buildup_duration: f32,
cast_duration: f32,
recover_duration: f32,
energy_cost: f32,
targets: GroupTarget,
auras: Vec<AuraBuffConstructor>,
aura_duration: Option<Secs>,
range: f32,
sprite_info: Option<SpriteInfo>,
meta: AbilityMeta,
},
Blink {
buildup_duration: f32,
recover_duration: f32,
max_range: f32,
frontend_specifier: Option<FrontendSpecifier>,
meta: AbilityMeta,
},
BasicSummon {
buildup_duration: f32,
cast_duration: f32,
recover_duration: f32,
summon_amount: u32,
summon_distance: (f32, f32),
summon_info: SummonInfo,
duration: Option<Duration>,
meta: AbilityMeta,
},
SelfBuff {
buildup_duration: f32,
cast_duration: f32,
recover_duration: f32,
buff_kind: BuffKind,
buff_strength: f32,
buff_duration: Option<Secs>,
energy_cost: f32,
enforced_limit: bool,
combo_cost: u32,
combo_scaling: Option<ScalingKind>,
meta: AbilityMeta,
specifier: Option<FrontendSpecifier>,
},
SpriteSummon {
buildup_duration: f32,
cast_duration: f32,
recover_duration: f32,
sprite: SpriteKind,
del_timeout: Option<(f32, f32)>,
summon_distance: (f32, f32),
sparseness: f64,
angle: f32,
anchor: SpriteSummonAnchor,
move_efficiency: f32,
meta: AbilityMeta,
},
Music {
play_duration: f32,
ori_modifier: f32,
meta: AbilityMeta,
},
FinisherMelee {
energy_cost: f32,
buildup_duration: f32,
swing_duration: f32,
recover_duration: f32,
melee_constructor: MeleeConstructor,
minimum_combo: u32,
scaling: Option<Scaling>,
combo_consumption: ComboConsumption,
meta: AbilityMeta,
},
DiveMelee {
energy_cost: f32,
vertical_speed: f32,
buildup_duration: Option<f32>,
movement_duration: f32,
swing_duration: f32,
recover_duration: f32,
melee_constructor: MeleeConstructor,
max_scaling: f32,
meta: AbilityMeta,
},
RiposteMelee {
energy_cost: f32,
buildup_duration: f32,
swing_duration: f32,
recover_duration: f32,
whiffed_recover_duration: f32,
block_strength: f32,
melee_constructor: MeleeConstructor,
meta: AbilityMeta,
},
RapidMelee {
buildup_duration: f32,
swing_duration: f32,
recover_duration: f32,
energy_cost: f32,
max_strikes: Option<u32>,
melee_constructor: MeleeConstructor,
move_modifier: f32,
ori_modifier: f32,
frontend_specifier: Option<FrontendSpecifier>,
minimum_combo: u32,
meta: AbilityMeta,
},
Transform {
buildup_duration: f32,
recover_duration: f32,
target: String,
specifier: Option<FrontendSpecifier>,
allow_players: bool,
meta: AbilityMeta,
},
RegrowHead {
buildup_duration: f32,
recover_duration: f32,
energy_cost: f32,
specifier: Option<FrontendSpecifier>,
meta: AbilityMeta,
},
}
Expand description
For documentation on individual fields, see the corresponding character state file in ‘common/src/states/’
Variants§
BasicMelee
Fields
§
melee_constructor: MeleeConstructor
§
frontend_specifier: Option<FrontendSpecifier>
§
meta: AbilityMeta
BasicRanged
Fields
§
projectile: ProjectileConstructor
§
projectile_light: Option<LightEmitter>
§
damage_effect: Option<CombatEffect>
§
meta: AbilityMeta
RepeaterRanged
Fields
§
projectile: ProjectileConstructor
§
projectile_light: Option<LightEmitter>
§
damage_effect: Option<CombatEffect>
§
properties_of_aoe: Option<ProjectileOffset>
§
specifier: Option<FrontendSpecifier>
§
meta: AbilityMeta
Boost
GlideBoost
DashMelee
BasicBlock
Roll
ComboMelee2
LeapMelee
Fields
§
melee_constructor: MeleeConstructor
§
damage_effect: Option<CombatEffect>
§
specifier: Option<FrontendSpecifier>
§
meta: AbilityMeta
LeapShockwave
Fields
§
damage_kind: DamageKind
§
specifier: FrontendSpecifier
§
damage_effect: Option<CombatEffect>
§
meta: AbilityMeta
ChargedMelee
Fields
§
buildup_strike: Option<(f32, MeleeConstructor)>
§
melee_constructor: MeleeConstructor
§
specifier: Option<FrontendSpecifier>
§
damage_effect: Option<CombatEffect>
§
custom_combo: Option<CustomCombo>
§
meta: AbilityMeta
ChargedRanged
Fields
§
projectile: ProjectileConstructor
§
projectile_light: Option<LightEmitter>
§
damage_effect: Option<CombatEffect>
§
meta: AbilityMeta
Shockwave
Fields
§
damage_kind: DamageKind
§
specifier: FrontendSpecifier
§
damage_effect: Option<CombatEffect>
§
combo_consumption: ComboConsumption
§
meta: AbilityMeta
BasicBeam
BasicAura
StaticAura
Fields
§
targets: GroupTarget
§
auras: Vec<AuraBuffConstructor>
§
sprite_info: Option<SpriteInfo>
§
meta: AbilityMeta
Blink
BasicSummon
SelfBuff
SpriteSummon
Music
FinisherMelee
DiveMelee
RiposteMelee
RapidMelee
Fields
§
melee_constructor: MeleeConstructor
§
frontend_specifier: Option<FrontendSpecifier>
§
meta: AbilityMeta
Transform
Fields
§
specifier: Option<FrontendSpecifier>
§
allow_players: bool
Only set to true
for admin only abilities since this disables
persistence and is not intended to be used by regular players
§
meta: AbilityMeta
RegrowHead
Implementations§
source§impl CharacterAbility
impl CharacterAbility
sourcepub fn requirements_paid(
&self,
data: &JoinData<'_>,
update: &mut StateUpdate,
) -> bool
pub fn requirements_paid( &self, data: &JoinData<'_>, update: &mut StateUpdate, ) -> bool
Attempts to fulfill requirements, mutating update
(taking energy) if
applicable.
pub fn default_roll(current_state: Option<&CharacterState>) -> CharacterAbility
pub fn adjusted_by_stats(self, stats: Stats) -> Self
pub fn energy_cost(&self) -> f32
pub fn combo_cost(&self) -> u32
pub fn ability_meta(&self) -> AbilityMeta
pub fn adjusted_by_skills( self, skillset: &SkillSet, tool: Option<ToolKind>, ) -> Self
fn adjusted_by_mining_skills(&mut self, skillset: &SkillSet)
fn adjusted_by_bow_skills(&mut self, skillset: &SkillSet)
fn adjusted_by_staff_skills(&mut self, skillset: &SkillSet)
fn adjusted_by_sceptre_skills(&mut self, skillset: &SkillSet)
Trait Implementations§
source§impl Asset for CharacterAbility
impl Asset for CharacterAbility
source§const EXTENSION: &'static str = "ron"
const EXTENSION: &'static str = "ron"
Use this field if your asset only uses one extension. Read more
§const EXTENSIONS: &'static [&'static str] = _
const EXTENSIONS: &'static [&'static str] = _
This field enables you to specify multiple extension for an asset. Read more
§fn default_value(
id: &SharedString,
error: Box<dyn Error + Send + Sync>,
) -> Result<Self, Box<dyn Error + Send + Sync>>
fn default_value( id: &SharedString, error: Box<dyn Error + Send + Sync>, ) -> Result<Self, Box<dyn Error + Send + Sync>>
Specifies a eventual default value to use if an asset fails to load. If
this method returns
Ok
, the returned value is used as an asset. In
particular, if this method always returns Ok
, AssetCache::load
is
guaranteed not to fail. Read more§const HOT_RELOADED: bool = true
const HOT_RELOADED: bool = true
If
false
, disable hot-reloading for assets of this type (true
by
default). This avoids having to lock the asset to read it (ie it makes
[Handle::read
] a noop)source§impl Clone for CharacterAbility
impl Clone for CharacterAbility
source§fn clone(&self) -> CharacterAbility
fn clone(&self) -> CharacterAbility
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CharacterAbility
impl Debug for CharacterAbility
source§impl Default for CharacterAbility
impl Default for CharacterAbility
source§impl<'de> Deserialize<'de> for CharacterAbility
impl<'de> Deserialize<'de> for CharacterAbility
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for CharacterAbility
impl PartialEq for CharacterAbility
source§fn eq(&self, other: &CharacterAbility) -> bool
fn eq(&self, other: &CharacterAbility) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for CharacterAbility
impl Serialize for CharacterAbility
impl StructuralPartialEq for CharacterAbility
Auto Trait Implementations§
impl Freeze for CharacterAbility
impl RefUnwindSafe for CharacterAbility
impl Send for CharacterAbility
impl Sync for CharacterAbility
impl Unpin for CharacterAbility
impl UnwindSafe for CharacterAbility
Blanket Implementations§
source§impl<T> AssetExt for Twhere
T: Compound,
impl<T> AssetExt for Twhere
T: Compound,
source§fn load(specifier: &str) -> Result<&'static Handle<T>, Error>
fn load(specifier: &str) -> Result<&'static Handle<T>, Error>
Function used to load assets from the filesystem or the cache.
Example usage: Read more
fn load_owned(specifier: &str) -> Result<T, Error>
fn get_or_insert(specifier: &str, default: T) -> &'static Handle<T>
source§fn load_cloned(specifier: &str) -> Result<Self, Error>where
Self: Clone,
fn load_cloned(specifier: &str) -> Result<Self, Error>where
Self: Clone,
Function used to load assets from the filesystem or the cache and return
a clone.
fn load_or_insert_with( specifier: &str, default: impl FnOnce(Error) -> Self, ) -> &'static Handle<Self>
source§fn load_expect(specifier: &str) -> &'static Handle<Self>
fn load_expect(specifier: &str) -> &'static Handle<Self>
Function used to load essential assets from the filesystem or the cache.
It will panic if the asset is not found. Example usage: Read more
source§fn load_expect_cloned(specifier: &str) -> Selfwhere
Self: Clone,
fn load_expect_cloned(specifier: &str) -> Selfwhere
Self: Clone,
Function used to load essential assets from the filesystem or the cache
and return a clone. It will panic if the asset is not found.
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T> Compound for Twhere
T: Asset,
impl<T> Compound for Twhere
T: Asset,
§fn load(
cache: AnyCache<'_>,
id: &SharedString,
) -> Result<T, Box<dyn Error + Send + Sync>>
fn load( cache: AnyCache<'_>, id: &SharedString, ) -> Result<T, Box<dyn Error + Send + Sync>>
Loads an asset from the cache. Read more
§const HOT_RELOADED: bool = Self::HOT_RELOADED
const HOT_RELOADED: bool = Self::HOT_RELOADED
If
false
, disable hot-reloading for assets of this type (true
by
default). This avoids having to lock the asset to read it (ie it makes
[Handle::read
] a noop)§impl<C, M> ConvertSaveload<M> for C
impl<C, M> ConvertSaveload<M> for C
§type Error = Infallible
type Error = Infallible
Error may occur during serialization or deserialization of component
§fn convert_into<F>(
&self,
_: F,
) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
fn convert_into<F>( &self, _: F, ) -> Result<<C as ConvertSaveload<M>>::Data, <C as ConvertSaveload<M>>::Error>
Convert this data type into serializable form (
Data
) using
entity to marker mapping function§fn convert_from<F>(
data: <C as ConvertSaveload<M>>::Data,
_: F,
) -> Result<C, <C as ConvertSaveload<M>>::Error>
fn convert_from<F>( data: <C as ConvertSaveload<M>>::Data, _: F, ) -> Result<C, <C as ConvertSaveload<M>>::Error>
Convert this data from a deserializable form (
Data
) using
entity to marker mapping function§impl<T> DirLoadable for Twhere
T: Asset,
impl<T> DirLoadable for Twhere
T: Asset,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<Context> SubContext<Context> for Context
impl<Context> SubContext<Context> for Context
fn sub_context(self) -> Context
§impl<T> TryDefault for Twhere
T: Default,
impl<T> TryDefault for Twhere
T: Default,
§fn try_default() -> Result<T, String>
fn try_default() -> Result<T, String>
Tries to create the default.
§fn unwrap_default() -> Self
fn unwrap_default() -> Self
Calls
try_default
and panics on an error case.