Downloads containing VDom4.j2as

Downloads
Name Author Game Mode Rating
JJ2+ Only: violetclm DOM Episodes I...Featured Download Violet CLM Custom / Concept 9 Download file

File preview

const bool MLLESetupSuccessful = MLLE::Setup(array<MLLEWeaponApply@> = {ArcaneWeapons::TornadoGun::Weapon(), null, null, null, null, null, SzmolWeaponPack::PetrolBomb::MyPetrol(), null, null}); ///@MLLE-Generated
#include "MLLE-Include-1.5w.asc" ///@MLLE-Generated
#pragma require "vdom.j2t" ///@MLLE-Generated
#pragma require "VDom4.j2l" ///@MLLE-Generated
#include "petrolBomb.asc" ///@MLLE-Generated
#pragma require "petrolBomb.asc" ///@MLLE-Generated
#include "ArcaneWeapon6.asc" ///@MLLE-Generated
#pragma require "ArcaneWeapon6.asc" ///@MLLE-Generated

///@SaveAndRunArgs -dom -server

const bool DoSpecialGemThing = false;

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

void onReceive(jjSTREAM&in packet, int fromClientID) {
	MLLE::WeaponHook.processPacket(packet, fromClientID);
}

void onLevelReload() { MLLE::Palette.apply(); }
void onLevelLoad() {
	///@Event 63=Red Gem (+1)                     |+|Gem       |Red    |Gem|CP:2|Left:c1
	jjObjectPresets[OBJECT::REDGEM].playerHandling = HANDLING::PARTICLE;
	jjObjectPresets[OBJECT::REDGEM].behavior = ControlPointIndicator;
	jjObjectPresets[OBJECT::DESTRUCTSCENERY].isTarget = true;
	jjObjectPresets[OBJECT::DESTRUCTSCENERY].behavior = function(o) { o.behave(BEHAVIOR::DESTRUCTSCENERY); o.special = 70*5; o.behavior = BEHAVIOR::DESTRUCTSCENERY; };
	jjObjectPresets[OBJECT::TNTAMMO3].scriptedCollisions = true;
}

int everyOtherFlame = 0;
namespace SzmolWeaponPack {
	namespace PetrolBomb {
		class MyPetrol : Weapon {
			void addFlames(float x, float y, uint16 crID, CREATOR::Type crType, bool send) const override {
				Weapon::addFlames(x,y,crID,crType,send);
				for (uint objectID = jjObjectCount; --objectID != 0;) {
					jjOBJ@ bullet = jjObjects[objectID];
					if (bullet.behavior == bombFlame) {
						//use a different behavior (which interacts with tornado guns) but also spawn fewer/faster flames to reduce lag a bit with so much petrol ammo
						if ((everyOtherFlame ^= 1) == 1) {
							bullet.behavior = myFlame;
							bullet.age += 456;
						} else
							bullet.delete();
					}
				}
			}
		}
		void myFlame(jjOBJ@ obj) {
			bombFlame(obj);
			if (obj.xSpeed == 0 && obj.ySpeed == 0) {
				if (jjGameTicks & 3 == 0)
					for (uint objectID = jjObjectCount; --objectID != 0;) {
						jjOBJ@ bullet = jjObjects[objectID];
						if (bullet.behavior == ArcaneWeapons::TornadoGun::Behavior && obj.doesCollide(bullet)) {
							obj.xSpeed = bullet.xSpeed;
							obj.ySpeed = bullet.ySpeed * 3;
							obj.age /= 2;
							obj.var[0] = 1;
							break;
						}
					}
			} else if (obj.var[0] == 1 && jjGameTicks & 7 == 0) {
				jjOBJ@ fire = jjObjects[jjAddObject(OBJECT::TOASTERBULLET, obj.xPos, obj.yPos, obj.creatorID, obj.creatorType)];
				fire.xSpeed = obj.xAcc = 0;
				fire.ySpeed = abs(obj.xSpeed);
			}
		}
	}
}

void ControlPointIndicator(jjOBJ@ obj) {
	const int xTile = int(obj.xOrg) >> 5;
	const int yTile = int(obj.yOrg) >> 5;
	if (obj.state == STATE::START) {	
		obj.var[4] = jjParameterGet(xTile, yTile, 0, 2);
		obj.var[5] = jjParameterGet(xTile, yTile, 2, 1);
	}
	const jjCONTROLPOINT@ controlPoint = jjControlPoints[obj.var[4]];
	if (DoSpecialGemThing && jjGameCustom == GAME::DOM) {
		switch (controlPoint.controlTeam) {
			case TEAM::BLUE:
				obj.var[0] = 3;
				break;
			case TEAM::RED:
				obj.var[0] = 1;
				break;
			case TEAM::GREEN:
				obj.var[0] = 2;
				break;
			case TEAM::YELLOW:
				obj.var[0] = 5;
				break;
			default:
				return;
		}
		obj.behave(BEHAVIOR::PICKUP, false);
		jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame, obj.direction, SPRITE::GEM, obj.var[0]-1, 3);
	}
	if (obj.var[5] != 0) {
		const bool correctTeam = !DoSpecialGemThing || jjGameCustom != GAME::DOM || jjLocalPlayers[0].team == controlPoint.controlTeam;
		jjTileSet(4, xTile + 1, yTile, correctTeam ? 538 : 528);
		jjTileSet(4, xTile + 2, yTile, correctTeam ? 539 : 529);
	}
}

void onLevelBegin() {
	if (DoSpecialGemThing && jjGameCustom == GAME::DOM)
		jjLocalPlayers[0].showText("@@@@Capture a control point to open@@the path to the next floor.", STRING::MEDIUM);
	jjWeapons[WEAPON::BLASTER].style = WEAPON::CAPPED; //can this be in oLL? idk who cares
}

bool BackgroundFlipped = false;
void onMain() {
	const jjPLAYER@ player = jjLocalPlayers[0];
	bool backgroundShouldBeFlipped;
	if (player.yPos < 61 * 32)
		backgroundShouldBeFlipped = false;
	else if (player.yPos > 76 * 32)
		backgroundShouldBeFlipped = true;
	else
		return;
	if (backgroundShouldBeFlipped != BackgroundFlipped) {
		BackgroundFlipped = backgroundShouldBeFlipped;
		for (uint x = 0; x < 25; ++x) {
			uint y = 0;
			while (true) {
				const auto swap = jjTileGet(8,x,y);
				jjTileSet(8,x,y, jjTileGet(8,x,18-y) ^ TILE::VFLIPPED);
				if (y < 9) {
					jjTileSet(8,x,18-y, swap ^ TILE::VFLIPPED);
					++y;
				} else
					break;
			}
		}
	}
}