Unstable 0.17.6.0
This commit is contained in:
@@ -116,8 +116,6 @@ namespace Barotrauma.Items.Components
|
||||
this.fabricationRecipes = fabricationRecipes.ToImmutableDictionary();
|
||||
|
||||
state = FabricatorState.Stopped;
|
||||
|
||||
InitProjSpecific();
|
||||
}
|
||||
|
||||
public override void OnItemLoaded()
|
||||
@@ -146,9 +144,6 @@ namespace Barotrauma.Items.Components
|
||||
|
||||
partial void OnItemLoadedProjSpecific();
|
||||
|
||||
|
||||
partial void InitProjSpecific();
|
||||
|
||||
public override bool Select(Character character)
|
||||
{
|
||||
SelectProjSpecific(character);
|
||||
@@ -192,7 +187,7 @@ namespace Barotrauma.Items.Components
|
||||
if (!isClient)
|
||||
{
|
||||
MoveIngredientsToInputContainer(selectedItem);
|
||||
if (selectedItem.RequiredMoney > 0)
|
||||
if (selectedItem.RequiredMoney > 0 && CanBeFabricated(fabricatedItem, availableIngredients, user))
|
||||
{
|
||||
if (GameMain.GameSession?.GameMode is MultiPlayerCampaign)
|
||||
{
|
||||
@@ -395,14 +390,17 @@ namespace Barotrauma.Items.Components
|
||||
var fabricationitemAmount = new AbilityFabricationItemAmount(fabricatedItem.TargetItem, fabricatedItem.Amount);
|
||||
|
||||
int quality = 0;
|
||||
if (user?.Info != null)
|
||||
if (fabricatedItem.Quality.HasValue)
|
||||
{
|
||||
quality = fabricatedItem.Quality.Value;
|
||||
}
|
||||
else if (user?.Info != null)
|
||||
{
|
||||
foreach (Character character in Character.GetFriendlyCrew(user))
|
||||
{
|
||||
character.CheckTalents(AbilityEffectType.OnAllyItemFabricatedAmount, fabricationitemAmount);
|
||||
}
|
||||
user.CheckTalents(AbilityEffectType.OnItemFabricatedAmount, fabricationitemAmount);
|
||||
|
||||
user.CheckTalents(AbilityEffectType.OnItemFabricatedAmount, fabricationitemAmount);
|
||||
quality = GetFabricatedItemQuality(fabricatedItem, user);
|
||||
}
|
||||
|
||||
|
||||
@@ -1196,7 +1196,7 @@ namespace Barotrauma
|
||||
drawableComponents.Add(drawable);
|
||||
hasComponentsToDraw = true;
|
||||
#if CLIENT
|
||||
cachedVisibleSize = null;
|
||||
cachedVisibleExtents = null;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -1208,7 +1208,7 @@ namespace Barotrauma
|
||||
drawableComponents.Remove(drawable);
|
||||
hasComponentsToDraw = drawableComponents.Count > 0;
|
||||
#if CLIENT
|
||||
cachedVisibleSize = null;
|
||||
cachedVisibleExtents = null;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@@ -118,6 +118,7 @@ namespace Barotrauma
|
||||
public readonly ImmutableArray<Skill> RequiredSkills;
|
||||
public readonly uint RecipeHash;
|
||||
public readonly int Amount;
|
||||
public readonly int? Quality;
|
||||
|
||||
/// <summary>
|
||||
/// How many of this item the fabricator can create (< 0 = unlimited)
|
||||
@@ -150,6 +151,11 @@ namespace Barotrauma
|
||||
FabricationLimitMin = element.GetAttributeInt(nameof(FabricationLimitMin), limitDefault);
|
||||
FabricationLimitMax = element.GetAttributeInt(nameof(FabricationLimitMax), limitDefault);
|
||||
|
||||
if (element.GetAttribute(nameof(Quality)) != null)
|
||||
{
|
||||
Quality = element.GetAttributeInt(nameof(Quality), 0);
|
||||
}
|
||||
|
||||
foreach (var subElement in element.Elements())
|
||||
{
|
||||
switch (subElement.Name.ToString().ToLowerInvariant())
|
||||
|
||||
Reference in New Issue
Block a user