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

Function CheckSpell

Source/spells.cpp:81–104  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79}
80
81BOOL CheckSpell(int id, int sn, char st, BOOL manaonly)
82{
83 BOOL result;
84
85#ifdef _DEBUG
86 if (debug_mode_key_inverted_v)
87 return TRUE;
88#endif
89
90 result = TRUE;
91 if (!manaonly && pcurs != 1) {
92 result = FALSE;
93 } else {
94 if (st != RSPLTYPE_SKILL) {
95 if (GetSpellLevel(id, sn) <= 0) {
96 result = FALSE;
97 } else {
98 result = plr[id]._pMana >= GetManaAmount(id, sn);
99 }
100 }
101 }
102
103 return result;
104}
105
106void CastSpell(int id, int spl, int sx, int sy, int dx, int dy, int caster, int spllvl)
107{

Callers 3

DrawSpellFunction · 0.85
GetSBookTransFunction · 0.85
CheckPlrSpellFunction · 0.85

Calls 2

GetSpellLevelFunction · 0.85
GetManaAmountFunction · 0.85

Tested by

no test coverage detected