using System.Collections.Generic; using UnityEngine.Scripting; #nullable disable [Preserve] public class ConsoleCmdKillAllRebirth : ConsoleCmdAbstract { [PublicizedFrom(EAccessModifier.Protected)] public override string[] getCommands() { return new string[1] { "killallr" }; } [PublicizedFrom(EAccessModifier.Protected)] public override string getDescription() => "Kill all entities"; [PublicizedFrom(EAccessModifier.Protected)] public override string getHelp() { return "Kills all matching entities (but never players)\nUsage:\n killall (all enemies)\n killall alive (all EntityAlive types except vehicles and turrets)\n killall all (all types)"; } public override void Execute(List _params, CommandSenderInfo _senderInfo) { bool flag1 = _params.Count > 0 && _params[0].EqualsCaseInsensitive("alive"); bool flag2 = _params.Count > 0 && _params[0].EqualsCaseInsensitive("all"); List entityList = new List((IEnumerable)GameManager.Instance.World.Entities.list); for (int index = 0; index < entityList.Count; ++index) { Entity entity = entityList[index]; if (entity != null && !(entity is EntityPlayer)) { if (!flag2) { if (entity is EntityAlive) { if (flag1) { switch (entity) { case EntityVehicle _: case EntityTurret _: break; default: goto label_7; } } if (!EntityClass.list[entity.entityClass].bIsEnemyEntity) continue; } else continue; } label_7: Log.Out("KILLALLR entity: " + entity.EntityClass.entityClassName); entity.DamageEntity(new DamageSource(EnumDamageSource.Internal, EnumDamageTypes.Suicide), 99999, false); //SingletonMonoBehaviour.Instance.Output("Gave " + 99999.ToString() + " damage to entity " + entity.GetDebugName()); } } } }