MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / setSpellCooldownTurns

Method setSpellCooldownTurns

source/game/Player.cpp:770–788  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

768}
769
770void Player::setSpellCooldownTurns(SpellType spellType, uint32_t cooldown)
771{
772 uint32_t spellIndex = static_cast<uint32_t>(spellType);
773 if(spellIndex >= mSpellsCooldown.size())
774 {
775 OD_LOG_ERR("seatId=" + Helper::toString(getId()) + ", spellType=" + SpellManager::getSpellNameFromSpellType(spellType));
776 return;
777 }
778
779 mSpellsCooldown[spellIndex] = PlayerSpellData(cooldown, 1.0f / ODApplication::turnsPerSecond);
780
781 if(mGameMap->isServerGameMap() && getIsHuman())
782 {
783 ServerNotification *serverNotification = new ServerNotification(
784 ServerNotificationType::setSpellCooldown, this);
785 serverNotification->mPacket << spellType << cooldown;
786 ODServer::getSingleton().queueServerNotification(serverNotification);
787 }
788}
789
790void Player::notifyWorkerAction(Creature& worker, CreatureActionType actionType)
791{

Callers 2

processMessageMethod · 0.80

Calls 4

PlayerSpellDataClass · 0.85
isServerGameMapMethod · 0.80
toStringFunction · 0.70

Tested by

no test coverage detected