Skip to content

H7WarUnit

Class in MMH7Game · MMH7Game.H7WarUnit · native, perobjectconfig

Object › Actor › SkeletalMeshActor › SkeletalMeshCinematicActor › SkeletalMeshActorMAT › H7Unit › H7WarUnit

Implements: H7IGUIListenable, H7IOffGridDeployable

Using it from Lua
h7.find_all("H7WarUnit")            -- live instances
h7.find_class("MMH7Game.H7WarUnit")   -- the class
h7.hook("MMH7Game.H7WarUnit.ApplyDamage", fn)

Properties

NameTypeNotes
CurrentDeathMaterialEffectsarray<H7DeathMaterialEffect>protected
mAIControlledboolprotected
mAimingSkeletalMeshSkeletalMeshComponentprotectedwrite
mAimingTimefloatprotected
mAnimControlH7WarUnitAnimControlprotected
mAnimControlEventsarray<H7WarfareEvent>protected
mAttackCountThisRoundintprotected
mBaseAttackintprotected
mBaseDefenseintprotected
mCombatControllerH7CombatControllerprotected
mCombatGridControllerH7CombatMapGridControllerprotected
mCurrentHitpointsintprotected
mDamageSoundEventAkEventprotected
mDeathMaterialFXarray<H7DeathMaterialEffect>protected
mDefaultWarfareAbilityH7BaseAbilityprotected
mDefaultWarfareSupportAbilityH7BaseAbilityprotected
mDynamicLightEnvDynamicLightEnvironmentComponentprotected
mFXH7WarUnitFXprotected
mHitpointsintprotected
mHitSoundEventAkEventprotected
mIsDeployedboolprotected
mIsHoveringboolprotected
mOrientedAttackAnimIdH7StructsAndEnums.EWarUnitAnimationprotected
mSkeletalMeshSkeletalMeshComponentprotectedwrite
mSkeletalMeshAuraSkeletalMeshComponentconst, protectedwrite
mSkipAbilityH7BaseAbilityprotected
mStartRotRotatorprotected
mTargetLocationVectorprotected
mTemplateH7EditorWarUnitprotected
mWarUnitClassH7StructsAndEnumsNative.EWarUnitClassprotected
mWarUnitMaterialsarray<MaterialInstanceConstant>protected

Functions

