Loading...
Searching...
No Matches
AdventureSouls.SoulsCriticalAction Class Reference

Detailed Description

action that gets checked by attacks with SoulsAttackAction.CanCritical
can only start when the trigger of a character with IGetCritted is in its trigger area
it also checks if that angle is right for a front/back crit provided the critted character is open there
when it is actually started it forces the critted character into a SoulsCrittedAction in addition ot START/END a HIT message has to be sent to indicate to moment of impact

https://adventure.softleitner.com/manual/acting

Inheritance diagram for AdventureSouls.SoulsCriticalAction:
AdventureCore.CharacterActionBase AdventureCore.IDamageSender AdventureCore.ICharacterAssociator AdventureCore.ICharacterAssociator

Public Member Functions

override bool CanStart (CharacterActorBase actor)
 
override void OnStart (CharacterActorBase actor, bool jumpStart=false)
 
override void OnEnd (CharacterActionBase next)
 
override void OnMessage (string parameter)
 
virtual Vector3 GetPosition ()
 position of the receiver, may be used to determine damage direction
 
virtual Vector3 GetDirection (IDamageReceiver receiver)
 calculates direction of damage between this sender and a receiver
 
bool PreDamage (IDamageReceiver receiver)
 called before any real damage handling to check if the handling is valid and should continue
for example if a character is currently dodging damage handling can be cancelled here
 
void OnDamage (DamageEvent e)
 this is where the main damage handling should take place and damage vectors are assigned
OnDamage is called in the order Sender > Receiver > Damage
for example if a character is wearing protective gear it may reduce the damage value here
this method is called for every damage parameter see DamageEvent for more details
 
void PostDamage (IDamageReceiver receiver, List< DamageEvent > events)
 called after alle the damages have been applied
this is a good spot to react to the change of state that has been done by the damages
for example death or destruction if health was reduced to 0 by the damages
 
- Public Member Functions inherited from AdventureCore.CharacterActionBase
void BindInput (InputAction inputAction)
 
void UnbindInput (InputAction inputAction)
 
virtual void Input (InputAction.CallbackContext callbackContext)
 
virtual void Input (InputAction.CallbackContext callbackContext, CharacterActorBase actor)
 
virtual void InputClick (CharacterActorBase actor)
 
virtual void InputDown (CharacterActorBase actor)
 
virtual void InputUp (CharacterActorBase actor)
 
virtual bool CanEnd (CharacterActionBase next)
 
void ForceAction (bool jumpStart=false)
 convenience method for inspector events that calls StartAction(bool, bool) with force=true
 
void JumpStartAction (bool force=false)
 convenience method for inspector events that calls StartAction(bool, bool) with jumpStart=true
 
void StartAction ()
 overload of StartAction(bool, bool) without a return type so it can be found in event triggers in the inspector
 
bool StartAction (bool jumpStart=false, bool force=false)
 
virtual bool StartAction (CharacterActorBase actor, bool jumpStart=false, bool force=false)
 
virtual void EndAction ()
 
virtual void AddAction (CharacterActorBase actor)
 
virtual void RemoveAction (CharacterActorBase actor)
 
virtual void SendCharacterMessages (string e)
 
virtual void SendCharacterMessage (string e)
 
virtual void MoveCharacter (Transform transform)
 
virtual void OnInput (bool parameter)
 
virtual void OnInput (int parameter)
 
virtual void OnInput (Vector2 parameter)
 
virtual string GetName ()
 

Public Attributes

float Tolerance = 20f
 
DamageParameter[] Damages
 
GenericTriggerArea TriggerArea
 
SoulsCrittedAction CrittedAction
 
- Public Attributes inherited from AdventureCore.CharacterActionBase
CharacterInstructionBase[] Instructions
 
CharacterActorBase Owner
 
CharacterActionInputType InputType
 
CharacterActionBase Next
 
UnityEvent< string > MessageReceived
 
MessageEvent[] MessageEvents
 
UnityEvent Starting
 
UnityEvent Ending
 

Static Public Attributes

static int CRITICAL_HASH = Animator.StringToHash("Critical")
 

Additional Inherited Members

- Public Types inherited from AdventureCore.CharacterActionBase
enum  CharacterActionInputType { Perform = 0 , PerformCancel = 1 , Start = 10 , StartCancel = 11 }
 
