Platformer Pro  2.3.2
A platform game kit for Unity.
PlatformerPro.GroundMovement_LandWithDamage Class Reference

Ground movement to play a land animation. More...

Inheritance diagram for PlatformerPro.GroundMovement_LandWithDamage:
PlatformerPro.GroundMovement_SimpleLand PlatformerPro.GroundMovement PlatformerPro.BaseMovement< GroundMovement >

Public Member Functions

override void DoMove ()
 Moves the character. More...
 
override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the mvoement with the given movement data. More...
 
override bool WantsGroundControl ()
 Gets a value indicating whether this movement wants to control the movement on the ground. We want this if roll timer is set and user hasn't put in a counter input. More...
 
override void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
- Public Member Functions inherited from PlatformerPro.GroundMovement_SimpleLand
override void DoMove ()
 Moves the character. More...
 
override Movement Init (Character character, MovementVariable[] movementData)
 Initialise the movement with the given movement data. More...
 
override bool WantsGroundControl ()
 Gets a value indicating whether this movement wants to control the movement on the ground. We want this if roll timer is set and user hasn't put in a counter input. More...
 
override void LosingControl ()
 Called when the movement loses control. Override to do any reset type actions. More...
 
- Public Member Functions inherited from PlatformerPro.GroundMovement
virtual void ApplySlopeForce ()
 Applies slope force. More...
 
virtual float ApplySlopeSpeedModifier (float speed)
 Adjusts speed to cater for vertical movement More...
 
virtual float GetSpeed (float baseSpeed)
 Gets the ground speed. More...
 
virtual float GetRunSpeed (float baseRunSpeed)
 Gets the run speed. More...
 
virtual float GetAcceleration (float baseAcceleration)
 Gets the acceleration. More...
 
- Public Member Functions inherited from PlatformerPro.BaseMovement< GroundMovement >
sealed override Movement Init (Character character)
 Initialise this movement. More...
 
bool IsMovementDataDifferent (MovementVariable[] originalMovementData)
 Determines whether this instances movement data is different from the supplied originalMovementData. More...
 

Public Attributes

float minSpeedForDamage
 Min speed for which damage will be calculated. More...
 
bool constantDamage
 Is damage constant? More...
 
float damageAmount
 The damage amount or if non-constant damage will be calcualted as (1 + (speed.y - minSpeedForDamage)) * damageMultiplier. More...
 
- Public Attributes inherited from PlatformerPro.GroundMovement_SimpleLand
float landTime
 How long to play landing animation for. More...
 
bool allowWalk
 Can character still move on ground while landing animation is being played. More...
 
float minSpeedForLand
 The minimum speed for land. More...
 

Protected Member Functions

virtual void CalculateDamage ()
 Works out how much damage we should apply during move. More...
 
virtual void DoDamage (int damage)
 Does the damage. More...
 
- Protected Member Functions inherited from PlatformerPro.GroundMovement
virtual void SnapToGround ()
 Snaps the character to the ground. More...
 

Protected Attributes

CharacterHealth characterHealth
 Cached character health args. More...
 
int damageThisFrame
 How much damage should we cause this frame. More...
 
- Protected Attributes inherited from PlatformerPro.GroundMovement_SimpleLand
float landTimer
 How long till we stop rolling More...
 
- Protected Attributes inherited from PlatformerPro.BaseMovement< GroundMovement >
Movement implementation
 The class that will do the movement. More...
 
string movementType
 The type of movement as a string. More...
 
MovementVariable[] movementData
 Data that should be applied to the movement type on init. More...
 

Static Protected Attributes

const int MinSpeedForDamageIndex = 3
 The minimum index of the speed for damage. More...
 
const int ConstantDamageIndex = 4
 The index of the constant damage. More...
 
const int DamageAmountIndex = 5
 The index of the damage amount. More...
 
- Static Protected Attributes inherited from PlatformerPro.GroundMovement_SimpleLand
const int LandTimeIndex = 0
 The index for the land time. More...
 
const int AllowWalkIndex = 1
 The index for allow walk in the movement data. More...
 
const int MinSpeedForLandIndex = 2
 The index for min speed for land. More...
 
const int MovementVariableCount = 3
 The size of the movement variable array. More...
 
const float DefaultMinSpeedForLand = -2.0f
 Default minimum speed for land. More...
 

