Skip to content

Commit

Permalink
remove flint BP and reladed
Browse files Browse the repository at this point in the history
  • Loading branch information
ttr committed May 14, 2024
1 parent 29d0be4 commit 4dbcae2
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 174 deletions.
2 changes: 1 addition & 1 deletion Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: MelonInfo(typeof(FireAddons.FireAddons), "FireAddons", "3.0.0", "ttr")]
[assembly: MelonInfo(typeof(FireAddons.FireAddons), "FireAddons", "3.0.1", "ttr")]
[assembly: MelonGame("Hinterland", "TheLongDark")]
9 changes: 1 addition & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,7 @@ Additionally, each tinder have separated setting is to have different values for

### Flint and steel

Flint is in game but hidden (and no icon) and normally is not crafteble nor lootable.
However, Whetstone (sharpening stone) can be used as flint in real life.
The steel part - this needs to be high carbon steel, and not aloys. In theory smelting prybar (which is hard steel) with coal will carbonize it.
That (over simplistic) theory can actually give us flint and steel as firestarter.

It's degredation should be keept low-ish - around 0.5-2 - as prybar and whetstone are rare and finite

Also, if game had shovel as lootable, that could be more realistic "steel" coponent.
(removed - see other mods)

Thanks to [zeobviouslyfakeacc](https://github.com/zeobviouslyfakeacc/), and his [TinCanImprovemnts](https://github.com/zeobviouslyfakeacc/TinCanImprovements) mod for ability to create blueprints.

Expand Down
82 changes: 0 additions & 82 deletions src/FireAddons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,19 +184,6 @@ internal static void ModifyFirestarters(GearItem gi)
gi.m_FireStarterItem.m_FireStartSkillModifier = Settings.options.lensesPenalty;
}

// Flint
if (gi.name.Contains("GEAR_FlintAndSteel"))
{
if (!gi.m_FireStarterItem)
{
gi.m_FireStarterItem = gi.gameObject.AddComponent<FireStarterItem>();
}
gi.m_FireStarterItem.m_ConditionDegradeOnUse = Settings.options.flintDegredation;
gi.m_FireStarterItem.m_SecondsToIgniteTinder = Settings.options.flintStartFire;
gi.m_FireStarterItem.m_SecondsToIgniteTorch = Settings.options.flintStartTorch;
gi.m_FireStarterItem.m_FireStartSkillModifier = Settings.options.flintPenalty;
gi.m_StartCondition = GearStartCondition.Perfect;
}
if (gi.name.Contains("GEAR_Firestriker"))
{
gi.m_FireStarterItem.m_ConditionDegradeOnUse = Settings.options.firestrikerDegredation;
Expand All @@ -206,76 +193,7 @@ internal static void ModifyFirestarters(GearItem gi)
}
}

