![]() |
AzerothCore 3.3.5a
OpenSource WoW Emulator
|
Lightweight stub for Unit proc-related functionality. More...
#include "UnitStub.h"
Classes | |
| struct | CastRecord |
Public Member Functions | |
| UnitStub ()=default | |
| virtual | ~UnitStub ()=default |
| virtual bool | IsPlayer () const |
| virtual bool | IsAlive () const |
| virtual bool | IsFriendlyTo (UnitStub const *unit) const |
| void | SetIsPlayer (bool isPlayer) |
| void | SetIsAlive (bool isAlive) |
| void | SetIsFriendly (bool isFriendly) |
| virtual bool | HasAura (uint32_t spellId) const |
| virtual void | AddAuraStub (uint32_t spellId) |
| virtual void | RemoveAuraStub (uint32_t spellId) |
| virtual void | RecordCast (uint32_t spellId, bool triggered=true, int32_t bp0=0, int32_t bp1=0, int32_t bp2=0) |
| std::vector< CastRecord > const & | GetCastHistory () const |
| bool | WasCast (uint32_t spellId) const |
| size_t | CountCasts (uint32_t spellId) const |
| void | ClearCastHistory () |
| virtual uint32_t | GetMaxHealth () const |
| virtual uint32_t | GetHealth () const |
| virtual uint32_t | CountPctFromMaxHealth (int32_t pct) const |
| void | SetMaxHealth (uint32_t maxHealth) |
| void | SetHealth (uint32_t health) |
| virtual uint32_t | GetAttackTime (uint8_t attType) const |
| void | SetAttackTime (uint8_t attType, uint32_t time) |
| void | SetPPMModifier (uint32_t spellId, float modifier) |
| void | ClearPPMModifiers () |
| virtual float | GetPPMProcChance (uint32_t weaponSpeed, float ppm, uint32_t spellId=0) const |
| Calculate PPM proc chance with modifiers Mimics Unit::GetPPMProcChance() formula: (WeaponSpeed * PPM) / 600.0f. | |
| void | SetChanceModifier (uint32_t spellId, float modifier) |
| void | ClearChanceModifiers () |
| float | ApplyChanceModifier (uint32_t spellId, float baseChance) const |
| Apply chance modifier for a spell. | |
| virtual bool | HasSpellCooldown (uint32_t spellId) const |
| virtual void | AddSpellCooldown (uint32_t spellId) |
| virtual void | RemoveSpellCooldown (uint32_t spellId) |
| virtual uint8_t | GetClass () const |
| virtual uint8_t | GetLevel () const |
| void | SetClass (uint8_t unitClass) |
| void | SetLevel (uint8_t level) |
Private Attributes | |
| bool | _isPlayer = false |
| bool | _isAlive = true |
| bool | _isFriendly = false |
| std::map< uint32_t, bool > | _auras |
| std::vector< CastRecord > | _castHistory |
| std::map< uint32_t, bool > | _cooldowns |
| std::map< uint8_t, uint32_t > | _attackTimes |
| std::map< uint32_t, float > | _ppmModifiers |
| std::map< uint32_t, float > | _chanceModifiers |
| uint32_t | _maxHealth = 10000 |
| uint32_t | _health = 10000 |
| uint8_t | _class = 1 |
| uint8_t | _level = 80 |
Lightweight stub for Unit proc-related functionality.
This stub provides controlled behavior for testing proc scripts without requiring the full Unit hierarchy.
|
default |
|
virtualdefault |
|
inlinevirtual |
References _auras.
|
inlinevirtual |
References _cooldowns.
|
inline |
|
inline |
References _castHistory.
|
inline |
References _chanceModifiers.
|
inline |
References _ppmModifiers.
|
inline |
References _castHistory.
|
inlinevirtual |
References _maxHealth.
|
inlinevirtual |
|
inline |
References _castHistory.
|
inlinevirtual |
References _class.
|
inlinevirtual |
References _health.
|
inlinevirtual |
|
inlinevirtual |
References _maxHealth.
|
inlinevirtual |
Calculate PPM proc chance with modifiers Mimics Unit::GetPPMProcChance() formula: (WeaponSpeed * PPM) / 600.0f.
References _ppmModifiers.
|
inlinevirtual |
|
inlinevirtual |
References _cooldowns.
|
inlinevirtual |
References _isAlive.
|
inlinevirtual |
References _isFriendly.
|
inlinevirtual |
References _isPlayer.
|
inlinevirtual |
References _castHistory.
|
inlinevirtual |
|
inlinevirtual |
References _cooldowns.
|
inline |
References _attackTimes.
Referenced by ProcTestScenario::WithWeaponSpeed().
|
inline |
References _chanceModifiers.
|
inline |
References _isFriendly.
|
inline |
References _isPlayer.
Referenced by ProcTestContext::WithActorAsPlayer().
|
inline |
|
inline |
References _maxHealth.
|
inline |
References _ppmModifiers.
|
inline |
References _castHistory.
|
private |
Referenced by GetAttackTime(), and SetAttackTime().
|
private |
Referenced by AddAuraStub(), HasAura(), and RemoveAuraStub().
|
private |
Referenced by ClearCastHistory(), CountCasts(), GetCastHistory(), RecordCast(), and WasCast().
|
private |
Referenced by ApplyChanceModifier(), ClearChanceModifiers(), and SetChanceModifier().
|
private |
Referenced by GetClass(), and SetClass().
|
private |
Referenced by AddSpellCooldown(), HasSpellCooldown(), and RemoveSpellCooldown().
|
private |
Referenced by GetHealth(), and SetHealth().
|
private |
Referenced by IsAlive(), and SetIsAlive().
|
private |
Referenced by IsFriendlyTo(), and SetIsFriendly().
|
private |
Referenced by IsPlayer(), and SetIsPlayer().
|
private |
Referenced by GetLevel(), and SetLevel().
|
private |
Referenced by CountPctFromMaxHealth(), GetMaxHealth(), and SetMaxHealth().
|
private |
Referenced by ClearPPMModifiers(), GetPPMProcChance(), and SetPPMModifier().