(63916eda9) Unstable v0.9.1001.0

This commit is contained in:
Juan Pablo Arce
2020-05-15 13:06:19 -03:00
parent a1ca41aa5d
commit 3d2b7bcf63
52 changed files with 364 additions and 164 deletions
@@ -70,6 +70,12 @@ namespace Barotrauma.Items.Components
[Serialize(false, false, description: "Can the item repair things through holes in walls.")]
public bool RepairThroughHoles { get; set; }
[Serialize(true, false, description: "Can the item hit broken doors.")]
public bool HitItems { get; set; }
[Serialize(false, false, description: "Can the item hit broken doors.")]
public bool HitBrokenDoors { get; set; }
[Serialize(0.0f, false, description: "The probability of starting a fire somewhere along the ray fired from the barrel (for example, 0.1 = 10% chance to start a fire during a second of use).")]
public float FireProbability { get; set; }
@@ -445,7 +451,9 @@ namespace Barotrauma.Items.Components
return true;
}
else if (targetBody.UserData is Item targetItem)
{
{
if (!HitItems) { return false; }
var levelResource = targetItem.GetComponent<LevelResource>();
if (levelResource != null && levelResource.Attached &&
levelResource.requiredItems.Any() &&
@@ -463,7 +471,15 @@ namespace Barotrauma.Items.Components
}
if (!targetItem.Prefab.DamagedByRepairTools) { return false; }
if (item.GetComponent<Door>() == null && item.Condition <= 0) { return false; }
if (HitBrokenDoors)
{
if (targetItem.GetComponent<Door>() == null && targetItem.Condition <= 0) { return false; }
}
else
{
if (targetItem.Condition <= 0) { return false; }
}
targetItem.IsHighlighted = true;
@@ -486,6 +486,10 @@ namespace Barotrauma.Items.Components
return true;
}
}
else if (target.Body.UserData is Item item)
{
if (item.Condition <= 0.0f) { return false; }
}
//ignore character colliders (the projectile only hits limbs)
if (target.CollisionCategories == Physics.CollisionCharacter && target.Body.UserData is Character)
@@ -309,11 +309,10 @@ namespace Barotrauma.Items.Components
SkillSettings.Current.SkillIncreasePerRepair / Math.Max(characterSkillLevel, 1.0f),
CurrentFixer.WorldPosition + Vector2.UnitY * 100.0f);
}
SteamAchievementManager.OnItemRepaired(item, CurrentFixer);
deteriorationTimer = Rand.Range(MinDeteriorationDelay, MaxDeteriorationDelay);
wasBroken = false;
}
deteriorationTimer = Rand.Range(MinDeteriorationDelay, MaxDeteriorationDelay);
wasBroken = false;
StopRepairing(CurrentFixer);
}
}
@@ -46,7 +46,7 @@ namespace Barotrauma.Items.Components
}
[Serialize(false, false, description: "Can the component communicate with wifi components in another team's submarine (e.g. enemy sub in Combat missions, respawn shuttle). Needs to be enabled on both the component transmitting the signal and the component receiving it.", alwaysUseInstanceValues: true)]
[Editable, Serialize(false, true, description: "Can the component communicate with wifi components in another team's submarine (e.g. enemy sub in Combat missions, respawn shuttle). Needs to be enabled on both the component transmitting the signal and the component receiving it.", alwaysUseInstanceValues: true)]
public bool AllowCrossTeamCommunication
{
get;