PWAD-- Fang's Six-Shooter Super Form by Ditchen Catastrophic -- Kinda reminds me of Psycho Waluigi in a way. local function createCorks(p, f) local flash = f or false for i = 1, 6 do local itemAng = i * ANG60 local cork = P_SPMAngle(p.mo, MT_CORK, itemAng, 0) if cork and cork.valid then cork.momx = FixedMul(8 * FRACUNIT, cos(itemAng)) cork.momy = FixedMul(8 * FRACUNIT, sin(itemAng)) cork.aaa = itemAng cork.swirl = 8 cork.thrown = false if flash then P_SpawnMobj(cork.x, cork.y, cork.z, MT_SUPERSPARK) end table.insert(p.SScorks, cork) else i = $ - 1 end end if flash then S_StartSound(p.mo, sfx_s3kcas) end end local function removeCorks(p, throw) if p.mo and p.valid then while #p.SScorks > 0 do if p.SScorks[1].valid then p.SScorks[1].thrown = throw if not throw then P_RemoveMobj(p.SScorks[1]) end end table.remove(p.SScorks, 1) end S_StartSound(p.mo, sfx_s3ka0) end end addHook("ThinkFrame", function(mo) for p in players.iterate do if p.mo and p.mo.valid then if p.mo.skin == "fang" then if not p.SSinit then p.SSinit = true p.SSfiredCorks = false p.SScorkRegenMax = 6 * TICRATE p.SScorkRegen = p.SScorkRegenMax p.SScorks = {} end if p.powers[pw_super] then if p.mo.state == S_PLAY_FIRE and not p.SSfiredCorks then p.SSfiredCorks = true if #p.SScorks == 0 then createCorks(p) else removeCorks(p, true) createCorks(p) end elseif p.mo.state ~= S_PLAY_FIRE then p.SSfiredCorks = false end if #p.SScorks < 6 then p.SScorkRegen = $ - 1 if p.SScorkRegen <= 0 then p.SScorkRegen = p.SScorkRegenMax removeCorks(p, false) createCorks(p, true) end end end for k, v in pairs(p.SScorks) do if not v.valid then table.remove(p.SScorks, k) end end if not p.powers[pw_super] and #p.SScorks > 0 then removeCorks(p, true) end end end end end) addHook("MobjThinker", function(mo) if mo.flags & MF_MISSILE and mo.target and mo.target.player and mo.target.player.valid then if mo.valid then if mo.thrown == nil or not mo.target.player.powers[pw_super] then return end if P_RandomRange(1, 50) == 1 then P_SpawnMobj(mo.x, mo.y, mo.z , MT_SUPERSPARK) end mo.colorized = true mo.color = mo.target.player.skincolor mo.flags = $|MF_NOGRAVITY|MF_NOBLOCKMAP|MF_NOCLIPHEIGHT if mo.thrown then if leveltime % 4 == 0 then mo.swirl = $ + 1 end mo.spinnnn = $ + ANG10 / 2 mo.momx = FixedMul((mo.swirl * FRACUNIT), cos(mo.spinnnn)) mo.momy = FixedMul((mo.swirl * FRACUNIT), sin(mo.spinnnn)) mo.flags = $ & ~MF_NOCLIP if 3 * TICRATE == mo.swirl and mo.valid then P_RemoveMobj(mo) end return end if leveltime % 3 == 0 then mo.rollangle = $1 + (P_RandomRange(1, 5) * ANGLE_45) end local inDanger = P_LookForEnemies(mo.target.player, false, true) if inDanger and inDanger.valid then P_SpawnLockOn(mo.target.player, inDanger, mobjinfo[MT_LOCKON].spawnstate) end if mo.target.player.cmd.buttons & BT_USE and not P_IsObjectOnGround(mo.target) then if not mo.target.player.SSfiredCork then mo.corkTarget = P_LookForEnemies(mo.target.player, false, true) if mo.corkTarget and mo.corkTarget.valid then mo.target.player.SSfiredCork = true mo.target.player.SScorkRegen = mo.target.player.SScorkRegenMax S_StartSound(mo, sfx_s3k81) end end elseif mo.target.player.SSfiredCork then mo.target.player.SSfiredCork = false end if mo.corkTarget then if mo.corkTarget.valid then if P_RandomRange(1, 5) == 1 or mo.engaged then P_HomingAttack(mo, mo.corkTarget) P_SpawnGhostMobj(mo) mo.engaged = true mo.flags = $ & ~MF_NOCLIP end else mo.engaged = false end end if not mo.engaged then if not mo.spinnnn then mo.spinnnn = mo.aaa end mo.spinnnn = $ + (2 * (ANG10 / 3)) mo.momx = FixedMul(32 * FRACUNIT, cos(mo.spinnnn)) mo.momy = FixedMul(32 * FRACUNIT, sin(mo.spinnnn)) mo.z = mo.target.player.mo.z + (mo.target.player.mo.height / 2) A_UnidusBall(mo) mo.flags = $|MF_NOCLIP end end end end, MT_CORK) local function SSHud(v, p) if p.mo then if p.mo.skin ~= "fang" then return end v.drawString(17, 168, "Corks " .. tostring(#p.SScorks), V_SNAPTOBOTTOM|V_SNAPTOLEFT) end end --hud.add(SSHud, "game") name = fang flags = SF_SUPER|SF_NOJUMPSPIN|SF_NOJUMPDAMAGE ILUA_FANGU;P_SKIN