home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
GameStar Special 2004 August
/
GSSH0804.iso
/
Rollenspiele
/
SwordOfFargoal
/
fargoal20030731b.exe
/
fargoal
/
src
/
spell.c
< prev
next >
Wrap
C/C++ Source or Header
|
2003-07-31
|
616b
|
34 lines
#include "char.h"
#include "game.h"
char const *spell_names[] = {
"Invisibility",
"Regeneration",
"Teleport",
"Shield",
"Light",
"Drift"
};
static int MAX[] = {
1, 3, 1, 1, 3, 1
};
int
spell_cast (int id, SPELLTYPE s)
{
if (list[id].spells[s].amount)
{
if (list[id].spells[s].active < MAX[s])
{
list[id].spells[s].amount--;
list[id].spells[s].active++;
message (FPS, s == SPELL_TELEPORT ? teleport : spell,
list[id].trapped?NULL:"%s spell cast!", spell_names[s]);
/* Actual teleportation is handled elsewhere, so no need to do anything else here. */
return 1;
}
}
return 0;
}