Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Version 0.33b
- -- OPTIONS -- OPTIONS -- OPTIONS -- Change to true or false
- Level_Blitz = false
- NoLeftMode = false
- DisableButton = "none"
- DrunkMode = false
- HardMode = false
- ForceRetry = false
- InfiniteLives = false
- DeathTimer = true -- When the star meter hits 0, you die. Combine with Hard Mode for Insane Mode (1-hit death)
- AlwaysExtendedFlutter = false
- NoFlutter = false
- NoTongue = false
- Velcro = false
- AlwaysFilledMouth = false -- Enter 2 for bubbles and 3 for melons. Enter false to disable
- FullEggsStart = true
- NumberOfEggs = 6 -- For FullEggsStart, how many to start with - choose between 1-6
- EggType = 37-- What eggs to start with (34 = flashing egg - 35 = red - 36 = yellow - 37 = green - 39 = key - 40 = chicken - 43 = big egg
- FastModeX = false
- FastModeY = false
- SpeedBoostX = 5 -- For fast mode, enter (-9) to 9 (higher is faster)
- SpeedBoostY = 8
- PoisonCoins = -10 -- Put 0 to disable. 10 = 1 star per coin. Negative values give stars.
- PoisonFlowers = -50
- GroundIsLava = 80 -- Put 0 to disable. 20 = about 1 star per second
- TerminalMode = 0 -- Put 0 to disable. Same rate as above
- PoisonAir = 0 -- Just as GroundIsLava but in air instead.
- PackMuleMode = false -- Only works when combined with Fast Mode
- StarMeterSpeedMode = false -- poop, don't use yet. (it's poop)
- -- Level Blitz Options -- Level Blitz Options --
- AutoScrollers = false
- ExtraStages = false
- ExcludeStages = {68, 72, 54} -- seperate by a comma, write stages like 54 as 5-4
- CustomLevelOrder = {}
- NormalFortressOrder = true
- NormalCastleOrder = true
- RandomSeed = 18467
- SameStage = false
- Fortresses = true
- Castles = true
- World1 = true
- World2 = true
- World3 = true
- World4 = true
- World5 = true
- World6 = true
- -- Level Goals Options -- Level Goals Options --
- CoinGoals = false -- set true if you wan't to use it
- MinimumCoins = true -- set true if you want a minimum goal
- MaximumCoins = false -- set true if you wanta a maximum goal
- MinCoinGoal = 200 -- set what minimum goal must be met
- MaxCoinGoal = 0 -- set what the maxiumum goal can be - death when getting more than max
- DisplayCoin = true -- whether to display on screen or not
- StarGoals = false
- MinimumStars = false
- MaximumStars = true
- MinStarGoal = 0
- MaxStarGoal = 25
- DisplayStar = true
- FlowerGoals = false
- MinimumFlowers = true
- MaximumFlowers = true
- MinFlowerGoal = 3
- MaxFlowerGoal = 3
- DisplayFlower = true
- RedCoinGoals = false
- MinimumRedCoins = true
- MaximumRedCoins = false
- MinRedCoinGoal = 4
- MaxRedCoinGoal = 0
- DisplayRed = true
- JumpGoals = false
- MinimumJumps = false
- MaximumJumps = true
- MinJumpGoal = 0
- MaxJumpGoal = 100
- DisplayJump = true
- Egg_Goals = false
- MinimumEggs = true
- MaximumEggs = false
- MinEggGoal = 25
- MaxEggGoal = 100
- DisplayEggs = true
- Fuzzy_Goals = false
- MinimumFuzzies = false
- MaximumFuzzies = true
- MinFuzzyGoal = 5
- MaxFuzzyGoal = 5
- DisplayFuzzy = true
- Lives_Goals = false
- MinimumLives = true
- MaximumLives = true
- MinLivesGoal = 5
- MaxLivesGoal = 5
- DisplayLives = true
- gui.opacity(0.8) -- set opacity for text displayed
- -- OPTIONS End -- OPTIONS End -- OPTIONS End --
- -- !Instructions! Instructions! Instructions! Instructions!
- -- 1. You must use a lua compatible Snes9x emulator. Recommended is -> http://code.google.com/p/snes9x-rr/downloads/detail?name=snes9x-1.51-rerecording-svn147.zip&can=2&q=
- -- 2. Recommended ROM is (U) (1.0) (!) but others should work but they are untested
- -- 3. Change options above and replace with true or false, RandomSeed is a number though, if it's a word, it's just random
- -- 4. In Snes9x, load ROM then go File -> Lua Scripting -> New Lua Script Window... -> Load file -> Press Run
- -- 5. You know you have loaded it right when the Lua Script window outputs what modes are on and what are false
- -- 6. If you have changed the options, you have to restart the script for it to take effect
- -- Newest version is always found at http://pastebin.com/qCGDbZZZ
- ------------------------------------------------
- ------------------------------------------------
- ------------------------------------------------
- ----------------Script starts here--------------
- ------------------------------------------------
- ------------------------------------------------
- ------------------------------------------------
- ------------------------------------------------
- ------------------------------------------------
- function table.contains(table, element)
- for i, value in pairs(table) do
- if value == element then
- valpos = i
- return true
- end
- end
- return false
- end
- function deepcopy(t)
- if type(t) ~= 'table' then return t end
- local mt = getmetatable(t)
- local res = {}
- for k,v in pairs(t) do
- if type(v) == 'table' then
- v = deepcopy(v)
- end
- res[k] = v
- end
- setmetatable(res,mt)
- return res
- end
- function removetable(tab,tab2)
- table.sort(tab)
- table.sort(tab2)
- rem = 0
- tabcopy = deepcopy(tab)
- for cy, value in ipairs(tab) do
- for cx, value2 in ipairs (tab2) do
- if value == value2 then
- table.remove(tabcopy,cy - rem)
- rem = rem + 1
- end
- end
- end
- return tabcopy
- end
- function convertstages(tablelist)
- for i, stg in pairs(tablelist) do
- worldnumber = math.floor(stg/10)
- levelnumber = stg - worldnumber*10
- realstagevalue = (worldnumber - 1)*12 + levelnumber - 1
- tablelist[i] = realstagevalue
- end
- end
- ------------------------------------------------
- ------------------------------------------------
- ------------------------------------------------
- print("Version 0.33b")
- NumberOfEggs = NumberOfEggs*2
- gpsn_value = 0
- apsn_value = 0
- psn_value = 0
- eggcount = 0
- keycount = 0
- mouth_var = 0
- packmulemodifier = 1
- laststage = 0
- lastworld = 0
- scrollerslist = {4, 53, 64} -- This can be changed to include or exclude other stages depending on how you define an autoscroller
- extralist = {8, 20, 32, 44, 56, 68}
- castlelist = {7, 19, 31, 43, 55}
- fortresslist = {3, 15, 27, 39, 51, 63}
- world1list = {0, 1, 2, 3, 4, 5, 6, 7, 8 }
- world2list = {12, 13, 14, 15, 16, 17, 18, 19, 20}
- world3list = {24, 25, 26, 27, 28 ,29, 30, 31, 32}
- world4list = {36, 37, 38, 39, 40, 41, 42, 43, 44}
- world5list = {48, 49, 50, 51, 52, 53, 54, 55, 56}
- world6list = {60, 61, 62, 63, 64, 65, 66, 68}
- stageslist =
- {0, 1, 2, 3, 4, 5, 6, 7, 8,
- 12, 13, 14, 15, 16, 17, 18, 19, 20,
- 24, 25, 26, 27, 28 ,29, 30, 31, 32,
- 36, 37, 38, 39, 40, 41, 42, 43, 44,
- 48, 49, 50, 51, 52, 53, 54, 55, 56,
- 60, 61, 62, 63, 64, 65, 66, 68}
- -- Remove stages according to options
- if AutoScrollers == false then
- stageslist = removetable(stageslist, scrollerslist)
- end
- if ExtraStages == false then
- stageslist = removetable(stageslist, extralist)
- end
- if World1 == false then
- stageslist = removetable(stageslist, world1list)
- end
- if World2 == false then
- stageslist = removetable(stageslist, world2list)
- end
- if World3 == false then
- stageslist = removetable(stageslist, world3list)
- end
- if World4 == false then
- stageslist = removetable(stageslist, world4list)
- end
- if World5 == false then
- stageslist = removetable(stageslist, world5list)
- end
- if World6 == false then
- stageslist = removetable(stageslist, world6list)
- end
- if Fortresses == false or NormalFortressOrder == true then
- stageslist = removetable(stageslist, fortresslist)
- end
- if Castles == false or NormalCastleOrder == true then
- stageslist = removetable(stageslist, castlelist)
- end
- convertstages(ExcludeStages)
- stageslist = removetable(stageslist, ExcludeStages)
- castlelist = removetable(castlelist, ExcludeStages)
- fortresslist = removetable(fortresslist, ExcludeStages)
- --
- if RandomSeed ~= nil then
- math.randomseed(RandomSeed)
- end
- --
- ------------------------------------------------
- --------------------GAMEMODES-------------------
- ------------------------------------------------
- ------------------------------------------------
- if Level_Blitz == true then
- gen_levelblitz = {}
- numberofstages = #stageslist
- if Castles == true then
- numberofstages = numberofstages + #castlelist
- end
- if Fortresses == true then
- numberofstages = numberofstages + #fortresslist
- end
- instage = 0
- xlbgen = 1
- if SameStage == false then
- function SameStage(remstagelist)
- table.remove(remstagelist,gen_stgnr)
- end
- else
- function SameStage()
- end
- end
- if #CustomLevelOrder == 0 then
- while xlbgen <= numberofstages do
- if xlbgen%8 == 0 and #castlelist > 0 and NormalCastleOrder == true then
- gen_stgnr = math.random(#castlelist)
- gen_stage = castlelist[gen_stgnr]
- table.insert(gen_levelblitz,gen_stage)
- SameStage(castlelist)
- elseif xlbgen%4 == 0 and xlbgen%8 ~= 0 and #fortresslist > 0 and NormalFortressOrder == true then
- gen_stgnr = math.random(#fortresslist)
- gen_stage = fortresslist[gen_stgnr]
- table.insert(gen_levelblitz,gen_stage)
- SameStage(fortresslist)
- elseif #stageslist > 0 then
- gen_stgnr = math.random(#stageslist)
- gen_stage = stageslist[gen_stgnr]
- table.insert(gen_levelblitz,gen_stage)
- SameStage(stageslist)
- end
- xlbgen = xlbgen + 1
- end
- else
- convertstages(CustomLevelOrder)
- gen_levelblitz = CustomLevelOrder
- numberofstages = #gen_levelblitz
- end
- function LevelBlitz()
- stagenumber = memory.readbyte(0x7E1112) --//or memory.readbyte(0x7E112E)
- worldnumber= memory.readbyte(0x7E0218)
- entering_stage = memory.readbyte(0x7E111D)
- overworld = memory.readbyte(0x7E0009)
- titlescreen = memory.readbyte(0x7E011C)
- if stagenumber < 8 and instage == 0 and entering_stage == 1 and titlescreen == 12 then
- laststage = stagenumber
- lastworld = worldnumber
- corresponding_stage = (worldnumber/2)*8 + stagenumber+1
- if corresponding_stage <= numberofstages then
- memory.writebyte(0x7E021A,gen_levelblitz[corresponding_stage])
- end
- instage = 1
- elseif overworld == 126 then
- memory.writebyte(0x7E021A, laststage+lastworld*6)
- memory.writebyte(0x7E0218, lastworld) -- This is not needed? Kept just in case
- elseif entering_stage ~= 1 then
- instage = 0
- end
- end
- print("Blitz Mode is ON")
- else
- function LevelBlitz()
- end
- print("Blitz Mode is OFF")
- end
- -----------------------------------------------
- ------------------------------------------------
- if NoLeftMode == true then
- function noleft()
- speed = memory.readwordsigned(0x7000B4)
- if speed < 0 and memory.readbyte(0x7000AC) == 0 then
- memory.writeword(0x7000B4,0)
- end
- end
- print("NoLeftMode is ON")
- else
- function noleft()
- end
- print("NoLeftMode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if DrunkMode == true then
- function drunk()
- if memory.readbyte(0x7E0118) == 16 or memory.readbyte(0x7E0118) == 57 then
- memory.writeword(0x701FE8, 0)
- else
- memory.writeword(0x701FE8, 10)
- end
- end
- print("Drunk Mode is ON")
- else
- function drunk()
- end
- print("Drunk Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if HardMode == true then
- timerreset = 1
- function hardmode()
- gamemode = memory.readbyte(0x7E0118)
- hit = memory.readbyte(0x701960)
- if hit == 85 and timerreset == 0 and gamemode == 15 then
- memory.writeword(0x7E03B6, 1)
- timerreset = 1
- elseif hit ~= 85 and timerreset == 1 then
- timerreset = 0
- memory.writeword(0x7E03B6, 100)
- end
- end
- print("Hard Mode is ON")
- else
- function hardmode()
- end
- print("Hard Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if ForceRetry == true then
- function forceretry()
- if memory.readbyte(0x7E0118) == 61 or memory.readbyte(0x7E0118) == 53 then
- memory.writebyte(0x704094, 0)
- end
- end
- print("Force Retry Mode is ON")
- else
- function forceretry()
- end
- print("Force Retry Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if InfiniteLives == true then
- function infinitelives()
- memory.writebyte(0x7E0379, 10)
- end
- print("Infinite Lives is ON")
- else
- function infinitelives()
- end
- print("Infinite Lives is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- -------------------------------------------------
- -------------------------------------------------
- function firedeath()
- memory.writebyte(0x7000AC, 40)
- memory.writebyte(0x7001B0, 40)
- memory.writebyte(0x7001D2, 34)
- memory.writebyte(0x002140, 07)
- yoshiisdead = false
- die = 0
- end
- if DeathTimer == true then
- yoshiisdead = false
- function deathtimer()
- startimer = memory.readword(0x7E03B6)
- gamemode = memory.readbyte(0x7E0118)
- if gamemode ~= 15 then
- die = 1
- end
- if startimer <= 1 and die == 1 and gamemode == 15 then
- yoshiisdead = true
- end
- if memory.readbyte(0x7001AE) == 0 and memory.readbyte(0x7000AC) == 0 and yoshiisdead == true then
- firedeath()
- end
- end
- print("Death Timer Mode is ON")
- else
- function deathtimer()
- end
- print("Death Timer Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if AlwaysExtendedFlutter == true then
- function extendedflutter()
- mario = memory.readbyte(0x7E0205)
- if mario == 1 then
- memory.writebyte(0x7000D3, 128)
- end
- end
- print("Always Extended Flutter is ON")
- else
- function extendedflutter()
- end
- print("Always Extended Flutter is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if NoTongue == true then
- function notongue()
- memory.writebyte(0x700162, 126)
- end
- print("No Tongue Mode is ON")
- else
- function notongue()
- end
- print("No Tongue Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if NoFlutter == true then
- function noflutter()
- memory.writebyte(0x7000D2, 0)
- end
- print("No Flutter Mode is ON")
- else
- function noflutter()
- end
- print("No Flutter Mode is OFF")
- end
- -------------------------------------------------
- ------------------------------------------------- -- Boss cutscenes are very slow, fix if people think it's a problem.
- if Velcro == true then
- function velcromode()
- if memory.readbyte(0x7000C0) == 0 and memory.readbyte(0x7E0118) == 15 and math.abs(memory.readwordsigned(0x7000B4)) > 20 then
- memory.writeword(0x7000B4,0)
- end
- end
- print("Velcro Mode is ON")
- else
- function velcromode()
- end
- print("Velcro Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if AlwaysFilledMouth == false then
- function mouthmode()
- end
- print("Always Filled Mouth is OFF")
- else
- if AlwaysFilledMouth == melon or AlwaysFilledMouth == melons or AlwaysFilledMouth == seeds or AlwaysFilledMouth == melonseeds or AlwaysFilledMouth == melonseed then
- mouth_var = 3
- end
- if AlwaysFilledMouth == bubble or AlwaysFilledMouth == bubbles then
- mouth_var = 2
- end
- function mouthmode()
- memory.writebyte(0x700162, 89)
- memory.writebyte(0x70016A, AlwaysFilledMouth)
- memory.writebyte(0x700170, 30)
- end
- print("Always Filled Mouth is ON")
- end
- -------------------------------------------------
- -------------------------------------------------
- if FullEggsStart == true then
- function eggstransitions()
- gamemode = memory.readbyte(0x7E0118)
- if gamemode == 12 then
- eggcount = memory.readbyte(0x7E5D98)
- for i = 0, eggcount, 2 do
- memory.writebyte(0x7E5D9A + i, memory.readbyte(0x7E5D9A + i))
- end
- for i = eggcount, NumberOfEggs, 2 do
- memory.writebyte(0x7E5D9A+i, EggType)
- end
- if eggcount > NumberOfEggs then
- memory.writebyte(0x7E5D98, eggcount)
- else
- memory.writebyte(0x7E5D98, NumberOfEggs)
- end
- end
- end
- print("Always Start With Full Eggs is ON -", NumberOfEggs/2, "eggs")
- else
- function eggstransitions()
- end
- print("Always Start With Full Eggs is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- xposoffset = 0
- if FastModeX == true then
- speedmodifierx = 1000 - SpeedBoostX*100
- function fastmodex()
- if memory.readbyte(0x7E0118) == 15 and memory.readbyte(0x7E0387) == 0 then
- xspeed = memory.readwordsigned(0x7000B4)
- xposition = memory.readwordsigned(0x70008c)
- xposoffset = xspeed/speedmodifierx
- memory.writeword(0x70008c, xposition + xposoffset)
- end
- end
- print("Fast Mode is ON - Speed:",SpeedBoostX)
- else
- function fastmodex()
- end
- print("Fast Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if FastModeY == true then
- speedmodifiery = 1000 - SpeedBoostY*100
- function fastmodey()
- if memory.readbyte(0x7E0118) == 15 and memory.readbyte(0x7E0387) == 0 then
- yspeed = memory.readwordsigned(0x7000AA)
- yposition = memory.readwordsigned(0x700090)
- memory.writeword(0x700090, yposition + yspeed/speedmodifiery)
- end
- end
- print("Fast Mode is ON - Speed:",SpeedBoostY)
- else
- function fastmodey()
- end
- print("Fast Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if PoisonCoins ~= 0 then
- lastframecoins = memory.readbyte(0x7E037B)
- function poisoncoins()
- starcounter = memory.readword(0x7E03B6)
- if memory.readbyte(0x7E037B) > lastframecoins then
- if starcounter > PoisonCoins then
- memory.writeword(0x7E03B6, starcounter - PoisonCoins)
- else
- memory.writeword(0x7E03B6, 0)
- end
- end
- lastframecoins = memory.readbyte(0x7E037B)
- end
- print("Poison Coins Mode is ON")
- else
- function poisoncoins()
- end
- print("Poison Coins Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if PoisonFlowers ~= 0 then
- lastframeflowers = memory.readbyte(0x7E03B8)
- function poisonflowers()
- starcounter = memory.readword(0x7E03B6)
- if memory.readbyte(0x7E03B8) > lastframeflowers then
- if starcounter > PoisonFlowers then
- memory.writeword(0x7E03B6, starcounter - PoisonFlowers)
- else
- memory.writeword(0x7E03B6, 0)
- end
- end
- lastframeflowers = memory.readbyte(0x7E03B8)
- end
- print("Poison Flowers Mode is ON")
- else
- function poisonflowers()
- end
- print("Poison Flowers Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if GroundIsLava ~= 0 then
- GroundIsLava = GroundIsLava + 9
- function groundislava()
- starcounter = memory.readword(0x7E03B6)
- if memory.readbyte(0x7000C0) == 0 and memory.readbyte(0x7001AE) == 0 and memory.readbyte(0x7000AC) == 0 then
- if starcounter > 0 then
- if gpsn_value >= 1 or gpsn_value <= -1 then
- memory.writeword(0x7E03B6, starcounter - gpsn_value)
- gpsn_value = 0
- end
- gpsn_value = gpsn_value + 0.01*GroundIsLava
- else
- memory.writeword(0x7E03B6, 0)
- end
- end
- end
- print("Ground is Lava Mode is ON")
- else
- function groundislava()
- end
- print("Ground is Lava is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if PoisonAir ~= 0 then
- PoisonAir = PoisonAir + 9
- function poisonair()
- starcounter = memory.readword(0x7E03B6)
- if memory.readbyte(0x7000C0) ~= 0 and memory.readbyte(0x7001AE) == 0 and memory.readbyte(0x7000AC) == 0 then
- if starcounter > 0 then
- if apsn_value >= 1 or apsn_value <= -1 then
- memory.writeword(0x7E03B6, starcounter - apsn_value)
- apsn_value = 0
- end
- apsn_value = apsn_value + 0.01*PoisonAir
- else
- memory.writeword(0x7E03B6, 0)
- end
- end
- end
- print("Poison Air Mode is ON")
- else
- function poisonair()
- end
- print("Poison Air is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if TerminalMode ~= 0 then
- TerminalMode = TerminalMode + 9
- function terminalmode()
- starcounter = memory.readword(0x7E03B6)
- if memory.readbyte(0x7001AE) == 0 and memory.readbyte(0x7000AC) == 0 then
- if starcounter > 0 then
- if psn_value >= 1 or psn_value <= -1 then
- memory.writeword(0x7E03B6, starcounter - psn_value)
- psn_value = 0
- end
- psn_value = psn_value + 0.01*TerminalMode
- else
- memory.writeword(0x7E03B6, 0)
- end
- end
- end
- print("Terminal Mode is ON")
- else
- function terminalmode()
- end
- print("Terminal Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if PackMuleMode == true then
- function packmule()
- packmulemodifier = (-1)*memory.readbyte(0x701DF6)/2
- end
- print("Pack Mule Mode is ON")
- else
- packmulemodifier = 0
- function packmule()
- end
- print("Pack Mule Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if StarMeterSpeedMode == true then
- starmetermodifier = 1
- function starmeterspeed()
- starmetermodifier = (memory.readword(0x7E03B6)*-1)
- end
- print("Star Meter Speed Mode is ON")
- else
- starmetermodifier = 0
- function starmeterspeed()
- end
- print("Star Meter Speed Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- if joypad.get(1)[DisableButton] ~= nil then
- function DisableButtonFunction(button)
- buttons_pressed = joypad.get(1)
- buttons_pressed[button] = false
- joypad.set(1, buttons_pressed)
- end
- print("Disable Button Mode is ON ", DisableButton)
- else
- function DisableButtonFunction(button)
- end
- print("Disable Button Mode is OFF")
- end
- -------------------------------------------------
- -------------------------------------------------
- --------------------------------------------------- Goal stuff below
- ---------------------------------------------------
- --------------------------------------------------- Display functios and shit first yo
- ---------------------------------------------------
- ---------------------------------------------------
- y_offset = 4
- function display_goals_gen(goalstring ,x_collect, mingoal, maxgoal, mingoalboolean, maxgoalboolean, y_offset)
- if mingoalboolean == true then
- if x_collect < mingoal then
- color = "red"
- else
- color = "green"
- end
- minstring = " min: "
- else
- mingoal = ""
- minstring = ""
- end
- if maxgoalboolean == true then
- if x_collect == maxgoal then
- color = "orange"
- elseif mingoalboolean == false then
- color = "yellow"
- end
- maxstring = " max: "
- else
- maxstring = ""
- maxgoal = ""
- end
- gui.text(4, y_offset, goalstring .. x_collect .. " -" .. minstring .. mingoal .. maxstring .. maxgoal, color)
- end
- ---------------------------------------------------
- if DisplayCoin == true and CoinGoals == true then
- function coindisplay()
- display_goals_gen("Coins: ", collectedcoins, MinCoinGoal, MaxCoinGoal, MinimumCoins, MaximumCoins, y_offset_coin)
- end
- y_offset_coin = y_offset
- y_offset = y_offset + 8
- else
- function coindisplay()
- end
- end
- ---------------------------------------------------
- if DisplayStar == true and StarGoals == true then
- function stardisplay()
- display_goals_gen("Stars: ", collectedstars, MinStarGoal, MaxStarGoal, MinimumStars, MaximumStars, y_offset_star)
- end
- y_offset_star = y_offset
- y_offset = y_offset + 8
- else
- function stardisplay()
- end
- end
- ---------------------------------------------------
- if DisplayFlower == true and FlowerGoals == true then
- function flowerdisplay()
- display_goals_gen("Flowers: ", flowers, MinFlowerGoal, MaxFlowerGoal, MinimumFlowers, MaximumFlowers, y_offset_flower)
- end
- y_offset_flower = y_offset
- y_offset = y_offset + 8
- else
- function flowerdisplay()
- end
- end
- ---------------------------------------------------
- if DisplayRed == true and RedCoinGoals == true then
- function reddisplay()
- display_goals_gen("Red Coins: ", redcoins, MinRedCoinGoal, MaxRedCoinGoal, MinimumRedCoins, MaximumRedCoins, y_offset_red)
- end
- y_offset_red = y_offset
- y_offset = y_offset + 8
- else
- function reddisplay()
- end
- end
- ---------------------------------------------------
- if DisplayJump == true and JumpGoals == true then
- function jumpdisplay()
- display_goals_gen("Jumped: ", times_jumped, MinJumpGoal, MaxJumpGoal, MinimumJumps, MaximumJumps, y_offset_jump)
- end
- y_offset_jump = y_offset
- y_offset = y_offset + 8
- else
- function jumpdisplay()
- end
- end
- ---------------------------------------------------
- if DisplayEggs == true and Egg_Goals == true then
- function eggdisplay()
- display_goals_gen("Eggs: ", eggs_made, MinEggGoal, MaxEggGoal, MinimumEggs, MaximumEggs, y_offset_egg)
- end
- y_offset_egg = y_offset
- y_offset = y_offset + 8
- else
- function eggdisplay()
- end
- end
- ---------------------------------------------------
- if DisplayFuzzy == true and Fuzzy_Goals == true then
- function fuzdisplay()
- display_goals_gen("Fuzzies: ", touched_fuzzies, MinFuzzyGoal, MaxFuzzyGoal, MinimumFuzzies, MaximumFuzzies, y_offset_fuz)
- end
- y_offset_fuz = y_offset
- y_offset = y_offset + 8
- else
- function fuzdisplay()
- end
- end
- ---------------------------------------------------
- if DisplayLives == true and Lives_Goals == true then
- function livesdisplay()
- display_goals_gen("Lives: ", extralives_gathered, MinLivesGoal, MaxLivesGoal, MinimumLives, MaximumLives, y_offset_lives)
- end
- y_offset_lives = y_offset
- y_offset = y_offset + 8
- else
- function livesdisplay()
- end
- end
- ---------------------------------------------------
- function what_to_display()
- if gamemode == 15 then
- coindisplay()
- stardisplay()
- flowerdisplay()
- reddisplay()
- jumpdisplay()
- eggdisplay()
- fuzdisplay()
- livesdisplay()
- end
- end
- gui.register(what_to_display)
- ---------------------------------------------------
- ---------------------------------------------------
- --------------------------------------------------- Start with goal functions.
- ---------------------------------------------------
- ---------------------------------------------------
- if MinimumCoins == true then
- function mincoincheck()
- if collectedcoins < MinCoinGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function mincoincheck()
- end
- end
- ---------------------------------------------------
- if MaximumCoins == true then
- function maxcoincheck()
- if collectedcoins > MaxCoinGoal and memory.readbyte(0x7001AE) == 0 then
- firedeath()
- collectedcoins = 0
- end
- end
- else
- function maxcoincheck()
- end
- end
- ---------------------------------------------------
- lastframecoins = memory.readbyte(0x7E037B)
- collectedcoins = 0
- function coincounter()
- gamemode = memory.readbyte(0x7E0118)
- if memory.readbyte(0x7E037B) > lastframecoins then
- collectedcoins = collectedcoins + memory.readbyte(0x7E037B) - lastframecoins
- elseif memory.readbyte(0x7E037B) < lastframecoins then
- collectedcoins = collectedcoins + 100 - lastframecoins + memory.readbyte(0x7E037B)
- end
- lastframecoins = memory.readbyte(0x7E037B)
- end
- ---------------------------------------------------
- if CoinGoals == true then
- function coingoals()
- savering = memory.readbyte(0x7E0B65)
- coincounter()
- if savering == 1 then
- MidRingCoins = collectedcoins
- end
- if gamemode == 61 or gamemode == 34 then
- collectedcoins = 0
- end
- if gamemode == 53 then
- collectedcoins = MidRingCoins
- end
- mincoincheck()
- maxcoincheck()
- end
- else
- function coingoals()
- end
- end
- ---------------------------------------------------
- ------------------------------------------------------
- ------------------------------------------------------
- ---------------------------------------------------
- lastframestars = math.floor(memory.readword(0x7E03B6)/10)
- collectedstars = 0
- if MinimumStars == true then
- function minstarcheck()
- if collectedstars < MinStarGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function minstarcheck()
- end
- end
- ------------------------------------------------------
- if MaximumStars == true then
- function maxstarcheck()
- if collectedstars > MaxStarGoal and memory.readbyte(0x7001AE) == 0 then
- firedeath()
- collectedstars = 0
- end
- end
- else
- function maxstarcheck()
- end
- end
- ------------------------------------------------------
- function starcounter()
- thisframestars = math.floor(memory.readword(0x7E03B6)/10)
- gamemode = memory.readbyte(0x7E0118)
- if thisframestars > lastframestars and gamemode == 15 then --
- collectedstars = collectedstars + thisframestars - lastframestars
- end
- lastframestars = math.floor(memory.readword(0x7E03B6)/10)
- end
- ------------------------------------------------------
- if StarGoals == true then
- function stargoals()
- memory.writeword(0x7EE23C, 10000)
- starcounter()
- savering = memory.readbyte(0x7E0B65)
- if savering == 1 then
- MidRingStars = collectedstars
- end
- if gamemode == 61 or gamemode == 34 then
- collectedstars = 0
- end
- if gamemode == 53 then
- collectedstars = MidRingStars
- end
- minstarcheck()
- maxstarcheck()
- end
- else
- function stargoals()
- end
- end
- ---------------------------------------------------
- ------------------------------------------------------
- ------------------------------------------------------
- ---------------------------------------------------
- if MinimumFlowers == true then
- function minflowers()
- if flowers < MinFlowerGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function minflowers()
- end
- end
- ------------------------------------------------------
- if MaximumFlowers == true then
- flowerdeath = false
- function maxflowers()
- if flowers > MaxFlowerGoal and memory.readbyte(0x7001AE) == 0 and flowerdeath == false and gamemode == 15 then
- firedeath()
- flowerdeath = true
- elseif gamemode == 12 and flowerdeath == true then
- flowerdeath = false
- end
- end
- else
- function maxflowers()
- end
- end
- ------------------------------------------------------
- if FlowerGoals == true then
- function flowergoals()
- gamemode = memory.readbyte(0x7E0118)
- flowers = memory.readbyte(0x7E03B8)
- minflowers()
- maxflowers()
- end
- else
- function flowergoals()
- end
- end
- ---------------------------------------------------
- ------------------------------------------------------
- ------------------------------------------------------
- ---------------------------------------------------
- if MinimumRedCoins == true then
- function minredcoins()
- if redcoins < MinRedCoinGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function minredcoins()
- end
- end
- ------------------------------------------------------
- if MaximumRedCoins == true then
- redcoindeath = false
- function maxredcoins()
- if redcoins > MaxRedCoinGoal and memory.readbyte(0x7001AE) == 0 and redcoindeath == false then
- firedeath()
- redcoindeath = true
- elseif gamemode == 12 and redcoindeath == true then
- redcoindeath = false
- end
- end
- else
- function maxredcoins()
- end
- end
- ------------------------------------------------------
- if RedCoinGoals == true then
- function redcoingoals()
- gamemode = memory.readbyte(0x7E0118)
- redcoins = memory.readbyte(0x7E03B4)
- minredcoins()
- maxredcoins()
- end
- else
- function redcoingoals()
- end
- end
- ---------------------------------------------------
- ------------------------------------------------------
- ------------------------------------------------------
- ---------------------------------------------------
- times_jumped = 0
- function jumpcounter()
- soundtype = memory.readbyte(0x7E0055)
- if soundtype == 73 or soundtype == 56 then
- times_jumped = times_jumped + 1
- end
- end
- ------------------------------------------------------
- if MinimumJumps == true then
- function minjumps()
- if times_jumped < MinJumpGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function minjumps()
- end
- end
- ------------------------------------------------------
- if MaximumJumps == true then
- function maxjumps()
- if times_jumped > MaxJumpGoal and memory.readbyte(0x7001AE) == 0 then
- firedeath()
- times_jumped = 0
- end
- end
- else
- function maxjumps()
- end
- end
- ------------------------------------------------------
- if JumpGoals == true then
- function jumpgoals()
- gamemode = memory.readbyte(0x7E0118)
- jumpcounter()
- savering = memory.readbyte(0x7E0B65)
- if savering == 1 then
- MidRingJumps = times_jumped
- end
- if gamemode == 61 or gamemode == 34 then
- times_jumped = 0
- end
- if gamemode == 53 then
- times_jumped = MidRingJumps
- end
- minjumps()
- maxjumps()
- end
- else
- function jumpgoals()
- end
- end
- ---------------------------------------------------
- ------------------------------------------------------------------------------------------------------------
- ------------------------------------------------------------------------------------------------------------
- ---------------------------------------------------
- if MinimumEggs == true then
- function mineggs()
- if eggs_made < MinEggGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function mineggs()
- end
- end
- ---------------------------------------------------
- if MaximumEggs == true then
- function maxeggs()
- if eggs_made > MaxEggGoal and memory.readbyte(0x7001AE) == 0 then
- firedeath()
- eggs_made = 0
- end
- end
- else
- function maxeggs()
- end
- end
- ---------------------------------------------------
- eggs_made = 0
- swallowing_egg = false
- function enemies_swallowed_counter()
- if memory.readbyte(0x700150) == 71 and swallowing_egg == false then -- Issue if you get hit while making an egg, might be others too? Also counts when eating a fuzzy. Need new indicator!
- eggs_made = eggs_made + 1
- swallowing_egg = true
- elseif memory.readbyte(0x700150) == 75 then
- swallowing_egg = false
- end
- end
- ---------------------------------------------------
- if Egg_Goals == true then
- function eggoals()
- gamemode = memory.readbyte(0x7E0118)
- enemies_swallowed_counter()
- savering = memory.readbyte(0x7E0B65)
- if savering == 1 then
- MidRingEggs = eggs_made
- end
- if gamemode == 61 or gamemode == 34 then
- eggs_made = 0
- end
- if gamemode == 53 then
- eggs_made = MidRingEggs
- end
- mineggs()
- maxeggs()
- end
- else
- function eggoals()
- end
- end
- ---------------------------------------------------
- ------------------------------------------------------
- ------------------------------------------------------
- ---------------------------------------------------
- touched_fuzzies = 0
- function fuzzy_counter() -- very important that this is before drunk mode, else it won't work
- if memory.readword(0x701FE8) == 1024 and touched_fuzzy == false then
- touched_fuzzies = touched_fuzzies + 1
- touched_fuzzy = true
- elseif memory.readword(0x701FE8) < 1024 then
- touched_fuzzy = false
- end
- end
- ------------------------------------------------------
- if MinimumFuzzies == true then
- function minfuzzies()
- if touched_fuzzies < MinFuzzyGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function minfuzzies()
- end
- end
- ------------------------------------------------------
- if MaximumFuzzies == true then
- function maxfuzzies()
- if touched_fuzzies > MaxFuzzyGoal and memory.readbyte(0x7001AE) == 0 then
- firedeath()
- touched_fuzzies = 0
- end
- end
- else
- function maxfuzzies()
- end
- end
- ------------------------------------------------------
- if Fuzzy_Goals == true then
- function fuzzygoals()
- gamemode = memory.readbyte(0x7E0118)
- fuzzy_counter()
- savering = memory.readbyte(0x7E0B65)
- if savering == 1 then
- MidRingFuzzies = touched_fuzzies
- end
- if gamemode == 61 or gamemode == 34 then
- touched_fuzzies = 0
- end
- if gamemode == 53 then
- touched_fuzzies = MidRingFuzzies
- end
- minfuzzies()
- maxfuzzies()
- end
- else
- function fuzzygoals()
- end
- end
- ---------------------------------------------------
- ------------------------------------------------------
- ------------------------------------------------------
- ---------------------------------------------------
- current_extralives = memory.readword(0x7E0379)
- extralives_gathered = 0
- function extralives_counter()
- extralives_difference = memory.readword(0x7E0379) - current_extralives
- if extralives_difference > 0 then
- extralives_gathered = extralives_gathered + extralives_difference
- end
- current_extralives = memory.readword(0x7E0379)
- end
- ------------------------------------------------------
- if MinimumLives == true then
- function minlives()
- if extralives_gathered < MinLivesGoal then
- if gamemode == 16 or memory.readbyte(0x7E004F) == 240 then
- firedeath()
- end
- end
- end
- else
- function minlives()
- end
- end
- ------------------------------------------------------
- if MaximumLives == true then
- function maxlives()
- if extralives_gathered > MaxLivesGoal and memory.readbyte(0x7001AE) == 0 then
- firedeath()
- extralives_gathered = 0
- end
- end
- else
- function maxlives()
- end
- end
- ------------------------------------------------------
- if Lives_Goals == true then
- function livesgoals()
- gamemode = memory.readbyte(0x7E0118)
- extralives_counter()
- savering = memory.readbyte(0x7E0B65)
- if savering == 1 then
- MidRingLives = extralives_gathered
- end
- if gamemode == 61 or gamemode == 34 then
- extralives_gathered = 0
- end
- if gamemode == 53 then
- extralives_gathered = MidRingLives
- end
- minlives()
- maxlives()
- end
- else
- function livesgoals()
- end
- end
- -------------------------------------------------
- -------------------------------------------------
- ------------------MAIN---------------------------
- -------------------------------------------------
- -------------------------------------------------
- while true do
- --
- LevelBlitz()
- -- Goal stuff
- coingoals()
- stargoals()
- flowergoals()
- redcoingoals()
- jumpgoals()
- eggoals()
- fuzzygoals()
- livesgoals()
- -- things
- starmeterspeed()
- packmule()
- noleft()
- DisableButtonFunction(DisableButton)
- drunk()
- hardmode()
- deathtimer()
- forceretry()
- infinitelives()
- extendedflutter()
- notongue()
- noflutter()
- velcromode()
- mouthmode()
- eggstransitions()
- fastmodex()
- fastmodey()
- poisoncoins()
- poisonflowers()
- groundislava()
- terminalmode()
- poisonair()
- coincounter()
- --
- emu.frameadvance()
- end
- -- END MAIN --
- -- Made by Arnethegreat - message me on #yoshi @ irc.speeddemosarchive.com if you want anything
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement