Downloads containing xlmalcatraz.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Anniversary Bash 25 Battle Jazz2Online Battle N/A Download file
JJ2+ Only: AlcatrazFeatured Download Loon Battle 8.3 Download file

File preview

#pragma require "BubbleGun.j2a";

void onLevelLoad() {

	jjUseLayer8Speeds = true;
	
	jjSetWaterGradient(69, 69, 69, 0, 0, 0);
	jjWaterChangeSpeed = 0;
	jjSetWaterLevel(186*32, true);
	jjWaterLighting = (WATERLIGHT::GLOBAL);
	
	jjAnimSets[ANIM::CUSTOM[0]].load(0, "BubbleGun.j2a");
	jjAnimSets[ANIM::CUSTOM[1]].load(1, "BubbleGun.j2a");
	jjAnimSets[ANIM::CUSTOM[2]].load(2, "BubbleGun.j2a");
	jjAnimations[jjAnimSets[ANIM::AMMO] + 29] = jjAnimations[jjAnimSets[ANIM::AMMO] + 8];
	jjAnimations[jjAnimSets[ANIM::AMMO] + 28] = jjAnimations[jjAnimSets[ANIM::CUSTOM[0]] + 0];
	
	jjObjectPresets[OBJECT::ICEBULLET].special = jjObjectPresets[OBJECT::ICEBULLET].determineCurAnim(ANIM::AMMO, 8);
	jjObjectPresets[OBJECT::ICEBULLET].xSpeed = 2;
	jjObjectPresets[OBJECT::ICEBULLET].counterEnd = 105;
	jjObjectPresets[OBJECT::ICEBULLET].var[6] = 0;
	jjObjectPresets[OBJECT::ICEBULLET].freeze = 0;
	jjObjectPresets[OBJECT::ICEBULLET].lightType = jjObjectPresets[OBJECT::BLASTERBULLET].lightType;

	jjObjectPresets[OBJECT::ICEBULLETPU].special = jjObjectPresets[OBJECT::ICEBULLETPU].determineCurAnim(ANIM::CUSTOM[0], 0);
	jjObjectPresets[OBJECT::ICEBULLETPU].xSpeed = 3;
	jjObjectPresets[OBJECT::ICEBULLETPU].counterEnd = 105;
	jjObjectPresets[OBJECT::ICEBULLETPU].var[6] = 8;
	jjObjectPresets[OBJECT::ICEBULLETPU].freeze = 0;
	jjObjectPresets[OBJECT::ICEBULLETPU].lightType = jjObjectPresets[OBJECT::BLASTERBULLET].lightType;
	
	jjObjectPresets[OBJECT::ICEBULLET].behavior = jjObjectPresets[OBJECT::ICEBULLETPU].behavior = BubbleGun();
	
	jjObjectPresets[OBJECT::ICEPOWERUP].determineCurAnim(ANIM::CUSTOM[1], 0, true);
	
	jjWeapons[WEAPON::ICE].spread = SPREAD::NORMAL;
	jjWeapons[WEAPON::ICE].defaultSample = false;
}

class BubbleGun : jjBEHAVIORINTERFACE {
    void onBehave(jjOBJ@ bubble) {
		if (bubble.state == STATE::START) {
			bubble.state = STATE::FLY;
			if (jjPlayers[bubble.creatorID].isLocal) jjSample(bubble.xPos, bubble.yPos, SOUND::COMMON_PLOP2, 0, 0);
		}
		
		if (jjMaskedPixel(int(bubble.xPos) + int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos) - int(bubble.xSpeed), int(bubble.yPos)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) + int(bubble.ySpeed)) || jjMaskedPixel(int(bubble.xPos), int(bubble.yPos) - int(bubble.ySpeed))) {
			jjSample(bubble.xPos, bubble.yPos, SOUND::P2_SPLOUT, 0, 0);
		}
		
		bubble.behave(BEHAVIOR::WATERSHIELDBULLET);
		
		if (bubble.state == STATE::FLY && bubble.counter > 0) {
			switch (bubble.direction) {
				case 1: bubble.xSpeed -= (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); bubble.ySpeed -= (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); break;
				case -1: bubble.xSpeed += (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); bubble.ySpeed -= (bubble.eventID == OBJECT::ICEBULLETPU? 0.1:0.04); break;
			}
		}
		
		bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
	}
}