Create
Return to post

Comparing difference between and

View raw
  • variables
  • {
  • global:
  • 0: CurrentTime
  • 1: MaxTime
  • 2: RespawnTime
  • 3: StartSpeedUp
  • 4: TeamSizeDifference
  • 7: RestrictedHeroPool
  • player:
  • 0: Health
  • 1: Ultimate
  • 2: Effect
  • 3: DifferenceBonus
  • 4: NextHero
  • 5: DamageBonus
  • 6: DebugField
  • 7: HealthBonus
  • 8: RandomHeroList
  • }
  • subroutines
  • {
  • 0: SetDifferences
  • 1: ApplyDifferences
  • 2: RandomHeroPick
  • 3: WaitRandomTime
  • 4: ApplyHealthAndUltimate
  • 5: SetHealthAndUltimate
  • 6: RestrictHeroes
  • }
  • rule("Base: Limit Hero Pool")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.RestrictedHeroPool = All Heroes;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Healers"), Custom String("Ana"), False, 1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Ana));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Ashe"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Ashe));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Healers"), Custom String("Baptiste"), False, 1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Baptiste));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Bastion"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Bastion));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Healers"), Custom String("Brigitte"), False, 1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Brigitte));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("D.VA"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(D.Va));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Doomfist"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Doomfist));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Echo"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Echo));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Genji"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Genji));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Hanzo"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Hanzo));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Junkrat"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Junkrat));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Healers"), Custom String("Lúcio"), False, 1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Lúcio));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("McRee"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(McCree));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Mei"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Mei));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Healers"), Custom String("Mercy"), False, 1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Mercy));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Healers"), Custom String("Moira"), False, 1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Moira));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("Orisa"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Orisa));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Pharah"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Pharah));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Reaper"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Reaper));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("Reinhardt"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Reinhardt));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("Roadhog"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Roadhog));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("Sigma"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Sigma));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Soldier 76"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Soldier: 76));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Sombra"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Sombra));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Symmetra"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Symmetra));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Torbjörn"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Torbjörn));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Tracer"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Tracer));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Damage"), Custom String("Widowmaker"), False, 0));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Widowmaker));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("Winston"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Winston));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("Wrecking Ball"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Wrecking Ball));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Tanks"), Custom String("Zarya"), False, -1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Zarya));
  • End;
  • If(Workshop Setting Toggle(Custom String("Disabled Heroes - Healers"), Custom String("Zenyatta"), False, 1));
  • Global.RestrictedHeroPool = Remove From Array(Global.RestrictedHeroPool, Hero(Zenyatta));
  • End;
  • Call Subroutine(RestrictHeroes);
  • }
  • }
  • rule("Global: Set Global Variables (ALL)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.MaxTime = Workshop Setting Integer(Custom String("Swap Timer"), Custom String("Seconds until swap"), 15, 5, 100, 0);
  • Global.CurrentTime = Global.MaxTime;
  • Global.RespawnTime = Workshop Setting Integer(Custom String("Respawing"), Custom String("Time in seconds"), 15, 0, 100, 0);
  • Global.StartSpeedUp = Workshop Setting Real(Custom String("Game Start"), Custom String("Speedup multiplier"), 1, 1, 5, 0);
  • All Players(All Teams).DifferenceBonus = 1;
  • Global.TeamSizeDifference = 1;
  • }
  • }
  • rule("Global: Set Global Variables (Deathmatch)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Current Game Mode == Game Mode(Deathmatch);
  • }
  • actions
  • {
  • Event Player.DifferenceBonus = 1;
  • }
  • }
  • rule("Global: Set Global Variables (No Deathmatch)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == False;
  • Current Game Mode != Game Mode(Deathmatch);
  • }
  • actions
  • {
  • Call Subroutine(SetDifferences);
  • }
  • }
  • rule("Balance: Apply Differences foreach at start")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • disabled Is Assembling Heroes == False;
  • }
  • actions
  • {
  • disabled Event Player.DifferenceBonus = 1;
  • Call Subroutine(ApplyDifferences);
  • "Set Next heroes"
  • Call Subroutine(RandomHeroPick);
  • Call Subroutine(SetHealthAndUltimate);
  • Call Subroutine(ApplyHealthAndUltimate);
  • }
  • }
  • rule("Balance: Team Size Difference (Player Join)")
  • {
  • event
  • {
  • Player Joined Match;
  • All;
  • All;
  • }
  • conditions
  • {
  • Current Game Mode != Game Mode(Deathmatch);
  • }
  • actions
  • {
  • Call Subroutine(SetDifferences);
  • Call Subroutine(RestrictHeroes);
  • }
  • }
  • rule("Balance: Team Size Difference (Player Left)")
  • {
  • event
  • {
  • Player Left Match;
  • All;
  • All;
  • }
  • conditions
  • {
  • Current Game Mode != Game Mode(Deathmatch);
  • }
  • actions
  • {
  • Call Subroutine(SetDifferences);
  • }
  • }
  • rule("Balance: SetPlayerDifferences")
  • {
  • event
  • {
  • Subroutine;
  • SetDifferences;
  • }
  • actions
  • {
  • Global.TeamSizeDifference = Max(Number Of Players(Team 1), Number Of Players(Team 2)) / Min(Number Of Players(Team 1),
  • Number Of Players(Team 2));
  • If(Number Of Players(Team 1) > Number Of Players(Team 2));
  • All Players(Team 1).DifferenceBonus = 1;
  • All Players(Team 2).DifferenceBonus = 1 * Global.TeamSizeDifference;
  • Else If(Number Of Players(Team 1) < Number Of Players(Team 2));
  • All Players(Team 1).DifferenceBonus = 1 * Global.TeamSizeDifference;
  • All Players(Team 2).DifferenceBonus = 1;
  • Else;
  • All Players(Team 1).DifferenceBonus = 1;
  • All Players(Team 2).DifferenceBonus = 1;
  • }
  • }
  • rule("Balance: Apply Differences")
  • {
  • event
  • {
  • Subroutine;
  • ApplyDifferences;
  • }
  • actions
  • {
  • Event Player.HealthBonus = 100 + 100 * (Event Player.DifferenceBonus - 1) * Workshop Setting Real(Custom String("Handicap"),
  • Custom String("Health Limiter (0 = normal, 1 = double (relative to team sizes))"), 0.500, 0, 1, 0);
  • Set Max Health(Event Player, Event Player.HealthBonus);
  • Event Player.DamageBonus = 100 + 100 * (Event Player.DifferenceBonus - 1) * Workshop Setting Real(Custom String("Handicap"),
  • Custom String("Damage Limiter (0 = normal, 1 = double (relative to team sizes))"), 0.500, 0, 1, 0);
  • Set Damage Dealt(Event Player, Event Player.DamageBonus);
  • }
  • }
  • rule("QuickStart: StartTimeSpeedUp")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Game In Progress == False;
  • Is Assembling Heroes == False;
  • }
  • actions
  • {
  • Set Match Time(Match Time / Global.StartSpeedUp);
  • Set Move Speed(All Players(All Teams), 100 * Global.StartSpeedUp);
  • "Wait some time"
  • Wait(Match Time / Global.StartSpeedUp, Ignore Condition);
  • Set Move Speed(All Players(All Teams), 100);
  • }
  • }
  • rule("QuickStart: RespawnTime")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Set Respawn Max Time(Event Player, Global.RespawnTime);
  • }
  • }
  • rule("QuickStart: Set Assembly time to lower")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • "Is Assembly"
  • Is Assembling Heroes == True;
  • }
  • actions
  • {
  • "Set Match Time"
  • Set Match Time(10);
  • }
  • }
  • rule("Base: SwapTimer")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == False;
  • "Timer is above -1"
  • Global.CurrentTime >= 0;
  • }
  • actions
  • {
  • "Decrease time"
  • Global.CurrentTime -= 1;
  • "Wait"
  • Wait(1, Ignore Condition);
  • "Do a loop"
  • Loop;
  • }
  • }
  • rule("Base: Swap Heroes when timer down (each player)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • "When timer down"
  • Global.CurrentTime <= 0;
  • Is Alive(Event Player) == True;
  • "Not in assembly"
  • Is Assembling Heroes == False;
  • }
  • actions
  • {
  • "Wait random seconds before swap"
  • Call Subroutine(WaitRandomTime);
  • Abort If(Is Alive(Event Player) == False);
  • Call Subroutine(ApplyDifferences);
  • Call Subroutine(SetHealthAndUltimate);
  • "Effect"
  • Create Effect(Event Player, Sparkles, Color(Red), Event Player, 1, Visible To Position and Radius);
  • Event Player.Effect = Last Created Entity;
  • Wait(0.010, Ignore Condition);
  • "Swap Hero"
  • Start Forcing Player To Be Hero(Event Player, Event Player.NextHero);
  • Wait(0.010, Ignore Condition);
  • Call Subroutine(ApplyHealthAndUltimate);
  • "Destroy Effect"
  • Wait(1, Ignore Condition);
  • Destroy Effect(Event Player.Effect);
  • "Pick next random hero"
  • Call Subroutine(RandomHeroPick);
  • }
  • }
  • rule("Base: Set SwapTimer to MaxTime (when all players done)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • "When timer down"
  • Global.CurrentTime == 0;
  • }
  • actions
  • {
  • "Wait a bit"
  • Wait(0.250, Ignore Condition);
  • "Set Global time back to normal"
  • Global.CurrentTime = Global.MaxTime;
  • }
  • }
  • rule("Base: Pick a random Hero")
  • {
  • event
  • {
  • Subroutine;
  • RandomHeroPick;
  • }
  • actions
  • {
  • "Debug"
  • disabled Event Player.DebugField = Remove From Array(All Heroes, Hero Of(Event Player));
  • If(Workshop Setting Toggle(Custom String("Randomize"), Custom String("Better Randomization"), True, 0));
  • Skip If(First Of(Event Player.RandomHeroList) != 0, 1);
  • Event Player.RandomHeroList = Randomized Array(Global.RestrictedHeroPool);
  • Event Player.NextHero = First Of(Event Player.RandomHeroList);
  • Event Player.RandomHeroList = Remove From Array(Event Player.RandomHeroList, Event Player.NextHero);
  • "Preload next Hero"
  • Preload Hero(All Players(All Teams), Event Player.NextHero);
  • Else;
  • "Pick a random Hero"
  • Event Player.NextHero = Random Value In Array(Remove From Array(Global.RestrictedHeroPool, Hero Of(Event Player)));
  • }
  • }
  • rule("Base: HUD Text (Global)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • "Show timer"
  • Create HUD Text(All Players(All Teams), Custom String("{0} CHAOS MYSTERY HEROES {0}", Icon String(Exclamation Mark)), Null, Null,
  • Left, 0, Color(Red), Color(Red), Color(Red), Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String("Hero Disable v1.6, made by Mirex"), Left, 0.500, Color(Red),
  • Color(Red), Color(Red), Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Null, Custom String("Time until swap: {0} second(s).", Global.CurrentTime), Left, 2,
  • Color(White), Color(White), Color(White), Visible To and String, Default Visibility);
  • }
  • }
  • rule("Base: HUD Text (each Player)")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • actions
  • {
  • "Create HUD TEXT 2"
  • Create HUD Text(Event Player, Custom String("Next hero is: {1} {0}", Event Player.NextHero, Hero Icon String(
  • Event Player.NextHero)), Null, Null, Left, 1, Color(White), Color(White), Color(White), Visible To and String,
  • Default Visibility);
  • }
  • }
  • rule("Base: Wait 0 to 2 seconds. (Toggleable)")
  • {
  • event
  • {
  • Subroutine;
  • WaitRandomTime;
  • }
  • actions
  • {
  • Skip If(Workshop Setting Toggle(Custom String("Performance"), Custom String(
  • "Wait extra random seconds for each player before swap. (Toggles above random time)"), False, 0) == False, 1);
  • Wait(Random Real(0, Min(Global.MaxTime, Workshop Setting Integer(Custom String("Performance"), Custom String(
  • "Extra random wait time between 0 and"), 2, 0, 5, 0))), Ignore Condition);
  • }
  • }
  • rule("Base: Set Player health and Ultimate")
  • {
  • event
  • {
  • Subroutine;
  • SetHealthAndUltimate;
  • }
  • actions
  • {
  • "Save Health and Ultimate"
  • Event Player.Health = Normalized Health(Event Player);
  • Event Player.Ultimate = Absolute Value(Ultimate Charge Percent(Event Player));
  • }
  • }
  • rule("Base: Apply Player health and Ultimate")
  • {
  • event
  • {
  • Subroutine;
  • ApplyHealthAndUltimate;
  • }
  • actions
  • {
  • "Set Health and Ultimate"
  • Set Player Health(Event Player, Absolute Value(Max Health(Event Player) * Event Player.Health));
  • Set Ultimate Charge(Event Player, Absolute Value(Event Player.Ultimate));
  • }
  • }
  • rule("Init: Restrict Heroes")
  • {
  • event
  • {
  • Subroutine;
  • RestrictHeroes;
  • }
  • actions
  • {
  • Reset Player Hero Availability(All Players(All Teams));
  • Set Player Allowed Heroes(All Players(All Teams), Global.RestrictedHeroPool);
  • }
  • }
Join the Workshop.codes Discord