void CTurtle::Update(float fElapsedTime) { m_vAnimations[m_nCurrAnimation].Update(fElapsedTime); if(GetExperience() >= (100 * GetLevel())) { CBattleMap::GetInstance()->PlaySFX(CAssets::GetInstance()->aBMcowabungaSnd); SetExperience(0/*GetExperience()-(100* GetLevel())*/); SetLevel(GetLevel() + 1); SetHealthMax((int)((float)GetMaxHealth() * 1.25f)); SetHealth((int)((float)GetMaxHealth())); SetBaseAP(GetBaseAP()+2); SetStrength( (int)( (float)GetStrength() * 1.2f ) ); SetDefense( (int) ( (float)GetDefense() * 1.2f ) ); SetAccuracy( (int) ( (float)GetAccuracy() * 1.2f ) ); SetSpeed( (int) ( (float)GetSpeed() * 1.2f ) ); } if( GetHealth() <= 0) { if(GetAlive() == true) { CBattleMap::GetInstance()->DecrementNumChars(); CBattleMap::GetInstance()->DecrementNumTurtles(); CBattleMap::GetInstance()->SetTurtleDead(); SetAlive(false); if(GetCurrAnimNum() != 9) SetCurrAnim(9); SetPosZ(0.9f); } } }
//////////////////////////////////////////////////////////////////////////// // popis experimentu ... // main() { SetOutput("3telesa.dat"); _Print("# Model obØhu dru§ice kolem soustavy dvou tØles v C++/SIMLIB \n"); Init(0, 300); // inicializace experimentu InitGraphics(); SetStep(1e-12,0.01); SetAccuracy(1e-14); // je nutn vysok pýesnost Run(); // simulace DoneGraphics(); return 0; }
void CTurtle::SetAttributes(int ap,int hp,int strength,int defense,int accuracy,int speed,int level, int experience,int range) { SetBaseAP(ap); SetCurrAP(ap); SetHealthMax(hp); SetHealth(hp); SetStrength(strength); SetDefense(defense); SetAccuracy(accuracy); SetSpeed(speed); SetLevel(level); SetExperience(experience); SetRange(range); }
OBSpectrophore::OBSpectrophore(void) : _resolution(3.0) , _beginProbe(0) , _endProbe(0) , _numberOfProbes(0) , _property(NULL) , _radii(NULL) , _oricoor(NULL) , _coor(NULL) { SetAccuracy(OBSpectrophore::AngStepSize20); SetStereo(OBSpectrophore::NoStereoSpecificProbes); SetNormalization(OBSpectrophore::NoNormalization); }
OBSpectrophore::OBSpectrophore(const OBSpectrophore& s) : _resolution(s._resolution) , _beginProbe(s._beginProbe) , _endProbe(s._endProbe) , _numberOfProbes(s._numberOfProbes) , _spectro(s._spectro) , _property(NULL) , _radii(NULL) , _oricoor(NULL) , _coor(NULL) { SetAccuracy(s.GetAccuracy()); SetStereo(s.GetStereo()); SetNormalization(s.GetNormalization()); }
int main(int argc, char *argv[]) { SetOutput("ctest4.dat"); _Print("# Test \n"); if(argc>1) { double d = atof(argv[1]); if(d==0) return 3; ACCURACY = d; } Print("# SetAccuracy(%g) \n", ACCURACY); //DebugON(); // _Print("# implicitn¡ metoda (RKE) \n"); Init(0,ENDTIME); // inicializace experimentu SetAccuracy(ACCURACY); // rel chyba // SetMethod(SIMLIB_ABM4Step); // SetMethod(SIMLIB_RK45Step); // SetMethod(SIMLIB_EulerStep); // SetMethod(SIMLIB_RK23Step); // SetMethod(SIMLIB_FWStep); Run(); // simulace return 0; _Print("\n# Eulerova metoda \n"); Init(0,ENDTIME); // inicializace experimentu SetAccuracy(ACCURACY); SetMethod(SIMLIB_EulerStep); Run(); // simulace return 0; }
OBSpectrophore& OBSpectrophore::operator=(const OBSpectrophore& s) { if (this != &s) { _resolution = s._resolution; _accuracy = s._accuracy; _beginProbe = s._beginProbe; _endProbe = s._endProbe; _numberOfProbes = s._numberOfProbes; _spectro = s._spectro; SetAccuracy(s.GetAccuracy()); SetStereo(s.GetStereo()); SetNormalization(s.GetNormalization()); } return *this; }