Elemental Tools; work backlog
This commit is contained in:
parent
d2ac4f5e9d
commit
c86f9c4a6e
33 changed files with 1961 additions and 531 deletions
|
|
@ -19,6 +19,7 @@ namespace ElementalTools
|
|||
internal const string malletItemKey = @"ItemMallet";
|
||||
internal const string sharpeningStoneItemKey = @"ItemSharpening_stone";
|
||||
internal const string SteelPrefix = @"Steel";//Generic 'steel' of Unknown province...
|
||||
internal const string consolidatableCardsKey = @"ConsolidatableCards";
|
||||
|
||||
internal const string pack_carburizationBlockKey = @"pack_carburization";
|
||||
internal const string pack_stateFired = @"fired";
|
||||
|
|
@ -47,20 +48,25 @@ namespace ElementalTools
|
|||
{
|
||||
CoreAPI.RegisterItemClass(malletItemKey, typeof(ItemMallet));
|
||||
CoreAPI.RegisterItemClass(sharpeningStoneItemKey, typeof(ItemSharpeningStone));
|
||||
|
||||
|
||||
CoreAPI.RegisterItemClass(consolidatableCardsKey, typeof(ItemConsolidatableCards));
|
||||
|
||||
//stock VS steel'ified classes
|
||||
CoreAPI.RegisterItemClass(@"Steel_Item", typeof(GenericSteelItem));
|
||||
|
||||
//Steel Wrapped ItemCores.
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<Item>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemSword>), SteelPrefix );
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemChisel>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemAxe>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemSpear>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemCleaver>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemHammer>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemHoe>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemKnife>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemProspectingPick>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemScythe>), SteelPrefix);
|
||||
CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemShears>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<Item>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemSword>), SteelPrefix );
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemChisel>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemAxe>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemSpear>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemCleaver>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemHammer>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemHoe>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemKnife>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemProspectingPick>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrapItem<ItemScythe>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrapItem<ItemShears>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemSaw>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemShovel>), SteelPrefix);
|
||||
//CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemArrow>), SteelPrefix);//Merging of Steel ammo - TODO!
|
||||
|
|
@ -195,7 +201,7 @@ namespace ElementalTools
|
|||
|
||||
}
|
||||
|
||||
private void GenerateSteelToolEquivalentGridRecipies( )
|
||||
private void GenerateSteelToolEquivalentGridRecipies( )//Revisit!
|
||||
{
|
||||
uint results = 0;
|
||||
var ironTools = new string[ ]{
|
||||
|
|
@ -336,7 +342,7 @@ namespace ElementalTools
|
|||
|
||||
/**** Terminology *************
|
||||
* Wrought Iron -> Blister Steel [Pack carburization / Cementation ]
|
||||
* Blister Steel -> Shear Steel [Smithing (Welding) ]
|
||||
* Blister Steel -> Shear Steel [Smithing (Welding/Consolidation) ]
|
||||
* Shear Steel -> Cast Steel [ Bessemer process / Open-hearth /.... ]
|
||||
* Pig Iron -> Cast Iron [ Blast furnace / .... ]
|
||||
* Cast Iron -> Steel-clad Cast Iron [ "fining" furnace; Decarburization, re-heat in air @900C]
|
||||
|
|
@ -352,6 +358,8 @@ attributes: {
|
|||
},
|
||||
|
||||
* Item: Sickle - 2x2 hand-held harvest tool (works on reeds, crops, grass, any plants)
|
||||
* Item: Mattock - Half Pickaxe, Half Shovel; All-Tool.
|
||||
* Item: Seax - larger stabbier Knife, thats still a knife.
|
||||
* Sort out how Arrow's work with item merging...
|
||||
|
||||
******************************/
|
||||
|
|
|
|||
|
|
@ -8,13 +8,15 @@ using Vintagestory.API.Config;
|
|||
using Vintagestory.API.Datastructures;
|
||||
using Vintagestory.API.MathTools;
|
||||
using Vintagestory.GameContent;
|
||||
using Vintagestory.API.Client;
|
||||
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
/// <summary>
|
||||
///Breakable Carburization 'box'; for Steel making.
|
||||
/// </summary>
|
||||
public class PackCarburization : BlockContainer
|
||||
public class PackCarburization : BlockContainer, IInFirepitRendererSupplier
|
||||
{
|
||||
public const string steelTransitionTempKey = @"SteelTransitionTemp";
|
||||
public const string steelTransitionTimeKey = @"SteelTransitionTime";
|
||||
|
|
@ -388,6 +390,20 @@ namespace ElementalTools
|
|||
return Lang.Get(this.Code.Domain +":block-"+this.Code.Path);//Domain needed...
|
||||
}
|
||||
|
||||
#region Firepit
|
||||
|
||||
public IInFirepitRenderer GetRendererWhenInFirepit(ItemStack stack, BlockEntityFirepit firepit, bool forOutputSlot)
|
||||
{
|
||||
return new PackCarburization_Renderer(this.api as ICoreClientAPI, stack, firepit.Pos, forOutputSlot);
|
||||
}
|
||||
|
||||
public EnumFirepitModel GetDesiredFirepitModel(ItemStack stack, BlockEntityFirepit firepit, bool forOutputSlot)
|
||||
{
|
||||
return EnumFirepitModel.Normal;//Or Wide?
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private void SetOutputOverride(ItemStack containerStack, string overrideCode)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(overrideCode)) {
|
||||
|
|
@ -413,6 +429,8 @@ namespace ElementalTools
|
|||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ namespace ElementalTools
|
|||
this.Temperature -= 1f;//Rain? Compute vs. ambient temp / biome, on snow/ice...
|
||||
}
|
||||
|
||||
if (!internalInventory.IsEmpty) {
|
||||
if (!internalInventory.Empty) {
|
||||
foreach (ItemSlot slot in internalInventory) {
|
||||
|
||||
if (slot.Empty) continue;
|
||||
|
|
@ -77,7 +77,7 @@ namespace ElementalTools
|
|||
*/
|
||||
dsc.Append("Contents: \n");
|
||||
|
||||
if (internalInventory.IsEmpty) {
|
||||
if (internalInventory.Empty) {
|
||||
dsc.Append("Nothing.\n");
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -8,8 +8,7 @@ using System.Text;
|
|||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.Datastructures;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
|
||||
[StructLayout(LayoutKind.Explicit, Size = 4, Pack = 1)]
|
||||
public struct RGBAColor_Int32
|
||||
{
|
||||
|
|
@ -97,5 +96,5 @@ namespace ElementalTools
|
|||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>ElementalTools</RootNamespace>
|
||||
<AssemblyName>ElementalTools</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
<ConsolePause>false</ConsolePause>
|
||||
<CustomCommands>
|
||||
<CustomCommands>
|
||||
<Command type="AfterBuild" command="7z -tzip a EraOfSteel_${ProjectConfig}.zip" workingdir="${TargetDir}" />
|
||||
<Command type="AfterBuild" command="7z a -tzip -x!*.zip -aoa ${ProjectName}_${ProjectConfig}.zip" workingdir="${TargetDir}" />
|
||||
<Command type="AfterClean" command="rm -f *.zip" workingdir="${TargetDir}" />
|
||||
</CustomCommands>
|
||||
</CustomCommands>
|
||||
|
|
@ -62,6 +62,10 @@
|
|||
<HintPath>vs_libs\VSSurvivalMod.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="0Harmony">
|
||||
<HintPath>vs_libs\0Harmony.dll</HintPath>
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="ElementalToolsMod.cs" />
|
||||
|
|
@ -73,12 +77,19 @@
|
|||
<Compile Include="Block\PackCarburization.cs" />
|
||||
<Compile Include="BlockEntities\PackCarburizationEntity.cs" />
|
||||
<Compile Include="Helpers.cs" />
|
||||
<Compile Include="General\IAmSteel.cs" />
|
||||
<Compile Include="Items\SteeIWrapItem.cs" />
|
||||
<Compile Include="General\ISteelByStack.cs" />
|
||||
<Compile Include="Items\ItemSharpeningStone.cs" />
|
||||
<Compile Include="Items\VariableWearRateTool.cs" />
|
||||
<Compile Include="ColorHelper.cs" />
|
||||
<Compile Include="General\SteelAssist.cs" />
|
||||
<Compile Include="Renderers\PackCarburization_Renderer.cs" />
|
||||
<Compile Include="General\ISteelThingInstance.cs" />
|
||||
<Compile Include="General\SteelThingViaStack.cs" />
|
||||
<Compile Include="Items\ItemConsolidatableCards.cs" />
|
||||
<Compile Include="Items\Steel\SteeIWrapItem.cs" />
|
||||
<Compile Include="Items\Steel\GenericSteelItem.cs" />
|
||||
<Compile Include="General\ISteelBase.cs" />
|
||||
<Compile Include="General\SteelAspects.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Items\" />
|
||||
|
|
@ -107,6 +118,10 @@
|
|||
<Folder Include="assets\fma\itemtypes\arms\heads\" />
|
||||
<Folder Include="assets\fma\recipes\smithing\" />
|
||||
<Folder Include="assets\fma\recipes\grid\weapon\" />
|
||||
<Folder Include="Renderers\" />
|
||||
<Folder Include="assets\fma\shapes\block\metal\" />
|
||||
<Folder Include="assets\fma\textures\liquids\" />
|
||||
<Folder Include="Items\Steel\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="modinfo.json">
|
||||
|
|
@ -304,6 +319,16 @@
|
|||
<None Include="assets\fma\shapes\item\tools\drawplate.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="assets\fma\blocktypes\metal\crusie_lamp.json" />
|
||||
<None Include="assets\fma\textures\metal\black_iron2.png" />
|
||||
<None Include="assets\fma\textures\liquids\liquid_oil.png" />
|
||||
<None Include="assets\fma\itemtypes\metallurgy\metal_cards.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="assets\fma\recipes\smithing\metal_cards.json" />
|
||||
<None Include="assets\fma\shapes\item\arms\seax.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
||||
|
|
@ -63,11 +63,16 @@ namespace ElementalTools
|
|||
return;
|
||||
}
|
||||
|
||||
ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, PostLoadTweaks);
|
||||
//ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, PostLoadTweaks);
|
||||
|
||||
Mod.Logger.VerboseDebug("The ERA of STEEL Begins!");
|
||||
}
|
||||
|
||||
public override void AssetsFinalize(ICoreAPI api)
|
||||
{
|
||||
PostLoadTweaks( );
|
||||
}
|
||||
|
||||
public override void StartClientSide(ICoreClientAPI api)
|
||||
{
|
||||
this.ClientAPI = api;
|
||||
|
|
@ -94,7 +99,7 @@ namespace ElementalTools
|
|||
/// <returns>The load tweaks.</returns>
|
||||
private void PostLoadTweaks( )
|
||||
{
|
||||
Mod.Logger.Notification("Making a few changes to recipes...");
|
||||
Mod.Logger.Notification("Making a few changes & additions to recipes...");
|
||||
|
||||
#if DEBUG
|
||||
Mod.Logger.VerboseDebug($"Total GridRecipies: {CoreAPI.World.GridRecipes.Count}");
|
||||
|
|
|
|||
20
ElementalTools/General/ISteelBase.cs
Normal file
20
ElementalTools/General/ISteelBase.cs
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
using System;
|
||||
namespace ElementalTools
|
||||
{
|
||||
/// <summary>
|
||||
/// General 'Steel' base properties [unchangeing/immutable]
|
||||
/// </summary>
|
||||
public interface ISteelBase
|
||||
{
|
||||
|
||||
//Static read-only properties from Item Def.
|
||||
string BaseMetalName { get; }//Blister, Shear, Cast, Damascus, Wootz, Stainless
|
||||
bool Sharpenable { get; }
|
||||
bool Hardenable { get; }
|
||||
//Fracture rate?
|
||||
//Rust resistance?
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -4,15 +4,11 @@ using Vintagestory.API.Common;
|
|||
|
||||
namespace ElementalTools
|
||||
{
|
||||
public interface IAmSteel
|
||||
public interface ISteelByStack
|
||||
{
|
||||
//Static read-only properties from Item Def.
|
||||
string Name { get; }//Blister, Shear, Cast, Damascus, Wootz...mostly descriptive
|
||||
bool Sharpenable { get; }
|
||||
bool Hardenable { get; }
|
||||
|
||||
//Rusty?
|
||||
|
||||
//Rust?
|
||||
//Fracture rate?
|
||||
|
||||
/// <summary>
|
||||
/// Read Sharpness; Dynamic properties from ItemStack - attribs
|
||||
|
|
@ -59,7 +55,7 @@ namespace ElementalTools
|
|||
/// </summary>
|
||||
/// <param name="donor">From here</param>
|
||||
/// <param name="recipient">To here.</param>
|
||||
void CopyAttributes(ItemStack donor, ItemStack recipient);
|
||||
void CopyStackAttributes(ItemStack donor, ItemStack recipient);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
44
ElementalTools/General/ISteelThingInstance.cs
Normal file
44
ElementalTools/General/ISteelThingInstance.cs
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
using System;
|
||||
|
||||
using Vintagestory.API.Common;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
public interface ISteelThingInstance
|
||||
{
|
||||
//Rusty?
|
||||
|
||||
/// <summary>
|
||||
/// Read Sharpness; Dynamic properties from ItemStack - attribs
|
||||
/// </summary>
|
||||
SharpnessState Sharpness { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Incriments the sharpness.
|
||||
/// </summary>
|
||||
/// <returns>The sharpness.</returns>
|
||||
SharpnessState Sharpen();
|
||||
|
||||
/// <summary>
|
||||
/// Reduce the sharpness.
|
||||
/// </summary>
|
||||
SharpnessState Dull();
|
||||
|
||||
/// <summary>
|
||||
/// Set Hardness
|
||||
/// </summary>
|
||||
HardnessState Hardness{ get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Harden (incriment) this collectable.
|
||||
/// </summary>
|
||||
HardnessState Harden();
|
||||
|
||||
/// <summary>
|
||||
/// Clones the stack attributes ONTO Target. (used when sharpening)
|
||||
/// </summary>
|
||||
/// <returns>The stack attributes.</returns>
|
||||
/// <param name="target">Subject of stack-attribute (overwrite).</param>
|
||||
void CloneStackAttributes(ItemStack target);
|
||||
}
|
||||
}
|
||||
593
ElementalTools/General/SteelAspects.cs
Normal file
593
ElementalTools/General/SteelAspects.cs
Normal file
|
|
@ -0,0 +1,593 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using HarmonyLib;
|
||||
|
||||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.Common.Entities;
|
||||
using Vintagestory.API.Config;
|
||||
using Vintagestory.API.MathTools;
|
||||
using Vintagestory.GameContent;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
|
||||
public static class SteelAspects
|
||||
{
|
||||
|
||||
internal const string _timestampKey = @"timestamp";
|
||||
public const string hardenableKeyword = @"hardenable";
|
||||
public const string sharpenableKeyword = @"sharpenable";
|
||||
public const string metalNameKeyword = @"metalName";
|
||||
public const string hardnessKeyword = @"hardness";
|
||||
public const string sharpnessKeyword = @"sharpness";
|
||||
public const string durabilityKeyword = @"durability";
|
||||
public const float eutectoid_transition_temperature = 727f;//Celcius
|
||||
public const float quenchTimeConstant = 180f;
|
||||
public const float quench_min_temperature = 450f;//Celcius
|
||||
|
||||
public static readonly BGRAColor_Int32 color_Rough = new BGRAColor_Int32(0xFF, 0x66, 0x00);
|
||||
public static readonly BGRAColor_Int32 color_Dull = new BGRAColor_Int32(0xFF, 0xBE, 0x00);
|
||||
public static readonly BGRAColor_Int32 color_Honed = new BGRAColor_Int32(0xE8, 0xFF, 0x00);
|
||||
public static readonly BGRAColor_Int32 color_Keen = new BGRAColor_Int32(0x7D, 0xFF, 0x00);
|
||||
public static readonly BGRAColor_Int32 color_Sharp = new BGRAColor_Int32(0x00, 0xFF, 0x12);
|
||||
public static readonly BGRAColor_Int32 color_Razor = new BGRAColor_Int32(0x00, 0xFF, 0xD7);
|
||||
public static readonly BGRAColor_Int32 color_Default = new BGRAColor_Int32(0xFF, 0x00, 0x00);
|
||||
|
||||
/// <summary>
|
||||
/// Match against:Variant(s){ metal, material } == 'iron'
|
||||
/// </summary>
|
||||
/// <returns>The ferric metal.</returns>
|
||||
/// <param name="something">Something collectable.</param>
|
||||
public static bool IsFerricMetal(this CollectibleObject something)
|
||||
{
|
||||
return something.Variant.KeyValueMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.IronNameKey) ||
|
||||
something.Variant.KeyValueMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.IronNameKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Match against:Variant(s){ metal, material } == 'steel'
|
||||
/// </summary>
|
||||
/// <returns>The Steel metal. </returns>
|
||||
/// <param name="something">Something collectable.</param>
|
||||
public static bool IsSteelMetal(this CollectibleObject something)
|
||||
{
|
||||
return something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.SteelNameKey) ||
|
||||
something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.SteelNameKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Using ItemSharpener class....
|
||||
/// </summary>
|
||||
/// <returns>If a sharpener.</returns>
|
||||
/// <param name="something">Something.</param>
|
||||
public static bool IsSharpener(this CollectibleObject something)
|
||||
{
|
||||
return String.Equals(something.Class, ElementalToolsSystem.sharpeningStoneItemKey, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Has Edge that can wear down...
|
||||
/// </summary>
|
||||
/// <returns>The impliment.</returns>
|
||||
/// <param name="what">What.</param>
|
||||
public static bool EdgedImpliment(this EnumTool? what)
|
||||
{
|
||||
if (what != null || what.HasValue && (
|
||||
what == EnumTool.Axe ||
|
||||
what == EnumTool.Chisel ||
|
||||
what == EnumTool.Hoe ||
|
||||
what == EnumTool.Knife ||
|
||||
what == EnumTool.Pickaxe ||
|
||||
what == EnumTool.Saw ||
|
||||
what == EnumTool.Scythe ||
|
||||
what == EnumTool.Shears ||
|
||||
what == EnumTool.Sickle ||
|
||||
what == EnumTool.Spear ||
|
||||
what == EnumTool.Sword)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Consider this as Weaspon ONLY (Axe being the special exception)
|
||||
/// </summary>
|
||||
/// <returns>The impliment.</returns>
|
||||
/// <param name="what">What.</param>
|
||||
public static bool Weapons(this EnumTool? what)
|
||||
{
|
||||
if (what != null || what.HasValue && (
|
||||
what == EnumTool.Axe || //Arguable
|
||||
what == EnumTool.Bow ||
|
||||
what == EnumTool.Knife ||
|
||||
what == EnumTool.Spear ||
|
||||
what == EnumTool.Sling ||
|
||||
what == EnumTool.Sword)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Consider this as Tools ONLY (Axe being the special exception)
|
||||
/// </summary>
|
||||
/// <returns>The impliment.</returns>
|
||||
/// <param name="what">What.</param>
|
||||
public static bool Tools(this EnumTool? what)
|
||||
{
|
||||
if (what != null || what.HasValue && (
|
||||
what == EnumTool.Axe || //Arguable
|
||||
what == EnumTool.Hammer||
|
||||
what == EnumTool.Hoe ||
|
||||
what == EnumTool.Chisel ||
|
||||
what == EnumTool.Drill ||
|
||||
what == EnumTool.Meter ||
|
||||
what == EnumTool.Pickaxe ||
|
||||
what == EnumTool.Probe ||
|
||||
what == EnumTool.Saw ||
|
||||
what == EnumTool.Scythe ||
|
||||
what == EnumTool.Shears ||
|
||||
what == EnumTool.Shovel ||
|
||||
what == EnumTool.Sickle ||
|
||||
what == EnumTool.Wrench
|
||||
)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool RecomendedUsage(this Item item, EnumBlockMaterial blockMaterial)
|
||||
{
|
||||
if (item.MiningSpeed != null && item.MiningSpeed.ContainsKey(blockMaterial)) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static SteelThingViaStack AsSteelThing(this IItemStack someStack)
|
||||
{
|
||||
if (someStack.Class == EnumItemClass.Item && someStack.Item is ISteelBase) {
|
||||
return new SteelThingViaStack(someStack);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void SetHitpoints(IItemStack recipient, int wearLevel)
|
||||
{
|
||||
recipient.Attributes.SetInt(SteelAspects.durabilityKeyword, wearLevel);
|
||||
}
|
||||
|
||||
#region Common Steel Methods
|
||||
|
||||
public static void GetHeldItemInfo(ICoreAPI api, ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo)
|
||||
{
|
||||
if (inSlot == null || inSlot.Empty || inSlot.Inventory == null) {
|
||||
#if DEBUG
|
||||
api.World.Logger.Warning("GetHeldItemInfo -> Invetory / slot / stack: FUBAR!");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
var steelInfo = inSlot.Itemstack.AsSteelThing( );
|
||||
|
||||
dsc.AppendFormat(Lang.Get(@"prop-metal", Lang.GetUnformatted(@"metalname-" + steelInfo.BaseMetalName)));
|
||||
|
||||
if (steelInfo.Hardenable || steelInfo.Hardness != HardnessState.Soft) {
|
||||
dsc.AppendFormat(Lang.Get(@"prop-temper", Lang.GetUnformatted(@"hardness-" + (int)steelInfo.Hardness)));
|
||||
}
|
||||
|
||||
if (steelInfo.Sharpenable) {
|
||||
dsc.AppendFormat(Lang.Get(@"prop-edge", Lang.GetUnformatted(@"sharpness-" + ( int )steelInfo.Sharpness)));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// For; Quench-hardening...(in fluid)
|
||||
/// </summary>
|
||||
/// <param name="entityItem">Entity item.(Itself)</param>
|
||||
public static void QuenchHarden(ISteelBase steelBased, EntityItem entityItem, ICoreAPI api)
|
||||
{
|
||||
if (api.Side.IsServer( ) && (entityItem.Swimming || entityItem.FeetInLiquid)) {
|
||||
|
||||
if (!steelBased.Hardenable) return;
|
||||
|
||||
float temperature = entityItem.Itemstack.Collectible.GetTemperature(api.World, entityItem.Itemstack);
|
||||
//Track first moment in liquid;
|
||||
SteelAspects.SetTimestamp(entityItem);//Need to clear when NORMALIZING.
|
||||
|
||||
//temperature <= eutectoid_transition_temperature ||
|
||||
if (temperature >= quench_min_temperature) {
|
||||
//TODO: Thermal capacity & Transfer coefficients for NON-Water fluids...and surfaces too!
|
||||
var elapsedTime = SteelAspects.GetTimestampElapsed(entityItem);
|
||||
|
||||
uint quenchUnits = ( uint )Math.Round(elapsedTime.TotalMilliseconds / quenchTimeConstant, 0);
|
||||
|
||||
var steelThing = entityItem.Itemstack.AsSteelThing();
|
||||
|
||||
if (quenchUnits < ( uint )HardnessState.Brittle) {
|
||||
steelThing.Hardness = ( HardnessState )quenchUnits;
|
||||
}
|
||||
else {
|
||||
steelThing.Hardness = HardnessState.Brittle;
|
||||
}
|
||||
|
||||
//Being that water conducts heat well - reduce Temperature _FASTER_
|
||||
entityItem.Itemstack.Collectible.SetTemperature(api.World, entityItem.Itemstack, temperature - 15, false);
|
||||
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Quench process: {0}S elapsed @{1}C H:{2} ~ QU#{3}", elapsedTime.TotalSeconds, temperature, steelThing.Hardness, quenchUnits);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static float AttackPower(ISteelBase steelBased, IItemStack withItemStack, ICoreAPI api)
|
||||
{
|
||||
var defaultPower = withItemStack.Item.AttackPower;
|
||||
var steelThing = withItemStack.AsSteelThing( );
|
||||
|
||||
if (steelBased.Sharpenable && withItemStack.Item.Tool.EdgedImpliment() ) {
|
||||
var sharpness = steelThing.Sharpness;
|
||||
float pctBoost = 0;//CONSIDER: Perhaps make this external?
|
||||
|
||||
switch (sharpness) {
|
||||
case SharpnessState.Rough:
|
||||
pctBoost = -0.25f;
|
||||
break;
|
||||
case SharpnessState.Dull:
|
||||
pctBoost = -0.20f;
|
||||
break;
|
||||
case SharpnessState.Honed:
|
||||
pctBoost = 0.10f;
|
||||
break;
|
||||
case SharpnessState.Keen:
|
||||
pctBoost = 0.15f;
|
||||
break;
|
||||
case SharpnessState.Sharp:
|
||||
pctBoost = 0.20f;
|
||||
break;
|
||||
case SharpnessState.Razor:
|
||||
pctBoost = 0.25f;
|
||||
break;
|
||||
}
|
||||
|
||||
return defaultPower + (pctBoost * defaultPower);
|
||||
}
|
||||
|
||||
return defaultPower;
|
||||
}
|
||||
|
||||
public static float MiningSpeed(IItemStack itemStack, BlockSelection blockSel, Block block, IPlayer forPlayer, ICoreAPI api)
|
||||
{
|
||||
var baseSpeed = 1f;
|
||||
var steelThing = itemStack.AsSteelThing( );
|
||||
var item = itemStack.Item;
|
||||
|
||||
//Boost for Edged tools / weapons
|
||||
if (item.MiningSpeed != null && item.MiningSpeed.ContainsKey(block.BlockMaterial) && item.Tool.EdgedImpliment( )) {
|
||||
|
||||
baseSpeed = item.MiningSpeed[block.BlockMaterial] * GlobalConstants.ToolMiningSpeedModifier;
|
||||
|
||||
float pctBoost = 0f;
|
||||
switch (steelThing.Sharpness) {
|
||||
case SharpnessState.Rough:
|
||||
pctBoost = -0.35f;
|
||||
break;
|
||||
case SharpnessState.Dull:
|
||||
pctBoost = -0.20f;
|
||||
break;
|
||||
case SharpnessState.Honed:
|
||||
pctBoost = 0.10f;
|
||||
break;
|
||||
case SharpnessState.Keen:
|
||||
pctBoost = 0.20f;
|
||||
break;
|
||||
case SharpnessState.Sharp:
|
||||
pctBoost = 0.25f;
|
||||
break;
|
||||
case SharpnessState.Razor:
|
||||
pctBoost = 0.30f;
|
||||
break;
|
||||
}
|
||||
|
||||
return baseSpeed + (pctBoost * baseSpeed);
|
||||
}
|
||||
|
||||
return baseSpeed;
|
||||
}
|
||||
|
||||
public static void WhenUsedInAttack(IWorldAccessor world, Entity byEntity, Entity attackedEntity, ItemSlot itemslot, ICoreAPI api)
|
||||
{
|
||||
var item = itemslot.Itemstack.Item;
|
||||
bool edged = item.Tool.EdgedImpliment();
|
||||
bool weapon = item.Tool.Weapons();
|
||||
var steelThing = itemslot.Itemstack.AsSteelThing( );
|
||||
|
||||
//Only called for attacks on ENTITIES. Scen# 1 - 4 here.
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug($"OnAttackingWith:: (Weap:{weapon},Edge:{edged}) {byEntity.Code} -> {attackedEntity.Code}");
|
||||
#endif
|
||||
|
||||
TakeDamage(world, byEntity ,attackedEntity, null, itemslot, api );
|
||||
|
||||
if (steelThing.Hardness > HardnessState.Hard) //VS.: High-Tier Mobs / High-Tier Player armor ?
|
||||
{
|
||||
bool catasptrophicFailure = world.Rand.Next(1, 1000) >= 999;
|
||||
if (catasptrophicFailure)
|
||||
{
|
||||
#if DEBUG
|
||||
world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", item.Code);
|
||||
#endif
|
||||
SteelAspects.SetHitpoints(itemslot.Itemstack, 0);
|
||||
item.DamageItem(world, byEntity, itemslot, 9999);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void WhenUsedForBlockBreak(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel, ICoreAPI api )
|
||||
{
|
||||
var item = itemslot.Itemstack.Item;
|
||||
bool edged = item.Tool.EdgedImpliment( );
|
||||
bool weapon = item.Tool.Weapons( );
|
||||
|
||||
var steelThing = itemslot.Itemstack.AsSteelThing( );
|
||||
|
||||
var targetBlock = api.World.BlockAccessor.GetBlock(blockSel.Position);
|
||||
int targetTier = targetBlock.ToolTier;
|
||||
float targetResistance = targetBlock.Resistance;
|
||||
bool recomendedUsage = item.RecomendedUsage(targetBlock.BlockMaterial);
|
||||
var hardness = steelThing.Hardness;
|
||||
|
||||
//Only called for attacks on BLOCKS / Envrionment. Scen# 5 - 6 here.
|
||||
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug($"OnBlockBrokenWith:: (Weap:{weapon},Edge:{edged},OK: {recomendedUsage},T.T#{targetTier}) {byEntity.Code} -> {targetBlock.Code}");
|
||||
#endif
|
||||
|
||||
TakeDamage(world, byEntity, null, blockSel, itemslot, api);
|
||||
|
||||
if (recomendedUsage == false && hardness > HardnessState.Hard) {
|
||||
bool catasptrophicFailure = world.Rand.Next(1, 1000) >= (999 - (targetTier * 5));
|
||||
|
||||
if (catasptrophicFailure) {
|
||||
world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", item.Code);
|
||||
SteelAspects.SetHitpoints(itemslot.Itemstack, 0);
|
||||
item.DamageItem(world, byEntity, itemslot, 9999);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void TakeDamage(IWorldAccessor world, Entity owner, Entity attackOnEntity, BlockSelection breakingBlock, ItemSlot itemslot, ICoreAPI api, int nomAmmount = 1)
|
||||
{
|
||||
var item = itemslot.Itemstack.Item;
|
||||
var steelThing = itemslot.Itemstack.AsSteelThing( );
|
||||
|
||||
/*DETERMINE:
|
||||
* Usage - Blade/Edged weapon attack Vs. creature Sc.#1 [What about armored players?]
|
||||
* Non-edged (blunt) weapon vs. creature Sc. #2 [What about armored players?]
|
||||
* [Improvised-arms] Edged-Tool (non-weapon) vs. Creature Sc.#3
|
||||
* [Improvised-arms] Blunt-Tool (non-weapon) vs. Creature Sc.#4
|
||||
* Tool Against Envrionment (Pickaxe / Axe / Propick / Saw / Shovel) Sc. #5
|
||||
* WEAPONS Vs. Envrionment (hiting dirt with a sword!) Sc. #6
|
||||
* Tools - don't really benefit from edges vs. envrionment...?
|
||||
*/
|
||||
uint extraBias = 0;
|
||||
|
||||
if (attackOnEntity != null)
|
||||
{
|
||||
bool edged = item.Tool.EdgedImpliment( );
|
||||
bool weapon = item.Tool.Weapons( );
|
||||
int armourTier = 0;//Most Creatures have no 'Armour' class...?
|
||||
float damageFactor = 0f;//Scaling
|
||||
int maxDamage = 1;
|
||||
int rndDamageOutcome = 1;
|
||||
|
||||
if (attackOnEntity is EntityPlayer) {
|
||||
var atkdPlayer = attackOnEntity as EntityPlayer;
|
||||
var atkeeInv = atkdPlayer.Player.InventoryManager.GetOwnInventory(GlobalConstants.characterInvClassName);
|
||||
var armourSlots = new ItemSlot[ ] { atkeeInv[( int )EnumCharacterDressType.ArmorHead], atkeeInv[( int )EnumCharacterDressType.ArmorBody], atkeeInv[( int )EnumCharacterDressType.ArmorLegs] };
|
||||
//TODO: Cache Armor combined-stat data...too pesky to extract all the time
|
||||
|
||||
foreach (var aSlot in armourSlots) {
|
||||
if (aSlot.Empty == false && aSlot.Itemstack.Class == EnumItemClass.Item && aSlot.Itemstack.Item is ItemWearable) {
|
||||
var armourItem = aSlot.Itemstack.Item as ItemWearable;
|
||||
if (armourItem.ProtectionModifiers != null) armourTier = Math.Max(armourItem.ProtectionModifiers.ProtectionTier, armourTier);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Scenarios #1, thru #4...
|
||||
if (edged && weapon) {//#1 Edged weapon
|
||||
int tierDisparity = armourTier - item.ToolTier;
|
||||
damageFactor = 1 + (tierDisparity * 0.2f) - (( int )(steelThing.Hardness) * 0.10f);
|
||||
maxDamage = 1 + (HardnessState.Brittle - steelThing.Hardness);
|
||||
extraBias = ( uint )(tierDisparity * 5);
|
||||
|
||||
}
|
||||
else if (weapon) {//#2 Blunt Weapon
|
||||
|
||||
}
|
||||
else if (edged && !weapon) {//#3 Improvised Edged weapon
|
||||
|
||||
}
|
||||
else {//#4 Improvised Blunt weapon
|
||||
|
||||
}
|
||||
|
||||
rndDamageOutcome = api.World.Rand.Next(0, ( int )(maxDamage * damageFactor));
|
||||
if (rndDamageOutcome > 0) item.DamageItem(world, null, itemslot, rndDamageOutcome);
|
||||
|
||||
}//Entities being attacked; ends.
|
||||
else if (breakingBlock != null)
|
||||
{
|
||||
//Scenarios #5, #6...
|
||||
bool tool = item.Tool.Tools( );
|
||||
if (tool) {//#5
|
||||
|
||||
}
|
||||
else {//#6
|
||||
|
||||
|
||||
}
|
||||
}//Blocks being broken; ends.
|
||||
|
||||
//TODO: Handle Crafting \ Other damage sources...here? (also done elsewhere)
|
||||
MabeyDull(steelThing,api, extraBias );
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Dull and/or DamageItem
|
||||
/// </summary>
|
||||
public static void ToolInRecipeUse(Item @this, ItemSlot[ ] allInputSlots, GridRecipe matchingRecipe, ICoreAPI api )
|
||||
{
|
||||
var steelToolSlot = (from inputSlot in allInputSlots
|
||||
where inputSlot.Empty == false
|
||||
where inputSlot.Itemstack.Class == EnumItemClass.Item
|
||||
where inputSlot.Itemstack.Collectible.Code == @this.Code
|
||||
select inputSlot).FirstOrDefault( );//Freaky recipie with TWO of same tool?!
|
||||
|
||||
var steelThing = steelToolSlot.Itemstack.AsSteelThing( );
|
||||
//Edged tool vs. non-edged tool
|
||||
bool edgedTool = @this.Tool.EdgedImpliment( );
|
||||
|
||||
float hardnessMult = (( int )HardnessState.Brittle + 1) / (( int )steelThing.Hardness + 1) * 0.25f;
|
||||
float wearMax = 1;
|
||||
|
||||
if (edgedTool) {
|
||||
wearMax = ( byte )SharpnessState.Razor - ( byte )steelThing.Sharpness;
|
||||
}
|
||||
|
||||
int actualDmg = ( int )Math.Round(NatFloat.createTri(wearMax, hardnessMult).nextFloat(1.0f, api.World.Rand), 1);
|
||||
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug($"tooluse [{@this.Code}] --> Harndess effect: [ Hardness {hardnessMult} Vs. Rate: {wearMax} apply dmg: {actualDmg}, edged: {edgedTool} ]");
|
||||
#endif
|
||||
if (actualDmg > 0)
|
||||
{
|
||||
steelToolSlot.Itemstack.Collectible.DamageItem(api.World, null, steelToolSlot, actualDmg);
|
||||
MabeyDull(steelThing, api);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public static void MabeyDull(SteelThingViaStack someSteelyThing, ICoreAPI api, uint extraBias = 0)
|
||||
{
|
||||
// **************** Edge blunting
|
||||
var hardness = someSteelyThing.Hardness;
|
||||
bool edgeBlunting = false;
|
||||
switch (hardness) {
|
||||
|
||||
case HardnessState.Soft:
|
||||
edgeBlunting = api.World.Rand.Next(1, 100) >= (99 - extraBias);
|
||||
break;
|
||||
|
||||
case HardnessState.Medium:
|
||||
edgeBlunting = api.World.Rand.Next(1, 200) >= (199 - extraBias);
|
||||
break;
|
||||
|
||||
case HardnessState.Hard:
|
||||
edgeBlunting = api.World.Rand.Next(1, 300) >= (299 - extraBias);
|
||||
break;
|
||||
|
||||
case HardnessState.Brittle:
|
||||
edgeBlunting = api.World.Rand.Next(1, 400) >= 399;
|
||||
break;
|
||||
}
|
||||
if (edgeBlunting) someSteelyThing.Dull();
|
||||
}
|
||||
|
||||
public static void SharpenOneSteelItem(ItemSlot[ ] allInputslots, ItemSlot outputSlot, GridRecipe byRecipe, ICoreAPI api)
|
||||
{
|
||||
//Failsafe[s]
|
||||
string name = "unset!";
|
||||
if (byRecipe == null || byRecipe.Ingredients == null || byRecipe.IngredientPattern == null || byRecipe.Output == null) {
|
||||
name = byRecipe?.Name.ToString( );
|
||||
api.World.Logger.Error("Invalid / Incomplete / Corrupt (sharpening) Recipe: {0}", name);
|
||||
return;
|
||||
}
|
||||
|
||||
var steelItemSlot = (from inputSlot in allInputslots
|
||||
where inputSlot.Empty == false
|
||||
where inputSlot.Itemstack.Class == EnumItemClass.Item
|
||||
where inputSlot.Itemstack.Collectible.IsSteelMetal( )
|
||||
select inputSlot).SingleOrDefault( );
|
||||
|
||||
var sharpenerItemSlot = (from inputSlot in allInputslots
|
||||
where inputSlot.Empty == false
|
||||
where inputSlot.Itemstack.Class == EnumItemClass.Item
|
||||
where inputSlot.Itemstack.Collectible.IsSharpener( )
|
||||
select inputSlot).SingleOrDefault( );
|
||||
|
||||
if (sharpenerItemSlot.Empty) return;//Not a sharpening recipie
|
||||
|
||||
if (steelItemSlot != null && steelItemSlot.Itemstack.Class == EnumItemClass.Item) {
|
||||
if (steelItemSlot.Itemstack.Item is ISteelByStack)
|
||||
{
|
||||
//OLD WAY
|
||||
var steelItem = steelItemSlot.Itemstack.Item;
|
||||
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Input (ingredient) Item {0} supports; ISteelByStack Interface ", steelItem.Code);
|
||||
#endif
|
||||
if (!outputSlot.Empty && outputSlot.Itemstack.Class == EnumItemClass.Item
|
||||
&& outputSlot.Itemstack.Item is ISteelByStack)
|
||||
{
|
||||
var outputItem = outputSlot.Itemstack.Item;
|
||||
var fullMetalInterface = outputSlot.Itemstack.Item as ISteelByStack;
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Output Item {0} supports; ISteelByStack Interface ", steelItem.Code);
|
||||
#endif
|
||||
|
||||
fullMetalInterface.CopyStackAttributes(steelItemSlot.Itemstack, outputSlot.Itemstack);
|
||||
|
||||
if (sharpenerItemSlot != null) fullMetalInterface.Sharpen(outputSlot.Itemstack);
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1} ", steelItem.Code, outputItem.Code);
|
||||
#endif
|
||||
}
|
||||
} else if (steelItemSlot.Itemstack.Item is ISteelThingInstance)
|
||||
{
|
||||
//NEW WAY
|
||||
var oldSteelThing = steelItemSlot.Itemstack.AsSteelThing( );
|
||||
|
||||
oldSteelThing.CloneStackAttributes(outputSlot.Itemstack);
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1}, using ISteelThingInstance ", steelItemSlot.Itemstack.Item.Code, outputSlot.Itemstack.Item.Code);
|
||||
#endif
|
||||
}
|
||||
|
||||
}
|
||||
else {
|
||||
#if DEBUG
|
||||
api.World.Logger.Debug("Could not find steel item; in Recipie:{0} ",name);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
public static void SetTimestamp(EntityItem entityItem)
|
||||
{
|
||||
|
||||
if (!entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) {
|
||||
entityItem.Attributes.SetLong(SteelAspects._timestampKey, DateTime.Now.Ticks);
|
||||
}
|
||||
}
|
||||
|
||||
public static TimeSpan GetTimestampElapsed(EntityItem entityItem)
|
||||
{
|
||||
if (entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) {
|
||||
var ts = TimeSpan.FromTicks(entityItem.Attributes.GetLong(SteelAspects._timestampKey));
|
||||
return ts.Subtract(TimeSpan.FromTicks(DateTime.Now.Ticks)).Negate( );
|
||||
}
|
||||
return TimeSpan.Zero;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
@ -1,32 +1,43 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
|
||||
using HarmonyLib;
|
||||
|
||||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.Config;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
/// <summary>
|
||||
/// Item wrapped with some Tool helpers & stuff
|
||||
/// Item with some common Tool helpers, Base common Steely-features
|
||||
/// </summary>
|
||||
public abstract class SteelAssistItem : Item
|
||||
public abstract class SteelBaseItem : Item, ISteelByStack, ISteelBase
|
||||
{
|
||||
private const string altToolKeyword = @"AltTool";
|
||||
|
||||
protected SteelAssistItem() : base()
|
||||
|
||||
|
||||
protected SteelBaseItem( ) : base( )
|
||||
{
|
||||
}
|
||||
|
||||
protected SteelAssistItem(int itemId) : base (itemId)
|
||||
{
|
||||
protected SteelBaseItem(int itemId) : base(itemId)
|
||||
{
|
||||
}
|
||||
|
||||
public void OverwriteFields(Item setee)
|
||||
{
|
||||
//setee.MiningSpeed = this.MiningSpeed;//Ect...
|
||||
Traverse.IterateFields(this, setee, Traverse.CopyFields);
|
||||
}
|
||||
|
||||
public EnumTool? AltTool {
|
||||
get
|
||||
{
|
||||
if (this.Attributes != null && this.Attributes.KeyExists(altToolKeyword))
|
||||
{
|
||||
EnumTool altEnumVal = (EnumTool)(this.Attributes[altToolKeyword].AsInt(0));
|
||||
return altEnumVal;
|
||||
}
|
||||
if (this.Attributes != null && this.Attributes.KeyExists(altToolKeyword)) {
|
||||
EnumTool altEnumVal = ( EnumTool )(this.Attributes[altToolKeyword].AsInt(0));
|
||||
return altEnumVal;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
//HACK: to workaround null tool values...
|
||||
|
|
@ -50,11 +61,141 @@ namespace ElementalTools
|
|||
}
|
||||
}
|
||||
|
||||
public bool RecomendedUsage(EnumBlockMaterial blockMaterial)
|
||||
|
||||
|
||||
|
||||
#region Static Properties
|
||||
public virtual bool Hardenable {
|
||||
get
|
||||
{
|
||||
return this.Attributes[SteelAspects.hardenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual string BaseMetalName {
|
||||
get
|
||||
{
|
||||
return this.Attributes[SteelAspects.metalNameKeyword].AsString("?");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Sharpenable {
|
||||
get
|
||||
{
|
||||
return this.Attributes[SteelAspects.sharpenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
#region ISteelByStack
|
||||
public virtual SharpnessState Sharpness(IItemStack someStack)
|
||||
{
|
||||
if( this.MiningSpeed != null && this.MiningSpeed.ContainsKey(blockMaterial)) return true;
|
||||
return false;
|
||||
}
|
||||
if (someStack.Attributes != null && someStack.Attributes.HasAttribute(SteelAspects.sharpnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = someStack.Attributes.GetBytes(SteelAspects.sharpnessKeyword, bytes);
|
||||
return bytes == null ? SharpnessState.Rough : ( SharpnessState )bytes[0];
|
||||
}
|
||||
|
||||
return SharpnessState.Rough;
|
||||
}
|
||||
|
||||
public virtual void Sharpness(IItemStack someStack, SharpnessState set)
|
||||
{
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes[0] = ( byte )set;
|
||||
someStack.Attributes.SetBytes(SteelAspects.sharpnessKeyword, bytes);
|
||||
}
|
||||
|
||||
public virtual SharpnessState Sharpen(IItemStack someStack)
|
||||
{
|
||||
if (this.Sharpenable == false) {
|
||||
api.World.Logger.VerboseDebug("Can't sharpen! {0}", this.Code);
|
||||
return this.Sharpness(someStack); ;
|
||||
}
|
||||
|
||||
SharpnessState sharp = Sharpness(someStack);
|
||||
|
||||
if (sharp < SharpnessState.Razor) { Sharpness(someStack, ++sharp); }
|
||||
//TODO: Play sound effect
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Sharpness of '{1}' increased to: {0}", sharp, this.Code);
|
||||
#endif
|
||||
|
||||
//TODO: If durability exists - decriment based on Hardnes Vs. Wear...
|
||||
if (this.Durability > 1) {
|
||||
|
||||
var currentDur = GetRemainingDurability(someStack as ItemStack);
|
||||
SteelAspects.SetHitpoints(someStack, --currentDur);
|
||||
}
|
||||
|
||||
return sharp;
|
||||
}
|
||||
|
||||
|
||||
public virtual SharpnessState Dull(IItemStack someStack)
|
||||
{
|
||||
if (someStack.Attributes != null && someStack.Attributes.HasAttribute(SteelAspects.sharpnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = someStack.Attributes.GetBytes(SteelAspects.sharpnessKeyword, bytes);
|
||||
var state = ( SharpnessState )bytes[0];
|
||||
|
||||
if (state > SharpnessState.Rough) state--;
|
||||
|
||||
bytes[0] = ( byte )state;
|
||||
someStack.Attributes.SetBytes(SteelAspects.sharpnessKeyword, bytes);
|
||||
|
||||
return state;
|
||||
}
|
||||
return SharpnessState.Rough;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public virtual HardnessState Hardness(IItemStack someStack)
|
||||
{
|
||||
if (someStack.Attributes != null && someStack.Attributes.HasAttribute(SteelAspects.hardnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = someStack.Attributes.GetBytes(SteelAspects.hardnessKeyword, bytes);
|
||||
return bytes == null ? HardnessState.Soft : ( HardnessState )bytes[0];
|
||||
}
|
||||
|
||||
return HardnessState.Soft;
|
||||
}
|
||||
|
||||
public virtual void Hardness(IItemStack someStack, HardnessState set)
|
||||
{
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes[0] = ( byte )set;
|
||||
someStack.Attributes.SetBytes(SteelAspects.hardnessKeyword, bytes);
|
||||
}
|
||||
|
||||
public virtual void CopyStackAttributes(ItemStack donor, ItemStack recipient)
|
||||
{
|
||||
|
||||
if (donor.Class == recipient.Class) {
|
||||
var hI = (donor.Item as ISteelByStack).Hardness(donor);
|
||||
var sI = (donor.Item as ISteelByStack).Sharpness(donor);
|
||||
|
||||
(recipient.Item as ISteelByStack).Hardness(recipient, hI);
|
||||
(recipient.Item as ISteelByStack).Sharpness(recipient, sI);
|
||||
|
||||
if (donor.Item.Durability > 0) {
|
||||
var wear = GetRemainingDurability(donor);
|
||||
|
||||
if (donor.Item.IsFerricMetal( ) && recipient.Item.IsSteelMetal( )) {
|
||||
var percentWear = (wear / donor.Item.Durability);
|
||||
SteelAspects.SetHitpoints(recipient, recipient.Item.Durability * percentWear);
|
||||
}
|
||||
else SteelAspects.SetHitpoints(recipient, wear);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
192
ElementalTools/General/SteelThingViaStack.cs
Normal file
192
ElementalTools/General/SteelThingViaStack.cs
Normal file
|
|
@ -0,0 +1,192 @@
|
|||
using System;
|
||||
|
||||
using Vintagestory.API.Common;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
public class SteelThingViaStack: ISteelThingInstance, ISteelBase
|
||||
{
|
||||
|
||||
|
||||
protected IItemStack sourceStack { get; set;}
|
||||
|
||||
private SteelThingViaStack( ) { }
|
||||
private ILogger Logger { get; set; }
|
||||
|
||||
public SteelThingViaStack(IItemStack inputStack)
|
||||
{
|
||||
sourceStack = inputStack;
|
||||
}
|
||||
|
||||
#region ISteelBase
|
||||
|
||||
public string BaseMetalName {
|
||||
get
|
||||
{
|
||||
return sourceStack.Item.Attributes[SteelAspects.metalNameKeyword].AsString("?");
|
||||
}
|
||||
}
|
||||
|
||||
public bool Sharpenable {
|
||||
get
|
||||
{
|
||||
return sourceStack.Item.Attributes[SteelAspects.sharpenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Hardenable {
|
||||
get
|
||||
{
|
||||
return sourceStack.Item.Attributes[SteelAspects.hardenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ISteelThingInstance
|
||||
|
||||
public SharpnessState Sharpness {
|
||||
get
|
||||
{
|
||||
if (sourceStack.Attributes != null && sourceStack.Attributes.HasAttribute(SteelAspects.sharpnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = sourceStack.Attributes.GetBytes(SteelAspects.sharpnessKeyword, bytes);
|
||||
return bytes == null ? SharpnessState.Rough : ( SharpnessState )bytes[0];
|
||||
}
|
||||
|
||||
return SharpnessState.Rough;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes[0] = ( byte )value;
|
||||
sourceStack.Attributes.SetBytes(SteelAspects.sharpnessKeyword, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
public HardnessState Hardness {
|
||||
get
|
||||
{
|
||||
if (sourceStack.Attributes != null && sourceStack.Attributes.HasAttribute(SteelAspects.hardnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = sourceStack.Attributes.GetBytes(SteelAspects.hardnessKeyword, bytes);
|
||||
return bytes == null ? HardnessState.Soft : ( HardnessState )bytes[0];
|
||||
}
|
||||
return HardnessState.Soft;
|
||||
}
|
||||
|
||||
set
|
||||
{
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes[0] = ( byte )value;
|
||||
sourceStack.Attributes.SetBytes(SteelAspects.hardnessKeyword, bytes);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
public SharpnessState Sharpen( )
|
||||
{
|
||||
if (this.Sharpenable == false) {
|
||||
Logger.Notification("Can't sharpen! {0}", sourceStack.Item.Code);
|
||||
return Sharpness;
|
||||
}
|
||||
SharpnessState sharp = this.Sharpness;
|
||||
|
||||
if (sharp < SharpnessState.Razor) { this.Sharpness = ++sharp; }
|
||||
//TODO: Play sound effect
|
||||
#if DEBUG
|
||||
Logger.VerboseDebug("Sharpness of '{1}' increased to: {0}", sharp, sourceStack.Item.Code);
|
||||
#endif
|
||||
|
||||
//TODO: If durability exists - decriment based on Hardness Vs. Wear...
|
||||
if (this.Hitpoints > 1) {
|
||||
Hitpoints = --Hitpoints;
|
||||
}
|
||||
|
||||
return sharp;
|
||||
}
|
||||
|
||||
public SharpnessState Dull( )
|
||||
{
|
||||
if (this.Sharpenable == false) {
|
||||
Logger.Notification("Can't dull! {0}", sourceStack.Item.Code);
|
||||
return Sharpness;
|
||||
}
|
||||
SharpnessState sharp = this.Sharpness;
|
||||
|
||||
if (sharp > SharpnessState.Dull) { this.Sharpness = --sharp; }
|
||||
#if DEBUG
|
||||
Logger.VerboseDebug("Sharpness of '{1}' decreased to: {0}", sharp, sourceStack.Item.Code);
|
||||
#endif
|
||||
|
||||
//TODO: If durability exists - decriment based on Hardness Vs. Wear...
|
||||
if (this.Hitpoints > 1) {
|
||||
Hitpoints = --Hitpoints;
|
||||
}
|
||||
|
||||
return sharp;
|
||||
}
|
||||
|
||||
public HardnessState Harden( )
|
||||
{
|
||||
if (this.Hardenable == false) {
|
||||
Logger.Notification("Can't Harden! {0}", sourceStack.Item.Code);
|
||||
return Hardness;
|
||||
}
|
||||
var hard = this.Hardness;
|
||||
|
||||
if (hard < HardnessState.Brittle) { this.Hardness = ++hard; }
|
||||
|
||||
#if DEBUG
|
||||
Logger.VerboseDebug("Hardness of '{1}' increased to: {0}", hard, sourceStack.Item.Code);
|
||||
#endif
|
||||
|
||||
//TODO: If durability exists - decriment based on Hardness Vs. Wear...
|
||||
if (this.Hitpoints > 1) {
|
||||
Hitpoints = --Hitpoints;
|
||||
}
|
||||
|
||||
return hard;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Clones the stack attributes.
|
||||
/// </summary>
|
||||
/// <returns>The stack attributes.</returns>
|
||||
/// <param name="target">Target.</param>
|
||||
//TODO: Clone _ALL_ the attributes!
|
||||
public void CloneStackAttributes(ItemStack target)
|
||||
{
|
||||
if (target.Collectible.Code == sourceStack.Collectible.Code) {
|
||||
var targetSteel = target.AsSteelThing();
|
||||
targetSteel.Sharpness = this.Sharpness;
|
||||
targetSteel.Hardness = this.Hardness;
|
||||
|
||||
|
||||
if (sourceStack.Item.Durability > 1) {
|
||||
SteelAspects.SetHitpoints(target, this.Hitpoints);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
protected int Hitpoints {
|
||||
get
|
||||
{
|
||||
return sourceStack.Attributes.GetInt(SteelAspects.durabilityKeyword, sourceStack.Item.Durability);
|
||||
}
|
||||
|
||||
set {
|
||||
sourceStack.Attributes.SetInt(SteelAspects.durabilityKeyword, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -33,37 +33,7 @@ namespace ElementalTools
|
|||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Match against:Variant(s){ metal, material } == 'iron'
|
||||
/// </summary>
|
||||
/// <returns>The ferric metal.</returns>
|
||||
/// <param name="something">Something collectable.</param>
|
||||
public static bool IsFerricMetal(this CollectibleObject something)
|
||||
{
|
||||
return something.Variant.KeyValueMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.IronNameKey) ||
|
||||
something.Variant.KeyValueMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.IronNameKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Match against:Variant(s){ metal, material } == 'steel'
|
||||
/// </summary>
|
||||
/// <returns>The Steel metal. </returns>
|
||||
/// <param name="something">Something collectable.</param>
|
||||
public static bool IsSteelMetal(this CollectibleObject something)
|
||||
{
|
||||
return something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.SteelNameKey) ||
|
||||
something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.SteelNameKey);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Using ItemSharpener class....
|
||||
/// </summary>
|
||||
/// <returns>If a sharpener.</returns>
|
||||
/// <param name="something">Something.</param>
|
||||
public static bool IsSharpener(this CollectibleObject something)
|
||||
{
|
||||
return String.Equals(something.Class, ElementalToolsSystem.sharpeningStoneItemKey, StringComparison.Ordinal);
|
||||
}
|
||||
|
||||
public static AssetLocation AppendPaths(this AssetLocation assetLoc, params string[ ] morePaths)
|
||||
{
|
||||
|
|
@ -94,49 +64,7 @@ namespace ElementalTools
|
|||
return originalAsset.Code;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Has Edge that can wear down...
|
||||
/// </summary>
|
||||
/// <returns>The impliment.</returns>
|
||||
/// <param name="what">What.</param>
|
||||
public static bool EdgedImpliment(this EnumTool? what)
|
||||
{
|
||||
if (what != null || what.HasValue && (
|
||||
what == EnumTool.Axe ||
|
||||
what == EnumTool.Chisel ||
|
||||
what == EnumTool.Hoe ||
|
||||
what == EnumTool.Knife ||
|
||||
what == EnumTool.Pickaxe ||
|
||||
what == EnumTool.Saw ||
|
||||
what == EnumTool.Scythe ||
|
||||
what == EnumTool.Shears ||
|
||||
what == EnumTool.Sickle ||
|
||||
what == EnumTool.Spear ||
|
||||
what == EnumTool.Sword)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Consider this as Weaspon Vs. Tool..?
|
||||
/// </summary>
|
||||
/// <returns>The impliment.</returns>
|
||||
/// <param name="what">What.</param>
|
||||
public static bool Weapons(this EnumTool? what)
|
||||
{
|
||||
if (what != null || what.HasValue && (
|
||||
what == EnumTool.Axe || //Arguable
|
||||
what == EnumTool.Bow ||
|
||||
what == EnumTool.Knife ||
|
||||
what == EnumTool.Spear ||
|
||||
what == EnumTool.Sword)
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Checks of Root term is match for Asset.
|
||||
|
|
@ -163,9 +91,12 @@ namespace ElementalTools
|
|||
commonApi.RegisterItemClass(className, itemType);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#if DEFUNCT
|
||||
//Why C# 7.0 ? WHY?!?!
|
||||
public static T GetEnum<T>(this ITreeAttribute treeAttr, string keyword, T defaultValue = default(T)) where T : struct// enum
|
||||
public static T GetEnum<T>(this ITreeAttribute treeAttr, string keyword, T defaultValue = default(T)) where T : enum
|
||||
{
|
||||
var enumType = typeof(T);
|
||||
|
||||
|
|
@ -243,7 +174,7 @@ namespace ElementalTools
|
|||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
89
ElementalTools/Items/ItemConsolidatableCards.cs
Normal file
89
ElementalTools/Items/ItemConsolidatableCards.cs
Normal file
|
|
@ -0,0 +1,89 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Vintagestory.API.Client;
|
||||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.Config;
|
||||
using Vintagestory.API.MathTools;
|
||||
using Vintagestory.GameContent;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
public class ItemConsolidatableCards : Item, IAnvilWorkable
|
||||
{
|
||||
|
||||
|
||||
#region IAnvilWorkable
|
||||
public bool CanWork(ItemStack stack)
|
||||
{
|
||||
throw new NotImplementedException( );
|
||||
}
|
||||
|
||||
public ItemStack GetBaseMaterial(ItemStack stack)
|
||||
{
|
||||
return stack;//Or Shear steel?
|
||||
}
|
||||
|
||||
public EnumHelveWorkableMode GetHelveWorkableMode(ItemStack stack, BlockEntityAnvil beAnvil)
|
||||
{
|
||||
return EnumHelveWorkableMode.NotWorkable;//Manual only
|
||||
}
|
||||
|
||||
public List<SmithingRecipe> GetMatchingRecipes(ItemStack stack)
|
||||
{
|
||||
throw new NotImplementedException( ); //(X) -> Steel Ingot
|
||||
}
|
||||
|
||||
public int GetRequiredAnvilTier(ItemStack stack)
|
||||
{
|
||||
return 3;//Iron+
|
||||
}
|
||||
|
||||
public ItemStack TryPlaceOn(ItemStack stack, BlockEntityAnvil beAnvil)
|
||||
{
|
||||
//Set smithing Voxels here.
|
||||
|
||||
/*
|
||||
if (!CanWork(stack)) return null;
|
||||
|
||||
Item item = api.World.GetItem(new AssetLocation("workitem-" + Variant["metal"]));
|
||||
if (item == null) return null;
|
||||
|
||||
ItemStack workItemStack = new ItemStack(item);
|
||||
workItemStack.Collectible.SetTemperature(api.World, workItemStack, stack.Collectible.GetTemperature(api.World, stack));
|
||||
|
||||
if (beAnvil.WorkItemStack == null)
|
||||
{
|
||||
CreateVoxelsFromIngot(api, ref beAnvil.Voxels, isBlisterSteel);
|
||||
} else
|
||||
{
|
||||
if (isBlisterSteel) return null;
|
||||
|
||||
IAnvilWorkable workable = beAnvil.WorkItemStack.Collectible as IAnvilWorkable;
|
||||
|
||||
if (!workable.GetBaseMaterial(beAnvil.WorkItemStack).Equals(api.World, GetBaseMaterial(stack), GlobalConstants.IgnoredStackAttributes))
|
||||
{
|
||||
if (api.Side == EnumAppSide.Client) (api as ICoreClientAPI).TriggerIngameError(this, "notequal", Lang.Get("Must be the same metal to add voxels"));
|
||||
return null;
|
||||
}
|
||||
|
||||
AddVoxelsFromIngot(api, ref beAnvil.Voxels);
|
||||
}
|
||||
|
||||
return workItemStack;
|
||||
*/
|
||||
return null;
|
||||
}
|
||||
#endregion
|
||||
|
||||
protected byte[ , , ] GenSmithingVoxels()
|
||||
{
|
||||
//Cards standing vertically, some-slag also randomly...
|
||||
var voxels = new byte[16, 6, 16];
|
||||
|
||||
return voxels;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -10,7 +10,7 @@ namespace ElementalTools
|
|||
public class ItemMallet : VariableWearRateTool
|
||||
{
|
||||
|
||||
|
||||
//IDEA: Smash unfired clay shapes/pottery back into a pile of source-clay items
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
156
ElementalTools/Items/Steel/GenericSteelItem.cs
Normal file
156
ElementalTools/Items/Steel/GenericSteelItem.cs
Normal file
|
|
@ -0,0 +1,156 @@
|
|||
using System;
|
||||
using System.Text;
|
||||
|
||||
using HarmonyLib;
|
||||
|
||||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.Common.Entities;
|
||||
using Vintagestory.API.Config;
|
||||
using Vintagestory.GameContent;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
public class GenericSteelItem : Item, ISteelBase //SteelAssist
|
||||
{
|
||||
#region ISteelBase
|
||||
|
||||
public string BaseMetalName {
|
||||
get
|
||||
{
|
||||
return this.Attributes[SteelAspects.metalNameKeyword].AsString("?");
|
||||
}
|
||||
}
|
||||
|
||||
public bool Sharpenable {
|
||||
get
|
||||
{
|
||||
return this.Attributes[SteelAspects.sharpenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
|
||||
public bool Hardenable {
|
||||
get
|
||||
{
|
||||
return this.Attributes[SteelAspects.hardenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region Specific_Behavior
|
||||
|
||||
public override void GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo)
|
||||
{
|
||||
if (inSlot == null || inSlot.Empty || inSlot.Inventory == null) {
|
||||
#if DEBUG
|
||||
api.World.Logger.Warning("GetHeldItemInfo -> Invetory / slot / stack: FUBAR!");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
base.GetHeldItemInfo(inSlot, dsc, world, withDebugInfo);
|
||||
SteelAspects.GetHeldItemInfo(api, inSlot, dsc, world, withDebugInfo);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// For; Quench-hardening...
|
||||
/// </summary>
|
||||
/// <param name="entityItem">Entity item.(Itself)</param>
|
||||
public override void OnGroundIdle(EntityItem entityItem)
|
||||
{
|
||||
SteelAspects.QuenchHarden(this, entityItem, api);
|
||||
base.OnGroundIdle(entityItem);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
#region Steel Affects
|
||||
|
||||
public override float GetAttackPower(IItemStack withItemStack)
|
||||
{
|
||||
return SteelAspects.AttackPower(this, withItemStack, this.api);
|
||||
}
|
||||
|
||||
public override float GetMiningSpeed(IItemStack itemstack, BlockSelection blockSel, Block block, IPlayer forPlayer)
|
||||
{
|
||||
return SteelAspects.MiningSpeed(itemstack, blockSel, block, forPlayer, this.api);
|
||||
}
|
||||
|
||||
public override void OnAttackingWith(IWorldAccessor world, Entity byEntity, Entity attackedEntity, ItemSlot itemslot)
|
||||
{
|
||||
SteelAspects.WhenUsedInAttack(world, byEntity,attackedEntity,itemslot, api );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public override bool OnBlockBrokenWith(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel, float dropQuantityMultiplier = 1f)
|
||||
{
|
||||
if (api.Side.IsClient( )) return true;
|
||||
|
||||
SteelAspects.WhenUsedForBlockBreak(world, byEntity, itemslot, blockSel, this.api);
|
||||
|
||||
return true;//Blocks Behavior overrides?
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
public override bool ConsumeCraftingIngredients(ItemSlot[ ] slots, ItemSlot outputSlot, GridRecipe matchingRecipe)
|
||||
{
|
||||
SteelAspects.ToolInRecipeUse(this, slots, matchingRecipe, api );
|
||||
|
||||
return true;//Always as its a tool?
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//OnCreated By Crafting: Copy properties from 'parent' to steel item/block, for Sharpening effect
|
||||
public override void OnCreatedByCrafting(ItemSlot[ ] allInputslots, ItemSlot outputSlot, GridRecipe byRecipe)
|
||||
{
|
||||
SteelAspects.SharpenOneSteelItem(allInputslots, outputSlot, byRecipe, api);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
public override int GetItemDamageColor(ItemStack itemstack)
|
||||
{
|
||||
var steelThing = itemstack.AsSteelThing( );
|
||||
|
||||
switch (steelThing.Sharpness) {
|
||||
case SharpnessState.Rough:
|
||||
return SteelAspects.color_Rough;
|
||||
|
||||
case SharpnessState.Dull:
|
||||
return SteelAspects.color_Dull;
|
||||
|
||||
case SharpnessState.Honed:
|
||||
return SteelAspects.color_Honed;
|
||||
|
||||
case SharpnessState.Keen:
|
||||
return SteelAspects.color_Keen;
|
||||
|
||||
case SharpnessState.Sharp:
|
||||
return SteelAspects.color_Sharp;
|
||||
|
||||
case SharpnessState.Razor:
|
||||
return SteelAspects.color_Razor;
|
||||
}
|
||||
|
||||
return SteelAspects.color_Default;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -13,33 +13,12 @@ using Vintagestory.API.Config;
|
|||
namespace ElementalTools
|
||||
{
|
||||
/// <summary>
|
||||
/// GENERIC Steel item. (Tool / Weapon / Armor...anything) [Possibly: Temperable and/or Hardenable ]
|
||||
/// GENERIC Steel item. (Tool / Weapon ) [Possibly: Temperable and/or Hardenable ]
|
||||
/// </summary>
|
||||
public class SteelWrap<T>: SteelAssistItem, IAmSteel where T : Item, new()
|
||||
{
|
||||
private const float eutectoid_transition_temperature = 727f;//Celcius
|
||||
private const float quenchTimeConstant = 180f;
|
||||
private const float quench_min_temperature = 450f;//Celcius
|
||||
private const string _timestampKey = @"timestamp";
|
||||
public class SteelWrapItem<OrigItem>: SteelBaseItem where OrigItem : Item, new()
|
||||
{
|
||||
private OrigItem WrappedItem;//Special placeholder replica - for calling ancestor (base) class
|
||||
|
||||
private Item WrappedItem;//Special placeholder replica - for calling ancestor class
|
||||
|
||||
internal const string hardenableKeyword = @"hardenable";
|
||||
internal const string sharpenableKeyword = @"sharpenable";
|
||||
internal const string metalNameKeyword = @"metalName";
|
||||
|
||||
internal const string hardnessKeyword = @"hardness";
|
||||
internal const string sharpnessKeyword = @"sharpness";
|
||||
|
||||
internal const string durabilityKeyword = @"durability";
|
||||
|
||||
internal readonly BGRAColor_Int32 color_Rough = new BGRAColor_Int32(0xFF, 0x66, 0x00);
|
||||
internal readonly BGRAColor_Int32 color_Dull = new BGRAColor_Int32(0xFF, 0xBE, 0x00);
|
||||
internal readonly BGRAColor_Int32 color_Honed = new BGRAColor_Int32(0xE8, 0xFF, 0x00);
|
||||
internal readonly BGRAColor_Int32 color_Keen = new BGRAColor_Int32(0x7D, 0xFF, 0x00);
|
||||
internal readonly BGRAColor_Int32 color_Sharp = new BGRAColor_Int32(0x00, 0xFF, 0x12);
|
||||
internal readonly BGRAColor_Int32 color_Razor = new BGRAColor_Int32(0x00, 0xFF, 0xD7);
|
||||
internal readonly BGRAColor_Int32 color_Default = new BGRAColor_Int32(0xFF, 0x00, 0x00);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -62,14 +41,14 @@ namespace ElementalTools
|
|||
public virtual bool MatchesForCrafting -- //Refect if trying to oversharpen
|
||||
* */
|
||||
|
||||
public SteelWrap( ) //Since It Invokes that for the new type of T anyways...
|
||||
public SteelWrapItem( ) //Since It Invokes that for the new type of T anyways...
|
||||
{
|
||||
WrappedItem = new T();
|
||||
WrappedItem = new OrigItem();
|
||||
}
|
||||
|
||||
public SteelWrap(int itemId) : base(itemId)
|
||||
public SteelWrapItem(int itemId) : base(itemId)
|
||||
{
|
||||
WrappedItem = new T();
|
||||
WrappedItem = new OrigItem();
|
||||
WrappedItem.ItemId = itemId;
|
||||
WrappedItem.MaxStackSize = 1;
|
||||
}
|
||||
|
|
@ -98,60 +77,12 @@ namespace ElementalTools
|
|||
api.World.Logger.Error("Substituting class name from wrapped Item '{0}'", trueClassName);
|
||||
}
|
||||
|
||||
|
||||
WrappedItem = api.ClassRegistry.CreateItem(trueClassName);
|
||||
|
||||
WrappedItem.ItemId = this.ItemId;
|
||||
WrappedItem.Code = this.Code.Clone( );
|
||||
WrappedItem.Class = trueClassName;
|
||||
WrappedItem.Textures = this.Textures;
|
||||
WrappedItem.Variant = this.Variant;
|
||||
WrappedItem.VariantStrict = this.VariantStrict;
|
||||
WrappedItem.Tool = this?.Tool;
|
||||
WrappedItem.Attributes = this?.Attributes?.Clone();
|
||||
WrappedItem.MiningSpeed = this?.MiningSpeed;
|
||||
WrappedItem.Shape = this.Shape;
|
||||
WrappedItem.StorageFlags = this.StorageFlags;
|
||||
WrappedItem.DamagedBy = this.DamagedBy;
|
||||
WrappedItem.Durability = this.Durability;
|
||||
WrappedItem.AttackPower = this.AttackPower;
|
||||
WrappedItem.AttackRange = this.AttackRange;
|
||||
WrappedItem.ToolTier = this.ToolTier;
|
||||
WrappedItem.MaxStackSize = this.MaxStackSize;
|
||||
WrappedItem.MaterialDensity = this.MaterialDensity;
|
||||
WrappedItem.GuiTransform = this.GuiTransform;
|
||||
WrappedItem.FpHandTransform = this.FpHandTransform;
|
||||
WrappedItem.TpHandTransform = this.TpHandTransform;
|
||||
WrappedItem.GroundTransform = this.GroundTransform;
|
||||
|
||||
|
||||
WrappedItem.OnLoadedNative(api);//Hacky - but needed?
|
||||
//WrappedItem.OnLoaded(api); // ItemScythe : ItemShears Needs this!
|
||||
WrappedItem = ( OrigItem )api.ClassRegistry.CreateItem(trueClassName);//( T )api.World.Items[this.ItemId];// Old Item class (name) should still exist.
|
||||
|
||||
OverwriteFields(WrappedItem);
|
||||
}
|
||||
|
||||
#region Static Properties
|
||||
public virtual bool Hardenable {
|
||||
get
|
||||
{
|
||||
return this.Attributes[hardenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public virtual string Name {
|
||||
get
|
||||
{
|
||||
return this.Attributes[metalNameKeyword].AsString("?");
|
||||
}
|
||||
}
|
||||
|
||||
public virtual bool Sharpenable {
|
||||
get
|
||||
{
|
||||
return this.Attributes[sharpenableKeyword].AsBool(false);
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
|
|
@ -160,185 +91,40 @@ namespace ElementalTools
|
|||
public override void GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo)
|
||||
{
|
||||
if (inSlot == null || inSlot.Empty || inSlot.Inventory == null) {
|
||||
#if DEBUG
|
||||
api.World.Logger.Warning("GetHeldItemInfo -> Invetory / slot / stack: FUBAR!");
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
WrappedItem?.GetHeldItemInfo(inSlot, dsc, world, withDebugInfo);
|
||||
|
||||
var hardness = Hardness(inSlot.Itemstack);
|
||||
var sharpness = Sharpness(inSlot.Itemstack);
|
||||
|
||||
dsc.AppendFormat("\nMetal: '{0}' ",Name);
|
||||
|
||||
if (this.Hardenable || hardness != HardnessState.Soft) {
|
||||
dsc.AppendFormat(", Temper: {0}\n", hardness);
|
||||
base.GetHeldItemInfo(inSlot, dsc, world, withDebugInfo);
|
||||
SteelAspects.GetHeldItemInfo(api, inSlot, dsc, world, withDebugInfo);
|
||||
}
|
||||
|
||||
if (this.Sharpenable) {
|
||||
dsc.AppendFormat(", Edge: {0}\n", sharpness);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public virtual SharpnessState Sharpness(IItemStack someStack)
|
||||
{
|
||||
if (someStack.Attributes != null && someStack.Attributes.HasAttribute(sharpnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = someStack.Attributes.GetBytes(sharpnessKeyword, bytes);
|
||||
return bytes == null ? SharpnessState.Rough : ( SharpnessState )bytes[0];
|
||||
}
|
||||
|
||||
return SharpnessState.Rough;
|
||||
}
|
||||
|
||||
public virtual void Sharpness(IItemStack someStack, SharpnessState set)
|
||||
{
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes[0] = (byte)set;
|
||||
someStack.Attributes.SetBytes(sharpnessKeyword, bytes);
|
||||
}
|
||||
|
||||
public virtual SharpnessState Dull(IItemStack someStack)
|
||||
{
|
||||
if (someStack.Attributes != null && someStack.Attributes.HasAttribute(sharpnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = someStack.Attributes.GetBytes(sharpnessKeyword, bytes);
|
||||
var state = ( SharpnessState )bytes[0];
|
||||
|
||||
if (state > SharpnessState.Rough) state--;
|
||||
|
||||
bytes[0] = ( byte )state;
|
||||
someStack.Attributes.SetBytes(sharpnessKeyword, bytes);
|
||||
|
||||
return state;
|
||||
}
|
||||
return SharpnessState.Rough;
|
||||
}
|
||||
|
||||
public virtual HardnessState Hardness(IItemStack someStack)
|
||||
{
|
||||
if (someStack.Attributes != null && someStack.Attributes.HasAttribute(hardnessKeyword)) {
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes = someStack.Attributes.GetBytes(hardnessKeyword, bytes);
|
||||
return bytes == null ? HardnessState.Soft : ( HardnessState )bytes[0];
|
||||
}
|
||||
|
||||
return HardnessState.Soft;
|
||||
}
|
||||
|
||||
public virtual void Hardness(IItemStack someStack, HardnessState set)
|
||||
{
|
||||
byte[ ] bytes = new byte[1];
|
||||
bytes[0] = ( byte )set;
|
||||
someStack.Attributes.SetBytes(hardnessKeyword, bytes);
|
||||
}
|
||||
|
||||
public virtual SharpnessState Sharpen(IItemStack someStack)
|
||||
{
|
||||
if (this.Sharpenable == false) {
|
||||
api.World.Logger.VerboseDebug("Can't sharpen! {0}", this.Code);
|
||||
return this.Sharpness(someStack);;
|
||||
}
|
||||
|
||||
SharpnessState sharp = Sharpness(someStack);
|
||||
|
||||
if (sharp < SharpnessState.Razor) { Sharpness(someStack, ++sharp); }
|
||||
//TODO: Play sound effect
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Sharpness of '{1}' increased to: {0}", sharp, this.Code);
|
||||
#endif
|
||||
|
||||
//TODO: If durability exists - decriment based on Hardnes Vs. Wear...
|
||||
if (this.Durability > 1) {
|
||||
|
||||
var currentDur = GetDurability(someStack);
|
||||
SetDurability(someStack,--currentDur);
|
||||
}
|
||||
|
||||
return sharp;
|
||||
}
|
||||
|
||||
public virtual void CopyAttributes(ItemStack donor, ItemStack recipient)
|
||||
{
|
||||
|
||||
if (donor.Class == recipient.Class) {
|
||||
var hI = (donor.Item as IAmSteel).Hardness(donor);
|
||||
var sI = (donor.Item as IAmSteel).Sharpness(donor);
|
||||
|
||||
(recipient.Item as IAmSteel).Hardness(recipient, hI);
|
||||
(recipient.Item as IAmSteel).Sharpness(recipient, sI);
|
||||
|
||||
if (donor.Item.Durability > 0)
|
||||
{
|
||||
var wear = GetDurability(donor);
|
||||
|
||||
if (donor.Item.IsFerricMetal( ) && recipient.Item.IsSteelMetal( )) {
|
||||
var percentWear = (wear / donor.Item.Durability);
|
||||
SetDurability(recipient, recipient.Item.Durability * percentWear);
|
||||
}
|
||||
else SetDurability(recipient, wear);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// ???
|
||||
/// Future use...
|
||||
/// </summary>
|
||||
/// <returns>The attack power.</returns>
|
||||
/// <param name="withItemStack">With item stack.</param>
|
||||
public override void OnHeldDropped(IWorldAccessor world, IPlayer byPlayer, ItemSlot slot, int quantity, ref EnumHandling handling)
|
||||
{
|
||||
//If Temperature > 450C - Set Timestamp?
|
||||
|
||||
|
||||
WrappedItem.OnHeldDropped(world, byPlayer, slot, quantity, ref handling);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Does Quench-hardening
|
||||
/// For; Quench-harden...
|
||||
/// </summary>
|
||||
/// <returns>The ground idle.</returns>
|
||||
/// <param name="entityItem">Entity item.</param>
|
||||
/// <param name="entityItem">Entity item.(Itself)</param>
|
||||
public override void OnGroundIdle(EntityItem entityItem)
|
||||
{
|
||||
if (api.Side.IsServer() && (entityItem.Swimming || entityItem.FeetInLiquid)) {
|
||||
|
||||
if (!this.Hardenable) return;
|
||||
|
||||
float temperature = entityItem.Itemstack.Collectible.GetTemperature(api.World, entityItem.Itemstack);
|
||||
//Track first moment in liquid;
|
||||
this.SetTimestamp(entityItem);//Need to clear when NORMALIZING.
|
||||
|
||||
//Above 900C - What should happen in this range; different phase of iron?
|
||||
|
||||
//temperature <= eutectoid_transition_temperature ||
|
||||
if ( temperature >= quench_min_temperature )
|
||||
{
|
||||
//TODO: Thermal capacity & Transfer values for NON-Water fluids...and surfaces too!
|
||||
var elapsedTime = this.GetTimestampElapsed(entityItem);
|
||||
|
||||
uint quenchUnits = ( uint )Math.Round(elapsedTime.TotalMilliseconds / quenchTimeConstant, 0);
|
||||
|
||||
if (quenchUnits < (uint)HardnessState.Brittle) {
|
||||
this.Hardness(entityItem.Itemstack, ( HardnessState )quenchUnits);
|
||||
}
|
||||
else {
|
||||
this.Hardness(entityItem.Itemstack, HardnessState.Brittle);
|
||||
}
|
||||
|
||||
//Being that water conducts heat well - reduce Temperature _FASTER_
|
||||
entityItem.Itemstack.Collectible.SetTemperature(api.World, entityItem.Itemstack, temperature - 15, false);
|
||||
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Quench process: {0}S elapsed @{1}C H:{2} ~ QU#{3}", elapsedTime.TotalSeconds, temperature, this.Hardness(entityItem.Itemstack), quenchUnits );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
WrappedItem.OnGroundIdle(entityItem);
|
||||
SteelAspects.QuenchHarden(this, entityItem, api);
|
||||
base.OnGroundIdle(entityItem);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -355,7 +141,7 @@ namespace ElementalTools
|
|||
float pctBoost = 0;//CONSIDER: Perhaps make this external?
|
||||
switch (sharpness) {
|
||||
case SharpnessState.Rough:
|
||||
pctBoost = -0.35f;
|
||||
pctBoost = -0.25f;
|
||||
break;
|
||||
|
||||
case SharpnessState.Dull:
|
||||
|
|
@ -366,13 +152,13 @@ namespace ElementalTools
|
|||
pctBoost = 0.10f;
|
||||
break;
|
||||
case SharpnessState.Keen:
|
||||
pctBoost = 0.20f;
|
||||
pctBoost = 0.15f;
|
||||
break;
|
||||
case SharpnessState.Sharp:
|
||||
pctBoost = 0.25f;
|
||||
pctBoost = 0.20f;
|
||||
break;
|
||||
case SharpnessState.Razor:
|
||||
pctBoost = 0.30f;
|
||||
pctBoost = 0.25f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -414,7 +200,7 @@ namespace ElementalTools
|
|||
bool catasptrophicFailure = world.Rand.Next(1, 1000) >= 999;
|
||||
if (catasptrophicFailure) {
|
||||
world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", this.Code);
|
||||
this.SetDurability(itemslot.Itemstack, 0);
|
||||
SteelAspects.SetHitpoints(itemslot.Itemstack, 0);
|
||||
this.DamageItem(world, byEntity, itemslot, 9999);
|
||||
return;
|
||||
}
|
||||
|
|
@ -428,7 +214,8 @@ namespace ElementalTools
|
|||
|
||||
|
||||
|
||||
public override bool OnBlockBrokenWith(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel)
|
||||
|
||||
public override bool OnBlockBrokenWith(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel, float dropQuantityMultiplier = 1f)
|
||||
{
|
||||
if (api.Side.IsClient()) return true;
|
||||
|
||||
|
|
@ -450,15 +237,16 @@ namespace ElementalTools
|
|||
//Tool Specific special damage reduction rate: e.g. scythe, hoe, knife, here...
|
||||
//By MiningSpeed
|
||||
|
||||
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug($"OnBlockBrokenWith:: (Weap:{weapon},Edge:{edged},OK: {recomendedUsage},T.T#{targetTier}) {byEntity.Code} -> {targetBlock.Code}");
|
||||
#endif
|
||||
|
||||
if (recomendedUsage == false && hardness > HardnessState.Hard) {
|
||||
bool catasptrophicFailure = world.Rand.Next(1, 1000) >= (999 - (targetTier * 5));
|
||||
|
||||
if (catasptrophicFailure) {
|
||||
world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", this.Code);
|
||||
this.SetDurability(itemslot.Itemstack, 0);
|
||||
SteelAspects.SetHitpoints(itemslot.Itemstack, 0);
|
||||
this.DamageItem(world, byEntity, itemslot, 9999);
|
||||
return true;
|
||||
}
|
||||
|
|
@ -522,7 +310,7 @@ namespace ElementalTools
|
|||
|
||||
|
||||
/// <summary>
|
||||
/// Advanced formula to calculate wear based on 'sharpness' and 'durability' inherint
|
||||
/// Handle Sharpening by Item + Craft-Grid use
|
||||
/// </summary>
|
||||
/// <returns>The consumed by crafting.</returns>
|
||||
/// <param name="allInputSlots">All input slots.</param>
|
||||
|
|
@ -572,7 +360,6 @@ namespace ElementalTools
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
var steelItemSlot = (from inputSlot in allInputslots
|
||||
where inputSlot.Empty == false
|
||||
where inputSlot.Itemstack.Class == EnumItemClass.Item
|
||||
|
|
@ -585,33 +372,37 @@ namespace ElementalTools
|
|||
where inputSlot.Itemstack.Collectible.IsSharpener()
|
||||
select inputSlot).SingleOrDefault( );
|
||||
|
||||
if (steelItemSlot != null) {
|
||||
if (steelItemSlot != null)
|
||||
{
|
||||
if (steelItemSlot.Itemstack.Item is ISteelByStack)
|
||||
{
|
||||
var steelItem = steelItemSlot.Itemstack.Item;
|
||||
|
||||
if (steelItemSlot.Itemstack.Item is IAmSteel) {
|
||||
var steelItem = steelItemSlot.Itemstack.Item;
|
||||
|
||||
api.World.Logger.VerboseDebug("Input (ingredient) Item {0} supports; Steel Interface ", steelItem.Code);
|
||||
|
||||
if (!outputSlot.Empty && outputSlot.Itemstack.Class == EnumItemClass.Item
|
||||
&& outputSlot.Itemstack.Item is IAmSteel) {
|
||||
var outputItem = outputSlot.Itemstack.Item;
|
||||
var fullMetalInterface = outputSlot.Itemstack.Item as IAmSteel;
|
||||
api.World.Logger.VerboseDebug("Output Item {0} supports; Steel Interface ", steelItem.Code);
|
||||
|
||||
fullMetalInterface.CopyAttributes(steelItemSlot.Itemstack, outputSlot.Itemstack);
|
||||
|
||||
if (sharpenerItemSlot != null) fullMetalInterface.Sharpen(outputSlot.Itemstack);
|
||||
api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1} ", steelItem.Code, outputItem.Code);
|
||||
}
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Input (ingredient) Item {0} supports; Steel Interface ", steelItem.Code);
|
||||
#endif
|
||||
if (!outputSlot.Empty && outputSlot.Itemstack.Class == EnumItemClass.Item
|
||||
&& outputSlot.Itemstack.Item is ISteelByStack)
|
||||
{
|
||||
var outputItem = outputSlot.Itemstack.Item;
|
||||
var fullMetalInterface = outputSlot.Itemstack.Item as ISteelByStack;
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Output Item {0} supports; Steel Interface ", steelItem.Code);
|
||||
#endif
|
||||
|
||||
fullMetalInterface.CopyStackAttributes(steelItemSlot.Itemstack, outputSlot.Itemstack);
|
||||
|
||||
if (sharpenerItemSlot != null) fullMetalInterface.Sharpen(outputSlot.Itemstack);
|
||||
#if DEBUG
|
||||
api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1} ", steelItem.Code, outputItem.Code);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public override float GetMiningSpeed(IItemStack itemstack, Block block)
|
||||
public override float GetMiningSpeed(IItemStack itemstack, BlockSelection blockSel, Block block, IPlayer forPlayer)
|
||||
{
|
||||
var baseSpeed = 1f;
|
||||
//Boost for Edged tools / weapons
|
||||
|
|
@ -652,25 +443,25 @@ namespace ElementalTools
|
|||
|
||||
switch (edge) {
|
||||
case SharpnessState.Rough:
|
||||
return this.color_Rough;
|
||||
return SteelAspects.color_Rough;
|
||||
|
||||
case SharpnessState.Dull:
|
||||
return this.color_Dull;
|
||||
return SteelAspects.color_Dull;
|
||||
|
||||
case SharpnessState.Honed:
|
||||
return this.color_Honed;
|
||||
return SteelAspects.color_Honed;
|
||||
|
||||
case SharpnessState.Keen:
|
||||
return this.color_Keen;
|
||||
return SteelAspects.color_Keen;
|
||||
|
||||
case SharpnessState.Sharp:
|
||||
return this.color_Sharp;
|
||||
return SteelAspects.color_Sharp;
|
||||
|
||||
case SharpnessState.Razor:
|
||||
return this.color_Razor;
|
||||
return SteelAspects.color_Razor;
|
||||
}
|
||||
|
||||
return this.color_Default;
|
||||
return SteelAspects.color_Default;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
@ -679,60 +470,27 @@ namespace ElementalTools
|
|||
//Wire up all invokes >>> to NOT call Base - but (WrappedItem) T instead !
|
||||
#region Wrapped_Calls
|
||||
|
||||
public override float OnBlockBreaking(IPlayer player, BlockSelection blockSel, ItemSlot itemslot, float remainingResistance, float dt, int counter)
|
||||
{
|
||||
return WrappedItem.OnBlockBreaking(player, blockSel, itemslot, remainingResistance, dt, counter);
|
||||
}
|
||||
public override float OnBlockBreaking(IPlayer player, BlockSelection blockSel, ItemSlot itemslot, float remainingResistance, float dt, int counter) => WrappedItem.OnBlockBreaking(player, blockSel, itemslot, remainingResistance, dt, counter);
|
||||
|
||||
public override void OnHeldInteractStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, bool firstEvent, ref EnumHandHandling handling)
|
||||
{
|
||||
WrappedItem.OnHeldInteractStart(slot, byEntity, blockSel, entitySel, firstEvent, ref handling);
|
||||
}
|
||||
public override void OnHeldInteractStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, bool firstEvent, ref EnumHandHandling handling) => WrappedItem.OnHeldInteractStart(slot, byEntity, blockSel, entitySel, firstEvent, ref handling);
|
||||
|
||||
public override bool OnHeldInteractStep(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel)
|
||||
{
|
||||
return WrappedItem.OnHeldInteractStep(secondsUsed, slot, byEntity, blockSel, entitySel);
|
||||
}
|
||||
public override bool OnHeldInteractStep(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) => WrappedItem.OnHeldInteractStep(secondsUsed, slot, byEntity, blockSel, entitySel);
|
||||
|
||||
public override void OnHeldInteractStop(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel)
|
||||
{
|
||||
WrappedItem.OnHeldInteractStop(secondsUsed, slot, byEntity, blockSel, entitySel);
|
||||
}
|
||||
public override void OnHeldInteractStop(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) => WrappedItem.OnHeldInteractStop(secondsUsed, slot, byEntity, blockSel, entitySel);
|
||||
|
||||
public override int GetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection)
|
||||
{
|
||||
return WrappedItem.GetToolMode(slot, byPlayer, blockSelection);
|
||||
}
|
||||
public override int GetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection) => WrappedItem.GetToolMode(slot, byPlayer, blockSelection);
|
||||
|
||||
public override void SetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection, int toolMode)
|
||||
{
|
||||
WrappedItem.SetToolMode(slot, byPlayer, blockSelection, toolMode);
|
||||
}
|
||||
public override void SetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection, int toolMode) => WrappedItem.SetToolMode(slot, byPlayer, blockSelection, toolMode);
|
||||
|
||||
public override SkillItem[ ] GetToolModes(ItemSlot slot, IClientPlayer forPlayer, BlockSelection blockSel)
|
||||
{
|
||||
return WrappedItem.GetToolModes(slot, forPlayer, blockSel);
|
||||
}
|
||||
public override SkillItem[ ] GetToolModes(ItemSlot slot, IClientPlayer forPlayer, BlockSelection blockSel) => WrappedItem.GetToolModes(slot, forPlayer, blockSel);
|
||||
|
||||
public override void OnHeldAttackStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, ref EnumHandHandling handling)
|
||||
{
|
||||
WrappedItem.OnHeldAttackStart(slot, byEntity, blockSel, entitySel, ref handling);
|
||||
}
|
||||
public override void OnHeldAttackStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, ref EnumHandHandling handling) => WrappedItem.OnHeldAttackStart(slot, byEntity, blockSel, entitySel, ref handling);
|
||||
|
||||
public override bool OnHeldAttackStep(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel)
|
||||
{
|
||||
return WrappedItem.OnHeldAttackStep(secondsPassed, slot, byEntity, blockSelection, entitySel);
|
||||
}
|
||||
public override bool OnHeldAttackStep(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel) => WrappedItem.OnHeldAttackStep(secondsPassed, slot, byEntity, blockSelection, entitySel);
|
||||
|
||||
public override void OnHeldAttackStop(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel)
|
||||
{
|
||||
WrappedItem.OnHeldAttackStop(secondsPassed, slot, byEntity, blockSelection, entitySel);
|
||||
}
|
||||
public override void OnHeldAttackStop(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel) => WrappedItem.OnHeldAttackStop(secondsPassed, slot, byEntity, blockSelection, entitySel);
|
||||
|
||||
public override bool OnHeldAttackCancel(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel, EnumItemUseCancelReason cancelReason)
|
||||
{
|
||||
return WrappedItem.OnHeldAttackCancel(secondsPassed, slot, byEntity, blockSelection, entitySel, cancelReason);
|
||||
}
|
||||
public override bool OnHeldAttackCancel(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel, EnumItemUseCancelReason cancelReason) => WrappedItem.OnHeldAttackCancel(secondsPassed, slot, byEntity, blockSelection, entitySel, cancelReason);
|
||||
|
||||
|
||||
/*
|
||||
|
|
@ -766,7 +524,6 @@ namespace ElementalTools
|
|||
|
||||
public override float AppendPerishableInfoText(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world)
|
||||
{
|
||||
api.World.Logger.VerboseDebug("AppendPerishableInfoText - invoked");
|
||||
return 0f;//HACK: to stop missing variables from causing a fault
|
||||
}
|
||||
|
||||
|
|
@ -774,28 +531,22 @@ namespace ElementalTools
|
|||
#endregion
|
||||
|
||||
|
||||
internal void SetDurability(IItemStack recipient, int wearLevel)
|
||||
{
|
||||
recipient.Attributes.SetInt(durabilityKeyword, wearLevel);
|
||||
}
|
||||
|
||||
internal int GetDurability(IItemStack recipient)
|
||||
{
|
||||
return recipient.Attributes.GetInt(durabilityKeyword, recipient.Item.Durability);
|
||||
}
|
||||
|
||||
internal void SetTimestamp(EntityItem entityItem)
|
||||
|
||||
|
||||
protected void SetTimestamp(EntityItem entityItem)
|
||||
{
|
||||
|
||||
if (!entityItem.Attributes.HasAttribute(_timestampKey)) {
|
||||
entityItem.Attributes.SetLong(_timestampKey, DateTime.Now.Ticks);
|
||||
if (!entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) {
|
||||
entityItem.Attributes.SetLong(SteelAspects._timestampKey, DateTime.Now.Ticks);
|
||||
}
|
||||
}
|
||||
|
||||
internal TimeSpan GetTimestampElapsed(EntityItem entityItem)
|
||||
protected TimeSpan GetTimestampElapsed(EntityItem entityItem)
|
||||
{
|
||||
if (entityItem.Attributes.HasAttribute(_timestampKey)) {
|
||||
var ts = TimeSpan.FromTicks(entityItem.Attributes.GetLong(_timestampKey));
|
||||
if (entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) {
|
||||
var ts = TimeSpan.FromTicks(entityItem.Attributes.GetLong(SteelAspects._timestampKey));
|
||||
return ts.Subtract(TimeSpan.FromTicks(DateTime.Now.Ticks)).Negate();
|
||||
}
|
||||
return TimeSpan.Zero;
|
||||
|
|
@ -1,10 +1,121 @@
|
|||
using System;
|
||||
|
||||
using Vintagestory.API.Client;
|
||||
using Vintagestory.API.Common;
|
||||
using Vintagestory.API.MathTools;
|
||||
using Vintagestory.GameContent;
|
||||
|
||||
namespace ElementalTools
|
||||
{
|
||||
public class PackCarburization_Renderer
|
||||
public class PackCarburization_Renderer : IInFirepitRenderer //FirepitContentsRenderer
|
||||
{
|
||||
public PackCarburization_Renderer( )
|
||||
private BlockPos pos;
|
||||
private ICoreClientAPI clientAPI;
|
||||
private ItemStack localStack;
|
||||
private bool isInOutputSlot;
|
||||
|
||||
private MeshRef carbpack_MeshRef;
|
||||
private Matrixf carbpack_ModelMatrix = new Matrixf( );
|
||||
|
||||
private int textureId;
|
||||
private float voxelHeight;
|
||||
protected int glowLevel;
|
||||
|
||||
public double RenderOrder {
|
||||
get
|
||||
{
|
||||
return 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
public int RenderRange {
|
||||
get
|
||||
{
|
||||
return 20;
|
||||
}
|
||||
}
|
||||
|
||||
public PackCarburization_Renderer(ICoreClientAPI capi, ItemStack stack, BlockPos pos, bool isInOutputSlot)
|
||||
{
|
||||
this.clientAPI = capi;
|
||||
this.localStack = stack;
|
||||
this.pos = pos;
|
||||
this.isInOutputSlot = isInOutputSlot;
|
||||
|
||||
PackCarburization packBlock = clientAPI.World.GetBlock(stack.Collectible.Code) as PackCarburization;
|
||||
|
||||
|
||||
MeshData pack_MeshData;
|
||||
//path: "shapes/block/metallurgy/pack_carburization.json"
|
||||
var shapePath = packBlock.Shape.Base.CopyWithPath("shapes/" + packBlock.Shape.Base.Path + ".json");//Why append filenames, can't Shape have a type-param?!
|
||||
|
||||
#if DEBUG
|
||||
capi.Logger.VerboseDebug("Shape-path: {0}", shapePath);
|
||||
#endif
|
||||
capi.Tesselator.TesselateShape(packBlock, Shape.TryGet(capi, shapePath), out pack_MeshData);
|
||||
|
||||
carbpack_MeshRef = capi.Render.UploadMesh(pack_MeshData);
|
||||
}
|
||||
|
||||
|
||||
public void Dispose( )
|
||||
{
|
||||
clientAPI.Event.UnregisterRenderer(this, EnumRenderStage.Opaque);
|
||||
carbpack_MeshRef?.Dispose( );
|
||||
}
|
||||
|
||||
public void OnCookingComplete( )
|
||||
{
|
||||
isInOutputSlot = true;
|
||||
//What Else??
|
||||
}
|
||||
|
||||
|
||||
public void OnRenderFrame(float deltaTime, EnumRenderStage stage)
|
||||
{
|
||||
IRenderAPI renderAPI = clientAPI.Render;
|
||||
Vec3d camPos = clientAPI.World.Player.Entity.CameraPos;
|
||||
|
||||
renderAPI.GlDisableCullFace( );
|
||||
renderAPI.GlToggleBlend(true);
|
||||
|
||||
IStandardShaderProgram shader = renderAPI.PreparedStandardShader(pos.X, pos.Y, pos.Z);
|
||||
|
||||
shader.Tex2D = clientAPI.BlockTextureAtlas.AtlasTextureIds[0];
|
||||
shader.DontWarpVertices = 0;
|
||||
shader.AddRenderFlags = 0;
|
||||
shader.RgbaAmbientIn = renderAPI.AmbientColor;
|
||||
shader.RgbaFogIn = renderAPI.FogColor;
|
||||
shader.FogMinIn = renderAPI.FogMin;
|
||||
shader.FogDensityIn = renderAPI.FogDensity;
|
||||
shader.RgbaTint = ColorUtil.WhiteArgbVec;
|
||||
shader.NormalShaded = 1;
|
||||
shader.ExtraGodray = 0;
|
||||
shader.ExtraGlow = glowLevel;
|
||||
shader.SsaoAttn = 0;
|
||||
shader.AlphaTest = 0.05f;
|
||||
shader.OverlayOpacity = 0;
|
||||
|
||||
//TODO: Change constants to work for Carburization pack sizes / offsets...
|
||||
shader.ModelMatrix = carbpack_ModelMatrix
|
||||
.Identity( )
|
||||
.Translate(pos.X - camPos.X + 0.001f, pos.Y - camPos.Y, pos.Z - camPos.Z - 0.001f)
|
||||
.Translate(0f, 1 / 16f, 0f)
|
||||
.Values;
|
||||
|
||||
shader.ViewMatrix = renderAPI.CameraMatrixOriginf;
|
||||
shader.ProjectionMatrix = renderAPI.CurrentProjectionMatrix;
|
||||
|
||||
renderAPI.RenderMesh(carbpack_MeshRef);
|
||||
|
||||
shader.Stop( );
|
||||
}
|
||||
|
||||
|
||||
public void OnUpdate(float temperature)
|
||||
{
|
||||
//Correct GLOW INCANDESCENT level?
|
||||
this.glowLevel = ( int )(temperature / 100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
57
ElementalTools/assets/fma/blocktypes/metal/crusie_lamp.json
Normal file
57
ElementalTools/assets/fma/blocktypes/metal/crusie_lamp.json
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
{
|
||||
code: "crusie_lamp",
|
||||
behaviors: [
|
||||
{ name: "UnstableFalling", properties: {
|
||||
attachableFaces: ["up", "down"],
|
||||
impactDamageMul: 10,
|
||||
attachmentAreas: {
|
||||
"down": { x1: 7, y1: 15, z1: 7, x2: 8, y2: 15, z2: 8 },
|
||||
"up": { x1: 7, y1: 0, z1: 7, x2: 8, y2: 0, z2: 8 }
|
||||
}
|
||||
}}
|
||||
],
|
||||
creativeinventory: { "decorative": ["*"] },
|
||||
textures: {
|
||||
"fuel": { base:"block/candle" },
|
||||
"iron": { base: "block/metal/black_iron2" },
|
||||
"wick": { base:"block/candle" },
|
||||
},
|
||||
shape: { base: "block/metal/crusie_lamp" },
|
||||
drawtype: "json",
|
||||
blockmaterial: "Metal",
|
||||
sidesolid: { all: false },
|
||||
sideopaque: { all: false },
|
||||
resistance: 3,
|
||||
lightHsv: [9, 3, 16],
|
||||
lightAbsorption: 0,
|
||||
collisionSelectionBox: { x1: 0.0625, y1: 0, z1: 0.0625, x2: 0.9375, y2: 1, z2: 0.9375 },
|
||||
sounds: {
|
||||
hit: "block/chandelier-hit",
|
||||
break: "block/chandelier-break",
|
||||
},
|
||||
particleProperties: [
|
||||
{
|
||||
posOffset: [
|
||||
{ avg: 0.5, var: 0 },{ avg: 0.7, var: 0 },{ avg: 0.7, var: 0 }
|
||||
],
|
||||
velocity: [
|
||||
{ avg: 0.07, var: 0.06 },{ avg: 0.1, var: 0 },{ avg: 0.1, var: 0 }
|
||||
],
|
||||
hsvaColor: [
|
||||
{ avg: 48, var: 0 }, { avg: 1, var: 0 },
|
||||
{ avg: 1, var: 0 }, { avg: 132, var: 123 }
|
||||
],
|
||||
quantity: { avg: 5, var: 0 },
|
||||
lifeLength: { avg: 0.14, var: 0.07 },
|
||||
gravityEffect: { avg: -0.12, var: -0.03 },
|
||||
size: { avg: 0.02, var: 0.01 },
|
||||
particleModel: "Quad",
|
||||
sizeEvolve: { transform: "linear", factor: 0.1 },
|
||||
opacityEvolve: { transform: "quadratic", factor: -20 },
|
||||
dieInLiquid: true,
|
||||
terrainCollision: false,
|
||||
windAffectednes: 0.5,
|
||||
vertexFlags: 255
|
||||
}
|
||||
],
|
||||
}
|
||||
|
|
@ -0,0 +1,38 @@
|
|||
{
|
||||
code: "metal_cards",
|
||||
classByType: {
|
||||
"metal_cards-blister_steel": "ConsolidatableCards",
|
||||
},
|
||||
variantgroups: [
|
||||
{ code: "metal", states: ["iron", "blister_steel" ] },
|
||||
],
|
||||
shape: { base: "fma:item/material/cards" },
|
||||
texture: { base: "fma:metal/blister_steel" },
|
||||
creativeinventory: { "general": ["*"], "items": ["*"] },
|
||||
|
||||
maxstacksize: 1,
|
||||
materialDensity: 9000,
|
||||
fpHandTransform: {
|
||||
translation: { x: 0.1, y: 0.4, z: 0.4 },
|
||||
rotation: { x: -20, y: 71, z: 61 },
|
||||
scale: 2.77
|
||||
},
|
||||
guiTransform: {
|
||||
rotate: false,
|
||||
translation: { x: 3, y: 0, z: 0 },
|
||||
rotation: { x: -8, y: -152, z: 142 },
|
||||
origin: { x: 0.5, y: 0.05, z: 0.4 },
|
||||
scale: 3.53
|
||||
},
|
||||
groundTransform: {
|
||||
translation: { x: 0, y: 0, z: 0 },
|
||||
rotation: { x: 90, y: 0, z: 0 },
|
||||
origin: { x: 0.5, y: 0, z: 0.55 },
|
||||
scale: 3.5
|
||||
},
|
||||
tpHandTransform: {
|
||||
translation: { x: -0.54, y: -0.08, z: -0.48 },
|
||||
rotation: { x: 0, y: 0, z: -10 },
|
||||
scale: 1
|
||||
}
|
||||
}
|
||||
106
ElementalTools/assets/fma/itemtypes/tools/striker.json
Normal file
106
ElementalTools/assets/fma/itemtypes/tools/striker.json
Normal file
|
|
@ -0,0 +1,106 @@
|
|||
{
|
||||
"editor": {
|
||||
"allAngles": true,
|
||||
"entityTextureMode": false
|
||||
},
|
||||
"textureWidth": 16,
|
||||
"textureHeight": 16,
|
||||
"textureSizes": {
|
||||
},
|
||||
"textures": {
|
||||
"steel": "block/metal/ingot/steel",
|
||||
"flint2": "block/stone/flint"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "Flint",
|
||||
"from": [ 7.0, 0.0, 7.0 ],
|
||||
"to": [ 9.75, 1.25, 9.75 ],
|
||||
"rotationOrigin": [ 8.0, 0.0, 8.0 ],
|
||||
"rotationY": 11.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#flint2", "uv": [ 0.0, 0.0, 2.5, 1.0 ] },
|
||||
"east": { "texture": "#flint2", "uv": [ 8.5, 7.0, 11.0, 8.0 ] },
|
||||
"south": { "texture": "#flint2", "uv": [ 5.5, 8.5, 8.0, 9.5 ] },
|
||||
"west": { "texture": "#flint2", "uv": [ 3.5, 9.0, 6.0, 10.0 ] },
|
||||
"up": { "texture": "#flint2", "uv": [ 6.0, 5.0, 8.5, 7.5 ] },
|
||||
"down": { "texture": "#flint2", "uv": [ 1.5, 9.0, 4.0, 11.5 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Striker1",
|
||||
"from": [ 10.5, 0.0, 6.5 ],
|
||||
"to": [ 11.5, 1.0, 10.0 ],
|
||||
"rotationOrigin": [ 11.0, 0.0, 6.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"east": { "texture": "#steel", "uv": [ 4.0, 2.5, 7.5, 3.5 ] },
|
||||
"south": { "texture": "#steel", "uv": [ 3.0, 4.0, 4.0, 5.0 ] },
|
||||
"west": { "texture": "#steel", "uv": [ 6.0, 8.5, 9.5, 9.5 ] },
|
||||
"up": { "texture": "#steel", "uv": [ 4.5, 7.5, 5.5, 11.0 ] },
|
||||
"down": { "texture": "#steel", "uv": [ 2.5, 2.5, 3.5, 6.0 ] }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"name": "Striker2",
|
||||
"from": [ 1.0, 0.0, 0.0 ],
|
||||
"to": [ 2.5, 1.0, 0.5 ],
|
||||
"rotationOrigin": [ 1.0, 0.0, 0.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#steel", "uv": [ 11.5, 6.5, 13.0, 7.5 ] },
|
||||
"east": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] },
|
||||
"south": { "texture": "#steel", "uv": [ 11.5, 7.5, 13.0, 8.5 ] },
|
||||
"west": { "texture": "#steel", "uv": [ 6.0, 1.0, 6.5, 2.0 ] },
|
||||
"up": { "texture": "#steel", "uv": [ 2.0, 4.5, 3.5, 5.0 ] },
|
||||
"down": { "texture": "#steel", "uv": [ 1.5, 3.5, 3.0, 4.0 ] }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"name": "Striker2e",
|
||||
"from": [ 1.5, 0.0, 0.0 ],
|
||||
"to": [ 2.0, 1.0, 1.0 ],
|
||||
"rotationOrigin": [ 2.0, 0.0, 1.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#steel", "uv": [ 9.5, 12.0, 10.0, 13.0 ] },
|
||||
"east": { "texture": "#steel", "uv": [ 12.0, 9.5, 13.0, 10.5 ] },
|
||||
"south": { "texture": "#steel", "uv": [ 7.0, 11.5, 7.5, 12.5 ] },
|
||||
"west": { "texture": "#steel", "uv": [ 9.0, 9.0, 10.0, 10.0 ] },
|
||||
"up": { "texture": "#steel", "uv": [ 4.5, 3.5, 5.0, 4.5 ] },
|
||||
"down": { "texture": "#steel", "uv": [ 5.5, 4.0, 6.0, 5.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "Striker3",
|
||||
"from": [ 1.0, 0.0, 3.0 ],
|
||||
"to": [ 2.5, 1.0, 3.5 ],
|
||||
"rotationOrigin": [ 1.0, 0.0, 2.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.5, 1.0 ] },
|
||||
"east": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] },
|
||||
"south": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.5, 1.0 ] },
|
||||
"west": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] },
|
||||
"up": { "texture": "#steel", "uv": [ 4.0, 4.5, 5.5, 5.0 ] },
|
||||
"down": { "texture": "#steel", "uv": [ 2.0, 1.5, 3.5, 2.0 ] }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"name": "Striker3e",
|
||||
"from": [ 1.5, 0.0, -0.5 ],
|
||||
"to": [ 2.0, 1.0, 0.5 ],
|
||||
"rotationOrigin": [ 2.0, 0.0, 0.0 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] },
|
||||
"east": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"south": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] },
|
||||
"west": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.0, 1.0 ] },
|
||||
"up": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] },
|
||||
"down": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
]}
|
||||
|
|
@ -35,7 +35,26 @@
|
|||
"item-shears-*":"Steel Shears",
|
||||
"item-shovel-*":"Steel Shovel",
|
||||
"item-sharpening_stone":"Sharpening Whetstones",
|
||||
"item-metal_cards-iron":"Metal cards (Iron)",
|
||||
"item-metal_cards-blister_steel":"Metal cards (Blister Steel)",
|
||||
"itemdesc-metal_cards-*":"Seven small card shaped metal plates.",
|
||||
"itemdesc-sharpening_stone":"Use in combination with _DULL_ steel items and grease to sharpen",
|
||||
"craftinginfo-primitive_steelmaking-title":"Steel making: (Pack Carburization process)",
|
||||
"craftinginfo-primitive_steelmaking-text": "So, you want to make steel?\n\nYou'll need Lots and Lots of Charcoal!\nMore Iron than you know what to do with!\n\nFirst step: combine Charcoal, Bonemeal and crush by hammering - makes <a href='handbook://fma:item-carburization_powder'>Carburization Powder</a>!\n Next make a Coffin or 'Pack' of blue-clay with lots of the previous steps powder packed around an iron object (tool-head, blade, ect...nothing too big). Then Fire it in a furnace or firepit for quite a long time - until it glows RED-HOT! \n\nTake out the 'pack' after its finished heating, and place the pack on any solid surface; break to open. Steel items can also be quenched. To improve edged steel - sharpen after hardening.",
|
||||
"craftinginfo-primitive_steelmaking-text": "So, you want to make steel objects?\n\nYou'll need Lots and Lots of Charcoal!\nMore Iron than you know what to do with!\n\nFirst step: combine Charcoal, Bonemeal and crush by hammering - making <a href='handbook://fma:item-carburization_powder'>Carburization Powder</a>!\n Next make a Coffin or 'Pack' of blue-clay with lots of the previous steps powder packed around an iron item (tool-head, blade, ect...nothing too big). Then Fire it in a furnace or firepit for quite a long time - until it glows RED-HOT! \n\nTake out the 'pack' after its finished heating, and place the pack on any solid surface; break it open! Steel items can also be quenched. To improve edged steel - sharpen after hardening.",
|
||||
"metalname-blister_steel":"Blister Steel",
|
||||
"metalname-shear_steel":"Shear Steel",
|
||||
"prop-metal":"Metal: {0},\n",
|
||||
"prop-temper":"Temper: {0},\n",
|
||||
"prop-edge":"Edge: {0},\n",
|
||||
"sharpness-0":"Rough",
|
||||
"sharpness-1":"Dull",
|
||||
"sharpness-2":"Honed",
|
||||
"sharpness-3":"Keen",
|
||||
"sharpness-4":"Sharp",
|
||||
"sharpness-5":"Razor",
|
||||
"hardness-0":"Soft",
|
||||
"hardness-1":"Mild",
|
||||
"hardness-2":"Medium",
|
||||
"hardness-3":"Hard",
|
||||
"hardness-4":"Brittle",
|
||||
}
|
||||
10
ElementalTools/assets/fma/recipes/grid/tool/hammers.json
Normal file
10
ElementalTools/assets/fma/recipes/grid/tool/hammers.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
ingredientPattern: "T S",
|
||||
ingredients: {
|
||||
"T": { type: "item", code: "fma:hammerhead-*", name: "metal" , allowedVariants: ["blister_steel", "shear_steel"] },
|
||||
"S": { type: "item", code: "game:stick" }
|
||||
},
|
||||
width: 1,
|
||||
height: 2,
|
||||
output: { type: "item", code: "fma:hammer-{metal}", quantity: 1 }
|
||||
}
|
||||
10
ElementalTools/assets/fma/recipes/grid/weapon/spears.json
Normal file
10
ElementalTools/assets/fma/recipes/grid/weapon/spears.json
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
ingredientPattern: "T S",
|
||||
ingredients: {
|
||||
"T": { type: "item", code: "fma:speartip-*", name: "metal", allowedVariants: ["blister_steel", "shear_steel"] },
|
||||
"S": { type: "item", code: "game:stick" }
|
||||
},
|
||||
width: 1,
|
||||
height: 2,
|
||||
output: { type: "item", code: "fma:spear-{metal}", quantity: 1 }
|
||||
}
|
||||
16
ElementalTools/assets/fma/recipes/smithing/metal_cards.json
Normal file
16
ElementalTools/assets/fma/recipes/smithing/metal_cards.json
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
{
|
||||
ingredient: { type: "item", code: "ingot-iron" },
|
||||
pattern: [
|
||||
[
|
||||
"## ## ## ##",
|
||||
"## ## ## ##",
|
||||
"## ## ## ##",
|
||||
"",
|
||||
"## ## ##",
|
||||
"## ## ##",
|
||||
"## ## ##",
|
||||
]
|
||||
],
|
||||
name: "Metal Cards recipie",
|
||||
output: { type: "item", code: "metal_cards-iron" }
|
||||
}
|
||||
BIN
ElementalTools/assets/fma/shapes/item/arms/gladii_inside.png
Normal file
BIN
ElementalTools/assets/fma/shapes/item/arms/gladii_inside.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 16 KiB |
93
ElementalTools/assets/fma/shapes/item/arms/seax.json
Normal file
93
ElementalTools/assets/fma/shapes/item/arms/seax.json
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
{
|
||||
"editor": {
|
||||
"allAngles": true,
|
||||
"entityTextureMode": false
|
||||
},
|
||||
"textureWidth": 16,
|
||||
"textureHeight": 8,
|
||||
"textureSizes": {
|
||||
},
|
||||
"textures": {
|
||||
"blister_steel": "/home/librarian/Documents/Project/DotNet/First_Machine_Age/ElementalTools/assets/fma/textures/metal/blister_steel",
|
||||
"handle": "item/tool/material/handle"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "grip",
|
||||
"from": [ 8.0, 0.125, 8.125 ],
|
||||
"to": [ 13.0, 1.125, 9.125 ],
|
||||
"rotationOrigin": [ 8.0, 0.0, 8.0 ],
|
||||
"rotationX": -45.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#handle", "uv": [ 10.5, 4.75, 15.5, 5.75 ] },
|
||||
"east": { "texture": "#handle", "uv": [ 12.5, 3.25, 13.5, 4.25 ] },
|
||||
"south": { "texture": "#handle", "uv": [ 10.0, 3.25, 15.0, 4.25 ] },
|
||||
"west": { "texture": "#handle", "uv": [ 8.0, 4.0, 9.0, 5.0 ] },
|
||||
"up": { "texture": "#handle", "uv": [ 2.0, 4.25, 7.0, 5.25 ] },
|
||||
"down": { "texture": "#handle", "uv": [ 8.5, 4.5, 13.5, 5.5 ] }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
"name": "BladeBack",
|
||||
"from": [ -5.9, 0.471, -0.182 ],
|
||||
"to": [ 0.0, 0.571, 1.008 ],
|
||||
"rotationOrigin": [ 0.0, 0.5, 0.5 ],
|
||||
"rotationX": -45.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 0.25 ], "enabled": false },
|
||||
"east": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false },
|
||||
"south": { "texture": "#blister_steel", "uv": [ 3.0, 2.75, 8.5, 3.0 ] },
|
||||
"west": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false },
|
||||
"up": { "texture": "#blister_steel", "uv": [ 7.0, 5.0, 12.5, 6.0 ] },
|
||||
"down": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 1.0 ], "enabled": false }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "BladeFront",
|
||||
"from": [ -5.9, 0.54, -0.25 ],
|
||||
"to": [ 0.0, 0.66, 0.95 ],
|
||||
"rotationOrigin": [ 0.0, 0.6, 0.5 ],
|
||||
"rotationX": -41.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 0.25 ], "enabled": false },
|
||||
"east": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false },
|
||||
"south": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 0.25 ], "enabled": false },
|
||||
"west": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false },
|
||||
"up": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 1.0 ], "enabled": false },
|
||||
"down": { "texture": "#blister_steel", "uv": [ 10.5, 7.0, 16.0, 8.0 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Slope1",
|
||||
"from": [ -7.089, -0.18, 0.42 ],
|
||||
"to": [ -5.589, 0.5, 0.52 ],
|
||||
"rotationOrigin": [ -5.7, 0.5, 0.5 ],
|
||||
"rotationX": 45.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#blister_steel", "uv": [ 1.0, 7.5, 2.5, 8.0 ], "rotation": 180 },
|
||||
"east": { "texture": "#blister_steel", "uv": [ 8.5, 5.0, 9.0, 5.5 ], "enabled": false },
|
||||
"south": { "texture": "#blister_steel", "uv": [ 6.5, 3.0, 8.0, 3.5 ], "enabled": false },
|
||||
"west": { "texture": "#blister_steel", "uv": [ 9.0, 3.5, 9.5, 4.0 ], "enabled": false },
|
||||
"up": { "texture": "#blister_steel", "uv": [ 8.0, 6.0, 9.5, 6.25 ], "enabled": false },
|
||||
"down": { "texture": "#blister_steel", "uv": [ 5.0, 3.5, 6.5, 3.75 ], "enabled": false }
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Slope2",
|
||||
"from": [ -7.24, 0.56, 0.43 ],
|
||||
"to": [ -5.65, 1.14, 0.487 ],
|
||||
"rotationOrigin": [ -5.5, 0.5, 0.5 ],
|
||||
"rotationX": 46.0,
|
||||
"rotationZ": 25.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#blister_steel", "uv": [ 1.0, 7.5, 2.5, 8.0 ], "rotation": 180 },
|
||||
"east": { "texture": "#blister_steel", "uv": [ 8.5, 5.0, 9.0, 5.5 ], "enabled": false },
|
||||
"south": { "texture": "#blister_steel", "uv": [ 6.5, 4.5, 8.0, 5.0 ] },
|
||||
"west": { "texture": "#blister_steel", "uv": [ 3.5, 5.5, 4.0, 6.0 ] },
|
||||
"up": { "texture": "#blister_steel", "uv": [ 3.0, 6.75, 4.5, 7.0 ] },
|
||||
"down": { "texture": "#blister_steel", "uv": [ 5.0, 3.5, 6.5, 3.75 ], "enabled": false }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]}
|
||||
|
|
@ -8,14 +8,14 @@
|
|||
"textureSizes": {
|
||||
},
|
||||
"textures": {
|
||||
"blister_steel": "fma:metal/blister_steel"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
"name": "card1",
|
||||
"from": [ 6.5, 0.0, 4.0 ],
|
||||
"to": [ 9.5, 2.0, 5.0 ],
|
||||
"from": [ 6.4, 0.0, 4.1 ],
|
||||
"to": [ 9.4, 2.0, 5.1 ],
|
||||
"rotationOrigin": [ 8.0, 0.0, 8.0 ],
|
||||
"rotationY": 3.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#blister_steel", "uv": [ 7.0, 6.0, 10.0, 8.0 ] },
|
||||
"east": { "texture": "#blister_steel", "uv": [ 5.5, 2.0, 6.5, 4.0 ] },
|
||||
|
|
@ -46,6 +46,7 @@
|
|||
"to": [ 9.5, 2.0, 7.5 ],
|
||||
"rotationOrigin": [ 8.0, 0.0, 8.0 ],
|
||||
"rotationX": -5.0,
|
||||
"rotationY": -6.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#blister_steel", "uv": [ 7.0, 6.0, 10.0, 8.0 ] },
|
||||
"east": { "texture": "#blister_steel", "uv": [ 6.0, 2.0, 7.0, 4.0 ] },
|
||||
|
|
@ -72,8 +73,8 @@
|
|||
},
|
||||
{
|
||||
"name": "card5",
|
||||
"from": [ 6.5, 0.0, 8.75 ],
|
||||
"to": [ 9.5, 2.0, 9.75 ],
|
||||
"from": [ 6.5, -0.1, 8.75 ],
|
||||
"to": [ 9.5, 1.9, 9.75 ],
|
||||
"rotationOrigin": [ 8.0, 0.0, 8.0 ],
|
||||
"rotationX": -7.0,
|
||||
"faces": {
|
||||
|
|
@ -87,8 +88,8 @@
|
|||
},
|
||||
{
|
||||
"name": "card6",
|
||||
"from": [ 6.5, 0.0, 10.0 ],
|
||||
"to": [ 9.5, 1.0, 12.0 ],
|
||||
"from": [ 6.5, 0.0, 9.9 ],
|
||||
"to": [ 9.5, 1.0, 11.9 ],
|
||||
"rotationOrigin": [ 8.0, 0.0, 7.0 ],
|
||||
"rotationY": -3.0,
|
||||
"faces": {
|
||||
|
|
@ -102,8 +103,8 @@
|
|||
},
|
||||
{
|
||||
"name": "card7",
|
||||
"from": [ 6.5, -2.5, 13.0 ],
|
||||
"to": [ 9.5, -0.5, 14.0 ],
|
||||
"from": [ 6.5, -2.5, 12.9 ],
|
||||
"to": [ 9.5, -0.5, 13.9 ],
|
||||
"rotationOrigin": [ 8.0, -2.0, 8.0 ],
|
||||
"rotationX": -28.0,
|
||||
"faces": {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
"textureSizes": {
|
||||
},
|
||||
"textures": {
|
||||
"steel-file": "fma:/metal/steel-file"
|
||||
},
|
||||
"elements": [
|
||||
{
|
||||
|
|
@ -17,12 +18,12 @@
|
|||
"rotationOrigin": [ 2.4, 0.48, 4.2 ],
|
||||
"rotationY": 5.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 4.5, 4.0, 6.5, 12.5 ], "rotation": 90, "autoUv": false },
|
||||
"east": { "texture": "#steel-file", "uv": [ 8.5, 9.5, 9.5, 10.0 ] },
|
||||
"south": { "texture": "#steel-file", "uv": [ 5.0, 6.5, 6.5, 14.5 ], "rotation": 90, "autoUv": false },
|
||||
"west": { "texture": "#steel-file", "uv": [ 8.5, 9.0, 9.5, 9.5 ] },
|
||||
"up": { "texture": "#steel-file", "uv": [ 4.0, 2.0, 5.5, 14.0 ], "rotation": 90, "autoUv": false },
|
||||
"down": { "texture": "#steel-file", "uv": [ 4.0, 1.5, 5.5, 13.5 ], "rotation": 270, "autoUv": false }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -30,12 +31,12 @@
|
|||
"from": [ -1.8, 0.0, 0.48 ],
|
||||
"to": [ 0.0, 0.09, 0.78 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.3, 0.3 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.3, 0.3 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 9.0, 9.5, 10.5, 10.0 ] },
|
||||
"east": { "texture": "#steel-file", "uv": [ 10.5, 9.5, 11.0, 10.0 ] },
|
||||
"south": { "texture": "#steel-file", "uv": [ 10.0, 11.5, 11.5, 12.0 ] },
|
||||
"west": { "texture": "#steel-file", "uv": [ 11.0, 10.5, 11.5, 11.0 ] },
|
||||
"up": { "texture": "#steel-file", "uv": [ 9.5, 11.0, 11.0, 11.5 ] },
|
||||
"down": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 11.0, 10.5 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -48,12 +49,12 @@
|
|||
"rotationX": -45.0,
|
||||
"rotationY": 1.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 5.5, 5.5, 6.5, 13.5 ], "rotation": 270, "autoUv": false },
|
||||
"east": { "texture": "#steel-file", "uv": [ 8.5, 8.5, 9.0, 9.0 ] },
|
||||
"south": { "texture": "#steel-file", "uv": [ 5.0, 5.0, 6.0, 13.0 ], "rotation": 90, "autoUv": false },
|
||||
"west": { "texture": "#steel-file", "uv": [ 7.5, 0.0, 8.5, 4.0 ], "autoUv": false },
|
||||
"up": { "texture": "#steel-file", "uv": [ 4.0, 4.5, 5.0, 13.5 ], "rotation": 90, "autoUv": false },
|
||||
"down": { "texture": "#steel-file", "uv": [ 5.5, 5.5, 6.5, 13.0 ], "rotation": 270, "autoUv": false }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -61,12 +62,12 @@
|
|||
"from": [ -1.8, 0.25, 0.2 ],
|
||||
"to": [ 0.0, 0.34, 0.5 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 10.5, 10.5, 12.0, 11.0 ] },
|
||||
"east": { "texture": "#steel-file", "uv": [ 10.0, 9.5, 10.5, 10.0 ] },
|
||||
"south": { "texture": "#steel-file", "uv": [ 10.0, 11.5, 11.5, 12.0 ] },
|
||||
"west": { "texture": "#steel-file", "uv": [ 10.0, 11.0, 10.5, 11.5 ] },
|
||||
"up": { "texture": "#steel-file", "uv": [ 9.0, 10.5, 10.5, 11.0 ] },
|
||||
"down": { "texture": "#steel-file", "uv": [ 9.0, 11.0, 10.5, 11.5 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -74,16 +75,16 @@
|
|||
{
|
||||
"name": "FileSurface3",
|
||||
"from": [ 7.4, 0.0, 11.2 ],
|
||||
"to": [ 15.2, 0.09, 12.4 ],
|
||||
"to": [ 15.2, 0.25, 12.4 ],
|
||||
"rotationOrigin": [ 5.0, 0.48, -1.0 ],
|
||||
"rotationY": -22.5,
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 7.5, 9.0, 12.5, 13.5 ], "enabled": false, "autoUv": false },
|
||||
"east": { "texture": "#steel-file", "uv": [ 7.5, 9.0, 13.0, 9.5 ], "autoUv": false },
|
||||
"south": { "texture": "#steel-file", "uv": [ 7.0, 8.0, 13.5, 15.0 ], "enabled": false, "autoUv": false },
|
||||
"west": { "texture": "#steel-file", "uv": [ 7.5, 10.0, 12.5, 10.5 ], "autoUv": false },
|
||||
"up": { "texture": "#steel-file", "uv": [ 8.5, 9.0, 13.0, 12.5 ], "enabled": false, "autoUv": false },
|
||||
"down": { "texture": "#steel-file", "uv": [ 4.0, 16.0, 6.5, 0.0 ], "rotation": 90, "autoUv": false }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -91,12 +92,12 @@
|
|||
"from": [ -1.8, 0.0, 0.5 ],
|
||||
"to": [ 0.0, 0.09, 0.8 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 10.0, 10.0, 11.5, 10.5 ] },
|
||||
"east": { "texture": "#steel-file", "uv": [ 10.5, 11.5, 11.0, 12.0 ] },
|
||||
"south": { "texture": "#steel-file", "uv": [ 10.0, 11.5, 11.5, 12.0 ] },
|
||||
"west": { "texture": "#steel-file", "uv": [ 11.5, 11.0, 12.0, 11.5 ] },
|
||||
"up": { "texture": "#steel-file", "uv": [ 10.0, 10.5, 11.5, 11.0 ] },
|
||||
"down": { "texture": "#steel-file", "uv": [ 10.0, 9.0, 11.5, 9.5 ] }
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -106,12 +107,12 @@
|
|||
"rotationOrigin": [ 0.0, 0.0, -0.05 ],
|
||||
"rotationX": -50.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"up": { "texture": "#metal", "uv": [ 2.5, 5.5, 10.0, 6.5 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false }
|
||||
"north": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"east": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"south": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"west": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"up": { "texture": "#steel-file", "uv": [ 4.5, 0.0, 6.5, 16.0 ], "rotation": 90, "autoUv": false },
|
||||
"down": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false }
|
||||
}
|
||||
},
|
||||
{
|
||||
|
|
@ -121,12 +122,12 @@
|
|||
"rotationOrigin": [ 0.0, 1.0, 0.05 ],
|
||||
"rotationX": 50.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"up": { "texture": "#metal", "uv": [ 2.5, 5.5, 10.0, 6.5 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false }
|
||||
"north": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"east": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"south": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false },
|
||||
"west": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false },
|
||||
"up": { "texture": "#steel-file", "uv": [ 4.0, 0.0, 6.5, 16.0 ], "rotation": 90, "autoUv": false },
|
||||
"down": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
@ -138,12 +139,12 @@
|
|||
"rotationOrigin": [ 2.4, 0.48, 4.2 ],
|
||||
"rotationY": -1.0,
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 5.0, 5.0, 5.5, 15.0 ], "rotation": 270, "autoUv": false },
|
||||
"east": { "texture": "#steel-file", "uv": [ 11.0, 12.0, 11.5, 12.5 ] },
|
||||
"south": { "texture": "#steel-file", "uv": [ 5.0, 4.0, 5.5, 15.0 ], "rotation": 90, "autoUv": false },
|
||||
"west": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 10.0, 10.5 ] },
|
||||
"up": { "texture": "#steel-file", "uv": [ 5.0, 3.0, 5.5, 15.0 ], "rotation": 90, "autoUv": false },
|
||||
"down": { "texture": "#steel-file", "uv": [ 5.0, 3.0, 5.5, 15.0 ], "rotation": 270, "autoUv": false }
|
||||
},
|
||||
"children": [
|
||||
{
|
||||
|
|
@ -151,12 +152,12 @@
|
|||
"from": [ -1.8, 0.125, 0.02 ],
|
||||
"to": [ 0.0, 0.215, 0.32 ],
|
||||
"faces": {
|
||||
"north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] },
|
||||
"up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] },
|
||||
"down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }
|
||||
"north": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 11.0, 10.5 ] },
|
||||
"east": { "texture": "#steel-file", "uv": [ 9.0, 9.5, 9.5, 10.0 ] },
|
||||
"south": { "texture": "#steel-file", "uv": [ 9.0, 10.0, 10.5, 10.5 ] },
|
||||
"west": { "texture": "#steel-file", "uv": [ 9.0, 10.5, 9.5, 11.0 ] },
|
||||
"up": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 11.0, 10.5 ] },
|
||||
"down": { "texture": "#steel-file", "uv": [ 10.5, 9.5, 12.0, 10.0 ] }
|
||||
}
|
||||
}
|
||||
]
|
||||
|
|
|
|||
BIN
ElementalTools/assets/fma/textures/liquids/liquid_oil.png
Normal file
BIN
ElementalTools/assets/fma/textures/liquids/liquid_oil.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 639 B |
BIN
ElementalTools/assets/fma/textures/metal/black_iron2.png
Normal file
BIN
ElementalTools/assets/fma/textures/metal/black_iron2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.6 KiB |
BIN
ElementalTools/assets/fma/textures/metal/steel-file.png
Normal file
BIN
ElementalTools/assets/fma/textures/metal/steel-file.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
|
|
@ -1,13 +1,13 @@
|
|||
{
|
||||
"type": "code",
|
||||
"name": "Era of STEEL.",
|
||||
"description" : "Anchient techniques for making STEEL, in your very own forge - today!",
|
||||
"description" : "The OLD technique for making steel items and Quench-Hardening them.",
|
||||
"authors": ["Melchior"],
|
||||
"ModID":"eraofsteel",
|
||||
"version": "0.1.2",
|
||||
"version": "0.1.4",
|
||||
"dependencies": {
|
||||
"game": "1.13.4",
|
||||
"game": "1.17.0",
|
||||
"survival": ""
|
||||
},
|
||||
"website": "http://nowebsite.nope"
|
||||
"website": ""
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue