Downloads containing ezforgotciv.j2as

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

File preview

const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {null, null, BubbleGun::Weapon(), ArcaneWeapons::MortarLauncher::Weapon(), null, null, null, null, null}); ///@MLLE-Generated
#include "MLLE-Include-1.6w.asc" ///@MLLE-Generated
#pragma require "ezforgotciv.j2l" ///@MLLE-Generated
#include "ArcaneWeapon4.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon4.asc" ///@MLLE-Generated
#include "BubbleGun.asc" ///@MLLE-Generated
#pragma require "BubbleGun.asc" ///@MLLE-Generated
///@SaveAndRunArgs -server -capture ///@MLLE-Generated

// Forgotten Civilisation
// Created by PurpleJazz of XLM (2011-2015)
// Updated by PurpleJazz of EZ in 2023

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

void onLevelLoad() {
	jjWaterChangeSpeed = 0;
	jjSetWaterLevel(32*93, true);
	jjWaterLighting = WATERLIGHT::GLOBAL;
	
	jjObjectPresets[OBJECT::FLICKERLIGHT].behavior = torch;
	
	jjWeapons[WEAPON::ICE].gradualAim = true;
}

void onLevelBegin() {
	for (int i = 1; i < 255; i++) {
		jjOBJ@ preset = jjObjectPresets[i];
		if (preset.playerHandling == HANDLING::PICKUP) {
			preset.behavior = CannotBeBuried(preset.behavior);
		}
	}
}

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

bool inView(const jjOBJ@ obj) {
	for (int i = 0; i < jjLocalPlayerCount; i++) {
		const jjPLAYER@ play = jjLocalPlayers[i];
		if (obj.xPos > play.cameraX - 64 && obj.yPos > play.cameraY - 64 && obj.xPos < play.cameraX + jjSubscreenWidth + 64 && obj.yPos < play.cameraY + jjSubscreenHeight + 64)
			return true;
	}
	return false;
}

class CannotBeBuried : jjBEHAVIORINTERFACE {
	CannotBeBuried(const jjBEHAVIOR &in behavior) {
		originalBehavior = behavior;
	}
	void onBehave(jjOBJ@ obj) {
		obj.behave(originalBehavior);
		if (jjMaskedPixel(int(obj.xPos), int(obj.yPos + 8))) {
			obj.state = STATE::FLOAT;
		}
	}
	bool onObjectHit(jjOBJ@ obj, jjOBJ@ bullet, jjPLAYER@ player, int force) {
		if (bullet is null) {
			obj.behavior = originalBehavior;
			if (player.objectHit(obj, force, obj.playerHandling))
				return true;
			obj.behavior = this;
		}
		return false;
	}
	private jjBEHAVIOR originalBehavior;
}

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

void onMain() {
	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; //thanks Foly
		}
		if (jjObjects[i].eventID == OBJECT::ICEBULLETPU && jjObjects[i].xSpeed > -0.5 && jjObjects[i].xSpeed < 0.5) {
            jjObjects[i].xSpeed = 0;
        }
	}
}

void onFunction0(jjPLAYER@ play) {
	play.showText("@@@@@@Forgotten Civilisation@Created by PurpleJazz of XLM/EZ (2011-2015; 2023)@Tileset by ET, edited by PurpleJazz@np: Alex Brandon - Atlantis [4:37]");
}

bool onDrawAmmo(jjPLAYER@ player, jjCANVAS@ canvas) {
	return MLLE::WeaponHook.drawAmmo(player, canvas);
}

void onLevelReload() {
	MLLE::ReapplyPalette();
}