Downloads containing StoneAbyss12.j2as

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

File preview

jjOBJ@ spawnedObject;
int i,b=0;
jjPAL Boss;
bool final=false;
void onLevelLoad() {
		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, 4, 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(165,140,100,		     0, 0, 0, 			       96, 7, 1.0);
	Boss.gradient(0,0,0,		         0, 0, 0, 			      103, 1, 1.0);
	Boss.gradient(200,170,90, 		     0, 0, 0, 			      104, 8, 1.0);
	Boss.gradient(255,210,0,		     0, 0, 0, 			  	  112, 8, 1.0);
	Boss.gradient(250,250,170,		     0, 0, 0, 			     160, 16, 1.0);
	Boss.gradient(230,180,60,			     150, 60, 30, 			     176, 8, 1.0);
	Boss.gradient(140,50,25,			     0, 0, 0, 			     184, 8, 1.0);
	Boss.gradient(255,180,80, 		 0, 0, 0, 				 192, 16, 1.0);
		
	jjLocalPlayers[i].lighting = 80;

	
	jjObjectPresets[OBJECT::MILK].energy = 6;
	jjObjectPresets[OBJECT::MILK].behavior = SpittingBubba;
	jjObjectPresets[OBJECT::MILK].points = 1000;
	jjObjectPresets[OBJECT::MILK].xSpeed = 1;
	jjObjectPresets[OBJECT::MILK].state = STATE::WALK;
	jjObjectPresets[OBJECT::MILK].deactivates = false;
	jjObjectPresets[OBJECT::MILK].scriptedCollisions = true;
	jjObjectPresets[OBJECT::MILK].isTarget = true;
	jjObjectPresets[OBJECT::MILK].playerHandling = HANDLING::ENEMY;
	
	jjObjectPresets[OBJECT::LEMON].energy = 12;
	jjObjectPresets[OBJECT::LEMON].behavior = BubbaSpirit;
	jjObjectPresets[OBJECT::LEMON].points = 700;
	jjObjectPresets[OBJECT::LEMON].light = 15;
	jjObjectPresets[OBJECT::LEMON].lightType = LIGHT::RING2;
    jjObjectPresets[OBJECT::LEMON].playerHandling = HANDLING::ENEMY;
	jjObjectPresets[OBJECT::LEMON].bulletHandling = HANDLING::IGNOREBULLET;
	jjObjectPresets[OBJECT::LEMON].isTarget = true;
	jjObjectPresets[OBJECT::LEMON].isBlastable = true;
	
	jjObjectPresets[OBJECT::APPLE].energy = 8;
	jjObjectPresets[OBJECT::APPLE].points = 1200;
	jjObjectPresets[OBJECT::APPLE].playerHandling = HANDLING::ENEMY;
	jjObjectPresets[OBJECT::APPLE].bulletHandling = HANDLING::HURTBYBULLET;
	jjObjectPresets[OBJECT::APPLE].behavior = Small;
	//jjObjectPresets[OBJECT::APPLE].direction = -1;
}

void Small(jjOBJ@ enemy) {
	enemy.putOnGround(true);
	switch (enemy.state) {
	case STATE::START:
		enemy.state = STATE::IDLE;
		
		enemy.determineCurAnim(ANIM::BILSBOSS, 4); //idle
		break;
	case STATE::KILL:
	case STATE::DEACTIVATE:
		enemy.deactivate();
		break;
	case STATE::IDLE:
		enemy.frameID = (jjGameTicks >> 2) & 7;
		enemy.determineCurFrame();
		if (enemy.findNearestPlayer(120*900) > -1) { 
			if (enemy.var[0] == 0) { jjSample(enemy.xPos, enemy.yPos, SOUND::BILSBOSS_THUNDER); enemy.var[0] = 1; }
					enemy.state = STATE::FADEOUT;
					enemy.determineCurAnim(ANIM::BILSBOSS, 2);
					enemy.counter = 0;
					if (jjDifficulty > 1) { 
						//enemy.playerHandling = HANDLING::PARTICLE;
						enemy.bulletHandling = HANDLING::IGNOREBULLET;
					} {
						jjPLAYER@ play = jjLocalPlayers[0];
						enemy.xAcc = play.xPos;
						enemy.yAcc = play.yPos;
					}}
					break;
			
		
					case STATE::FREEZE:
			{if (enemy.freeze > 0) {
				enemy.draw();
				enemy.freeze -= 4;
			}
			if (enemy.freeze < 4) {
				enemy.unfreeze(0);
				enemy.state = enemy.oldState;
			}
			break;}
		
	case STATE::FADEOUT:
		if (++enemy.counter < 68) {
			enemy.frameID = enemy.counter >> 2;
			enemy.determineCurFrame();
		} else {
			enemy.frameID = enemy.counter = 0;
			enemy.state = STATE::FADEIN;
			jjSample(enemy.xPos, enemy.yPos, SOUND::BILSBOSS_BILLAPPEAR);
			enemy.determineCurAnim(ANIM::BILSBOSS, 1);
			enemy.xPos = enemy.xAcc;
			enemy.yPos = enemy.yAcc - 32;
			enemy.direction = (jjLocalPlayers[0].xPos < enemy.xPos) ? -1 : 1;
			enemy.determineCurFrame();
			enemy.putOnGround(true);
			return;
		}
		break;
	case STATE::FADEIN:
		if (++enemy.counter < 40) {
			enemy.frameID = enemy.counter >> 1;
			enemy.determineCurFrame();
		} else {
			enemy.frameID = enemy.counter = 0;
			enemy.determineCurAnim(ANIM::BILSBOSS, 4);
			enemy.state = STATE::IDLE;
			enemy.playerHandling = HANDLING::ENEMY;
			enemy.bulletHandling = HANDLING::HURTBYBULLET;
		}
		break;
	case STATE::ATTACK:
		if (++enemy.counter < 36) {
			enemy.frameID = enemy.counter >> 1;
			enemy.determineCurFrame();
			if (enemy.counter == 32) {
				jjObjects[enemy.fireBullet(OBJECT::TOASTERBULLET)].playerHandling = HANDLING::ENEMYBULLET;
			}
		} else {
			enemy.frameID = enemy.counter = 0;
			enemy.determineCurAnim(ANIM::BILSBOSS, 4);
			enemy.state = STATE::IDLE;
		}
		break;
	}
	enemy.draw();
}

