summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xCHANGELOG.TXT9
-rw-r--r--effects.h7
-rw-r--r--global.h8
-rw-r--r--levels.h51
-rw-r--r--main.cpp26
-rw-r--r--menus.h4
-rw-r--r--towernbullet.h284
7 files changed, 295 insertions, 94 deletions
diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT
index 46347c8..a772610 100755
--- a/CHANGELOG.TXT
+++ b/CHANGELOG.TXT
@@ -7,8 +7,15 @@ Add missing tips.
Pre-Released versions:
0.8.0-0_PR (b74)
New level Achromatopsia.
-Move levels to level -1.
+New level hyper-threading.
+Tower8 partly rewritten, dropping tdir.
+Move levels to level -1. <-typo fixed
+Modify the semi-coll threshold of laser.
+SCEffect_Attatch now take a optional parameter.
+Global varibles cleanup.
+Fix a bug in bullet8 caused by RandomEngine port.
Rename "Minesweeper"->"Spiky", add noname2pnt.
+Add achroma2pnt.
0.7.3-0_PR (b73)
This is a pre-release version of 0.7.2-2_PR.
diff --git a/effects.h b/effects.h
index ab63cbf..1b3c246 100644
--- a/effects.h
+++ b/effects.h
@@ -3,9 +3,10 @@
//Copyright Chrisoft 2014
//static const char* EFFECTS_H_FN="effects.h";
-void SCEffect_Attatch()
+void SCEffect_Attatch(vector2d Target=vector2d(-100,-100))
{
int cnt=rand()%8+3;
+ if(Target.x<-50&&Target.y<-50)Target=playerpos;
for (int ii=1;ii<=cnt;++ii)
{
int i;
@@ -19,8 +20,8 @@ void SCEffect_Attatch()
}
bullet[i].exist=true;
bullet[i].bullettype=254;
- bullet[i].bulletpos.x=playerpos.x+3;
- bullet[i].bulletpos.y=playerpos.y+3;
+ bullet[i].bulletpos.x=Target.x+3;
+ bullet[i].bulletpos.y=Target.y+3;
bullet[i].bulletdir.x=rand()%100-50;
bullet[i].bulletdir.y=rand()%100-50;
bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y;
diff --git a/global.h b/global.h
index 05f354f..01a9d12 100644
--- a/global.h
+++ b/global.h
@@ -128,7 +128,6 @@ struct Tower
int towertype;
int towertimer,curtimer;
int towertimer2,curtimer2,shotcount,curshotcount;
- vector2d tdir;
bool dblstate;
double bulletspeed;
int redexplo,whicnt,yelbrk;
@@ -260,16 +259,14 @@ int level,part,clrtime,clrbns;
int coll,semicoll,mode,dsmc,restarts;
double clrrange,clrrad,clrmaxrange,clrind;
hgeSprite *clrcircle;
-bool IfCallLevel;
bool Dis8ref,t8special;
int frameskips=0,stepskips=0;
-bool IfShowTip=false,FadeTip=false;
+bool IfCallLevel,IfShowTip,FadeTip,PlayerSplit;
RandomEngine re;
hgeFont *TipFont;
char lasttip[200];
int whicnt,whrcnt,shots,clrusg;
-bool yelattrib;
-bool Complete=false;
+bool yelattrib,Complete;
double bsscale;
long long score,scminus;
double mult,lsc;
@@ -284,6 +281,7 @@ int creditsp;double creditfly,creditacc,credbrk;
bool credstop,creddone;
bool tfs;
int fpslvl,clrmode;
+const vector2d splitData[4]={vector2d(0,0),vector2d(400,0),vector2d(0,300),vector2d(400,300)};
//static const char* GLOBAL_H_FN="global.h";
void Throw(char *Filename,char *Info)
diff --git a/levels.h b/levels.h
index 4b5e171..9955339 100644
--- a/levels.h
+++ b/levels.h
@@ -3135,3 +3135,54 @@ void Levelm1Part10()//Achromatopsia2-child
}
aca.Update();acb.Update();
}
+void Levelm1Part11()
+{
+ frameleft=AMinute+ThirtySeconds;
+ DisableAllTower=false;
+ if (IfShowTip)
+ {
+ IfShowTip=false;
+ FadeTip=false;
+ Current_Position=2;
+ ShowTip("I've heard that all of you\n\
+support hyper-threading?");
+ return;
+ }
+ ++frameskips;
+ if (frameskips<10&&!LOWFPS)return;
+ frameskips=0;
+ CreateTower8(400,300,857,3,57,20,false);
+ for (int i=1;i<=towcnt;++i)
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
+ for (int i=1;i<=towcnt;++i)
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
+ else
+ {
+ IfCallLevel=false;
+ aca.achroma2pnt();acb.achroma2pnt();
+ playerpos=vector2d(200,150);PlayerSplit=true;
+ return;
+ }
+}
+void Levelm1Part12()
+{
+ frameleft=ThirtySeconds;if(tower[towcnt].towertype!=6)towcnt=0;
+ DisableAllTower=false;
+ ++frameskips;
+ if (frameskips<10&&!LOWFPS)return;
+ frameskips=0;
+ CreateTower6(400,300,2500,2,2000,3,12);
+ for (int i=1;i<=towcnt;++i)
+ if (tower[i].RendColor==0x80FFFFFF)
+ tower[i].RendColor=0x00FFFFFF;
+ for (int i=1;i<=towcnt;++i)
+ if ((tower[i].RendColor>>24)<=0x80)
+ tower[i].RendColor=tower[i].RendColor+0x01FFFFFF;
+ else
+ {
+ IfCallLevel=false;
+ return;
+ }
+}
diff --git a/main.cpp b/main.cpp
index 72cdb81..c4e6a12 100644
--- a/main.cpp
+++ b/main.cpp
@@ -164,7 +164,13 @@ void ProcessPlayer()
Lock.Setdata(i,vector2d(0,playerpos.y+7),vector2d(800,playerpos.y+7),0xC0FFFFFF);
Lock.Render();
}
+ if(!PlayerSplit)
playerspr->RenderEx(playerpos.x+8.4,playerpos.y+8.4,playerrot,0.7,0);
+ else
+ {
+ for(int i=0;i<4;++i)
+ playerspr->RenderEx(playerpos.x+splitData[i].x+8.4,playerpos.y+splitData[i].y+8.4,playerrot,0.7,0);
+ }
if (DisablePlayer)return;
if (!LOWFPS)
playerrot+=0.00174533;
@@ -182,7 +188,7 @@ void ProcessPlayer()
}
if (hge->Input_GetKeyState(HGEK_RIGHT)&&!playerLockX)
{
- if (playerpos.x<770)
+ if ((playerpos.x<770&&!PlayerSplit)||(playerpos.x<370&&PlayerSplit))
playerpos.x+=realspd;
}
if (hge->Input_GetKeyState(HGEK_UP)&&!playerLockY)
@@ -192,20 +198,20 @@ void ProcessPlayer()
}
if (hge->Input_GetKeyState(HGEK_DOWN)&&!playerLockY)
{
- if (playerpos.y<570)
+ if ((playerpos.y<570&&!PlayerSplit)||(playerpos.y<270&&PlayerSplit))
playerpos.y+=realspd;
}
if (!clrmode)
{
- if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT&&clrrange==0/*&&clrtime+clrbns*/&&!diffkey)
+ if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_HIT&&clrrange==0&&!diffkey)
{
clrmaxrange=0;clrind=0;
}
- if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_HIT&&clrrange==0/*&&clrtime+clrbns*/&&diffkey)
+ if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_HIT&&clrrange==0&&diffkey)
{
clrmaxrange=0;clrind=0;
}
- if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_KEEP&&clrrange==0/*&&clrtime+clrbns*/&&!diffkey)
+ if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_KEEP&&clrrange==0&&!diffkey)
{
if (clrmaxrange<=400)
{
@@ -214,7 +220,7 @@ void ProcessPlayer()
if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi;
clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f);
}
- if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_KEEP&&clrrange==0/*&&clrtime+clrbns*/&&diffkey)
+ if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_KEEP&&clrrange==0&&diffkey)
{
if (clrmaxrange<=400)
{
@@ -223,7 +229,7 @@ void ProcessPlayer()
if (!LOWFPS)clrind+=0.001*pi;else clrind+=0.016*pi;
clrcircle->RenderEx(playerpos.x+7.2,playerpos.y+7.2,clrind,2*clrmaxrange/193.0f);
}
- if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_RELEASE&&clrrange==0/*&&clrtime+clrbns*/&&!diffkey/*&&clrmaxrange>50*/)
+ if (hge->Input_GetKeyStateEx(HGEK_Z)==HGEKST_RELEASE&&clrrange==0&&!diffkey)
{
if (clrmaxrange<=50)
{
@@ -234,7 +240,7 @@ void ProcessPlayer()
Player_Clear_Expand();++clrusg;
}
}
- if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_RELEASE&&clrrange==0/*&&clrtime+clrbns*/&&diffkey/*&&clrmaxrange>50*/)
+ if (hge->Input_GetKeyStateEx(HGEK_X)==HGEKST_RELEASE&&clrrange==0&&diffkey)
{
if (clrmaxrange<=50)
{
@@ -445,7 +451,7 @@ void CallLevels()
if (level==7&&part==23)Level7Part23();
if (level==7&&part==24)Level7Part24();
if (level==7&&part==25)Level7Part25();
- if (level==-1&&part==26)Level7Part26();
+ if (level==7&&part==26)Level7Part26();
if (level==-1&&part==0)Levelm1Part0();
if (level==-1&&part==1)Levelm1Part1();
if (level==-1&&part==2)Levelm1Part2();
@@ -457,6 +463,8 @@ void CallLevels()
if (level==-1&&part==8)Levelm1Part8();
if (level==-1&&part==9)Levelm1Part9();
if (level==-1&&part==10)Levelm1Part10();
+ if (level==-1&&part==11)Levelm1Part11();
+ if (level==-1&&part==12)Levelm1Part12();
if (level==1&&part==5)level=2,part=0;
if (level==2&&part==10)level=3,part=0;
if (level==3&&part==7)level=4,part=0;
diff --git a/menus.h b/menus.h
index 758cb4c..8fca040 100644
--- a/menus.h
+++ b/menus.h
@@ -44,7 +44,7 @@ void StartGUI_FrameFnk()
playerpos.x=400,playerpos.y=400,playerrot=0;
frameleft=ThirtySeconds;infofade=0xFF;Dis8ref=t8special=false;
level=1,part=1;frms=0,averfps=0.0;bsscale=1;
- towcnt=bulcnt=0;whrcnt=12;skyactive=false;
+ towcnt=bulcnt=0;whrcnt=12;skyactive=false;PlayerSplit=false;
score=0;Mult_Init();//Music_Init("./Resources/Music/CanonTechno.ogg");
lpst=4625568;lped=9234584;//Music_Play();
coll=semicoll=clrusg=0;playerLockX=playerLockY=false;
@@ -96,7 +96,7 @@ void StartGUI_FrameFnk()
playerpos.x=400,playerpos.y=400,playerrot=0;
frameleft=ThirtySeconds;infofade=0xFF;Dis8ref=t8special=false;
level=1,part=1;frms=0,averfps=0.0;bsscale=1;
- towcnt=bulcnt=0;whrcnt=12;skyactive=false;
+ towcnt=bulcnt=0;whrcnt=12;skyactive=false;PlayerSplit=false;
score=0;Mult_Init();//Music_Init("./Resources/Music/CanonTechno.ogg");
lpst=4625568;lped=9234584;//Music_Play();
coll=semicoll=clrusg=0;playerLockX=playerLockY=false;
diff --git a/towernbullet.h b/towernbullet.h
index a9bae85..4c25f9d 100644
--- a/towernbullet.h
+++ b/towernbullet.h
@@ -47,7 +47,7 @@ int CreateBullet1(double x,double y,double bs,bool eff=false)
bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y;
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
- bullet[i].alterColor=green;
+ bullet[i].alterColor=green;bullet[i].alterColor2=COLOR_COUNT;
bullet[i].scollable=true;
bullet[i].scale=1;
if (eff)BulletEffect_Attatch(i);
@@ -112,7 +112,7 @@ void CreateBullet4(double x,double y,double bs,int yelbrk=0,bool eff=false)
bullet[i].yelbrk=yelbrk;
bullet[i].scollable=true;
bullet[i].scale=1;
- bullet[i].alterColor=yellow;
+ bullet[i].alterColor=yellow;bullet[i].alterColor2=COLOR_COUNT;
if (eff)BulletEffect_Attatch(i);
}
void CreateBullet5(double x,double y,double bs,bool eff=false)
@@ -137,7 +137,7 @@ void CreateBullet5(double x,double y,double bs,bool eff=false)
bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y;
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
- bullet[i].alterColor=purple;
+ bullet[i].alterColor=purple;bullet[i].alterColor2=COLOR_COUNT;
bullet[i].scollable=true;
bullet[i].scale=1;
if (eff)BulletEffect_Attatch(i);
@@ -164,7 +164,7 @@ int CreateBullet6(double x,double y,double bs,int explo,int exp1=8,int exp2=12,b
bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y;
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
- bullet[i].alterColor=red;
+ bullet[i].alterColor=red;bullet[i].alterColor2=COLOR_COUNT;
bullet[i].redattrib=0;
bullet[i].exp1=exp1;
bullet[i].exp2=exp2;
@@ -196,7 +196,7 @@ int CreateBullet7(double x,double y,double bs,int explo,bool eff=false)
bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y;
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
- bullet[i].alterColor=white;
+ bullet[i].alterColor=white;bullet[i].alterColor2=COLOR_COUNT;
bullet[i].oriexplo=bullet[i].redexplo=explo;
bullet[i].redattrib=0;
bullet[i].whirem=whicnt;
@@ -228,7 +228,7 @@ int CreateBullet8(double x,double y,double bs,bool eff=false)
bullet[i].dist=bullet[i].bulletdir.x*bullet[i].bulletdir.x+bullet[i].bulletdir.y*bullet[i].bulletdir.y;
bullet[i].dist=sqrt(bullet[i].dist);
bullet[i].bulletspeed=bs;
- bullet[i].alterColor=dblue;
+ bullet[i].alterColor=dblue;bullet[i].alterColor2=COLOR_COUNT;
bullet[i].scollable=true;
bullet[i].scale=1;
if (eff)BulletEffect_Attatch(i);
@@ -262,7 +262,7 @@ int CreateBullet9(double x,double y,double bs,int explo,int cnt,int brk,bool eff
bullet[i].redattrib=0;
bullet[i].whicnt=cnt;
bullet[i].yelbrk=brk;
- bullet[i].alterColor=orange;
+ bullet[i].alterColor=orange;bullet[i].alterColor2=COLOR_COUNT;
bullet[i].scollable=true;
bullet[i].scale=1;
if (eff)BulletEffect_Attatch(i);
@@ -350,37 +350,82 @@ void ProcessBullet2(int i)
bullet[i].bulletpos.y-=bsscale*bullet[i].bulletspeed*(bullet[i].bulletdir.y)/20*(1000.0f/hge->Timer_GetFPS());
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);
- if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625)
+ if(PlayerSplit)
{
- bullet[i].exist=false;
- bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999;
- bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
- bullet[i].dist=0;
- bullet[i].bullettype=0;
- return;
+ bool rndr=true;
+ for(int j=0;j<4;++j)
+ {
+ double dis=GetDist(bullet[i].bulletpos,playerpos+splitData[j]);
+ if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625)
+ {
+ bullet[i].exist=false;rndr=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ return;
+ }
+ if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable)
+ {
+ ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;rndr=false;
+ if(!bullet[i].inv)
+ {
+ bullet[i].exist=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ }
+ return;
+ }
+ else
+ {
+ if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(playerpos+splitData[j]);
+ }
+ }
+ if(rndr)
+ {
+ if(bullet[i].alterColor2==COLOR_COUNT)
+ bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ else
+ RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale),
+ Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0;
+ }
}
- if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable)
+ else
{
- ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;
- if(!bullet[i].inv)
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
+ if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625)
{
bullet[i].exist=false;
- bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999;
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
+ return;
+ }
+ if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable)
+ {
+ ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;
+ if(!bullet[i].inv)
+ {
+ bullet[i].exist=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ }
+ return;
}
- return;
- }
- else
- {
- if(bullet[i].alterColor2==COLOR_COUNT)
- bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
else
- RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale),
- Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0;
- if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
+ {
+ if(bullet[i].alterColor2==COLOR_COUNT)
+ bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ else
+ RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale),
+ Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0;
+ if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
+ }
}
}
//There is no need for ProcessBullet3() because they are in fact bullet2
@@ -516,20 +561,82 @@ void ProcessBullet6(int i)
bullet[i].bullettype=0;
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);
- if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
+ if(PlayerSplit)
{
- if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
- bullet[i].exist=false;
- bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
- bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
- bullet[i].dist=0;
- bullet[i].bullettype=0;
+ bool rndr=true;
+ for(int j=0;j<4;++j)
+ {
+ double dis=GetDist(bullet[i].bulletpos,playerpos+splitData[j]);
+ if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625)
+ {
+ bullet[i].exist=false;rndr=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ return;
+ }
+ if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable)
+ {
+ ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;rndr=false;
+ if(!bullet[i].inv)
+ {
+ bullet[i].exist=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ }
+ return;
+ }
+ else
+ {
+ if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(playerpos+splitData[j]);
+ }
+ }
+ if(rndr)
+ {
+ if(bullet[i].alterColor2==COLOR_COUNT)
+ bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ else
+ RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale),
+ Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0;
+ }
}
else
{
- bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
- if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
+ if (bullet[i].bulletpos.x<=-25||bullet[i].bulletpos.x>=825||bullet[i].bulletpos.y<=-25||bullet[i].bulletpos.y>=625)
+ {
+ bullet[i].exist=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=-999;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ return;
+ }
+ if (bullet[i].scale<1.2&&dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7&&bullet[i].collable)
+ {
+ ++coll,scminus+=10000,Mult_BatClear();bullet[i].collable=false;
+ if(!bullet[i].inv)
+ {
+ bullet[i].exist=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ }
+ return;
+ }
+ else
+ {
+ if(bullet[i].alterColor2==COLOR_COUNT)
+ bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ else
+ RenderAlter(vector2d(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2),bullet[i].alterColor,bullet[i].alterColor2,bullet[i].rot,0.6*bullet[i].scale),
+ Current_Position==1?bullet[i].rot+=(i&1?1:-1)*(1000/hge->Timer_GetFPS())*pi/1000:0;
+ if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
+ }
}
}
void ProcessBullet7(int i)
@@ -651,23 +758,18 @@ void ProcessBullet8(int i)
}
}
BulletEffect_Process(i);
- double dis=GetDist(bullet[i].bulletpos,playerpos);
- if (dis<=6||bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
+ if(bullet[i].bulletpos.x<=-10||bullet[i].bulletpos.x>=800||bullet[i].bulletpos.y<=-10||bullet[i].bulletpos.y>=600)
{
- if (dis<=6&&clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();
- else
+ int cnt=re.NextInt(2,5);if (Dis8ref)cnt=0;
+ for (int ii=1;ii<=cnt;++ii)
{
- int cnt=re.NextInt(2,5);if (Dis8ref)cnt=0;
- for (int ii=1;ii<=cnt;++ii)
+ int pnt=CreateBullet2(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,re.NextDouble(-pi,pi));
+ if (t8special)
{
- int pnt=CreateBullet2(bullet[i].bulletpos.x,bullet[i].bulletpos.y,bullet[i].bulletspeed,re.NextDouble(0,pi));
- if (t8special)
- {
- bullet[pnt].alterColor=(TColors)(re.NextInt(0,7));
- bullet[pnt].alterColor2=(TColors)(re.NextInt(0,7));
- if(re.NextInt(0,3)==3)bullet[pnt].redir(vector2d(400,300));
- if(re.NextInt(0,1))++ii;
- }
+ bullet[pnt].alterColor=(TColors)(re.NextInt(0,7));
+ bullet[pnt].alterColor2=(TColors)(re.NextInt(0,7));
+ if(re.NextInt(0,3)==3)bullet[pnt].redir(vector2d(400,300));
+ if(re.NextInt(0,1))++ii;
}
}
bullet[i].exist=false;
@@ -675,11 +777,46 @@ void ProcessBullet8(int i)
bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
bullet[i].dist=0;
bullet[i].bullettype=0;
+ return;
}
- else
+ if(PlayerSplit)
{
+ for(int j=0;j<4;++j)
+ {
+ double dis=GetDist(bullet[i].bulletpos,playerpos+splitData[j]);
+ if (dis<=6)
+ {
+ if (dis<=6){if(clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();}
+ bullet[i].exist=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;
+ }
+ else
+ {
+ if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch(playerpos+splitData[j]);
+ }
+ }
bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
- if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
+ }
+ else
+ {
+ double dis=GetDist(bullet[i].bulletpos,playerpos);
+ if (dis<=6)
+ {
+ if (dis<=6){if(clrrange<1e-5&&clrrad-pi/2<1e-7)++coll,scminus+=10000,Mult_BatClear();}
+ bullet[i].exist=false;
+ bullet[i].bulletpos.x=bullet[i].bulletpos.y=0;
+ bullet[i].bulletdir.x=bullet[i].bulletdir.y=0;
+ bullet[i].dist=0;
+ bullet[i].bullettype=0;return;
+ }
+ else
+ {
+ bulletspr[bullet[i].alterColor]->RenderEx(bullet[i].bulletpos.x+7.2,bullet[i].bulletpos.y+7.2,0,0.6*bullet[i].scale,0);
+ if (dis<=16&&bullet[i].scollable)++semicoll,++dsmc,bullet[i].scollable=false,SCEffect_Attatch();
+ }
}
}
void ProcessBullet9(int i)
@@ -1286,7 +1423,16 @@ void ProcessTower8()
tower[i].dblstate=true;
tower[i].curtimer2=tower[i].towertimer2;
tower[i].curshotcount=tower[i].shotcount;
- if (!Dis8ref&&!t8special)BTarg.TargShow(),BTarg.targpos=playerpos;
+ if (!Dis8ref&&!t8special)BTarg.TargShow();
+ if (!Dis8ref)BTarg.targpos=playerpos;
+ if (PlayerSplit)
+ {
+ int r=0;
+ for(int i=1;i<4;++i)
+ if(GetDist(playerpos+splitData[r],vector2d(400,300))>
+ GetDist(playerpos+splitData[i],vector2d(400,300)))r=i;
+ BTarg.targpos=playerpos+splitData[r];
+ }
}
}
else
@@ -1314,14 +1460,7 @@ void ProcessTower8()
if (tower[i].towerpos.y<300)
bullet[pnt].setdir(-pi/2);else bullet[pnt].setdir(pi/2);
}
- if (tower[i].curshotcount==tower[i].shotcount)
- tower[i].tdir=bullet[pnt].bulletdir;
- else
- {
- bullet[pnt].bulletdir=tower[i].tdir;
- bullet[pnt].dist=bullet[pnt].bulletdir.x*bullet[pnt].bulletdir.x+bullet[pnt].bulletdir.y*bullet[pnt].bulletdir.y;
- bullet[pnt].dist=sqrt(bullet[pnt].dist);
- }
+ else bullet[pnt].redir(BTarg.targpos);
}
else
{
@@ -1329,15 +1468,8 @@ void ProcessTower8()
{
int pnt=CreateBullet8(tower[i].towerpos.x,tower[i].towerpos.y,tower[i].bulletspeed,tower[i].effect);
bullet[pnt].alterColor=white;
- if (tower[i].curshotcount==tower[i].shotcount&&j==0)
- tower[i].tdir=bullet[pnt].bulletdir;
- else
- {
- bullet[pnt].bulletdir=tower[i].tdir;
- bullet[pnt].bulletdir.ToUnitCircle();
- bullet[pnt].dist=1;
- bullet[pnt].bulletdir.rotate(j*2*pi/5);
- }
+ bullet[pnt].redir(BTarg.targpos);
+ bullet[pnt].bulletdir.rotate(j*2*pi/5);
}
}
tower[i].curtimer2=tower[i].towertimer2;
@@ -1454,7 +1586,7 @@ public:
++coll,scminus+=10000,collbrk=0,Mult_BatClear();
}
}
- if (GetDist()<16.0f)
+ if (GetDist()<9.0f)
{
if (!LOWFPS)++scollbrk;else scollbrk+=17;
if (scollbrk>200)
@@ -2386,7 +2518,7 @@ public:
class achromaGroup
{
private:
- class achromaBullet:private SimpleBullet
+ class achromaBullet:public SimpleBullet
{
private:
bool active;
@@ -2427,6 +2559,10 @@ public:
else if(col==green)col=red;
for(int i=0;i<500;++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);
+ }
void Update()
{
crbrk-=hge->Timer_GetDelta();