NameDeclaration
ApplyDamagesimulated function ApplyDamage(H7CombatResult Result, int resultIdx, bool isForecast, optional bool isRetaliation = false, optional bool raiseEvent = true)
ApplyHeroArmyBonusBufffunction ApplyHeroArmyBonusBuff()
BeginTurnfunction bool BeginTurn()
ClearAttackCountfunction ClearAttackCount()
DataChangedevent DataChanged(optional string cause)
DebugLogSelfprotected function DebugLogSelf()
DeHighlightWarfareUnitevent DeHighlightWarfareUnit()
doSkipfunction doSkip()
EndTurnfunction EndTurn()
FaceTargetObstaclefunction FaceTargetObstacle(H7IEffectTargetable Target)
GetAnimControlfunction H7WarUnitAnimControl GetAnimControl()
GetAttackevent int GetAttack()
GetAttackRangefunction H7StructsAndEnumsNative.EAttackRange GetAttackRange()
GetBaseAttackfunction int GetBaseAttack()
GetBaseDefensefunction int GetBaseDefense()
GetCellfunction H7CombatMapCell GetCell()
GetCurrentHitPointsfunction int GetCurrentHitPoints()
GetDamageResultfunction GetDamageResult(int dmg, out int currentHealth, optional bool isForecast = false)
GetDefaultAbilityfunction H7BaseAbility GetDefaultAbility()
GetEntityTypenative function H7StructsAndEnumsNative.EUnitType GetEntityType()
GetFloatingTextLocationfunction Vector GetFloatingTextLocation()
GetGridPositionfunction IntPoint GetGridPosition()
GetHeightfunction float GetHeight()
GetHitPointsfunction int GetHitPoints()
GetHitPointsBasefunction int GetHitPointsBase()
GetIconfunction Texture2D GetIcon()
GetInitialStackSizefunction int GetInitialStackSize()
GetMaximumDamageevent float GetMaximumDamage()
GetMaximumDamageBaseevent int GetMaximumDamageBase()
GetMeshCenternative function Vector GetMeshCenter()
GetMinimumDamageevent float GetMinimumDamage()
GetMinimumDamageBaseevent int GetMinimumDamageBase()
GetModifiersByIDnative function GetModifiersByID(out array<H7MeModifiesStat> outStats, H7StructsAndEnumsNative.EStat desiredStat, optional H7StructsAndEnumsNative.EOperationType exclusiveFirstOT = 255, optional H7StructsAndEnumsNative.EOperationType exclusiveSecondOT = 255, optional bool nextRound)
GetMovementPointsfunction int GetMovementPoints()
GetMovementTypefunction H7StructsAndEnumsNative.EMovementType GetMovementType()
GetNamefunction string GetName()
GetOrientationToTargetfunction float GetOrientationToTarget(H7IEffectTargetable Target)
GetOrientedAttackAnimFromAimfunction H7StructsAndEnums.EWarUnitAnimation GetOrientedAttackAnimFromAim(float Aim)
GetOrientedAttackAnimIdfunction H7StructsAndEnums.EWarUnitAnimation GetOrientedAttackAnimId()
GetSchoolfunction H7StructsAndEnumsNative.EAbilitySchool GetSchool()
GetSkipAbilityfunction H7BaseAbility GetSkipAbility()
GetSkipTurnAbilityfunction H7BaseAbility GetSkipTurnAbility()
GetSocketLocationnative function Vector GetSocketLocation(name SocketName)
GetStackSizefunction int GetStackSize()
GetSupportAbilityfunction H7BaseAbility GetSupportAbility()
GetTemplatefunction H7EditorWarUnit GetTemplate()
GetTemplateAsUnitfunction H7Unit GetTemplateAsUnit()
GetUnitBaseSizenative function H7StructsAndEnumsNative.ECellSize GetUnitBaseSize()
GetUnitBaseSizeIntfunction int GetUnitBaseSizeInt()
GetWarfareAttackAbilityTemplatefunction H7BaseAbility GetWarfareAttackAbilityTemplate()
GetWarUnitClassfunction H7StructsAndEnumsNative.EWarUnitClass GetWarUnitClass()
GUIAddListenerfunction GUIAddListener(GFxObject Data, optional H7StructsAndEnums.H7ListenFocus Focus)
GUIWriteIntofunction GUIWriteInto(GFxObject Data, optional H7StructsAndEnums.H7ListenFocus Focus, optional H7GFxUIContainer flashFactory)
HasFullActionfunction bool HasFullAction()
HideSlotFXprotected function HideSlotFX(H7CombatMapCell myCell)
HighlightWarfareUnitfunction HighlightWarfareUnit()
IncrementAttackCountfunction IncrementAttackCount()
Initfunction Init(optional bool fromSave)
InitFXprotected function InitFX()
IsControlledByAIfunction bool IsControlledByAI()
IsDeadnative function bool IsDead()
IsDeployedfunction bool IsDeployed()
OnFaceTargetObstacleFinishedFuncdelegate OnFaceTargetObstacleFinishedFunc()
PlayDeathEffectfunction PlayDeathEffect()
PlayDeathMaterialEffectsfunction PlayDeathMaterialEffects(optional bool undo = false)
PostInitAnimTreesimulated event PostInitAnimTree(SkeletalMeshComponent SkelComp)
PrepareDefaultAbilityevent PrepareDefaultAbility()
RecalculatePostAnimInputfunction RecalculatePostAnimInput()
ReplaceAttackAbilityfunction ReplaceAttackAbility(H7BaseAbility A)
ReplaceDefaultAbilityfunction ReplaceDefaultAbility(H7BaseAbility A)
ReplaceSupportAbilityfunction ReplaceSupportAbility(H7BaseAbility A)
SetAIControledfunction SetAIControled(bool B)
SetAnimEventsfunction SetAnimEvents(array<H7WarfareEvent> E)
SetBaseAttackfunction SetBaseAttack(int Attack)
SetBaseDefensefunction SetBaseDefense(int Defense)
SetCurrentHitPointsfunction SetCurrentHitPoints(int NewValue)
SetDamagefunction SetDamage(int minDmg, int maxDmg)
SetDamageSoundEventfunction SetDamageSoundEvent(AkEvent Sound)
SetDeathMaterialEffectsfunction SetDeathMaterialEffects(array<H7DeathMaterialEffect> deathFX)
SetDefaultAbilityfunction SetDefaultAbility(H7BaseAbility A)
SetDeployedfunction SetDeployed(bool val)
SetDestroyedfunction SetDestroyed()
SetFactionfunction SetFaction(H7Faction Faction)
SetGetHitSoundEventfunction SetGetHitSoundEvent(AkEvent Sound)
SetGridPositionfunction SetGridPosition(IntPoint gp)
SetHitPointsBasefunction SetHitPointsBase(int hp)
SetIconfunction SetIcon(Texture2D Icon)
SetMeshesfunction SetMeshes(SkeletalMeshComponent SkelMesh, SkeletalMeshComponent AimingSkelMesh)
SetNamefunction SetName(string OverrideName)
SetRangedAttackAbilityfunction SetRangedAttackAbility(H7BaseAbility Ability)
SetSkipAbilityfunction SetSkipAbility(H7BaseAbility Ability)
SetSupportAbilityfunction SetSupportAbility(H7BaseAbility A)
SetTemplatefunction SetTemplate(H7EditorWarUnit Template)
SetWarUnitClassfunction SetWarUnitClass(H7StructsAndEnumsNative.EWarUnitClass C)
ShowSlotFXActiveprotected function ShowSlotFXActive(H7CombatMapCell myCell)
ShowSlotFXAllyprotected function ShowSlotFXAlly(H7CombatMapCell myCell)
ShowSlotFXDeadAllyprotected function ShowSlotFXDeadAlly(H7CombatMapCell myCell)
ShowSlotFXEnemyprotected function ShowSlotFXEnemy(H7CombatMapCell myCell)
Tickevent Tick(float DeltaTime)
TurnChangedfunction TurnChanged()
UpdateAbilitySlotFXprotected function UpdateAbilitySlotFX(H7CombatMapCell myCell, H7BaseAbility preparedAbility)
UpdateSlotFXfunction UpdateSlotFX()
WillExceedAttackCountfunction bool WillExceedAttackCount()

