Downloads containing NapsMEV0-3-29.asc

Downloads
Name Author Game Mode Rating
JJ2+ Only: Anniversary Bash 25 Battle Jazz2Online Battle N/A Download file
TSF with JJ2+ Only: Honey CataCombs Rysice Battle N/A Download file
TSF with JJ2+ Only: Anniversary Bash 24 Battle Jazz2Online Battle N/A Download file

File preview

//82=Custom Modifiers (Naps)          |+|Modifier  |Custom |Modifier  |EventType:8

//Total events so far: 2 (this number might increase in the future)
//Expected number of events: 18
//Versioning: (Years Passed)-Month-day

namespace NapModifier {
	array<jjOBJ@> playerSupportingPlatforms(32);
	array<uint> playerButtstompCounter(jjLocalPlayerCount);
	enum customEvents {Slow_Sink,Bouncy_Sink};
	int usedEvent = 82;
	bool fixedBouncySinkButtstomp = false;
	void onPlayerModifierHook(jjPLAYER@ play) {
		int playEventBelow = 0;
		int playEventParBelow = 0;
		int playEventAbove = 0;
		int playEventParAbove = 0;
		int playEvent = 0;
		int playEventPar = 0;
		if (play.xPos > 0 && (play.xPos/32) < jjLayerWidth[4] && play.yPos > 0 && ((play.yPos + 12)/32) < jjLayerHeight[4]) {
			playEventBelow = jjEventGet(int(play.xPos/32),int((play.yPos + (play.antiGrav? -12 : 12))/32));
			playEventParBelow = jjParameterGet(int(play.xPos/32),int((play.yPos + (play.antiGrav? -12 : 12))/32),0,8);
		}
		if (play.xPos > 0 && (play.xPos/32) < jjLayerWidth[4] && play.yPos - 12 > 0 && ((play.yPos)/32) < jjLayerHeight[4]) {
			playEventAbove = jjEventGet(int(play.xPos/32),int((play.yPos - (play.antiGrav? -12 : 12))/32));
			playEventParAbove = jjParameterGet(int(play.xPos/32),int((play.yPos - (play.antiGrav? -12 : 12))/32),0,8);
		}
		
		if (play.xPos > 0 && (play.xPos/32) < jjLayerWidth[4] && play.yPos > 0 && ((play.yPos)/32) < jjLayerHeight[4]) {
			playEvent = jjEventGet(int(play.xPos/32),int((play.yPos)/32));
			playEventPar = jjParameterGet(int(play.xPos/32),int(play.yPos/32),0,8);
		}
		if (playEventBelow == usedEvent) {
			if (playEventParBelow == Slow_Sink || playEventParBelow == Bouncy_Sink) {
				if (playEventParBelow == Bouncy_Sink && play.ySpeed > 4) {
					if (play.buttstomp >= 121 || (playerButtstompCounter[play.localPlayerID] < 3 && !fixedBouncySinkButtstomp)) {
						play.yPos -= play.ySpeed;
						if (!fixedBouncySinkButtstomp) {
							playerButtstompCounter[play.localPlayerID]++;
						}
					}
				}
				if (play.ySpeed < -0.5) {
					play.ySpeed = 0;
				}	
				
				if (play.xSpeed < -0.5) {
					play.xSpeed = -0.5;
				}
				if (play.xSpeed > 0.5) {
					play.xSpeed = 0.5;
				}
				if (!(((playEventParAbove == Slow_Sink || playEventParAbove == Bouncy_Sink) && (playEventAbove == usedEvent)) || ((playEventPar == Slow_Sink || playEventPar == Bouncy_Sink) && playEvent == usedEvent)) && playEventParBelow == Bouncy_Sink) {
					if (play.ySpeed >= 4) {
						if (play.ySpeed < 13) {
							play.ySpeed = (-play.ySpeed)*2.3;
							jjSample(play.xPos,play.yPos,SOUND::Sample(SOUND::BUBBA_BUBBABOUNCE1 + int(jjRandom() % 2)),63, 1000 + int(abs(play.ySpeed) * 1000));
						} else {
							play.ySpeed = -13;
						}
					}		
				} else {
					if (play.ySpeed > 0.5) {
						play.ySpeed = 0.5;
					}	
				}
				if (playerSupportingPlatforms[play.playerID] is null) {
					jjOBJ@ obj = jjObjects[jjAddObject(OBJECT::GRASSPLATFORM,play.xPos,play.yPos + (play.antiGrav? -48 : 24),0)];
					@playerSupportingPlatforms[play.playerID] = obj;
					obj.determineCurAnim(ANIM::GRASSPLAT, 0);
					obj.determineCurFrame(true);
					obj.behavior = SupportingPlatform();
					obj.var[1] = play.playerID;
					
				}
				
			}
		} else {
			if (playEventAbove == usedEvent && (playEventParAbove == Slow_Sink || playEventParAbove == Bouncy_Sink)) {
				if (play.ySpeed < -0.5) {
					play.ySpeed = 0;
					
				}	
			}
			revertChanges(play);
		}
		
	}
	
	void revertChanges(jjPLAYER@ play) {
		if (playerSupportingPlatforms[play.playerID] !is null) {
			play.platform = 0;
			playerSupportingPlatforms[play.playerID].delete();
			@playerSupportingPlatforms[play.playerID] = null;
		}
		playerButtstompCounter[play.localPlayerID] = 0;
	}
	class SupportingPlatform : jjBEHAVIORINTERFACE {
		void onBehave(jjOBJ@ obj) {
			if (obj.var[1] >= 0) {
				jjPLAYER@ play = jjPlayers[obj.var[1]];
				obj.xPos = play.xPos;
				obj.isFreezable = false;
				obj.triggersTNT = false;
				obj.bulletHandling = HANDLING::IGNOREBULLET;
				obj.beSolid();
				if (play.platform == obj.objectID) {
					obj.yPos += (play.antiGrav? -0.5 : 0.5);
				} else {
					play.platform = 0;
				}
				 //jjDrawSpriteFromCurFrame(obj.xPos, obj.yPos, obj.curFrame,0);
			} else
			{
				obj.state = STATE::DEACTIVATE;
			}
		}
	}
}