Upload from upload_mods.ps1
This commit is contained in:
38
Scripts/Command/ConsoleCmdChangeOption.cs
Normal file
38
Scripts/Command/ConsoleCmdChangeOption.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ConsoleCmdChangeOption : ConsoleCmdAbstract
|
||||
{
|
||||
public override bool IsExecuteOnClient => true;
|
||||
public override bool AllowedInMainMenu => false;
|
||||
public override int DefaultPermissionLevel => 1000;
|
||||
|
||||
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
||||
{
|
||||
if (GameManager.Instance.adminTools == null)
|
||||
return;
|
||||
|
||||
if (_params.Count == 2)
|
||||
{
|
||||
string option = _params[0];
|
||||
string value = _params[1];
|
||||
|
||||
if (!SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer((NetPackage)NetPackageManager.GetPackage<NetPackageChangeOption>().Setup(option, value));
|
||||
return;
|
||||
}
|
||||
|
||||
RebirthUtilities.ChangeOption(option, value);
|
||||
}
|
||||
}
|
||||
|
||||
public override string[] getCommands()
|
||||
{
|
||||
return new string[1] { "changeoption" };
|
||||
}
|
||||
|
||||
public override string getDescription()
|
||||
{
|
||||
return "Lets the player change a rebirth option";
|
||||
}
|
||||
}
|
||||
61
Scripts/Command/ConsoleCmdKillAllRebirth.cs
Normal file
61
Scripts/Command/ConsoleCmdKillAllRebirth.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
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<string> _params, CommandSenderInfo _senderInfo)
|
||||
{
|
||||
bool flag1 = _params.Count > 0 && _params[0].EqualsCaseInsensitive("alive");
|
||||
bool flag2 = _params.Count > 0 && _params[0].EqualsCaseInsensitive("all");
|
||||
List<Entity> entityList = new List<Entity>((IEnumerable<Entity>)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<SdtdConsole>.Instance.Output("Gave " + 99999.ToString() + " damage to entity " + entity.GetDebugName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
56
Scripts/Command/ConsoleCmdListPrefabs.cs
Normal file
56
Scripts/Command/ConsoleCmdListPrefabs.cs
Normal file
@@ -0,0 +1,56 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
||||
public class ConsoleCmdListPrefabs : ConsoleCmdAbstract
|
||||
{
|
||||
public override bool IsExecuteOnClient => true;
|
||||
public override bool AllowedInMainMenu => false;
|
||||
public override int DefaultPermissionLevel => 1000;
|
||||
|
||||
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
||||
{
|
||||
if (GameManager.Instance.adminTools == null)
|
||||
return;
|
||||
|
||||
List<PrefabInstance> uniquePrefabs = new List<PrefabInstance>();
|
||||
|
||||
// Iterate over all prefabs
|
||||
for (int i = 0; i < GameManager.Instance.GetDynamicPrefabDecorator().allPrefabs.Count; i++)
|
||||
{
|
||||
PrefabInstance prefabInstance = GameManager.Instance.GetDynamicPrefabDecorator().allPrefabs[i];
|
||||
|
||||
if (prefabInstance == null) continue;
|
||||
|
||||
bool proceed = prefabInstance.prefab.SleeperVolumes.Count > 0 && !prefabInstance.prefab.Tags.Test_AnySet(FastTags<TagGroup.Poi>.Parse("rwgonly,streettile,hideui,part"));
|
||||
|
||||
if (!proceed)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check if prefab already exists in the list (by prefabName)
|
||||
if (uniquePrefabs.Any(p => p.prefab.PrefabName == prefabInstance.prefab.PrefabName)) continue;
|
||||
|
||||
// Add unique prefab instance to the list
|
||||
uniquePrefabs.Add(prefabInstance);
|
||||
}
|
||||
|
||||
// Sort the list by difficultyTier
|
||||
uniquePrefabs = uniquePrefabs.OrderBy(p => p.prefab.DifficultyTier).ToList();
|
||||
|
||||
foreach (PrefabInstance prefabInstance in uniquePrefabs)
|
||||
{
|
||||
Log.Out("ConsoleCmdListPrefabs-Execute prefab: " + prefabInstance.prefab.PrefabName + " [" + prefabInstance.prefab.DifficultyTier + "] + / tags: " + prefabInstance.prefab.Tags);
|
||||
}
|
||||
}
|
||||
|
||||
public override string[] getCommands()
|
||||
{
|
||||
return new string[1] { "listprefabs" };
|
||||
}
|
||||
|
||||
public override string getDescription()
|
||||
{
|
||||
return "List the prefabs on the current map";
|
||||
}
|
||||
}
|
||||
32
Scripts/Command/ConsoleCmdNohit.cs
Normal file
32
Scripts/Command/ConsoleCmdNohit.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ConsoleCmdNohit : ConsoleCmdAbstract
|
||||
{
|
||||
public override bool IsExecuteOnClient => true;
|
||||
public override bool AllowedInMainMenu => false;
|
||||
public override int DefaultPermissionLevel => 1000;
|
||||
|
||||
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
||||
{
|
||||
if (!RebirthVariables.noHit)
|
||||
{
|
||||
Log.Out("============================== NO HIT LOGGING STARTED ==============================");
|
||||
}
|
||||
else
|
||||
{
|
||||
Log.Out("============================== NO HIT LOGGING ENDED ==============================");
|
||||
}
|
||||
RebirthVariables.noHitCheck = Time.time;
|
||||
RebirthVariables.noHit = !RebirthVariables.noHit;
|
||||
}
|
||||
|
||||
public override string[] getCommands()
|
||||
{
|
||||
return new string[1] { "nohit" };
|
||||
}
|
||||
|
||||
public override string getDescription()
|
||||
{
|
||||
return "Enables extra logging in an attempt to figure out the source of the no hit bug";
|
||||
}
|
||||
}
|
||||
44
Scripts/Command/ConsoleCmdSetProgression.cs
Normal file
44
Scripts/Command/ConsoleCmdSetProgression.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ConsoleCmdSetProgression : ConsoleCmdAbstract
|
||||
{
|
||||
public override bool IsExecuteOnClient => true;
|
||||
public override bool AllowedInMainMenu => false;
|
||||
public override int DefaultPermissionLevel => 1000;
|
||||
|
||||
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
||||
{
|
||||
if (GameManager.Instance.adminTools == null)
|
||||
return;
|
||||
|
||||
if (_params.Count == 2)
|
||||
{
|
||||
string progression = _params[0];
|
||||
int level = int.Parse(_params[1]);
|
||||
|
||||
if (level >= 0)
|
||||
{
|
||||
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
|
||||
if (primaryPlayer != null)
|
||||
{
|
||||
ProgressionValue progressionValue = primaryPlayer.Progression.GetProgressionValue(progression);
|
||||
if (progressionValue != null)
|
||||
{
|
||||
progressionValue.level = level;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override string[] getCommands()
|
||||
{
|
||||
return new string[1] { "setprogression" };
|
||||
}
|
||||
|
||||
public override string getDescription()
|
||||
{
|
||||
return "Lets the player set progression";
|
||||
}
|
||||
}
|
||||
35
Scripts/Command/ConsoleCmdTestEvents.cs
Normal file
35
Scripts/Command/ConsoleCmdTestEvents.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
public class ConsoleCmdTestEvents : ConsoleCmdAbstract
|
||||
{
|
||||
public override bool IsExecuteOnClient => true;
|
||||
public override bool AllowedInMainMenu => false;
|
||||
public override int DefaultPermissionLevel => 1000;
|
||||
|
||||
// testevents 0 1 20 0
|
||||
// testevents 6 1 10 3 (BANDITS)
|
||||
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
||||
{
|
||||
if (GameManager.Instance.adminTools == null)
|
||||
return;
|
||||
|
||||
if (_params.Count == 4)
|
||||
{
|
||||
RebirthVariables.testEventsType = int.Parse(_params[0]);
|
||||
RebirthVariables.testEventsCategory = int.Parse(_params[1]);
|
||||
RebirthVariables.testEventsPlayerLevel = int.Parse(_params[2]);
|
||||
RebirthVariables.testEventsClassLevel = int.Parse(_params[3]);
|
||||
RebirthVariables.testEvents = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override string[] getCommands()
|
||||
{
|
||||
return new string[1] { "testevents" };
|
||||
}
|
||||
|
||||
public override string getDescription()
|
||||
{
|
||||
return "Lets the player test a single event.";
|
||||
}
|
||||
}
|
||||
71
Scripts/Command/ConsoleCmdUnhideNPC.cs
Normal file
71
Scripts/Command/ConsoleCmdUnhideNPC.cs
Normal file
@@ -0,0 +1,71 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine.Scripting;
|
||||
|
||||
#nullable disable
|
||||
[Preserve]
|
||||
public class ConsoleCmdUnhideNPC : ConsoleCmdAbstract
|
||||
{
|
||||
public override bool IsExecuteOnClient => true;
|
||||
|
||||
[PublicizedFrom(EAccessModifier.Protected)]
|
||||
public override string[] getCommands()
|
||||
{
|
||||
return new string[1] { "unhidenpc" };
|
||||
}
|
||||
|
||||
[PublicizedFrom(EAccessModifier.Protected)]
|
||||
public override string getDescription() => "Unhide hidden npcs";
|
||||
|
||||
[PublicizedFrom(EAccessModifier.Protected)]
|
||||
public override string getHelp()
|
||||
{
|
||||
return "Unhides all matching npcs\nUsage:\n unhidenpc (all npcs)\n unhidenpc [EntityID] (npc with matching entity ID)";
|
||||
}
|
||||
|
||||
public override void Execute(List<string> _params, CommandSenderInfo _senderInfo)
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute START");
|
||||
if (SingletonMonoBehaviour<ConnectionManager>.Instance.IsServer)
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute 1");
|
||||
if (_params.Count > 0)
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute 2");
|
||||
string parameter = _params[0];
|
||||
|
||||
RebirthUtilities.UnhideNPC(parameter);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute 3");
|
||||
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
|
||||
if (primaryPlayer != null)
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute 4");
|
||||
RebirthUtilities.UnhideNPC("", primaryPlayer.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute 5");
|
||||
string parameter = "";
|
||||
|
||||
if (_params.Count > 0)
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute 6");
|
||||
parameter = _params[0];
|
||||
}
|
||||
|
||||
EntityPlayerLocal primaryPlayer = GameManager.Instance.World.GetPrimaryPlayer();
|
||||
|
||||
if (primaryPlayer != null)
|
||||
{
|
||||
//Log.Out("ConsoleCmdUnhideNPC-Execute 7");
|
||||
SingletonMonoBehaviour<ConnectionManager>.Instance.SendToServer((NetPackage)NetPackageManager.GetPackage<NetPackageUnhideNPC>().Setup(parameter, primaryPlayer.position));
|
||||
RebirthUtilities.UnhideNPC("", primaryPlayer.position);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user