States

State code replaces the class's functions while the object is in that state. Hook a state's version as MMH7Game.H7WarUnit.<State>.<Function>.

StateFunctions
AimingBeginState, GetOptimalTargetRotation, Tick
Waiting

Default values

mIsDeployed=true

Inherited

FromMembers
H7UnitProperties: mAbilityManager, mAnimSoundSpeedManipulator, mArmy, mArmyAdventure, mArtwork, mAttack, mAttackCount, mAttackCountMod, mBuffManager, mCasualtyStacks, mCollider, mColliderHeight, mColliderRadius, mCombatCtrl, mCurrentWave, mDefense, mDestiny, mDoStatusCheck, mEffectManager, mEmitterPoolParticleComps, mEventManager, mFaction, mFactionSymbol, mFinishedCommand, mFlankingBonus, mGhostWalkParticles, mGridPos, mHasBadMoral, mIcon, Mid, mIgnoreAllegiances, mInitiative, mIsAdditionalTurn, mIsDoneForAI, mIsMoralTurn, mIsWaiting, mIsWaitTurn, mKillsOnCurrentTurn, mLastPath, mLastQueuePosition, mLeadership, mLore, mLoreInst, mLuckAbility, mLuckType, mMagicAbs, mMarkForSkipTurn, mMaximumDamage, mMeleeAttackAbilityTemplate, mMinimumDamage, mMoveCount, mMovementPoints, mName, mNameInst, mNeedsPrivileg, mNewCreaturePosition, mOverrideAutoCollider, mOverrideWithAI, mPrivilegID, mProjectileStartSocket, mRange, mRangedAttackAbilityTemplate, mRotateRandom, mSchoolType, mSkipTurn, mSkirmishAttack, mSkirmishDefense, mSkirmishDestiny, mSkirmishInitiative, mSkirmishLeadership, mSkirmishMaximumDamage, mSkirmishMinimumDamage, mSkirmishMovementPoints, mSkirmishSchoolType, mSkirmishUnitCost, mStatCache, mStatModSourceBuffer, mSubstituteLuckAbility, mTeleportationEndSound, mTeleportationStartSound, mTeleportEndEffect, mTeleportStartEffect, mTriggerTurnEndEvents, mTriggerTurnStartEvents, mTsunamiCasterValues, mUnitCost, mWaitAbility, mWaitClicked, mWaveSource
Functions: AllocatePooledEmitter, ApplyDamage, BeforeEndTurn, BeginAction, BeginTurn, CanAttack, CanDefend, CanMakeAction, CanMove, ChangeUnitAnimationSoundSpeed, CleanupEmitterPools, ClearStatCache, ClearTurns, DataChanged, DecreaseBaseStatByID, Defend, DeleteImage, Deserialize, DeserializeReferences, Destroyed, DisplayStatChangeFloat, DisplayStatChangeLog, DoDeathMaterialEffectFading, DoLuckRoll, DumpModifiers, EnableUnitMoveSound, EnableUnitSound, EndAction, EndMoving, EndTurn, FinishedCommand, GetAbilityManager, GetActionID, GetAddBoniOnStatByID, GetAdventureArmy, GetAllShieldEffects, GetAnimSoundSpeedManipulator, GetArmy, GetAttack, GetAttackCount, GetAttackType, GetBaseStatByID, GetBuffManager, GetColliderHeight, GetColliderRadius, GetCombatArmy, GetCurrentLuckType, GetDefense, GetDefenseBase, GetDestiny, GetDestinyBase, GetDoneForAI, GetEffectContainerForStat, GetEffectManager, GetEndTeleportFXSound, GetEntityType, GetEventManager, GetFaction, GetFlashArtworkPath, GetFlashIconPath, GetForeignMoralePenaltyModifier, GetGhostWalkParticleFX, GetGridPosition, GetHeightPos, GetHitPoints, GetIcon, GetID, GetIDString, GetIgnoreAllegiances, GetInitiative, GetKillsOnCurrentTurn, GetLastQueuePosition, GetLastWalkedPath, GetLastWalkedPathLength, GetLeadership, GetLeadershipBase, GetLocation, GetLore, GetLuckAbility, GetLuckDestiny, GetMagic, GetMaximumDamage, GetMaximumDamageBase, GetMeleeAttackAbility, GetMeshCenter, GetMeshComponent, GetMinimumDamage, GetMinimumDamageBase, GetModifiedStatByID, GetModifiersByID, GetMoveCount, GetMovementPoints, GetMovementPointsBase, GetMultiBoniOnStatByID, GetName, GetNegotiationChance, GetNextInitiative, GetOriginal, GetPlayer, GetPreparedAbility, GetProjectileStartSocketName, GetRangedAttackAbility, GetResistanceModifierFor, GetResistanceModifierForTag, GetSchool, GetSkipTurnAbility, GetSocketLocation, GetStackSize, GetStartTeleportFXSound, GetStatModSourceList, GetSurrenderCostModifier, GetTeleportEndParticleFX, GetTeleportStartParticleFX, GetUnitBaseSize, GetUnitBaseSizeInt, GetUnitCost, GetUnitName, GetWaitAbility, HasBadMoral, HasFullAction, HasPreparedAbility, HasPreparedAbilityId, HasTeleportEndFX, HasTeleportStartFX, HasWaitClicked, HitUnit, IncreaseBaseStatByID, Init, InitCurrentWave, IsAdditionalTurn, IsAttacker, IsAutoColliderOverridden, IsCasting, IsControlledByAI, IsDead, IsDefaultAttackActive, IsMarkedForTurnSkip, IsMoralTurn, IsMoving, IsMyDefaultAbility, IsOverridenByAI, IsRanged, IsUnderAttack, IsWaiting, IsWaitTurn, LoadIcon, MakeTurn, MarkForTurnSkip, MPIsYourTurn, NextWaveStep, OnGetBuffed, OnPooledAttachedParticleSystemFinished, PlayParticleEffect, PostBeginPlay, PrepareAbility, PrepareDefaultAbility, RecalculatePostAnimInput, RecyclePooledEmitter, ResetLuckType, ResetPreparedAbility, ResetTurnCount, Serialize, SetAdditionalTurn, SetArmy, SetBaseStatByID, SetCommandFinished, SetCurrentLuckType, SetDoneForAI, SetIgnoreAllegiances, SetInitiative, SetKillsOnCurrentTurn, SetLastQueuePosition, SetLastWalkedPath, SetMeleeAttackAbility, SetMoralTurn, SetNewCreaturePosition, SetOverrideByAI, SetRangedAttackAbility, SetSchoolType, SetSkipTurn, SetSubstituteLuckAbilty, SetTriggerStartTurnEvents, SetUnitCosts, SetWaitAbility, SetWaitClick, SetWaiting, ShowFloatingText, StatusChanged, Think, TriggerEvents, TriggerStartTurnEvents, UndoDeathMaterialFX, UpdateParticleTranslucency, UseAttack, UseMove, UsePreparedAbility, Wait, WaveCatchCreatureStack
SkeletalMeshActorMAT1 properties, 13 functions
SkeletalMeshCinematicActor0 properties, 0 functions
SkeletalMeshActor15 properties, 28 functions
Actor156 properties, 262 functions
Object13 properties, 308 functions