/**************************************************************
 * FFTacticsMUD : projectile.h                                *
 **************************************************************
 * (c) 2002 Damien Dailidenas (Trenton). All rights reserved. *
 **************************************************************/

#define DECLARE_ON_RELEASE(fun)	ON_RELEASE fun
#define DECLARE_ON_HIT(fun)     ON_HIT fun

typedef class PROJECTILE PROJECTILE;
typedef class AREA AREA;
typedef class ROOM ROOM;

typedef void ON_RELEASE args((CH *ch, CH *target));
typedef void ON_HIT     args((PROJECTILE *projectile, CH *target));

class PROJECTILE {
public:
  PROJECTILE *next, *next_in_room;
  AREA *area;
  ROOM *room;
  CH *ch, *target;
  long dam;
  short timer, id, defense[5], spd, color;  
  ON_HIT *onHit;
  bool crit, trail, busy;

  PROJECTILE();
  ~PROJECTILE();
  void to(ROOM *room);   
  void from_room();
  void hit(CH *target);  
  void calculate_damage(const CH *target);
  void hunt(CH *target);
  void move(const short dir);
  void warn(CH *target);
  short dir(const CH *ch);
  void leave_trail();
  void check_collision();
};

extern PROJECTILE *projectile_list;