From ee48cc78ff887600725d5a064b90ce633f20d78b Mon Sep 17 00:00:00 2001 From: keizaal Date: Tue, 22 Jun 2021 16:27:05 +0200 Subject: [PATCH] Implemented functions for the other Crouch and Stand Attack in BlueNormals and added the calling in CharacterBlue --- src/gameplay/Characters/Blue/BlueNormals.java | 451 +++++++++++++++++- .../Characters/Blue/CharacterBlue.java | 4 +- 2 files changed, 453 insertions(+), 2 deletions(-) diff --git a/src/gameplay/Characters/Blue/BlueNormals.java b/src/gameplay/Characters/Blue/BlueNormals.java index 23ffe7a..ae8eb9a 100644 --- a/src/gameplay/Characters/Blue/BlueNormals.java +++ b/src/gameplay/Characters/Blue/BlueNormals.java @@ -460,6 +460,153 @@ public class BlueNormals { return new Attack(isSpecial,rS,cmd,parts); } + private static Frame crouchDFrame1() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = true; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*7),(138*5),138,138); + return f; + } + + private static Frame crouchDFrame2() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*7),(138*6),138,138); + return f; + } + + private static Frame crouchDFrame3() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*7),(138*7),138,138); + return f; + } + + private static Frame crouchDFrame4() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*7),(138*8),138,138); + return f; + } + + private static attackPart blueCrouchDstartup() { + Frame[] f = new Frame[4]; + f[0] = crouchDFrame1(); + f[1] = crouchDFrame1(); + f[2] = crouchDFrame1(); + f[3] = crouchDFrame1(); + return(new attackPart(f)); + } + + private static attackPart blueCrouchDrecovery() { + Frame[] f = new Frame[25]; + for(int i = 0; i < 15; i++) { + f[i] = crouchDFrame3(); + } + for(int i = 15; i < f.length; i++) { + f[i] = crouchDFrame4(); + } + return(new attackPart(f)); + } + + private static attackPart blueCrouchDactive() { + Frame[] f = new Frame[6]; + for(int i = 0; i < f.length; i++) { + f[i] = crouchAFrame2(); + } + return(new attackPart(120,0,31,10,30,15,f,true,false,true)); + } + + public static Attack blueCrouchRoundHouse() { + ButtonIG[][] cmd = {{DOWN,D}}; + boolean isSpecial = false; + Status rS = Status.NORMAL; + attackPart[] parts = {blueCrouchDstartup(),blueCrouchDactive(),blueCrouchDrecovery()}; + return new Attack(isSpecial,rS,cmd,parts); + } private static Frame standAFrame1(){ @@ -595,6 +742,153 @@ public class BlueNormals { attackPart[] parts = {blueStandAstartup(),blueStandAactive(),blueStandArecovery()}; return new Attack(isSpecial,rS,cmd,parts); } + + private static Frame StandCFrame1() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap(0,0,138,138); + return f; + } + + private static Frame StandCFrame2() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = true; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*3),(138*2),138,138); + return f; + } + + private static Frame StandCFrame3() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = false; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap(138,(138*6),138,138); + return f; + } + + private static Frame StandCFrame4() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = true; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox pB1 = new Push_HitBox(200,-150,160,400); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,pB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap(138,(138*7),138,138); + return f; + } + + private static attackPart blueStandCstartup() { + Frame[] f = new Frame[6]; + for(int i = 0; i < 3; i++) { + f[i] = StandCFrame1(); + } + for(int i = 3; i < 6; i++) { + f[i] = StandCFrame2(); + } + return(new attackPart(f)); + } + + private static attackPart blueStandCrecovery() { + Frame[] f = new Frame[22]; + for(int i = 0; i < 22; i++) { + f[i] = StandCFrame4(); + } + return(new attackPart(f)); + } + + private static attackPart blueStandCactive() { + Frame[] f = new Frame[6]; + for(int i = 0; i < f.length; i++) { + f[i] = StandCFrame3(); + } + return(new attackPart(100,0,28,14,10,5,f,false,false,false)); + } + + public static Attack blueStandFierce() { + ButtonIG[][] cmd = {{C}}; + boolean isSpecial = false; + Status rS = Status.NORMAL; + attackPart[] parts = {blueStandCstartup(),blueStandCactive(),blueStandCrecovery()}; + return new Attack(isSpecial,rS,cmd,parts); + } private static Frame standDFrame1(){ @@ -727,6 +1021,39 @@ public class BlueNormals { f.setSpriteWrap((138*10),138,138,138); return f; } + + private static Frame standDFrame5(){ + + /* + Hitboxes lists creation + */ + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + + /* + Individual hitboxes creation + */ + Passive_HitBox phb1 = new Passive_HitBox(70,70,150,500); + Passive_throw_HitBox pthb1 = new Passive_throw_HitBox(70,400,150,100); + Push_HitBox pushB = new Push_HitBox(70,70,150,500); + + /* + adding hitboxes to lists + */ + phb.add(phb1); + pthb.add(pthb1); + + /* + frame creation + */ + Frame f = new Frame(0.0,3.0,phb,ahb,pthb,athb,pushB, + //cancels (in order : normal, special, jump, move, dash) + false,false,false,false,false); + f.setSpriteWrap((138*4),0,138,138); + return f; + } private static attackPart blueStandDstartup() { Frame[] f = new Frame[8]; @@ -749,9 +1076,12 @@ public class BlueNormals { private static attackPart blueStandDrecovery() { Frame[] f = new Frame[18]; - for(int i = 0; i < f.length; i++) { + for(int i = 0; i < 10; i++) { f[i] = standDFrame4(); } + for(int i = 10; i < f.length; i++) { + f[i] = standDFrame5(); + } return(new attackPart(f)); } @@ -762,6 +1092,125 @@ public class BlueNormals { attackPart[] parts = {blueStandDstartup(),blueStandDactive(),blueStandDrecovery()}; return new Attack(isSpecial,rS,cmd,parts); } + + private static Frame StandBFrame1() { + //movement data + double moveX = 3.0; + double moveY = 0.0; + + //cancelData + boolean normalC = true; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*5),(138*5),138,138); + return f; + } + + private static Frame StandBFrame2() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = true; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*6),(138*5),138,138); + return f; + } + + private static Frame StandBFrame3() { + //movement data + double moveX = 0.0; + double moveY = 0.0; + + //cancelData + boolean normalC = true; + boolean specialC = false; + boolean jumpC = false; + boolean moveC = false; + boolean dashC = false; + + //hitbox lists + ArrayList ahb = new ArrayList(); + ArrayList athb = new ArrayList(); + ArrayList phb = new ArrayList(); + ArrayList pthb = new ArrayList(); + + //generate hitboxes here and then use ArrayList add method to add them to the correct list + Push_HitBox bStandPB1 = new Push_HitBox(70,70,150,500); + + Frame f = new Frame(moveY,moveX,phb,ahb,pthb,athb,bStandPB1,normalC,specialC,jumpC,moveC,dashC); + + //set sprite data on sheet + f.setSpriteWrap((138*7),(138*5),138,138); + return f; + } + + private static attackPart blueStandBstartup() { + Frame[] f = new Frame[6]; + for(int i = 0; i < 6; i++) { + f[i] = StandBFrame1(); + } + return(new attackPart(f)); + } + + private static attackPart blueStandBactive() { + Frame[] f = new Frame[6]; + for(int i = 0; i < f.length; i++) { + f[i] = StandBFrame2(); + } + return(new attackPart(80,0,11,8,8,5,f,false,false,false)); + } + + private static attackPart blueStandBrecovery() { + Frame[] f = new Frame[4]; + for(int i = 0; i < 4; i++) { + f[i] = StandBFrame3(); + } + return(new attackPart(f)); + } + + public static Attack blueStandShort() { + ButtonIG[][] cmd = {{B}}; + boolean isSpecial = false; + Status rS = Status.NORMAL; + attackPart[] parts = {blueStandBstartup(),blueStandBactive(),blueStandBrecovery()}; + return new Attack(isSpecial,rS,cmd,parts); + } + + + private static Frame ForwardDFrame0() { //movement data double moveX = 3.0; diff --git a/src/gameplay/Characters/Blue/CharacterBlue.java b/src/gameplay/Characters/Blue/CharacterBlue.java index 087b352..5b5bfc2 100644 --- a/src/gameplay/Characters/Blue/CharacterBlue.java +++ b/src/gameplay/Characters/Blue/CharacterBlue.java @@ -31,7 +31,9 @@ public class CharacterBlue { Jump nJ = new Jump(njcmd,nJumpF); Jump bJ = new Jump(bjcmd,bJumpF); - Attack[] atks = {blueLDP(),blueCrouchFierce(),blueCrouchJab(),blueCrouchShort(),blueStandHeavyKick(),blueStandJab(),blueFordwardRoundHouse()}; + Attack[] atks = {blueLDP(),blueCrouchFierce(),blueCrouchJab(),blueCrouchShort(),blueCrouchRoundHouse(), + blueStandHeavyKick(),blueStandJab(),blueStandFierce(),blueStandShort(), + blueFordwardRoundHouse()}; Frame shf = BlueMisc.blueStandHit(); Frame chf = BlueMisc.blueCrouchHit();