00001 00007 #ifndef _VIRUS_H_ 00008 #define _VIRUS_H_ 00009 00010 #include "IsoBomb.h" 00011 #include "CharacterProps.h" 00012 00013 class ConfigFile; 00014 class Character; 00015 00016 // Number of viruses 00017 const int NUM_VIRUSES = 6; 00018 // Virus types 00019 const int SLOW_VIRUS = 0; 00020 const int NOBOMBS_VIRUS = 1; 00021 const int BOMBARRHEA_VIRUS = 2; 00022 const int WEAKTHROW_VIRUS = 3; 00023 const int DELAY_VIRUS = 4; 00024 const int SHRINK_VIRUS = 5; 00025 // The maximum red value 00026 const float MAX_RED_VALUE = 255.0f; 00027 // The minimum red value 00028 const float MIN_RED_VALUE = 200.0f; 00029 // The rate at which the red value changes 00030 const float RED_CHANGE_RATE = 150.0f; 00031 00039 class Virus { 00040 00041 public: 00042 00046 Virus(); 00047 00054 Virus( char virType, Character* c ); 00055 00063 Virus( char virType, Character* c, float timeLeft ); 00064 00072 void init( char virType, Character* c, float timeLeft ); 00073 00077 virtual ~Virus(); 00078 00085 bool update( float dt ); 00086 00093 int getRedValue() const; 00094 00102 Virus* getCloneFor( Character* c ) const; 00103 00109 int getVirusType() const; 00110 00116 static void initVars( ConfigFile& f ); 00117 00118 private: 00119 00123 static float lifeTime; 00124 00129 static float slowSpeed; 00130 00134 static float delayTime; 00135 00139 static float weakPower; 00140 00141 private: 00142 00143 00147 float countdown; 00148 00152 CharacterProps props; 00153 00157 Character* host; 00158 00162 char type; 00163 00167 float red; 00168 00172 bool increaseColor; 00173 00177 float throwTime; 00178 00179 }; 00180 00181 #endif