Workshop.codes
Create

This code is over 6 months old. The code may have expired and might no longer function.

A Fall damage tool
Fall damage formula (fall speed) x (max health) / 200 x (fall speed) / 8 x (fall damage modifier)

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

variables
{
    global:
        107: Fall_damage_mod

    player:
        108: Fall_damage_speed
}

rule("Fall damage init -----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I-----I")
{
    event
    {
        Ongoing - Global;
    }

    actions
    {
        Global.Fall_damage_mod = Workshop Setting Real(Custom String("Fall Damage Mod"), Custom String(
            "Fall Damage Modifier (Can one shot if above 2)"), 1, 0.010, 10, 0);
    }
}

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

    conditions
    {
        Is On Ground(Event Player) == True;
        Event Player.Fall_damage_speed < -10;
        (Workshop Setting Toggle(Custom String("Fall Damage Mod"), Custom String("Make Bap immune against falldamage"), True, 1)
            == True ? Hero Of(Event Player) : Empty Array) != Hero(Baptiste);
        (Workshop Setting Toggle(Custom String("Fall Damage Mod"), Custom String("Make Ball immune against falldamage"), True, 2)
            == True ? Hero Of(Event Player) : Empty Array) != Hero(Wrecking Ball);
        (Hero Of(Event Player) == Hero(Wrecking Ball) && Vertical Speed Of(Event Player) < -30) != True;
        (Hero Of(Event Player) == Hero(Genji) && Is Using Ability 1(Event Player) == True) != True;
        "to make hero immune copy paste this and enable it and set hero to whatever hero you want to make immune"
        disabled Hero Of(Event Player) != Hero(Ana);
    }

    actions
    {
        Damage(Event Player, Null, Absolute Value(Event Player.Fall_damage_speed) * Max Health(Event Player) / 200 * (Absolute Value(
            Event Player.Fall_damage_speed) / 8) * Global.Fall_damage_mod);
    }
}

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("Debug Hud (Disable 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),
            Absolute Value(Vertical Speed Of(Event Player)) * Max Health(Event Player) / 200 * (Vertical Speed Of(Event Player) / 8)
            * Global.Fall_damage_mod), Null, Null, Left, 0, Color(White), Color(White), Color(White), Visible To and String,
            Default Visibility);
    }
}
Players | 1 - 12
Categories: Tools
Tags: fall damage
Heroes: D.va, Doomfist, Junker Queen, Mauga, Orisa, and 34 more...
Created at:
Last updated:
Current version: 1.03

Snippet

Loading...

Users Also Like

Similar Codes

Workshop.codes
Join the Workshop.codes Discord