6#ifndef BATTLE_PET_BATTLE_STATE_H
7#define BATTLE_PET_BATTLE_STATE_H
91 bool CanTrap(
bool canStoreBattlePet =
true,
bool enemyTameable =
true)
const
131 uint8 allyFrontPet = 0,
uint8 enemyFrontPet = 3,
165 if (!remainingHealth)
174 return remainingHealth;
254 0, 0, allyTurn, enemyTurn);
429 if (!canStoreBattlePet)
456 AllyTeam[petIndex].MaxHealth = maxHealth;
545 return maxHealth && health > maxHealth ? maxHealth : health;
593 cooldowns.push_back(cooldownState);
628 if (!amount || !rounds)
698 if (damage >= health)
BattlePetAchievementSource
@ BATTLE_PET_ACHIEVEMENT_SOURCE_WILD
@ BATTLE_PET_ACHIEVEMENT_SOURCE_PVP_DUEL
@ BATTLE_PET_ACHIEVEMENT_SOURCE_PVP_MATCHMAKING
constexpr uint8 BATTLE_PET_ABILITY_SLOT_INVALID
constexpr uint8 BATTLE_PET_ABILITY_SLOT_COUNT
@ PET_BATTLE_TRAP_STATUS_JOURNAL_FULL
@ PET_BATTLE_TRAP_STATUS_UNAVAILABLE
@ PET_BATTLE_TRAP_STATUS_ALREADY_TRAPPED
@ PET_BATTLE_TRAP_STATUS_HEALTH_TOO_HIGH
@ PET_BATTLE_TRAP_STATUS_ACTIVE
@ PET_BATTLE_TRAP_STATUS_NOT_CAPTURABLE
@ PET_BATTLE_TRAP_STATUS_NPC_PET
@ PET_BATTLE_TRAP_STATUS_DEAD_PET
@ PET_BATTLE_WINNER_ENEMY
ActivePetBattleTurnEffect
@ ACTIVE_PET_BATTLE_TURN_EFFECT_DAMAGE
@ ACTIVE_PET_BATTLE_TURN_EFFECT_SWAP
@ ACTIVE_PET_BATTLE_TURN_EFFECT_NONE
uint32 IncomingDamageReduction
uint32 ApplyAllyDamage(uint32 damage)
uint8 GetTrapStatus(bool canStoreBattlePet=true, bool enemyTameable=true) const
bool CanTrap(bool canStoreBattlePet=true, bool enemyTameable=true) const
uint32 ApplyEnemyDamage(uint32 damage)
bool ApplyAbilityExchange(uint32 roundId, uint32 allyDamage, uint32 enemyDamage, uint8 allyAbilitySlot, uint32 allyAbilityId, uint16 allyAbilityCooldown, ActivePetBattleTurn &allyTurn, ActivePetBattleTurn &enemyTurn)
static uint32 ApplyIncomingDamageReduction(ActivePetBattleAuraState const &aura, uint32 damage)
void DecrementAllyCooldowns()
ActivePetBattleTurn ApplyEnemyAbilityRound(uint32 roundId, uint32 damage)
void StartPvp(uint64 opponentGuid, uint64 allyPetId, uint32 allyMaxHealth, uint32 allyHealth, uint64 enemyPetId, uint32 enemyMaxHealth, uint32 enemyHealth, uint16 enemySpecies=0, uint8 enemyLevel=0, uint8 enemyQuality=0, uint8 allyFrontPet=0, uint8 enemyFrontPet=3, BattlePetAchievementSource source=BATTLE_PET_ACHIEVEMENT_SOURCE_PVP_DUEL)
static bool IsValidAllyPetIndex(uint8 petIndex)
bool SelectAllyFrontPet(uint8 frontPet)
bool IsAllyPetAlive(uint8 petIndex) const
void SnapshotAllyCooldowns(std::vector< ActivePetBattleCooldown > &cooldowns) const
bool IsAllyAbilityOnCooldown(uint8 petIndex, uint8 abilitySlot) const
static void DecrementAura(ActivePetBattleAuraState &aura)
static bool IsValidAbilitySlot(uint8 abilitySlot)
bool CanAcceptRound(uint32 roundId) const
uint32 ApplyDamage(uint32 &health, uint32 damage, uint8 winner)
void StartAllyAbilityCooldown(uint8 petIndex, uint8 abilitySlot, uint32 abilityId, uint16 cooldown)
ActivePetBattleTurn ApplyTrapRound(uint32 roundId, bool captured)
void ClearExpiredAllyCooldowns()
ActivePetBattleTurn ApplyAbilityRound(uint32 roundId, uint32 damage)
void ActivateAllyIncomingDamageReduction(uint32 amount, uint8 rounds)
ActivePetBattleTurn CreateTurn(uint32 roundId) const
bool HasAliveAllyPetOtherThan(uint8 petIndex) const
ActivePetBattleCooldown AllyCooldowns[BATTLE_PET_MAX_ACTIVE_TEAM_PETS][BATTLE_PET_ABILITY_SLOT_COUNT]
BattlePetAchievementSource GetAchievementSource() const
void FinishAcceptedRound(ActivePetBattleTurn &turn)
ActivePetBattleTurn ApplyForfeit(uint32 roundId)
uint16 GetAllyAbilityCooldown(uint8 petIndex, uint8 abilitySlot) const
bool WaitingForAllyFrontPet
static uint32 NormalizeHealth(uint32 health, uint32 maxHealth)
bool ApplyAbilityExchange(uint32 roundId, uint32 allyDamage, uint32 enemyDamage, ActivePetBattleTurn &allyTurn, ActivePetBattleTurn &enemyTurn)
bool IsMatchmaking() const
bool CanAcceptInput(uint32 roundId) const
ActivePetBattleTurn ApplyAbilityRound(uint32 roundId, uint32 damage, uint8 abilitySlot, uint32 abilityId, uint16 abilityCooldown)
ActivePetBattlePetState AllyTeam[BATTLE_PET_MAX_ACTIVE_TEAM_PETS]
bool HasAllyPet(uint8 petIndex) const
void ActivateEnemyIncomingDamageReduction(uint32 amount, uint8 rounds)
void Finish(uint8 winner)
bool SetAllyPet(uint8 petIndex, uint64 petId, uint32 maxHealth, uint32 health)
ActivePetBattleAuraState EnemyAura
ActivePetBattleTurn ApplySwapRound(uint32 roundId, uint8 newFrontPet)
bool GetAllyPetHealth(uint64 petId, uint32 &health) const
static constexpr uint8 BATTLE_PET_MAX_ACTIVE_TEAM_PETS
BattlePetAchievementSource Source
void StartWild(uint64 enemyGuid, uint64 allyPetId, uint32 allyMaxHealth, uint32 allyHealth, uint64 enemyPetId, uint32 enemyMaxHealth, uint32 enemyHealth, uint16 enemySpecies=0, uint8 enemyLevel=0, uint8 enemyQuality=0, uint8 enemyBreed=0, uint8 allyFrontPet=0)
ActivePetBattleAuraState AllyAura
bool IsEnemyHealthTrapEligible() const
static void ActivateIncomingDamageReduction(ActivePetBattleAuraState &aura, uint32 amount, uint8 rounds)
bool ApplyTrapRoundWithEnemyResponse(uint32 roundId, bool captured, uint32 enemyDamage, ActivePetBattleTurn &trapTurn, ActivePetBattleTurn &enemyTurn)
std::vector< ActivePetBattleCooldown > Cooldowns