Downloads containing xlmforgotciv.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: Forgotten CivilisationFeatured Download PurpleJazz Capture the flag 8.7 Download file

File preview

#pragma require "BubbleGun.j2a"

// Forgotten Civilisation
// Created by PurpleJazz of XLM (2011-2015)

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

void onLevelLoad() {
	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];
	
	jjUseLayer8Speeds = true;
	jjTexturedBGTexture = TEXTURE::XARGON;
	jjTexturedBGFadePositionY = 0.65;

	jjWaterChangeSpeed = 0;
	jjSetWaterLevel(32*93, true);
	jjWaterLighting = WATERLIGHT::GLOBAL;
	
	
	for (int i = 0; i < 255; i++) {
		if (jjObjects[i].playerHandling == HANDLING::PICKUP) 
			jjObjectPresets[i].behavior = CantBeBuried;
	}
	
	jjObjectPresets[OBJECT::FLICKERLIGHT].behavior = torch;
	
	jjObjectPresets[OBJECT::ICEBULLET].special = jjObjectPresets[OBJECT::ICEBULLET].determineCurAnim(ANIM::AMMO, 8);
	jjObjectPresets[OBJECT::ICEBULLET].behavior = BubbleGun;
	jjObjectPresets[OBJECT::ICEBULLET].xSpeed = 1.5;
	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].behavior = BubbleGunPU;
	jjObjectPresets[OBJECT::ICEBULLETPU].xSpeed = 2;
	jjObjectPresets[OBJECT::ICEBULLETPU].counterEnd = 105;
	jjObjectPresets[OBJECT::ICEBULLETPU].var[6] = 0;
	jjObjectPresets[OBJECT::ICEBULLETPU].freeze = 0;
	jjObjectPresets[OBJECT::ICEBULLETPU].lightType = jjObjectPresets[OBJECT::BLASTERBULLET].lightType;
	
	jjObjectPresets[OBJECT::ICEPOWERUP].determineCurAnim(ANIM::CUSTOM[1], 0, true);
	jjObjectPresets[OBJECT::ICEAMMO15].behavior = BubbleCrate;
	
	jjObjectPresets[OBJECT::BOUNCERPOWERUP].direction = 0;
	
	jjWeapons[WEAPON::ICE].spread = SPREAD::NORMAL;
	jjWeapons[WEAPON::ICE].defaultSample = false;
}

void BubbleGun(jjOBJ@ bubble) {
    if (bubble.state == STATE::START) {
		bubble.state = STATE::FLY;
		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);
	bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
}

void BubbleGunPU(jjOBJ@ bubble) {
	if (bubble.state == STATE::START) {
		bubble.state = STATE::FLY;
		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.xSpeed - 0.08; bubble.ySpeed = bubble.ySpeed - 0.08; break;
			case -1: bubble.xSpeed = bubble.xSpeed + 0.08; bubble.ySpeed = bubble.ySpeed - 0.08; break;
		}
	}
	
	bubble.killAnim = jjObjectPresets[OBJECT::WATERSHIELDBULLET].killAnim;
}

void BubbleCrate(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::AMMO15, false);
	jjDrawSprite(int(obj.xPos), int(obj.yPos), ANIM::CUSTOM[2], 0, 0, SPRITE::NORMAL);
}

void torch(jjOBJ@ obj) {
	jjDrawSprite(obj.xPos+5, obj.yPos-11, ANIM::AMMO, 13, jjGameTicks / 10 % 6);
}

void CantBeBuried(jjOBJ@ obj) {
	obj.behave(BEHAVIOR::PICKUP);
	if (jjMaskedPixel(int(obj.xPos), int(obj.yPos) + 8)) {
		obj.state = STATE::FLOAT;
	}
}

void onPlayer(jjPLAYER@ play) {
	play.lighting = 80;
	play.lightType = LIGHT::NONE;
}

void onMain() { //thanks Foly
	for (int i = 1; i < jjObjectCount; i++) {
		if (jjObjects[i].isActive && jjObjects[i].eventID == OBJECT::COPTER && jjObjects[i].state == STATE::FLY) {
			jjObjects[i].counter = 90;
			if (jjObjects[i].var[4] == 0)
				jjObjects[i].state = STATE::DONE;
		}
	}
}

void onFunction0(jjPLAYER@ play) {
	play.showText("@@@@@@Forgotten Civilisation@Created by PurpleJazz of XLM (2011-2015)@Tileset by ET, edited by PurpleJazz@np: Kevin Riepl - Atlantis [3:03]");
}