Create
Return to post

Comparing difference between and

View raw
  • variables
  • {
  • global:
  • 0: hunter
  • player:
  • 0: chasing_score
  • }
  • subroutines
  • {
  • 0: NotifyHunter
  • 3: UpdateSecondaryFire
  • }
  • rule("Disable scoring")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Disable Built-In Game Mode Scoring;
  • }
  • }
  • rule("On player hit")
  • {
  • event
  • {
  • Player Took Damage;
  • All;
  • All;
  • }
  • conditions
  • {
  • Global Variable(hunter) != Event Player;
  • Attacker == Global Variable(hunter);
  • }
  • actions
  • {
  • Destroy Effect(Last Created Entity);
  • Kill(Event Player, Attacker);
  • Respawn(Event Player);
  • Set Global Variable(hunter, Event Player);
  • Set Secondary Fire Enabled(Event Player, False);
  • Set Secondary Fire Enabled(Attacker, True);
  • Modify Player Variable(Attacker, chasing_score, Add, 1);
  • }
  • }
  • rule("Set random hunter")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Global Variable(hunter) == Null;
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Set Global Variable(hunter, Random Value In Array(All Players(All Teams)));
  • Modify Player Variable(Global Variable(hunter), chasing_score, Add, 10);
  • Create Effect(Remove From Array(All Players(All Teams), Global Variable(hunter)), Sphere, Red, Global Variable(hunter), 1,
  • Visible To Position and Radius);
  • Wait(1, Ignore Condition);
  • Call Subroutine(NotifyHunter);
  • }
  • }
  • rule("Notify about new hunter")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Global Variable(hunter) == Event Player;
  • }
  • actions
  • {
  • Call Subroutine(NotifyHunter);
  • }
  • }
  • rule("onNotify")
  • {
  • event
  • {
  • Subroutine;
  • NotifyHunter;
  • }
  • actions
  • {
  • Small Message(Filtered Array(All Players(All Teams), Compare(Current Array Element, !=, Global Variable(hunter))), Custom String(
  • "{0} is now a hunter", Global Variable(hunter), Null, Null));
  • Big Message(Global Variable(hunter), Custom String("You are a hunter now!", Null, Null, Null));
  • }
  • }
  • rule("Set winner")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Player Variable(Event Player, chasing_score) >= 360;
  • }
  • actions
  • {
  • Declare Player Victory(Event Player);
  • }
  • }
  • rule("Slow down preys in radius")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player != Global Variable(hunter);
  • Players Within Radius(Position Of(Global Variable(hunter)), 5, All Teams, Surfaces And All Barriers) == True;
  • }
  • actions
  • {
  • Set Move Speed(Event Player, 80);
  • Wait(0.500, Ignore Condition);
  • If(Compare(Value In Array(Players Within Radius(Position Of(Global Variable(hunter)), 10, All Teams, Off), Index Of Array Value(
  • Players Within Radius(Position Of(Global Variable(hunter)), 10, All Teams, Off), Event Player)), !=, Null));
  • Set Move Speed(Event Player, 50);
  • Else;
  • Set Move Speed(Event Player, 100);
  • End;
  • Loop If Condition Is True;
  • }
  • }
  • rule("Show GUI")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • actions
  • {
  • Create HUD Text(Event Player, Custom String("Your score is {0}", Player Variable(Event Player, chasing_score), Null, Null), Null,
  • Null, Left, 0, White, White, White, Visible To and String, Default Visibility);
  • }
  • }
  • rule("Gain score")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Compare(Event Player, !=, Global Variable(hunter)) == True;
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Wait(1, Ignore Condition);
  • Modify Player Variable(Event Player, chasing_score, Add, 1);
  • Loop If Condition Is True;
  • }
  • }
  • rule("Lose score")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Compare(Event Player, ==, Global Variable(hunter)) == True;
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Wait(1, Ignore Condition);
  • Modify Player Variable(Event Player, chasing_score, Subtract, 0.100);
  • If(Compare(Player Variable(Event Player, chasing_score), <=, 0));
  • Damage(Event Player, Null, 0.001);
  • End;
  • Loop If Condition Is True;
  • }
  • }
  • rule("Reset speed")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Players Within Radius(Position Of(Global Variable(hunter)), 10, All Teams, Surfaces And All Barriers) != True;
  • Compare(Global Variable(hunter), ==, Event Player) == True;
  • }
  • actions
  • {
  • Wait(0.500, Ignore Condition);
  • Set Move Speed(Event Player, 120);
  • Loop If Condition Is True;
  • }
  • }
  • rule("Update secondary fire")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • actions
  • {
  • Wait(1, Ignore Condition);
  • Call Subroutine(UpdateSecondaryFire);
  • Loop;
  • }
  • }
  • rule("onUpdateSecondaryFire")
  • {
  • event
  • {
  • Subroutine;
  • UpdateSecondaryFire;
  • }
  • actions
  • {
  • Set Move Speed(Event Player, 100);
  • Set Secondary Fire Enabled(Event Player, Compare(Event Player, !=, Global Variable(hunter)));
  • }
  • }
Join the Workshop.codes Discord