Endworm attacks working, itemlabel text saving bugfix, deconstructors & fabricators need power, engine sprite, disable wire node dragging in character mode, only hit with one meleeweapon at a time, fixrequirement text overflow fix, mapentities can hace multiple categories, Gap.FindHull fix, Waypoint ladder & gap saving, stuff
This commit is contained in:
@@ -35,7 +35,7 @@ namespace Barotrauma
|
||||
|
||||
public override bool IsCompleted()
|
||||
{
|
||||
return isCompleted;
|
||||
return isCompleted || container.Inventory.FindItem(itemName)!=null;
|
||||
}
|
||||
|
||||
protected override void Act(float deltaTime)
|
||||
|
||||
@@ -59,6 +59,8 @@ namespace Barotrauma
|
||||
|
||||
protected override void Act(float deltaTime)
|
||||
{
|
||||
if (target == character) return;
|
||||
|
||||
waitUntilPathUnreachable -= deltaTime;
|
||||
|
||||
if (character.SelectedConstruction!=null && character.SelectedConstruction.GetComponent<Ladder>()==null)
|
||||
|
||||
@@ -85,12 +85,12 @@ namespace Barotrauma
|
||||
currentObjective = new AIObjectiveGoTo(Character.Controlled, character, true);
|
||||
break;
|
||||
case "wait":
|
||||
currentObjective = new AIObjectiveGoTo(character.SimPosition, character, true);
|
||||
currentObjective = new AIObjectiveGoTo(character, character, true);
|
||||
break;
|
||||
default:
|
||||
if (order.TargetItem == null) return;
|
||||
|
||||
currentObjective = new AIObjectiveOperateItem(order.TargetItem, character, option);
|
||||
currentObjective = new AIObjectiveOperateItem(order.TargetItem, character, option, null, order.UseController);
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -30,15 +30,19 @@ namespace Barotrauma
|
||||
get { return operateTarget; }
|
||||
}
|
||||
|
||||
public AIObjectiveOperateItem(ItemComponent item, Character character, string option, Entity operateTarget = null)
|
||||
public AIObjectiveOperateItem(ItemComponent item, Character character, string option, Entity operateTarget = null, bool useController = false)
|
||||
:base (character, option)
|
||||
{
|
||||
component = item;
|
||||
|
||||
this.operateTarget = operateTarget;
|
||||
|
||||
var controllers = item.Item.GetConnectedComponents<Controller>();
|
||||
if (controllers.Any()) component = controllers[0];
|
||||
if (useController)
|
||||
{
|
||||
var controllers = item.Item.GetConnectedComponents<Controller>();
|
||||
if (controllers.Any()) component = controllers[0];
|
||||
}
|
||||
|
||||
|
||||
canBeCompleted = true;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@ namespace Barotrauma
|
||||
|
||||
public readonly Color Color;
|
||||
|
||||
public readonly bool UseController;
|
||||
|
||||
public ItemComponent TargetItem;
|
||||
|
||||
public readonly string[] Options;
|
||||
@@ -76,6 +78,8 @@ namespace Barotrauma
|
||||
|
||||
Color = new Color(ToolBox.GetAttributeVector4(orderElement, "color", new Vector4(1.0f, 1.0f, 1.0f, 1.0f)));
|
||||
|
||||
UseController = ToolBox.GetAttributeBool(orderElement, "usecontroller", false);
|
||||
|
||||
string optionStr = ToolBox.GetAttributeString(orderElement, "options", "");
|
||||
|
||||
if (string.IsNullOrWhiteSpace(optionStr))
|
||||
@@ -112,12 +116,13 @@ namespace Barotrauma
|
||||
|
||||
public Order(Order prefab, ItemComponent targetItem)
|
||||
{
|
||||
Name = prefab.Name;
|
||||
DoingText = prefab.DoingText;
|
||||
ItemComponentType = prefab.ItemComponentType;
|
||||
Options = prefab.Options;
|
||||
SymbolSprite = prefab.SymbolSprite;
|
||||
Color = prefab.Color;
|
||||
Name = prefab.Name;
|
||||
DoingText = prefab.DoingText;
|
||||
ItemComponentType = prefab.ItemComponentType;
|
||||
Options = prefab.Options;
|
||||
SymbolSprite = prefab.SymbolSprite;
|
||||
Color = prefab.Color;
|
||||
UseController = prefab.UseController;
|
||||
|
||||
TargetItem = targetItem;
|
||||
}
|
||||
|
||||
@@ -89,6 +89,7 @@ namespace Barotrauma
|
||||
private Character closestCharacter, selectedCharacter;
|
||||
|
||||
protected bool isDead;
|
||||
private CauseOfDeath causeOfDeath;
|
||||
|
||||
public readonly bool IsHumanoid;
|
||||
|
||||
@@ -291,6 +292,11 @@ namespace Barotrauma
|
||||
get { return isDead; }
|
||||
}
|
||||
|
||||
public CauseOfDeath CauseOfDeath
|
||||
{
|
||||
get { return causeOfDeath; }
|
||||
}
|
||||
|
||||
public override Vector2 SimPosition
|
||||
{
|
||||
get { return AnimController.RefLimb.SimPosition; }
|
||||
@@ -915,7 +921,6 @@ namespace Barotrauma
|
||||
if (!protectedFromPressure &&
|
||||
(AnimController.CurrentHull == null || AnimController.CurrentHull.LethalPressure >= 100.0f))
|
||||
{
|
||||
|
||||
PressureTimer += ((AnimController.CurrentHull == null) ?
|
||||
100.0f : AnimController.CurrentHull.LethalPressure) * deltaTime;
|
||||
|
||||
@@ -1222,6 +1227,7 @@ namespace Barotrauma
|
||||
health = 0.0f;
|
||||
|
||||
isDead = true;
|
||||
this.causeOfDeath = causeOfDeath;
|
||||
AnimController.movement = Vector2.Zero;
|
||||
AnimController.TargetMovement = Vector2.Zero;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user