//Healing (Code to heal other players (increase Ring count or HP)) --Healing flags addHook("PlayerThink", function(player) if player.mo and player.mo.valid then --No skin check this time, this hook applies to everyone! if player.pfhealingflag == nil then player.pfhealingflag = 0 end if player.pfhealingflag ~= 0 then if not (leveltime%(TICRATE*4)) then player.pfhealingflag = 0 --Reset the healing flag on a character who isn't being healed end end if player.pfhealingflag == 1 or player.pfhealingflag == 2 or player.pfhealingflag == 3 or player.pfhealingflag == 4 then --For any version of Annie's healing if not (leveltime%TICRATE) then if player.powers[pw_super] > 0 then P_GivePlayerRings(player, 1) --Counteract Super ring drain end if (player.mo.subsector.sector.special == 9 and P_IsObjectOnGround(player.mo) == true) or player.mo.subsector.sector.special == 10 then P_GivePlayerRings(player, 2) --Counteract Ring drain sectors end end end if player.pfhealingflag == 1 then --For basic healing applied to a player other than Annie herself if not (leveltime%TICRATE) then if player.mo.energy ~= nil then --if the player being healed has an energy meter (i.e. is one of the Belnades sisters) player.mo.energy = $ + 3*FRACUNIT end end end if player.pfhealingflag == 2 then --For accelerated healing applied to a player other than Annie herself if not (leveltime%TICRATE) then if player.mo.energy ~= nil then --if the player being healed has an energy meter (i.e. is one of the Belnades sisters) player.mo.energy = $ + 6*FRACUNIT end end end end end) --Healing sound sfxinfo[sfx_heal] = { singular = false, priority = 16, caption = "Healing", flags = SF_NOMULTIPLESOUND } --Healing hook addHook("PlayerThink", function(player) if player.mo and player.mo.valid then --check if the player object exists if player.mo.skin ~= "annie_belnades" then --is the player NOT playing as Annie? return --stop running hook for this player end /*if player.custom1down == nil then player.custom1down = 0 end if player.cmd.buttons & BT_CUSTOM1 > 0 then player.custom1down = $1 + 1 else player.custom1down = 0 end*/ if player.custom1down > 1 --if custom1 is being pressed and player.custom3down == 0 --and custom3 is not being pressed and player.mo.energy >= 5*FRACUNIT/2 then if not (leveltime%TICRATE) then if player.mo.energy >= 5*FRACUNIT/2 then player.mo.energy = $ - 5*FRACUNIT/2 S_StartSoundAtVolume(player.mo, sfx_heal, 90, nil) if not (player.custom1down%(TICRATE*2)) then --Every 2 seconds if P_LookForPlayers(player.mo, 20*FRACUNIT, true, false) == true then --Is there another player within 20 fracunits of Annie? local target = player.mo.target.player --defining the player found in P_LookForPlayers as the target for the rest of the healing script if target.player and target.player.valid and target.player.playerstate ~= PST_DEAD and target.player.mo ~= player.mo then --Is there a live player OTHER THAN Annie herself within 20 fracunits of her? if G_CoopGametype() == true or (G_GametypeHasTeams() == true and player.ctfteam == target.player.ctfteam) then --Is that other player on the same team as Annie? if P_CheckSight(player.mo, target.player) == true then --Can Annie actually see the other player? if target.player.skin == ("basesamus" or "samus") then --Healing Samus Aran target.player.sam_energy = $ + 15 end if target.player.skin == ("Mario" or "Luigi") then --Healing the Mario Bros. target.player.mariocoins = $ + 1 end if target.player.skin == "sgimario" then --Healing N64 Mario target.player.rkyHealth = $ + 136 end if target.player.skin == "lilac" then --Healing Lilac target.player.oldrings = $ + 5 end if target.player.skin == "drone" then --Healing Drone and refilling its energy target.dvars.hull = $ + 2 target.dvars.energy = $ + 25 end if target.player.skin == "ass" then --restore Almost Super Sonic's depleted stats if target.player.normalspeed < skins[target.player.mo.skin].normalspeed then target.player.normalspeed = $ + 1 end if target.player.jumpfactor < skins[target.player.mo.skin].jumpfactor then target.player.jumpfactor = $ + 1*FRACUNIT/100 end if target.player.actionspd < skins[target.player.mo.skin].actionspd then target.player.actionspd = $ + 1 end if target.player.mindash < skins[target.player.mo.skin].mindash then target.player.mindash = $ + 1 end if target.player.maxdash < skins[target.player.mo.skin].maxdash then target.player.maxdash = $ + 1 end end if target.player.skin == "satsr_sonic" then target.player.soulgauge = $ + 25 end P_GivePlayerRings(target.player, 1) --Heal the other player target.player.pfhealingflag = 1 --Flag to tell the game that Annie is applying basic healing to a player other than herself end end end end else P_GivePlayerRings(player, 1) --If Annie can't find another player to heal, she heals herself player.pfhealingflag = 3 --Flag to tell the game that Annie is applying basic healing to herself end else return end end end end end) //Accelerated Healing (Code to double the speed of healing) addHook("PlayerThink", function(player) if player.mo and player.mo.valid then if player.mo.skin ~= "annie_belnades" then return end /*if player.custom1down == nil then player.custom1down = 0 end if player.cmd.buttons & BT_CUSTOM1 > 0 then player.custom1down = $1 + 1 else player.custom1down = 0 end*/ if player.custom1down > 1 --if custom1 is currently being pressed and player.custom3down > 1 --and custom3 is also currently being pressed and player.custom1down > player.custom3down --and custom1 was pressed *before* custom3 and player.mo.energy >= 5*FRACUNIT then --and the player has energy if not (leveltime%TICRATE) then if player.mo.energy >= 5*FRACUNIT then player.mo.energy = $ - 5*FRACUNIT S_StartSoundAtVolume(player.mo, sfx_heal, 120, nil) if not (player.custom1down%TICRATE) then --Every second if P_LookForPlayers(player.mo, 20*FRACUNIT, true, false) == true then --Is there another player within 20 fracunits of Annie? local target = player.mo.target.player --defining the player found in P_LookForPlayers as the target for the rest of the healing script if target.player and target.player.valid and target.player.playerstate ~= PST_DEAD and target.player.mo ~= player.mo then --Is there a live player OTHER THAN Annie herself within 20 fracunits of her? if G_CoopGametype() == true or (G_GametypeHasTeams() == true and player.ctfteam == target.player.ctfteam) then --Is that other player on the same team as Annie? if P_CheckSight(player.mo, target.player) == true then --Can Annie actually see the other player? if target.player.skin == ("basesamus" or "samus") then --Healing Samus Aran target.player.sam_energy = $ + 30 end if target.player.skin == ("Mario" or "Luigi") then --Healing the Mario Bros. target.player.mariocoins = $ + 2 end if target.player.skin == "sgimario" then --Healing N64 Mario target.player.rkyHealth = $ + 272 end if target.player.skin == "lilac" then --Healing Lilac target.player.oldrings = $ + 10 end if target.player.skin == "drone" then --Healing Drone and refilling its energy target.dvars.hull = $ + 4 target.dvars.energy = $ + 50 end if target.player.skin == "ass" then --restore Almost Super Sonic's depleted stats if target.player.normalspeed < skins[target.player.mo.skin].normalspeed then target.player.normalspeed = $ + 2 end if target.player.jumpfactor < skins[target.player.mo.skin].jumpfactor then target.player.jumpfactor = $ + 2*FRACUNIT/100 end if target.player.actionspd < skins[target.player.mo.skin].actionspd then target.player.actionspd = $ + 2 end if target.player.mindash < skins[target.player.mo.skin].mindash then target.player.mindash = $ + 2 end if target.player.maxdash < skins[target.player.mo.skin].maxdash then target.player.maxdash = $ + 2 end end if target.player.skin == "satsr_sonic" then target.player.soulgauge = $ + 50 end P_GivePlayerRings(target.player, 2) --Heal the other player target.player.pfhealingflag = 2 --Flag to tell the game that Annie is applying accelerated healing to a character other than herself end end end end else P_GivePlayerRings(player, 2) --If Annie can't find another player to heal, she heals herself player.pfhealingflag = 4 --Flag to tell the game that Annie is applying accelerated healing to herself end else return end end end end end)