2011-04-08 18:59:03 +02:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
|
|
|
* See COPYING for further information.
|
|
|
|
* ---
|
|
|
|
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef BOSS_H
|
|
|
|
#define BOSS_H
|
|
|
|
|
|
|
|
#include <complex.h>
|
|
|
|
|
2011-06-24 19:16:05 +02:00
|
|
|
#include <resource/animation.h>
|
2011-04-08 18:59:03 +02:00
|
|
|
struct Boss;
|
|
|
|
|
|
|
|
typedef void (*BossRule)(struct Boss*, int time);
|
|
|
|
|
|
|
|
typedef enum AttackType {
|
2011-06-13 18:48:36 +02:00
|
|
|
AT_Normal,
|
2011-08-23 17:37:14 +02:00
|
|
|
AT_Move,
|
2011-06-13 18:48:36 +02:00
|
|
|
AT_Spellcard,
|
|
|
|
AT_SurvivalSpell
|
2011-04-08 18:59:03 +02:00
|
|
|
} AttackType;
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct Attack {
|
|
|
|
char *name;
|
|
|
|
|
|
|
|
AttackType type;
|
|
|
|
|
|
|
|
int starttime;
|
|
|
|
|
|
|
|
int timeout;
|
|
|
|
int dmglimit;
|
2011-08-23 17:37:14 +02:00
|
|
|
|
2011-04-08 18:59:03 +02:00
|
|
|
BossRule rule;
|
2011-05-09 13:42:02 +02:00
|
|
|
BossRule draw_rule;
|
2011-04-08 18:59:03 +02:00
|
|
|
} Attack;
|
|
|
|
|
|
|
|
typedef struct Boss {
|
|
|
|
Attack *attacks;
|
|
|
|
Attack *current;
|
|
|
|
|
|
|
|
complex pos;
|
|
|
|
|
2011-05-13 19:03:02 +02:00
|
|
|
char *name;
|
|
|
|
|
|
|
|
int acount;
|
|
|
|
|
|
|
|
Animation *ani;
|
|
|
|
int anirow;
|
|
|
|
|
2011-04-08 18:59:03 +02:00
|
|
|
int dmg;
|
2012-07-18 15:02:26 +02:00
|
|
|
Color *zoomcolor;
|
2011-04-08 18:59:03 +02:00
|
|
|
} Boss;
|
|
|
|
|
|
|
|
Boss *create_boss(char *name, char *ani, complex pos);
|
|
|
|
void draw_boss(Boss *boss);
|
|
|
|
void process_boss(Boss *boss);
|
|
|
|
|
|
|
|
void free_boss(Boss *boss);
|
|
|
|
void free_attack(Attack *a);
|
|
|
|
|
|
|
|
void start_attack(Boss *b, Attack *a);
|
|
|
|
|
2011-05-09 13:42:02 +02:00
|
|
|
Attack *boss_add_attack(Boss *boss, AttackType type, char *name, float timeout, int hp, BossRule rule, BossRule draw_rule);
|
2011-04-08 18:59:03 +02:00
|
|
|
|
2011-05-09 13:42:02 +02:00
|
|
|
void boss_death(Boss **boss);
|
|
|
|
|
2012-07-18 15:02:26 +02:00
|
|
|
#endif
|