AI operating reactors & railguns, misc AI improvements
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Barotrauma.Items.Components;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
@@ -7,32 +8,53 @@ namespace Barotrauma
|
||||
{
|
||||
class Order
|
||||
{
|
||||
public static List<Order> List;
|
||||
public static List<Order> PrefabList;
|
||||
|
||||
public readonly string Name;
|
||||
public readonly string DoingText;
|
||||
|
||||
Sprite buttonSprite;
|
||||
//Sprite buttonSprite;
|
||||
|
||||
public readonly Type ItemComponentType;
|
||||
|
||||
public ItemComponent TargetItem;
|
||||
|
||||
public readonly string[] Options;
|
||||
|
||||
static Order()
|
||||
{
|
||||
List = new List<Order>();
|
||||
PrefabList = new List<Order>();
|
||||
|
||||
new Order("Follow", "Following");
|
||||
new Order("Operate Reactor", "Operating reactor", new string[] {"Power Up", "Shutdown"});
|
||||
PrefabList.Add(new Order("Follow", "Following"));
|
||||
|
||||
new Order("Dismiss", "Dismissed");
|
||||
PrefabList.Add(new Order("Operate Reactor", "Operating reactor", typeof(Reactor), new string[] {"Power up", "Shutdown"}));
|
||||
PrefabList.Add(new Order("Operate Railgun", "Operating railgun", typeof(Turret), new string[] { "Fire at will", "Hold fire" }));
|
||||
|
||||
|
||||
PrefabList.Add(new Order("Dismiss", "Dismissed"));
|
||||
}
|
||||
|
||||
private Order(string name, string doingText, Type itemComponentType, string[] parameters = null)
|
||||
{
|
||||
Name = name;
|
||||
DoingText = doingText;
|
||||
ItemComponentType = itemComponentType;
|
||||
Options = parameters == null ? new string[0] : parameters;
|
||||
}
|
||||
|
||||
public Order(Order prefab, ItemComponent targetItem)
|
||||
{
|
||||
Name = prefab.Name;
|
||||
DoingText = prefab.DoingText;
|
||||
ItemComponentType = prefab.ItemComponentType;
|
||||
Options = prefab.Options;
|
||||
|
||||
TargetItem = targetItem;
|
||||
}
|
||||
|
||||
private Order(string name, string doingText, string[] parameters = null)
|
||||
:this (name,doingText, null, parameters)
|
||||
{
|
||||
this.Name = name;
|
||||
this.DoingText = doingText;
|
||||
this.Options = parameters == null ? new string[0] : parameters;
|
||||
|
||||
List.Add(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user