From c37d62fd1b979bc6758ad72d12346baba0f9b69f Mon Sep 17 00:00:00 2001 From: "chirs241097@gmail.com" Date: Sat, 22 Mar 2014 12:17:21 +0000 Subject: Modify "Achromatopsia". Report build and version in the log file. Fix crashes in mingw-64 build. --- towernbullet.h | 58 ++++++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 48 insertions(+), 10 deletions(-) (limited to 'towernbullet.h') diff --git a/towernbullet.h b/towernbullet.h index 59613f2..5d6ad95 100644 --- a/towernbullet.h +++ b/towernbullet.h @@ -2556,6 +2556,7 @@ public: } } }; +bool achromab,achromaB[100]; class achromaGroup { private: @@ -2598,26 +2599,63 @@ public: { if(col==red)col=green; else if(col==green)col=red; - for(int i=0;i<500;++i)if(bullets[i].isActive())bullets[i].Reverse(); + for(int i=0;i<1000;++i)if(bullets[i].isActive())bullets[i].Reverse(); } void achroma2pnt() { - for(int i=0;i<500;++i)if(bullets[i].isActive())CreateBullet255(bullets[i].bulletpos.x,bullets[i].bulletpos.y,10); + for(int i=0;i<1000;++i)if(bullets[i].isActive())CreateBullet255(bullets[i].bulletpos.x,bullets[i].bulletpos.y,10); } - void Update() + void Update(int msk=0) { crbrk-=hge->Timer_GetDelta(); - if(crbrk<=0) + if(achromab) + { + if(crbrk<=0) + { + crbrk=re.NextDouble(0,frameleft/(double)AMinute)*(part==36?0.07:0.02)+0.03; + for(int i=0;i<1000;++i) + if(!bullets[i].isActive()) + { + bullets[i].achromaInit(vector2d(re.NextDouble(10,790),-5),col,llim); + break; + } + } + for(int i=0;i<1000;++i)if(bullets[i].isActive())bullets[i].achromaUpdate(); + } + else { - crbrk=re.NextDouble(0,frameleft/(double)AMinute)*(part==36?0.07:0.02)+0.03; - for(int i=0;i<500;++i) - if(!bullets[i].isActive()) + if(crbrk<=0) { - bullets[i].achromaInit(vector2d(re.NextDouble(10,790),10),col,llim); - break; + crbrk=1; + if(msk) + { + memset(achromaB,0,sizeof(achromaB)); + for(int i=0;i<80;++i)achromaB[i]=re.NextInt(0,1); + } + for(int i=0;i<80;++i) + { + if(achromaB[i]&&col==green) + { + for(int j=0;j<1000;++j) + if(!bullets[j].isActive()) + { + bullets[j].achromaInit(vector2d(i*10,-5),col,llim); + break; + } + } + if(!achromaB[i]&&col==red) + { + for(int j=0;j<500;++j) + if(!bullets[j].isActive()) + { + bullets[j].achromaInit(vector2d(i*10,-5),col,llim); + break; + } + } + } } + for(int i=0;i<500;++i)if(bullets[i].isActive())bullets[i].achromaUpdate(); } - for(int i=0;i<500;++i)if(bullets[i].isActive())bullets[i].achromaUpdate(); } }; class yellowGroup -- cgit v1.2.3