Create
Return to post

Comparing difference between and

View raw
  • settings
  • {
  • main
  • {
  • Description: "McCree Single Bullet game mode. Improved UI, added player stats & streak effects, fixed bugs. Easy to configure Modified by Mimimi#2348."
  • Description: "McCree Single Bullet game mode. New UI & player stats. Edit parameters in first Workshop rule. Permanent code: 3VWZG. Modified by Mimimi#2348."
  • }
  • lobby
  • {
  • Allow Players Who Are In Queue: Yes
  • Max Spectators: 6
  • Return To Lobby: Never
  • }
  • modes
  • {
  • Deathmatch
  • {
  • enabled maps
  • {
  • Black Forest Winter
  • Black Forest
  • }
  • }
  • General
  • {
  • Allow Hero Switching: Off
  • Enemy Health Bars: Off
  • Game Length In Minutes: 15
  • Game Mode Start: Immediately
  • Hero Limit: Off
  • Kill Cam: Off
  • Score To Win: 50
  • Spawn Health Packs: Disabled
  • }
  • }
  • heroes
  • {
  • General
  • {
  • McCree
  • {
  • Flashbang: Off
  • No Ammunition Requirement: On
  • Secondary Fire: Off
  • Ultimate Generation - Combat Deadeye: 0%
  • Ultimate Generation - Passive Deadeye: 0%
  • Ultimate Generation Deadeye: 10%
  • }
  • Mercy
  • {
  • Weapons Enabled: Caduceus Staff Only
  • }
  • Tracer
  • {
  • Blink Cooldown Time: 86%
  • Recall Cooldown Time: 30%
  • }
  • enabled heroes
  • {
  • McCree
  • }
  • }
  • }
  • }
  • variables
  • {
  • global:
  • 0: ScoreToWin
  • 1: MatchTime
  • 2: ShotsMinForBestAccuracy
  • 3: StreakReward
  • 5: BestStreak
  • 6: BestStreakOwner
  • 7: BestAccuracy
  • 8: BestAccuracyShots
  • 9: BestAccuracyOwner
  • player:
  • 0: CurrentStreak
  • 1: HighestStreak
  • 2: CheckScore
  • 3: InternalCount
  • 5: local_CommunicateType
  • 6: meleeOnlyVisuals
  • 7: shots
  • 8: hits
  • 9: accuracy
  • }
  • subroutines
  • {
  • 1: communicateOnKill
  • }
  • rule("SETTINGS (edit here)")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • "Instant win on achieving this score"
  • Global.ScoreToWin = 50;
  • "Match duration in seconds"
  • Global.MatchTime = 420;
  • Global.MatchTime = 600;
  • "Bonus score for 3 gun kills in a row"
  • Global.StreakReward = 2;
  • "Required number of shots before player will appear in 'Best accuracy'. Simply to avoid 100% (1 shot)"
  • Global.ShotsMinForBestAccuracy = 3;
  • }
  • }
  • disabled rule("# modified by Mimimi#2348. original creator is unknown #")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("Skip hero assembling phase")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Assembling Heroes == True;
  • }
  • actions
  • {
  • Set Match Time(0);
  • }
  • }
  • rule("Match setup")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Disable Built-In Game Mode Completion;
  • Disable Built-In Game Mode Scoring;
  • Disable Built-In Game Mode Announcer;
  • Set Match Time(Global.MatchTime);
  • Create HUD Text(All Players(All Teams), Null, Custom String("Best streak overall"), Global.BestStreak > 0 ? Custom String(
  • "{1} - {0}", Global.BestStreak, Global.BestStreakOwner) : Custom String("None"), Left, 15, White, Blue, White,
  • Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Global.BestAccuracy > 0 ? Custom String("Best accuracy overall") : Custom String(""),
  • Global.BestAccuracy > 0 ? Custom String("{2} - {0}%", Global.BestAccuracy, Global.BestAccuracyShots, Global.BestAccuracyOwner)
  • : Custom String(""), Left, 20, White, Blue, White, Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Global.BestStreak > 0 ? Custom String("{0}\r\nBest streak overall", Icon String(
  • Skull)) : Custom String(""), Global.BestStreak > 0 ? Custom String("{1} - {0}", Global.BestStreak, Global.BestStreakOwner)
  • : Custom String(""), Left, 15, White, Blue, White, Visible To and String, Default Visibility);
  • Create HUD Text(All Players(All Teams), Null, Global.BestAccuracy > 0 ? Custom String("{0}\r\nBest accuracy overall", Icon String(
  • Plus)) : Custom String(""), Global.BestAccuracy > 0 ? Custom String("{2} - {0}%", Global.BestAccuracy,
  • Global.BestAccuracyShots, Global.BestAccuracyOwner) : Custom String(""), Left, 20, White, Blue, White, Visible To and String,
  • Default Visibility);
  • Set Objective Description(All Players(All Teams), Custom String("Score to win: {0}\r\nBonus +{1} for 3 gun kills in a row",
  • Global.ScoreToWin, Global.StreakReward), Visible To);
  • }
  • }
  • rule("Player Settings")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • actions
  • {
  • Event Player.CurrentStreak = 0;
  • Event Player.HighestStreak = 0;
  • Event Player.CheckScore = False;
  • Event Player.InternalCount = 0;
  • Disable Built-In Game Mode Respawning(Event Player);
  • }
  • }
  • rule("Scoring")
  • {
  • event
  • {
  • Player Dealt Final Blow;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Modify Player Score(Event Player, 1);
  • If(!Is Meleeing(Event Player));
  • Event Player.CurrentStreak += 1;
  • Modify Player Variable(Event Player, HighestStreak, Max, Event Player.CurrentStreak);
  • Event Player.InternalCount += 1;
  • Event Player.hits += 1;
  • Event Player.accuracy = Round To Integer(Event Player.hits / Event Player.shots * 100, Up);
  • "reset roll on successful melee"
  • Else;
  • Set Ability Cooldown(Event Player, Button(Ability 1), 0);
  • End;
  • Wait(0.017, Ignore Condition);
  • Call Subroutine(communicateOnKill);
  • Event Player.CheckScore = False;
  • Set Primary Fire Enabled(Event Player, True);
  • Event Player.meleeOnlyVisuals = False;
  • }
  • }
  • rule("OnDeath")
  • {
  • event
  • {
  • Player Died;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Wait(1.500, Ignore Condition);
  • Set Primary Fire Enabled(Event Player, True);
  • Event Player.InternalCount = 0;
  • Event Player.CurrentStreak = 0;
  • Event Player.CheckScore = False;
  • Event Player.meleeOnlyVisuals = False;
  • Respawn(Event Player);
  • }
  • }
  • rule("Calculate Victory -- Match Time")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Match Time == 0;
  • Number of Players(All Teams) >= 1;
  • }
  • actions
  • {
  • Declare Player Victory(Last Of(Sorted Array(All Players(All Teams), Score Of(Current Array Element))));
  • }
  • }
  • rule("Calculate Victory -- Player Score")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Score Of(Event Player) >= Global.ScoreToWin;
  • }
  • actions
  • {
  • Declare Player Victory(Event Player);
  • }
  • }
  • rule("Reset Match If Not Enough Players")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • conditions
  • {
  • Match Time == 0;
  • Number of Players(All Teams) <= 1;
  • }
  • actions
  • {
  • Declare Match Draw;
  • }
  • }
  • rule("Update leaderboards every 5 seconds")
  • rule("Update leaderboards every 3 seconds")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Global.BestStreakOwner = Last Of(Sorted Array(All Players(All Teams), Current Array Element.HighestStreak));
  • Global.BestStreak = Global.BestStreakOwner.HighestStreak;
  • Global.BestAccuracyOwner = Last Of(Sorted Array(Filtered Array(All Players(All Teams),
  • Current Array Element.shots >= Global.ShotsMinForBestAccuracy), Current Array Element.accuracy));
  • Global.BestAccuracyShots = Global.BestAccuracyOwner.shots;
  • Global.BestAccuracy = Global.BestAccuracyOwner.accuracy;
  • Wait(5, Ignore Condition);
  • Wait(3, Ignore Condition);
  • Loop;
  • }
  • }
  • rule("communicate subroutine (after weapon kill)")
  • rule("communicate subroutine (after gun kill)")
  • {
  • event
  • {
  • Subroutine;
  • communicateOnKill;
  • }
  • actions
  • {
  • "We have 6 possible phrases here, so random value is in range [0; 5] "
  • Event Player.local_CommunicateType = Random Integer(0, 5);
  • "Skip all phrases before the selected one. Then, exit the subroutine"
  • Skip(Event Player.local_CommunicateType * 2);
  • Communicate(Event Player, Hello);
  • Abort;
  • Communicate(Event Player, Thanks);
  • Abort;
  • Communicate(Event Player, Acknowledge);
  • Abort;
  • Communicate(Event Player, You are Welcome);
  • Abort;
  • Communicate(Event Player, Goodbye);
  • Abort;
  • Communicate(Event Player, Incoming);
  • }
  • }
  • disabled rule("==Bullet Logic==")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("One In The Chamber")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Firing Primary(Event Player) == True;
  • }
  • actions
  • {
  • "Disabling primary fire after each shot. If player scored, primary fire becomes enabled again"
  • Set Primary Fire Enabled(Event Player, False);
  • Event Player.CheckScore = True;
  • Event Player.shots += 1;
  • Event Player.accuracy = Round To Integer(Event Player.hits / Event Player.shots * 100, Up);
  • }
  • }
  • rule("One Hit Kills")
  • {
  • event
  • {
  • Player Dealt Damage;
  • All;
  • All;
  • }
  • actions
  • {
  • Kill(Victim, Attacker);
  • }
  • }
  • disabled rule("If player is trying to shot with no bullet, show tip")
  • rule("If player is trying to shot with no bullet")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Button Held(Event Player, Primary Fire) == True;
  • Event Player.meleeOnlyVisuals == True;
  • }
  • actions
  • {
  • Big Message(Event Player, Custom String("Kill someone with melee punch to get a bullet"));
  • Wait(30, Ignore Condition);
  • Play Effect(Event Player, Debuff Impact Sound, White, Position Of(Event Player), 1);
  • }
  • }
  • disabled rule("==Streak Counter==")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • rule("player HUD")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Create HUD Text(Event Player, String("{0} {1} {2}", Event Player.InternalCount >= 1 ? Hero Icon String(Hero(McCree)) : Icon String(
  • X), Event Player.InternalCount >= 2 ? Hero Icon String(Hero(McCree)) : Icon String(X),
  • Event Player.InternalCount >= 3 ? Hero Icon String(Hero(McCree)) : Icon String(X)), Null, Custom String(
  • "Current streak: {0}\r\n Best streak: {1}\r\n Accuracy: {2}%", Event Player.CurrentStreak, Event Player.HighestStreak,
  • Event Player.accuracy), Left, 10, Green, White, Orange, String, Visible Never);
  • Ring Thin), Event Player.InternalCount >= 2 ? Hero Icon String(Hero(McCree)) : Icon String(Ring Thin),
  • Event Player.InternalCount >= 3 ? Hero Icon String(Hero(McCree)) : Icon String(Ring Thin)), Custom String(
  • "Kill streak resets on miss & on death"), Custom String("Current streak: {0}\r\n Best streak: {1}\r\n Accuracy: {2}%",
  • Event Player.CurrentStreak, Event Player.HighestStreak, Event Player.accuracy), Left, 10, Green, Blue, Orange, String,
  • Visible Never);
  • Create HUD Text(Event Player.meleeOnlyVisuals ? Event Player : Empty Array, Custom String("Melee punch only"), Null, Null, Top, 50,
  • Red, White, White, Visible To, Visible Never);
  • }
  • }
  • rule("Reset Streak On Miss")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.CheckScore == True;
  • }
  • actions
  • {
  • Wait(0.250, Abort When False);
  • Event Player.CurrentStreak = 0;
  • Event Player.InternalCount = 0;
  • Event Player.CheckScore = False;
  • Event Player.meleeOnlyVisuals = True;
  • }
  • }
  • rule("3 In a Row")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Event Player.InternalCount >= 3;
  • }
  • actions
  • {
  • Play Effect(Event Player, Buff Impact Sound, White, Position Of(Event Player), 50);
  • Play Effect(All Players(All Teams), Good Explosion, Green, Event Player, 1);
  • Play Effect(All Players(All Teams), Ring Explosion, Yellow, Position Of(Event Player), 1);
  • Wait(0.500, Ignore Condition);
  • Modify Player Score(Event Player, Global.StreakReward);
  • Event Player.InternalCount -= 3;
  • }
  • }
  • disabled rule("===Jump Pads===")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • disabled rule("This code was not map-specific for whatever reason, so i disabled it")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • }
  • disabled rule("Visuals")
  • {
  • event
  • {
  • Ongoing - Global;
  • }
  • actions
  • {
  • Create Effect(All Players(All Teams), Ring, Purple, Vector(15.332, 2.205, -39.108), 1.200, Visible To Position and Radius);
  • Create Effect(All Players(All Teams), Ring, Purple, Vector(-8.728, 2.219, -62.514), 1.200, Visible To Position and Radius);
  • Create Effect(All Players(All Teams), Ring, Purple, Vector(35.893, 2.098, -77.039), 1.200, Visible To Position and Radius);
  • Create Effect(All Players(All Teams), Ring, Purple, Vector(26.336, 7.600, -81.628), 1.200, Visible To Position and Radius);
  • }
  • }
  • disabled rule("Jump Bank")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Distance Between(Event Player, Vector(14.725, 2.205, -38.984)) <= 2;
  • Is Game In Progress == True;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Up, 19, To World, Cancel Contrary Motion);
  • }
  • }
  • disabled rule("Jump Saloon")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Distance Between(Event Player, Vector(-8.728, 2.219, -62.514)) <= 2;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Up, 19, To World, Cancel Contrary Motion);
  • }
  • }
  • disabled rule("Jump Jail")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Distance Between(Event Player, Vector(35.392, 2.060, -76.871)) <= 2;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Up, 15, To World, Cancel Contrary Motion);
  • }
  • }
  • disabled rule("Jump Jail Roof")
  • {
  • event
  • {
  • Ongoing - Each Player;
  • All;
  • All;
  • }
  • conditions
  • {
  • Distance Between(Event Player, Vector(26.222, 7.252, -82.144)) <= 1.200;
  • }
  • actions
  • {
  • Apply Impulse(Event Player, Vector Towards(Vector(26.167, 7.252, -81.518), Vector(13.640, 18.398, -68.793)), 40, To World,
  • Cancel Contrary Motion);
  • Small Message(Event Player, Custom String(" +{0} points for streak", Global.StreakReward));
  • }
  • }
Join the Workshop.codes Discord