Downloads containing hgfCow.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Welcome to Chaostopia! happygreenfrog Single player 7.4 Download file

File preview

  1. #include "MLLE-Include-1.4.asc"
  2. const bool MLLESetupSuccessful = MLLE::Setup();
  3. #pragma require "Tube.j2t"
  4. #pragma require "Medivo.j2t"
  5. #pragma require "hgfCow-MLLE-Data-1.j2l"
  6. #pragma require "Carrot1.j2t"
  7. #pragma require "hgfCow.j2l"
  8.  
  9. //a special thanks to Sir Ementaler and Violet CLM for their assistance with writing the script!
  10.  
  11. void onLevelLoad() {
  12.  jjObjectPresets[OBJECT::DEVILDEVAN].behavior = cowBoss;
  13.  jjObjectPresets[OBJECT::DEVILDEVAN].isFreezable = false;
  14.  jjObjectPresets[OBJECT::DEVILDEVAN].playerHandling = HANDLING::ENEMY;
  15.  jjObjectPresets[OBJECT::DEVILDEVAN].scriptedCollisions = true;
  16.  jjObjectPresets[OBJECT::DEVILDEVAN].energy = 30;
  17.  //jjObjectPresets[OBJECT::DEVILDEVAN].energy = 50;
  18.  //jjObjectPresets[OBJECT::DEVILDEVAN].bulletHandling = HANDLING::DESTROYBULLET;
  19.  
  20.  jjObjectPresets[OBJECT::BILSY].bulletHandling = HANDLING::HURTBYBULLET;
  21.  jjObjectPresets[OBJECT::BILSY].playerHandling = HANDLING::ENEMY;
  22.  jjObjectPresets[OBJECT::BILSY].energy = 14;
  23.  jjObjectPresets[OBJECT::BUBBA].bulletHandling = HANDLING::HURTBYBULLET;
  24.  jjObjectPresets[OBJECT::BUBBA].playerHandling = HANDLING::ENEMY;
  25.  jjObjectPresets[OBJECT::BUBBA].energy = 5+(jjDifficulty*4);
  26.  jjObjectPresets[OBJECT::TUFBOSS].bulletHandling = HANDLING::HURTBYBULLET;
  27.  jjObjectPresets[OBJECT::TUFBOSS].playerHandling = HANDLING::ENEMY;
  28.  jjObjectPresets[OBJECT::TUFBOSS].energy = 7+(jjDifficulty*4);
  29.  jjObjectPresets[OBJECT::BOLLY].bulletHandling = HANDLING::HURTBYBULLET;
  30.  jjObjectPresets[OBJECT::BOLLY].playerHandling = HANDLING::SPECIAL;
  31.  jjObjectPresets[OBJECT::BOLLY].energy = 10;
  32.  jjObjectPresets[OBJECT::UTERUS].bulletHandling = HANDLING::HURTBYBULLET;
  33.  jjObjectPresets[OBJECT::UTERUS].playerHandling = HANDLING::ENEMY;
  34.  jjObjectPresets[OBJECT::UTERUS].energy = 10;
  35.  jjObjectPresets[OBJECT::ROBOT].bulletHandling = HANDLING::HURTBYBULLET;
  36.  jjObjectPresets[OBJECT::ROBOT].playerHandling = HANDLING::ENEMY;
  37.  jjObjectPresets[OBJECT::ROBOT].energy = 30;
  38.  //jjSampleLoad(SOUND::DEVILDEVAN_DRAGONFIRE, 'moo-ortal.wav');
  39.  
  40.  //just a thing I borrowed from plusPixelMapEx
  41.  jjANIMATION@ anim = jjAnimations[jjObjectPresets[OBJECT::DEVILDEVAN].curAnim];
  42.  anim.frameCount = 1;
  43.  jjANIMFRAME@ frame = jjAnimFrames[anim.firstFrame];
  44.  jjPIXELMAP kingCow(459*32, 3*32, 6*32, 7*32, 4);
  45.  kingCow.save(frame);
  46.  frame.hotSpotX = -frame.width / 2;
  47.  frame.hotSpotY = -frame.height / 2;
  48.  //make frog able to hurt stuff
  49.  jjCharacters[CHAR::FROG].canHurt = true;
  50. }
  51.  
  52. void onLevelBegin(){
  53. //make sure the main song reloads after encountering the boss
  54. jjMusicLoad("Meatball Parade.ogg");
  55. //fix the parallax background
  56. jjUseLayer8Speeds = true;
  57. }
  58.  
  59. void cowBoss(jjOBJ@ obj) {
  60.  switch (obj.state) {
  61.   case STATE::START:
  62.    //don't start boss until player has reached boss activation point
  63.    obj.state = STATE::DELAYEDSTART;
  64.    case STATE::DELAYEDSTART:
  65.     //loop players
  66.     for (int i = 0; i < jjLocalPlayerCount; ++i) {
  67.      jjPLAYER@ localPlayer = jjLocalPlayers[i];
  68.      if (localPlayer.bossActivated) {
  69.       localPlayer.boss = obj.objectID;
  70.           //kinda borrowed from plusPixelMapEx as well in a way
  71.           //localPlayer.showText("MOO-ORTAL, YOUR SPECIAL MOO-OVES ARE VOID!@AND IF THOU STOMPETH WITH THINE REAR END,@THY LIFE IS FORFEIT.");
  72.           localPlayer.showText("MOO-ORTAL, YOUR SPECIAL MOO-OVES ARE VOID!");
  73.       obj.state = STATE::START;
  74.      }
  75.     }
  76.     if (obj.state == STATE::START) {
  77.          //set object to be handled in a more normal way, since we're using Devil Devan as the "base"
  78.      obj.playerHandling = HANDLING::SPECIAL;
  79.          //load song
  80.          jjMusicLoad("dang.j2b");
  81.          //jjSample(obj.xPos, obj.yPos, SOUND::DEVILDEVAN_DRAGONFIRE);
  82.          //start boss
  83.          obj.state = STATE::ATTACK;
  84.          //initialize some important variables
  85.          obj.age = 60; //boss attack cooldown
  86.          obj.special = 0; //next attack the boss is going to use
  87.          obj.var[0] = 0; //move direction
  88.          obj.var[1] = 0; //reticle height
  89.          obj.var[2] = 10; //carrot delay
  90.          obj.var[3] = 120; //projectile cooldown
  91.      break;
  92.     }
  93.     return;
  94.   case STATE::KILL:
  95.    //start next stage
  96.    jjNxt(true, false);
  97.   case STATE::DEACTIVATE:
  98.    //reset boss
  99.    jjMusicLoad("Meatball Parade.ogg");
  100.    obj.deactivate();
  101.    break;
  102.   case STATE::ATTACK:
  103.    //draw boss
  104.    jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::NORMAL, 24);
  105.    //set cow as boss
  106.    for (int i = 0; i < jjLocalPlayerCount; ++i) {
  107.      jjPLAYER@ localPlayer = jjLocalPlayers[i];
  108.      if (localPlayer.bossActivated) {
  109.       localPlayer.boss = obj.objectID;
  110.      }
  111.         }
  112.        
  113.         //just some old code I didn't completely remove
  114.         //for (int i = 1; i < jjObjectCount; i++){
  115.         // jjOBJ@ o = jjObjects[i];
  116.         // if (o.eventID == OBJECT::BOLLY){obj.var[0] == 1;}
  117.         // if (o.eventID == OBJECT::BUBBA){obj.var[0] == 1;}
  118.         // if (o.eventID == OBJECT::BILSY){obj.var[0] == 1;}
  119.         // if (o.eventID == OBJECT::TUFBOSS){obj.var[0] == 1;}
  120.         //}
  121.         //if (obj.var[0] == 0){}
  122.        
  123.         //constantly cool down attack
  124.         obj.age -= 1;
  125.         //prepare summon
  126.         if (obj.age <= 0) {
  127.          //just some more old code I didn't completely remove
  128.          //if (obj.special == 1){jjAddObject(OBJECT::TUFBOSS, obj.xPos, obj.yPos+96);}
  129.          //if (obj.special == 2){jjAddObject(OBJECT::BUBBA, obj.xPos, obj.yPos);}
  130.          //if (obj.special == 2){jjAddObject(OBJECT::BOLLY, obj.xPos, obj.yPos);}
  131.          //if (obj.special == 2){jjAddObject(OBJECT::UTERUS, obj.xPos, obj.yPos);}
  132.          //if (obj.special == 3){jjAddObject(OBJECT::BILSY, obj.xPos, obj.yPos);}
  133.          
  134.          //summon an enemy based on next attack chosen
  135.          if (obj.special == 0){jjObjects[jjAddObject(OBJECT::LIZARD, obj.xPos, obj.yPos)].playerHandling = HANDLING::ENEMY;}
  136.          if (obj.special == 1){jjObjects[jjAddObject(OBJECT::BAT, obj.xPos, obj.yPos+120)].playerHandling = HANDLING::ENEMY;}
  137.          if (obj.special == 2){jjObjects[jjAddObject(OBJECT::RAVEN, obj.xPos, obj.yPos+120)].playerHandling = HANDLING::ENEMY;}
  138.          if (obj.special == 3){jjObjects[jjAddObject(OBJECT::FENCER, obj.xPos, obj.yPos)].playerHandling = HANDLING::ENEMY;}
  139.          if (obj.special == 4){jjObjects[jjAddObject(OBJECT::BEE, obj.xPos, obj.yPos+120)].playerHandling = HANDLING::ENEMY;}
  140.          if (obj.special == 5){jjObjects[jjAddObject(OBJECT::TUFBOSS, obj.xPos, obj.yPos+120)].playerHandling = HANDLING::ENEMY;}
  141.          //if (obj.special == 6){jjObjects[jjAddObject(OBJECT::BEE, obj.xPos, obj.yPos+120)].playerHandling = HANDLING::SPECIAL;
  142.          // if(jjDifficulty >= 2){jjObjects[jjAddObject(OBJECT::BEE, obj.xPos+10, obj.yPos+120)].playerHandling = HANDLING::SPECIAL;
  143.          // jjObjects[jjAddObject(OBJECT::BEE, obj.xPos-10, obj.yPos+120)].playerHandling = HANDLING::SPECIAL;}}
  144.          if (obj.special == 6){jjObjects[jjAddObject(OBJECT::BEE, obj.xPos, obj.yPos+120)].playerHandling = HANDLING::ENEMY;
  145.           if(jjDifficulty >= 2){jjObjects[jjAddObject(OBJECT::BEE, obj.xPos+10, obj.yPos+120)].playerHandling = HANDLING::ENEMY;}}
  146.          if (obj.special == 7){jjObjects[jjAddObject(OBJECT::BUBBA, obj.xPos, obj.yPos)].playerHandling = HANDLING::ENEMY;}
  147.          if (obj.special == 8){jjObjects[jjAddObject(OBJECT::LIZARD, obj.xPos, obj.yPos)].playerHandling = HANDLING::ENEMY;
  148.           if(jjDifficulty >= 2){jjObjects[jjAddObject(OBJECT::LIZARD, obj.xPos+10, obj.yPos)].playerHandling = HANDLING::ENEMY;
  149.           jjObjects[jjAddObject(OBJECT::LIZARD, obj.xPos-10, obj.yPos)].playerHandling = HANDLING::SPECIAL;}}
  150.          if (obj.special == 9 && jjDifficulty >= 2){jjObjects[jjAddObject(OBJECT::BILSY, obj.xPos, obj.yPos)].playerHandling = HANDLING::ENEMY;}
  151.          if (obj.special == 9 && jjDifficulty == 1){jjObjects[jjAddObject(OBJECT::BAT, obj.xPos, obj.yPos+120)].playerHandling = HANDLING::ENEMY;}
  152.          if (obj.special == 9 && jjDifficulty == 0){jjAddObject(OBJECT::CARROT, obj.xPos, obj.yPos+140);}
  153.          //if (obj.special == 10){jjObjects[jjAddObject(OBJECT::FENCER, obj.xPos, obj.yPos)]; if(jjDifficulty >= 2){jjObjects[jjAddObject(OBJECT::FENCER, obj.xPos+10, obj.yPos)]; jjObjects[jjAddObject(OBJECT::FENCER, obj.xPos-10, obj.yPos)];}}
  154.          if (obj.special == 10){jjObjects[jjAddObject(OBJECT::FENCER, obj.xPos, obj.yPos)].playerHandling = HANDLING::ENEMY;
  155.           if(jjDifficulty >= 2){jjObjects[jjAddObject(OBJECT::FENCER, obj.xPos+10, obj.yPos)].playerHandling = HANDLING::ENEMY;}}
  156.          //reset cooldown
  157.          obj.age = 180;
  158.          if (jjDifficulty == 2){obj.age = 150;}
  159.          if (jjDifficulty >= 3){obj.age = 120;}
  160.          //select next move
  161.          obj.special += 1;
  162.          //progress towards next carrot
  163.          obj.var[2] = obj.var[2]-1;
  164.          //hurt boss
  165.          obj.energy -= 1;
  166.         }
  167.         //loop attack pattern
  168.         if (obj.special >= 11){
  169.          obj.special = 5;
  170.         }
  171.         if (obj.var[2] <= 0){
  172.          if (jjDifficulty <= 2){jjAddObject(OBJECT::CARROT, obj.xPos, obj.yPos+140);}
  173.          if (jjDifficulty >= 3){jjAddObject(OBJECT::SEEKERAMMO3, obj.xPos, obj.yPos+140);}
  174.          obj.var[2] = 10;
  175.         }
  176.         //end boss
  177.         if (obj.energy <= 0){obj.bulletHandling = HANDLING::DESTROYBULLET; obj.state = STATE::KILL;}
  178.         //turn around
  179.     if (obj.xPos <= 495*32){obj.var[0]=1;}
  180.         if (obj.xPos >= 506*32){obj.var[0]=0;}
  181.         //move
  182.         if (obj.var[0] == 0){obj.xPos -=1;}
  183.         if (obj.var[0] == 1){obj.xPos +=1;}
  184.        
  185.         //set reticle height
  186.         if (obj.special == 0 || obj.special == 3 || obj.special == 5 || obj.special == 7 || obj.special == 8 || obj.special == 10 && obj.special != 9){obj.var[1]=230;}
  187.         if (obj.special == 1 || obj.special == 2 || obj.special == 4 || obj.special == 6){obj.var[1]=120;}
  188.         if (obj.special == 9 && jjDifficulty >= 2){obj.var[1]=230;}
  189.         if (obj.special == 9 && jjDifficulty == 1){obj.var[1]=120;}
  190.         if (obj.special == 9 && jjDifficulty == 0){obj.var[1]=9001;}
  191.         //display reticle
  192.         if (obj.age < 45 && obj.age % 6 <= 2){jjDrawSprite(obj.xPos, obj.yPos+obj.var[1], ANIM::PLUS_RETICLES, 2, 0, 0);}
  193.         //attempted work-around for killing bosses, this works about half the time
  194.         //for (int i = 1; i < jjObjectCount; i++){
  195.         // jjOBJ@ o = jjObjects[i];
  196.         // if (o.state == STATE::DONE){jjDeleteObject(o.objectID);}
  197.         //}
  198.        
  199.         //make player's specials not work during the boss
  200.     jjCharacters[CHAR::JAZZ].canHurt = false;
  201.         jjCharacters[CHAR::SPAZ].canHurt = false;
  202.         jjCharacters[CHAR::LORI].canHurt = false;
  203.        
  204.         //disable stomp
  205.         for (int i = 0; i < jjLocalPlayerCount; ++i) {
  206.      jjPLAYER@ localPlayer = jjLocalPlayers[i];
  207.          //if (localPlayer.buttstomp < 41 && localPlayer.health > 0 && localPlayer.specialMove == 0){localPlayer.buttstomp = 121;localPlayer.hurt(5, true);}
  208.          localPlayer.buttstomp = 100;
  209.         }
  210.         obj.var[3] = obj.var[3]-1;
  211.         if(obj.var[3] <= 0)
  212.         {
  213.         obj.var[3] = 180;
  214.         //jjObjects[jjAddObject(OBJECT::BULLET, obj.xPos, obj.yPos+140)].ySpeed = 10;
  215.         }
  216.   default:
  217.    //empty
  218.  }
  219. }
  220.  
  221. void onPlayer(jjPLAYER@ play)
  222. {if(play.bossActivated == false)
  223.  {
  224.  jjCharacters[CHAR::JAZZ].canHurt = true;
  225.  jjCharacters[CHAR::SPAZ].canHurt = true;
  226.  jjCharacters[CHAR::LORI].canHurt = true;
  227.  }
  228. }