-
Notifications
You must be signed in to change notification settings - Fork 0
/
ConsoleCommands.cs
95 lines (76 loc) · 3.43 KB
/
ConsoleCommands.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
using System.Collections.Generic;
using DaggerfallWorkshop.Game;
using DaggerfallWorkshop.Game.Items;
using UnityEngine;
namespace Game.Mods.QuestActionsExtension
{
public static class ConsoleCommands
{
public static class InBlockPosition
{
public const string Name = "qae_inblockposition";
public const string Description = "Output current position coordinates inside the current block.";
public const string Usage = "qae_inblockposition";
public static string Execute(params string[] args)
{
var playerPosition = GameManager.Instance.PlayerGPS.transform.position;
var x = Mathf.RoundToInt(playerPosition.x / 6.4f);
var y = Mathf.RoundToInt(playerPosition.z / 6.4f);
return $"Current in-block position:\nx:{x} y:{y}";
}
}
public static class CurrentMapPixel
{
public const string Name = "qae_getcurrentpixel";
public const string Description = "Output pixel coordinates for a current location.";
public const string Usage = "qae_getcurrentpixel";
public static string Execute(params string[] args)
{
var playerPosition = GameManager.Instance.PlayerGPS.CurrentMapPixel;
return $"Current Pixel Coordinates:\nx: {playerPosition.X} y: {playerPosition.Y}";
}
}
public static class CurrentRegionIndex
{
public const string Name = "qae_getcurrentregionindex";
public const string Description = "Output integer index for a current region.";
public const string Usage = "qae_getcurrentregionindex";
public static string Execute(params string[] args)
{
var cri = GameManager.Instance.PlayerGPS.CurrentRegionIndex;
return $"Current Region Index is: {cri}";
}
}
public static class EnumerateInventory
{
private const string _error = "Incorrect arguments";
public const string Name = "qae_player_possesses";
public const string Description = "Output list of items that player possesses in the inventory or in the wagon.";
public const string Usage = "qae_player_possesses (inventory|wagon)";
public static string Execute(params string[] args)
{
if (args == null || args.Length < 1) return _error;
ItemCollection container = null;
if (args[0] == "inventory")
{
container = GameManager.Instance.PlayerEntity.Items;
}
if (args[0] == "wagon")
{
container = GameManager.Instance.PlayerEntity.WagonItems;
}
if (container == null) return Usage;
List<string> itemText = new List<string>();
var items = container.CloneAll();
foreach (var item in items)
{
if (!item.IsQuestItem)
{
itemText.Add("Name: " + item.LongName + " | Count: " + item.stackCount + " | ItemClass: " + (int)item.ItemGroup + " | TemplateIndex: " + item.TemplateIndex);
}
}
return "List of possessed items:\n" + string.Join("\n", itemText);
}
}
}
}