Return to post
- variables
- {
- global:
- 0: IsRoundOver
- 1: RoundVictor
- 2: RoundCounter
- 3: MaximumScorePerRound
- 4: VictoriesPerHero
- 5: RoundEndPlayerIndex
- 6: RoundEndPossibleVictorsList
- 7: RoundEndHighestHeroCount
- 8: MostVictoriousHero
- 9: SelectionsPerHero
- 10: MostSelectedHero
- 11: PlayersViewingStatsList
- 12: HeroStatsSubroutineIndex
- 13: PlayerOutlinesSubroutineIndex
- 14: PlayerOutlinesSubroutineElement
- 15: HealingPerConversion
- 16: AllowedHeroes
- player:
- 0: InitallySelectedHero
- 1: PlayerToTransferSelectedHeroTo
- 2: InitallySelectedHeroHUDSame
- 3: InitallySelectedHeroHUDOther
- 4: HasEverSpawned
- 5: DamageModifierID
- 6: RoundEndingIcon
- 7: LateJoinSelectableHeroesList
- 8: LateJoinPlayerIndex
- 9: HeroConversionList
- 10: WinningTeamConversionCount
- 11: ScoreToAward
- 12: SelectionsPerHero
- 13: MostSelectedHero
- 14: VictoriesPerHero
- 15: MostVictoriousHero
- 16: PersonalStatsHUDList
- 17: PersonalStatsHUDIndex
- 18: HeroStatsSubroutineIndex
- 19: RoundsPlayedCount
- }
- subroutines
- {
- 0: UpdateLobbyMostSelectedHero
- 1: UpdateLobbyMostVictoriousHero
- 2: UpdatePlayerMostSelectedHero
- 3: UpdatePlayerMostVictoriousHero
- 4: UpdatePlayerOutlines
- }
- rule("SUB: UpdateLobbyMostSelectedHero")
- {
- event
- {
- Subroutine;
- UpdateLobbyMostSelectedHero;
- }
- actions
- {
- Global.MostSelectedHero = All Heroes[0];
- For Global Variable(HeroStatsSubroutineIndex, 1, Count Of(All Heroes), 1);
- "Is the count greater for the current hero than the previous?"
- If(Global.SelectionsPerHero[Global.HeroStatsSubroutineIndex] > Global.SelectionsPerHero[Index Of Array Value(All Heroes,
- Global.MostSelectedHero)]);
- Global.MostSelectedHero = All Heroes[Global.HeroStatsSubroutineIndex];
- End;
- End;
- }
- }
- rule("SUB: UpdateLobbyMostVictoriousHero")
- {
- event
- {
- Subroutine;
- UpdateLobbyMostVictoriousHero;
- }
- actions
- {
- Global.MostVictoriousHero = All Heroes[0];
- For Global Variable(HeroStatsSubroutineIndex, 1, Count Of(All Heroes), 1);
- "Is the count greater for the current hero than the previous?"
- If(Global.VictoriesPerHero[Global.HeroStatsSubroutineIndex] > Global.VictoriesPerHero[Index Of Array Value(All Heroes,
- Global.MostVictoriousHero)]);
- Global.MostVictoriousHero = All Heroes[Global.HeroStatsSubroutineIndex];
- End;
- End;
- }
- }
- rule("SUB: UpdatePlayerMostSelectedHero")
- {
- event
- {
- Subroutine;
- UpdatePlayerMostSelectedHero;
- }
- actions
- {
- Event Player.MostSelectedHero = All Heroes[0];
- For Player Variable(Event Player, HeroStatsSubroutineIndex, 1, Count Of(All Heroes), 1);
- "Is the count greater for the current hero than the previous?"
- If(Event Player.SelectionsPerHero[Event Player.HeroStatsSubroutineIndex] > Event Player.SelectionsPerHero[Index Of Array Value(
- All Heroes, Event Player.MostSelectedHero)]);
- Event Player.MostSelectedHero = All Heroes[Event Player.HeroStatsSubroutineIndex];
- End;
- End;
- }
- }
- rule("SUB: UpdatePlayerMostVictoriousHero")
- {
- event
- {
- Subroutine;
- UpdatePlayerMostVictoriousHero;
- }
- actions
- {
- Event Player.MostVictoriousHero = All Heroes[0];
- For Player Variable(Global.RoundVictor, HeroStatsSubroutineIndex, 1, Count Of(All Heroes), 1);
- "Is the count greater for the current hero than the previous?"
- If(Event Player.VictoriesPerHero[Event Player.HeroStatsSubroutineIndex] > Event Player.VictoriesPerHero[Index Of Array Value(
- All Heroes, Event Player.MostVictoriousHero)]);
- Event Player.MostVictoriousHero = All Heroes[Event Player.HeroStatsSubroutineIndex];
- End;
- End;
- }
- }
- rule("SUB: UpdatePlayerOutlines")
- {
- event
- {
- Subroutine;
- UpdatePlayerOutlines;
- }
- actions
- {
- For Global Variable(PlayerOutlinesSubroutineIndex, 0, Number Of Players(All Teams), 1);
- Global.PlayerOutlinesSubroutineElement = All Players(All Teams)[Global.PlayerOutlinesSubroutineIndex];
- Start Forcing Player Outlines(Global.PlayerOutlinesSubroutineElement, Filtered Array(All Players(All Teams), Hero Of(
- Global.PlayerOutlinesSubroutineElement) == Hero Of(Current Array Element)), True, Color(Blue), Always);
- Start Forcing Player Outlines(Global.PlayerOutlinesSubroutineElement, Filtered Array(All Players(All Teams), Hero Of(
- Global.PlayerOutlinesSubroutineElement) != Hero Of(Current Array Element)), True, Color(Red), Default);
- End;
- }
- }
- rule("INIT: Setup game mode and HUD text")
- {
- event
- {
- Ongoing - Global;
- }
- actions
- {
- Disable Inspector Recording;
- Disable Built-In Game Mode Scoring;
- "Setup some constants"
Global.MaximumScorePerRound = 5;
- Global.MaximumScorePerRound = Workshop Setting Integer(Custom String("General Settings"), Custom String("Maximum Score Per Round"),
- 5, 1, 11, 0);
- Global.HealingPerConversion = Workshop Setting Integer(Custom String("General Settings"), Custom String("Healing Per Conversion"),
- 75, 0, 600, 1);
- Global.AllowedHeroes = Empty Array;
- "Default-initialise stat references to something sensible"
- Global.MostSelectedHero = Hero(Reaper);
- Global.MostVictoriousHero = Hero(Reaper);
- "Setup global HUD"
- Create HUD Text(All Players(All Teams), Null, Null, Custom String("HERO COUNT:"), Left, 50, Color(White), Color(White), Color(
- White), Visible To and String, Visible Always);
Create HUD Text(All Players(All Teams), Null, Custom String("Hero vs Hero Battle v1.2 by ipi#21149"), Null, Right, -99, Color(
- Create HUD Text(All Players(All Teams), Null, Custom String("Hero vs Hero Battle v1.2.1 by ipi#21149"), Null, Right, -99, Color(
- White), Color(Blue), Color(White), Visible To and String, Visible Always);
- Create HUD Text(All Players(All Teams), Null, Custom String("Eliminate other heroes to convert them to your team!"), Null, Right,
- -98, Color(White), Color(Blue), Color(White), Visible To and String, Visible Always);
- Create HUD Text(All Players(All Teams), Null, Custom String("Earn points by converting other players to the winning team!"), Null,
- Right, -97, Color(White), Color(Blue), Color(White), Visible To and String, Visible Always);
- Create HUD Text(All Players(All Teams), Null, Custom String("Hold Interact to view game stats."), Null, Right, -96, Color(White),
- Color(Blue), Color(White), Visible To and String, Visible Always);
Create HUD Text(All Players(All Teams), Null, Custom String("Code: MM0TR"), Null, Right, -95, Color(White), Color(Blue), Color(
- Create HUD Text(All Players(All Teams), Null, Custom String("Code: H88Z1"), Null, Right, -95, Color(White), Color(Blue), Color(
- White), Visible To and String, Visible Always);
- disabled Create HUD Text(Host Player, Null, Custom String("Average server load: {0}%", Server Load Average), Null, Right, -1, Color(White),
- Color(Blue), Color(White), Visible To and String, Visible Never);
- }
- }
- rule("INIT: Setup new players")
- {
- event
- {
Ongoing - Each Player;
- Player Joined Match;
- All;
- All;
- }
- actions
- {
- Event Player.MostSelectedHero = Hero(Reaper);
- Event Player.MostVictoriousHero = Hero(Reaper);
- }
- }
- rule("INIT: Determine which heroes have been restricted by the game's settings")
- {
- event
- {
- Player Joined Match;
- All;
- All;
- }
- conditions
- {
- Count Of(Global.AllowedHeroes) == 0;
- }
- actions
- {
- Global.AllowedHeroes = Allowed Heroes(Event Player);
- Set Player Allowed Heroes(All Players(All Teams), Global.AllowedHeroes);
- }
- }
- rule("When assembling heroes, shorten timer, increment round counter, reset any player variables")
- {
- event
- {
- Ongoing - Global;
- }
- conditions
- {
- Is Assembling Heroes == True;
- }
- actions
- {
- Unpause Match Time;
- Destroy All Dummy Bots;
- Destroy All Icons;
- Stop All Damage Modifications;
- Stop Forcing Player To Be Hero(All Players(All Teams));
Set Player Allowed Heroes(All Players(All Teams), All Heroes);
- Set Player Allowed Heroes(All Players(All Teams), Global.AllowedHeroes);
- All Players(All Teams).InitallySelectedHero = Null;
- All Players(All Teams).HeroConversionList = Empty Array;
- If(Global.RoundCounter == 0);
Set Match Time(15);
- Set Match Time(20);
- Else;
- Set Match Time(5);
- End;
- Global.RoundCounter += 1;
- }
- }
- rule("When game begins, set round timer based on the number of players")
- {
- event
- {
- Ongoing - Global;
- }
- conditions
- {
- Is Game In Progress == True;
- }
- actions
- {
- If(Count Of(All Players(All Teams)) <= 3);
- Set Match Time(90);
- Else If(Count Of(All Players(All Teams)) <= 5);
- Set Match Time(120);
- Else If(Count Of(All Players(All Teams)) <= 7);
- Set Match Time(150);
- Else;
- Set Match Time(180);
- End;
- Wait(0.250, Abort When False);
- Big Message(All Players(All Teams), String("Round {0}", Global.RoundCounter));
- }
- }
- rule("Ensure players cannot select anyone that was previously chosen")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Game In Progress == True;
- Has Spawned(Event Player) == False;
- }
- actions
- {
Event Player.LateJoinSelectableHeroesList = All Heroes;
- Event Player.LateJoinSelectableHeroesList = Global.AllowedHeroes;
- For Player Variable(Event Player, LateJoinPlayerIndex, 0, Count Of(All Players(All Teams)), 1);
- If(All Players(All Teams)[Event Player.LateJoinPlayerIndex] != Event Player);
- Modify Player Variable(Event Player, LateJoinSelectableHeroesList, Remove From Array By Value, All Players(All Teams)
- [Event Player.LateJoinPlayerIndex].InitallySelectedHero);
- Modify Player Variable(Event Player, LateJoinSelectableHeroesList, Remove From Array By Value, Hero Of(All Players(All Teams)
- [Event Player.LateJoinPlayerIndex]));
- End;
- End;
- Set Player Allowed Heroes(Event Player, Event Player.LateJoinSelectableHeroesList);
- Wait(0.016, Abort When False);
- Loop If Condition Is True;
- }
- }
- rule("When the player spawns, remember the hero they selected and prevent damage from teammates")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Has Spawned(Event Player) == True;
- Event Player.InitallySelectedHero == Null;
- }
- actions
- {
- "Sanity check to ensure two players never end up with the same initial hero"
- If(!Is True For Any(All Players(All Teams), Current Array Element.InitallySelectedHero == Hero Of(Event Player)));
- Event Player.InitallySelectedHero = Hero Of(Event Player);
- Global.SelectionsPerHero[Index Of Array Value(All Heroes, Hero Of(Event Player))] += 1;
- Call Subroutine(UpdateLobbyMostSelectedHero);
- Event Player.SelectionsPerHero[Index Of Array Value(All Heroes, Hero Of(Event Player))] += 1;
- Call Subroutine(UpdatePlayerMostSelectedHero);
- End;
- Start Forcing Player To Be Hero(Event Player, Hero Of(Event Player));
- Start Forcing Player Outlines(Event Player, All Players(All Teams), True, Color(Red), Default);
- Start Damage Modification(Event Player, Filtered Array(Players On Hero(Hero Of(Event Player), All Teams),
- Current Array Element != Event Player), 0, Receivers and Damagers);
- Event Player.DamageModifierID = Last Damage Modification ID;
- Event Player.RoundsPlayedCount += 1;
- }
- }
- rule("Display a unique message when players spawn for the first time ever")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Event Player.HasEverSpawned == False;
- Has Spawned(Event Player) == True;
- }
- actions
- {
- Wait(0.500, Ignore Condition);
Big Message(Event Player, Custom String("Eliminate other heroes!"));
Event Player.HasEverSpawned = False;
- Big Message(Event Player, Custom String("Convert all enemies to your hero!"));
- Event Player.HasEverSpawned = True;
- }
- }
- rule("Add player's hero HUD elements when count is non-zero")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Event Player.InitallySelectedHero != Null;
- Count Of(Players On Hero(Event Player.InitallySelectedHero, All Teams)) > 0;
- }
- actions
- {
- "Setup HUD for players of the same hero"
- Create HUD Text(Filtered Array(All Players(All Teams), Hero Of(Current Array Element) == Event Player.InitallySelectedHero),
- Custom String("{0} x {1}", Hero Icon String(Event Player.InitallySelectedHero), Number Of Heroes(
- Event Player.InitallySelectedHero, All Teams)), Custom String("Chosen by {0}", Event Player), Null, Left, 100 - Count Of(
- Players On Hero(Event Player.InitallySelectedHero, All Teams)), Color(White), Color(White), Color(White),
- Visible To Sort Order and String, Visible Always);
- Event Player.InitallySelectedHeroHUDSame = Last Text ID;
- "Setup HUD for players of a different hero"
- Create HUD Text(Filtered Array(All Players(All Teams), Hero Of(Current Array Element) != Event Player.InitallySelectedHero),
- Custom String("{0} x {1}", Hero Icon String(Event Player.InitallySelectedHero), Number Of Heroes(
- Event Player.InitallySelectedHero, All Teams)), Custom String("Chosen by {0}", Event Player), Null, Left, 100 - Count Of(
- Players On Hero(Event Player.InitallySelectedHero, All Teams)), Color(Team 2), Color(Team 2), Color(Team 2),
- Visible To Sort Order and String, Visible Always);
- Event Player.InitallySelectedHeroHUDOther = Last Text ID;
- }
- }
- rule("Remove player's hero HUD elements when count is zero")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Event Player.InitallySelectedHero != Null;
- Count Of(Players On Hero(Event Player.InitallySelectedHero, All Teams)) == 0;
- }
- actions
- {
- Destroy HUD Text(Event Player.InitallySelectedHeroHUDSame);
- Destroy HUD Text(Event Player.InitallySelectedHeroHUDOther);
- }
- }
- rule("Remove player's hero HUD elements when round ends")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Assembling Heroes == True;
- }
- actions
- {
- Destroy HUD Text(Event Player.InitallySelectedHeroHUDSame);
- Destroy HUD Text(Event Player.InitallySelectedHeroHUDOther);
- }
- }
- rule("Convert enemies upon eliminating them and update their outlines")
- {
- event
- {
- Player Died;
- All;
- All;
- }
- conditions
- {
- Attacker != Victim;
- Hero Of(Attacker) != Hero Of(Victim);
- }
- actions
- {
- Start Forcing Player To Be Hero(Victim, Hero Of(Attacker));
Heal(Attacker, Null, 75);
- Heal(Attacker, Null, Global.HealingPerConversion);
- Modify Player Variable(Attacker, HeroConversionList, Append To Array, Hero Of(Attacker));
- Call Subroutine(UpdatePlayerOutlines);
- "Wait just in case this was the round-ending kill"
- Wait(0.016, Ignore Condition);
- Abort If(Global.IsRoundOver);
- Small Message(Victim, Custom String("You joined Team {0}", Hero Of(Attacker)));
- Small Message(Attacker, Custom String("{0} is now your ally!", Victim));
- }
- }
- rule("Make players invulnerable for a short time after spawning/being converted")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Alive(Event Player) == True;
- }
- actions
- {
- Set Damage Received(Event Player, 0);
- Wait(1, Ignore Condition);
- Set Damage Received(Event Player, 100);
- }
- }
- rule("Display icons above heads once round timer is low")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Game In Progress == True;
- Match Time <= 30;
- Has Spawned(Event Player) == True;
- }
- actions
- {
- Big Message(Event Player, Custom String("All enemies revealed"));
- Create Icon(Filtered Array(All Players(All Teams), Hero Of(Current Array Element) != Hero Of(Event Player)), Event Player, Skull,
- Visible To and Position, Color(Red), True);
- Event Player.RoundEndingIcon = Last Created Entity;
- }
- }
- rule("VICTORY: If all players are now the same hero, declare round victory")
- {
- event
- {
- Ongoing - Global;
- }
- conditions
- {
- Is Game In Progress == True;
- Global.IsRoundOver == False;
- Global.RoundVictor == Null;
- Count Of(Filtered Array(All Players(All Teams), Has Spawned(Current Array Element))) > 1;
- Count Of(Filtered Array(All Heroes, Number Of Heroes(Current Array Element, All Teams) > 0)) == 1;
- }
- actions
- {
- Global.RoundVictor = First Of(Filtered Array(All Players(All Teams), Current Array Element.InitallySelectedHero == Hero Of(
- Current Array Element)));
- Global.IsRoundOver = True;
- }
- }
- rule("VICTORY: Randomly pick a victor if time expires")
- {
- event
- {
- Ongoing - Global;
- }
- conditions
- {
- Is Game In Progress == True;
- Global.IsRoundOver == False;
- Match Time <= 0.025;
- }
- actions
- {
- Pause Match Time;
- Global.RoundEndHighestHeroCount = 1;
- Global.RoundEndPossibleVictorsList = Empty Array;
- For Global Variable(RoundEndPlayerIndex, 0, Count Of(All Players(All Teams)), 1);
- "Reset array if current player's count exceeds previous"
- If(Count Of(Players On Hero(All Players(All Teams)[Global.RoundEndPlayerIndex].InitallySelectedHero, All Teams))
- > Global.RoundEndHighestHeroCount);
- Global.RoundEndHighestHeroCount = Count Of(Players On Hero(All Players(All Teams)[Global.RoundEndPlayerIndex].InitallySelectedHero,
- All Teams));
- Global.RoundEndPossibleVictorsList = Empty Array;
- End;
- "Add to array if current player's count matches previous"
- If(Count Of(Players On Hero(All Players(All Teams)[Global.RoundEndPlayerIndex].InitallySelectedHero, All Teams))
- == Global.RoundEndHighestHeroCount);
- Modify Global Variable(RoundEndPossibleVictorsList, Append To Array, All Players(All Teams)[Global.RoundEndPlayerIndex]);
- End;
- End;
- "Randomly choose a victor (if any)"
- Global.RoundVictor = Random Value In Array(Global.RoundEndPossibleVictorsList);
- Global.IsRoundOver = True;
- }
- }
- rule("VICTORY: Perform victory routine")
- {
- event
- {
- Ongoing - Global;
- }
- conditions
- {
- Is Game In Progress == True;
- Global.IsRoundOver == True;
- }
- actions
- {
- Pause Match Time;
- If(Global.RoundVictor != Null);
- Big Message(All Players(All Teams), Custom String("TEAM {0} WINS!", Hero Of(Global.RoundVictor)));
- Global.VictoriesPerHero[Index Of Array Value(All Heroes, Hero Of(Global.RoundVictor))] += 1;
- Call Subroutine(UpdateLobbyMostVictoriousHero);
- Else;
- Big Message(All Players(All Teams), Custom String("Round complete"));
- End;
- Set Slow Motion(50);
- Wait(2, Ignore Condition);
- Set Slow Motion(100);
- Global.IsRoundOver = False;
- Global.RoundVictor = Null;
- Go To Assemble Heroes;
- }
- }
- rule("VICTORY: When round ends, give each player score based on how many conversions they made and update stats")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Global.IsRoundOver == True;
- Global.RoundVictor != Null;
- }
- actions
- {
- Event Player.WinningTeamConversionCount = Count Of(Filtered Array(Event Player.HeroConversionList,
- Current Array Element == Hero Of(Global.RoundVictor)));
- Event Player.ScoreToAward = Min(Event Player.WinningTeamConversionCount, Global.MaximumScorePerRound);
- If(Event Player.WinningTeamConversionCount > 0);
- Small Message(Event Player, Custom String("{0} conversions = +{1} points", Event Player.WinningTeamConversionCount, Min(
- Event Player.WinningTeamConversionCount, Global.MaximumScorePerRound)));
- Else;
- Small Message(Event Player, Custom String("No conversions this round"));
- End;
- "Update most victorious hero stat"
- If(Global.RoundVictor == Event Player);
- Call Subroutine(UpdatePlayerMostVictoriousHero);
- Event Player.VictoriesPerHero[Index Of Array Value(All Heroes, Hero Of(Event Player))] += 1;
- End;
- }
- }
- rule("VICTORY: Tick score upwards gradually if there's multiple points to award")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Event Player.ScoreToAward > 0;
- }
- actions
- {
- Modify Player Score(Event Player, 1);
- Event Player.ScoreToAward -= 1;
- Wait(0.250, Abort When False);
- Loop If Condition Is True;
- }
- }
- rule("MISC: Transfer initial hero selection on player leaving")
- {
- event
- {
- Player Left Match;
- All;
- All;
- }
- conditions
- {
- Has Spawned(Event Player) == True;
- Event Player.InitallySelectedHero != Null;
- Count Of(Players On Hero(Hero Of(Event Player), All Teams)) > 1;
- }
- actions
- {
- "Prefer transferring to player whose initial hero is extinct"
- Event Player.PlayerToTransferSelectedHeroTo = Random Value In Array(Filtered Array(Players On Hero(
- Event Player.InitallySelectedHero, All Teams), Count Of(Players On Hero(Current Array Element.InitallySelectedHero, All Teams))
- == 0));
- If(Event Player.PlayerToTransferSelectedHeroTo == Null);
- Event Player.PlayerToTransferSelectedHeroTo = Random Value In Array(Players On Hero(Event Player.InitallySelectedHero, All Teams));
- End;
- Event Player.PlayerToTransferSelectedHeroTo.InitallySelectedHero = Event Player.InitallySelectedHero;
- Event Player.PlayerToTransferSelectedHeroTo.InitallySelectedHeroHUDSame = Event Player.InitallySelectedHeroHUDSame;
- Event Player.PlayerToTransferSelectedHeroTo.InitallySelectedHeroHUDOther = Event Player.InitallySelectedHeroHUDOther;
- }
- }
- rule("STATS: Setup global stats page")
- {
- event
- {
- Ongoing - Global;
- }
- actions
- {
- Create HUD Text(Global.PlayersViewingStatsList, Null, Null, Custom String("Lobby most selected hero:"), Top, 100, Color(White),
- Color(White), Color(White), Visible To and String, Visible Never);
- Create HUD Text(Global.PlayersViewingStatsList, Custom String("{0} {1} ({2}%)", Hero Icon String(Global.MostSelectedHero),
- Global.MostSelectedHero, Round To Integer(Global.SelectionsPerHero[Index Of Array Value(All Heroes, Global.MostSelectedHero)
- ] / Global.RoundCounter * 100, Up)), Null, Null, Top, 101, Color(White), Color(White), Color(White), Visible To and String,
- Visible Never);
- Create HUD Text(Global.PlayersViewingStatsList, Null, Null, Custom String("Lobby most victorious hero:"), Top, 102, Color(White),
- Color(White), Color(White), Visible To and String, Visible Never);
- Create HUD Text(Global.PlayersViewingStatsList, Custom String("{0} {1} ({2} wins)", Hero Icon String(Global.MostVictoriousHero),
- Global.MostVictoriousHero, Global.VictoriesPerHero[Index Of Array Value(All Heroes, Global.MostVictoriousHero)]), Null, Null,
- Top, 103, Color(White), Color(White), Color(White), Visible To and String, Visible Never);
- }
- }
- rule("STATS: Add player to stats list when holding interact and add player-specific stats")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Button Held(Event Player, Button(Interact)) == True;
- }
- actions
- {
- Wait(0.500, Abort When False);
- Modify Global Variable(PlayersViewingStatsList, Append To Array, Event Player);
- "Show player specific HUD"
- Create HUD Text(Event Player, Null, Null, Custom String("Your most selected hero:"), Top, 105, Color(White), Color(White), Color(
- White), String, Visible Never);
- Modify Player Variable(Event Player, PersonalStatsHUDList, Append To Array, Last Text ID);
- Create HUD Text(Event Player, Custom String("{0} {1} ({2}%)", Hero Icon String(Event Player.MostSelectedHero),
- Event Player.MostSelectedHero, Round To Integer(Event Player.SelectionsPerHero[Index Of Array Value(All Heroes,
- Event Player.MostSelectedHero)] / Event Player.RoundsPlayedCount * 100, Up)), Null, Null, Top, 106, Color(White), Color(White),
- Color(White), String, Visible Never);
- Modify Player Variable(Event Player, PersonalStatsHUDList, Append To Array, Last Text ID);
- Create HUD Text(Event Player, Null, Null, Custom String("Your most victorious hero:"), Top, 107, Color(White), Color(White), Color(
- White), String, Visible Never);
- Modify Player Variable(Event Player, PersonalStatsHUDList, Append To Array, Last Text ID);
- Create HUD Text(Event Player, Custom String("{0} {1} ({2} wins)", Hero Icon String(Event Player.MostVictoriousHero),
- Event Player.MostVictoriousHero, Event Player.VictoriesPerHero[Index Of Array Value(All Heroes,
- Event Player.MostVictoriousHero)]), Null, Null, Top, 108, Color(White), Color(White), Color(White), String, Visible Never);
- Modify Player Variable(Event Player, PersonalStatsHUDList, Append To Array, Last Text ID);
- }
- }
- rule("STATS: Hide stats page when player releases interact")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Button Held(Event Player, Button(Interact)) == False;
- }
- actions
- {
- Modify Global Variable(PlayersViewingStatsList, Remove From Array By Value, Event Player);
- For Player Variable(Event Player, PersonalStatsHUDIndex, 0, Count Of(Event Player.PersonalStatsHUDList), 1);
- Destroy HUD Text(Event Player.PersonalStatsHUDList[Event Player.PersonalStatsHUDIndex]);
- End;
- Event Player.PersonalStatsHUDList = Empty Array;
- }
- }
- disabled rule("DEBUG - Hosts can spawn dummy bot by pressing crouch + interact")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Host Player == Event Player;
- Is Button Held(Event Player, Button(Crouch)) == True;
- Is Button Held(Event Player, Button(Interact)) == True;
- }
- actions
- {
- Create Dummy Bot(Random Value In Array(Filtered Array(All Heroes, Is Hero Being Played(Current Array Element, All Teams)
- == False)), All Teams, -1, Position Of(Event Player) + Facing Direction Of(Event Player), Facing Direction Of(Event Player)
- * -1);
- }
- }
- disabled rule("DEBUG - Cause dummy bots to shoot")
- {
- event
- {
- Ongoing - Each Player;
- All;
- All;
- }
- conditions
- {
- Is Dummy Bot(Event Player) == True;
- }
- actions
- {
- Press Button(Event Player, Button(Reload));
- Wait(2, Abort When False);
- Start Holding Button(Event Player, Button(Primary Fire));
- Wait(5, Abort When False);
- Stop Holding Button(Event Player, Button(Primary Fire));
- Loop If Condition Is True;
- }
- }