Downloads containing StoneAbyss7.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Stone AbyssFeatured Download Bloody_Body Single player 9.6 Download file

File preview

//неплохо бы реализовать механику, позволяющую Ведьме превращать ракеты в еду. А то они её за несколько секунд разъёбывают.
//самозалечивание куда больше идёт Ведьме, чем Твидлу. Для твидла можно реализовать большую выносливость.
int i,b=0;
int u=1;
bool final=false;
jjPAL Boss;
const string MUSICFILENAME = "Diamond.j2b";
			void onLevelLoad()  {
			jjTexturedBGTexture = TEXTURE::DIAMONDUSBETA;	
				for (int weaponID = WEAPON::BLASTER; weaponID <= WEAPON::GUN9; ++weaponID) {
		jjWEAPON@ weaponProfile = jjWeapons[weaponID];
		weaponProfile.comesFromBirds = weaponProfile.comesFromBirdsPowerup = true; 
	}
		
	
	Boss.gradient(0, 0,0,             0, 0,0,         0, 10, 1.0);
	Boss.gradient(255, 255,255,             255, 255,255,         10, 6, 1.0);
	Boss.gradient(199, 255,0,             199, 255,0,         16, 1, 1.0);
	Boss.gradient(143, 219,0,             0, 11,0,         17, 7, 1.0);
	Boss.gradient(255, 0,0,             163, 0,0,         24, 4, 1.0);
	Boss.gradient(135, 0,0,             11, 0,0,         28, 4, 1.0);
	Boss.gradient(187, 227,255,             0, 139,255,         32, 4, 1.0);
	Boss.gradient(0, 107,203,             0, 7,11,         36, 4, 1.0);
	Boss.gradient(255, 255,0,             255, 199,0,         40, 2, 1.0);
	Boss.gradient(255, 147,0,             255, 95,0,         42, 2, 1.0);
	Boss.gradient(203, 55,0,             11, 0,0,         44, 4, 1.0);
	Boss.gradient(251, 139,183,       239, 0,99,         48, 4, 1.0);            
	Boss.gradient(191, 0,71,      55, 0,19,         52, 3, 1.0);
	Boss.gradient(0, 3,0,      0, 3,0,         55, 1, 1.0);
	Boss.gradient(220, 165,113,             154, 129,100,         56, 3, 1.0);
	Boss.gradient(219, 195,0,             11, 7,0,         59, 5, 1.0);
	Boss.gradient(255, 243,211,             255, 243,211,         64, 1, 1.0);
	Boss.gradient(219, 207,175,             11, 7,7,         65, 7, 1.0);
	Boss.gradient(211, 231,255,             211, 231,255,         72, 1, 1.0);
	Boss.gradient(171, 195,219,             107, 127,155,         73, 3, 1.0);
	Boss.gradient(75, 95,119,             7, 7,11,         76, 4, 1.0);
	Boss.gradient(0, 255,195,             0, 11,7,         80, 8, 1.0);
	Boss.gradient(231, 119,255,             11, 0,7,         88, 8, 1.0);
	
	Boss.gradient(85, 105, 70,		     0, 0, 0, 			     96, 16, 1.0);		
	Boss.gradient(24, 100, 66,		     0, 0, 0, 			     112, 16, 1.0);
	Boss.gradient(235, 255, 0,		     0, 0, 0, 			     128, 16, 1.0);
	Boss.gradient(65, 95, 20,		     0, 0, 0, 			     144, 16, 1.0);
	Boss.gradient(152, 166, 0, 		   	 0, 0, 0, 				 160, 16, 1.0);
	Boss.gradient(10,140,  140,	 		 0, 0, 0, 				 176, 32, 1.0);
	//Boss.apply(); 	
	jjLocalPlayers[i].lighting = 80;
	
	jjObjectPresets[OBJECT::FASTFEET].points = 100;
	jjObjectPresets[OBJECT::FASTFEET].scriptedCollisions = true;
	
	jjObjectPresets[OBJECT::GRAPES].points = 0;
	jjObjectPresets[OBJECT::GRAPES].scriptedCollisions = true;		
	jjObjectPresets[OBJECT::GRAPES].behavior = WITCHSPELL;	
	jjObjectPresets[OBJECT::GRAPES].state = STATE::ACTION;
			
	jjObjectPresets[OBJECT::WITCH].behavior = WITCHBOSS;
	jjObjectPresets[OBJECT::WITCH].points = 5000;
	jjObjectPresets[OBJECT::WITCH].energy = 100;
	jjObjectPresets[OBJECT::WITCH].bulletHandling = HANDLING::HURTBYBULLET;
	jjObjectPresets[OBJECT::WITCH].state = STATE::ACTION;
	}
	
	void onMain(){
	
	updateGems();
	
if (b<=99 && final && (jjGameTicks & 20) == 0) { 
b++;
		jjPalette.reset();
		jjPalette.copyFrom(
			1,		
			254,		
			1,		
			Boss,	
			b/100.0	
		);
		jjPalette.apply();
		}
		else if (b==99) {
		Boss.apply();
		}
		}
	
		void onLevelReload()  {
		jjTexturedBGTexture = TEXTURE::DIAMONDUSBETA;	
		jjPLAYER@ play = jjLocalPlayers[0];
		play.jumpStrength = -10;
		b=0;
	final=false;
	jjPalette.reset();
	jjLocalPlayers[i].lighting = 80;
	jjMusicLoad(MUSICFILENAME);
	}

	
		void WITCHBOSS(jjOBJ@ boss) {
		//jjOBJ@ obj = OBJECT::GRAPES;
		jjPLAYER@ play = jjLocalPlayers[0];
		int a;
		if (play.charCurr != CHAR::FROG)
		{a=0;}
		else 
		{a=0.5;}	
	if ( boss.energy==0) 
	{	
		boss.counter==0;
		boss.counter += 1; 
		boss.determineCurAnim(ANIM::WITCH, 1);
		boss.determineCurFrame();
		boss.frameID = boss.counter/56;
		jjDrawSpriteFromCurFrame(boss.xPos, boss.yPos, boss.curFrame, boss.direction, SPRITE::NORMAL);
		++boss.counter;
	
	if ( boss.energy==0&&++boss.counter>2300)  
			jjEventSet(play.xPos / 32, play.yPos / 32, AREA::EOL);
	}
	
	if ((boss.xPos > play.xPos+3 || boss.xPos < play.xPos-3)&& boss.state != STATE::KILL)
	{boss.direction = (play.xPos < boss.xPos) ? -1 : 1;}
	else 
				{
				boss.direction==1;}
	if (boss.yPos < 105*32)
	{boss.yPos = boss.yPos + 1;}
	if (boss.xPos > 278*32)
	{boss.xPos = boss.xPos - 1;}
		switch (boss.state) {
		case STATE::ACTION:
		//boss.xPos - play.xPos+32 = boss.direction;
		if (boss.xPos > play.xPos)
				{
				boss.xPos = boss.xPos - (1+a*jjDifficulty); }
		else if (boss.xPos < play.xPos) 
				{
				boss.xPos = boss.xPos + (1+a*jjDifficulty);}
		if (boss.yPos > play.yPos)
				{boss.yPos = boss.yPos - (1+a*jjDifficulty); }
		else if (boss.yPos < play.yPos) 
				{boss.yPos = boss.yPos + (1+a*jjDifficulty);}
				
		++boss.counter;
		//boss.xPos = (jjCos(boss.counter*12)*jjRandom()&6) + play.xPos;
		if (boss.findNearestPlayer(100*100) > -1) 
		{
		//int u=((jjRandom() & 7) - 3.5);
		boss.yPos = jjCos(boss.counter/2)*2 + boss.yPos;
		boss.xPos = jjSin(boss.counter)*2 + boss.xPos;}
	
		boss.determineCurAnim(ANIM::WITCH, 2);	
		boss.determineCurFrame();
		boss.frameID = boss.counter/30;
		boss.counter += 1; 
		boss.draw();
			if (++boss.counter > 600&&boss.findNearestPlayer(300*300) > -1 && play.charCurr != CHAR::FROG) 
			switch (jjRandom() & 2) 
			{
			case 0:
			boss.state = STATE::ATTACK;
			break;
			case 1:
			boss.state = STATE::ACTION;
			break;
			}
			break;
	 case STATE::ATTACK:	
	// boss.counter==0;
		//boss.behave(BEHAVIOR::BEE);
		//boss.yPos = jjCos(boss.counter)*2 + boss.yPos;
	 boss.direction = (jjLocalPlayers[0].xPos < boss.xPos) ? -1 : 1;
	 	if (boss.counter >= 1200) {
			jjSample(boss.xPos, boss.yPos, SOUND::WITCH_MAGIC);
			int spell = OBJECT::GRAPES;
			jjOBJ@ obj = jjObjects[boss.fireBullet(OBJECT::GRAPES)];
			obj.killAnim = obj.determineCurAnim(ANIM::AMMO, 4, false);
			obj.determineCurAnim(ANIM::WITCH,3);
			obj.determineCurFrame();	
			obj.yPos = boss.yPos+32;
			obj.xPos = boss.xPos+32*(boss.direction);
		}
		// if ((obj.yPos == play.yPos) && (obj.xPos == play.xPos)){
		//jjSample(boss.xPos, boss.yPos, SOUND::WITCH_LAUGH);}
		boss.determineCurAnim(ANIM::WITCH,0);
		boss.determineCurFrame();
		boss.frameID = boss.counter/55;
		boss.counter += 5; 
		//boss.draw();
		if (boss.justHit == 0)
		jjDrawSpriteFromCurFrame(boss.xPos, boss.yPos, boss.curFrame, boss.direction, SPRITE::NORMAL);
		else jjDrawSpriteFromCurFrame(boss.xPos, boss.yPos, boss.curFrame, boss.direction, SPRITE::SINGLECOLOR,15);

	if (++boss.counter > 1205) 
	{
	boss.xAcc= boss.yAcc =0;
	boss.state = STATE::ACTION;
	boss.counter =0;
	}
	break;
						case STATE::FREEZE:
			if (boss.freeze > 0) {
				boss.draw();
				boss.freeze -= 4;
			}
			if (boss.freeze < 4) {
				boss.unfreeze(0);
				boss.state = boss.oldState;
			}
			break;
	case STATE::KILL:
	
	break;	
		
										
						}
					//if (boss.justHit == 0)
		//jjDrawSpriteFromCurFrame(boss.xPos, boss.yPos, boss.curFrame, boss.direction, SPRITE::NORMAL);
		//else jjDrawSpriteFromCurFrame(boss.xPos, boss.yPos, boss.curFrame, boss.direction, SPRITE::SINGLECOLOR,15);			
						}
						
							void WITCHSPELL(jjOBJ@ enemy) {
		jjPLAYER@ play = jjLocalPlayers[0];
		
		if (enemy.xPos > play.xPos)
				enemy.xPos = enemy.xPos - (2+jjDifficulty/4); 
		else if (enemy.xPos < play.xPos) 
				enemy.xPos = enemy.xPos + (2+jjDifficulty/4);
		if (enemy.yPos > play.yPos)
				enemy.yPos = enemy.yPos - (2+jjDifficulty/4); 
		else if (enemy.yPos < play.yPos) 
				enemy.yPos = enemy.yPos + (2+jjDifficulty/4);
		enemy.determineCurAnim(ANIM::WITCH,3);
		enemy.determineCurFrame();
		enemy.frameID = enemy.counter/8;
		//enemy.draw();
		++enemy.counter;
		enemy.counter += 1; 
		 if (enemy.counter >200*jjDifficulty/2+400)
		{enemy.delete();
		  int explosionID = jjAddObject(OBJECT::BLASTERBULLET, enemy.xPos, enemy.yPos, enemy.creator, CREATOR::OBJECT);
		jjObjects[explosionID].determineCurAnim(ANIM::AMMO, 4, true);
		jjObjects[explosionID].state = STATE::EXPLODE;
		}
	enemy.draw();}
	
		void onPlayerTimerEnd(jjPLAYER@ play) {
	play.jumpStrength = play.jumpStrength + 8; 
}
void updateGems()
{
  for(int i=1;i<jjObjectCount;i++)
  {
    if(jjObjects[i].isActive)
    {
      if(jjObjects[i].eventID==OBJECT::SUPERGEM)
      {
        jjObjects[i].var[0]=jjParameterGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32,0,2)+1;
      }
      if(jjObjects[i].eventID==OBJECT::FLICKERGEM)
      {
        if(jjEventGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32)==OBJECT::SUPERGEM)
        {
          jjObjects[i].var[0]=jjParameterGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32,0,2)+1;
        }
        else if(jjEventGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32+1)==OBJECT::GEMSTOMP)
        {
          jjObjects[i].var[0]=jjParameterGet(jjObjects[i].xOrg/32,jjObjects[i].yOrg/32+1,0,2)+1;
        }
        if(jjObjects[i].var[0]==2||jjObjects[i].var[0]==3)
        {
          jjObjects[i].points=500*(jjObjects[i].var[0]-1);
        }
      }
    }
  }
}


	void onFunction1(jjPLAYER@ play) {
	play.showText("@If you are turned into a frog@pick up fastfeet and @rise upward to Eva Longear", STRING::SMALL);
	play.activateBoss();
	final=true;
	{play.boss=jjAddObject(OBJECT::WITCH, 270*32, 120*32);}
	jjMusicLoad("boss1.j2b");
	jjOBJ@ boss = jjObjects[play.boss];
	}
	
		void onFunction2(jjPLAYER@ play) {
		if(play.charCurr == CHAR::FROG && play.charOrig == CHAR::LORI)
	{play.showText("@Oh, that glitchy lesbian kiss!", STRING::SMALL);}
	}
	
	void onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ play, int force) {
	if (obj.eventID == OBJECT::GRAPES)
	{  //boss.eventID == OBJECT::WITCH;
	obj.state = STATE::EXPLODE;
		obj.scriptedCollisions = false;
	jjSample(obj.xPos, obj.yPos, SOUND::WITCH_LAUGH);	
	play.morphTo(CHAR::FROG, false);}
		else if (obj.eventID == OBJECT::FASTFEET) { 
	play.timerStart(2000/(jjDifficulty+1));
		play.jumpStrength = play.jumpStrength - 8;
		play.showText("@Heigth of jumps @ temporarily increased!", STRING::SMALL);
		obj.behavior = BEHAVIOR::EXPLOSION2; //this is ESSENTIAL. just like enemies die by getting their states set to STATE::KILL, and bullets die by getting their states set to STATE::EXPLODE, pickups die by getting their behavior set to BEHAVIOR::EXPLOSION2. yes, sometimes a little consistency is in fact too much to ask for.
		obj.scriptedCollisions = false; //or obj.playerHandling = HANDLING::EXPLOSION; or something like that
		obj.frameID = 0;
		jjSample(obj.xPos, obj.yPos, SOUND::BUBBA_BUBBABOUNCE2);
	}
}