class NPC : CUSTOM::Object { NPC(OBJECT::Object object, float xPos, float yPos) { super(object,xPos,yPos); playerHandling = HANDLING::PARTICLE; } void behavior() { draw(); } } class DemonNPC : NPC { DemonNPC(float xPos, float yPos) { super(OBJECT::DEMON,xPos,yPos); stand(); } void charge() {playAnimation(ANIM::DEMON,2,0,8);} void stand() {playAnimation(ANIM::DEMON,0,0,15);} } class BilsyNPC : NPC { BilsyNPC(float xPos, float yPos) { super(OBJECT::BILSY,xPos,yPos); stand(); } void stand() {playAnimation(ANIM::BILSBOSS,4,0,8);} void teleportInAnim() {playAnimation(ANIM::BILSBOSS,1,0,20,7,false);} void teleportOutAnim() {playAnimation(ANIM::BILSBOSS,2,0,17,7,false);} void fireballAnim() {playAnimation(ANIM::BILSBOSS,3,0,3);} void throwFireball() {playAnimation(ANIM::BILSBOSS,0,0,18,7,false);} } class BollyNPC : NPC { BollyNPC(float xPos, float yPos) { super(OBJECT::BOLLY,xPos,yPos); } void missileAnim() {playAnimation(ANIM::SONCSHIP,0,0,8);} void baseAnim() {playAnimation(ANIM::SONCSHIP,2,0,8);} void eyeAnim() {playAnimation(ANIM::SONCSHIP,3,0,6);} } class RavenNPC : NPC { RavenNPC(float xPos, float yPos) { super(OBJECT::RAVEN,xPos,yPos); fly(); } void fly() {playAnimation(ANIM::RAVEN,1,0,6);} void pose() {playAnimation(ANIM::RAVEN,0,0,2);} } class RavenDOA : RavenNPC { RavenDOA(float xPos, float yPos) { super(xPos,yPos); } void behavior() {RavenNPC::behavior();if(!isMoving()) delete();} } class DevilDevanNPC : NPC { DevilDevanNPC(float xPos, float yPos) { super(OBJECT::DEVILDEVAN,xPos,yPos); fly(); } void fly() {playAnimation(ANIM::DEVILDEVAN,5,0,11);} void fireBreath() {playAnimation(ANIM::DEVILDEVAN,0,0,11,7,false);} void startFireBreath() {playAnimation(ANIM::DEVILDEVAN,0,0,9,7,false);} void fireBreathPause() {playAnimation(ANIM::DEVILDEVAN,0,8,1,7,true);} void revertUntilFall() {playAnimation(ANIM::DEVILDEVAN,7,0,11,7,false);} void aboutToFall() {playAnimation(ANIM::DEVILDEVAN,7,11,1,7,true);} void startFall() {playAnimation(ANIM::DEVILDEVAN,7,11,2,7,false);} void fall() {playAnimation(ANIM::DEVILDEVAN,2,0,2);}; void stand() {playAnimation(ANIM::DEVILDEVAN,8,0,4);} void run() {playAnimation(ANIM::DEVILDEVAN,18,0,13);} } class BirdNPC : NPC { BirdNPC(float xPos, float yPos) { super(OBJECT::FISH,xPos,yPos); fly(); } void fly3D() {playAnimation(ANIM::BIRD3D,0,0,9);} void fly() {playAnimation(ANIM::BIRD,9,0,8);} } int nextPlayerID = 31; interface IRabbit : CUSTOM::ICustomObject { void set_name(string name); string get_name(); void set_nameLen(float nameLen); float get_nameLen(); void initRabbit(); void becomeSpaz(); void becomeJazz(); void becomeLori(); void becomeChar(CHAR::Char char); void redTeam(); void rabbitBehavior(); void becomeViolet(); void becomeRagnarok(); void becomeCooba(); void becomeBlacky(); void becomeDizZy(); void becomeSkull(); void becomeURJazz(); void becomeMdnchmr(); void becomeJJTublear(); void becomeSxypnksal(); void becomeFireSword(); void becomeFireball(); void becomePurpleKeet(); void becomeBlur(); void becomeEnigma(); void becomeBoarder(); void becomeTheServer(); void becomeSciz(); void becomeSuperjazz(); void becomeLark(); void becomeNimrod(); void becomeDalspots(); void becomeDerby(); void becomePlayer1(); void becomeSpotty(); void becomeBlackNinja(); void becomeSasik(); void becomeBirdie(); void becomeKJAZZ(); void becomeBean(); void becomeKrsplat(); void becomeOdin(); void becomeCelL(); void becomeQuickz(); void becomeTalec(); void becomeEvilMonkey(); void becomeSal(); void becomeTrafton(); void becomeVegito(); void becomeVelkasha(); void becomeSpazzyman(); void becomePyro(); void becomeSnooze(); void becomeEvilMike(); void becomeFireRabbit(); void becomeKrzysie(); void becomeSirEmentaler(); void becomeKyro(); void becomeRadium(); void becomeZepect(); void becomeTrey(); void become555(); void becomeSkOne(); void becomeNoob(); void becomeLotrfan(); void becomeDog(); void becomeJazzJackrabbit(); void becomeSpazJackrabbit(); void becomeLoriJackrabbit(); void becomeBossrule(); void becomeMetalDragon(); void becomeWicehy(); void blueTeam(); void drawName(); void idleAnim(); void poseAnim(); void runAnim(); void hangVineAnim(); void ledgeAnim(); void copterAnim(); void copterShootAnim(); void jumpShootAnim(); void hurtAnim(); void deathAnim(); void deadAnim(); void crouchShootAnim(); void crouchAnim(); void jumpAnim(); } mixin class Rabbit : IRabbit { private string nam; private float namLen; private int playerNum; private CHAR::Char char = CHAR::SPAZ; void initRabbit() { setStandFrame(); } //TODO: This is really bad and might break if plus changes how anims are loaded void setStandFrame() { if(jjIsTSF)this.curFrame = 1410; //Hax for proper hit boxes else this.curFrame = 1579; } void setCrouchFrame() { if(jjIsTSF)this.curFrame = 1278; else this.curFrame = 1427; } bool isCrouchFrame() { if(jjIsTSF) return this.curFrame == 1278; else return this.curFrame == 1427; } void fur(int a, int b, int c, int d) { spriteMode = SPRITE::PLAYER; this.playerNum = nextPlayerID; jjPlayers[this.playerNum].furSet(a,b,c,d); spriteParam = nextPlayerID--; } void set_name(string name) {this.nam = "§0" + name;} string get_name() { return this.nam; } void set_nameLen(float nameLen) {this.namLen = nameLen;} float get_nameLen() {return namLen;} void becomeViolet() {this.name="Violet CLM"; this.nameLen=2.7*32; fur(88,24,72,32);} void becomeRagnarok() {this.name="Ragnar0k Cx"; this.nameLen=3*32; fur(64,64,24,88);} void becomeCooba() {this.name="cooba||||[si]"; this.nameLen=2.5*32; fur(0,64,88,176);} void becomeBlacky() {this.name="Blacky||||[si]"; this.nameLen=2.5*32; fur(1,24,24,1);} void becomeDizZy() {this.name="DizZy DM"; this.nameLen=2*32; fur(24,24,72,24);} void becomeSkull() {this.name="SkulL FoR"; this.nameLen=3*32; fur(24,24,64,24);} void becomeURJazz() {this.name="|UR|Ja|zz|CC"; this.nameLen=3*32; fur(29,29,29,29);} void becomeMdnchmr() {this.name="mdnchmr"; this.nameLen=2*32; fur(51,22,51,47);} void becomeJJTublear() {this.name="|JJ Tüblèãr"; this.nameLen=3.5*32; fur(37,37,37,37);} void becomeSxypnksal() {this.name="|||||SxYpNkSaL"; this.nameLen=3*32; fur(44,44,44,44);} void becomeFireSword() {this.name="FireSword DM"; this.nameLen=3.5*32; fur(40,40,64,72);} void becomeFireball() {this.name="Fireball FoR"; this.nameLen=3*32; fur(24,24,40,24);} void becomePurpleKeet() {this.name="Purple Keet"; this.nameLen=3.5*32; fur(88,24,24,88);} void becomeBlur() {this.name="blur||||[si]"; this.nameLen=2*32; fur(40,32,32,32);} void becomeEnigma() {this.name="Enigma TF"; this.nameLen=2.5*32; fur(16,32,32,16);} void becomeBoarder() {this.name="Boarder FoR"; this.nameLen=3.2*32; fur(64,64,64,64);} void becomeTheServer() {this.name="The Server"; this.nameLen=3.5*32; fur(64,64,64,64);} void becomeSciz() {this.name="Sciz CT"; this.nameLen=2*32; fur(40,40,32,40);} void becomeSuperjazz() {this.name="Superjazz"; this.nameLen=3*32; fur(80,80,40,64);} void becomeLark() {this.name="Lark||||[si]"; this.nameLen=2*32; fur(64,64,32,24);} void becomeNimrod() {this.name="||[GpW]|Nimrod"; this.nameLen=3*32; fur(32,64,88,64);} void becomeDalspots() {this.name="dalspots"; this.nameLen=2.5*32; fur(32,40,32,32);} void becomeDerby() {this.name="Derby"; this.nameLen=1.5*32; fur(40,32,24,16);} void becomePlayer1() {this.name="Player 1"; this.nameLen=2*32; fur(40,32,24,16);} void becomeSpotty() {this.name="ŠpõttÿDM"; this.nameLen=2.5*32; fur(80,32,72,72);} void becomeBlackNinja() {this.name="|ßläçk Ñiñjà"; this.nameLen=3*32; fur(16,40,88,1);} void becomeSasik() {this.name="Sasik[VS]"; this.nameLen=2.5*32; fur(32,32,1,32);} void becomeBirdie() {this.name="Birdie8D"; this.nameLen=2.5*32; fur(0,80,80,0);} void becomeKJAZZ() {this.name="KJAZZ"; this.nameLen=2*32; fur(32,40,32,24);} void becomeBean() {this.name="|||Bean"; this.nameLen=1.5*32; fur(24,72,24,32);} void becomeKrsplat() {this.name="|0<9/1_\\Spalt"; this.nameLen=3.5*32; fur(67,3,35,55);} void becomeOdin() {this.name="||||||||Odin"; this.nameLen=1.2*32; fur(72,72,80,72);} void becomeCelL() {this.name="CelL FoR"; this.nameLen=2.5*32; fur(1,1,64,1);} void becomeQuickz() {this.name="QuickzCC"; this.nameLen=2.5*32; fur(40,24,64,16);} void becomeTalec() {this.name="Talec LP"; this.nameLen=2.5*32; fur(32,32,32,32);} void becomeEvilMonkey() {this.name="||Evil||Monkey"; this.nameLen=3*32; fur(24,24,0,72);} void becomeSal() {this.name="sÀlÄmÃnDèR DM"; this.nameLen=4.2*32; fur(32,40,16,69);} void becomeTrafton() {this.name="Trafton AT"; this.nameLen=2.7*32; fur(32,40,16,24);} void becomeVegito() {this.name="VegitoCC"; this.nameLen=2.3*32; fur(32,40,16,24);} void becomeVelkasha() {this.name="Velkasha DM"; this.nameLen=3*32; fur(32,40,16,24);} void becomeSpazzyman() {this.name="spazzyman"; this.nameLen=3*32; fur(40,32,24,16);} void becomePyro() {this.name="Pyromanus[GpW]"; this.nameLen=4*32; fur(40,32,24,16);} void becomeSnooze() {this.name="SnoozeCC"; this.nameLen=2.5*32; fur(40,32,24,16);} void becomeEvilMike() {this.name="EvilMike DM"; this.nameLen=3*32; fur(32,32,32,72);} void becomeFireRabbit() {this.name="FireRabbit"; this.nameLen=3*32; fur(32,40,16,24);} void becomeKrzysie() {this.name="KrzysieCx"; this.nameLen=3*32; fur(32,40,16,24);} void becomeSirEmentaler() {this.name="-t3||||||||'"; this.nameLen=1*32; fur(80,72,80,40);} void becomeKyro() {this.name="KyroCC"; this.nameLen=2*32; fur(80,80,64,80);} void becomeRadium() {this.name="|Çhàós||HyÐrá"; this.nameLen=3*32; fur(40,32,24,16);} void becomeZepect() {this.name="zepect"; this.nameLen=2*32; fur(64,64,32,40);} void becomeTrey() {this.name="|Tr|||eyLi|na"; this.nameLen=2.5*32; fur(41,65,17,87);} void become555() {this.name="|||||555"; this.nameLen=1*32; fur(40,48,81,89);} void becomeSkOne() {this.name="SK one"; this.nameLen=2*32; fur(80,24,40,40);} void becomeNoob() {this.name="noob"; this.nameLen=1.5*32; fur(40,32,24,16);} void becomeLotrfan() {this.name="LOTRFAN"; this.nameLen=2*32; fur(64,40,32,80);} void becomeDog() {this.name="dog"; this.nameLen=1*32; fur(40,32,40,64);} void becomeJazzJackrabbit() {this.name="Jazz Jackrabbit"; this.nameLen=3.5*32; fur(40,32,40,64);} void becomeSpazJackrabbit() {this.name="Spaz Jackrabbit"; this.nameLen=3.5*32; fur(40,32,40,64);} void becomeLoriJackrabbit() {this.name="Lori Jackrabbit"; this.nameLen=3.5*32; fur(40,32,40,64);} void becomeBossrule() {this.name="BOSSRULE"; this.nameLen=3*32; fur(40,32,24,16);} void becomeMetalDragon() { this.name="metaldragon cc"; this.nameLen=4*32; fur(40,32,24,16); spriteMode = SPRITE::TINTED; spriteParam = 17; } void becomeWicehy() { this.name="wiCeHY[JeW]"; this.nameLen=3*32; fur(40,32,24,16); spriteMode = SPRITE::TINTED; spriteParam = 91; } void becomeSpaz() { this.char = CHAR::SPAZ;} void becomeJazz() { this.char = CHAR::JAZZ;} void becomeLori() { this.char = CHAR::LORI;} void becomeChar(CHAR::Char char) { this.char = char; } void redTeam() { int a,b,_; jjPlayers[this.playerNum].furGet(a,_,b,_); jjPlayers[this.playerNum].furSet(a,24,b,24); } void blueTeam() { int a,b,_; jjPlayers[this.playerNum].furGet(a,_,b,_); jjPlayers[this.playerNum].furSet(a,32,b,32); } void drawName() { if(nameLen > 0) jjDrawString(xPos-nameLen/2.0,yPos-28,nam,STRING::SMALL,STRING::NORMAL,0,1); } void rabbitBehavior() {drawName();} void idleAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,61,0,1); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,61,0,4,11); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,61,0,8);} bool isIdleAnim() { return animation == 61; } void poseAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,12,0,1); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,12,0,1); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,12,0,1);} bool isPoseAnim() { return animation == 12 && startFram == 0;} //TODO: other 12 void runAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,56,0,3); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,56,0,3); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,56,0,3);} bool isRunAnim() { return animation == 56; } void hangVineAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,22,0,5,10); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,22,0,7,10); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,22,0,28,10);} bool isHangVineAnim() { return animation == 22; } void vineShootAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,24,0,2,7,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,24,0,2,7,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,24,0,2,7,false);} bool isVineShootAnim() { return animation == 24; } void ledgeAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,40,0,18,10,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,40,0,22,6); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,40,0,22,12);} bool isLedgeAnim() { return animation == 40; } void copterAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,25,0,8); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,25,0,8); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,25,0,28);} bool isCopterAnim() { return animation == 25; } void copterShootAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,27,0,2,7,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,27,0,2,7,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,27,0,2,7,false);} bool isCopterShootAnim() { return animation == 27; } void jumpShootAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,36,0,2,15,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,36,0,2,15,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,36,0,2,15,false);} bool isJumpShootAnim() { return animation == 36; } void hurtAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,29,0,9,7,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,29,0,11,7,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,29,0,11,7,false);} bool isHurtAnim() { return animation == 29; } void deathAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,4,0,20,7,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,4,0,20,7,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,4,0,24,7,false);} bool isDeathAnim() { return animation == 4; } void deadAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,3,0,1); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,3,0,5); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,3,0,1);} bool isDeadAnim() { return animation == 3; } void crouchShootAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,7,0,2,15,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,7,0,2,15,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,7,0,2,15,false);} bool isCrouchShootAnim() { return animation == 7; } void crouchAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,5,1,1); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,5,1,1); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,5,1,1);} bool isCrouchAnim() { return animation == 5 && startFram==1; } void startCrouchingAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,5,0,2,7,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,5,0,2,7,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,5,0,2,7,false);} bool isStartCrouchingAnim() { return animation == 5 && startFram==0; } void startStandingAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,8,0,2,3,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,8,1,2,3,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,8,0,2,3,false);} bool isStartStandingAnim() { return animation == 8; } void jumpAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,39,0,3); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,39,0,3); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,39,0,3);} bool isJumpAnim() { return animation == 39; } void fallAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,11,0,3); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,11,0,3); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,11,0,3);} bool isFallAnim() { return animation == 11; } void hitGroundAnim() {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,13,0,5,2,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,13,0,5,2,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,13,0,7,2,false);} bool isHitGroundAnim() { return animation == 13; } void standShootAnim(){if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,14,0,2,15,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,14,0,2,15,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,14,0,2,15,false);} bool isStandShootAnim() { return animation == 14; } void jumpPutAwayGunAnim(){if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,35,0,2,7,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,35,0,2,7,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,35,0,2,7,false);} bool isJumpPutAwayGunAnim() { return animation == 35; } void standPutAwayGunAnim(){if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,47,0,4,5,false); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,47,0,4,5,false); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,47,0,4,5,false);} bool isStandPutAwayGunAnim() { return animation == 47; } /* {if(char==CHAR::JAZZ) playAnimation(ANIM::JAZZ,); else if(char==CHAR::SPAZ) playAnimation(ANIM::SPAZ,); else if(char==CHAR::LORI) playAnimation(ANIM::LORI,);} */ } class RabbitNPC : NPC, Rabbit { RabbitNPC(CHAR::Char char,float xPos, float yPos) { super(NIL,xPos,yPos); this.char = char; idleAnim(); } void behavior() { rabbitBehavior(); NPC::behavior(); } } class RabbitDOA : RabbitNPC { RabbitDOA(CHAR::Char char,float xPos, float yPos) { super(char,xPos,yPos); } void behavior() {RabbitNPC::behavior();if(!isMoving()) delete();} } class DyingRabbit : NPC, Rabbit { DyingRabbit(CHAR::Char char,float xPos,float yPos) { super(NIL,xPos,yPos); this.char = char; deathAnim(); } void behavior() { if(!isPlayingAnimation()) deadAnim(); rabbitBehavior(); NPC::behavior(); } } interface IRabbitEnemy : IRabbit { void initRabbitEnemy(); void jump(); void crouch(); void stand(); void shoot(int weapon,bool powerup); void shoot(); void set_deleteOnDeath(bool delete); bool get_deleteOnDeath() const; void set_touchingHurts(bool hurts); bool get_touchingHurts() const; int get_fastFire() const; void set_fastFire(int fastFire); int get_weapon() const; void set_weapon(int weapon); bool get_powerup() const; void set_powerup(bool powerup); bool get_isIdle() const; void set_isIdle(bool isIdle); int get_hearts() const; void set_hearts(int hearts); bool get_facePlayer() const; void set_facePlayer(bool face); void hurt(int damage,bool showMessage); void rabbitEnemyBehavior(); void onRabbitEnemyHit(jjOBJ@ bullet, jjPLAYER@ player, int force); int distToGround(); bool onGround(int charHeight=21); bool isDrawn(); } mixin class RabbitEnemy : IRabbitEnemy { private uint8 blink=0; private int heart=5; private bool showHearts = true; private bool jumpAction = false; private bool crouchAction = false; private bool standAction = false; private bool shootAction = false; private bool deleteMe = true; private bool noTouchy = true; private bool facePlay = false; private int ff = 16; private int weaponNumber = 1; private bool power = false; private bool idle = false; void initRabbitEnemy() { initRabbit(); playerHandling = HANDLING::SPECIAL; scriptedCollisions = true; } void resetActions() { jumpAction = false; crouchAction = false; standAction = false; shootAction = false; } void set_deleteOnDeath(bool delete) {this.deleteMe = delete;} bool get_deleteOnDeath() const {return deleteMe;} void set_touchingHurts(bool hurts) {this.noTouchy=hurts;} bool get_touchingHurts() const {return this.noTouchy;} bool get_facePlayer() const {return facePlay;} void set_facePlayer(bool face) {this.facePlay = face;} int get_fastFire() const {return ff;} void set_fastFire(int fastFire) {this.ff = fastFire;} int get_weapon() const {return weaponNumber;} void set_weapon(int weapon) {this.weaponNumber = weapon;} bool get_powerup() const {return power;} void set_powerup(bool powerup) {this.power = powerup;} bool get_isIdle() const {return idle;} void set_isIdle(bool isIdle) {this.idle = isIdle;} int get_hearts() const {return heart;} void set_hearts(int hearts) { this.heart=hearts;} void jump() {jumpAction = true;} void crouch() {crouchAction=true;} void stand() {standAction=true;} void shoot(int weapon,bool powerup) { this.weapon=weapon; this.powerup=powerup; shoot(); } void shoot() { this.shootAction = true; } private void fireWeapon() { if(powerup) { switch(weapon) { case 1:jjAddObject(OBJECT::BLASTERBULLETPU,xPos+direction*15,yPos,objectID);break; case 2:jjAddObject(OBJECT::BOUNCERBULLETPU,xPos+direction*15,yPos,objectID);break; case 3:jjAddObject(OBJECT::ICEBULLETPU,xPos+direction*15,yPos,objectID);break; case 4:jjAddObject(OBJECT::SEEKERBULLETPU,xPos+direction*15,yPos,objectID);break; case 5:{ jjObjects[jjAddObject(OBJECT::RFBULLETPU,xPos+direction*15,yPos,objectID)].ySpeed=1; jjObjects[jjAddObject(OBJECT::RFBULLETPU,xPos+direction*15,yPos,objectID)]; jjObjects[jjAddObject(OBJECT::RFBULLETPU,xPos+direction*15,yPos,objectID)].ySpeed=-1; break; } case 6:jjAddObject(OBJECT::TOASTERBULLETPU,xPos+direction*15,yPos,objectID);break; case 7:jjAddObject(OBJECT::TNT,xPos+direction*15,yPos,objectID);break; case 8:jjAddObject(OBJECT::FIREBALLBULLETPU,xPos+direction*15,yPos,objectID);break; case 9:jjAddObject(OBJECT::ELECTROBULLETPU,xPos+direction*15,yPos,objectID);break; } } else { switch(weapon) { case 1:jjAddObject(OBJECT::BLASTERBULLET,xPos+direction*15,yPos,objectID);break; case 2:jjAddObject(OBJECT::BOUNCERBULLET,xPos+direction*15,yPos,objectID);break; case 3:jjAddObject(OBJECT::ICEBULLET,xPos+direction*15,yPos,objectID);break; case 4:jjAddObject(OBJECT::SEEKERBULLET,xPos+direction*15,yPos,objectID);break; case 5:{ jjObjects[jjAddObject(OBJECT::RFBULLET,xPos+direction*15,yPos,objectID)].ySpeed=1; jjObjects[jjAddObject(OBJECT::RFBULLET,xPos+direction*15,yPos,objectID)].ySpeed=-1; break; } case 6:jjAddObject(OBJECT::TOASTERBULLET,xPos+direction*15,yPos,objectID);break; case 7:jjAddObject(OBJECT::TNT,xPos+direction*15,yPos,objectID);break; case 8:jjAddObject(OBJECT::FIREBALLBULLET,xPos+direction*15,yPos,objectID);break; case 9:jjAddObject(OBJECT::ELECTROBULLET,xPos+direction*15,yPos,objectID);break; } } } void onNotIdle() {} void rabbitEnemyBehavior() { //jjObject Maintenance justHit = 0; if(heart>0) energy=255; if(!isIdle) onNotIdle(); if(!isActive) return; if(facePlay) direction = p.xPos > xPos ? 1 : -1; //Take actions if(!((isHurtAnim()||isDeathAnim()||isDeadAnim())&&isPlayingAnimation())) { if(onGround()) { if(jumpAction) {ySpeed = -7; setStandFrame();} else if(crouchAction) {setCrouchFrame();} //Maybe change curFrame? } if(shootAction) { if(jjGameTicks%fastFire==0) fireWeapon(); } } if(isDeathAnim()&&!isPlayingAnimation()&&deleteMe) { delete(); return; } //Determine the animation if(!((isHurtAnim()||isDeathAnim()||isDeadAnim())&&isPlayingAnimation())) { //If already playing the hurt animation, do nothing if(onGround()) { if(isCrouchFrame()) { if(shootAction || isCrouchShootAnim()) { crouchShootAnim(); } else if(!isCrouchShootAnim() && !isCrouchAnim() && !isStartCrouchingAnim()) { startCrouchingAnim(); } else if(isStartCrouchingAnim() && !isPlayingAnimation()) { crouchAnim(); } } else { if(shootAction || (isStandShootAnim() && isPlayingAnimation())) { standShootAnim(); } else if(isStandShootAnim() && !isPlayingAnimation() || (isStandPutAwayGunAnim() && isPlayingAnimation())) { standPutAwayGunAnim(); } else if(standAction || isStartStandingAnim()) { startStandingAnim(); } else if(ySpeed < 0 || isJumpAnim()) { jumpAnim(); } else if(ySpeed > 0 || (isHitGroundAnim() && isPlayingAnimation())) { hitGroundAnim(); } else { idleAnim(); } } } else { if(shootAction || ((isStandShootAnim() || isJumpShootAnim()) && isPlayingAnimation())) { jumpShootAnim(); } else if((isJumpShootAnim() && !isPlayingAnimation()) || (isJumpPutAwayGunAnim() && isPlayingAnimation())) { jumpPutAwayGunAnim(); } else if(ySpeed < 0) { jumpAnim(); } else if(ySpeed >= 0) { fallAnim(); } } } //Gravity int d = distToGround(); if(ySpeed > d) ySpeed = d; yPos = yPos + ySpeed; if(ySpeed < 5 && !onGround()) ySpeed = ySpeed + 0.2; if(blink > 0) blink--; if(showHearts) { int lenHearts = 16*heart; for(int i = 0; i < heart; i++) jjDrawSprite(xPos+10-lenHearts/2+i*16,yPos-48,ANIM::PICKUPS,41,0,0,SPRITE::NORMAL,0,1); } resetActions(); rabbitBehavior(); } void onRabbitEnemyHit(jjOBJ@ bullet, jjPLAYER@ player, int force) { if(blink == 0) { if(bullet !is null && player !is null) { hurt(force); bullet.state = STATE::EXPLODE; } else if(player !is null && heart > 0 && noTouchy) { player.hurt(); } } } void hurt(int damage,bool showMessage=true) { heart = heart - damage < 0 ? 0 : heart - damage; justHit=0; blink = 209; setStandFrame(); if(heart>0)hurtAnim(); else { deathAnim(); if(name != "" && showMessage) jjAlert("Devan Shell roasted " + stripPipes(name)); } } int distToGround() { int len = 32; while(onGround(len--)); return len - 17 < 0 ? 0 : len - 17; } bool onGround(int charHeight=21) { return jjMaskedHLine(int(xPos-12),24,int(yPos+charHeight)); } bool isDrawn() { return blink/2 % 4 < 2; } } class IdleRabbitEnemy : NPC, RabbitEnemy, Rabbit { IdleRabbitEnemy(CHAR::Char char,float xPos, float yPos) { super(OBJECT::FISH,xPos,yPos); this.char = char; initRabbitEnemy(); } //Should be called *AFTER* implemented logic void behavior() { rabbitEnemyBehavior(); NPC::behavior(); } void onObjectHit(jjOBJ@ bullet, jjPLAYER@ player, int force) {onRabbitEnemyHit(bullet,player,force);} int draw(bool useCustomSpriteProperties) const { if(isDrawn()) return NPC::draw(useCustomSpriteProperties);return -1;} } class JumpingShootingRabbitEnemy : IdleRabbitEnemy { JumpingShootingRabbitEnemy(CHAR::Char char,float xPos, float yPos) { super(char,xPos,yPos); } void onNotIdle() { shoot(); if(onGround()) jump(); } } class CrouchingShootingRabbitEnemy : IdleRabbitEnemy { CrouchingShootingRabbitEnemy(CHAR::Char char,float xPos, float yPos) { super(char,xPos,yPos); } void onNotIdle() { shoot(); if(onGround()) crouch(); } } class ShootingRabbitEnemy : IdleRabbitEnemy { ShootingRabbitEnemy(CHAR::Char char,float xPos, float yPos) { super(char,xPos,yPos); } void onNotIdle() { shoot(); } } //Gry //Foly //Minmay //MS //Robo4900 //Slaz //King //CJ //Loon //DJazz //PurpleJazz //violet reg: 20 48 18 58 -> 32,72,24,88 -> 88,24,72,32 //ragn0k reg: 58 18 40 40 ("wrong fur") //cooba: 176 88 64 0 //blacky: reg: 01 18 18 01 (or 24 instead of 18) //bob and skull: reg: 18 40 18 18 //fs: reg 48 40 28 28 //fireball: reg: 18 28 18 18 //blur: reg 20 20 20 28 //enigma: reg 10 20 20 10 //boarder/blacky: reg: 40 40 40 40, monolith (jazz) //Sciz jazz reg: 28 20 28 28 //superjazz reg: 40 28 50 50 //lark reg: 18 20 40 40 //nimrod reg: 40 58 40 20 //dalspots reg: 20 20 28 20 (jazz) //derby player1 reg: 10 18 20 28 (jazz) //spotty: reg: 48 48 20 25 ŠpõttÿDM //bn: reg: 01 58 28 10 (jazz) |ßläçk Ñiñjà //Sasik[VS] 20 01 20 20 //birdie: 00 50 50 00 //KJAZZ: 18 20 28 20 //|||Bean 20 18 48 18 //Kirby ??? //Krsplat: 37 23 3 43 0<9/1_\Spalt //||||||||Odin: 48 50 48 48 //CelL FoR: 01 40 01 01 //QuickzCC 10 40 18 28 //Talec LP (blue jazz) //||Evil||Monkey (black body,red chest, grey gun, red shoes) //sÀlÄmÃnDèR DM //standard spaz: spazzyman, pyromanus(sometimes), //spaz inverted: trafton, vegito, velk //|Ä|É|æ|Û|Õ regedit: 20 21 20 21 //Mirai.j2t class Fireball : NPC { Fireball(float xPos, float yPos) { super(NIL, xPos, yPos); playAnimation(ANIM::DEVILDEVAN,4,0,3); } } class Firebreath : CUSTOM::Object { Firebreath(float xPos, float yPos,int angle,int distance=15,int time=140) { super(NIL, xPos, yPos); float angleRadians = (angle/1024.0) * TWO_PI; float xEnd = xPos+distance*32*sin(angleRadians); float yEnd = yPos+distance*32*cos(angleRadians); spriteAngle = angle-128; moveLinear(xEnd,yEnd,time); playAnimation(ANIM::DEVILDEVAN,4,0,3); } void behavior() { CUSTOM::Object::behavior(); if(!isMoving()) delete(); } } class AnimatingTile : CUSTOM::Object { private array tileIds; private int animationRate = 7; AnimatingTile(float xPos, float yPos, array tileIds) { super(NIL, xPos, yPos); this.tileIds = tileIds; } int draw(bool useCustomSpriteProperties=true) const { jjDrawTile(xPos,yPos,tileIds[(jjGameTicks/animationRate)%tileIds.length],TILE::ALLQUADRANTS,spriteLayerZ,spriteLayerXY,spritePlayerID); return -1; } } CHAR::Char getRandomRabbit() { int rand = jjRandom() % 3; if(rand == 0) return CHAR::JAZZ; else if(rand == 1) return CHAR::SPAZ; else if(rand == 2) return CHAR::LORI; return CHAR::JAZZ; }