diff --git a/C++ProjectTemplate b/C++ProjectTemplate index fa20c88..9c951cd 100755 Binary files a/C++ProjectTemplate and b/C++ProjectTemplate differ diff --git a/effect.h b/effect.h index b9017e8..663ef45 100644 --- a/effect.h +++ b/effect.h @@ -1,6 +1,7 @@ class Effect{ public: std::vector particles; + int maxLifeTime=0; virtual void create(std::vector&PARTICLES)=0; virtual bool update()=0; Effect(){} @@ -13,11 +14,12 @@ class Effect{ class FountainEffect:public Effect{ int fountainDensity=0; - int maxLifeTime=0; int lifetime=0; public: FountainEffect(int fountainDensity,int lifetime) - :fountainDensity(fountainDensity),lifetime(lifetime),maxLifeTime(lifetime){} + :fountainDensity(fountainDensity),lifetime(lifetime){ + this->maxLifeTime=lifetime; + } void create(std::vector&PARTICLES){ lifetime=maxLifeTime; for (int i=0;icomposition,bool pctDamage=false,std::vector> properties={}) - :Move(name,desc,0,baseDmg,randomDmg,PPCost,range,0,false,composition,pctDamage,properties){}; - Move(std::string name,std::string desc,int baseDmg,int randomDmg,int PPCost,int range,int channelTime,bool friendly,std::arraycomposition,bool pctDamage=false,std::vector> properties={}) - :Move(name,desc,0,baseDmg,randomDmg,PPCost,range,channelTime,friendly,composition,pctDamage,properties){}; - Move(std::string name,std::string desc,int grade,int baseDmg,int randomDmg,int PPCost,int range,int channelTime,bool friendly,std::arraycomposition,bool pctDamage=false,std::vector> properties={}) - :name(name),grade(grade),PPCost(PPCost),desc(desc),randomDmg(randomDmg),baseDmg(baseDmg),range(range),friendly(friendly),channelTime(channelTime),composition(composition),pctDamage(pctDamage),properties(properties){} + Move(std::string name,std::string desc,int baseDmg,int randomDmg,int PPCost,int range,std::arraycomposition,Effect*eff=nullptr,bool pctDamage=false,std::vector> properties={}) + :Move(name,desc,0,baseDmg,randomDmg,PPCost,range,0,false,composition,eff,pctDamage,properties){}; + Move(std::string name,std::string desc,int baseDmg,int randomDmg,int PPCost,int range,int channelTime,bool friendly,std::arraycomposition,Effect*eff=nullptr,bool pctDamage=false,std::vector> properties={}) + :Move(name,desc,0,baseDmg,randomDmg,PPCost,range,channelTime,friendly,composition,eff,pctDamage,properties){}; + Move(std::string name,std::string desc,int grade,int baseDmg,int randomDmg,int PPCost,int range,int channelTime,bool friendly,std::arraycomposition,Effect*eff=nullptr,bool pctDamage=false,std::vector> properties={}) + :name(name),grade(grade),PPCost(PPCost),desc(desc),randomDmg(randomDmg),baseDmg(baseDmg),range(range),friendly(friendly),eff(eff),channelTime(channelTime),composition(composition),pctDamage(pctDamage),properties(properties){} }; } @@ -549,7 +550,7 @@ public: ConsoleCaptureStdOut(true); // Called once at the start, so create things here - FOUNTAIN_EFFECT = new FountainEffect(250,2000); + FOUNTAIN_EFFECT = new FountainEffect(250,200); EnableLayer(layer::COLLISION,false); @@ -2009,10 +2010,10 @@ goes on a very long time, I hope you can understand this is only for testing pur MOVELIST[BattleMoveName::PKLIFEUP_B]=new Battle::Move("PK Lifeup","Restores a moderate amount of health.",BETA,240,60,ㅍ 9,1,0,true,{0,0,20,0}); MOVELIST[BattleMoveName::PKLIFEUP_G]=new Battle::Move("PK Lifeup","Restores a large amount of health.",GAMMA,400,50,ㅍ 21,3,0,true,{0,0,20,0}); MOVELIST[BattleMoveName::PKLIFEUP_O]=new Battle::Move("PK Lifeup","Restores a great amount of health to all allies.",OMEGA,800,100,ㅍ 64,6,0,true,{0,0,20,0}); - MOVELIST[BattleMoveName::PKFUN_A]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",ALPHA,100,10,ㅍ 15,6,0,false,{0,0,20,0}); - MOVELIST[BattleMoveName::PKFUN_B]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",BETA,240,40,ㅍ 30,6,0,false,{0,0,20,0}); - MOVELIST[BattleMoveName::PKFUN_G]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",GAMMA,360,80,ㅍ 45,7,0,false,{0,0,20,0}); - MOVELIST[BattleMoveName::PKFUN_O]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",OMEGA,590,100,ㅍ 90,8,0,false,{0,0,20,0}); + MOVELIST[BattleMoveName::PKFUN_A]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",ALPHA,100,10,ㅍ 15,6,0,false,{0,0,20,0},FOUNTAIN_EFFECT); + MOVELIST[BattleMoveName::PKFUN_B]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",BETA,240,40,ㅍ 30,6,0,false,{0,0,20,0},FOUNTAIN_EFFECT); + MOVELIST[BattleMoveName::PKFUN_G]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",GAMMA,360,80,ㅍ 45,7,0,false,{0,0,20,0},FOUNTAIN_EFFECT); + MOVELIST[BattleMoveName::PKFUN_O]=new Battle::Move("PK Fun","A very fun barrage. Hits for large damage.",OMEGA,590,100,ㅍ 90,8,0,false,{0,0,20,0},FOUNTAIN_EFFECT); MOVELIST[BattleMoveName::PKFIRE_A]=new Battle::Move("PK Fire","Causes extreme heat to burn foes and scorch trees",ALPHA,60,20,ㅍ 6,3,0,false,{0,0,20,0}); MOVELIST[BattleMoveName::PKFIRE_B]=new Battle::Move("PK Fire","Causes extreme heat to burn foes and scorch trees",BETA,120,40,ㅍ 12,4,0,false,{0,0,20,0}); MOVELIST[BattleMoveName::PKFIRE_G]=new Battle::Move("PK Fire","Causes extreme heat to burn foes and scorch trees",GAMMA,190,50,ㅍ 20,5,0,false,{0,0,20,0}); @@ -2890,7 +2891,13 @@ goes on a very long time, I hope you can understand this is only for testing pur case BattleState::WAIT_ANIMATION:{ BATTLE_ROLLING_COUNTER_WAITTIME=5; BATTLE_ANIMATION_TIMER++; - if (BATTLE_ANIMATION_TIMER==90) { + if (BATTLE_ANIMATION_TIMER==30) { + Effect*eff=(CURRENT_TURN<0)?PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->eff:BATTLE_ENCOUNTER->objs[CURRENT_TURN]->selectedMove->eff; + if (eff!=nullptr) { + StartEffect(eff); + } + } + if (CURRENT_EFFECT==nullptr&&BATTLE_ANIMATION_TIMER==90||CURRENT_EFFECT!=nullptr&&BATTLE_ANIMATION_TIMER>CURRENT_EFFECT->maxLifeTime-30) { if (CURRENT_TURN<0) { if (PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove->friendly) { if (PARTY_MEMBER_STATS[-PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedTarget-1]->GetHP()>0) { @@ -2955,7 +2962,7 @@ goes on a very long time, I hope you can understand this is only for testing pur } } } else - if (BATTLE_ANIMATION_TIMER>120) { + if (CURRENT_EFFECT==nullptr&&BATTLE_ANIMATION_TIMER>120||CURRENT_EFFECT!=nullptr&&BATTLE_ANIMATION_TIMER>CURRENT_EFFECT->maxLifeTime) { //Turn's done! if (CURRENT_TURN<0) { PARTY_MEMBER_STATS[PARTY_MEMBER_ID[-CURRENT_TURN-1]]->selectedMove=nullptr;