-- name: \\#8de\\gMario\\#fc2\\[\\#ac9\\0\\#fc2\\]\\#dcdcdc\\ RNG (Alpha) -- real name \\#adf993\\Position \\#badaf9\\Randomiser\\#dcdcdc\\ (beta) -- description: Makes you jitter randomly all over the place! - wybh24 alias \n(\\#646496\\Bob-omb\\#dcdcdc\\, \\#e3e3e3\\Boo\\#dcdcdc\\, \\#aa66dd\\Chuckya\\#dcdcdc\\, \\#32ba32\\Bombella\\#dcdcdc\\, \\#dd5544\\Cheep Cheep\\#dcdcdc\\, \\#dfdfdf\\Blooper\\#dcdcdc\\, \\#ffbb05\\S\\#9c5817\\ti\\#ffbb05\\ng\\#9c5817\\by\\#646464\\>\\#dcdcdc\\) \n\nSpecial Thanks:\napplemansunny (Coin Counter)\n\n\\#ffffff\\[Version: Alpha v1] local s = gGlobalSyncTable s.A_Count = 0 s.B_Count = 0 s.Z_Count = 0 s.distanceT = 0 s.BdistanceT = 0 s.coincount = 0 s.Bcoincount = 0 s.hurtcount = 0 s.Bhurtcount = 0 s.BA_Count = 0 s.BB_Count = 0 s.BZ_Count = 0 s.RMSetting = 1 s.Nply = 0 s.BNply = 0 s.mult1 = 1 s.mult2 = 1 s.div1 = 69420 s.timeacc = 3600 s.doubletimeflag = false s.removetimeflag = false s.displacementflag = false s.catastrophic_failure_flag = false local showdebug = false local NplyD = 0 local BNplyD = 0 local NplyA = 0 local BNplyA = 0 local Nply2 = 2 local Nply3 = 0.25 local Inc = 0 local RandomIncrement = 0 local numberKeys = 0 ---@param m MarioState function Incrementcheck(m) if m.playerIndex ~= 0 then return end Inc = ((math.random() + 1) ^ 2) - 1 local rng101 = math.random() local rng102 = math.random() * 1.28 local rng103 = math.random() if rng103 <= 0.015625 then Inc = 0 end RandomIncrement = (rng101 - rng102) / 6.4 end local timer81 = 0 local timer82 = 0 local stars1 = 0 local stars2 = 0 local whatstars = 0 function savesys() if network_is_server() then m = gMarioStates[0] if whatstars < m.numStars then if timer82 > 2 then mod_storage_save("A", tostring(s.A_Count)) mod_storage_save("B", tostring(s.B_Count)) mod_storage_save("Z", tostring(s.Z_Count)) mod_storage_save("coin", tostring(s.coincount)) mod_storage_save("distance", tostring(s.distanceT)) mod_storage_save("hurtcount", tostring(s.hurtcount)) mod_storage_save("BA", tostring(s.BA_Count)) mod_storage_save("BB", tostring(s.BB_Count)) mod_storage_save("BZ", tostring(s.BZ_Count)) mod_storage_save("Bcoin", tostring(s.Bcoincount)) mod_storage_save("Bdistance", tostring(s.BdistanceT)) mod_storage_save("Bhurtcount", tostring(s.Bhurtcount)) end end if m.numStars ~= 0 then if timer82 < 2 then s.A_Count = tonumber(mod_storage_load("A")) s.B_Count = tonumber(mod_storage_load("B")) s.Z_Count = tonumber(mod_storage_load("Z")) s.coincount = tonumber(mod_storage_load("coin")) s.distanceT = tonumber(mod_storage_load("distance")) s.hurtcount = tonumber(mod_storage_load("hurtcount")) s.BA_Count = tonumber(mod_storage_load("BA")) s.BB_Count = tonumber(mod_storage_load("BB")) s.BZ_Count = tonumber(mod_storage_load("BZ")) s.Bcoincount = tonumber(mod_storage_load("Bcoin")) s.BdistanceT = tonumber(mod_storage_load("Bdistance")) s.Bhurtcount = tonumber(mod_storage_load("Bhurtcount")) end end timer81 = (timer81 + 1) % 2 if timer82 < 5 then timer82 = timer82 + 1 end if timer81 == 0 then stars1 = m.numStars whatstars = stars2 elseif timer81 == 1 then stars2 = m.numStars whatstars = stars1 end end end hook_event(HOOK_UPDATE, savesys) ---@param m MarioState function countingupA(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then return end local m = gMarioStates[0] if m.controller.buttonPressed then local button_state = tonumber(m.controller.buttonPressed) or 0 local a_pressed = (button_state & A_BUTTON) ~= 0 if a_pressed then if (s.Nply >= Inc ^ 0.64) then if s.BA_Count == 0 then s.A_Count = s.A_Count + (0.64 + (RandomIncrement * 1.96)) * s.mult2 end if s.A_Count < 0 then s.BA_Count = s.BA_Count + s.A_Count s.A_Count = 0 end if s.BA_Count ~= 0 then s.BA_Count = s.BA_Count + (0.64 + (RandomIncrement * 1.96)) * s.mult2 if s.BA_Count > 0 then s.A_Count = s.A_Count + s.BA_Count s.BA_Count = 0 end end end end end end local Mply = 1 local timer1 = 217 ---@param m MarioState function randomM(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then Mply = 1 return end local rng7 = math.random() local rng8 = math.random() local rng9 = math.random() local rng10 = math.random() local rngD = ((rng9 * 720) + (600 * rng10) + 64) / ((math.sqrt(s.Nply + 1) - 1) + 0.00001) Mply = math.abs(math.sqrt(1 + ((rng7 / rngD) - (rng8 / rngD)))) if Mply < 1 then Mply = Mply ^ (Mply ^ (math.sqrt(Mply))) end end -- like to credit @applemansunny for the baseline of this function coinvar = 0 local coins = 0 ---@param m MarioState hook_event(HOOK_MARIO_UPDATE, function(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then return end local m = gMarioStates[0] coins = m.numCoins local rng17 = math.random() local rng18 = math.random() if coinvar ~= coins then if coinvar < coins then if rng17 <= (math.sqrt(s.Nply + 1) - 1) then if s.Bcoincount == 0 then s.coincount = s.coincount + (((coins - coinvar) + (rng17 - rng18)) / 192) * s.mult2 end if s.coincount < 0 then s.Bcoincount = s.Bcoincount + s.coincount s.coincount = 0 end if s.Bcoincount ~= 0 then s.Bcoincount = s.Bcoincount + (((coins - coinvar) + (rng17 - rng18)) / 192) * s.mult2 if s.Bcoincount > 0 then s.coincount = s.coincount + s.Bcoincount s.Bcoincount = 0 end end else s.coincount = s.coincount end end coinvar = coins end end) ouch = 0 ---@param m MarioState hook_event(HOOK_MARIO_UPDATE, function(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then return end local m = gMarioStates[0] ouch = m.hurtCounter local rng47 = math.random() local rng48 = math.random() if m.hurtCounter > 0 then if m.health > 300 then if rng47 <= (math.sqrt(s.Nply + 1) - 1) then if s.Bhurtcount == 0 then s.hurtcount = s.hurtcount + ((ouch + (rng47 - rng48)) / 2048) * s.mult2 end if s.hurtcount < 0 then s.Bhurtcount = s.Bhurtcount + s.hurtcount s.hurtcount = 0 end if s.Bhurtcount ~= 0 then s.Bhurtcount = s.Bhurtcount + ((ouch + (rng47 - rng48)) / 2048) * s.mult2 if s.Bhurtcount > 0 then s.hurtcount = s.hurtcount + s.Bhurtcount s.Bhurtcount = 0 end end else s.hurtcount = s.hurtcount end end end end) local key1 = 0 local key2 = 0 function checkkey() if save_file_get_flags() & SAVE_FLAG_HAVE_KEY_1 ~= 0 then key1 = 1 end if save_file_get_flags() & SAVE_FLAG_HAVE_KEY_2 ~= 0 then key2 = 1 end numberKeys = ((key1 + key2 + 1) ^ 0.64) - 1 end hook_event(HOOK_UPDATE, checkkey) ---@param m MarioState function countingupB(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then return end local m = gMarioStates[0] if m.controller.buttonPressed then local button_state = tonumber(m.controller.buttonPressed) or 0 local b_pressed = (button_state & B_BUTTON) ~= 0 if b_pressed then if (s.Nply >= Inc ^ 0.64) then if s.BB_Count == 0 then s.B_Count = s.B_Count + (0.360 + RandomIncrement) * s.mult2 end if s.B_Count < 0 then s.BB_Count = s.BB_Count + s.B_Count s.B_Count = 0 end if s.BB_Count ~= 0 then s.BB_Count = s.BB_Count + (0.360 + RandomIncrement) * s.mult2 if s.BB_Count > 0 then s.B_Count = s.B_Count + s.BB_Count s.BB_Count = 0 end end end end end end ---@param m MarioState function countingupZ(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then return end local m = gMarioStates[0] if m.controller.buttonPressed then local button_state = tonumber(m.controller.buttonPressed) or 0 local z_pressed = (button_state & Z_TRIG) ~= 0 if z_pressed then if (s.Nply >= Inc ^ 0.64) then if s.BZ_Count == 0 then s.Z_Count = s.Z_Count + (0.335 + RandomIncrement) * s.mult2 end if s.Z_Count < 0 then s.BZ_Count = s.BZ_Count + s.Z_Count s.Z_Count = 0 end if s.BZ_Count ~= 0 then s.BZ_Count = s.BZ_Count + (0.335 + RandomIncrement) * s.mult2 if s.BZ_Count > 0 then s.Z_Count = s.Z_Count + s.BZ_Count s.BZ_Count = 0 end end end end end end ---@param m MarioState function measuringdistance(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then return end if s.catastrophic_failure_flag == true then return end local m = gMarioStates[0] local Hvel = math.abs(m.forwardVel) local Yvel = math.abs(m.vel.y) if NplyD >= 1.6 then if math.abs(Hvel) > 5 then if math.abs(Hvel) < 1640 then if s.BdistanceT == 0 then s.distanceT = s.distanceT + ((math.sqrt((Hvel ^ 2 + Yvel ^ 2))) / 1000000) * s.mult2 end if s.distanceT < 0 then s.BdistanceT = s.BdistanceT + s.distanceT s.distanceT = 0 end if s.BdistanceT ~= 0 then s.BdistanceT = s.BdistanceT + ((math.sqrt((Hvel ^ 2 + Yvel ^ 2))) / 1000000) * s.mult2 if s.BdistanceT > 0 then s.distanceT = s.distanceT + s.BdistanceT s.BdistanceT = 0 end end end end end end s.expvar1 = 1 ---@param m MarioState function randomN(m) if m.playerIndex ~= 0 then return end if s.RMSetting ~= 1 then return end if s.catastrophic_failure_flag == false then s.BNply = (((((((math.abs(s.Bhurtcount) + 1) ^ 0.64) * ((math.abs(s.BdistanceT) + 1) ^ 0.05) * math.sqrt(math.sqrt(math.abs(s.Bcoincount) + 1)) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.abs(s.BA_Count) + 1)))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.abs(s.BB_Count) + 1))))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.abs(s.BZ_Count + 1))))))) - 1) + 1) ^ 0.896875) - 1) * s.expvar1 s.Nply = ((((((((s.hurtcount + 1) ^ 0.64) * ((s.distanceT + 1) ^ 0.05) * math.sqrt(math.sqrt(s.coincount + 1)) * math.sqrt(math.sqrt(((m.numStars + 1) ^ 0.64))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(s.A_Count + 1)))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.sqrt(s.B_Count + 1))))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.sqrt(s.Z_Count + 1)))))) - 1) + 1) ^ 0.896875) - 1) * s.expvar1 - s.BNply) / (math.sqrt(numberKeys) + 1) Nply2 = (7 - s.Nply) if s.Nply < 0 then s.Nply = 0 end if s.Nply < 1 then Nply3 = (0.95 - s.Nply) elseif s.Nply < 1.7 then if s.Nply > 1.2 then Nply3 = (1.6 - s.Nply) end else Nply3 = (3 - s.Nply) end if s.Nply > 7 then if s.Nply < 81920 then if timer1 > 30 then s.expvar1 = s.expvar1 * 1.001 else s.expvar1 = s.expvar1 * 1.001064 end if timer1 >= 216.97 then play_sound(SOUND_OBJ_BOO_LAUGH_LONG, m.marioObj.header.gfx.cameraToObject) end if timer1 > 0 then timer1 = timer1 - 1/30 end if timer1 <= 1 then if timer1 > 0 then return end s.Nply = 0 end if timer1 <= 0 then s.A_Count = 0 s.B_Count = 0 s.Z_Count = 0 s.Nply = 0 s.coincount = 0 s.distanceT = 0 s.hurtcount = 0 m.pos.y = find_floor_height(m.pos.x, m.pos.y, m.pos.z) m.health = 0 m.numLives = 0 s.expvar1 = 1 timer1 = 217 spawn_non_sync_object(id_bhvExplosion, E_MODEL_BOBOMB_BUDDY, m.pos.x, find_floor_height(m.pos.x, m.pos.y, m.pos.z), m.pos.z, function(o) end) end end end elseif s.catastrophic_failure_flag == true then s.Nply = (((((((s.hurtcount + 1) ^ 0.64) * ((s.distanceT + 1) ^ 0.05) * math.sqrt(math.sqrt(s.coincount + 1)) * math.sqrt(math.sqrt(math.sqrt(m.numStars + 1))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(s.A_Count + 1)))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.sqrt(s.B_Count + 1))))) * math.sqrt(math.sqrt(math.sqrt(math.sqrt(math.sqrt(s.Z_Count + 1)))))) - 1) + 1) ^ 0.896875) - 1) * s.mult1 end end local NplyI = 0 local updatespeed = 0.28 ---@param m MarioState function nplyupdater(m) if m.playerIndex ~= 0 then return end NplyD = NplyD + (s.Nply - NplyD) * updatespeed BNplyD = BNplyD + (s.BNply - BNplyD) * updatespeed if s.catastrophic_failure_flag == false then NplyI = NplyD end end ---@param m MarioState function nplyAupdater(m) if m.playerIndex ~= 0 then return end NplyA = s.Nply - NplyD if NplyA < 0 then plusorminus = '-' else plusorminus = '+' end BNplyA = s.BNply - BNplyD if BNplyA < 0 then Bplusorminus = '-' else Bplusorminus = '+' end end local Oply = 1 ---@param m MarioState function randomO(m) if m.playerIndex ~= 0 then return end local rng33 = math.random() local rng34 = math.random() if rng33 < ((((s.Nply + 1) ^ 0.64) - 1) / s.div1) then if s.Nply < 64 then Oply = (rng34 + 1) * 12 * math.sqrt(s.Nply + 1) else Oply = (rng34 + 1) * 12 * math.sqrt(100 + 1) end elseif rng33 < (s.Nply / s.div1) then if s.Nply < 64 then Oply = (rng34 + 1) * 3.5 * math.sqrt(s.Nply + 1) else Oply = (rng34 + 1) * 3.5 * math.sqrt(100 + 1) end else Oply = 1 end end ---@param m MarioState function random1(m) if m.playerIndex ~= 0 then return end local rng1 = math.random() local rng2 = math.random() rngA = ((rng1 - rng2) * 2) * s.Nply * Oply m.pos.x = (m.pos.x + rngA) * Mply end ---@param m MarioState function random2(m) if m.playerIndex ~= 0 then return end local rng3 = math.random() local rng4 = math.random() rngB = ((rng3 - rng4) * 2) * s.Nply * Oply m.pos.y = (m.pos.y + rngB) * Mply end ---@param m MarioState function random3(m) if m.playerIndex ~= 0 then return end local rng5 = math.random() local rng6 = math.random() rngC = ((rng5 - rng6) * 2) * s.Nply * Oply m.pos.z = (m.pos.z + rngC) * Mply end function randomothervariables(m) if m.playerIndex ~= 0 then return end local rng44 = math.random() - 0.5 local rng313 = math.random(20) rngK = rng44 * 3.14 * (math.sqrt(s.Nply + 1) - 1) * Oply if m.quicksandDepth > 0 then m.quicksandDepth = (m.quicksandDepth + rngK * 1.414) end m.peakHeight = (m.peakHeight + rngK * 5) if m.capTimer > (4 * (math.sqrt(s.Nply + 1) - 1)) then m.capTimer = m.capTimer + rngK if rng313 <= 10 then if s.Nply == 0 then return end m.capTimer = m.capTimer + 1 end end end local inittempo1 = 0 local inittempo2 = 0 local inittempo3 = 0 local timerRES = 0 local rng51 = 0 local rng52 = 0 local rng53 = 0 local rng54 = 0 local inittranspos = 0 local rng55 = 0 local seqflag = true local transposinc = 0 function resetthing() if seqflag ~= true then return end timerRES = 0 rng55 = math.random() * 5 if rng55 < s.Nply then inittranspos = sequence_player_get_transposition(0) + transposinc rng54 = math.random(-12, 12) if rng54 / 2 ~= math.floor(rng54 / 2) then rng54 = 0 end else rng54 = 0 end end local tempoinc = 0 local incq = 0 local timer21 = 18 function randomseqthing(m) if m.playerIndex ~= 0 then return end if seqflag ~= true then return end if s.Nply < 3 then rng51 = math.random(-250, 300) * (s.Nply ^ 1.5 / 3 ^ 1.5) rng52 = math.random(-250, 300) * (s.Nply ^ 1.5 / 3 ^ 1.5) rng53 = math.random(-250, 300) * (s.Nply ^ 1.5 / 3 ^ 1.5) else rng51 = math.random(-250, 300) * (3 ^ 1.5 / 3 ^ 1.5) rng52 = math.random(-250, 300) * (3 ^ 1.5 / 3 ^ 1.5) rng53 = math.random(-250, 300) * (3 ^ 1.5 / 3 ^ 1.5) end if s.catastrophic_failure_flag == true then timer21 = timer21 - 1 if timer21 <= 0 then incq = (incq + 1) % 48 if incq == 1 then tempoinc = tempoinc + 88 transposinc = transposinc + math.random(1, math.random(256)) / 350 end end sequence_player_set_transposition(1, transposinc) sequence_player_set_tempo(1, 6960 + tempoinc) else tempoinc = 0 transposinc = 0 timer21 = math.random(60, 300) end if s.catastrophic_failure_flag ~= true then return end timerRES = timerRES + 1 if timerRES > 0 and timerRES <= 3 then inittempo1 = sequence_player_get_tempo(0) inittempo2 = sequence_player_get_tempo(1) inittempo3 = sequence_player_get_tempo(2) inittranspos = sequence_player_get_transposition(0) end if timerRES == 5 then sequence_player_set_transposition(0, inittranspos + rng54 + transposinc) end if timerRES > 5 then sequence_player_set_tempo(0, inittempo1 + rng51 * 10 + tempoinc) sequence_player_set_tempo(1, inittempo2 + rng52 * 18) sequence_player_set_tempo(2, inittempo3 + rng53 * 18) elseif timerRES <= 5 then if timerRES <= 3 then return end sequence_player_set_tempo(0, inittempo1) sequence_player_set_tempo(1, inittempo2) sequence_player_set_tempo(2, inittempo3) end end hook_event(HOOK_ON_LEVEL_INIT, resetthing) hook_event(HOOK_MARIO_UPDATE, randomseqthing) local animflag = false local rng61 = 0 local rng62 = 0 local rng63 = 0 local rng64 = 0 local timerAN = 0 function randomanims(m) if m.playerIndex ~= 0 then return end if animflag == false then rng61 = math.random(0, 208) timerAN = 0 end rng62 = math.random() if s.Nply < 5 then if rng62 * 32000 < s.Nply then animflag = true end else if rng62 * 32000 < 5 then animflag = true end end if animflag == true then rng64 = math.random(64) if rng64 == 1 then rng61 = math.random(0, 208) timerAN = 0 end timerAN = timerAN + 1 set_mario_animation(m, rng61) set_anim_to_frame(m, timerAN) if timerAN > 30 then rng63 = math.random(0, math.floor(15 - (timerAN - 30) / 6)) if rng63 == 0 then animflag = false timerAN = 0 end end end end function setanimflag() end hook_event(HOOK_ON_SET_MARIO_ACTION, setanimflag) hook_event(HOOK_MARIO_UPDATE, randomanims) local rng72 = 0 function objectposram() m = gMarioStates[0] if m.playerIndex ~= 0 then return end rng72 = math.random(3) if rng72 ~= 1 then return end for objList = 0, NUM_OBJ_LISTS - 1 do local o = obj_get_first(objList) while o ~= nil do if s.Nply < 3 then o.oPosX = o.oPosX + (math.random() - 0.5) * (250 * (s.Nply ^ 1.5 / 6)) o.oPosY = o.oPosY + (math.random() - 0.5) * (64 * (s.Nply ^ 1.5 / 6)) o.oPosZ = o.oPosZ + (math.random() - 0.5) * (250 * (s.Nply ^ 1.5 / 6)) elseif s.Nply > 3 then o.oPosX = o.oPosX + (math.random() - 0.5) * (250 * (3 ^ 1.5 / 4)) o.oPosY = o.oPosY + (math.random() - 0.5) * (64 * (3 ^ 1.5 / 4)) o.oPosZ = o.oPosZ + (math.random() - 0.5) * (250 * (3 ^ 1.5 / 4)) end o = obj_get_next(o) end end end hook_event(HOOK_ON_LEVEL_INIT, objectposram) ---@param m MarioState function randomV(m) if m.playerIndex ~= 0 then return end if s.Nply >= 0.95 then local rng13 = math.random() local rng14 = math.random() local rngV1 = ((rng13 - rng14) * 2) * ((((math.sqrt(s.Nply + 1) - 1) + 1) ^ 1.5) - 1) m.forwardVel = (m.forwardVel + rngV1) * Mply if m.forwardVel < 8 then m.forwardVel = m.forwardVel + 0.064 end local rng15 = math.random() local rng16 = math.random() local rngV2 = ((rng15 - rng16) * 2) * ((((math.sqrt(s.Nply + 1) - 1) + 1) ^ 1.35) - 1) m.vel.y = (m.vel.y + rngV2 - 0.064) * Mply end end ---@param m MarioState function random4(m) if m.playerIndex ~= 0 then return end local rng11 = math.random() local rng12 = math.random() local rngE = ((rng11 - rng12) * 2) * s.Nply * 5 if m.faceAngle.y > 0 then m.faceAngle.y = (m.faceAngle.y + rngE + 0.5) else m.faceAngle.y = (m.faceAngle.y - rngE - 0.5) end end ---@param m MarioState function randomhealth(m) if m.playerIndex ~= 0 then return end local m = gMarioStates[0] local rng40 = math.random() * 3 local rng41 = math.random() local rng42 = math.random() local rng43 = math.random(-1, 1) if s.Nply > 3 then if s.catastrophic_failure_flag == true then return end m.health = m.health + math.floor(rng42 * (12 * (math.log(s.Nply, 1.35) - 4))) * rng43 end if s.catastrophic_failure_flag == true then if rng41 < (s.Nply / 128) then m.health = m.health - math.floor(rng40) end end end hook_event(HOOK_MARIO_UPDATE, randomhealth) local timer2 = 12 ---@param m MarioState function timerA(m) if m.playerIndex ~= 0 then return end if s.catastrophic_failure_flag == true then return end if s.Nply > 0.95 then if timer2 > 0 then timer2 = timer2 - 0.03 end if timer2 == 11.97 then play_sound(SOUND_MENU_MESSAGE_APPEAR, m.marioObj.header.gfx.cameraToObject) end end end local T3 = -800 local timer3 = 14 ---@param m MarioState function timerB(m) if m.playerIndex ~= 0 then return end if s.catastrophic_failure_flag == true then return end if s.Nply > 1.6 then if timer3 > 0 then timer3 = timer3 - 0.03 end if timer3 == 13.97 then play_sound(SOUND_MENU_MESSAGE_APPEAR, m.marioObj.header.gfx.cameraToObject) T3 = -800 end end end local timer6 = 14 ---@param m MarioState function timerE(m) if m.playerIndex ~= 0 then return end if s.catastrophic_failure_flag == true then return end if s.Nply > 3 then if timer6 > 0 then timer6 = timer6 - 0.03 end if timer6 == 13.97 then play_sound(SOUND_MENU_MESSAGE_APPEAR, m.marioObj.header.gfx.cameraToObject) T3 = -800 end end end hook_event(HOOK_MARIO_UPDATE, timerE) local T4 = 0 ---@param m MarioState function timerD(m) if m.playerIndex ~= 0 then return end if s.Nply > 0.95 then if timer2 > 2 then T3 = T3 + (T4 - T3) * 0.064 end end if s.Nply > 1.6 then if timer3 > 2 then T3 = T3 + (T4 - T3) * 0.064 end end if s.Nply > 2.5 then if timer6 > 2 then T3 = T3 + (T4 - T3) * 0.064 end end end local T1 = 20 local T2 = 0 ---@param m MarioState function transitionqtoRM(m) if m.playerIndex ~= 0 then return end if s.Nply >= 1.6 then if timer3 > 2 then T1 = T1 + (T2 - T1) * 0.021 else T1 = 0 end end end local shake = 0 local shakey = 0 ---@param m MarioState function shakefunction(m) if m.playerIndex ~= 0 then return end if doshake == true then if s.Nply >= 7 then shake = (math.random() - math.random()) * 7 shakey = (math.random() - math.random()) * 7 else shake = (math.random() - math.random()) * s.Nply shakey = (math.random() - math.random()) * s.Nply end end end local rancolor1 = 0 local rancolor2 = 0 local rancolor3 = 0 ---@param m MarioState function randomcolour(m) if m.playerIndex ~= 0 then return end if randomcolour == true then if s.Nply <= 7 then rancolor1 = math.random(0, math.floor(s.Nply * 35)) rancolor2 = math.random(0, math.floor(s.Nply * 35)) rancolor3 = math.random(0, math.floor(s.Nply * 35)) else rancolor1 = math.random(0, 255) rancolor2 = math.random(0, 255) rancolor3 = math.random(0, 255) end else rancolor1 = 0 rancolor2 = 0 rancolor3 = 0 end end local mult = 0 local rounded = 0 local NplyDT = tostring(0) local BNplyDT = tostring(0) local dp = math.tointeger(5) ---@param m MarioState function truncatezeros(m) function round(num, dp) mult = 10^(dp or 0) return math.floor(num * mult + 0.5) / mult end function removeTrailingZeros(num) return tostring(num):gsub("%.?0+$", "") end rounded = round(NplyD, dp) if (NplyD + 0.00025) >= s.Nply then NplyDT = removeTrailingZeros(rounded) else NplyDT = rounded end Brounded = round(BNplyD, dp) if (BNplyD + 0.00025) >= s.BNply then BNplyDT = removeTrailingZeros(Brounded) else BNplyDT = Brounded end end local var1 = 0 local var2 = 0 local var3 = 0 local var4 = 0 local var5 = 0 local var6 = 0 local var7 = 0 local var8 = 0 local var9 = 0 local var10 = 0 local var11 = 0 local var12 = 0 local var13 = 0 local var14 = 0 local var15 = 0 local var16 = 0 local starttimerflag = false local timerU = 0 local timerV = 0 local timerY = 0 local timerZ = 0 local timerF = 0 local timerG = 0 local timerH = 0 local timerI = 0 function blinktext() local m = gMarioStates[0] if s.catastrophic_failure_flag ~= true then if s.Nply >= 0.65 and s.Nply < 0.95 then if timerU < 247 then timerU = timerU + 1 if math.fmod(timerU, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end var1 = var1 + 12/57.296 var2 = math.sin(var1) end elseif s.Nply > 1.3 and s.Nply < 1.6 then if timerV < 247 then timerV = timerV + 1 if math.fmod(timerV, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end var5 = var5 + 12/57.296 var6 = math.sin(var5) end end if s.Nply > 2.5 and s.Nply < 3 then if timerF < 247 then timerF = timerF + 1 if math.fmod(timerF, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end var9 = var9 + 12/57.296 var10 = math.sin(var9) end end elseif s.catastrophic_failure_flag == true then if timerY < 247 then timerY = timerY + 1 if timerY <= 24 then if math.fmod(timerY, 4) == 1 then set_camera_pitch_shake(math.random(110), 120, math.random(2500)) set_camera_yaw_shake(math.random(1100), 120, math.random(2500)) set_camera_roll_shake(math.random(1100), 120, math.random(2500)) end var7 = var7 + 98.78/57.296 var8 = math.sin(var7) ^ 1.2 else if timerY == 25 then set_camera_pitch_shake(math.random(230), 160, math.random(2500)) set_camera_yaw_shake(math.random(230), 160, math.random(2500)) set_camera_roll_shake(math.random(230), 155, math.random(2500)) set_camera_pitch_shake(math.random(230), 80, math.random(2500)) set_camera_yaw_shake(math.random(230), 80, math.random(2500)) set_camera_roll_shake(math.random(230), 75, math.random(2500)) end var7 = var7 + 13.852/57.296 var8 = math.sin(var7) ^ 1.064 end end if s.doubletimeflag == true then if math.fmod(timerY, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end var7 = var7 + 12/57.296 var8 = math.sin(var7) ^ 1.064 end else var8 = 1 var7 = 0 end if s.doubletimeflag == true then if timerG < 247 then timerG = timerG + 1 if math.fmod(timerG, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end var11 = var11 + 24/57.296 var12 = math.sin(var11) ^ 1.064 else var12 = 1 var11 = 0 end end if s.removetimeflag == true then if timerH < 247 then timerH = timerH + 1 if timerH == 1 then play_sound(SOUND_GENERAL_RED_COIN, m.marioObj.header.gfx.cameraToObject) end if timerH > 35 then if math.fmod(timerH, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end end var13 = var13 + 24/57.296 var14 = math.sin(var13) ^ 1.064 else var14 = 1 var13 = 0 end end if s.displacementflag == true then if timerI < 247 then timerI = timerI + 1 if timerI > 35 then if math.fmod(timerI, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end end var15 = var15 + 24/57.296 var16 = math.sin(var15) ^ 1.064 else var15 = 0 var16 = 1 end end if s.starttimer > 0 then if timerZ < 110 then timerZ = timerZ + 1 if math.fmod(timerZ, 15) == 1 then play_sound(SOUND_GENERAL_COIN, m.marioObj.header.gfx.cameraToObject) end var3 = var3 + 24/57.296 var4 = math.sin(var3) ^ 0.64 else var4 = 1 var3 = 0 end end end hook_event(HOOK_UPDATE, blinktext) gGlobalSyncTable.gamerule_summon = true gGlobalSyncTable.catastrophic_failure = true gGlobalSyncTable.doubletimeuse = true gGlobalSyncTable.removetimeuse = true local show = true s.timerW = 0 local shake2 = 0 local shakey2 = 0 local shake3 = 0 local shakey3 = 0 local cirvarx = 0 local cirvary = 0 local cirvary2 = 0 local circlex = 0 local circley = 0 local circley2 = 0 local ranscale = 1 s.starttimer = 0 local counter1 = 0 local counter2 = 0 local counter3 = 0 local counter4 = 0 local counter5 = 0 local counter6 = 0 local counter7 = 0 local font = 2 local scale = 0.3 local N64DivideRes = 4.6 -- / N64DivideRes local Xorcolon = ':' local plusorminus = '+' local Bplusorminus = '+' local test2 = 0 function on_hud_render() djui_hud_set_font(font) djui_hud_set_resolution(RESOLUTION_N64) local m = gMarioStates[0] if m.capTimer > 0 then djui_hud_print_text(string.format("Cap:%.2f\"", m.capTimer / 30), 15 / N64DivideRes, 275 / N64DivideRes, 2.6 * scale) end if show == false then return end if showdebug == true then djui_hud_print_text(string.format("BufferA: %.5f", s.BA_Count), 255 / N64DivideRes, 325 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("BufferB: %.5f", s.BB_Count), 255 / N64DivideRes, 345 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("BufferZ: %.5f", s.BZ_Count), 255 / N64DivideRes, 365 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Buffercoincounter: %.5f", s.Bcoincount), 255 / N64DivideRes, 385 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Bufferhurtcounter: %.5f", s.Bhurtcount), 255 / N64DivideRes, 405 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Bufferdistancecounter: %.5f", s.BdistanceT), 255 / N64DivideRes, 425 / N64DivideRes, 1 * scale) djui_hud_set_color(208, 255, 158, 255) djui_hud_print_text(string.format("Mply: %.5f", Mply), 15 / N64DivideRes, 280 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("(Nply is the randomness multiplier)"), 15 / N64DivideRes, 300 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Oply: %.5f", Oply), 15 / N64DivideRes, 320 / N64DivideRes, 1 * scale) djui_hud_set_color(218, 241, 239, 255) djui_hud_print_text(string.format("Inc: %.5f", Inc), 15 / N64DivideRes, 350 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("rInc: %.5f", RandomIncrement), 15 / N64DivideRes, 370 / N64DivideRes, 1 * scale) djui_hud_set_color(231, 251, 179, 255) djui_hud_print_text(string.format("A: %.5f", s.A_Count), 15 / N64DivideRes, 400 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("B: %.5f", s.B_Count), 15 / N64DivideRes, 420 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Z: %.5f", s.Z_Count), 15 / N64DivideRes, 440 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Coins: %.5f", s.coincount), 15 / N64DivideRes, 460 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Stars: (check star count)"), 15 / N64DivideRes, 480 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Distance Travelled: %.5f", s.distanceT), 15 / N64DivideRes, 500 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Damage Taken: %.5f", s.hurtcount), 15 / N64DivideRes, 520 / N64DivideRes, 1 * scale) djui_hud_set_color(255, 255, 255, 255) if gGlobalSyncTable.gamerule_summon == true then djui_hud_set_color(207, 251, 207, 255) djui_hud_print_text(string.format("Bob-ombs spawned: %.0f", counter1), 15 / N64DivideRes, 530 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Bob-omb Buddies spawned: %.0f", counter2), 15 / N64DivideRes, 550 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Goombas spawned: %.0f", counter3), 15 / N64DivideRes, 570 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Yellow Coins spawned: %.0f", counter4), 15 / N64DivideRes, 590 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Blue Coins spawned: %.0f", counter5), 15 / N64DivideRes, 610 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Boos spawned: %.0f", counter6), 15 / N64DivideRes, 630 / N64DivideRes, 1 * scale) djui_hud_print_text(string.format("Cork Boxes spawned: %.0f", counter7), 15 / N64DivideRes, 650 / N64DivideRes, 1 * scale) djui_hud_set_color(255, 255, 255, 255) end end djui_hud_set_color(255 - rancolor1, 255 - rancolor2, 255 - rancolor3, 255) if NplyI <= 1 then if NplyD < 1 then djui_hud_print_text(string.format("?: %s%s", NplyDT, Xorcolon), (15 + shake) / N64DivideRes, (700 + shakey) / N64DivideRes, (1 + NplyD) * scale) else djui_hud_print_text(string.format("?: %s%s", NplyDT, Xorcolon), (15 + shake) / N64DivideRes, (700 + shakey) / N64DivideRes, 2 * scale) end elseif NplyI <= 1.6 then djui_hud_print_text(string.format("?: %s%s", NplyDT, Xorcolon), (15 + shake) / N64DivideRes, (700 + shakey) / N64DivideRes, 2 * scale) else djui_hud_print_text(string.format("Randomness Multiplier"), (15 - (T1 * 12) + (shakey / 2)) / N64DivideRes, (664 + (shake / 2)) / N64DivideRes, 1.4 * scale) djui_hud_print_text(string.format("%s%s", NplyDT, Xorcolon), (15 + (T1 * 3) + (shake / 2)) / N64DivideRes, (700 + (shakey / 2)) / N64DivideRes, 2 * scale) end if BNplyD > 0.00001 then if NplyD <= 1 then djui_hud_print_text(string.format("'-%s%s'", BNplyDT, Xorcolon), (15 + shake) / N64DivideRes, (800 + shakey) / N64DivideRes, (0.82 + NplyD) * scale) else djui_hud_print_text(string.format("'-%s%s'", BNplyDT, Xorcolon), (15 + shake) / N64DivideRes, (800 + shakey) / N64DivideRes, 1.82 * scale) end end if math.abs(NplyA) > 0.00000164 then if NplyA < 0 then if NplyD < 1 then if 15 + (math.abs(NplyA) ^ 0.35 * -64) + (shake / 3.5) < 0 then djui_hud_print_text(string.format("%.5f%s", NplyA, Xorcolon), 0, (720 + (NplyD * 30) + (shakey / 3.5)) / N64DivideRes, (0.82 + NplyD) * scale) else djui_hud_print_text(string.format("%.5f%s", NplyA, Xorcolon), (15 + (math.abs(NplyA) ^ 0.35 * -64) + (shake / 3.5)) / N64DivideRes, (720 + (NplyD * 30) + (shakey / 3.5)) / N64DivideRes, (0.82 + NplyD) * scale) end else if 15 + (math.abs(NplyA) ^ 0.35 * -64) + (shake / 3.5) < 0 then djui_hud_print_text(string.format("%.5f%s", NplyA, Xorcolon), 0, (750 + (shakey / 3.5)) / N64DivideRes, 1.82 * scale) else djui_hud_print_text(string.format("%.5f%s", NplyA, Xorcolon), (15 + (math.abs(NplyA) ^ 0.35 * -64) + (shake / 3.5)) / N64DivideRes, (750 + (shakey / 3.5)) / N64DivideRes, 1.82 * scale) end end else if NplyD < 1 then djui_hud_print_text(string.format("%s%.5f%s", plusorminus, NplyA, Xorcolon), (15 + (math.abs(NplyA) ^ 0.35 * 64) + (shake / 3.5)) / N64DivideRes, (720 + (NplyD * 30) + (shakey / 3.5)) / N64DivideRes, (0.82 + NplyD) * scale) else djui_hud_print_text(string.format("%s%.5f%s", plusorminus, NplyA, Xorcolon), (15 + (math.abs(NplyA) ^ 0.35 * 64) + (shake / 3.5)) / N64DivideRes, (750 + (shakey / 3.5)) / N64DivideRes, 1.82 * scale) end end end if math.abs(BNplyA) > 0.0000164 then if NplyD < 1 then if 15 + (math.abs(BNplyA) ^ 0.35 * -64) + (shake / 3.5) < 0 then djui_hud_print_text(string.format("(%s%.5f%s)", Bplusorminus, BNplyA, Xorcolon), 0, (850 + (shakey / 3.5)) / N64DivideRes, (0.64 + NplyD) * scale) else djui_hud_print_text(string.format("(%s%.5f%s)", Bplusorminus, BNplyA, Xorcolon), (15 + (math.abs(BNplyA) ^ 0.35 * -64) + (shake / 3.5)) / N64DivideRes, (850 + (shakey / 3.5)) / N64DivideRes, (0.64 + NplyD) * scale) end else if 15 + (math.abs(BNplyA) ^ 0.35 * -64) + (shake / 3.5) < 0 then djui_hud_print_text(string.format("(%s%.5f%s)", Bplusorminus, BNplyA, Xorcolon), 0, (850 + (shakey / 3.5)) / N64DivideRes, 1.64 * scale) else djui_hud_print_text(string.format("(%s%.5f%s)", Bplusorminus, BNplyA, Xorcolon), (15 + (math.abs(BNplyA) ^ 0.35 * -64) + (shake / 3.5)) / N64DivideRes, (850 + (shakey / 3.5)) / N64DivideRes, 1.64 * scale) end end end if s.starttimer > 0 then if math.floor(s.starttimer / 1800) > 0.03 then djui_hud_set_color(255, 255, 255, var4 * 255) djui_hud_print_text(string.format("??? in %.0f'%.0f\"...", math.floor(s.starttimer / 1800), (s.starttimer / 30) % 60), 15 / N64DivideRes, 625 / N64DivideRes, 1.4 * scale) else djui_hud_set_color(255, 255, 255, var4 * 255) djui_hud_print_text(string.format("??? in %.0f\"...", (s.starttimer / 30) % 60), 15 / N64DivideRes, 625 / N64DivideRes, 1.4 * scale) end end if s.catastrophic_failure_flag == true then djui_hud_set_color(255, 255, 255, math.abs(255 * var8)) djui_hud_print_text(string.format("Catastrophic Failure!"), (15 + (shake2 / 2)) / N64DivideRes, (620 + (shakey2 / 2)) / N64DivideRes, 1.4 * scale * ranscale) if math.floor(((s.timeacc - s.timerW) / 1800)) > 0 then djui_hud_print_text(string.format("Stopping in %.0f'%.0f\"...", math.floor(((s.timeacc - s.timerW) / 1800)), ((s.timeacc - s.timerW) / 30) % 60), (15 + (shakey3 / 2)) / N64DivideRes, (800 + (shake3 / 2)) / N64DivideRes, 1.4 * scale * ranscale) else djui_hud_print_text(string.format("Stopping in %.0f\"...", ((s.timeacc - s.timerW) / 30)), (15 + (shakey3 / 2)) / N64DivideRes, (800 + (shake3 / 2)) / N64DivideRes, 1.4 * scale * ranscale) end end if s.doubletimeflag == true then djui_hud_set_color(255, 255, 255, math.abs(255 * var12)) djui_hud_print_text(string.format("Double Multiplier Increase!"), (15 + circlex) / N64DivideRes, (625 + circley) / N64DivideRes, 1.4 * scale * ranscale) if math.floor(((s.timeacc - s.timerW) / 1800)) > 0 then djui_hud_print_text(string.format("Stopping in %.0f'%.0f\"...", math.floor(((s.timeacc - s.timerW) / 1800)), ((s.timeacc - s.timerW) / 30) % 60), (15 - circlex) / N64DivideRes, (835 - circley2) / N64DivideRes, 1.4 * scale * ranscale) else djui_hud_print_text(string.format("Stopping in %.0f\"...", ((s.timeacc - s.timerW) / 30)), (15 - circlex) / N64DivideRes, (835 - circley2) / N64DivideRes, 1.4 * scale * ranscale) end end if s.removetimeflag == true then djui_hud_set_color(255, 255, 255, math.abs(255 * var14)) djui_hud_print_text(string.format("A Multiplier Decrease Event!"), (15 + circlex) / N64DivideRes, (625 + circley) / N64DivideRes, 1.4 * scale * ranscale) if math.floor(((s.timeacc - s.timerW) / 1800)) > 0 then djui_hud_print_text(string.format("Stopping in %.0f'%.0f\"...", math.floor(((s.timeacc - s.timerW) / 1800)), ((s.timeacc - s.timerW) / 30) % 60), (15 - circlex) / N64DivideRes, (835 - circley2) / N64DivideRes, 1.4 * scale * ranscale) else djui_hud_print_text(string.format("Stopping in %.0f\"...", ((s.timeacc - s.timerW) / 30)), (15 - circlex) / N64DivideRes, (835 - circley2) / N64DivideRes, 1.4 * scale * ranscale) end end if s.displacementflag == true then djui_hud_set_color(255, 255, 255, math.abs(255 * var16)) djui_hud_print_text(string.format("Unknown... About Displacement."), (15 + circlex) / N64DivideRes, (625 + circley) / N64DivideRes, 1.4 * scale * ranscale) if math.floor(((s.timeacc - s.timerW) / 1800)) > 0 then djui_hud_print_text(string.format("Stopping in %.0f'%.0f\"...", math.floor(((s.timeacc - s.timerW) / 1800)), ((s.timeacc - s.timerW) / 30) % 60), (15 - circlex) / N64DivideRes, (835 - circley2) / N64DivideRes, 1.4 * scale * ranscale) else djui_hud_print_text(string.format("Stopping in %.0f\"...", ((s.timeacc - s.timerW) / 30)), (15 - circlex) / N64DivideRes, (835 - circley2) / N64DivideRes, 1.4 * scale * ranscale) end end djui_hud_set_color(255, 255, 255, math.abs(255 * var2)) if s.catastrophic_failure_flag == true then return end if s.Nply >= 0.65 then if s.Nply < 0.95 then if s.RMSetting == 1 then djui_hud_print_text(string.format("%.2f%s until...", Nply3, Xorcolon), 15 / N64DivideRes, (765 + (NplyD * 30)) / N64DivideRes, (1.6 + (NplyD / 16)) * scale) end end end djui_hud_set_color(255, 255, 255, math.abs(255 * var6)) if s.Nply >= 1.3 then if s.Nply < 1.6 then if s.RMSetting == 1 then djui_hud_print_text(string.format("%.2f%s until...", Nply3, Xorcolon), 15 / N64DivideRes, 800 / N64DivideRes, 1.7 * scale) end end end djui_hud_set_color(255, 255, 255, math.abs(255 * var10)) if s.Nply >= 2.5 then if s.Nply < 3 then if s.RMSetting == 1 then djui_hud_print_text(string.format("%.2f%s until...", Nply3, Xorcolon), 15 / N64DivideRes, 800 / N64DivideRes, 1.7 * scale) end end end djui_hud_set_color(255, 255, 255, 255) if s.Nply >= 0.95 then if s.RMSetting == 1 then if timer2 > 2 then if s.Nply < 1.3 then if s.Nply <= 1 then djui_hud_print_text(string.format("Something is changing velocity..."), (15 + T3) / N64DivideRes, (760 + (s.Nply * 30)) / N64DivideRes, (1.45 + (NplyD / 20)) * scale) else djui_hud_print_text(string.format("Something is changing velocity..."), (15 + T3) / N64DivideRes, 795 / N64DivideRes, 1.5 * scale) end end end end end if s.Nply >= 1.6 then if s.RMSetting == 1 then if timer3 > 2 then djui_hud_print_text(string.format("Something else now affects your randomness multiplier..."), (15 + T3) / N64DivideRes, 795 / N64DivideRes, 1.5 * scale) end end end if s.Nply >= 3 then if s.RMSetting == 1 then if timer6 > 2 then djui_hud_print_text(string.format("Watch your health!"), (15 + T3) / N64DivideRes, 795 / N64DivideRes, 1.5 * scale) end end end if s.Nply >= 5 then if s.Nply < 7 then if s.RMSetting == 1 then djui_hud_print_text(string.format("Multiplier left until", Nply2, Xorcolon), 15 / N64DivideRes, 860 / N64DivideRes, 1.7 * scale) djui_hud_print_text(string.format("eventual doom: %.5f%s", Nply2, Xorcolon), 15 / N64DivideRes, 890 / N64DivideRes, 1.7 * scale) end end end if s.Nply >= 7 then if s.RMSetting == 1 then djui_hud_print_text(string.format("Time until", timer1), 15 / N64DivideRes, 860 / N64DivideRes, 1.7 * scale) if timer1 <= 60 then djui_hud_print_text(string.format("eventual doom: %.2f\"", timer1), 15 / N64DivideRes, 890 / N64DivideRes, 1.7 * scale) else djui_hud_print_text(string.format("eventual doom: %.0f'%.2f\"", (timer1 / 60 - 60/120), (timer1 % 60)), 15 / N64DivideRes, 890 / N64DivideRes, 1.7 * scale) end end end end ---@param msg string function randomisercommands(msg) if string.lower(msg) == 'hide' then show = false return true elseif string.lower(msg) == 'show' then show = true return true else djui_chat_message_create("Not that! Use a valid answer.") return true end end function split(s) local result = {} for match in (s):gmatch(string.format("[^%s]+", " ")) do table.insert(result, match) end return result end ---@param msg string function design(msg) args = split(msg) if args[1] == 'shaking' then if args[2] == 'true' then doshake = true return true elseif args[2] == 'false' then doshake = false return true else djui_chat_message_create("/rmdesign \\#17ae7b\\[shaking \\#17de4b\\[true / false]\\#17ae7b\\]") return true end elseif args[1] == 'color' then if args[2] == 'random' then if args[3] == 'true' then randomcolour = true return true elseif args[3] == 'false' then randomcolour = false return true else djui_chat_message_create("/rmdesign \\#17ae7b\\[color \\#17de4b\\[random \\#84db96\\[true / false]\\#17de4b\\]\\#17ae7b\\]") return true end else djui_chat_message_create("/rmdesign \\#17ae7b\\[color \\#17de4b\\[random]\\#17ae7b\\]") return true end elseif args[1] == 'font' then if args[2] == 'hud' then font = 2 scale = 1.5 Xorcolon = ':' return true elseif args[2] == 'text' then font = 0 scale = 1 Xorcolon = 'x' return true elseif args[2] == 'djui' then font = 1 scale = 0.564 Xorcolon = 'x' return true else djui_chat_message_create("/rmdesign \\#17ae7b\\[font \\#17de4b\\[hud / text / djui]\\#17ae7b\\]") return true end elseif args[1] == 'precision' then if math.tointeger(args[2]) ~= nil then if tonumber(args[2]) <= 32 then if tonumber(args[2]) >= 0 then dp = math.tointeger(args[2]) return true else djui_chat_message_create("Please input an integer 0-32.") return true end else djui_chat_message_create("Please input an integer 0-32.") return true end else djui_chat_message_create("/rmdesign \\#17ae7b\\[precision \\#17de4b\\(integer number, 0-32)\\#17ae7b\\] \\#ffffff\\- Note: Make sure the number you're inputting is an integer, like 28, not 9.2.") return true end elseif args[1] == 'updater' then if args[2] == 'justbarelynotstagnant' then updatespeed = 0.00001 elseif args[2] == 'nearlystagnant' then updatespeed = 0.001 elseif args[2] == 'veryslow' then updatespeed = 0.035 elseif args[2] == 'slow' then updatespeed = 0.12 elseif args[2] == 'normal' then updatespeed = 0.28 elseif args[2] == 'fast' then updatespeed = 0.42 elseif args[2] == 'veryfast' then updatespeed = 0.64 elseif args[2] == 'instant' then updatespeed = 1 else djui_chat_message_create("/rmdesign \\#17ae7b\\[updater \\#17de4b\\[justbarelynotstagnant / nearlystagnant / veryslow / slow / normal / fast / veryfast / instant]\\#17ae7b\\]\\#ffffff\\ - if you don't know what this does, this sets the speed at which the randomiser multiplier tries updating to it's true value. Instant means the randomiser multiplier is at it's true value.") end else djui_chat_message_create("Not that! Use a valid answer.") return true end end ---@param msg string function rmV(msg) if tonumber(msg) ~= nil then s.RMSetting = 0 s.Nply = tonumber(msg) return true elseif string.lower(msg) == 'incremental' then s.RMSetting = 1 s.Nply = 0 return true elseif string.lower(msg) == 'reset' then s.A_Count = 0 s.B_Count = 0 s.Z_Count = 0 s.coincount = 0 s.distanceT = 0 s.hurtcount = 0 s.BA_Count = 0 s.BB_Count = 0 s.BZ_Count = 0 s.Bcoincount = 0 s.Bhurtcount = 0 s.BdistanceT = 0 djui_chat_message_create("All rm base values (except stars... Obviously!) removed! The multiplier may have decreased!") timer1 = 16.93 return true elseif string.lower(msg) == 'increase' then s.A_Count = s.A_Count * 1.618 return true else djui_chat_message_create("Not that! Use a valid answer.") return true end end local spawnflag1 = false local spawnflag2 = false local spawnflag3 = false local spawnflag4 = false local spawnflag5 = false local spawnflag6 = false local spawnflag7 = false local rng24 = 0 local rng25 = 0 local rng21 = 0 s.rarity2 = 128064 ---@param o Object function summonenemies(o) local m = gMarioStates[0] if gGlobalSyncTable.gamerule_summon == true then local rng18 = math.random() local rng19 = math.random() local rng20 = math.random() local rng22 = math.random() local rng23 = math.random() local rng36 = math.random() local rng37 = math.random() if test2 < 32 then rng24 = math.random(-32768, 32767) rng25 = math.random(-32768, 32767) rng21 = math.random(0, math.random(0, 1024)) + find_floor_height(rng24, math.random(-16384, 32767), rng25) elseif test2 < 64 then rng24 = math.random(-16384, 16383) rng25 = math.random(-16384, 16383) rng21 = math.random(0, math.random(0, 1024)) + find_floor_height(rng24, math.random(-8192, 32767), rng25) elseif test2 < 96 then rng24 = math.random(-8192, 8191) rng25 = math.random(-8192, 8191) rng21 = math.random(0, math.random(0, 512)) + find_floor_height(rng24, math.random(-4096, 16383), rng25) elseif test2 < 256 then rng24 = math.random(math.floor(-32768 / (2 ^ (test2 / 32))), math.floor(32767 / (2 ^ (test2 / 32)))) rng25 = math.random(math.floor(-32768 / (2 ^ (test2 / 32))), math.floor(32767 / (2 ^ (test2 / 32)))) rng21 = math.random(0, math.random(0, 1024)) + find_floor_height(rng24, math.random(math.floor((-16384 / (2 ^ (test2 / 32)))), math.floor(32767 / (2 ^ (test2 / 64)))), rng25) else test2 = 0 spawnflag1 = false spawnflag2 = false spawnflag3 = false spawnflag4 = false spawnflag5 = false spawnflag6 = false spawnflag7 = false end local checkOOB = find_floor_height(rng24, rng21, rng25) if rng18 < (s.Nply / s.rarity2) then spawnflag1 = true end if rng19 < (s.Nply / s.rarity2) then spawnflag2 = true end if rng20 < (s.Nply / s.rarity2) then spawnflag3 = true end if rng22 < (s.Nply / s.rarity2) then spawnflag4 = true end if rng23 < (s.Nply / (s.rarity2 * 2.50148863068)) then spawnflag5 = true end if rng36 < (s.Nply / s.rarity2) then spawnflag6 = true end if rng37 < (s.Nply / s.rarity2) then spawnflag7 = true end if s.Nply <= 1200 then if spawnflag1 == true then if checkOOB == nil or checkOOB < -16000 then log_to_console("Prevented spawn because of out of bounds!") test2 = test2 + 1 else spawn_sync_object(id_bhvBobomb, E_MODEL_BLACK_BOBOMB, rng24, rng21, rng25, function(o) network_init_object(o, true, {"oAction", "oAnimState"}) end) counter1 = counter1 + 1 test2 = 0 spawnflag1 = false end end if spawnflag2 == true then if checkOOB == nil or checkOOB < -8000 then log_to_console("Prevented spawn because of out of bounds!") test2 = test2 + 1 else spawn_sync_object(id_bhvBobomb, E_MODEL_BOBOMB_BUDDY, rng24, rng21, rng25, function(o) network_init_object(o, true, {"oAction", "oAnimState"}) end) counter2 = counter2 + 1 test2 = 0 spawnflag2 = false end end if spawnflag3 == true then if checkOOB == nil or checkOOB < -8000 then log_to_console("Prevented spawn because of out of bounds!") test2 = test2 + 1 else spawn_sync_object(id_bhvGoomba, E_MODEL_GOOMBA, rng24, rng21, rng25, function(o) network_init_object(o, true, {"oAction", "oAnimState"}) end) counter3 = counter3 + 1 test2 = 0 spawnflag3 = false end end if spawnflag4 == true then if checkOOB == nil or checkOOB < -8000 then log_to_console("Prevented spawn because of out of bounds!") test2 = test2 + 1 else spawn_sync_object(id_bhvMovingYellowCoin, E_MODEL_YELLOW_COIN_NO_SHADOW, rng24, rng21, rng25, function(o) network_init_object(o, true, {"oAction", "oAnimState"}) end) counter4 = counter4 + 1 test2 = 0 spawnflag4 = false end end if spawnflag5 == true then if checkOOB == nil or checkOOB < -8000 then log_to_console("Prevented spawn because of out of bounds!") test2 = test2 + 1 else spawn_sync_object(id_bhvMovingBlueCoin, E_MODEL_BLUE_COIN, rng24, rng21, rng25, function(o) network_init_object(o, true, {"oAction", "oAnimState"}) end) counter5 = counter5 + 1 test2 = 0 spawnflag5 = false end end if spawnflag6 == true then if checkOOB == nil or checkOOB < -8000 then log_to_console("Prevented spawn because of out of bounds!") test2 = test2 + 1 else spawn_sync_object(id_bhvBoo, E_MODEL_BOO, rng24, (rng21 / 3.313), rng25, function(o) network_init_object(o, true, {"oAction", "oAnimState"}) end) counter6 = counter6 + 1 test2 = 0 spawnflag6 = false end end if spawnflag7 == true then if checkOOB == nil or checkOOB < -8000 then log_to_console("Prevented spawn because of out of bounds!") test2 = test2 + 1 else spawn_sync_object(id_bhvBreakableBoxSmall, E_MODEL_BREAKABLE_BOX_SMALL, rng24, rng21, rng25, function(o) network_init_object(o, true, {"oAction", "oAnimState"}) end) counter7 = counter7 + 1 test2 = 0 spawnflag7 = false end end end end end local rng35 = 0 local rng38 = 0 local rng39 = 0 local rng20 = 0 local rng22 = 1 local var5 = 640 local timer5 = 0 local timer7 = 0 local starttimersetflag = true local startflag = false s.rarity1 = 164000 s.starttimerset1 = 360 s.eventlength = 5200 s.cooldowntimer1 = 60 s.randomeventsflag = true function randomevents() if s.randomeventsflag == true then timer7 = timer7 + 1 if timer7 == 64 then timer7 = 0 rng22 = math.random(1, 2) end ranscale = 1 + (rng35 - rng38) / 512 shake2 = (math.random() - math.random()) * 15 shake3 = (math.random() - math.random()) * 15 shakey2 = (math.random() - math.random()) * 15 shakey3 = (math.random() - math.random()) * 15 if rng22 == 1 then cirvarx = cirvarx + 8/57.2958 circlex = (math.sin(cirvarx) * 10) cirvary = cirvary + 8/57.2958 circley = (math.cos(cirvary) * 10) cirvary2 = cirvary2 + 8/57.2958 circley2 = (math.cos(cirvary2) * 10) elseif rng22 == 2 then cirvarx = cirvarx - 8/57.2958 circlex = (math.sin(cirvarx) * 10) cirvary = cirvary - 8/57.2958 circley = (math.cos(cirvary) * 10) cirvary2 = cirvary2 - 8/57.2958 circley2 = (math.cos(cirvary2) * 10) end if circley2 > 5 then circley2 = 5 end if circley > 5 then circley = 5 end end if network_is_server() then if s.randomeventsflag == true then if s.catastrophic_failure_flag == true then return end if s.doubletimeflag == true then return end if s.removetimeflag == true then return end if s.displacementflag == true then return end if starttimerflag == true then return end if s.cooldowntimer1 < 3 then if starttimersetflag == true then if math.random() < (1 + math.log(s.Nply, 6.4)) / s.rarity1 then startflag = true end end end if startflag == true then s.rng121 = math.random(4) starttimerflag = true s.starttimer = math.random(s.starttimerset1, s.starttimerset1 * 5) s.timeacc = math.random(math.random(64, s.eventlength), s.eventlength) starttimersetflag = false startflag = false end if s.cooldowntimer1 > 1 then s.cooldowntimer1 = s.cooldowntimer1 - 1 end end end end hook_event(HOOK_UPDATE, randomevents) function displacementevent() local m = gMarioStates[0] if network_is_server() then if s.rng121 == 1 then return end if s.rng121 == 2 then return end if s.rng121 == 3 then return end if s.displacementflag == true then if s.timerW <= s.timeacc then s.timerW = s.timerW + 1 rng122 = math.random(1, 100) s.div1 = math.floor(69420 / 96) - rng122 if Oply > 1 then set_camera_pitch_shake(math.random(560), math.random(10, 300), math.random(5600)) set_camera_pitch_shake(math.random(560), math.random(10, 300), math.random(5600)) set_camera_pitch_shake(math.random(560), math.random(10, 300), math.random(5600)) set_camera_yaw_shake(math.random(560), math.random(10, 300), math.random(5600)) set_camera_yaw_shake(math.random(560), math.random(10, 300), math.random(5600)) set_camera_roll_shake(math.random(560), math.random(10, 300), math.random(5600)) set_camera_roll_shake(math.random(560), math.random(10, 300), math.random(5600)) end elseif s.timerW >= s.timeacc then play_sound(SOUND_OBJ_CANNON3, m.marioObj.header.gfx.cameraToObject) s.displacementflag = false starttimersetflag = true s.cooldowntimer1 = 11520 s.timerW = 0 timerI = 0 s.div1 = 69420 end end if starttimerflag == true then s.starttimer = s.starttimer - 1 if s.starttimer <= 0 then s.displacementflag = true starttimerflag = false end end end end hook_event(HOOK_UPDATE, displacementevent) function removetime() local m = gMarioStates[0] if network_is_server() then if s.rng121 == 1 then return end if s.rng121 == 2 then return end if s.rng121 == 4 then return end if s.removetimeflag == true then if s.timerW <= s.timeacc then s.timerW = s.timerW + 1 s.mult2 = -1 * (math.random() * 3.14159265359 * (math.sqrt(s.Nply + 1) - 1)) elseif s.timerW >= s.timeacc then play_sound(SOUND_OBJ_CANNON3, m.marioObj.header.gfx.cameraToObject) s.removetimeflag = false starttimersetflag = true s.cooldowntimer1 = 11520 s.timerW = 0 timerH = 0 s.mult2 = 1 end end if starttimerflag == true then s.starttimer = s.starttimer - 1 if s.starttimer <= 0 then s.removetimeflag = true starttimerflag = false end end end end hook_event(HOOK_UPDATE, removetime) function doubletime() local m = gMarioStates[0] if network_is_server() then if s.rng121 == 1 then return end if s.rng121 == 3 then return end if s.rng121 == 4 then return end if s.doubletimeflag == true then if s.timerW <= s.timeacc then s.timerW = s.timerW + 1 s.mult2 = 2 * (math.random() + 0.64) elseif s.timerW >= s.timeacc then play_sound(SOUND_OBJ_CANNON3, m.marioObj.header.gfx.cameraToObject) s.doubletimeflag = false starttimersetflag = true s.cooldowntimer1 = 11520 s.timerW = 0 timerG = 0 s.mult2 = 1 end end if starttimerflag == true then s.starttimer = s.starttimer - 1 if s.starttimer <= 0 then s.doubletimeflag = true starttimerflag = false end end end end hook_event(HOOK_UPDATE, doubletime) function catastropicfail() local m = gMarioStates[0] if s.rng121 == 2 then return end if s.rng121 == 3 then return end if s.rng121 == 4 then return end if s.catastrophic_failure_flag == true then if s.timerW <= s.timeacc then if math.random() < 1/164 then if timer5 <= 0 then timer5 = math.random(16, 128) else timer5 = timer5 + math.random(8, 64) end end if timer5 > 0 then timer5 = timer5 - 1 var5 = 64 else var5 = 640 end if math.random() < 1/var5 * (1 + math.log(s.Nply, 2)) then rng20 = math.random(3) rng27 = math.random(64) rng28 = math.random(4) if rng20 == 1 then play_sound(SOUND_OBJ_CANNON4, m.marioObj.header.gfx.cameraToObject) set_camera_pitch_shake(math.random(2800), 160, math.random(2500)) set_camera_pitch_shake(math.random(2300), 80, math.random(2500)) set_camera_pitch_shake(math.random(2300), math.random(10, 300), math.random(2500)) set_camera_yaw_shake(math.random(800), 160, math.random(2500)) set_camera_yaw_shake(math.random(800), 80, math.random(2500)) set_camera_roll_shake(math.random(800), 160, math.random(2500)) set_camera_roll_shake(math.random(800), 80, math.random(2500)) elseif rng20 == 2 then play_sound(SOUND_OBJ_POUNDING1, m.marioObj.header.gfx.cameraToObject) set_camera_yaw_shake(math.random(2800), 160, math.random(2500)) set_camera_yaw_shake(math.random(2300), 80, math.random(2500)) set_camera_yaw_shake(math.random(2300), math.random(10, 300), math.random(2500)) set_camera_pitch_shake(math.random(1200), 160, math.random(2500)) set_camera_pitch_shake(math.random(1200), 80, math.random(2500)) set_camera_roll_shake(math.random(1200), 160, math.random(2500)) set_camera_roll_shake(math.random(1200), 80, math.random(2500)) elseif rng20 == 3 then play_sound(SOUND_OBJ_POUNDING_CANNON, m.marioObj.header.gfx.cameraToObject) set_camera_roll_shake(math.random(2800), 160, math.random(25000)) set_camera_roll_shake(math.random(2300), 80, math.random(25000)) set_camera_roll_shake(math.random(2300), math.random(10, 300), math.random(2500)) set_camera_yaw_shake(math.random(800), 160, math.random(2500)) set_camera_yaw_shake(math.random(800), 80, math.random(2500)) set_camera_pitch_shake(math.random(800), 160, math.random(2500)) set_camera_pitch_shake(math.random(800), 80, math.random(2500)) end if rng27 == 1 then m.faceAngle.y = m.faceAngle.y + math.random(-5000, 5000) if rng28 <= 4 then m.forwardVel = m.forwardVel + math.random(12, 20) else m.forwardVel = m.forwardVel - math.random(-20, -12) end m.vel.y = m.vel.y + math.random(-32, 32) if rng28 == 1 then set_mario_action(m, ACT_HARD_BACKWARD_AIR_KB, 0) elseif rng28 == 2 then set_mario_action(m, ACT_HARD_FORWARD_AIR_KB, 0) elseif rng28 == 3 then set_mario_action(m, ACT_BACKWARD_AIR_KB, 0) elseif rng28 == 4 then set_mario_action(m, ACT_FORWARD_AIR_KB, 0) end end end end end if network_is_server() then if s.rng121 == 2 then return end if gGlobalSyncTable.catastrophic_failure ~= true then return end if s.catastrophic_failure_flag == true then if s.timerW <= s.timeacc then s.timerW = s.timerW + 1 rng35 = math.random() rng38 = math.random() rng39 = 3 + (2 * math.random()) s.mult1 = rng39 + (rng35 - rng38) elseif s.timerW >= s.timeacc then NplyD = s.Nply play_sound(SOUND_OBJ_CANNON3, m.marioObj.header.gfx.cameraToObject) s.catastrophic_failure_flag = false starttimersetflag = true s.mult1 = 1 s.Nply = 0 s.cooldowntimer1 = 11520 s.timerW = 0 timerY = 0 end end if starttimerflag == true then s.starttimer = s.starttimer - 1 if s.starttimer <= 0 then s.catastrophic_failure_flag = true starttimerflag = false end end end end hook_event(HOOK_UPDATE, catastropicfail) timerX = 1 function updatemusiconCF() if s.catastrophic_failure_flag == true then fade_volume_scale(0, 0, 5) play_secondary_music(0x11, 120, 120, 2) timerX = 1 else if timerX > 0 then timerX = timerX - 1 stop_secondary_music(60) fade_volume_scale(0, 255, 60) play_music(0, get_current_background_music(), 60) end end end if s.catastrophic_failure_flag == true then hook_event(HOOK_ON_WARP, updatemusiconCF) else hook_event(HOOK_UPDATE, updatemusiconCF) end ---@param msg string function rmM(msg) args = split(msg) if args[1] == 'summon' then if args[2] == 'false' then gGlobalSyncTable.gamerule_summon = false djui_chat_message_create("Random entity spawning is \\#ef2a2a\\off\\#ffffff\\!") return true elseif args[2] == 'true' then gGlobalSyncTable.gamerule_summon = true djui_chat_message_create("Random entity spawning is \\#2aef2a\\on\\#ffffff\\!") return true elseif args[2] == 'rarity' then if math.tointeger(args[3]) ~= nil then if tonumber(args[3]) >= 64 and tonumber(args[3]) <= 16777216 then s.rarity2 = tonumber(args[3]) return true else djui_chat_message_create("Please input an integer 64-16777216.") return true end else djui_chat_message_create("/rmmods \\#17ae7b\\[summon \\#17de4b\\[rarity \\#84db96\\(integer number 64-16,777,216)\\#17de4b\\]\\#17ae7b\\]\\#ffffff\\ - This sets the rarity something may spawn in a if rng < 1/n formula, so the lower numbers are gooing to spawn more.") return true end else djui_chat_message_create("/rmmods \\#17ae7b\\[summon \\#17de4b\\[false / true / rarity\\#17ae7b\\] \\#ffffff\\") return true end elseif args[1] == 'events' then if args[2] == 'false' then s.randomeventsflag = false djui_chat_message_create("Random events \\#ef2a2a\\may not\\#ffffff\\ appear!") return true elseif args[2] == 'true' then s.randomeventsflag = true djui_chat_message_create("Random events \\#2aef2a\\may\\#ffffff\\ appear!") return true elseif args[2] == 'start' then if args[3] == '1' then s.rng121 = 1 starttimerflag = true s.starttimer = 64 s.timeacc = math.random(math.random(64, s.eventlength), s.eventlength) starttimersetflag = false startflag = false return true elseif args[3] == '2' then s.rng121 = 2 starttimerflag = true s.starttimer = 64 s.timeacc = math.random(math.random(64, s.eventlength), s.eventlength) s.timerW = 34039402 starttimersetflag = false startflag = false return true elseif args[3] == '3' then s.rng121 = 3 starttimerflag = true s.starttimer = 64 s.timeacc = math.random(math.random(64, s.eventlength), s.eventlength) s.timerW = 34039402 starttimersetflag = false startflag = false return true elseif args[3] == '4' then s.rng121 = 4 starttimerflag = true s.starttimer = 64 s.timeacc = math.random(math.random(64, s.eventlength), s.eventlength) starttimersetflag = false startflag = false return true elseif args[3] == 'random' then s.rng121 = math.random(4) starttimerflag = true s.starttimer = 64 s.timeacc = math.random(math.random(64, s.eventlength), s.eventlength) starttimersetflag = false startflag = false return true else djui_chat_message_create("/rmmods \\#17ae7b\\[events \\#17de4b\\[start \\#84db96\\[(integers 1-4), random]\\#17de4b\\]\\#17ae7b\\]\\#ffffff\\\nYou can activate events 1-4 here.\n1 is the Catastrophic Disaster,\n2 is the Double Multiplier Additive,\n3 is the Multiplier Depletion Event,\n4 is the One Unknown. Maybe try it!") return true end elseif args[2] == 'rarity' then if math.tointeger(args[3]) ~= nil then if tonumber(args[3]) >= 1 and tonumber(args[3]) <= 1000000000 then s.rarity1 = tonumber(args[3]) return true else djui_chat_message_create("Please input an integer 1-1,000,000,000.") return true end else djui_chat_message_create("/rmmods \\#17ae7b\\[events \\#17de4b\\[rarity \\#84db96\\(integer number 1-1,000,000,000)\\#17de4b\\]\\#17ae7b\\] \\#ffffff\\ - sets how rare an event occurs in a 1/n formula.") return true end elseif args[2] == 'starttimer' then if math.tointeger(args[3]) ~= nil then if tonumber(args[3]) >= 2 and tonumber(args[3]) <= 65536 then s.starttimerset1 = tonumber(args[3]) return true else djui_chat_message_create("Please input an integer 2-65,536.") return true end else djui_chat_message_create("/rmmods \\#17ae7b\\[events \\#17de4b\\[starttimer \\#84db96\\(integer number 2-65,536)\\#17de4b\\]\\#17ae7b\\]\\#ffffff\\ - This sets the timer from a random number in a range between the value you're setting and 5x the value.") return true end elseif args[2] == 'eventlength' then if math.tointeger(args[3]) ~= nil then if tonumber(args[3]) >= 64 and tonumber(args[3]) <= 65536 then s.starttimerset1 = tonumber(args[3]) return true else djui_chat_message_create("Please input an integer 64-65,536.") return true end else djui_chat_message_create("/rmmods \\#17ae7b\\[events \\#17de4b\\[eventlength \\#84db96\\(integer number 64-65,536)\\#17de4b\\]\\#17ae7b\\]\\#ffffff\\ - This sets the length of time an event may last for, with a formula like this: random(random(64, n), n), so this is a weighted chance.") return true end else djui_chat_message_create("/rmmods \\#17ae7b\\[events \\#17de4b\\[false / true / start / rarity / starttimer / eventlength\\#17ae7b\\] \\#ffffff\\") return true end else djui_chat_message_create("Not that! Use a valid answer.") return true end end ---@param msg string function debug(msg) if string.lower(msg) == 'true' then showdebug = true return true elseif string.lower(msg) == 'false' then showdebug = false return true else djui_chat_message_create("Not that! Use a valid answer.") return true end end function plshelp() djui_chat_message_create("\\#8dda9a\\If you don't know what's going on: \\#ffffff\\ \nThis mod has RNG (or Randomness) which can slightly change your position, and angle, and at a higher amount, velocity is affected too. \n\\#df13fe\\This RNG has a multiplier \\#ffffff\\(shown on the left) which amplifies the randomness, at 1x, you can move up to 2 units in all directions in a frame. This multiplier may incrementally increase.") djui_chat_message_create("\\#7deaca\\There is an option to hide the multiplier\\#ffffff\\ via the command '/rmdisplay hide.'") djui_chat_message_create("\\#ddda7a\\This mod also includes modifiers that use the RNG function\\#ffffff\\ which are 'randomly summoning enemies', and 'events' that affect the multiplier.") return true end function ransamp(msg) if seqflag == false then seqflag = true djui_chat_message_create("Sequence Tempo and Pitch (Music only) \\#55ee55\\may be randomised\\#dcdcdc\\!") return true elseif seqflag == true then djui_chat_message_create("Sequence Tempo and Pitch (Music only) \\#ee5555\\won't be randomised\\#dcdcdc\\ anymore!") seqflag = false return true end end hook_chat_command('rmsamples', 'randomises samples and sequences tempo and music pitch (transposition) [Enabled by default]', ransamp) local timer4 = 20 ---@param m MarioState function timerC(m) if m.playerIndex ~= 0 then return end if timer4 > 0 then timer4 = timer4 - 1 end if timer4 == 10 then djui_chat_message_create("\\#8de\\gMario\\#fc2\\[\\#ac9\\0\\#fc2\\]\\#dcdcdc\\ RNG (Alpha) is still Alpha! There may be oversights with this mod!") djui_chat_message_create("For help about this mod, use '\\#bce3bc\\/rmhelp\\#dcdcdc\\'!") djui_chat_message_create("\\#f16161\\Seizure Warning!\\#dcdcdc\\ Be Fore-warned!") if network_is_server() and m.numStars > 0 then djui_chat_message_create("As \\#88dc88\\Server Host\\#dcdcdc\\, you can use \\#bce3bc\\/rmvalue reset\\#dcdcdc\\, which resets the multiplier (except for the star count, which affects it). \\#dc8888\\You cannot undo this action once you do\\#dcdcdc\\. Be careful!") end end end if network_is_server() then hook_chat_command('rmvalue', '\\#17ae7b\\[\\#17de4b\\{number}\\#17ae7b\\ | incremental | reset | increase] \\#ffffff\\- Incremental is default.', rmV) hook_chat_command('rmmods', '\\#17ae7b\\[summon / events] \\#ffffff\\ - If summon is enabled, enemies can spawn with more chance the higher RM is, highest being 1200x. Events enable the random events affecting the RM that might appear during gameplay.', rmM) hook_chat_command('rmdebug', '\\#17ae7b\\[true / false] \\#ffffff\\ - Shows variables when enabled', debug) end function accountotherplayers() if starttimersetflag == true then s.mult2 = 1 end s.mult2 = s.mult2 / network_player_connected_count() ^ 0.64 end hook_event(HOOK_UPDATE, accountotherplayers) hook_chat_command('rmdisplay', '\\#17ae7b\\[show / hide] \\#ffffff\\ - Shows or hides multiplier display', randomisercommands) hook_chat_command('rmdesign', '\\#17ae7b\\[shaking | color | font | precision | updater] \\#ffffff\\ - change some things about the design of the randomiser multiplier', design) hook_chat_command('rmhelp','- explains how pos randomiser works.', plshelp) hook_event(HOOK_MARIO_UPDATE, randomM) hook_event(HOOK_MARIO_UPDATE, randomN) hook_event(HOOK_MARIO_UPDATE, randomO) hook_event(HOOK_MARIO_UPDATE, nplyupdater) hook_event(HOOK_MARIO_UPDATE, nplyAupdater) hook_event(HOOK_MARIO_UPDATE, random1) hook_event(HOOK_MARIO_UPDATE, random2) hook_event(HOOK_MARIO_UPDATE, random3) hook_event(HOOK_MARIO_UPDATE, random4) hook_event(HOOK_MARIO_UPDATE, timerA) hook_event(HOOK_MARIO_UPDATE, truncatezeros) hook_event(HOOK_MARIO_UPDATE, timerB) hook_event(HOOK_MARIO_UPDATE, timerC) hook_event(HOOK_MARIO_UPDATE, timerD) hook_event(HOOK_MARIO_UPDATE, Incrementcheck) hook_event(HOOK_MARIO_UPDATE, countingupA) hook_event(HOOK_MARIO_UPDATE, countingupB) hook_event(HOOK_MARIO_UPDATE, countingupZ) hook_event(HOOK_MARIO_UPDATE, shakefunction) hook_event(HOOK_MARIO_UPDATE, randomcolour) hook_event(HOOK_ON_HUD_RENDER, on_hud_render) hook_event(HOOK_UPDATE, summonenemies) hook_event(HOOK_MARIO_UPDATE, randomV) hook_event(HOOK_MARIO_UPDATE, measuringdistance) hook_event(HOOK_MARIO_UPDATE, transitionqtoRM)