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

Method slap

source/entities/Creature.cpp:2509–2529  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2507}
2508
2509void Creature::slap()
2510{
2511 if(!getIsOnServerMap())
2512 return;
2513
2514 fireCreatureSound(CreatureSound::Slap);
2515
2516 // In editor mode, we remove the creature
2517 if(getGameMap()->isInEditorMode())
2518 {
2519 removeFromGameMap();
2520 deleteYourself();
2521 return;
2522 }
2523
2524 CreatureEffectSlap* effect = new CreatureEffectSlap(
2525 ConfigManager::getSingleton().getSlapEffectDuration(), "");
2526 addCreatureEffect(effect);
2527 mHp -= mMaxHP * ConfigManager::getSingleton().getSlapDamagePercent() / 100.0;
2528 computeCreatureOverlayHealthValue();
2529}
2530
2531void Creature::fireAddEntity(Seat* seat, bool async)
2532{

Callers

nothing calls this directly

Calls 3

isInEditorModeMethod · 0.80
getSlapEffectDurationMethod · 0.80
getSlapDamagePercentMethod · 0.80

Tested by

no test coverage detected