51 lines
961 B
C
51 lines
961 B
C
|
#include <SDL/SDL.h>
|
||
|
#include <SDL/SDL_image.h>
|
||
|
#include <SDL/SDL_ttf.h>
|
||
|
#include <SDL/SDL_mixer.h>
|
||
|
|
||
|
#include "enum.h"
|
||
|
#include "Player.h"
|
||
|
#include "Kaos.h"
|
||
|
#include "Room.h"
|
||
|
#include "HyperKaos.h"
|
||
|
#include "Synergy.h"
|
||
|
|
||
|
|
||
|
typedef struct player Player;
|
||
|
//typedef struct room Room;
|
||
|
//typedef struct kaos Kaos;
|
||
|
typedef struct scene Scene;
|
||
|
typedef struct timer Timer;
|
||
|
typedef struct textBox TextBox;
|
||
|
#include "extern.h"
|
||
|
|
||
|
Synergy* newSynergy(int s, char d, SDL_Rect z, HyperKaos* t)
|
||
|
{
|
||
|
Synergy* self = malloc(sizeof(Synergy));
|
||
|
|
||
|
self->spell = s;
|
||
|
self->dir = d;
|
||
|
self->zone = z;
|
||
|
self->trigger = t;
|
||
|
|
||
|
return self;
|
||
|
}
|
||
|
|
||
|
void deleteSynergy(Synergy* target)
|
||
|
{
|
||
|
free(target);
|
||
|
}
|
||
|
|
||
|
void Synergize()
|
||
|
{
|
||
|
int i;
|
||
|
Synergy* sigil = rightHere->sigils[0];
|
||
|
for (i = 0; i < rightHere->numberOfSigils; i++)
|
||
|
{
|
||
|
if (sigil->spell == spellFlag
|
||
|
&& playerFaces(hero, sigil->dir)
|
||
|
&& playerIsInRect(hero, &(sigil->zone)))
|
||
|
run(sigil->trigger);
|
||
|
sigil++;
|
||
|
}
|
||
|
}
|