end\r
\r
function GetSpeedMod(pn)\r
- local BaseSpeeds = GetBaseSpeeds()\r
- local ExtraSpeeds = GetExtraSpeeds()\r
- for n = 1, table.getn(BaseSpeeds) do\r
- if GetSpeedModRowType() == "basic" or GetSpeedModRowType() == "advanced" then\r
- if GAMESTATE:PlayerIsUsingModifier(pn, BaseSpeeds[n]) then return BaseSpeeds[n] end\r
- end\r
-\r
- if GetSpeedModRowType() == "pro" then\r
- for m = 1, table.getn(ExtraSpeeds) do\r
- local CombinedSpeeds = BaseSpeeds[n] + string.gsub(ExtraSpeeds[m], 'x', '') --combines the speeds in to things like 4.50\r
-\r
- --check x-mods\r
- if GAMESTATE:PlayerIsUsingModifier(pn, CombinedSpeeds .. 'x') then return CombinedSpeeds .. 'x' end\r
+ local BaseSpeeds = GetBaseSpeeds()\r
+ local ExtraSpeeds = GetExtraSpeeds()\r
+ for n = 1, table.getn(BaseSpeeds) do\r
+ if GetSpeedModRowType() == "basic" or GetSpeedModRowType() == "advanced" then\r
+ if GAMESTATE:PlayerIsUsingModifier(pn, BaseSpeeds[n]) then return BaseSpeeds[n] end\r
+ end\r
+\r
+ if GetSpeedModRowType() == "pro" then\r
+ for m = 1, table.getn(ExtraSpeeds) do\r
+ local CombinedSpeeds = BaseSpeeds[n] + string.gsub(ExtraSpeeds[m], 'x', '') --combines the speeds in to things like 4.50\r
+\r
+ --check x-mods\r
+ if GAMESTATE:PlayerIsUsingModifier(pn, CombinedSpeeds .. 'x') then return CombinedSpeeds .. 'x' end\r
\r
- --check c-mods\r
- if GAMESTATE:PlayerIsUsingModifier(pn, 'c' .. CombinedSpeeds*100) then return 'c' .. CombinedSpeeds*100 end\r
- end\r
+ --check c-mods\r
+ if GAMESTATE:PlayerIsUsingModifier(pn, 'c' .. CombinedSpeeds*100) then return 'c' .. CombinedSpeeds*100 end\r
+ \r
+ --check m-mods (for some reason m0 is always applied so it has to be skipped)\r
+ if GAMESTATE:PlayerIsUsingModifier(pn, 'm' .. CombinedSpeeds*100) and CombinedSpeeds ~= 0 then return 'm' .. CombinedSpeeds*100 end\r
+ end\r
+ end\r
end\r
- end\r
-\r
- -- M-Mods need to be checked last, as when the game starts m0 is always applied (even if a different default modifier has been chosen)\r
- for n = 1, table.getn(BaseSpeeds) do\r
- if GetSpeedModRowType() == "pro" then\r
- for m = 1, table.getn(ExtraSpeeds) do\r
- local CombinedSpeeds = BaseSpeeds[n] + string.gsub(ExtraSpeeds[m], 'x', '') --combines the speeds in to things like 4.50 \r
-\r
- if GAMESTATE:PlayerIsUsingModifier(pn, 'm' .. CombinedSpeeds*100) then return 'm' .. CombinedSpeeds*100 end\r
- end\r
- end\r
- end\r
\r
- return nil\r
+ -- If we get here, chances are that m0 was applied.\r
+ return "m0"\r
end\r
\r
function GetSpeedModBase(pn)\r
local SpeedMod = GetSpeedMod(pn)\r
+ \r
SpeedMod = string.gsub(SpeedMod, 'c', '')\r
SpeedMod = string.gsub(SpeedMod, 'm', '')\r
SpeedMod = string.gsub(SpeedMod, 'x', '')\r
\r
if GetSpeedModRowType() ~= "pro" then\r
GAMESTATE:ApplyGameCommand('mod,' .. ModBase, pn+1)\r
- MESSAGEMAN:Broadcast('SpeedModChanged')\r
+ MESSAGEMAN:Broadcast('SpeedModChangedP' .. pn+1)\r
else\r
SpeedMod = ModBase + ModExtra\r
\r
if ModType == 'm-mod' then GAMESTATE:ApplyGameCommand('mod,9999x',pn+1) end\r
if ModType == 'x-mod' then GAMESTATE:ApplyGameCommand('mod,m9999',pn+1) end\r
GAMESTATE:ApplyGameCommand('mod,'..SpeedMod,pn+1) --this is so annoying, the player number has to be 1 or 2 for ApplyGameCommand\r
- MESSAGEMAN:Broadcast('SpeedModChanged')\r
+ MESSAGEMAN:Broadcast('SpeedModChangedP' .. pn+1)\r
end\r
end\r
\r
--easter eggs
local function BlazeIt(Params)
- local spaces = string.rep(" ", string.len(DisplayScrollSpeed(Params.pn)))
+ local ScrollSpeed = DisplayScrollSpeed(Params.pn)
+ local spaces = string.rep(" ", string.len(ScrollSpeed))
- if DisplayScrollSpeed(Params.pn) == '420' then
+ if ScrollSpeed == '420' then
Params.Actor:settext(spaces .. " Blaze It!")
Params.Actor:diffusealpha(1)
Params.Actor:rainbow()
end
local function NoScope(Params)
- local spaces = string.rep(" ", string.len(DisplayScrollSpeed(Params.pn)))
+ local ScrollSpeed = DisplayScrollSpeed(Params.pn)
+ local spaces = string.rep(" ", string.len(ScrollSpeed))
- if DisplayScrollSpeed(Params.pn) == '360' then
+ if ScrollSpeed == '360' then
Params.Actor:settext(spaces .. " No Scope!")
Params.Actor:diffusealpha(1)
Params.Actor:rainbow()