VerseIsland
FeedLearnLeaderboardGuidesReferenceExploreSearchDocsVerse Library
Sign in
Feed Learn 📖 Codex Leaderboard Guides Reference Explore Search Docs Verse Library
Browse Community Snippets›Devices·Up to Community Snippets · Devices·1 of 70 in Devices

Customizable Siphon Device

7887 Views

Report

  • using { /Fortnite.com/Characters }
    using { /Fortnite.com/Devices }
    using { /Fortnite.com/Game }
    using { /UnrealEngine.com/Temporary/Diagnostics }
    using { /Verse.org/Simulation }
    
    #░█████╗░░█████╗░░██████╗███╗░░░███╗██╗░█████╗░░██████╗██╗░░██╗░█████╗░██╗░░░░░██╗░░░░░#
    #██╔══██╗██╔══██╗██╔════╝████╗░████║██║██╔══██╗██╔════╝██║░██╔╝██╔══██╗██║░░░░░██║░░░░░#
    #██║░░╚═╝██║░░██║╚█████╗░██╔████╔██║██║██║░░╚═╝╚█████╗░█████═╝░██║░░██║██║░░░░░██║░░░░░#
    #██║░░██╗██║░░██║░╚═══██╗██║╚██╔╝██║██║██║░░██╗░╚═══██╗██╔═██╗░██║░░██║██║░░░░░██║░░░░░#
    #╚█████╔╝╚█████╔╝██████╔╝██║░╚═╝░██║██║╚█████╔╝██████╔╝██║░╚██╗╚█████╔╝███████╗███████╗#
    #░╚════╝░░╚════╝░╚═════╝░╚═╝░░░░░╚═╝╚═╝░╚════╝░╚═════╝░╚═╝░░╚═╝░╚════╝░╚══════╝╚══════╝#
    
    # TOOL TIPS
    ActivatingTriggerTip<localizes>:message=
        "Trigger activates Siphon"
    StatToModifyTip<localizes>:message=
        "Heal types effected by Siphon"
    SiphonEffectTip<localizes>:message=
        "Flat: Instant Change. Steady: Change Overtime. SetTo: Instantly Sets Health."
    SiphonAmountTip<localizes>:message=
        "How much health/shield granted in total"
    SiphonDurationTip<localizes>:message=
        "How long Siphon takes to finish (only applies to Steady)"
    TickRateTip<localizes>:message=
        "How many ticks per second (only applies to Steady)"
    # SIPHON STAT TYPE
    siphon_stat_type := enum:
        Health
        Shield
        Both
    # SIPHON EFFECT TYPE
    siphon_effect_type := enum:
        FlatIncrease
        SteadyIncrease
        FlatDecrease
        SteadyDecrease
        SetTo
    Siphon := class(creative_device):
    # EDITABLES / VARIABLES
        @editable:
            ToolTip := ActivatingTriggerTip    
        ActivatingTrigger : trigger_device = trigger_device{}
        @editable:
            ToolTip := StatToModifyTip    
        StatToModify : siphon_stat_type = siphon_stat_type.Health
        @editable:
            ToolTip := SiphonEffectTip
        SiphonEffect : siphon_effect_type = siphon_effect_type.SteadyIncrease
        @editable:
            ToolTip := SiphonAmountTip
        var SiphonAmount : float = 75.0
        @editable:
            ToolTip := SiphonDurationTip    
        var SiphonDuration : float = 7.5
        @editable:
            ToolTip := TickRateTip
        var TickRate : float = 2.0
        var AmountPerTick : float = 0.0
        var SteadyTickRate : float = 0.0
    # ON BEGIN
        OnBegin<override>()<suspends>:void=
            set AmountPerTick = SiphonAmount/(TickRate*SiphonDuration) 
            set SteadyTickRate = 1.0/TickRate
            ActivatingTrigger.TriggeredEvent.Subscribe(ActivateSiphon)
            DebugSiphon()
    # ACTIVATE SIPHON FUNCTION
        ActivateSiphon(Agent : ?agent):void=
            if (EliminatorCharacter := Agent?.GetFortCharacter[]):
                spawn{ApplySiphonEffect(EliminatorCharacter)}
    # APPLY SIPHON EFFECTS
        ApplySiphonEffect(FC : fort_character)<suspends>:void=
            var TotalTicks : float = SiphonDuration * TickRate
            # FLAT INCREASE
                if (SiphonEffect = siphon_effect_type.FlatIncrease):
                    if (StatToModify = siphon_stat_type.Health): # HEALTH
                        FC.IncreaseHealth(SiphonAmount)
                    if (StatToModify = siphon_stat_type.Shield): # SHIELD
                        FC.IncreaseShield(SiphonAmount)
                    if (StatToModify = siphon_stat_type.Both): # BOTH
                        FC.IncreaseAsOne(SiphonAmount)
            # STEADY INCREASE
                if (SiphonEffect = siphon_effect_type.SteadyIncrease):
                    if (StatToModify = siphon_stat_type.Health): # HEALTH
                        loop:
                            if (TotalTicks <= 0.0):
                                set TotalTicks = SiphonDuration * TickRate
                                break
                            FC.IncreaseHealth(AmountPerTick)
                            Sleep(SteadyTickRate)
                            set TotalTicks -= 1.0
                    if (StatToModify = siphon_stat_type.Shield): # SHIELD
                        loop:
                            if (TotalTicks <= 0.0):
                                set TotalTicks = SiphonDuration * TickRate
                                break
                            FC.IncreaseShield(AmountPerTick)
                            Sleep(SteadyTickRate)
                            set TotalTicks -= 1.0
                    if(StatToModify = siphon_stat_type.Both): # BOTH
                        loop:
                            if (TotalTicks <= 0.0):
                                set TotalTicks = SiphonDuration * TickRate
                                break
                            FC.IncreaseAsOne(AmountPerTick)
                            Sleep(SteadyTickRate)
                            set TotalTicks -= 1.0
            # FLAT DECREASE
                if (SiphonEffect = siphon_effect_type.FlatDecrease):
                    if (StatToModify = siphon_stat_type.Health): # HEALTH
                        FC.DecreaseHealth(SiphonAmount)
                    if (StatToModify = siphon_stat_type.Shield): # SHIELD
                        FC.DecreaseShield(SiphonAmount)
                    if (StatToModify = siphon_stat_type.Both): # BOTH
                        FC.DecreaseAsOne(SiphonAmount)
            # STEADY DECREASE
                if (SiphonEffect = siphon_effect_type.SteadyDecrease):
                    if (StatToModify = siphon_stat_type.Health): # HEALTH
                        loop:
                            if (TotalTicks <= 0.0):
                                set TotalTicks = SiphonDuration * TickRate
                                break
                            FC.DecreaseHealth(AmountPerTick)
                            Sleep(SteadyTickRate)
                            set TotalTicks -= 1.0
                    if (StatToModify = siphon_stat_type.Shield): # SHIELD
                        loop:
                            if (TotalTicks <= 0.0):
                                set TotalTicks = SiphonDuration * TickRate
                                break
                            FC.DecreaseShield(AmountPerTick)
                            Sleep(SteadyTickRate)
                            set TotalTicks -= 1.0
                    if (StatToModify = siphon_stat_type.Both): # BOTH
                        loop:
                            if (TotalTicks <= 0.0):
                                set TotalTicks = SiphonDuration * TickRate
                                break
                            FC.DecreaseAsOne(AmountPerTick)
                            Sleep(SteadyTickRate)
                            set TotalTicks -= 1.0
            # SET TO
                if (SiphonEffect = siphon_effect_type.SetTo):
                    if (StatToModify = siphon_stat_type.Health or StatToModify = siphon_stat_type.Both): # HEALTH / BOTH
                        FC.SetHealth(SiphonAmount)
                    if (StatToModify = siphon_stat_type.Shield or StatToModify = siphon_stat_type.Both): # SHIELD / BOTH
                        FC.SetShield(SiphonAmount)
    # HEALTH (VALUES)
        (Char:fort_character).IncreaseHealth(Amount:float):void=
            Char.SetHealth(Char.GetHealth()+Amount)
        (Char:fort_character).DecreaseHealth(Amount:float):void=
            Char.SetHealth(Char.GetHealth()-Amount)
            if(Char.GetHealth()<=Amount):
                Char.Damage(Char.GetShield()+2.0)
    # SHIELD (VALUES)
        (Char:fort_character).IncreaseShield(Amount:float):void=
            Char.SetShield(Char.GetShield()+Amount)
        (Char:fort_character).DecreaseShield(Amount:float):void=
            Char.SetShield(Char.GetShield()-Amount)
    # HEALTH & SHIELD (VALUES)
        (Char:fort_character).IncreaseBoth(Amount:float):void=
            Char.SetHealth(Char.GetHealth()+Amount)
            Char.SetShield(Char.GetShield()+Amount)
        (Char:fort_character).DecreaseBoth(Amount:float):void=
            Char.SetHealth(Char.GetHealth()-Amount)
            Char.SetShield(Char.GetShield()-Amount)
            if(Char.GetHealth()<=Amount):
                Char.Damage(Char.GetShield()+2.0)
    # HEALTH -> SHIELD (VALUES)
        (Char:fort_character).IncreaseAsOne(Amount:float):void=
            OverflowAmount := Char.GetHealth()+Amount-100.0
            if(OverflowAmount > 0.0):
                Char.SetHealth(100.0)
                Char.SetShield(Char.GetShield()+OverflowAmount)
            else:
                Char.SetHealth(Char.GetHealth()+Amount)
    # SHIELD -> HEALTH (VALUES)
        (Char:fort_character).DecreaseAsOne(Amount:float):void=
            UnderflowAmount := Char.GetShield()-Amount
            if(UnderflowAmount < 0.0):
                Char.SetShield(0.0)
                Char.SetHealth(Char.GetHealth()+UnderflowAmount)
                if(Char.GetHealth()+Char.GetShield()<=Amount):
                    Char.Damage(Char.GetShield()+Char.GetHealth()+2.0)
            else:
                Char.SetShield(UnderflowAmount)
    # DEBUG
        DebugSiphon():void=
            Print("Total of {SiphonAmount} Health and/or Shield")
            if(SiphonEffect = siphon_effect_type.SteadyIncrease or SiphonEffect = siphon_effect_type.SteadyDecrease):
                Print("Every {SteadyTickRate} seconds, there is {AmountPerTick} Siphon applied. Total of {SiphonDuration} seconds.")
    

You're reading a preview

The full reference is free for BrainDeadGuild Discord members — sign in to read it all, or open the original at the source.

Sign in with Discord — free for members Read the original at Epic Games documentation

Sign in with your BrainDead.TV / BrainDeadGuild Discord account for full access.

Guided course

Add this to your free study plan — we’ll suggest related material and stitch it into one compile-checked lesson.

Keep exploring
More in Devices · 1 of 70
Next
fortnite fully customizable ui button verse device

Source

Epic Games documentation

View original

Last updated 2026-07-26T12:21:53.902576+00:00

VerseIsland· an archipelago of Verse & UEFN knowledge
🗺️ Island atlasLearnGuidesHistoryAbout & PressSources & LicensingPrivacy PolicyTermsStatus

Not affiliated with Epic Games. Fortnite, UEFN, Unreal Engine, and Verse are trademarks of Epic Games, Inc. Content is attributed to its source — see Sources & Licensing.

🦜

Scout · your island guide

The Isle of Verse