package com.lloydm.javakogengine_chess; class Blood { public static int BLOODSPAWNER = 1000; public static int MAXBLOOD = 800 * Config.FACTOR; public static int NUMBLOOD = 20; public static int bloodcount = 0; public static float ACCELERATION = -0.2f; public static int DUSTCLOUD = 100; public static int SPELL = 200; public static int FIRESPELL = 201; public static int DARKSPELL = 202; public static int GOODSPELL = 203; public static int GREENSPELL = 204;//15mar2021 public static int REDSPELL = 205;//15mar2021 public static int LIGHTNINGSPELL = 206;//28mar2021 public static int WHIRLWINDSPELL = 207;//28mar2021 public static int WHIRLWINDGRID = 5;//28mar2021 public float cx; public float cy; public float x; public float y; public float h; public float vx; public float vy; public float vh; public int life; public int red; public int green; public int blue; public int sizex; public int sizey; public float angle; public int magic;//28mar2021 public int ismagic; ///////////////////Method Definition/////////////// public Blood(int sx,int sy) { x = (float)sx; y = (float)sy; cx = sx; cy = sy; life = 90; h = 1.8f; angle = (float) Functions.rand(0,400) / 60f; vh = 2f * (float)(Functions.rand(70,100)) / 100f; vx = -2f * (float)(Functions.rand(-50,50)) / 100f; vy = -2f * (float)(Functions.rand(-50,50)) / 100f; red = Functions.rand(192,255); green = Functions.rand(32,128); blue = Functions.rand(96,160); sizex = Functions.rand(1,5); sizey = Functions.rand(1,5); ismagic = 0; } ///////////////////Method Definition/////////////// public Blood() { //all set to zero.... } ///////////////////Method Definition/////////////// public static void makeblood(Game game,int sx,int sy,int magic) { //make a blood or fiery or spell effect in game Functions.saveseed(Functions.seed); sy += Map.getheight(sx,sy); for(int j=0;j0 && magic=SPELL && magic<=SPELL+10) { Game.blood[i].life = 4; Game.blood[i].vh/=3; Game.blood[i].vx/=3; Game.blood[i].vy/=3; Game.blood[i].angle = (float) Functions.rand(0,400) / 60f; if(magic==FIRESPELL) { Game.blood[i].red = Functions.rand(180,250); Game.blood[i].green = Functions.rand(160,220); Game.blood[i].blue = Functions.rand(80,120); Game.blood[i].sizex*=2;//16sep2021 } if(magic==GOODSPELL) { Game.blood[i].red = Functions.rand(30,80); Game.blood[i].green = Functions.rand(120,220); Game.blood[i].blue = Functions.rand(180,240); } if(magic==DARKSPELL) { Game.blood[i].red = Functions.rand(180,250); Game.blood[i].green = Functions.rand(30,80); Game.blood[i].blue = Functions.rand(180,240); } //start-------//15mar2021 if(magic==GREENSPELL) { Game.blood[i].red = Functions.rand(20,80); Game.blood[i].green = Functions.rand(180,250); Game.blood[i].blue = Functions.rand(80,160); } if(magic==REDSPELL) { Game.blood[i].red = Functions.rand(180,250); Game.blood[i].green = Functions.rand(30,80); Game.blood[i].blue = Functions.rand(30,80); } //end---------//15mar2021 } if(magic>BLOODSPAWNER) { Game.blood[i].h = 0.1f; if(magic-BLOODSPAWNER==Game.PLAYERFACTION) { Game.blood[i].red = Functions.rand(80,120); Game.blood[i].green = Functions.rand(180,240); Game.blood[i].blue = Functions.rand(80,120); } if(magic-BLOODSPAWNER==Game.SKIRMISHENEMYFACTION) { Game.blood[i].green = Functions.rand(80,120); Game.blood[i].red = Functions.rand(180,240); Game.blood[i].blue = Functions.rand(180,240); } } break; } } if(magic==LIGHTNINGSPELL)//28mar2021 { break; } if(magic==WHIRLWINDSPELL)//28mar2021 { break; } if(magic>=FIRESPELL)//12apr2021 { if(Functions.rand(0,100)<33) { break;//12apr2021 } } } Functions.restoreseed(); } ///////////////////Method Definition/////////////// public static void clearall(Game game) //29oct2020 { //remove all the fx from the visuals of the game for(int i=0;i0) { bloodcount++; Game.blood[i].life--; Game.blood[i].x+=Game.blood[i].vx * (float)(Config.delta)/100f;//18sep2021 Game.blood[i].y+=Game.blood[i].vy * (float)(Config.delta)/100f;//18sep2021 Game.blood[i].h+=Game.blood[i].vh * (float)(Config.delta)/100f;//18sep2021 Game.blood[i].vh+=Blood.ACCELERATION; if(Game.blood[i].h<0) { Game.blood[i].vh*=-0.5f; Game.blood[i].h=0; Game.blood[i].vx*=0.6f; Game.blood[i].vy*=0.6f; } //if(Functions.abs(Game.blood[i].vx)<0.1f && Functions.abs(Game.blood[i].vy)<0.1f)//28mar2021 if(Functions.abs(Game.blood[i].vx)<0.1f && Functions.abs(Game.blood[i].vy)<0.1f && Game.blood[i].magic!=WHIRLWINDSPELL)//28mar2021 { Game.blood[i].life=0; } } } } ///////////////////Method Definition/////////////// public static void drawall(Game game) { //draw all the visual fx if(bloodcount>MAXBLOOD) { bloodcount=MAXBLOOD; } for(int i=0;i0) { //23mar2021 check if on screen if not then don't draw if(Game.blood[i].x-Game.CORNERX>=-100 && Game.blood[i].x-Game.CORNERX=-100 && Game.blood[i].y - Game.blood[i].h - Game.CORNERY<=Game.RESOLUTIONY+100) { if(Game.blood[i].magic==LIGHTNINGSPELL && Game.lightning!=-1) { int frame = (int)Functions.abs(Functions.rand(0,1000)) % (Game.images[Game.lightning].cwn * Game.images[Game.lightning].chn); RenderList.drawimage(game,Game.images[Game.lightning].texture,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h)-Game.CORNERY - Game.images[Game.lightning].chy/2,0,1f,1f,frame,1,false,1f,Game.lightning); } else { if(Game.blood[i].magic==WHIRLWINDSPELL && Game.whirlwind!=-1) { int frame = (int)Functions.abs((Game.frame/10)) % (Game.images[Game.whirlwind].cwn * Game.images[Game.whirlwind].chn); RenderList.drawimage(game,Game.images[Game.whirlwind].texture,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h)-Game.CORNERY - Game.images[Game.whirlwind].chy/2,0,0.5f,0.5f,frame,0,false,1f,Game.whirlwind); } else { if(Game.spellball!=-1 && Game.blood[i].magic>=FIRESPELL)//12apr2021 { int frame = 0; switch(Game.blood[i].magic) { case 205: frame = Game.REDBALL; break; case 204: frame = Game.GREENBALL; break; case 203: frame = Game.BLUEBALL; break; case 201: frame = Game.ORANGEBALL; break; case 202: frame = Game.PURPLEBALL; break; } RenderList.drawimage(game,Game.images[Game.spellball].texture,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h)-Game.CORNERY - Game.images[Game.spellball].chy/2,Game.blood[i].angle,0.7f+0.06f*(float)Game.blood[i].sizex,0.7f+0.06f*(float)Game.blood[i].sizex,frame,1,false,1f,Game.spellball); } else { RenderList.drawrect(game,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h) - Game.CORNERY,Game.blood[i].sizex,Game.blood[i].sizey,RenderList.getrgb(Game.blood[i].red,Game.blood[i].green,Game.blood[i].blue),0); } } } } } } } } /* class Blood { public static int BLOODSPAWNER = 1000; public static int MAXBLOOD = 800 * Config.FACTOR; public static int NUMBLOOD = 20; public static int bloodcount = 0; public static float ACCELERATION = -0.2f; public static int DUSTCLOUD = 100; public static int SPELL = 200; public static int FIRESPELL = 201; public static int DARKSPELL = 202; public static int GOODSPELL = 203; public static int GREENSPELL = 204;//15mar2021 public static int REDSPELL = 205;//15mar2021 public static int LIGHTNINGSPELL = 206;//28mar2021 public static int WHIRLWINDSPELL = 207;//28mar2021 public static int WHIRLWINDGRID = 5;//28mar2021 public float cx; public float cy; public float x; public float y; public float h; public float vx; public float vy; public float vh; public int life; public int red; public int green; public int blue; public int sizex; public int sizey; public float angle; public int magic;//28mar2021 public int ismagic; ///////////////////Method Definition/////////////// public Blood(int sx,int sy) { x = (float)sx; y = (float)sy; cx = sx; cy = sy; life = 90; h = 1.8f; angle = (float) Functions.rand(0,400) / 60f; vh = 2f * (float)(Functions.rand(70,100)) / 100f; vx = -2f * (float)(Functions.rand(-50,50)) / 100f; vy = -2f * (float)(Functions.rand(-50,50)) / 100f; red = Functions.rand(192,255); green = Functions.rand(32,128); blue = Functions.rand(96,160); sizex = Functions.rand(1,5); sizey = Functions.rand(1,5); ismagic = 0; } ///////////////////Method Definition/////////////// public Blood() { //all set to zero.... } ///////////////////Method Definition/////////////// public static void makeblood(Game game,int sx,int sy,int magic) { return; //make a blood or fiery or spell effect in game } ///////////////////Method Definition/////////////// public static void clearall(Game game) //29oct2020 { //remove all the fx from the visuals of the game for(int i=0;i0) { bloodcount++; Game.blood[i].life--; Game.blood[i].x+=Game.blood[i].vx * (float)(Config.delta)/100f;//18sep2021 Game.blood[i].y+=Game.blood[i].vy * (float)(Config.delta)/100f;//18sep2021 Game.blood[i].h+=Game.blood[i].vh * (float)(Config.delta)/100f;//18sep2021 Game.blood[i].vh+=Blood.ACCELERATION; if(Game.blood[i].h<0) { Game.blood[i].vh*=-0.5f; Game.blood[i].h=0; Game.blood[i].vx*=0.6f; Game.blood[i].vy*=0.6f; } //if(Functions.abs(Game.blood[i].vx)<0.1f && Functions.abs(Game.blood[i].vy)<0.1f)//28mar2021 if(Functions.abs(Game.blood[i].vx)<0.1f && Functions.abs(Game.blood[i].vy)<0.1f && Game.blood[i].magic!=WHIRLWINDSPELL)//28mar2021 { Game.blood[i].life=0; } } } } ///////////////////Method Definition/////////////// public static void drawall(Game game) { //draw all the visual fx if(bloodcount>MAXBLOOD) { bloodcount=MAXBLOOD; } for(int i=0;i0) { //23mar2021 check if on screen if not then don't draw if(Game.blood[i].x-Game.CORNERX>=-100 && Game.blood[i].x-Game.CORNERX=-100 && Game.blood[i].y - Game.blood[i].h - Game.CORNERY<=Game.RESOLUTIONY+100) { if(Game.blood[i].magic==LIGHTNINGSPELL && Game.lightning!=-1) { int frame = (int)Functions.abs(Functions.rand(0,1000)) % (Game.images[Game.lightning].cwn * Game.images[Game.lightning].chn); RenderList.drawimage(game,Game.images[Game.lightning].texture,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h)-Game.CORNERY - Game.images[Game.lightning].chy/2,0,1f,1f,frame,1,false,1f,Game.lightning); } else { if(Game.blood[i].magic==WHIRLWINDSPELL && Game.whirlwind!=-1) { int frame = (int)Functions.abs((Game.frame/10)) % (Game.images[Game.whirlwind].cwn * Game.images[Game.whirlwind].chn); RenderList.drawimage(game,Game.images[Game.whirlwind].texture,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h)-Game.CORNERY - Game.images[Game.whirlwind].chy/2,0,0.5f,0.5f,frame,0,false,1f,Game.whirlwind); } else { if(Game.spellball!=-1 && Game.blood[i].magic>=FIRESPELL)//12apr2021 { int frame = 0; switch(Game.blood[i].magic) { case 205: frame = Game.REDBALL; break; case 204: frame = Game.GREENBALL; break; case 203: frame = Game.BLUEBALL; break; case 201: frame = Game.ORANGEBALL; break; case 202: frame = Game.PURPLEBALL; break; } RenderList.drawimage(game,Game.images[Game.spellball].texture,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h)-Game.CORNERY - Game.images[Game.spellball].chy/2,Game.blood[i].angle,0.7f+0.06f*(float)Game.blood[i].sizex,0.7f+0.06f*(float)Game.blood[i].sizex,frame,1,false,1f,Game.spellball); } else { RenderList.drawrect(game,(int)Game.blood[i].x-Game.CORNERX,(int)(Game.blood[i].y - Game.blood[i].h) - Game.CORNERY,Game.blood[i].sizex,Game.blood[i].sizey,RenderList.getrgb(Game.blood[i].red,Game.blood[i].green,Game.blood[i].blue),0); } } } } } } } } */