IndustrialRiotReview.cs
using Sandbox;
using System;
namespace PaintballBaddies;
// Explicit private fixture; never attached to saved gameplay scenes.
public static class IndustrialRiotReview
{
public static string[] Rules(Scene scene)
{
var s=MultiplayerSession.Find(scene);var checks=new List<string>();
if(!s.IsValid() || !Networking.IsHost || s.PublicLobby || !s.InRound || !s.IsPopRiot)return ["FAIL private cooperative round required"];
void Check(bool result,string label)=>checks.Add((result ? "PASS " : "FAIL ")+label);
var actor=MultiplayerSession.LocalPlayer(scene).Components.Get<PaintballCombatant>();
var target=s.SpawnRiotTarget(new Vector3(0,6000,6000),PopKind.Giant);target.ReviewStill=true;
try
{
Check(target.ActiveChambers==3 && target.Health==target.MaximumHealth,"three independently initialized pressure chambers");
Check(!target.Hit(target.WorldPosition,actor),"armored machine core rejects damage");
int chunk=target.ChamberA;
for(int i=0;i<chunk;i++)Check(target.Hit(target.ChamberPoint(0),actor),$"chamber A hit {i+1}");
Check(target.ActiveChambers==2 && target.ChamberA==0 && target.Health==chunk*2,"one broken chamber removes one attack source");
int before=target.Health;
Check(!target.Hit(target.ChamberPoint(0),actor) && before==target.Health,"broken chamber cannot accept another scored hit");
Check((target.AimPoint(actor.EyePosition)-target.ChamberPoint(0)).Length>1,"AI aim skips destroyed chamber");
for(int i=0;i<chunk;i++)target.Hit(target.ChamberPoint(1),actor);
Check(target.ActiveChambers==1 && target.ChamberC==chunk,"second chamber leaves one attack source");
Check(s.TeamScore==scene.GetAllComponents<PaintballCombatant>().Sum(a=>a.PopScore),"shared scoreboard remains consistent");
}
finally {target.GameObject.Destroy();}
return checks.ToArray();
}
}