MCPcopy Create free account
hub / github.com/diasurgical/devilution / ToggleSpell

Function ToggleSpell

Source/control.cpp:437–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

435}
436
437void ToggleSpell(int slot)
438{
439 unsigned __int64 spells;
440
441 if (plr[myplr]._pSplHotKey[slot] == -1) {
442 return;
443 }
444
445 switch (plr[myplr]._pSplTHotKey[slot]) {
446 case RSPLTYPE_SKILL:
447 spells = plr[myplr]._pAblSpells;
448 break;
449 case RSPLTYPE_SPELL:
450 spells = plr[myplr]._pMemSpells;
451 break;
452 case RSPLTYPE_SCROLL:
453 spells = plr[myplr]._pScrlSpells;
454 break;
455 case RSPLTYPE_CHARGES:
456 spells = plr[myplr]._pISpells;
457 break;
458 }
459
460 if (spells & (__int64)1 << (plr[myplr]._pSplHotKey[slot] - 1)) {
461 plr[myplr]._pRSpell = plr[myplr]._pSplHotKey[slot];
462 plr[myplr]._pRSplType = plr[myplr]._pSplTHotKey[slot];
463 force_redraw = 255;
464 }
465}
466
467/**
468 * @brief Print letter to the back buffer

Callers 1

PressKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected