Downloads containing player_collision_detector_interface.asc

Downloads
Name Author Game Mode Rating
TSF with JJ2+ Only: Player-to-Player Collision... froducish Mutator N/A Download file

File preview

namespace COLLIDE {
	shared enum Collide {
		BULLET,
		BULLETPU,
		BUMP,
		STOMPORRUSH,
		SPECIALMOVE
	};
	
	shared funcdef void HOOK(jjPLAYER@, jjPLAYER@, Collide);
	
	// Reference: https://docs.jj2.plus/plus-angelscript.html#jjpublicinterface
	shared DetectorI@ getDetector(bool debug = false) {
		jjPUBLICINTERFACE@ pi = jjGetPublicInterface("player_collision_detector.mut");
		if (pi !is null) {
			DetectorI@ detector = cast<DetectorI>(pi);
			if (detector is null) {
				if (debug) jjAlert("|Incompatible player_collision_detector.mut version: " + pi.getVersion());
				return null;
			}
			return detector;
		}
		if (debug) jjAlert("|player_collision_detector.mut needs to be running.");
		return null;
	}
	
	shared interface DetectorI : jjPUBLICINTERFACE {
		void setHook(COLLIDE::HOOK@ = onCollide, uint moduleID = jjScriptModuleID);
		void unsetHook(uint moduleID = jjScriptModuleID);
		void startDetecting();
		void stopDetecting();
	}
}