internal static void Blueprints()
{
// Buy 'zeobviouslyfakeacc' a beer as i've used his tincan improvements code
if (Settings.options.flintEnable)
{
// create bp

BlueprintData bp_flint = new();
// Inputs
bp_flint.m_RequiredGear = new Il2CppReferenceArray<BlueprintData.RequiredGearItem>(4)
{
[0] = new BlueprintData.RequiredGearItem() { m_Count = 1, m_Item = GetGearItemPrefab("GEAR_Prybar") },
[1] = new BlueprintData.RequiredGearItem() { m_Count = 1, m_Item = GetGearItemPrefab("GEAR_SharpeningStone") },
[2] = new BlueprintData.RequiredGearItem() { m_Count = 1, m_Item = GetGearItemPrefab("GEAR_Coal") }
};

bp_flint.m_KeroseneLitersRequired = 0f;
bp_flint.m_GunpowderKGRequired = 0f;
bp_flint.m_RequiredTool = GetToolItemPrefab("GEAR_Hammer");
bp_flint.m_OptionalTools = new Il2CppReferenceArray<ToolsItem>(0);

// Outputs
bp_flint.m_CraftedResult = GetGearItemPrefab("GEAR_FlintAndSteel");
bp_flint.m_CraftedResultCount = 1;

// Process
bp_flint.m_Locked = false;
bp_flint.m_AppearsInStoryOnly = false;
bp_flint.m_RequiresLight = false;
bp_flint.m_RequiresLitFire = true;
bp_flint.m_RequiredCraftingLocation = CraftingLocation.Forge;
bp_flint.m_DurationMinutes = 360;
bp_flint.m_CraftingAudio = MakeAudioEvent("PLAY_CRAFTINGGENERIC");
bp_flint.m_AppliedSkill = SkillType.ToolRepair;
bp_flint.m_ImprovedSkill = SkillType.None;


if (Settings.options.flintSmeltEnable)
{
// re-smelt one
BlueprintData bp_flint2 = new();
// Inputs
bp_flint2.m_RequiredGear = new Il2CppReferenceArray<BlueprintData.RequiredGearItem>(4)
{
[0] = new BlueprintData.RequiredGearItem() { m_Count = 1, m_Item = GetGearItemPrefab("GEAR_FlintAndSteel") },
[1] = new BlueprintData.RequiredGearItem() { m_Count = 1, m_Item = GetGearItemPrefab("GEAR_ScrapMetal") },
[2] = new BlueprintData.RequiredGearItem() { m_Count = 1, m_Item = GetGearItemPrefab("GEAR_Coal") }
};
bp_flint2.m_KeroseneLitersRequired = 0f;
bp_flint2.m_GunpowderKGRequired = 0f;
bp_flint2.m_RequiredTool = GetToolItemPrefab("GEAR_Hammer");
bp_flint2.m_OptionalTools = new Il2CppReferenceArray<ToolsItem>(0);

// Outputs
bp_flint2.m_CraftedResult = GetGearItemPrefab("GEAR_FlintAndSteel");
bp_flint2.m_CraftedResultCount = 1;

// Process
bp_flint2.m_Locked = false;
bp_flint2.m_AppearsInStoryOnly = false;
bp_flint2.m_RequiresLight = false;
bp_flint2.m_RequiresLitFire = true;
bp_flint2.m_RequiredCraftingLocation = CraftingLocation.Forge;
bp_flint2.m_DurationMinutes = 180;
bp_flint2.m_CraftingAudio = MakeAudioEvent("PLAY_CRAFTINGGENERIC");
bp_flint2.m_AppliedSkill = SkillType.ToolRepair;
bp_flint2.m_ImprovedSkill = SkillType.None;
}
}
}
private static GearItem GetGearItemPrefab(string name) => Resources.Load(name).Cast<GameObject>().GetComponent<GearItem>();
private static ToolsItem GetToolItemPrefab(string name) => Resources.Load(name).Cast<GameObject>().GetComponent<ToolsItem>();
public static Il2CppAK.Wwise.Event? MakeAudioEvent(string eventName)
Expand Down
38 changes: 0 additions & 38 deletions src/Patches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,44 +33,6 @@ private static void Postfix(GearItem __instance)
FireAddons.ModifyFirestarters(__instance);
}
}
[HarmonyPatch(typeof(Panel_Crafting), nameof(Panel_Crafting.Initialize))]
public class Panel_Crafting_bpl
{
private static void Postfix()
{
FireAddons.Blueprints();
}
}
[HarmonyPatch(typeof(Panel_Crafting), "ItemPassesFilter")]
private static class RecipesInToolsRecipes
{
internal static void Postfix(Panel_Crafting __instance, ref bool __result, BlueprintData bpi)
{
if (bpi?.m_CraftedResult?.name == "GEAR_FlintAndSteel" && __instance.m_CurrentCategory == Panel_Crafting.Category.FireStarting)
{
__result = true;
}
}
}
/*
[HarmonyPatch(typeof(BlueprintDisplayItem), "Setup")]
private static class FixScrapMetalRecipeIcon
{
internal static void Postfix(BlueprintDisplayItem __instance, BlueprintItem bpi)
{
if (bpi?.m_CraftedResult?.name == "GEAR_FlintAndSteel")
{
Texture2D scrapMetalTexture = Utils.GetCachedTexture(SCRAP_METAL_CRAFTING_ICON_NAME);
if (!scrapMetalTexture)
{
scrapMetalTexture = TinCanImprovementsMod.assetBundle.LoadAsset(SCRAP_METAL_CRAFTING_ICON_NAME).Cast<Texture2D>();
Utils.CacheTexture(SCRAP_METAL_CRAFTING_ICON_NAME, scrapMetalTexture);
}
__instance.m_Icon.mTexture = scrapMetalTexture;
}
}
}
*/

[HarmonyPatch(typeof(Panel_FeedFire), "OnFeedFire")]
internal class Panel_FeedFire_OnFeedFire
Expand Down
45 changes: 0 additions & 45 deletions src/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,35 +75,6 @@ internal class FireAddonsSettings : JsonModSettings
public int firestrikerDegredation = 2;


[Section("Flint")]
[Name("Flint: crafting enabled")]
public bool flintEnable = true;

[Name("Flint: resmelt enabled")]
[Description("Allow re-smelting flints steel as repair process.")]
public bool flintSmeltEnable = true;

[Name("Flint: time to light fire")]
[Description("Default: 4.")]
[Slider(0, 40)]
public int flintStartFire = 4;

[Name("Flint: time to light torch")]
[Description("Default: 4.")]
[Slider(0, 40)]
public int flintStartTorch = 4;

[Name("Flint: fire start chance modification")]
[Description("Default: -10.")]
[Slider(-30, 30)]
public int flintPenalty = -10;

[Name("Flint: degredation")]
[Description("Suggested value 1.")]
[Slider(0f, 20f)]
public int flintDegredation = 1;


[Section("Tinder")]
[Name("Tinder as Fuel")]
[Description("Use tinder as fuel (not during starting fire). Vanilla: no, suggested yes.")]
Expand Down Expand Up @@ -266,22 +237,6 @@ internal void RefreshFields()
SetFieldVisible(nameof(tinderBonusBark), false);

}
if (flintEnable)
{
SetFieldVisible(nameof(flintSmeltEnable), true);
SetFieldVisible(nameof(flintDegredation), true);
SetFieldVisible(nameof(flintStartFire), true);
SetFieldVisible(nameof(flintStartTorch), true);
SetFieldVisible(nameof(flintPenalty), true);
}
else
{
SetFieldVisible(nameof(flintSmeltEnable), false);
SetFieldVisible(nameof(flintDegredation), false);
SetFieldVisible(nameof(flintStartFire), false);
SetFieldVisible(nameof(flintStartTorch), false);
SetFieldVisible(nameof(flintPenalty), false);
}
if (embersSystem)
{
SetFieldVisible(nameof(embersTime), true);
Expand Down

0 comments on commit 4dbcae2

Please sign in to comment.