Create
Return to post

Comparing difference between and

View raw
  • variables
  • {
  • global:
  • 0: _extendedGlobalCollection
  • 1: _arrayBuilder
  • 2: isDebug
  • 3: FirstPointTimeRemovalAmount
  • 4: MaxCapPointTimeRemovalAmount
  • 5: lastPointOne
  • 6: setFirstPointOne
  • 7: lastPointTwo
  • 8: setFirstPointTwo
  • player:
  • 0: _extendedPlayerCollection
  • }
  • // Extended collection variables:
  • // global [0]: _arrayBuilderStore
  • globalvar define isDebug = WorkshopSettingToggle("Debug", "Debug", false, 0);
  • globalvar define setupTime = WorkshopSettingInteger("Time", "Setup Time", 25, 0, 55, 4);
  • globalvar define assembleTime = WorkshopSettingInteger("Time", "Assemble Heros Time", 8, 0, 30, 3);
  • // Class identifiers:
  • rule("Initial Global")
  • rule: "Set Debug Functions"
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • // Action count: 7
  • actions
  • if (!isDebug)
  • {
  • Set Global Variable(isDebug, Workshop Setting Toggle(Custom String("Debug Mode", Null, Null, Null), Custom String("Debug", Null, Null, Null), False, 3));
  • Set Global Variable(FirstPointTimeRemovalAmount, Workshop Setting Integer(Custom String("Time settings", Null, Null, Null), Custom String("Game Start Time Removal Amount", Null, Null, Null), 90, 30, 160, 0));
  • Set Global Variable(MaxCapPointTimeRemovalAmount, Workshop Setting Integer(Custom String("Time settings", Null, Null, Null), Custom String("Maximum Capture Point Time Removal Amount (Divide by Team Score Each Capture)", Null, Null, Null), 65, 30, 160, 1));
  • Set Global Variable(lastPointOne, 0);
  • Set Global Variable(setFirstPointOne, False);
  • Set Global Variable(lastPointTwo, 0);
  • Set Global Variable(setFirstPointTwo, False);
  • }
  • DisableInspectorRecording();
  • }
  • }
  • rule("Set Debug Functions")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • // Action count: 3
  • actions
  • {
  • If(Not(Global Variable(isDebug)));
  • Disable Inspector Recording;
  • End;
  • }
  • }
  • rule("Set Assembling Heroes Time")
  • rule: "Set Assembling Heroes Time"
  • if (IsAssemblingHeroes())
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == True;
  • }
  • // Action count: 1
  • actions
  • {
  • Set Match Time(8);
  • }
  • SetMatchTime(assembleTime);
  • }
  • rule("Set Setup Time")
  • rule: "Set Setup Time"
  • if (IsInSetup())
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is In Setup == True;
  • }
  • // Action count: 1
  • actions
  • {
  • Set Match Time(30);
  • }
  • SetMatchTime(setupTime);
  • }
  • rule("Set First Point Time")
  • {
  • globalvar define FirstPointTimeRemovalAmount = WorkshopSettingInteger("Time", "Game Start Time Removal Amount", 90, 30, 160, 0);
  • globalvar define MaxCapPointTimeRemovalAmount = WorkshopSettingInteger("Time", "Maximum Capture Point Time Removal Amount (Divide by Team Score Each Capture)", 65, 30, 160, 1);
  • globalvar define lastPointOne = 0;
  • globalvar define setFirstPointOne = false;
  • globalvar define lastPointTwo = 0;
  • globalvar define setFirstPointTwo = false;
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • rule: "Set First Point Time"
  • if (IsGameInProgress())
  • {
  • if (lastPointOne == 0 && !setFirstPointOne && IsTeamOnOffense(Team.Team1))
  • {
  • Is Game In Progress == True;
  • SetMatchTime(MatchTime() - FirstPointTimeRemovalAmount);
  • setFirstPointOne = true;
  • }
  • // Action count: 8
  • actions
  • if (lastPointTwo == 0 && !setFirstPointTwo && IsTeamOnOffense(Team.Team2))
  • {
  • If(And(And(Compare(Global Variable(lastPointOne), ==, 0), Not(Global Variable(setFirstPointOne))), Is Team On Offense(Team(Team1))));
  • Set Match Time(Subtract(Match Time, Global Variable(FirstPointTimeRemovalAmount)));
  • Set Global Variable(setFirstPointOne, True);
  • End;
  • If(And(And(Compare(Global Variable(lastPointTwo), ==, 0), Not(Global Variable(setFirstPointTwo))), Is Team On Offense(Team(Team2))));
  • Set Match Time(Subtract(Match Time, Global Variable(FirstPointTimeRemovalAmount)));
  • Set Global Variable(setFirstPointTwo, True);
  • End;
  • SetMatchTime(MatchTime() - FirstPointTimeRemovalAmount);
  • setFirstPointTwo = true;
  • }
  • }
  • rule("Init Main Loop")
  • rule: "Init Main Loop"
  • Event.OngoingGlobal
  • {
  • while(true)
  • {
  • event
  • {
  • Ongoing - Global;
  • if (IsTeamOnOffense(Team.Team1) && lastPointOne < 2)
  • {
  • if (lastPointOne != TeamScore(Team.Team1))
  • {
  • SetMatchTime(MatchTime() - (MaxCapPointTimeRemovalAmount / TeamScore(Team.Team1)));
  • lastPointOne = TeamScore(Team.Team1);
  • }
  • }
  • if (IsTeamOnOffense(Team.Team2) && lastPointTwo < 2)
  • {
  • if (lastPointTwo != TeamScore(Team.Team2))
  • {
  • SetMatchTime(MatchTime() - (MaxCapPointTimeRemovalAmount / TeamScore(Team.Team2)));
  • lastPointTwo = TeamScore(Team.Team2);
  • }
  • }
  • if (MatchRound() == 3)
  • {
  • return;
  • }
  • MinWait(WaitBehavior.IgnoreCondition);
  • }
  • // Action count: 18
  • actions
  • {
  • While(True);
  • If(And(Is Team On Offense(Team(Team1)), Compare(Global Variable(lastPointOne), <, 2)));
  • If(Compare(Global Variable(lastPointOne), !=, Team Score(Team(Team1))));
  • Set Match Time(Subtract(Match Time, Divide(Global Variable(MaxCapPointTimeRemovalAmount), Team Score(Team(Team1)))));
  • Set Global Variable(lastPointOne, Team Score(Team(Team1)));
  • End;
  • End;
  • If(And(Is Team On Offense(Team(Team2)), Compare(Global Variable(lastPointTwo), <, 2)));
  • If(Compare(Global Variable(lastPointTwo), !=, Team Score(Team(Team2))));
  • Set Match Time(Subtract(Match Time, Divide(Global Variable(MaxCapPointTimeRemovalAmount), Team Score(Team(Team2)))));
  • Set Global Variable(lastPointTwo, Team Score(Team(Team2)));
  • End;
  • End;
  • If(Compare(Match Round, ==, 3));
  • Abort;
  • End;
  • Wait(0.016, Ignore Condition);
  • End;
  • }
  • }
  • }
Join the Workshop.codes Discord