Downloads containing xlmnewbtl03.j2as

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Anniversary Bash 16 Levels Jazz2Online Multiple N/A Download file
JJ2+ Only: Renewed InspirationsFeatured Download Xtreme Level Makers Multiple 9.3 Download file

File preview

// Cerulean Comet
// Created by PurpleJazz of XLM (2013)

/*******************************************************************/

bool coinMsg = false;

void onLevelBegin() {
	if (jjIsServer) jjChat("/fireball on");	
}

void onLevelLoad() {
	jjObjectPresets[OBJECT::BLASTERBULLETPU].determineCurAnim(ANIM::AMMO,69);
	jjObjectPresets[OBJECT::BLASTERBULLETPU].special = jjObjectPresets[OBJECT::BLASTERBULLETPU].determineCurAnim(ANIM::AMMO,69,false);
	jjObjectPresets[OBJECT::BLASTERBULLETPU].determineCurFrame();
	jjObjectPresets[OBJECT::BLASTERBULLETPU].xSpeed = 0.5;
	jjObjectPresets[OBJECT::BLASTERBULLETPU].counterEnd = 85;
	jjObjectPresets[OBJECT::BLASTERBULLETPU].light = 8;
	jjObjectPresets[OBJECT::BLASTERBULLETPU].lightType = LIGHT::BRIGHT;
	
	jjObjectPresets[OBJECT::FLYCARROT].bulletHandling = HANDLING::IGNOREBULLET;
	
	jjWeapons[WEAPON::SEEKER].maximum = 25;	
	jjWeapons[WEAPON::SEEKER].comesFromGunCrates = false;
	
	jjWeapons[WEAPON::GUN8].comesFromGunCrates =
	jjWeapons[WEAPON::GUN9].comesFromGunCrates = true;
}
void onPlayer(jjPLAYER@ p) {

	p.powerup[WEAPON::SEEKER] = true;
	
	if (p.fly == FLIGHT::FLYCARROT && p.timerState == TIMER::STOPPED) p.timerStart(10*70);
	if (p.fly == FLIGHT::NONE) p.timerStop();
  	if (p.timerState == TIMER::STARTED && p.timerTime <= 3*70 && p.timerTime > 0 && p.timerTime % 70 == 0) jjSamplePriority(SOUND::COMMON_NOCOIN);
  	
 	for (int i = 1; i < jjObjectCount; ++i) {
		switch (jjObjects[i].eventID) {
			case OBJECT::SILVERCOIN:
				if (p.coins >= 1) {
					p.coins = 1;
					jjObjects[i].playerHandling = HANDLING::PARTICLE; 
				}
				else jjObjects[i].playerHandling = HANDLING::PICKUP;
				break;
			case OBJECT::FLYCARROT:
				if (jjObjects[i].state == STATE::FLOATFALL) jjObjects[i].state = STATE::FLOAT;
				break;
    		}
  	}
	if (p.coins >= 1 && !coinMsg) {
		jjAlert("|||||||You picked up a shield token!");
		coinMsg = true;
	}
	if (p.coins == 0) coinMsg = false;
}

void onPlayerTimerEnd(jjPLAYER@ p) { p.fly = FLIGHT::NONE; }

void onFunction9(jjPLAYER@ p) {
	if (p.testForCoins(1)) {
		p.shieldType = SHIELD::PLASMA;
		p.shieldTime = 20*70;
		jjSamplePriority(SOUND::COMMON_GLASS2);
		jjSamplePriority(SOUND::COMMON_SHIELD1);
	}
}

bool onDrawHealth(jjPLAYER@ p, jjCANVAS@ canvas) {
      	if (p.shieldType != 0 && p.shieldTime > 0) {
      		canvas.drawString(
			jjSubscreenWidth-100,
	      		jjSubscreenHeight-464,
	      		"||||||||Shield!",
	      		STRING::MEDIUM,
	      		STRING::NORMAL
		);
		
		return true;
	}
        return false;
}

bool onDrawPlayerTimer(jjPLAYER@ p, jjCANVAS@ canvas) {
      	if (p.fly == FLIGHT::FLYCARROT) {
      		canvas.drawString(
			jjSubscreenWidth - 55,
	      		jjSubscreenHeight - 284,
	      		"" + (p.timerTime + 70) / 70,
	      		STRING::LARGE,
	      		STRING::PALSHIFT,
	      		p.timerTime > 3*70?
	      			0 :
	      			jjGameTicks % 28 > 14?
	      				-40 :
	      				-24
		);
		
		canvas.drawSprite(
			jjSubscreenWidth - 72,
			jjSubscreenHeight - 270,
			ANIM::PICKUPS,
			40,
			0
		);
	}
	return true;
}