void SpittingBubba(jjOBJ@ enemy) {
					if ( enemy.energy == 0)
					enemy.state = STATE::KILL;
	switch (enemy.state) {
		case STATE::WALK:
		enemy.behave(BEHAVIOR::WALKINGENEMY);
		enemy.determineCurAnim(ANIM::BUBBA, 5);	
										
			 if (enemy.findNearestPlayer(64*800) > -1 && ++enemy.counter > 36) enemy.state = STATE::IDLE;
				if (enemy.energy == 0)
					enemy.state = STATE::KILL;
			break;
			case STATE::IDLE:
			enemy.frameID = enemy.counter/5;
			enemy.determineCurFrame();
			
			switch (jjRandom() & 3) {
				
				case 0:  
				case 1:
				
					enemy.state = STATE::ACTION;
					enemy.determineCurAnim(ANIM::BUBBA, 0);
					enemy.counter = 0;
					break;
					
				case 2:
				
					enemy.state = STATE::WALK;
					enemy.determineCurAnim(ANIM::BUBBA, 5);
					enemy.counter = 0;
					
					break;
					
					}
			break;
			
			
		case STATE::ACTION:
		if (++enemy.counter < 36) {
			enemy.frameID = enemy.counter/5;
			enemy.determineCurFrame();
			enemy.direction = (jjLocalPlayers[0].xPos < enemy.xPos) ? -1 : 1;
				   if (enemy.justHit == 0)
			if (enemy.counter == 25 ) {
			//if difficulty is easy Bubba spits once per every "state::action", if normal- twice, it hard or turbo- three times.
		jjOBJ@ bullet = jjObjects[enemy.fireBullet(OBJECT::FIRESHIELDBULLET)];
				bullet.determineCurAnim(ANIM::BUBBA, 4);
				bullet.killAnim = bullet.determineCurAnim(ANIM::AMMO, 3, false);
				bullet.playerHandling = HANDLING::ENEMYBULLET;
				bullet.state = STATE::FLY;
				bullet.xPos = enemy.xPos;
				bullet.yPos = bullet.yPos - 16; 
				
				bullet.animSpeed = 2;
				jjSample(enemy.xPos, enemy.yPos, SOUND::BUBBA_SNEEZE2);
				
				
				
			}
		} else {
			enemy.frameID = enemy.counter = 0;
			enemy.determineCurAnim(ANIM::BUBBA, 5);
			enemy.state = STATE::IDLE;
		}
		break;
	
			
		case STATE::FREEZE:
			if (enemy.freeze > 0) {
				enemy.draw();
				enemy.freeze -= 4;
			}
			if (enemy.freeze < 4) {
				enemy.unfreeze(0);
				enemy.state = enemy.oldState;
			}
			break; 
	
			
		case STATE::KILL:
			
			enemy.particlePixelExplosion(2);
			@spawnedObject = jjObjects[jjAddObject(OBJECT::LEMON, enemy.xPos, enemy.yPos)];
			spawnedObject.determineCurAnim(ANIM::BUBBA, 1);
			jjSample(enemy.xPos, enemy.yPos, SOUND::RAPIER_GOSTRIP);
			enemy.delete();
			break;
			}
		enemy.draw();
		
		
	}
	
		void BubbaSpirit(jjOBJ@ enemy) {
		enemy.determineCurAnim(ANIM::BUBBA, 1);
		enemy.behave(BEHAVIOR::BEE);
		}
		
	
const string MUSICFILENAME = "dang.j2b";	
void onLevelReload() {	
b=0;
final=false;
jjMusicLoad(MUSICFILENAME);
jjPalette.reset();
}

void onMain(){
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 onFunction3(jjPLAYER@ play) {
			//Boss.load("ImprDamn_Ash.j2t");
	final=true;		
	jjLocalPlayers[i].lighting = 70;
	}