Properties

new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override int FacingDirection [get]
 Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the input direction. More...
 
- Properties inherited from PlatformerPro.GroundMovement_SimpleLand
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override AnimationState AnimationState [get]
 Gets the animation state that this movement wants to set. More...
 
override int FacingDirection [get]
 Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the input direction. More...
 
- Properties inherited from PlatformerPro.GroundMovement
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
virtual bool SupportsSlidingOnSlopes [get]
 Gets a value indicating whether this PlatformerPro.Movement can support automatic sliding based on the characters slope. More...
 
- Properties inherited from PlatformerPro.BaseMovement< GroundMovement >
virtual string MovementType [get, set]
 The type of movement as a string. More...
 
virtual MovementVariable[] MovementData [get, set]
 Data that should be applied to the movement type on init. More...
 
new static MovementInfo Info [get]
 Static movement info used by the editor. More...
 
override bool Enabled [get, set]
 A custom enable which base movements can use to pass on enable values. More...
 
override Movement Implementation [get]
 Gets the underlying implementation. More...
 

Detailed Description

Ground movement to play a land animation.

Member Function Documentation

◆ CalculateDamage()

virtual void PlatformerPro.GroundMovement_LandWithDamage.CalculateDamage ( )
protectedvirtual

Works out how much damage we should apply during move.

◆ DoDamage()

virtual void PlatformerPro.GroundMovement_LandWithDamage.DoDamage ( int  damage)
protectedvirtual

Does the damage.

◆ DoMove()

override void PlatformerPro.GroundMovement_LandWithDamage.DoMove ( )

Moves the character.

◆ Init()

override Movement PlatformerPro.GroundMovement_LandWithDamage.Init ( Character  character,
MovementVariable[]  movementData 
)

Initialise the mvoement with the given movement data.

Parameters
characterCharacter.
movementDataMovement data.

◆ LosingControl()

override void PlatformerPro.GroundMovement_LandWithDamage.LosingControl ( )

Called when the movement loses control. Override to do any reset type actions.

◆ WantsGroundControl()

override bool PlatformerPro.GroundMovement_LandWithDamage.WantsGroundControl ( )
virtual

Gets a value indicating whether this movement wants to control the movement on the ground. We want this if roll timer is set and user hasn't put in a counter input.

true if this instance wants control; otherwise, false.

Reimplemented from PlatformerPro.GroundMovement.

Member Data Documentation

◆ characterHealth

CharacterHealth PlatformerPro.GroundMovement_LandWithDamage.characterHealth
protected

Cached character health args.

◆ constantDamage

bool PlatformerPro.GroundMovement_LandWithDamage.constantDamage

Is damage constant?

◆ ConstantDamageIndex

const int PlatformerPro.GroundMovement_LandWithDamage.ConstantDamageIndex = 4
staticprotected

The index of the constant damage.

◆ damageAmount

float PlatformerPro.GroundMovement_LandWithDamage.damageAmount

The damage amount or if non-constant damage will be calcualted as (1 + (speed.y - minSpeedForDamage)) * damageMultiplier.

◆ DamageAmountIndex

const int PlatformerPro.GroundMovement_LandWithDamage.DamageAmountIndex = 5
staticprotected

The index of the damage amount.

◆ damageThisFrame

int PlatformerPro.GroundMovement_LandWithDamage.damageThisFrame
protected

How much damage should we cause this frame.

◆ minSpeedForDamage

float PlatformerPro.GroundMovement_LandWithDamage.minSpeedForDamage

Min speed for which damage will be calculated.

◆ MinSpeedForDamageIndex

const int PlatformerPro.GroundMovement_LandWithDamage.MinSpeedForDamageIndex = 3
staticprotected

The minimum index of the speed for damage.

Property Documentation

◆ AnimationState

override AnimationState PlatformerPro.GroundMovement_LandWithDamage.AnimationState
get

Gets the animation state that this movement wants to set.

◆ FacingDirection

override int PlatformerPro.GroundMovement_LandWithDamage.FacingDirection
get

Returns the direction the character is facing. 0 for none, 1 for right, -1 for left. This overriden version always returns the input direction.

◆ Info

new static MovementInfo PlatformerPro.GroundMovement_LandWithDamage.Info
staticget

Static movement info used by the editor.


The documentation for this class was generated from the following file: