#pragma once #include "ObjectManager.h" #include "Vectors.h" #include "ModelManager.h" #define MAXBULLETDISTANCE (20.0 * 20) #define MAXROCKETDISTANCE (100.0 * 100) #define ROCKETROTATERATE 0.002 #define BULLETSPEED 0.02 #define ROCKETSPEED 0.001 #define MAXROCKETSPEED 0.02 #define ROCKETACCELERATION 0.0001 enum weaponTypes { WEAPONTYPEBULLET, WEAPONTYPEROCKET /* Add more as necessary. Super Rockets? Bombs? Mines? */ }; typedef struct VTrail { float duration; float TimeLeft; VObject Object; Vector Direction; struct VTrail * previous; struct VTrail * next; } VTrail; typedef struct VWeapon { int Type; int Damage; int MaxDistance; float Speed; Vector InitialPos; Vector Target; VObject Object; struct VWeapon * next; Boolean taggedForRemoval; VTrail * Trail; } VWeapon; void InitWeapon(VWeapon * w, int type); void CleanUpWeapon(VWeapon * w); void StartWeapon(VWeapon * w, Vector * startPos, Vector * target, Vector * forward, Vector * up); void RunWeapon(VWeapon * w, float interval, void * world); void DrawWeapon(VWeapon * w); void DrawTrail(VTrail * t); void RunTrail(VTrail * t, float interval); void NewTrail(VTrail ** t, Vector * Start); void CleanUpTrail(VTrail * t); void RemoveTrail(VTrail ** trail);