Workshop.codes
Login
Create
A_literal_who

Fall damage Tool

A Fall damage tool

Fall damage formula

fall speed ^ fall damage exponent * (max health * fall damage modifier) / 1000

-----| Copy text below if your on pc otherwise use the AD2RE to import |-----

variables
{
    global:
        107: Fall_damage_mod
        108: Fall_damage_exp

    player:
        26: Fall_damage_IsAException
        27: Fall_damage_Resistance
        108: Fall_damage_Speed
}

rule("Fall damage Values  (Change here) -----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I")
{
    event
    {
        Ongoing - Global;
    }

    actions
    {
        "change values here"
        Global.Fall_damage_mod = 1;
        Global.Fall_damage_exp = 2;
    }
}

rule("Apply damage")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        Is On Ground(Event Player) == True;
        Absolute Value(Event Player.Fall_damage_Speed) > 10 + Event Player.Fall_damage_Resistance;
        "List of exepmt heroes"
        Hero Of(Event Player) != Hero(Baptiste);
    }

    actions
    {
        If(Event Player.Fall_damage_IsAException == True || Event Player.Fall_damage_Speed < -30);
            Event Player.Fall_damage_Speed = 0;
        Else;
            Damage(Event Player, Null, Absolute Value(Event Player.Fall_damage_Speed) ^ Global.Fall_damage_exp * (Max Health Of Type(
                Event Player, Health) + Max Health Of Type(Event Player, Armor) + Max Health Of Type(Event Player, Shields))
                * Global.Fall_damage_mod * 0.001);
            Event Player.Fall_damage_Speed = 0;
    }
}

rule("Find speed")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        Altitude Of(Event Player) < 1;
        Is In Air(Event Player) == True;
    }

    actions
    {
        Event Player.Fall_damage_Speed = Vertical Speed Of(Event Player);
    }
}

rule("[Exception] Anran Dash")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Anran) || Hero Being Duplicated(Event Player) == Hero(Anran)) && Is Using Ability 1(Event Player))
            == True;
    }

    actions
    {
        Event Player.Fall_damage_IsAException = True;
        Wait Until(!Is Using Ability 1(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_IsAException = False;
    }
}

rule("[Exception] Genji Dash")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Genji) || Hero Being Duplicated(Event Player) == Hero(Genji)) && Is Using Ability 1(Event Player))
            == True;
    }

    actions
    {
        Event Player.Fall_damage_IsAException = True;
        Wait Until(!Is Using Ability 1(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_IsAException = False;
    }
}

rule("[Exception] Mauga Dash")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Mauga) || Hero Being Duplicated(Event Player) == Hero(Mauga)) && Is Using Ability 1(Event Player))
            == True;
    }

    actions
    {
        Event Player.Fall_damage_IsAException = True;
        Wait Until(!Is Using Ability 1(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_IsAException = False;
    }
}

rule("[Exception] Doom Leap")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Doomfist) || Hero Being Duplicated(Event Player) == Hero(Doomfist)) && Is Using Ability 1(
            Event Player)) == True;
    }

    actions
    {
        Event Player.Fall_damage_IsAException = True;
        Wait Until(!Is Using Ability 1(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_IsAException = False;
    }
}

rule("[Exception] Venture Drill")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Venture) || Hero Being Duplicated(Event Player) == Hero(Venture)) && Is Firing Secondary(
            Event Player)) == True;
    }

    actions
    {
        Event Player.Fall_damage_IsAException = True;
        Wait Until(!Is Firing Secondary(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_IsAException = False;
    }
}

rule("[Exception] Winston Leap")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Winston) || Hero Being Duplicated(Event Player) == Hero(Winston)) && Is Using Ability 1(
            Event Player)) == True;
    }

    actions
    {
        Event Player.Fall_damage_IsAException = True;
        Wait Until(!Is Using Ability 1(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_IsAException = False;
    }
}

rule("[Exception] Wujang Staff")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Wuyang) || Hero Being Duplicated(Event Player) == Hero(Wuyang)) && Is Using Ability 2(
            Event Player)) == True;
    }

    actions
    {
        Event Player.Fall_damage_IsAException = True;
        Wait Until(!Is Using Ability 2(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_IsAException = False;
    }
}

rule("[Resistance] Emre Pistol")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Emre) || Hero Being Duplicated(Event Player) == Hero(Emre)) && Is Using Ability 1(Event Player))
            == True;
    }

    actions
    {
        Event Player.Fall_damage_Resistance = 5;
        Wait Until(!Is Using Ability 1(Event Player), 99);
        Wait(0.750, Ignore Condition);
        Event Player.Fall_damage_Resistance = 0;
    }
}

rule("[Resistance] Wujang Rush")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    conditions
    {
        ((Hero Of(Event Player) == Hero(Wuyang) || Hero Being Duplicated(Event Player) == Hero(Wuyang)) && Is Using Ability 1(
            Event Player)) == True;
    }

    actions
    {
        Event Player.Fall_damage_Resistance = 5;
        Wait Until(!Is Using Ability 1(Event Player), 99);
        Wait(0.250, Ignore Condition);
        Event Player.Fall_damage_Resistance = 0;
    }
}

rule("Debug Hud (Disable or delete this when done tweaking fall damage values) -----I-----I-----I-----I-----I")
{
    event
    {
        Ongoing - Each Player;
        All;
        All;
    }

    actions
    {
        Create HUD Text(Event Player, Custom String("Fall speed {0} | Damage you will take {1}", Vertical Speed Of(Event Player),
            Round To Integer(Absolute Value(Vertical Speed Of(Event Player)) ^ Global.Fall_damage_exp * Max Health(Event Player)
            * Global.Fall_damage_mod * 0.001, To Nearest)), Null, Null, Left, 0, Color(White), Color(White), Color(White),
            Visible To and String, Default Visibility);
    }
}
Workshop.codes