/* s_pwrup.h

   Powerup sprite. See sprite.h for details on sprites in general.

   This sprite has no sprite_freedata_proc entry. Set it to null.

   NOTE: THIS FILE IS A MESS.
*/

#ifndef INCLUDED_S_POWERUP_H
#define INCLUDED_S_POWERUP_H

#include "tilemap.h"
#include "sprite.h"

/* spawn_powerup(SPRITE *spr)
 *  Creates teh powerup
 */
void spawn_powerup(SPRITE *spr);

void spawn_powerup(SPRITE *sprite);


/* draw_powerup(): this is the powerup's sprite_draw_proc entry (see
   sprite.h). Use draw_generic_sprite() in sprhelp.h to draw the sprite.
*/
void draw_powerup(BITMAP *bmp, SPRITE *sprite, float cth);


/* update_powerup():
*/
void update_powerup(TILEMAP *map, SPRITE *sprite);

/* Powerup-player interaction */
void si_powerup_player(SPRITE *spr1, SPRITE *spr2);


/* Player-powerup interaction. Player collects powerup, or, on occasions,
   powerup explodes.
*/
void si_player_powerup(TILEMAP *map, SPRITE *spr1, SPRITE *spr2);

#define POWERUP_NONE            0
#define POWERUP_MYSTERY         1
#define POWERUP_HEALTH          2
#define POWERUP_INVULNERABILITY 3
#define POWERUP_BOMB            4
#define POWERUP_SPEED_BOOST     5
#define POWERUP_JUMP            6
#define POWERUP_MAGBOMBS        7
#define POWERUP_BOMB_LAUNCHER   8
#define POWERUP_SEEKING_BOMB    9
#define POWERUP_MINE_BOMB      10

#define N_POWER_UPS             11

#define N_POWERUP_ANIM_FRAMES   3

extern char *powerup_names[N_POWER_UPS];
extern void init_powerups();

extern const int powerup_freq[N_POWER_UPS];


typedef struct POWERUP {
	int powerup;
	int explosive;
} POWERUP;

void free_powerup_data(void *p);


#endif /* INCLUDED_S_PLAYER_H */