- Protected Member Functions inherited from AdventureCore.CharacterActionBase
virtual void OnDestroy ()
 
virtual void OnEnable ()
 
virtual void OnDisable ()
 
virtual void setTrigger (int id)
 
virtual void setBool (int id, bool value)
 
virtual void setInt (int id, int value)
 
virtual void setFloat (int id, float value)
 
virtual void setState (int id)
 
void onCanStartChanged ()
 
void onCanEndChanged ()
 
void addInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void removeInstructions (IEnumerable< CharacterInstructionBase > instructions)
 
void addInstruction (CharacterInstructionBase instruction)
 
void removeInstruction (CharacterInstructionBase instruction)
 
- Static Protected Member Functions inherited from AdventureCore.CharacterActionBase
static bool checkMessage (string parameter, string message)
 
- Protected Attributes inherited from AdventureCore.CharacterActionBase
bool _isDestroyed = false
 
- Properties inherited from AdventureCore.CharacterActionBase
CharacterActorBase Actor [get]
 
CharacterBase AssociatedCharacter [get]
 character that owns or is otherwise associted with the object
 
virtual bool IsAvailable [get, set]
 IsAvailable asserts whether an action is availabel at all, even if it can't be started.
 
virtual bool IsHappening [get]
 whether the action is currently being executed
 
virtual bool IsHappeningWithNext [get]
 
- Properties inherited from AdventureCore.ICharacterAssociator
- Properties inherited from AdventureCore.IDamageSender
- Events inherited from AdventureCore.CharacterActionBase
Action< bool > IsAvailableChanged
 IsAvailable asserts whether an action is availabel at all, even if it can't be started.
 
Action< bool > IsHappeningChanged
 fired when the action starts and ends
 
Action< CharacterActionBaseCanStartChanged
 fired when whether the action can be started changes
 
Action< CharacterActionBaseCanEndChanged
 fired when whether the action can be ended changes
some actions can be ended before they end on their own(released motions for example)
 

Member Function Documentation

◆ CanStart()

override bool AdventureSouls.SoulsCriticalAction.CanStart ( CharacterActorBase actor)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ GetDirection()

virtual Vector3 AdventureSouls.SoulsCriticalAction.GetDirection ( IDamageReceiver receiver)
virtual

calculates direction of damage between this sender and a receiver

Parameters
receiver
Returns

Implements AdventureCore.IDamageSender.

◆ GetPosition()

virtual Vector3 AdventureSouls.SoulsCriticalAction.GetPosition ( )
virtual

position of the receiver, may be used to determine damage direction

Returns
position of the receiver, or the character associated with it

Implements AdventureCore.IDamageSender.

◆ OnDamage()

void AdventureSouls.SoulsCriticalAction.OnDamage ( DamageEvent e)
inline

this is where the main damage handling should take place and damage vectors are assigned
OnDamage is called in the order Sender > Receiver > Damage
for example if a character is wearing protective gear it may reduce the damage value here
this method is called for every damage parameter see DamageEvent for more details

Parameters
e

Implements AdventureCore.IDamageSender.

◆ OnEnd()

override void AdventureSouls.SoulsCriticalAction.OnEnd ( CharacterActionBase next)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnMessage()

override void AdventureSouls.SoulsCriticalAction.OnMessage ( string parameter)
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ OnStart()

override void AdventureSouls.SoulsCriticalAction.OnStart ( CharacterActorBase actor,
bool jumpStart = false )
inlinevirtual

Reimplemented from AdventureCore.CharacterActionBase.

◆ PostDamage()

void AdventureSouls.SoulsCriticalAction.PostDamage ( IDamageReceiver receiver,
List< DamageEvent > events )
inline

called after alle the damages have been applied
this is a good spot to react to the change of state that has been done by the damages
for example death or destruction if health was reduced to 0 by the damages

Parameters
sender
events

Implements AdventureCore.IDamageSender.

◆ PreDamage()

bool AdventureSouls.SoulsCriticalAction.PreDamage ( IDamageReceiver receiver)

called before any real damage handling to check if the handling is valid and should continue
for example if a character is currently dodging damage handling can be cancelled here

Parameters
receiver
Returns
whether the damage handling should continue

Implements AdventureCore.IDamageSender.