Struct veloren_common::combat::Attack
source · pub struct Attack {
damages: Vec<AttackDamage>,
effects: Vec<AttackEffect>,
precision_multiplier: f32,
}
Fields§
§damages: Vec<AttackDamage>
§effects: Vec<AttackEffect>
§precision_multiplier: f32
Implementations§
source§impl Attack
impl Attack
pub fn with_damage(self, damage: AttackDamage) -> Self
pub fn with_effect(self, effect: AttackEffect) -> Self
pub fn with_precision(self, precision_multiplier: f32) -> Self
pub fn with_combo_requirement( self, combo: i32, requirement: CombatRequirement, ) -> Self
pub fn with_combo(self, combo: i32) -> Self
pub fn with_combo_increment(self) -> Self
pub fn effects(&self) -> impl Iterator<Item = &AttackEffect>
pub fn compute_block_damage_decrement( attacker: Option<&AttackerInfo<'_>>, damage_reduction: f32, target: &TargetInfo<'_>, source: AttackSource, dir: Dir, damage: Damage, msm: &MaterialStatManifest, time: Time, emitters: &mut (impl EmitExt<ParryHookEvent> + EmitExt<PoiseChangeEvent>), emit_outcome: impl FnMut(Outcome), ) -> f32
pub fn compute_damage_reduction( attacker: Option<&AttackerInfo<'_>>, target: &TargetInfo<'_>, damage: Damage, msm: &MaterialStatManifest, ) -> f32
pub fn apply_attack( &self, attacker: Option<AttackerInfo<'_>>, target: &TargetInfo<'_>, dir: Dir, options: AttackOptions, strength_modifier: f32, attack_source: AttackSource, time: Time, emitters: &mut (impl EmitExt<HealthChangeEvent> + EmitExt<EnergyChangeEvent> + EmitExt<ParryHookEvent> + EmitExt<KnockbackEvent> + EmitExt<BuffEvent> + EmitExt<PoiseChangeEvent> + EmitExt<ComboChangeEvent> + EmitExt<EntityAttackedHookEvent>), emit_outcome: impl FnMut(Outcome), rng: &mut ThreadRng, damage_instance_offset: u64, ) -> bool
Trait Implementations§
source§impl<'de> Deserialize<'de> for Attack
impl<'de> Deserialize<'de> for Attack
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
Auto Trait Implementations§
impl Freeze for Attack
impl RefUnwindSafe for Attack
impl Send for Attack
impl Sync for Attack
impl Unpin for Attack
impl UnwindSafe for Attack
Blanket Implementations§
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<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> 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.