freeslot("S_MULLIGAN","S_MULLIGAN2","MT_MULLIGAN", "S_MULLIGANM") states[S_MULLIGAN] = { sprite = SPR_LHRT, frame = A | FF_FULLBRIGHT, tics = 50, var1 = 0, var2 = 50, } states[S_MULLIGAN2] = { sprite = SPR_RNGS, frame = A | FF_FULLBRIGHT, tics = 50, var1 = 0, var2 = 50, } states[S_MULLIGANM] = { var1 = 0, var2 = 0, action = A_CapeChase, } mobjinfo[MT_MULLIGAN] = { spawnstate = S_MULLIGANM, radius = 5*FRACUNIT, height = 30*FRACUNIT, mass = 0, flags = MF_NOGRAVITY } local nulliganrecord = 0 local mulligan = 0 local mulliganrecord = 0 local mulliganname local nulliganname addHook("NetVars", function(net) -- Setting the variable to net(variable) syncs it up. -- Pretty sure it'll be set to the server's though, might need to think about it. mulliganrecord = net(mulliganrecord) nulliganrecord = net(nulliganrecord) mulliganname = net(mulliganname) nulliganname = net(nulliganname) end) COM_AddCommand("mulliganr", function(p) CONS_Printf(p, "\136Current Mulligan record is:" + mulliganrecord+" By "+mulliganname) end) COM_AddCommand("nulliganr", function(p) CONS_Printf(p, "\143Current Nulligan record is:" + nulliganrecord+" By "+nulliganname) end) local function Mulligan(player) if player.mulligancombo == nil or player.nulligancombo == nil then player.mulligancombo = 0 player.nulligancombo = 0 end if mulligan == 1 then for i=1,#player.powers do player.powers[i-1] = 0 end if player.nulligancombo > nulliganrecord then nulliganrecord = player.nulligancombo nulliganname = player.name print("\131"+player.name+" got a Nulligan combo of "+player.nulligancombo+"! That's a new Record!") else if player.nulligancombo >= 5 then print("\132"+player.name+" got a Nulligan combo of "+player.nulligancombo+"! Current record is: "+nulliganrecord+" By "+nulliganname) end end player.powers[pw_flashing] = 105 player.pflags = player.pflags & ~PF_INVIS player.mo.state = S_PLAY_SUPER_TRANS1 mulligan = nil S_StartSound(player.mo, sfx_s227, player) player.mulliganIcon = P_SpawnMobj(player.mo.x,player.mo.y,player.mo.z+100*FRACUNIT,MT_MULLIGAN) player.mulliganIcon.target = player.mo player.mulliganIcon.state = S_MULLIGAN player.mulligancombo = player.mulligancombo+1 if player.mulligancombo >= 2 then CONS_Printf(player, "\136Mulligan combo X" + player.mulligancombo) end player.nulligancombo = 0 else if player.mulligancombo > mulliganrecord then mulliganrecord = player.mulligancombo mulliganname = player.name print("\130"+player.name+" got a Mulligan combo of "+player.mulligancombo+"! That's a new Record!") else if player.mulligancombo >= 5 then print("\133"+player.name+" got a Mulligan combo of "+player.mulligancombo+"! Current record is: "+mulliganrecord+" By "+mulliganname) end end player.mulligan = false mulligan = nil P_DamageMobj(player.mo, nil, nil, 1, DMG_INSTAKILL) player.mulliganIcon = P_SpawnMobj(player.mo.x,player.mo.y,player.mo.z+100*FRACUNIT,MT_MULLIGAN) player.mulliganIcon.target = player.mo player.mulliganIcon.state = S_MULLIGAN2 player.nulligancombo = player.nulligancombo+1 if player.nulligancombo >= 2 then CONS_Printf(player, "\143Nulligan combo X" + player.nulligancombo) end player.mulligancombo = 0 end end local function Mulligancc(player) if player.mulligancombo == nil or player.nulligancombo == nil then player.mulligancombo = 0 player.nulligancombo = 0 end if mulligan == 1 then for i=1,#player.powers do player.powers[i-1] = 0 end if player.nulligancombo > nulliganrecord then nulliganrecord = player.nulligancombo nulliganname = player.name print("\131"+player.name+" got a Nulligan combo of "+player.nulligancombo+"! That's a new Record!") else if player.nulligancombo >= 5 then print("\132"+player.name+" got a Nulligan combo of "+player.nulligancombo+"! Current record is: "+nulliganrecord+" By "+nulliganname) end end player.powers[pw_flashing] = 105 player.pflags = player.pflags & ~PF_INVIS player.mo.state = S_PLAY_SPRING mulligan = nil S_StartSound(player.mo, sfx_s227, player) player.mulliganIcon = P_SpawnMobj(player.mo.x,player.mo.y,player.mo.z+100*FRACUNIT,MT_MULLIGAN) player.mulliganIcon.target = player.mo player.mulliganIcon.state = S_MULLIGAN player.mulligancombo = player.mulligancombo+1 if player.mulligancombo >= 2 then CONS_Printf(player, "\136Mulligan combo X" + player.mulligancombo) end player.nulligancombo = 0 else if player.mulligancombo > mulliganrecord then mulliganrecord = player.mulligancombo mulliganname = player.name print("\130"+player.name+" got a Mulligan combo of "+player.mulligancombo+"! That's a new Record!") else if player.mulligancombo >= 5 then print("\133"+player.name+" got a Mulligan combo of "+player.mulligancombo+"! Current record is: "+mulliganrecord+" By "+mulliganname) end end player.mulligan = false mulligan = nil P_DamageMobj(player.mo, nil, nil, 1, DMG_INSTAKILL) player.mulliganIcon = P_SpawnMobj(player.mo.x,player.mo.y,player.mo.z+100*FRACUNIT,MT_MULLIGAN) player.mulliganIcon.target = player.mo player.mulliganIcon.state = S_MULLIGAN2 player.nulligancombo = player.nulligancombo+1 if player.nulligancombo >= 2 then CONS_Printf(player, "\143Nulligan combo X" + player.nulligancombo) end player.mulligancombo = 0 end end addHook("MobjDamage",function(target, inflictor, source, damage, damagetype) if multiplayer and not G_IsSpecialStage(gamemap) and G_GametypeUsesLives() then if damagetype ~= DMG_DEATHPIT and damagetype ~= DMG_CRUSHED then if target.skin ~= "mario" and target.skin ~= "luigi" and target.skin ~= "fluffy" and target.skin ~= "pointy" then if target.player.rings == 0 and target.player.powers[pw_shield] == SH_NONE then P_DoPlayerPain(target.player, source, inflictor) mulligan = P_RandomRange(1, 2) Mulligan(target.player) return true end else if target.skin ~= "fluffy" and target.skin ~= "pointy" then if target.player.mariohealth == 1 then P_DoPlayerPain(target.player, source, inflictor) mulligan = P_RandomRange(1, 2) Mulligan(target.player) return true end else if target.player.rings == 0 and target.player.powers[pw_shield] == SH_NONE then P_DoPlayerPain(target.player, source, inflictor) mulligan = P_RandomRange(1, 2) Mulligancc(target.player) return true end end end end end end, MT_PLAYER)