First Machine Age's Mods (Combined repo.)
Révision | c86f9c4a6ec8cd759f975b474320cdf8d62502ed (tree) |
---|---|
l'heure | 2022-11-27 05:25:16 |
Auteur | melchior <melchior@user...> |
Commiter | melchior |
Elemental Tools; work backlog
@@ -19,6 +19,7 @@ namespace ElementalTools | ||
19 | 19 | internal const string malletItemKey = @"ItemMallet"; |
20 | 20 | internal const string sharpeningStoneItemKey = @"ItemSharpening_stone"; |
21 | 21 | internal const string SteelPrefix = @"Steel";//Generic 'steel' of Unknown province... |
22 | + internal const string consolidatableCardsKey = @"ConsolidatableCards"; | |
22 | 23 | |
23 | 24 | internal const string pack_carburizationBlockKey = @"pack_carburization"; |
24 | 25 | internal const string pack_stateFired = @"fired"; |
@@ -47,20 +48,25 @@ namespace ElementalTools | ||
47 | 48 | { |
48 | 49 | CoreAPI.RegisterItemClass(malletItemKey, typeof(ItemMallet)); |
49 | 50 | CoreAPI.RegisterItemClass(sharpeningStoneItemKey, typeof(ItemSharpeningStone)); |
50 | - | |
51 | + | |
52 | + CoreAPI.RegisterItemClass(consolidatableCardsKey, typeof(ItemConsolidatableCards)); | |
53 | + | |
54 | + //stock VS steel'ified classes | |
55 | + CoreAPI.RegisterItemClass(@"Steel_Item", typeof(GenericSteelItem)); | |
56 | + | |
51 | 57 | //Steel Wrapped ItemCores. |
52 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<Item>), SteelPrefix); | |
53 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemSword>), SteelPrefix ); | |
54 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemChisel>), SteelPrefix); | |
55 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemAxe>), SteelPrefix); | |
56 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemSpear>), SteelPrefix); | |
57 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemCleaver>), SteelPrefix); | |
58 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemHammer>), SteelPrefix); | |
59 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemHoe>), SteelPrefix); | |
60 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemKnife>), SteelPrefix); | |
61 | - CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrap<ItemProspectingPick>), SteelPrefix); | |
62 | - CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemScythe>), SteelPrefix); | |
63 | - CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemShears>), SteelPrefix); | |
58 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<Item>), SteelPrefix); | |
59 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemSword>), SteelPrefix ); | |
60 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemChisel>), SteelPrefix); | |
61 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemAxe>), SteelPrefix); | |
62 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemSpear>), SteelPrefix); | |
63 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemCleaver>), SteelPrefix); | |
64 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemHammer>), SteelPrefix); | |
65 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemHoe>), SteelPrefix); | |
66 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemKnife>), SteelPrefix); | |
67 | + //CoreAPI.NamePrefixed_RegisterItemClass( typeof(SteelWrapItem<ItemProspectingPick>), SteelPrefix); | |
68 | + //CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrapItem<ItemScythe>), SteelPrefix); | |
69 | + //CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrapItem<ItemShears>), SteelPrefix); | |
64 | 70 | //CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemSaw>), SteelPrefix); |
65 | 71 | //CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemShovel>), SteelPrefix); |
66 | 72 | //CoreAPI.NamePrefixed_RegisterItemClass(typeof(SteelWrap<ItemArrow>), SteelPrefix);//Merging of Steel ammo - TODO! |
@@ -195,7 +201,7 @@ namespace ElementalTools | ||
195 | 201 | |
196 | 202 | } |
197 | 203 | |
198 | - private void GenerateSteelToolEquivalentGridRecipies( ) | |
204 | + private void GenerateSteelToolEquivalentGridRecipies( )//Revisit! | |
199 | 205 | { |
200 | 206 | uint results = 0; |
201 | 207 | var ironTools = new string[ ]{ |
@@ -336,7 +342,7 @@ namespace ElementalTools | ||
336 | 342 | |
337 | 343 | /**** Terminology ************* |
338 | 344 | * Wrought Iron -> Blister Steel [Pack carburization / Cementation ] |
339 | - * Blister Steel -> Shear Steel [Smithing (Welding) ] | |
345 | + * Blister Steel -> Shear Steel [Smithing (Welding/Consolidation) ] | |
340 | 346 | * Shear Steel -> Cast Steel [ Bessemer process / Open-hearth /.... ] |
341 | 347 | * Pig Iron -> Cast Iron [ Blast furnace / .... ] |
342 | 348 | * Cast Iron -> Steel-clad Cast Iron [ "fining" furnace; Decarburization, re-heat in air @900C] |
@@ -352,6 +358,8 @@ attributes: { | ||
352 | 358 | }, |
353 | 359 | |
354 | 360 | * Item: Sickle - 2x2 hand-held harvest tool (works on reeds, crops, grass, any plants) |
361 | +* Item: Mattock - Half Pickaxe, Half Shovel; All-Tool. | |
362 | +* Item: Seax - larger stabbier Knife, thats still a knife. | |
355 | 363 | * Sort out how Arrow's work with item merging... |
356 | 364 | |
357 | 365 | ******************************/ |
@@ -8,13 +8,15 @@ using Vintagestory.API.Config; | ||
8 | 8 | using Vintagestory.API.Datastructures; |
9 | 9 | using Vintagestory.API.MathTools; |
10 | 10 | using Vintagestory.GameContent; |
11 | +using Vintagestory.API.Client; | |
12 | + | |
11 | 13 | |
12 | 14 | namespace ElementalTools |
13 | 15 | { |
14 | 16 | /// <summary> |
15 | 17 | ///Breakable Carburization 'box'; for Steel making. |
16 | 18 | /// </summary> |
17 | - public class PackCarburization : BlockContainer | |
19 | + public class PackCarburization : BlockContainer, IInFirepitRendererSupplier | |
18 | 20 | { |
19 | 21 | public const string steelTransitionTempKey = @"SteelTransitionTemp"; |
20 | 22 | public const string steelTransitionTimeKey = @"SteelTransitionTime"; |
@@ -388,6 +390,20 @@ namespace ElementalTools | ||
388 | 390 | return Lang.Get(this.Code.Domain +":block-"+this.Code.Path);//Domain needed... |
389 | 391 | } |
390 | 392 | |
393 | + #region Firepit | |
394 | + | |
395 | + public IInFirepitRenderer GetRendererWhenInFirepit(ItemStack stack, BlockEntityFirepit firepit, bool forOutputSlot) | |
396 | + { | |
397 | + return new PackCarburization_Renderer(this.api as ICoreClientAPI, stack, firepit.Pos, forOutputSlot); | |
398 | + } | |
399 | + | |
400 | + public EnumFirepitModel GetDesiredFirepitModel(ItemStack stack, BlockEntityFirepit firepit, bool forOutputSlot) | |
401 | + { | |
402 | + return EnumFirepitModel.Normal;//Or Wide? | |
403 | + } | |
404 | + | |
405 | + #endregion | |
406 | + | |
391 | 407 | private void SetOutputOverride(ItemStack containerStack, string overrideCode) |
392 | 408 | { |
393 | 409 | if (!string.IsNullOrEmpty(overrideCode)) { |
@@ -413,6 +429,8 @@ namespace ElementalTools | ||
413 | 429 | } |
414 | 430 | return 0; |
415 | 431 | } |
432 | + | |
433 | + | |
416 | 434 | } |
417 | 435 | } |
418 | 436 |
@@ -49,7 +49,7 @@ namespace ElementalTools | ||
49 | 49 | this.Temperature -= 1f;//Rain? Compute vs. ambient temp / biome, on snow/ice... |
50 | 50 | } |
51 | 51 | |
52 | - if (!internalInventory.IsEmpty) { | |
52 | + if (!internalInventory.Empty) { | |
53 | 53 | foreach (ItemSlot slot in internalInventory) { |
54 | 54 | |
55 | 55 | if (slot.Empty) continue; |
@@ -77,7 +77,7 @@ namespace ElementalTools | ||
77 | 77 | */ |
78 | 78 | dsc.Append("Contents: \n"); |
79 | 79 | |
80 | - if (internalInventory.IsEmpty) { | |
80 | + if (internalInventory.Empty) { | |
81 | 81 | dsc.Append("Nothing.\n"); |
82 | 82 | } |
83 | 83 | else { |
@@ -8,8 +8,7 @@ using System.Text; | ||
8 | 8 | using Vintagestory.API.Common; |
9 | 9 | using Vintagestory.API.Datastructures; |
10 | 10 | |
11 | -namespace ElementalTools | |
12 | -{ | |
11 | + | |
13 | 12 | [StructLayout(LayoutKind.Explicit, Size = 4, Pack = 1)] |
14 | 13 | public struct RGBAColor_Int32 |
15 | 14 | { |
@@ -97,5 +96,5 @@ namespace ElementalTools | ||
97 | 96 | |
98 | 97 | |
99 | 98 | |
100 | -} | |
99 | + | |
101 | 100 |
@@ -7,7 +7,7 @@ | ||
7 | 7 | <OutputType>Library</OutputType> |
8 | 8 | <RootNamespace>ElementalTools</RootNamespace> |
9 | 9 | <AssemblyName>ElementalTools</AssemblyName> |
10 | - <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> | |
10 | + <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion> | |
11 | 11 | </PropertyGroup> |
12 | 12 | <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> |
13 | 13 | <DebugSymbols>true</DebugSymbols> |
@@ -20,7 +20,7 @@ | ||
20 | 20 | <ConsolePause>false</ConsolePause> |
21 | 21 | <CustomCommands> |
22 | 22 | <CustomCommands> |
23 | - <Command type="AfterBuild" command="7z -tzip a EraOfSteel_${ProjectConfig}.zip" workingdir="${TargetDir}" /> | |
23 | + <Command type="AfterBuild" command="7z a -tzip -x!*.zip -aoa ${ProjectName}_${ProjectConfig}.zip" workingdir="${TargetDir}" /> | |
24 | 24 | <Command type="AfterClean" command="rm -f *.zip" workingdir="${TargetDir}" /> |
25 | 25 | </CustomCommands> |
26 | 26 | </CustomCommands> |
@@ -62,6 +62,10 @@ | ||
62 | 62 | <HintPath>vs_libs\VSSurvivalMod.dll</HintPath> |
63 | 63 | <Private>False</Private> |
64 | 64 | </Reference> |
65 | + <Reference Include="0Harmony"> | |
66 | + <HintPath>vs_libs\0Harmony.dll</HintPath> | |
67 | + <Private>False</Private> | |
68 | + </Reference> | |
65 | 69 | </ItemGroup> |
66 | 70 | <ItemGroup> |
67 | 71 | <Compile Include="ElementalToolsMod.cs" /> |
@@ -73,12 +77,19 @@ | ||
73 | 77 | <Compile Include="Block\PackCarburization.cs" /> |
74 | 78 | <Compile Include="BlockEntities\PackCarburizationEntity.cs" /> |
75 | 79 | <Compile Include="Helpers.cs" /> |
76 | - <Compile Include="General\IAmSteel.cs" /> | |
77 | - <Compile Include="Items\SteeIWrapItem.cs" /> | |
80 | + <Compile Include="General\ISteelByStack.cs" /> | |
78 | 81 | <Compile Include="Items\ItemSharpeningStone.cs" /> |
79 | 82 | <Compile Include="Items\VariableWearRateTool.cs" /> |
80 | 83 | <Compile Include="ColorHelper.cs" /> |
81 | 84 | <Compile Include="General\SteelAssist.cs" /> |
85 | + <Compile Include="Renderers\PackCarburization_Renderer.cs" /> | |
86 | + <Compile Include="General\ISteelThingInstance.cs" /> | |
87 | + <Compile Include="General\SteelThingViaStack.cs" /> | |
88 | + <Compile Include="Items\ItemConsolidatableCards.cs" /> | |
89 | + <Compile Include="Items\Steel\SteeIWrapItem.cs" /> | |
90 | + <Compile Include="Items\Steel\GenericSteelItem.cs" /> | |
91 | + <Compile Include="General\ISteelBase.cs" /> | |
92 | + <Compile Include="General\SteelAspects.cs" /> | |
82 | 93 | </ItemGroup> |
83 | 94 | <ItemGroup> |
84 | 95 | <Folder Include="Items\" /> |
@@ -107,6 +118,10 @@ | ||
107 | 118 | <Folder Include="assets\fma\itemtypes\arms\heads\" /> |
108 | 119 | <Folder Include="assets\fma\recipes\smithing\" /> |
109 | 120 | <Folder Include="assets\fma\recipes\grid\weapon\" /> |
121 | + <Folder Include="Renderers\" /> | |
122 | + <Folder Include="assets\fma\shapes\block\metal\" /> | |
123 | + <Folder Include="assets\fma\textures\liquids\" /> | |
124 | + <Folder Include="Items\Steel\" /> | |
110 | 125 | </ItemGroup> |
111 | 126 | <ItemGroup> |
112 | 127 | <None Include="modinfo.json"> |
@@ -304,6 +319,16 @@ | ||
304 | 319 | <None Include="assets\fma\shapes\item\tools\drawplate.json"> |
305 | 320 | <CopyToOutputDirectory>Always</CopyToOutputDirectory> |
306 | 321 | </None> |
322 | + <None Include="assets\fma\blocktypes\metal\crusie_lamp.json" /> | |
323 | + <None Include="assets\fma\textures\metal\black_iron2.png" /> | |
324 | + <None Include="assets\fma\textures\liquids\liquid_oil.png" /> | |
325 | + <None Include="assets\fma\itemtypes\metallurgy\metal_cards.json"> | |
326 | + <CopyToOutputDirectory>Always</CopyToOutputDirectory> | |
327 | + </None> | |
328 | + <None Include="assets\fma\recipes\smithing\metal_cards.json" /> | |
329 | + <None Include="assets\fma\shapes\item\arms\seax.json"> | |
330 | + <CopyToOutputDirectory>Always</CopyToOutputDirectory> | |
331 | + </None> | |
307 | 332 | </ItemGroup> |
308 | 333 | <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> |
309 | 334 | </Project> |
\ No newline at end of file |
@@ -63,11 +63,16 @@ namespace ElementalTools | ||
63 | 63 | return; |
64 | 64 | } |
65 | 65 | |
66 | - ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, PostLoadTweaks); | |
66 | + //ServerCore.Event.ServerRunPhase(EnumServerRunPhase.GameReady, PostLoadTweaks); | |
67 | 67 | |
68 | 68 | Mod.Logger.VerboseDebug("The ERA of STEEL Begins!"); |
69 | 69 | } |
70 | 70 | |
71 | + public override void AssetsFinalize(ICoreAPI api) | |
72 | + { | |
73 | + PostLoadTweaks( ); | |
74 | + } | |
75 | + | |
71 | 76 | public override void StartClientSide(ICoreClientAPI api) |
72 | 77 | { |
73 | 78 | this.ClientAPI = api; |
@@ -94,7 +99,7 @@ namespace ElementalTools | ||
94 | 99 | /// <returns>The load tweaks.</returns> |
95 | 100 | private void PostLoadTweaks( ) |
96 | 101 | { |
97 | - Mod.Logger.Notification("Making a few changes to recipes..."); | |
102 | + Mod.Logger.Notification("Making a few changes & additions to recipes..."); | |
98 | 103 | |
99 | 104 | #if DEBUG |
100 | 105 | Mod.Logger.VerboseDebug($"Total GridRecipies: {CoreAPI.World.GridRecipes.Count}"); |
@@ -0,0 +1,20 @@ | ||
1 | +using System; | |
2 | +namespace ElementalTools | |
3 | +{ | |
4 | + /// <summary> | |
5 | + /// General 'Steel' base properties [unchangeing/immutable] | |
6 | + /// </summary> | |
7 | + public interface ISteelBase | |
8 | + { | |
9 | + | |
10 | + //Static read-only properties from Item Def. | |
11 | + string BaseMetalName { get; }//Blister, Shear, Cast, Damascus, Wootz, Stainless | |
12 | + bool Sharpenable { get; } | |
13 | + bool Hardenable { get; } | |
14 | + //Fracture rate? | |
15 | + //Rust resistance? | |
16 | + | |
17 | + | |
18 | + } | |
19 | +} | |
20 | + |
@@ -4,15 +4,11 @@ using Vintagestory.API.Common; | ||
4 | 4 | |
5 | 5 | namespace ElementalTools |
6 | 6 | { |
7 | - public interface IAmSteel | |
7 | + public interface ISteelByStack | |
8 | 8 | { |
9 | - //Static read-only properties from Item Def. | |
10 | - string Name { get; }//Blister, Shear, Cast, Damascus, Wootz...mostly descriptive | |
11 | - bool Sharpenable { get; } | |
12 | - bool Hardenable { get; } | |
9 | + | |
10 | + //Rusty? | |
13 | 11 | |
14 | - //Rust? | |
15 | - //Fracture rate? | |
16 | 12 | |
17 | 13 | /// <summary> |
18 | 14 | /// Read Sharpness; Dynamic properties from ItemStack - attribs |
@@ -59,7 +55,7 @@ namespace ElementalTools | ||
59 | 55 | /// </summary> |
60 | 56 | /// <param name="donor">From here</param> |
61 | 57 | /// <param name="recipient">To here.</param> |
62 | - void CopyAttributes(ItemStack donor, ItemStack recipient); | |
58 | + void CopyStackAttributes(ItemStack donor, ItemStack recipient); | |
63 | 59 | } |
64 | 60 | |
65 | 61 | /// <summary> |
@@ -0,0 +1,44 @@ | ||
1 | +using System; | |
2 | + | |
3 | +using Vintagestory.API.Common; | |
4 | + | |
5 | +namespace ElementalTools | |
6 | +{ | |
7 | + public interface ISteelThingInstance | |
8 | + { | |
9 | + //Rusty? | |
10 | + | |
11 | + /// <summary> | |
12 | + /// Read Sharpness; Dynamic properties from ItemStack - attribs | |
13 | + /// </summary> | |
14 | + SharpnessState Sharpness { get; set; } | |
15 | + | |
16 | + /// <summary> | |
17 | + /// Incriments the sharpness. | |
18 | + /// </summary> | |
19 | + /// <returns>The sharpness.</returns> | |
20 | + SharpnessState Sharpen(); | |
21 | + | |
22 | + /// <summary> | |
23 | + /// Reduce the sharpness. | |
24 | + /// </summary> | |
25 | + SharpnessState Dull(); | |
26 | + | |
27 | + /// <summary> | |
28 | + /// Set Hardness | |
29 | + /// </summary> | |
30 | + HardnessState Hardness{ get; set; } | |
31 | + | |
32 | + /// <summary> | |
33 | + /// Harden (incriment) this collectable. | |
34 | + /// </summary> | |
35 | + HardnessState Harden(); | |
36 | + | |
37 | + /// <summary> | |
38 | + /// Clones the stack attributes ONTO Target. (used when sharpening) | |
39 | + /// </summary> | |
40 | + /// <returns>The stack attributes.</returns> | |
41 | + /// <param name="target">Subject of stack-attribute (overwrite).</param> | |
42 | + void CloneStackAttributes(ItemStack target); | |
43 | + } | |
44 | +} | |
\ No newline at end of file |
@@ -0,0 +1,593 @@ | ||
1 | +using System; | |
2 | +using System.Linq; | |
3 | +using System.Text; | |
4 | + | |
5 | +using HarmonyLib; | |
6 | + | |
7 | +using Vintagestory.API.Common; | |
8 | +using Vintagestory.API.Common.Entities; | |
9 | +using Vintagestory.API.Config; | |
10 | +using Vintagestory.API.MathTools; | |
11 | +using Vintagestory.GameContent; | |
12 | + | |
13 | +namespace ElementalTools | |
14 | +{ | |
15 | + | |
16 | + public static class SteelAspects | |
17 | + { | |
18 | + | |
19 | + internal const string _timestampKey = @"timestamp"; | |
20 | + public const string hardenableKeyword = @"hardenable"; | |
21 | + public const string sharpenableKeyword = @"sharpenable"; | |
22 | + public const string metalNameKeyword = @"metalName"; | |
23 | + public const string hardnessKeyword = @"hardness"; | |
24 | + public const string sharpnessKeyword = @"sharpness"; | |
25 | + public const string durabilityKeyword = @"durability"; | |
26 | + public const float eutectoid_transition_temperature = 727f;//Celcius | |
27 | + public const float quenchTimeConstant = 180f; | |
28 | + public const float quench_min_temperature = 450f;//Celcius | |
29 | + | |
30 | + public static readonly BGRAColor_Int32 color_Rough = new BGRAColor_Int32(0xFF, 0x66, 0x00); | |
31 | + public static readonly BGRAColor_Int32 color_Dull = new BGRAColor_Int32(0xFF, 0xBE, 0x00); | |
32 | + public static readonly BGRAColor_Int32 color_Honed = new BGRAColor_Int32(0xE8, 0xFF, 0x00); | |
33 | + public static readonly BGRAColor_Int32 color_Keen = new BGRAColor_Int32(0x7D, 0xFF, 0x00); | |
34 | + public static readonly BGRAColor_Int32 color_Sharp = new BGRAColor_Int32(0x00, 0xFF, 0x12); | |
35 | + public static readonly BGRAColor_Int32 color_Razor = new BGRAColor_Int32(0x00, 0xFF, 0xD7); | |
36 | + public static readonly BGRAColor_Int32 color_Default = new BGRAColor_Int32(0xFF, 0x00, 0x00); | |
37 | + | |
38 | + /// <summary> | |
39 | + /// Match against:Variant(s){ metal, material } == 'iron' | |
40 | + /// </summary> | |
41 | + /// <returns>The ferric metal.</returns> | |
42 | + /// <param name="something">Something collectable.</param> | |
43 | + public static bool IsFerricMetal(this CollectibleObject something) | |
44 | + { | |
45 | + return something.Variant.KeyValueMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.IronNameKey) || | |
46 | + something.Variant.KeyValueMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.IronNameKey); | |
47 | + } | |
48 | + | |
49 | + /// <summary> | |
50 | + /// Match against:Variant(s){ metal, material } == 'steel' | |
51 | + /// </summary> | |
52 | + /// <returns>The Steel metal. </returns> | |
53 | + /// <param name="something">Something collectable.</param> | |
54 | + public static bool IsSteelMetal(this CollectibleObject something) | |
55 | + { | |
56 | + return something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.SteelNameKey) || | |
57 | + something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.SteelNameKey); | |
58 | + } | |
59 | + | |
60 | + /// <summary> | |
61 | + /// Using ItemSharpener class.... | |
62 | + /// </summary> | |
63 | + /// <returns>If a sharpener.</returns> | |
64 | + /// <param name="something">Something.</param> | |
65 | + public static bool IsSharpener(this CollectibleObject something) | |
66 | + { | |
67 | + return String.Equals(something.Class, ElementalToolsSystem.sharpeningStoneItemKey, StringComparison.Ordinal); | |
68 | + } | |
69 | + | |
70 | + /// <summary> | |
71 | + /// Has Edge that can wear down... | |
72 | + /// </summary> | |
73 | + /// <returns>The impliment.</returns> | |
74 | + /// <param name="what">What.</param> | |
75 | + public static bool EdgedImpliment(this EnumTool? what) | |
76 | + { | |
77 | + if (what != null || what.HasValue && ( | |
78 | + what == EnumTool.Axe || | |
79 | + what == EnumTool.Chisel || | |
80 | + what == EnumTool.Hoe || | |
81 | + what == EnumTool.Knife || | |
82 | + what == EnumTool.Pickaxe || | |
83 | + what == EnumTool.Saw || | |
84 | + what == EnumTool.Scythe || | |
85 | + what == EnumTool.Shears || | |
86 | + what == EnumTool.Sickle || | |
87 | + what == EnumTool.Spear || | |
88 | + what == EnumTool.Sword) | |
89 | + ) { | |
90 | + return true; | |
91 | + } | |
92 | + return false; | |
93 | + } | |
94 | + | |
95 | + /// <summary> | |
96 | + /// Consider this as Weaspon ONLY (Axe being the special exception) | |
97 | + /// </summary> | |
98 | + /// <returns>The impliment.</returns> | |
99 | + /// <param name="what">What.</param> | |
100 | + public static bool Weapons(this EnumTool? what) | |
101 | + { | |
102 | + if (what != null || what.HasValue && ( | |
103 | + what == EnumTool.Axe || //Arguable | |
104 | + what == EnumTool.Bow || | |
105 | + what == EnumTool.Knife || | |
106 | + what == EnumTool.Spear || | |
107 | + what == EnumTool.Sling || | |
108 | + what == EnumTool.Sword) | |
109 | + ) { | |
110 | + return true; | |
111 | + } | |
112 | + return false; | |
113 | + } | |
114 | + | |
115 | + /// <summary> | |
116 | + /// Consider this as Tools ONLY (Axe being the special exception) | |
117 | + /// </summary> | |
118 | + /// <returns>The impliment.</returns> | |
119 | + /// <param name="what">What.</param> | |
120 | + public static bool Tools(this EnumTool? what) | |
121 | + { | |
122 | + if (what != null || what.HasValue && ( | |
123 | + what == EnumTool.Axe || //Arguable | |
124 | + what == EnumTool.Hammer|| | |
125 | + what == EnumTool.Hoe || | |
126 | + what == EnumTool.Chisel || | |
127 | + what == EnumTool.Drill || | |
128 | + what == EnumTool.Meter || | |
129 | + what == EnumTool.Pickaxe || | |
130 | + what == EnumTool.Probe || | |
131 | + what == EnumTool.Saw || | |
132 | + what == EnumTool.Scythe || | |
133 | + what == EnumTool.Shears || | |
134 | + what == EnumTool.Shovel || | |
135 | + what == EnumTool.Sickle || | |
136 | + what == EnumTool.Wrench | |
137 | + ) | |
138 | + ) { | |
139 | + return true; | |
140 | + } | |
141 | + return false; | |
142 | + } | |
143 | + | |
144 | + public static bool RecomendedUsage(this Item item, EnumBlockMaterial blockMaterial) | |
145 | + { | |
146 | + if (item.MiningSpeed != null && item.MiningSpeed.ContainsKey(blockMaterial)) return true; | |
147 | + return false; | |
148 | + } | |
149 | + | |
150 | + public static SteelThingViaStack AsSteelThing(this IItemStack someStack) | |
151 | + { | |
152 | + if (someStack.Class == EnumItemClass.Item && someStack.Item is ISteelBase) { | |
153 | + return new SteelThingViaStack(someStack); | |
154 | + } | |
155 | + | |
156 | + return null; | |
157 | + } | |
158 | + | |
159 | + public static void SetHitpoints(IItemStack recipient, int wearLevel) | |
160 | + { | |
161 | + recipient.Attributes.SetInt(SteelAspects.durabilityKeyword, wearLevel); | |
162 | + } | |
163 | + | |
164 | + #region Common Steel Methods | |
165 | + | |
166 | + public static void GetHeldItemInfo(ICoreAPI api, ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo) | |
167 | + { | |
168 | + if (inSlot == null || inSlot.Empty || inSlot.Inventory == null) { | |
169 | + #if DEBUG | |
170 | + api.World.Logger.Warning("GetHeldItemInfo -> Invetory / slot / stack: FUBAR!"); | |
171 | + #endif | |
172 | + return; | |
173 | + } | |
174 | + var steelInfo = inSlot.Itemstack.AsSteelThing( ); | |
175 | + | |
176 | + dsc.AppendFormat(Lang.Get(@"prop-metal", Lang.GetUnformatted(@"metalname-" + steelInfo.BaseMetalName))); | |
177 | + | |
178 | + if (steelInfo.Hardenable || steelInfo.Hardness != HardnessState.Soft) { | |
179 | + dsc.AppendFormat(Lang.Get(@"prop-temper", Lang.GetUnformatted(@"hardness-" + (int)steelInfo.Hardness))); | |
180 | + } | |
181 | + | |
182 | + if (steelInfo.Sharpenable) { | |
183 | + dsc.AppendFormat(Lang.Get(@"prop-edge", Lang.GetUnformatted(@"sharpness-" + ( int )steelInfo.Sharpness))); | |
184 | + } | |
185 | + | |
186 | + } | |
187 | + | |
188 | + /// <summary> | |
189 | + /// For; Quench-hardening...(in fluid) | |
190 | + /// </summary> | |
191 | + /// <param name="entityItem">Entity item.(Itself)</param> | |
192 | + public static void QuenchHarden(ISteelBase steelBased, EntityItem entityItem, ICoreAPI api) | |
193 | + { | |
194 | + if (api.Side.IsServer( ) && (entityItem.Swimming || entityItem.FeetInLiquid)) { | |
195 | + | |
196 | + if (!steelBased.Hardenable) return; | |
197 | + | |
198 | + float temperature = entityItem.Itemstack.Collectible.GetTemperature(api.World, entityItem.Itemstack); | |
199 | + //Track first moment in liquid; | |
200 | + SteelAspects.SetTimestamp(entityItem);//Need to clear when NORMALIZING. | |
201 | + | |
202 | + //temperature <= eutectoid_transition_temperature || | |
203 | + if (temperature >= quench_min_temperature) { | |
204 | + //TODO: Thermal capacity & Transfer coefficients for NON-Water fluids...and surfaces too! | |
205 | + var elapsedTime = SteelAspects.GetTimestampElapsed(entityItem); | |
206 | + | |
207 | + uint quenchUnits = ( uint )Math.Round(elapsedTime.TotalMilliseconds / quenchTimeConstant, 0); | |
208 | + | |
209 | + var steelThing = entityItem.Itemstack.AsSteelThing(); | |
210 | + | |
211 | + if (quenchUnits < ( uint )HardnessState.Brittle) { | |
212 | + steelThing.Hardness = ( HardnessState )quenchUnits; | |
213 | + } | |
214 | + else { | |
215 | + steelThing.Hardness = HardnessState.Brittle; | |
216 | + } | |
217 | + | |
218 | + //Being that water conducts heat well - reduce Temperature _FASTER_ | |
219 | + entityItem.Itemstack.Collectible.SetTemperature(api.World, entityItem.Itemstack, temperature - 15, false); | |
220 | + | |
221 | + #if DEBUG | |
222 | + api.World.Logger.VerboseDebug("Quench process: {0}S elapsed @{1}C H:{2} ~ QU#{3}", elapsedTime.TotalSeconds, temperature, steelThing.Hardness, quenchUnits); | |
223 | + #endif | |
224 | + } | |
225 | + } | |
226 | + } | |
227 | + | |
228 | + public static float AttackPower(ISteelBase steelBased, IItemStack withItemStack, ICoreAPI api) | |
229 | + { | |
230 | + var defaultPower = withItemStack.Item.AttackPower; | |
231 | + var steelThing = withItemStack.AsSteelThing( ); | |
232 | + | |
233 | + if (steelBased.Sharpenable && withItemStack.Item.Tool.EdgedImpliment() ) { | |
234 | + var sharpness = steelThing.Sharpness; | |
235 | + float pctBoost = 0;//CONSIDER: Perhaps make this external? | |
236 | + | |
237 | + switch (sharpness) { | |
238 | + case SharpnessState.Rough: | |
239 | + pctBoost = -0.25f; | |
240 | + break; | |
241 | + case SharpnessState.Dull: | |
242 | + pctBoost = -0.20f; | |
243 | + break; | |
244 | + case SharpnessState.Honed: | |
245 | + pctBoost = 0.10f; | |
246 | + break; | |
247 | + case SharpnessState.Keen: | |
248 | + pctBoost = 0.15f; | |
249 | + break; | |
250 | + case SharpnessState.Sharp: | |
251 | + pctBoost = 0.20f; | |
252 | + break; | |
253 | + case SharpnessState.Razor: | |
254 | + pctBoost = 0.25f; | |
255 | + break; | |
256 | + } | |
257 | + | |
258 | + return defaultPower + (pctBoost * defaultPower); | |
259 | + } | |
260 | + | |
261 | + return defaultPower; | |
262 | + } | |
263 | + | |
264 | + public static float MiningSpeed(IItemStack itemStack, BlockSelection blockSel, Block block, IPlayer forPlayer, ICoreAPI api) | |
265 | + { | |
266 | + var baseSpeed = 1f; | |
267 | + var steelThing = itemStack.AsSteelThing( ); | |
268 | + var item = itemStack.Item; | |
269 | + | |
270 | + //Boost for Edged tools / weapons | |
271 | + if (item.MiningSpeed != null && item.MiningSpeed.ContainsKey(block.BlockMaterial) && item.Tool.EdgedImpliment( )) { | |
272 | + | |
273 | + baseSpeed = item.MiningSpeed[block.BlockMaterial] * GlobalConstants.ToolMiningSpeedModifier; | |
274 | + | |
275 | + float pctBoost = 0f; | |
276 | + switch (steelThing.Sharpness) { | |
277 | + case SharpnessState.Rough: | |
278 | + pctBoost = -0.35f; | |
279 | + break; | |
280 | + case SharpnessState.Dull: | |
281 | + pctBoost = -0.20f; | |
282 | + break; | |
283 | + case SharpnessState.Honed: | |
284 | + pctBoost = 0.10f; | |
285 | + break; | |
286 | + case SharpnessState.Keen: | |
287 | + pctBoost = 0.20f; | |
288 | + break; | |
289 | + case SharpnessState.Sharp: | |
290 | + pctBoost = 0.25f; | |
291 | + break; | |
292 | + case SharpnessState.Razor: | |
293 | + pctBoost = 0.30f; | |
294 | + break; | |
295 | + } | |
296 | + | |
297 | + return baseSpeed + (pctBoost * baseSpeed); | |
298 | + } | |
299 | + | |
300 | + return baseSpeed; | |
301 | + } | |
302 | + | |
303 | + public static void WhenUsedInAttack(IWorldAccessor world, Entity byEntity, Entity attackedEntity, ItemSlot itemslot, ICoreAPI api) | |
304 | + { | |
305 | + var item = itemslot.Itemstack.Item; | |
306 | + bool edged = item.Tool.EdgedImpliment(); | |
307 | + bool weapon = item.Tool.Weapons(); | |
308 | + var steelThing = itemslot.Itemstack.AsSteelThing( ); | |
309 | + | |
310 | + //Only called for attacks on ENTITIES. Scen# 1 - 4 here. | |
311 | + #if DEBUG | |
312 | + api.World.Logger.VerboseDebug($"OnAttackingWith:: (Weap:{weapon},Edge:{edged}) {byEntity.Code} -> {attackedEntity.Code}"); | |
313 | + #endif | |
314 | + | |
315 | + TakeDamage(world, byEntity ,attackedEntity, null, itemslot, api ); | |
316 | + | |
317 | + if (steelThing.Hardness > HardnessState.Hard) //VS.: High-Tier Mobs / High-Tier Player armor ? | |
318 | + { | |
319 | + bool catasptrophicFailure = world.Rand.Next(1, 1000) >= 999; | |
320 | + if (catasptrophicFailure) | |
321 | + { | |
322 | + #if DEBUG | |
323 | + world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", item.Code); | |
324 | + #endif | |
325 | + SteelAspects.SetHitpoints(itemslot.Itemstack, 0); | |
326 | + item.DamageItem(world, byEntity, itemslot, 9999); | |
327 | + return; | |
328 | + } | |
329 | + } | |
330 | + } | |
331 | + | |
332 | + public static void WhenUsedForBlockBreak(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel, ICoreAPI api ) | |
333 | + { | |
334 | + var item = itemslot.Itemstack.Item; | |
335 | + bool edged = item.Tool.EdgedImpliment( ); | |
336 | + bool weapon = item.Tool.Weapons( ); | |
337 | + | |
338 | + var steelThing = itemslot.Itemstack.AsSteelThing( ); | |
339 | + | |
340 | + var targetBlock = api.World.BlockAccessor.GetBlock(blockSel.Position); | |
341 | + int targetTier = targetBlock.ToolTier; | |
342 | + float targetResistance = targetBlock.Resistance; | |
343 | + bool recomendedUsage = item.RecomendedUsage(targetBlock.BlockMaterial); | |
344 | + var hardness = steelThing.Hardness; | |
345 | + | |
346 | + //Only called for attacks on BLOCKS / Envrionment. Scen# 5 - 6 here. | |
347 | + | |
348 | + #if DEBUG | |
349 | + api.World.Logger.VerboseDebug($"OnBlockBrokenWith:: (Weap:{weapon},Edge:{edged},OK: {recomendedUsage},T.T#{targetTier}) {byEntity.Code} -> {targetBlock.Code}"); | |
350 | + #endif | |
351 | + | |
352 | + TakeDamage(world, byEntity, null, blockSel, itemslot, api); | |
353 | + | |
354 | + if (recomendedUsage == false && hardness > HardnessState.Hard) { | |
355 | + bool catasptrophicFailure = world.Rand.Next(1, 1000) >= (999 - (targetTier * 5)); | |
356 | + | |
357 | + if (catasptrophicFailure) { | |
358 | + world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", item.Code); | |
359 | + SteelAspects.SetHitpoints(itemslot.Itemstack, 0); | |
360 | + item.DamageItem(world, byEntity, itemslot, 9999); | |
361 | + | |
362 | + } | |
363 | + } | |
364 | + } | |
365 | + | |
366 | + public static void TakeDamage(IWorldAccessor world, Entity owner, Entity attackOnEntity, BlockSelection breakingBlock, ItemSlot itemslot, ICoreAPI api, int nomAmmount = 1) | |
367 | + { | |
368 | + var item = itemslot.Itemstack.Item; | |
369 | + var steelThing = itemslot.Itemstack.AsSteelThing( ); | |
370 | + | |
371 | + /*DETERMINE: | |
372 | + * Usage - Blade/Edged weapon attack Vs. creature Sc.#1 [What about armored players?] | |
373 | + * Non-edged (blunt) weapon vs. creature Sc. #2 [What about armored players?] | |
374 | + * [Improvised-arms] Edged-Tool (non-weapon) vs. Creature Sc.#3 | |
375 | + * [Improvised-arms] Blunt-Tool (non-weapon) vs. Creature Sc.#4 | |
376 | + * Tool Against Envrionment (Pickaxe / Axe / Propick / Saw / Shovel) Sc. #5 | |
377 | + * WEAPONS Vs. Envrionment (hiting dirt with a sword!) Sc. #6 | |
378 | + * Tools - don't really benefit from edges vs. envrionment...? | |
379 | + */ | |
380 | + uint extraBias = 0; | |
381 | + | |
382 | + if (attackOnEntity != null) | |
383 | + { | |
384 | + bool edged = item.Tool.EdgedImpliment( ); | |
385 | + bool weapon = item.Tool.Weapons( ); | |
386 | + int armourTier = 0;//Most Creatures have no 'Armour' class...? | |
387 | + float damageFactor = 0f;//Scaling | |
388 | + int maxDamage = 1; | |
389 | + int rndDamageOutcome = 1; | |
390 | + | |
391 | + if (attackOnEntity is EntityPlayer) { | |
392 | + var atkdPlayer = attackOnEntity as EntityPlayer; | |
393 | + var atkeeInv = atkdPlayer.Player.InventoryManager.GetOwnInventory(GlobalConstants.characterInvClassName); | |
394 | + var armourSlots = new ItemSlot[ ] { atkeeInv[( int )EnumCharacterDressType.ArmorHead], atkeeInv[( int )EnumCharacterDressType.ArmorBody], atkeeInv[( int )EnumCharacterDressType.ArmorLegs] }; | |
395 | + //TODO: Cache Armor combined-stat data...too pesky to extract all the time | |
396 | + | |
397 | + foreach (var aSlot in armourSlots) { | |
398 | + if (aSlot.Empty == false && aSlot.Itemstack.Class == EnumItemClass.Item && aSlot.Itemstack.Item is ItemWearable) { | |
399 | + var armourItem = aSlot.Itemstack.Item as ItemWearable; | |
400 | + if (armourItem.ProtectionModifiers != null) armourTier = Math.Max(armourItem.ProtectionModifiers.ProtectionTier, armourTier); | |
401 | + } | |
402 | + } | |
403 | + } | |
404 | + | |
405 | + //Scenarios #1, thru #4... | |
406 | + if (edged && weapon) {//#1 Edged weapon | |
407 | + int tierDisparity = armourTier - item.ToolTier; | |
408 | + damageFactor = 1 + (tierDisparity * 0.2f) - (( int )(steelThing.Hardness) * 0.10f); | |
409 | + maxDamage = 1 + (HardnessState.Brittle - steelThing.Hardness); | |
410 | + extraBias = ( uint )(tierDisparity * 5); | |
411 | + | |
412 | + } | |
413 | + else if (weapon) {//#2 Blunt Weapon | |
414 | + | |
415 | + } | |
416 | + else if (edged && !weapon) {//#3 Improvised Edged weapon | |
417 | + | |
418 | + } | |
419 | + else {//#4 Improvised Blunt weapon | |
420 | + | |
421 | + } | |
422 | + | |
423 | + rndDamageOutcome = api.World.Rand.Next(0, ( int )(maxDamage * damageFactor)); | |
424 | + if (rndDamageOutcome > 0) item.DamageItem(world, null, itemslot, rndDamageOutcome); | |
425 | + | |
426 | + }//Entities being attacked; ends. | |
427 | + else if (breakingBlock != null) | |
428 | + { | |
429 | + //Scenarios #5, #6... | |
430 | + bool tool = item.Tool.Tools( ); | |
431 | + if (tool) {//#5 | |
432 | + | |
433 | + } | |
434 | + else {//#6 | |
435 | + | |
436 | + | |
437 | + } | |
438 | + }//Blocks being broken; ends. | |
439 | + | |
440 | + //TODO: Handle Crafting \ Other damage sources...here? (also done elsewhere) | |
441 | + MabeyDull(steelThing,api, extraBias ); | |
442 | + | |
443 | + } | |
444 | + | |
445 | + /// <summary> | |
446 | + /// Dull and/or DamageItem | |
447 | + /// </summary> | |
448 | + public static void ToolInRecipeUse(Item @this, ItemSlot[ ] allInputSlots, GridRecipe matchingRecipe, ICoreAPI api ) | |
449 | + { | |
450 | + var steelToolSlot = (from inputSlot in allInputSlots | |
451 | + where inputSlot.Empty == false | |
452 | + where inputSlot.Itemstack.Class == EnumItemClass.Item | |
453 | + where inputSlot.Itemstack.Collectible.Code == @this.Code | |
454 | + select inputSlot).FirstOrDefault( );//Freaky recipie with TWO of same tool?! | |
455 | + | |
456 | + var steelThing = steelToolSlot.Itemstack.AsSteelThing( ); | |
457 | + //Edged tool vs. non-edged tool | |
458 | + bool edgedTool = @this.Tool.EdgedImpliment( ); | |
459 | + | |
460 | + float hardnessMult = (( int )HardnessState.Brittle + 1) / (( int )steelThing.Hardness + 1) * 0.25f; | |
461 | + float wearMax = 1; | |
462 | + | |
463 | + if (edgedTool) { | |
464 | + wearMax = ( byte )SharpnessState.Razor - ( byte )steelThing.Sharpness; | |
465 | + } | |
466 | + | |
467 | + int actualDmg = ( int )Math.Round(NatFloat.createTri(wearMax, hardnessMult).nextFloat(1.0f, api.World.Rand), 1); | |
468 | + | |
469 | + #if DEBUG | |
470 | + api.World.Logger.VerboseDebug($"tooluse [{@this.Code}] --> Harndess effect: [ Hardness {hardnessMult} Vs. Rate: {wearMax} apply dmg: {actualDmg}, edged: {edgedTool} ]"); | |
471 | + #endif | |
472 | + if (actualDmg > 0) | |
473 | + { | |
474 | + steelToolSlot.Itemstack.Collectible.DamageItem(api.World, null, steelToolSlot, actualDmg); | |
475 | + MabeyDull(steelThing, api); | |
476 | + } | |
477 | + | |
478 | + } | |
479 | + | |
480 | + public static void MabeyDull(SteelThingViaStack someSteelyThing, ICoreAPI api, uint extraBias = 0) | |
481 | + { | |
482 | + // **************** Edge blunting | |
483 | + var hardness = someSteelyThing.Hardness; | |
484 | + bool edgeBlunting = false; | |
485 | + switch (hardness) { | |
486 | + | |
487 | + case HardnessState.Soft: | |
488 | + edgeBlunting = api.World.Rand.Next(1, 100) >= (99 - extraBias); | |
489 | + break; | |
490 | + | |
491 | + case HardnessState.Medium: | |
492 | + edgeBlunting = api.World.Rand.Next(1, 200) >= (199 - extraBias); | |
493 | + break; | |
494 | + | |
495 | + case HardnessState.Hard: | |
496 | + edgeBlunting = api.World.Rand.Next(1, 300) >= (299 - extraBias); | |
497 | + break; | |
498 | + | |
499 | + case HardnessState.Brittle: | |
500 | + edgeBlunting = api.World.Rand.Next(1, 400) >= 399; | |
501 | + break; | |
502 | + } | |
503 | + if (edgeBlunting) someSteelyThing.Dull(); | |
504 | + } | |
505 | + | |
506 | + public static void SharpenOneSteelItem(ItemSlot[ ] allInputslots, ItemSlot outputSlot, GridRecipe byRecipe, ICoreAPI api) | |
507 | + { | |
508 | + //Failsafe[s] | |
509 | + string name = "unset!"; | |
510 | + if (byRecipe == null || byRecipe.Ingredients == null || byRecipe.IngredientPattern == null || byRecipe.Output == null) { | |
511 | + name = byRecipe?.Name.ToString( ); | |
512 | + api.World.Logger.Error("Invalid / Incomplete / Corrupt (sharpening) Recipe: {0}", name); | |
513 | + return; | |
514 | + } | |
515 | + | |
516 | + var steelItemSlot = (from inputSlot in allInputslots | |
517 | + where inputSlot.Empty == false | |
518 | + where inputSlot.Itemstack.Class == EnumItemClass.Item | |
519 | + where inputSlot.Itemstack.Collectible.IsSteelMetal( ) | |
520 | + select inputSlot).SingleOrDefault( ); | |
521 | + | |
522 | + var sharpenerItemSlot = (from inputSlot in allInputslots | |
523 | + where inputSlot.Empty == false | |
524 | + where inputSlot.Itemstack.Class == EnumItemClass.Item | |
525 | + where inputSlot.Itemstack.Collectible.IsSharpener( ) | |
526 | + select inputSlot).SingleOrDefault( ); | |
527 | + | |
528 | + if (sharpenerItemSlot.Empty) return;//Not a sharpening recipie | |
529 | + | |
530 | + if (steelItemSlot != null && steelItemSlot.Itemstack.Class == EnumItemClass.Item) { | |
531 | + if (steelItemSlot.Itemstack.Item is ISteelByStack) | |
532 | + { | |
533 | + //OLD WAY | |
534 | + var steelItem = steelItemSlot.Itemstack.Item; | |
535 | + | |
536 | + #if DEBUG | |
537 | + api.World.Logger.VerboseDebug("Input (ingredient) Item {0} supports; ISteelByStack Interface ", steelItem.Code); | |
538 | + #endif | |
539 | + if (!outputSlot.Empty && outputSlot.Itemstack.Class == EnumItemClass.Item | |
540 | + && outputSlot.Itemstack.Item is ISteelByStack) | |
541 | + { | |
542 | + var outputItem = outputSlot.Itemstack.Item; | |
543 | + var fullMetalInterface = outputSlot.Itemstack.Item as ISteelByStack; | |
544 | + #if DEBUG | |
545 | + api.World.Logger.VerboseDebug("Output Item {0} supports; ISteelByStack Interface ", steelItem.Code); | |
546 | + #endif | |
547 | + | |
548 | + fullMetalInterface.CopyStackAttributes(steelItemSlot.Itemstack, outputSlot.Itemstack); | |
549 | + | |
550 | + if (sharpenerItemSlot != null) fullMetalInterface.Sharpen(outputSlot.Itemstack); | |
551 | + #if DEBUG | |
552 | + api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1} ", steelItem.Code, outputItem.Code); | |
553 | + #endif | |
554 | + } | |
555 | + } else if (steelItemSlot.Itemstack.Item is ISteelThingInstance) | |
556 | + { | |
557 | + //NEW WAY | |
558 | + var oldSteelThing = steelItemSlot.Itemstack.AsSteelThing( ); | |
559 | + | |
560 | + oldSteelThing.CloneStackAttributes(outputSlot.Itemstack); | |
561 | + #if DEBUG | |
562 | + api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1}, using ISteelThingInstance ", steelItemSlot.Itemstack.Item.Code, outputSlot.Itemstack.Item.Code); | |
563 | + #endif | |
564 | + } | |
565 | + | |
566 | + } | |
567 | + else { | |
568 | + #if DEBUG | |
569 | + api.World.Logger.Debug("Could not find steel item; in Recipie:{0} ",name); | |
570 | + #endif | |
571 | + } | |
572 | + } | |
573 | + | |
574 | + public static void SetTimestamp(EntityItem entityItem) | |
575 | + { | |
576 | + | |
577 | + if (!entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) { | |
578 | + entityItem.Attributes.SetLong(SteelAspects._timestampKey, DateTime.Now.Ticks); | |
579 | + } | |
580 | + } | |
581 | + | |
582 | + public static TimeSpan GetTimestampElapsed(EntityItem entityItem) | |
583 | + { | |
584 | + if (entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) { | |
585 | + var ts = TimeSpan.FromTicks(entityItem.Attributes.GetLong(SteelAspects._timestampKey)); | |
586 | + return ts.Subtract(TimeSpan.FromTicks(DateTime.Now.Ticks)).Negate( ); | |
587 | + } | |
588 | + return TimeSpan.Zero; | |
589 | + } | |
590 | + | |
591 | + #endregion | |
592 | + } | |
593 | +} |
@@ -1,32 +1,43 @@ | ||
1 | 1 | using System; |
2 | +using System.Text; | |
3 | + | |
4 | +using HarmonyLib; | |
2 | 5 | |
3 | 6 | using Vintagestory.API.Common; |
7 | +using Vintagestory.API.Config; | |
4 | 8 | |
5 | 9 | namespace ElementalTools |
6 | 10 | { |
7 | 11 | /// <summary> |
8 | - /// Item wrapped with some Tool helpers & stuff | |
12 | + /// Item with some common Tool helpers, Base common Steely-features | |
9 | 13 | /// </summary> |
10 | - public abstract class SteelAssistItem : Item | |
14 | + public abstract class SteelBaseItem : Item, ISteelByStack, ISteelBase | |
11 | 15 | { |
12 | 16 | private const string altToolKeyword = @"AltTool"; |
13 | 17 | |
14 | - protected SteelAssistItem() : base() | |
18 | + | |
19 | + | |
20 | + protected SteelBaseItem( ) : base( ) | |
21 | + { | |
22 | + } | |
23 | + | |
24 | + protected SteelBaseItem(int itemId) : base(itemId) | |
15 | 25 | { |
16 | 26 | } |
17 | 27 | |
18 | - protected SteelAssistItem(int itemId) : base (itemId) | |
19 | - { | |
28 | + public void OverwriteFields(Item setee) | |
29 | + { | |
30 | + //setee.MiningSpeed = this.MiningSpeed;//Ect... | |
31 | + Traverse.IterateFields(this, setee, Traverse.CopyFields); | |
20 | 32 | } |
21 | 33 | |
22 | 34 | public EnumTool? AltTool { |
23 | 35 | get |
24 | 36 | { |
25 | - if (this.Attributes != null && this.Attributes.KeyExists(altToolKeyword)) | |
26 | - { | |
27 | - EnumTool altEnumVal = (EnumTool)(this.Attributes[altToolKeyword].AsInt(0)); | |
28 | - return altEnumVal; | |
29 | - } | |
37 | + if (this.Attributes != null && this.Attributes.KeyExists(altToolKeyword)) { | |
38 | + EnumTool altEnumVal = ( EnumTool )(this.Attributes[altToolKeyword].AsInt(0)); | |
39 | + return altEnumVal; | |
40 | + } | |
30 | 41 | return null; |
31 | 42 | } |
32 | 43 | //HACK: to workaround null tool values... |
@@ -50,11 +61,141 @@ namespace ElementalTools | ||
50 | 61 | } |
51 | 62 | } |
52 | 63 | |
53 | - public bool RecomendedUsage(EnumBlockMaterial blockMaterial) | |
64 | + | |
65 | + | |
66 | + | |
67 | + #region Static Properties | |
68 | + public virtual bool Hardenable { | |
69 | + get | |
70 | + { | |
71 | + return this.Attributes[SteelAspects.hardenableKeyword].AsBool(false); | |
72 | + } | |
73 | + } | |
74 | + | |
75 | + | |
76 | + public virtual string BaseMetalName { | |
77 | + get | |
78 | + { | |
79 | + return this.Attributes[SteelAspects.metalNameKeyword].AsString("?"); | |
80 | + } | |
81 | + } | |
82 | + | |
83 | + public virtual bool Sharpenable { | |
84 | + get | |
85 | + { | |
86 | + return this.Attributes[SteelAspects.sharpenableKeyword].AsBool(false); | |
87 | + } | |
88 | + } | |
89 | + #endregion | |
90 | + | |
91 | + | |
92 | + #region ISteelByStack | |
93 | + public virtual SharpnessState Sharpness(IItemStack someStack) | |
54 | 94 | { |
55 | - if( this.MiningSpeed != null && this.MiningSpeed.ContainsKey(blockMaterial)) return true; | |
56 | - return false; | |
57 | - } | |
95 | + if (someStack.Attributes != null && someStack.Attributes.HasAttribute(SteelAspects.sharpnessKeyword)) { | |
96 | + byte[ ] bytes = new byte[1]; | |
97 | + bytes = someStack.Attributes.GetBytes(SteelAspects.sharpnessKeyword, bytes); | |
98 | + return bytes == null ? SharpnessState.Rough : ( SharpnessState )bytes[0]; | |
99 | + } | |
100 | + | |
101 | + return SharpnessState.Rough; | |
102 | + } | |
103 | + | |
104 | + public virtual void Sharpness(IItemStack someStack, SharpnessState set) | |
105 | + { | |
106 | + byte[ ] bytes = new byte[1]; | |
107 | + bytes[0] = ( byte )set; | |
108 | + someStack.Attributes.SetBytes(SteelAspects.sharpnessKeyword, bytes); | |
109 | + } | |
110 | + | |
111 | + public virtual SharpnessState Sharpen(IItemStack someStack) | |
112 | + { | |
113 | + if (this.Sharpenable == false) { | |
114 | + api.World.Logger.VerboseDebug("Can't sharpen! {0}", this.Code); | |
115 | + return this.Sharpness(someStack); ; | |
116 | + } | |
117 | + | |
118 | + SharpnessState sharp = Sharpness(someStack); | |
119 | + | |
120 | + if (sharp < SharpnessState.Razor) { Sharpness(someStack, ++sharp); } | |
121 | + //TODO: Play sound effect | |
122 | + #if DEBUG | |
123 | + api.World.Logger.VerboseDebug("Sharpness of '{1}' increased to: {0}", sharp, this.Code); | |
124 | + #endif | |
125 | + | |
126 | + //TODO: If durability exists - decriment based on Hardnes Vs. Wear... | |
127 | + if (this.Durability > 1) { | |
128 | + | |
129 | + var currentDur = GetRemainingDurability(someStack as ItemStack); | |
130 | + SteelAspects.SetHitpoints(someStack, --currentDur); | |
131 | + } | |
132 | + | |
133 | + return sharp; | |
134 | + } | |
135 | + | |
136 | + | |
137 | + public virtual SharpnessState Dull(IItemStack someStack) | |
138 | + { | |
139 | + if (someStack.Attributes != null && someStack.Attributes.HasAttribute(SteelAspects.sharpnessKeyword)) { | |
140 | + byte[ ] bytes = new byte[1]; | |
141 | + bytes = someStack.Attributes.GetBytes(SteelAspects.sharpnessKeyword, bytes); | |
142 | + var state = ( SharpnessState )bytes[0]; | |
143 | + | |
144 | + if (state > SharpnessState.Rough) state--; | |
145 | + | |
146 | + bytes[0] = ( byte )state; | |
147 | + someStack.Attributes.SetBytes(SteelAspects.sharpnessKeyword, bytes); | |
148 | + | |
149 | + return state; | |
150 | + } | |
151 | + return SharpnessState.Rough; | |
152 | + } | |
153 | + | |
154 | + | |
155 | + | |
156 | + public virtual HardnessState Hardness(IItemStack someStack) | |
157 | + { | |
158 | + if (someStack.Attributes != null && someStack.Attributes.HasAttribute(SteelAspects.hardnessKeyword)) { | |
159 | + byte[ ] bytes = new byte[1]; | |
160 | + bytes = someStack.Attributes.GetBytes(SteelAspects.hardnessKeyword, bytes); | |
161 | + return bytes == null ? HardnessState.Soft : ( HardnessState )bytes[0]; | |
162 | + } | |
163 | + | |
164 | + return HardnessState.Soft; | |
165 | + } | |
166 | + | |
167 | + public virtual void Hardness(IItemStack someStack, HardnessState set) | |
168 | + { | |
169 | + byte[ ] bytes = new byte[1]; | |
170 | + bytes[0] = ( byte )set; | |
171 | + someStack.Attributes.SetBytes(SteelAspects.hardnessKeyword, bytes); | |
172 | + } | |
173 | + | |
174 | + public virtual void CopyStackAttributes(ItemStack donor, ItemStack recipient) | |
175 | + { | |
176 | + | |
177 | + if (donor.Class == recipient.Class) { | |
178 | + var hI = (donor.Item as ISteelByStack).Hardness(donor); | |
179 | + var sI = (donor.Item as ISteelByStack).Sharpness(donor); | |
180 | + | |
181 | + (recipient.Item as ISteelByStack).Hardness(recipient, hI); | |
182 | + (recipient.Item as ISteelByStack).Sharpness(recipient, sI); | |
183 | + | |
184 | + if (donor.Item.Durability > 0) { | |
185 | + var wear = GetRemainingDurability(donor); | |
186 | + | |
187 | + if (donor.Item.IsFerricMetal( ) && recipient.Item.IsSteelMetal( )) { | |
188 | + var percentWear = (wear / donor.Item.Durability); | |
189 | + SteelAspects.SetHitpoints(recipient, recipient.Item.Durability * percentWear); | |
190 | + } | |
191 | + else SteelAspects.SetHitpoints(recipient, wear); | |
192 | + } | |
193 | + } | |
194 | + } | |
195 | + | |
196 | + #endregion | |
58 | 197 | } |
198 | + | |
199 | + | |
59 | 200 | } |
60 | 201 |
@@ -0,0 +1,192 @@ | ||
1 | +using System; | |
2 | + | |
3 | +using Vintagestory.API.Common; | |
4 | + | |
5 | +namespace ElementalTools | |
6 | +{ | |
7 | + public class SteelThingViaStack: ISteelThingInstance, ISteelBase | |
8 | + { | |
9 | + | |
10 | + | |
11 | + protected IItemStack sourceStack { get; set;} | |
12 | + | |
13 | + private SteelThingViaStack( ) { } | |
14 | + private ILogger Logger { get; set; } | |
15 | + | |
16 | + public SteelThingViaStack(IItemStack inputStack) | |
17 | + { | |
18 | + sourceStack = inputStack; | |
19 | + } | |
20 | + | |
21 | + #region ISteelBase | |
22 | + | |
23 | + public string BaseMetalName { | |
24 | + get | |
25 | + { | |
26 | + return sourceStack.Item.Attributes[SteelAspects.metalNameKeyword].AsString("?"); | |
27 | + } | |
28 | + } | |
29 | + | |
30 | + public bool Sharpenable { | |
31 | + get | |
32 | + { | |
33 | + return sourceStack.Item.Attributes[SteelAspects.sharpenableKeyword].AsBool(false); | |
34 | + } | |
35 | + } | |
36 | + | |
37 | + public bool Hardenable { | |
38 | + get | |
39 | + { | |
40 | + return sourceStack.Item.Attributes[SteelAspects.hardenableKeyword].AsBool(false); | |
41 | + } | |
42 | + } | |
43 | + #endregion | |
44 | + | |
45 | + #region ISteelThingInstance | |
46 | + | |
47 | + public SharpnessState Sharpness { | |
48 | + get | |
49 | + { | |
50 | + if (sourceStack.Attributes != null && sourceStack.Attributes.HasAttribute(SteelAspects.sharpnessKeyword)) { | |
51 | + byte[ ] bytes = new byte[1]; | |
52 | + bytes = sourceStack.Attributes.GetBytes(SteelAspects.sharpnessKeyword, bytes); | |
53 | + return bytes == null ? SharpnessState.Rough : ( SharpnessState )bytes[0]; | |
54 | + } | |
55 | + | |
56 | + return SharpnessState.Rough; | |
57 | + } | |
58 | + | |
59 | + set | |
60 | + { | |
61 | + byte[ ] bytes = new byte[1]; | |
62 | + bytes[0] = ( byte )value; | |
63 | + sourceStack.Attributes.SetBytes(SteelAspects.sharpnessKeyword, bytes); | |
64 | + } | |
65 | + } | |
66 | + | |
67 | + public HardnessState Hardness { | |
68 | + get | |
69 | + { | |
70 | + if (sourceStack.Attributes != null && sourceStack.Attributes.HasAttribute(SteelAspects.hardnessKeyword)) { | |
71 | + byte[ ] bytes = new byte[1]; | |
72 | + bytes = sourceStack.Attributes.GetBytes(SteelAspects.hardnessKeyword, bytes); | |
73 | + return bytes == null ? HardnessState.Soft : ( HardnessState )bytes[0]; | |
74 | + } | |
75 | + return HardnessState.Soft; | |
76 | + } | |
77 | + | |
78 | + set | |
79 | + { | |
80 | + byte[ ] bytes = new byte[1]; | |
81 | + bytes[0] = ( byte )value; | |
82 | + sourceStack.Attributes.SetBytes(SteelAspects.hardnessKeyword, bytes); | |
83 | + } | |
84 | + } | |
85 | + | |
86 | + | |
87 | + | |
88 | + public SharpnessState Sharpen( ) | |
89 | + { | |
90 | + if (this.Sharpenable == false) { | |
91 | + Logger.Notification("Can't sharpen! {0}", sourceStack.Item.Code); | |
92 | + return Sharpness; | |
93 | + } | |
94 | + SharpnessState sharp = this.Sharpness; | |
95 | + | |
96 | + if (sharp < SharpnessState.Razor) { this.Sharpness = ++sharp; } | |
97 | + //TODO: Play sound effect | |
98 | + #if DEBUG | |
99 | + Logger.VerboseDebug("Sharpness of '{1}' increased to: {0}", sharp, sourceStack.Item.Code); | |
100 | + #endif | |
101 | + | |
102 | + //TODO: If durability exists - decriment based on Hardness Vs. Wear... | |
103 | + if (this.Hitpoints > 1) { | |
104 | + Hitpoints = --Hitpoints; | |
105 | + } | |
106 | + | |
107 | + return sharp; | |
108 | + } | |
109 | + | |
110 | + public SharpnessState Dull( ) | |
111 | + { | |
112 | + if (this.Sharpenable == false) { | |
113 | + Logger.Notification("Can't dull! {0}", sourceStack.Item.Code); | |
114 | + return Sharpness; | |
115 | + } | |
116 | + SharpnessState sharp = this.Sharpness; | |
117 | + | |
118 | + if (sharp > SharpnessState.Dull) { this.Sharpness = --sharp; } | |
119 | + #if DEBUG | |
120 | + Logger.VerboseDebug("Sharpness of '{1}' decreased to: {0}", sharp, sourceStack.Item.Code); | |
121 | + #endif | |
122 | + | |
123 | + //TODO: If durability exists - decriment based on Hardness Vs. Wear... | |
124 | + if (this.Hitpoints > 1) { | |
125 | + Hitpoints = --Hitpoints; | |
126 | + } | |
127 | + | |
128 | + return sharp; | |
129 | + } | |
130 | + | |
131 | + public HardnessState Harden( ) | |
132 | + { | |
133 | + if (this.Hardenable == false) { | |
134 | + Logger.Notification("Can't Harden! {0}", sourceStack.Item.Code); | |
135 | + return Hardness; | |
136 | + } | |
137 | + var hard = this.Hardness; | |
138 | + | |
139 | + if (hard < HardnessState.Brittle) { this.Hardness = ++hard; } | |
140 | + | |
141 | + #if DEBUG | |
142 | + Logger.VerboseDebug("Hardness of '{1}' increased to: {0}", hard, sourceStack.Item.Code); | |
143 | + #endif | |
144 | + | |
145 | + //TODO: If durability exists - decriment based on Hardness Vs. Wear... | |
146 | + if (this.Hitpoints > 1) { | |
147 | + Hitpoints = --Hitpoints; | |
148 | + } | |
149 | + | |
150 | + return hard; | |
151 | + } | |
152 | + | |
153 | + /// <summary> | |
154 | + /// Clones the stack attributes. | |
155 | + /// </summary> | |
156 | + /// <returns>The stack attributes.</returns> | |
157 | + /// <param name="target">Target.</param> | |
158 | + //TODO: Clone _ALL_ the attributes! | |
159 | + public void CloneStackAttributes(ItemStack target) | |
160 | + { | |
161 | + if (target.Collectible.Code == sourceStack.Collectible.Code) { | |
162 | + var targetSteel = target.AsSteelThing(); | |
163 | + targetSteel.Sharpness = this.Sharpness; | |
164 | + targetSteel.Hardness = this.Hardness; | |
165 | + | |
166 | + | |
167 | + if (sourceStack.Item.Durability > 1) { | |
168 | + SteelAspects.SetHitpoints(target, this.Hitpoints); | |
169 | + } | |
170 | + | |
171 | + } | |
172 | + } | |
173 | + | |
174 | + #endregion | |
175 | + | |
176 | + | |
177 | + protected int Hitpoints { | |
178 | + get | |
179 | + { | |
180 | + return sourceStack.Attributes.GetInt(SteelAspects.durabilityKeyword, sourceStack.Item.Durability); | |
181 | + } | |
182 | + | |
183 | + set { | |
184 | + sourceStack.Attributes.SetInt(SteelAspects.durabilityKeyword, value); | |
185 | + } | |
186 | + } | |
187 | + | |
188 | + | |
189 | + | |
190 | + } | |
191 | +} | |
192 | + |
@@ -33,37 +33,7 @@ namespace ElementalTools | ||
33 | 33 | return false; |
34 | 34 | } |
35 | 35 | |
36 | - /// <summary> | |
37 | - /// Match against:Variant(s){ metal, material } == 'iron' | |
38 | - /// </summary> | |
39 | - /// <returns>The ferric metal.</returns> | |
40 | - /// <param name="something">Something collectable.</param> | |
41 | - public static bool IsFerricMetal(this CollectibleObject something) | |
42 | - { | |
43 | - return something.Variant.KeyValueMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.IronNameKey) || | |
44 | - something.Variant.KeyValueMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.IronNameKey); | |
45 | - } | |
46 | - | |
47 | - /// <summary> | |
48 | - /// Match against:Variant(s){ metal, material } == 'steel' | |
49 | - /// </summary> | |
50 | - /// <returns>The Steel metal. </returns> | |
51 | - /// <param name="something">Something collectable.</param> | |
52 | - public static bool IsSteelMetal(this CollectibleObject something) | |
53 | - { | |
54 | - return something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MetalNameKey, ElementalToolsSystem.SteelNameKey) || | |
55 | - something.Variant.KeyValueEndingMatch(ElementalToolsSystem.MaterialNameKey, ElementalToolsSystem.SteelNameKey); | |
56 | - } | |
57 | 36 | |
58 | - /// <summary> | |
59 | - /// Using ItemSharpener class.... | |
60 | - /// </summary> | |
61 | - /// <returns>If a sharpener.</returns> | |
62 | - /// <param name="something">Something.</param> | |
63 | - public static bool IsSharpener(this CollectibleObject something) | |
64 | - { | |
65 | - return String.Equals(something.Class, ElementalToolsSystem.sharpeningStoneItemKey, StringComparison.Ordinal); | |
66 | - } | |
67 | 37 | |
68 | 38 | public static AssetLocation AppendPaths(this AssetLocation assetLoc, params string[ ] morePaths) |
69 | 39 | { |
@@ -94,49 +64,7 @@ namespace ElementalTools | ||
94 | 64 | return originalAsset.Code; |
95 | 65 | } |
96 | 66 | |
97 | - /// <summary> | |
98 | - /// Has Edge that can wear down... | |
99 | - /// </summary> | |
100 | - /// <returns>The impliment.</returns> | |
101 | - /// <param name="what">What.</param> | |
102 | - public static bool EdgedImpliment(this EnumTool? what) | |
103 | - { | |
104 | - if (what != null || what.HasValue && ( | |
105 | - what == EnumTool.Axe || | |
106 | - what == EnumTool.Chisel || | |
107 | - what == EnumTool.Hoe || | |
108 | - what == EnumTool.Knife || | |
109 | - what == EnumTool.Pickaxe || | |
110 | - what == EnumTool.Saw || | |
111 | - what == EnumTool.Scythe || | |
112 | - what == EnumTool.Shears || | |
113 | - what == EnumTool.Sickle || | |
114 | - what == EnumTool.Spear || | |
115 | - what == EnumTool.Sword) | |
116 | - ) { | |
117 | - return true; | |
118 | - } | |
119 | - return false; | |
120 | - } | |
121 | 67 | |
122 | - /// <summary> | |
123 | - /// Consider this as Weaspon Vs. Tool..? | |
124 | - /// </summary> | |
125 | - /// <returns>The impliment.</returns> | |
126 | - /// <param name="what">What.</param> | |
127 | - public static bool Weapons(this EnumTool? what) | |
128 | - { | |
129 | - if (what != null || what.HasValue && ( | |
130 | - what == EnumTool.Axe || //Arguable | |
131 | - what == EnumTool.Bow || | |
132 | - what == EnumTool.Knife || | |
133 | - what == EnumTool.Spear || | |
134 | - what == EnumTool.Sword) | |
135 | - ) { | |
136 | - return true; | |
137 | - } | |
138 | - return false; | |
139 | - } | |
140 | 68 | |
141 | 69 | /// <summary> |
142 | 70 | /// Checks of Root term is match for Asset. |
@@ -163,9 +91,12 @@ namespace ElementalTools | ||
163 | 91 | commonApi.RegisterItemClass(className, itemType); |
164 | 92 | } |
165 | 93 | |
94 | + | |
95 | + | |
96 | + | |
166 | 97 | #if DEFUNCT |
167 | 98 | //Why C# 7.0 ? WHY?!?! |
168 | - public static T GetEnum<T>(this ITreeAttribute treeAttr, string keyword, T defaultValue = default(T)) where T : struct// enum | |
99 | + public static T GetEnum<T>(this ITreeAttribute treeAttr, string keyword, T defaultValue = default(T)) where T : enum | |
169 | 100 | { |
170 | 101 | var enumType = typeof(T); |
171 | 102 |
@@ -243,7 +174,7 @@ namespace ElementalTools | ||
243 | 174 | } |
244 | 175 | |
245 | 176 | } |
246 | -#endif | |
177 | + #endif | |
247 | 178 | } |
248 | 179 | } |
249 | 180 |
@@ -0,0 +1,89 @@ | ||
1 | +using System; | |
2 | +using System.Collections.Generic; | |
3 | +using Vintagestory.API.Client; | |
4 | +using Vintagestory.API.Common; | |
5 | +using Vintagestory.API.Config; | |
6 | +using Vintagestory.API.MathTools; | |
7 | +using Vintagestory.GameContent; | |
8 | + | |
9 | +namespace ElementalTools | |
10 | +{ | |
11 | + public class ItemConsolidatableCards : Item, IAnvilWorkable | |
12 | + { | |
13 | + | |
14 | + | |
15 | + #region IAnvilWorkable | |
16 | + public bool CanWork(ItemStack stack) | |
17 | + { | |
18 | + throw new NotImplementedException( ); | |
19 | + } | |
20 | + | |
21 | + public ItemStack GetBaseMaterial(ItemStack stack) | |
22 | + { | |
23 | + return stack;//Or Shear steel? | |
24 | + } | |
25 | + | |
26 | + public EnumHelveWorkableMode GetHelveWorkableMode(ItemStack stack, BlockEntityAnvil beAnvil) | |
27 | + { | |
28 | + return EnumHelveWorkableMode.NotWorkable;//Manual only | |
29 | + } | |
30 | + | |
31 | + public List<SmithingRecipe> GetMatchingRecipes(ItemStack stack) | |
32 | + { | |
33 | + throw new NotImplementedException( ); //(X) -> Steel Ingot | |
34 | + } | |
35 | + | |
36 | + public int GetRequiredAnvilTier(ItemStack stack) | |
37 | + { | |
38 | + return 3;//Iron+ | |
39 | + } | |
40 | + | |
41 | + public ItemStack TryPlaceOn(ItemStack stack, BlockEntityAnvil beAnvil) | |
42 | + { | |
43 | + //Set smithing Voxels here. | |
44 | + | |
45 | + /* | |
46 | + if (!CanWork(stack)) return null; | |
47 | + | |
48 | + Item item = api.World.GetItem(new AssetLocation("workitem-" + Variant["metal"])); | |
49 | + if (item == null) return null; | |
50 | + | |
51 | + ItemStack workItemStack = new ItemStack(item); | |
52 | + workItemStack.Collectible.SetTemperature(api.World, workItemStack, stack.Collectible.GetTemperature(api.World, stack)); | |
53 | + | |
54 | + if (beAnvil.WorkItemStack == null) | |
55 | + { | |
56 | + CreateVoxelsFromIngot(api, ref beAnvil.Voxels, isBlisterSteel); | |
57 | + } else | |
58 | + { | |
59 | + if (isBlisterSteel) return null; | |
60 | + | |
61 | + IAnvilWorkable workable = beAnvil.WorkItemStack.Collectible as IAnvilWorkable; | |
62 | + | |
63 | + if (!workable.GetBaseMaterial(beAnvil.WorkItemStack).Equals(api.World, GetBaseMaterial(stack), GlobalConstants.IgnoredStackAttributes)) | |
64 | + { | |
65 | + if (api.Side == EnumAppSide.Client) (api as ICoreClientAPI).TriggerIngameError(this, "notequal", Lang.Get("Must be the same metal to add voxels")); | |
66 | + return null; | |
67 | + } | |
68 | + | |
69 | + AddVoxelsFromIngot(api, ref beAnvil.Voxels); | |
70 | + } | |
71 | + | |
72 | + return workItemStack; | |
73 | + */ | |
74 | + return null; | |
75 | + } | |
76 | + #endregion | |
77 | + | |
78 | + protected byte[ , , ] GenSmithingVoxels() | |
79 | + { | |
80 | + //Cards standing vertically, some-slag also randomly... | |
81 | + var voxels = new byte[16, 6, 16]; | |
82 | + | |
83 | + return voxels; | |
84 | + } | |
85 | + | |
86 | + | |
87 | + } | |
88 | +} | |
89 | + |
@@ -10,7 +10,7 @@ namespace ElementalTools | ||
10 | 10 | public class ItemMallet : VariableWearRateTool |
11 | 11 | { |
12 | 12 | |
13 | - | |
13 | + //IDEA: Smash unfired clay shapes/pottery back into a pile of source-clay items | |
14 | 14 | |
15 | 15 | } |
16 | 16 | } |
@@ -0,0 +1,156 @@ | ||
1 | +using System; | |
2 | +using System.Text; | |
3 | + | |
4 | +using HarmonyLib; | |
5 | + | |
6 | +using Vintagestory.API.Common; | |
7 | +using Vintagestory.API.Common.Entities; | |
8 | +using Vintagestory.API.Config; | |
9 | +using Vintagestory.GameContent; | |
10 | + | |
11 | +namespace ElementalTools | |
12 | +{ | |
13 | + public class GenericSteelItem : Item, ISteelBase //SteelAssist | |
14 | + { | |
15 | + #region ISteelBase | |
16 | + | |
17 | + public string BaseMetalName { | |
18 | + get | |
19 | + { | |
20 | + return this.Attributes[SteelAspects.metalNameKeyword].AsString("?"); | |
21 | + } | |
22 | + } | |
23 | + | |
24 | + public bool Sharpenable { | |
25 | + get | |
26 | + { | |
27 | + return this.Attributes[SteelAspects.sharpenableKeyword].AsBool(false); | |
28 | + } | |
29 | + } | |
30 | + | |
31 | + public bool Hardenable { | |
32 | + get | |
33 | + { | |
34 | + return this.Attributes[SteelAspects.hardenableKeyword].AsBool(false); | |
35 | + } | |
36 | + } | |
37 | + #endregion | |
38 | + | |
39 | + #region Specific_Behavior | |
40 | + | |
41 | + public override void GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo) | |
42 | + { | |
43 | + if (inSlot == null || inSlot.Empty || inSlot.Inventory == null) { | |
44 | + #if DEBUG | |
45 | + api.World.Logger.Warning("GetHeldItemInfo -> Invetory / slot / stack: FUBAR!"); | |
46 | + #endif | |
47 | + return; | |
48 | + } | |
49 | + | |
50 | + base.GetHeldItemInfo(inSlot, dsc, world, withDebugInfo); | |
51 | + SteelAspects.GetHeldItemInfo(api, inSlot, dsc, world, withDebugInfo); | |
52 | + | |
53 | + } | |
54 | + | |
55 | + | |
56 | + /// <summary> | |
57 | + /// For; Quench-hardening... | |
58 | + /// </summary> | |
59 | + /// <param name="entityItem">Entity item.(Itself)</param> | |
60 | + public override void OnGroundIdle(EntityItem entityItem) | |
61 | + { | |
62 | + SteelAspects.QuenchHarden(this, entityItem, api); | |
63 | + base.OnGroundIdle(entityItem); | |
64 | + } | |
65 | + | |
66 | + #endregion | |
67 | + | |
68 | + | |
69 | + #region Steel Affects | |
70 | + | |
71 | + public override float GetAttackPower(IItemStack withItemStack) | |
72 | + { | |
73 | + return SteelAspects.AttackPower(this, withItemStack, this.api); | |
74 | + } | |
75 | + | |
76 | + public override float GetMiningSpeed(IItemStack itemstack, BlockSelection blockSel, Block block, IPlayer forPlayer) | |
77 | + { | |
78 | + return SteelAspects.MiningSpeed(itemstack, blockSel, block, forPlayer, this.api); | |
79 | + } | |
80 | + | |
81 | + public override void OnAttackingWith(IWorldAccessor world, Entity byEntity, Entity attackedEntity, ItemSlot itemslot) | |
82 | + { | |
83 | + SteelAspects.WhenUsedInAttack(world, byEntity,attackedEntity,itemslot, api ); | |
84 | + } | |
85 | + | |
86 | + | |
87 | + | |
88 | + | |
89 | + public override bool OnBlockBrokenWith(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel, float dropQuantityMultiplier = 1f) | |
90 | + { | |
91 | + if (api.Side.IsClient( )) return true; | |
92 | + | |
93 | + SteelAspects.WhenUsedForBlockBreak(world, byEntity, itemslot, blockSel, this.api); | |
94 | + | |
95 | + return true;//Blocks Behavior overrides? | |
96 | + } | |
97 | + | |
98 | + | |
99 | + | |
100 | + | |
101 | + | |
102 | + public override bool ConsumeCraftingIngredients(ItemSlot[ ] slots, ItemSlot outputSlot, GridRecipe matchingRecipe) | |
103 | + { | |
104 | + SteelAspects.ToolInRecipeUse(this, slots, matchingRecipe, api ); | |
105 | + | |
106 | + return true;//Always as its a tool? | |
107 | + } | |
108 | + | |
109 | + | |
110 | + | |
111 | + | |
112 | + //OnCreated By Crafting: Copy properties from 'parent' to steel item/block, for Sharpening effect | |
113 | + public override void OnCreatedByCrafting(ItemSlot[ ] allInputslots, ItemSlot outputSlot, GridRecipe byRecipe) | |
114 | + { | |
115 | + SteelAspects.SharpenOneSteelItem(allInputslots, outputSlot, byRecipe, api); | |
116 | + | |
117 | + | |
118 | + | |
119 | + } | |
120 | + | |
121 | + | |
122 | + | |
123 | + public override int GetItemDamageColor(ItemStack itemstack) | |
124 | + { | |
125 | + var steelThing = itemstack.AsSteelThing( ); | |
126 | + | |
127 | + switch (steelThing.Sharpness) { | |
128 | + case SharpnessState.Rough: | |
129 | + return SteelAspects.color_Rough; | |
130 | + | |
131 | + case SharpnessState.Dull: | |
132 | + return SteelAspects.color_Dull; | |
133 | + | |
134 | + case SharpnessState.Honed: | |
135 | + return SteelAspects.color_Honed; | |
136 | + | |
137 | + case SharpnessState.Keen: | |
138 | + return SteelAspects.color_Keen; | |
139 | + | |
140 | + case SharpnessState.Sharp: | |
141 | + return SteelAspects.color_Sharp; | |
142 | + | |
143 | + case SharpnessState.Razor: | |
144 | + return SteelAspects.color_Razor; | |
145 | + } | |
146 | + | |
147 | + return SteelAspects.color_Default; | |
148 | + } | |
149 | + | |
150 | + #endregion | |
151 | + | |
152 | + | |
153 | + | |
154 | + } | |
155 | +} | |
156 | + |
@@ -13,33 +13,12 @@ using Vintagestory.API.Config; | ||
13 | 13 | namespace ElementalTools |
14 | 14 | { |
15 | 15 | /// <summary> |
16 | - /// GENERIC Steel item. (Tool / Weapon / Armor...anything) [Possibly: Temperable and/or Hardenable ] | |
16 | + /// GENERIC Steel item. (Tool / Weapon ) [Possibly: Temperable and/or Hardenable ] | |
17 | 17 | /// </summary> |
18 | - public class SteelWrap<T>: SteelAssistItem, IAmSteel where T : Item, new() | |
19 | - { | |
20 | - private const float eutectoid_transition_temperature = 727f;//Celcius | |
21 | - private const float quenchTimeConstant = 180f; | |
22 | - private const float quench_min_temperature = 450f;//Celcius | |
23 | - private const string _timestampKey = @"timestamp"; | |
18 | + public class SteelWrapItem<OrigItem>: SteelBaseItem where OrigItem : Item, new() | |
19 | + { | |
20 | + private OrigItem WrappedItem;//Special placeholder replica - for calling ancestor (base) class | |
24 | 21 | |
25 | - private Item WrappedItem;//Special placeholder replica - for calling ancestor class | |
26 | - | |
27 | - internal const string hardenableKeyword = @"hardenable"; | |
28 | - internal const string sharpenableKeyword = @"sharpenable"; | |
29 | - internal const string metalNameKeyword = @"metalName"; | |
30 | - | |
31 | - internal const string hardnessKeyword = @"hardness"; | |
32 | - internal const string sharpnessKeyword = @"sharpness"; | |
33 | - | |
34 | - internal const string durabilityKeyword = @"durability"; | |
35 | - | |
36 | - internal readonly BGRAColor_Int32 color_Rough = new BGRAColor_Int32(0xFF, 0x66, 0x00); | |
37 | - internal readonly BGRAColor_Int32 color_Dull = new BGRAColor_Int32(0xFF, 0xBE, 0x00); | |
38 | - internal readonly BGRAColor_Int32 color_Honed = new BGRAColor_Int32(0xE8, 0xFF, 0x00); | |
39 | - internal readonly BGRAColor_Int32 color_Keen = new BGRAColor_Int32(0x7D, 0xFF, 0x00); | |
40 | - internal readonly BGRAColor_Int32 color_Sharp = new BGRAColor_Int32(0x00, 0xFF, 0x12); | |
41 | - internal readonly BGRAColor_Int32 color_Razor = new BGRAColor_Int32(0x00, 0xFF, 0xD7); | |
42 | - internal readonly BGRAColor_Int32 color_Default = new BGRAColor_Int32(0xFF, 0x00, 0x00); | |
43 | 22 | |
44 | 23 | |
45 | 24 | /* |
@@ -62,14 +41,14 @@ namespace ElementalTools | ||
62 | 41 | public virtual bool MatchesForCrafting -- //Refect if trying to oversharpen |
63 | 42 | * */ |
64 | 43 | |
65 | - public SteelWrap( ) //Since It Invokes that for the new type of T anyways... | |
44 | + public SteelWrapItem( ) //Since It Invokes that for the new type of T anyways... | |
66 | 45 | { |
67 | - WrappedItem = new T(); | |
46 | + WrappedItem = new OrigItem(); | |
68 | 47 | } |
69 | 48 | |
70 | - public SteelWrap(int itemId) : base(itemId) | |
49 | + public SteelWrapItem(int itemId) : base(itemId) | |
71 | 50 | { |
72 | - WrappedItem = new T(); | |
51 | + WrappedItem = new OrigItem(); | |
73 | 52 | WrappedItem.ItemId = itemId; |
74 | 53 | WrappedItem.MaxStackSize = 1; |
75 | 54 | } |
@@ -98,60 +77,12 @@ namespace ElementalTools | ||
98 | 77 | api.World.Logger.Error("Substituting class name from wrapped Item '{0}'", trueClassName); |
99 | 78 | } |
100 | 79 | |
101 | - | |
102 | - WrappedItem = api.ClassRegistry.CreateItem(trueClassName); | |
103 | - | |
104 | - WrappedItem.ItemId = this.ItemId; | |
105 | - WrappedItem.Code = this.Code.Clone( ); | |
106 | - WrappedItem.Class = trueClassName; | |
107 | - WrappedItem.Textures = this.Textures; | |
108 | - WrappedItem.Variant = this.Variant; | |
109 | - WrappedItem.VariantStrict = this.VariantStrict; | |
110 | - WrappedItem.Tool = this?.Tool; | |
111 | - WrappedItem.Attributes = this?.Attributes?.Clone(); | |
112 | - WrappedItem.MiningSpeed = this?.MiningSpeed; | |
113 | - WrappedItem.Shape = this.Shape; | |
114 | - WrappedItem.StorageFlags = this.StorageFlags; | |
115 | - WrappedItem.DamagedBy = this.DamagedBy; | |
116 | - WrappedItem.Durability = this.Durability; | |
117 | - WrappedItem.AttackPower = this.AttackPower; | |
118 | - WrappedItem.AttackRange = this.AttackRange; | |
119 | - WrappedItem.ToolTier = this.ToolTier; | |
120 | - WrappedItem.MaxStackSize = this.MaxStackSize; | |
121 | - WrappedItem.MaterialDensity = this.MaterialDensity; | |
122 | - WrappedItem.GuiTransform = this.GuiTransform; | |
123 | - WrappedItem.FpHandTransform = this.FpHandTransform; | |
124 | - WrappedItem.TpHandTransform = this.TpHandTransform; | |
125 | - WrappedItem.GroundTransform = this.GroundTransform; | |
126 | - | |
127 | - | |
128 | - WrappedItem.OnLoadedNative(api);//Hacky - but needed? | |
129 | - //WrappedItem.OnLoaded(api); // ItemScythe : ItemShears Needs this! | |
130 | - } | |
131 | - | |
132 | - #region Static Properties | |
133 | - public virtual bool Hardenable { | |
134 | - get | |
135 | - { | |
136 | - return this.Attributes[hardenableKeyword].AsBool(false); | |
137 | - } | |
80 | + WrappedItem = ( OrigItem )api.ClassRegistry.CreateItem(trueClassName);//( T )api.World.Items[this.ItemId];// Old Item class (name) should still exist. | |
81 | + | |
82 | + OverwriteFields(WrappedItem); | |
138 | 83 | } |
139 | - | |
140 | 84 | |
141 | - public virtual string Name { | |
142 | - get | |
143 | - { | |
144 | - return this.Attributes[metalNameKeyword].AsString("?"); | |
145 | - } | |
146 | - } | |
147 | 85 | |
148 | - public virtual bool Sharpenable { | |
149 | - get | |
150 | - { | |
151 | - return this.Attributes[sharpenableKeyword].AsBool(false); | |
152 | - } | |
153 | - } | |
154 | - #endregion | |
155 | 86 | |
156 | 87 | |
157 | 88 |
@@ -160,185 +91,40 @@ namespace ElementalTools | ||
160 | 91 | public override void GetHeldItemInfo(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world, bool withDebugInfo) |
161 | 92 | { |
162 | 93 | if (inSlot == null || inSlot.Empty || inSlot.Inventory == null) { |
163 | - api.World.Logger.Warning("GetHeldItemInfo -> Invetory / slot / stack: FUBAR!"); | |
164 | - return; | |
165 | - } | |
166 | - | |
167 | - WrappedItem?.GetHeldItemInfo(inSlot, dsc, world, withDebugInfo); | |
168 | - | |
169 | - var hardness = Hardness(inSlot.Itemstack); | |
170 | - var sharpness = Sharpness(inSlot.Itemstack); | |
171 | - | |
172 | - dsc.AppendFormat("\nMetal: '{0}' ",Name); | |
173 | - | |
174 | - if (this.Hardenable || hardness != HardnessState.Soft) { | |
175 | - dsc.AppendFormat(", Temper: {0}\n", hardness); | |
176 | - } | |
177 | - | |
178 | - if (this.Sharpenable) { | |
179 | - dsc.AppendFormat(", Edge: {0}\n", sharpness); | |
180 | - } | |
181 | - | |
182 | - } | |
183 | - | |
184 | - public virtual SharpnessState Sharpness(IItemStack someStack) | |
185 | - { | |
186 | - if (someStack.Attributes != null && someStack.Attributes.HasAttribute(sharpnessKeyword)) { | |
187 | - byte[ ] bytes = new byte[1]; | |
188 | - bytes = someStack.Attributes.GetBytes(sharpnessKeyword, bytes); | |
189 | - return bytes == null ? SharpnessState.Rough : ( SharpnessState )bytes[0]; | |
190 | - } | |
191 | - | |
192 | - return SharpnessState.Rough; | |
193 | - } | |
194 | - | |
195 | - public virtual void Sharpness(IItemStack someStack, SharpnessState set) | |
196 | - { | |
197 | - byte[ ] bytes = new byte[1]; | |
198 | - bytes[0] = (byte)set; | |
199 | - someStack.Attributes.SetBytes(sharpnessKeyword, bytes); | |
200 | - } | |
201 | - | |
202 | - public virtual SharpnessState Dull(IItemStack someStack) | |
203 | - { | |
204 | - if (someStack.Attributes != null && someStack.Attributes.HasAttribute(sharpnessKeyword)) { | |
205 | - byte[ ] bytes = new byte[1]; | |
206 | - bytes = someStack.Attributes.GetBytes(sharpnessKeyword, bytes); | |
207 | - var state = ( SharpnessState )bytes[0]; | |
208 | - | |
209 | - if (state > SharpnessState.Rough) state--; | |
210 | - | |
211 | - bytes[0] = ( byte )state; | |
212 | - someStack.Attributes.SetBytes(sharpnessKeyword, bytes); | |
213 | - | |
214 | - return state; | |
215 | - } | |
216 | - return SharpnessState.Rough; | |
217 | - } | |
218 | - | |
219 | - public virtual HardnessState Hardness(IItemStack someStack) | |
220 | - { | |
221 | - if (someStack.Attributes != null && someStack.Attributes.HasAttribute(hardnessKeyword)) { | |
222 | - byte[ ] bytes = new byte[1]; | |
223 | - bytes = someStack.Attributes.GetBytes(hardnessKeyword, bytes); | |
224 | - return bytes == null ? HardnessState.Soft : ( HardnessState )bytes[0]; | |
225 | - } | |
226 | - | |
227 | - return HardnessState.Soft; | |
228 | - } | |
229 | - | |
230 | - public virtual void Hardness(IItemStack someStack, HardnessState set) | |
231 | - { | |
232 | - byte[ ] bytes = new byte[1]; | |
233 | - bytes[0] = ( byte )set; | |
234 | - someStack.Attributes.SetBytes(hardnessKeyword, bytes); | |
235 | - } | |
236 | - | |
237 | - public virtual SharpnessState Sharpen(IItemStack someStack) | |
238 | - { | |
239 | - if (this.Sharpenable == false) { | |
240 | - api.World.Logger.VerboseDebug("Can't sharpen! {0}", this.Code); | |
241 | - return this.Sharpness(someStack);; | |
242 | - } | |
243 | - | |
244 | - SharpnessState sharp = Sharpness(someStack); | |
245 | - | |
246 | - if (sharp < SharpnessState.Razor) { Sharpness(someStack, ++sharp); } | |
247 | - //TODO: Play sound effect | |
248 | 94 | #if DEBUG |
249 | - api.World.Logger.VerboseDebug("Sharpness of '{1}' increased to: {0}", sharp, this.Code); | |
95 | + api.World.Logger.Warning("GetHeldItemInfo -> Invetory / slot / stack: FUBAR!"); | |
250 | 96 | #endif |
251 | - | |
252 | - //TODO: If durability exists - decriment based on Hardnes Vs. Wear... | |
253 | - if (this.Durability > 1) { | |
254 | - | |
255 | - var currentDur = GetDurability(someStack); | |
256 | - SetDurability(someStack,--currentDur); | |
97 | + return; | |
257 | 98 | } |
258 | 99 | |
259 | - return sharp; | |
100 | + base.GetHeldItemInfo(inSlot, dsc, world, withDebugInfo); | |
101 | + SteelAspects.GetHeldItemInfo(api, inSlot, dsc, world, withDebugInfo); | |
260 | 102 | } |
261 | 103 | |
262 | - public virtual void CopyAttributes(ItemStack donor, ItemStack recipient) | |
263 | - { | |
264 | - | |
265 | - if (donor.Class == recipient.Class) { | |
266 | - var hI = (donor.Item as IAmSteel).Hardness(donor); | |
267 | - var sI = (donor.Item as IAmSteel).Sharpness(donor); | |
268 | 104 | |
269 | - (recipient.Item as IAmSteel).Hardness(recipient, hI); | |
270 | - (recipient.Item as IAmSteel).Sharpness(recipient, sI); | |
271 | 105 | |
272 | - if (donor.Item.Durability > 0) | |
273 | - { | |
274 | - var wear = GetDurability(donor); | |
275 | 106 | |
276 | - if (donor.Item.IsFerricMetal( ) && recipient.Item.IsSteelMetal( )) { | |
277 | - var percentWear = (wear / donor.Item.Durability); | |
278 | - SetDurability(recipient, recipient.Item.Durability * percentWear); | |
279 | - } | |
280 | - else SetDurability(recipient, wear); | |
281 | - } | |
282 | 107 | |
283 | - } | |
284 | - } | |
285 | 108 | |
286 | 109 | |
287 | 110 | /// <summary> |
288 | - /// ??? | |
111 | + /// Future use... | |
289 | 112 | /// </summary> |
290 | 113 | /// <returns>The attack power.</returns> |
291 | 114 | /// <param name="withItemStack">With item stack.</param> |
292 | 115 | public override void OnHeldDropped(IWorldAccessor world, IPlayer byPlayer, ItemSlot slot, int quantity, ref EnumHandling handling) |
293 | 116 | { |
294 | - //If Temperature > 450C - Set Timestamp? | |
295 | - | |
296 | - | |
297 | 117 | WrappedItem.OnHeldDropped(world, byPlayer, slot, quantity, ref handling); |
298 | 118 | } |
299 | 119 | |
300 | 120 | /// <summary> |
301 | - /// Does Quench-hardening | |
121 | + /// For; Quench-harden... | |
302 | 122 | /// </summary> |
303 | - /// <returns>The ground idle.</returns> | |
304 | - /// <param name="entityItem">Entity item.</param> | |
123 | + /// <param name="entityItem">Entity item.(Itself)</param> | |
305 | 124 | public override void OnGroundIdle(EntityItem entityItem) |
306 | 125 | { |
307 | - if (api.Side.IsServer() && (entityItem.Swimming || entityItem.FeetInLiquid)) { | |
308 | - | |
309 | - if (!this.Hardenable) return; | |
310 | - | |
311 | - float temperature = entityItem.Itemstack.Collectible.GetTemperature(api.World, entityItem.Itemstack); | |
312 | - //Track first moment in liquid; | |
313 | - this.SetTimestamp(entityItem);//Need to clear when NORMALIZING. | |
314 | - | |
315 | - //Above 900C - What should happen in this range; different phase of iron? | |
316 | - | |
317 | - //temperature <= eutectoid_transition_temperature || | |
318 | - if ( temperature >= quench_min_temperature ) | |
319 | - { | |
320 | - //TODO: Thermal capacity & Transfer values for NON-Water fluids...and surfaces too! | |
321 | - var elapsedTime = this.GetTimestampElapsed(entityItem); | |
322 | - | |
323 | - uint quenchUnits = ( uint )Math.Round(elapsedTime.TotalMilliseconds / quenchTimeConstant, 0); | |
324 | - | |
325 | - if (quenchUnits < (uint)HardnessState.Brittle) { | |
326 | - this.Hardness(entityItem.Itemstack, ( HardnessState )quenchUnits); | |
327 | - } | |
328 | - else { | |
329 | - this.Hardness(entityItem.Itemstack, HardnessState.Brittle); | |
330 | - } | |
331 | - | |
332 | - //Being that water conducts heat well - reduce Temperature _FASTER_ | |
333 | - entityItem.Itemstack.Collectible.SetTemperature(api.World, entityItem.Itemstack, temperature - 15, false); | |
334 | - | |
335 | - #if DEBUG | |
336 | - api.World.Logger.VerboseDebug("Quench process: {0}S elapsed @{1}C H:{2} ~ QU#{3}", elapsedTime.TotalSeconds, temperature, this.Hardness(entityItem.Itemstack), quenchUnits ); | |
337 | - #endif | |
338 | - } | |
339 | - } | |
340 | - | |
341 | - WrappedItem.OnGroundIdle(entityItem); | |
126 | + SteelAspects.QuenchHarden(this, entityItem, api); | |
127 | + base.OnGroundIdle(entityItem); | |
342 | 128 | } |
343 | 129 | |
344 | 130 | #endregion |
@@ -355,7 +141,7 @@ namespace ElementalTools | ||
355 | 141 | float pctBoost = 0;//CONSIDER: Perhaps make this external? |
356 | 142 | switch (sharpness) { |
357 | 143 | case SharpnessState.Rough: |
358 | - pctBoost = -0.35f; | |
144 | + pctBoost = -0.25f; | |
359 | 145 | break; |
360 | 146 | |
361 | 147 | case SharpnessState.Dull: |
@@ -366,13 +152,13 @@ namespace ElementalTools | ||
366 | 152 | pctBoost = 0.10f; |
367 | 153 | break; |
368 | 154 | case SharpnessState.Keen: |
369 | - pctBoost = 0.20f; | |
155 | + pctBoost = 0.15f; | |
370 | 156 | break; |
371 | 157 | case SharpnessState.Sharp: |
372 | - pctBoost = 0.25f; | |
158 | + pctBoost = 0.20f; | |
373 | 159 | break; |
374 | 160 | case SharpnessState.Razor: |
375 | - pctBoost = 0.30f; | |
161 | + pctBoost = 0.25f; | |
376 | 162 | break; |
377 | 163 | } |
378 | 164 |
@@ -414,7 +200,7 @@ namespace ElementalTools | ||
414 | 200 | bool catasptrophicFailure = world.Rand.Next(1, 1000) >= 999; |
415 | 201 | if (catasptrophicFailure) { |
416 | 202 | world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", this.Code); |
417 | - this.SetDurability(itemslot.Itemstack, 0); | |
203 | + SteelAspects.SetHitpoints(itemslot.Itemstack, 0); | |
418 | 204 | this.DamageItem(world, byEntity, itemslot, 9999); |
419 | 205 | return; |
420 | 206 | } |
@@ -428,7 +214,8 @@ namespace ElementalTools | ||
428 | 214 | |
429 | 215 | |
430 | 216 | |
431 | - public override bool OnBlockBrokenWith(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel) | |
217 | + | |
218 | + public override bool OnBlockBrokenWith(IWorldAccessor world, Entity byEntity, ItemSlot itemslot, BlockSelection blockSel, float dropQuantityMultiplier = 1f) | |
432 | 219 | { |
433 | 220 | if (api.Side.IsClient()) return true; |
434 | 221 |
@@ -450,15 +237,16 @@ namespace ElementalTools | ||
450 | 237 | //Tool Specific special damage reduction rate: e.g. scythe, hoe, knife, here... |
451 | 238 | //By MiningSpeed |
452 | 239 | |
453 | - | |
240 | + #if DEBUG | |
454 | 241 | api.World.Logger.VerboseDebug($"OnBlockBrokenWith:: (Weap:{weapon},Edge:{edged},OK: {recomendedUsage},T.T#{targetTier}) {byEntity.Code} -> {targetBlock.Code}"); |
242 | + #endif | |
455 | 243 | |
456 | 244 | if (recomendedUsage == false && hardness > HardnessState.Hard) { |
457 | 245 | bool catasptrophicFailure = world.Rand.Next(1, 1000) >= (999 - (targetTier * 5)); |
458 | 246 | |
459 | 247 | if (catasptrophicFailure) { |
460 | 248 | world.Logger.VerboseDebug("Catastrophic brittle fracture of {0} !", this.Code); |
461 | - this.SetDurability(itemslot.Itemstack, 0); | |
249 | + SteelAspects.SetHitpoints(itemslot.Itemstack, 0); | |
462 | 250 | this.DamageItem(world, byEntity, itemslot, 9999); |
463 | 251 | return true; |
464 | 252 | } |
@@ -522,7 +310,7 @@ namespace ElementalTools | ||
522 | 310 | |
523 | 311 | |
524 | 312 | /// <summary> |
525 | - /// Advanced formula to calculate wear based on 'sharpness' and 'durability' inherint | |
313 | + /// Handle Sharpening by Item + Craft-Grid use | |
526 | 314 | /// </summary> |
527 | 315 | /// <returns>The consumed by crafting.</returns> |
528 | 316 | /// <param name="allInputSlots">All input slots.</param> |
@@ -572,7 +360,6 @@ namespace ElementalTools | ||
572 | 360 | return; |
573 | 361 | } |
574 | 362 | |
575 | - | |
576 | 363 | var steelItemSlot = (from inputSlot in allInputslots |
577 | 364 | where inputSlot.Empty == false |
578 | 365 | where inputSlot.Itemstack.Class == EnumItemClass.Item |
@@ -585,33 +372,37 @@ namespace ElementalTools | ||
585 | 372 | where inputSlot.Itemstack.Collectible.IsSharpener() |
586 | 373 | select inputSlot).SingleOrDefault( ); |
587 | 374 | |
588 | - if (steelItemSlot != null) { | |
589 | - | |
590 | - if (steelItemSlot.Itemstack.Item is IAmSteel) { | |
591 | - var steelItem = steelItemSlot.Itemstack.Item; | |
592 | - | |
593 | - api.World.Logger.VerboseDebug("Input (ingredient) Item {0} supports; Steel Interface ", steelItem.Code); | |
594 | - | |
595 | - if (!outputSlot.Empty && outputSlot.Itemstack.Class == EnumItemClass.Item | |
596 | - && outputSlot.Itemstack.Item is IAmSteel) { | |
597 | - var outputItem = outputSlot.Itemstack.Item; | |
598 | - var fullMetalInterface = outputSlot.Itemstack.Item as IAmSteel; | |
599 | - api.World.Logger.VerboseDebug("Output Item {0} supports; Steel Interface ", steelItem.Code); | |
600 | - | |
601 | - fullMetalInterface.CopyAttributes(steelItemSlot.Itemstack, outputSlot.Itemstack); | |
602 | - | |
603 | - if (sharpenerItemSlot != null) fullMetalInterface.Sharpen(outputSlot.Itemstack); | |
604 | - api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1} ", steelItem.Code, outputItem.Code); | |
605 | - } | |
606 | - | |
607 | - | |
608 | - } | |
375 | + if (steelItemSlot != null) | |
376 | + { | |
377 | + if (steelItemSlot.Itemstack.Item is ISteelByStack) | |
378 | + { | |
379 | + var steelItem = steelItemSlot.Itemstack.Item; | |
609 | 380 | |
381 | + #if DEBUG | |
382 | + api.World.Logger.VerboseDebug("Input (ingredient) Item {0} supports; Steel Interface ", steelItem.Code); | |
383 | + #endif | |
384 | + if (!outputSlot.Empty && outputSlot.Itemstack.Class == EnumItemClass.Item | |
385 | + && outputSlot.Itemstack.Item is ISteelByStack) | |
386 | + { | |
387 | + var outputItem = outputSlot.Itemstack.Item; | |
388 | + var fullMetalInterface = outputSlot.Itemstack.Item as ISteelByStack; | |
389 | + #if DEBUG | |
390 | + api.World.Logger.VerboseDebug("Output Item {0} supports; Steel Interface ", steelItem.Code); | |
391 | + #endif | |
392 | + | |
393 | + fullMetalInterface.CopyStackAttributes(steelItemSlot.Itemstack, outputSlot.Itemstack); | |
394 | + | |
395 | + if (sharpenerItemSlot != null) fullMetalInterface.Sharpen(outputSlot.Itemstack); | |
396 | + #if DEBUG | |
397 | + api.World.Logger.VerboseDebug("Attributes perpetuated from {0} to {1} ", steelItem.Code, outputItem.Code); | |
398 | + #endif | |
399 | + } | |
400 | + } | |
610 | 401 | } |
611 | 402 | |
612 | 403 | } |
613 | 404 | |
614 | - public override float GetMiningSpeed(IItemStack itemstack, Block block) | |
405 | + public override float GetMiningSpeed(IItemStack itemstack, BlockSelection blockSel, Block block, IPlayer forPlayer) | |
615 | 406 | { |
616 | 407 | var baseSpeed = 1f; |
617 | 408 | //Boost for Edged tools / weapons |
@@ -652,25 +443,25 @@ namespace ElementalTools | ||
652 | 443 | |
653 | 444 | switch (edge) { |
654 | 445 | case SharpnessState.Rough: |
655 | - return this.color_Rough; | |
446 | + return SteelAspects.color_Rough; | |
656 | 447 | |
657 | 448 | case SharpnessState.Dull: |
658 | - return this.color_Dull; | |
449 | + return SteelAspects.color_Dull; | |
659 | 450 | |
660 | 451 | case SharpnessState.Honed: |
661 | - return this.color_Honed; | |
452 | + return SteelAspects.color_Honed; | |
662 | 453 | |
663 | 454 | case SharpnessState.Keen: |
664 | - return this.color_Keen; | |
455 | + return SteelAspects.color_Keen; | |
665 | 456 | |
666 | 457 | case SharpnessState.Sharp: |
667 | - return this.color_Sharp; | |
458 | + return SteelAspects.color_Sharp; | |
668 | 459 | |
669 | 460 | case SharpnessState.Razor: |
670 | - return this.color_Razor; | |
461 | + return SteelAspects.color_Razor; | |
671 | 462 | } |
672 | 463 | |
673 | - return this.color_Default; | |
464 | + return SteelAspects.color_Default; | |
674 | 465 | } |
675 | 466 | |
676 | 467 | #endregion |
@@ -679,60 +470,27 @@ namespace ElementalTools | ||
679 | 470 | //Wire up all invokes >>> to NOT call Base - but (WrappedItem) T instead ! |
680 | 471 | #region Wrapped_Calls |
681 | 472 | |
682 | - public override float OnBlockBreaking(IPlayer player, BlockSelection blockSel, ItemSlot itemslot, float remainingResistance, float dt, int counter) | |
683 | - { | |
684 | - return WrappedItem.OnBlockBreaking(player, blockSel, itemslot, remainingResistance, dt, counter); | |
685 | - } | |
473 | + public override float OnBlockBreaking(IPlayer player, BlockSelection blockSel, ItemSlot itemslot, float remainingResistance, float dt, int counter) => WrappedItem.OnBlockBreaking(player, blockSel, itemslot, remainingResistance, dt, counter); | |
686 | 474 | |
687 | - public override void OnHeldInteractStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, bool firstEvent, ref EnumHandHandling handling) | |
688 | - { | |
689 | - WrappedItem.OnHeldInteractStart(slot, byEntity, blockSel, entitySel, firstEvent, ref handling); | |
690 | - } | |
475 | + 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); | |
691 | 476 | |
692 | - public override bool OnHeldInteractStep(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) | |
693 | - { | |
694 | - return WrappedItem.OnHeldInteractStep(secondsUsed, slot, byEntity, blockSel, entitySel); | |
695 | - } | |
477 | + public override bool OnHeldInteractStep(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) => WrappedItem.OnHeldInteractStep(secondsUsed, slot, byEntity, blockSel, entitySel); | |
696 | 478 | |
697 | - public override void OnHeldInteractStop(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) | |
698 | - { | |
699 | - WrappedItem.OnHeldInteractStop(secondsUsed, slot, byEntity, blockSel, entitySel); | |
700 | - } | |
479 | + public override void OnHeldInteractStop(float secondsUsed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel) => WrappedItem.OnHeldInteractStop(secondsUsed, slot, byEntity, blockSel, entitySel); | |
701 | 480 | |
702 | - public override int GetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection) | |
703 | - { | |
704 | - return WrappedItem.GetToolMode(slot, byPlayer, blockSelection); | |
705 | - } | |
481 | + public override int GetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection) => WrappedItem.GetToolMode(slot, byPlayer, blockSelection); | |
706 | 482 | |
707 | - public override void SetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection, int toolMode) | |
708 | - { | |
709 | - WrappedItem.SetToolMode(slot, byPlayer, blockSelection, toolMode); | |
710 | - } | |
483 | + public override void SetToolMode(ItemSlot slot, IPlayer byPlayer, BlockSelection blockSelection, int toolMode) => WrappedItem.SetToolMode(slot, byPlayer, blockSelection, toolMode); | |
711 | 484 | |
712 | - public override SkillItem[ ] GetToolModes(ItemSlot slot, IClientPlayer forPlayer, BlockSelection blockSel) | |
713 | - { | |
714 | - return WrappedItem.GetToolModes(slot, forPlayer, blockSel); | |
715 | - } | |
485 | + public override SkillItem[ ] GetToolModes(ItemSlot slot, IClientPlayer forPlayer, BlockSelection blockSel) => WrappedItem.GetToolModes(slot, forPlayer, blockSel); | |
716 | 486 | |
717 | - public override void OnHeldAttackStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, ref EnumHandHandling handling) | |
718 | - { | |
719 | - WrappedItem.OnHeldAttackStart(slot, byEntity, blockSel, entitySel, ref handling); | |
720 | - } | |
487 | + public override void OnHeldAttackStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, ref EnumHandHandling handling) => WrappedItem.OnHeldAttackStart(slot, byEntity, blockSel, entitySel, ref handling); | |
721 | 488 | |
722 | - public override bool OnHeldAttackStep(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel) | |
723 | - { | |
724 | - return WrappedItem.OnHeldAttackStep(secondsPassed, slot, byEntity, blockSelection, entitySel); | |
725 | - } | |
489 | + public override bool OnHeldAttackStep(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel) => WrappedItem.OnHeldAttackStep(secondsPassed, slot, byEntity, blockSelection, entitySel); | |
726 | 490 | |
727 | - public override void OnHeldAttackStop(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel) | |
728 | - { | |
729 | - WrappedItem.OnHeldAttackStop(secondsPassed, slot, byEntity, blockSelection, entitySel); | |
730 | - } | |
491 | + public override void OnHeldAttackStop(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel) => WrappedItem.OnHeldAttackStop(secondsPassed, slot, byEntity, blockSelection, entitySel); | |
731 | 492 | |
732 | - public override bool OnHeldAttackCancel(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel, EnumItemUseCancelReason cancelReason) | |
733 | - { | |
734 | - return WrappedItem.OnHeldAttackCancel(secondsPassed, slot, byEntity, blockSelection, entitySel, cancelReason); | |
735 | - } | |
493 | + public override bool OnHeldAttackCancel(float secondsPassed, ItemSlot slot, EntityAgent byEntity, BlockSelection blockSelection, EntitySelection entitySel, EnumItemUseCancelReason cancelReason) => WrappedItem.OnHeldAttackCancel(secondsPassed, slot, byEntity, blockSelection, entitySel, cancelReason); | |
736 | 494 | |
737 | 495 | |
738 | 496 | /* |
@@ -766,7 +524,6 @@ namespace ElementalTools | ||
766 | 524 | |
767 | 525 | public override float AppendPerishableInfoText(ItemSlot inSlot, StringBuilder dsc, IWorldAccessor world) |
768 | 526 | { |
769 | - api.World.Logger.VerboseDebug("AppendPerishableInfoText - invoked"); | |
770 | 527 | return 0f;//HACK: to stop missing variables from causing a fault |
771 | 528 | } |
772 | 529 |
@@ -774,28 +531,22 @@ namespace ElementalTools | ||
774 | 531 | #endregion |
775 | 532 | |
776 | 533 | |
777 | - internal void SetDurability(IItemStack recipient, int wearLevel) | |
778 | - { | |
779 | - recipient.Attributes.SetInt(durabilityKeyword, wearLevel); | |
780 | - } | |
781 | 534 | |
782 | - internal int GetDurability(IItemStack recipient) | |
783 | - { | |
784 | - return recipient.Attributes.GetInt(durabilityKeyword, recipient.Item.Durability); | |
785 | - } | |
786 | 535 | |
787 | - internal void SetTimestamp(EntityItem entityItem) | |
536 | + | |
537 | + | |
538 | + protected void SetTimestamp(EntityItem entityItem) | |
788 | 539 | { |
789 | 540 | |
790 | - if (!entityItem.Attributes.HasAttribute(_timestampKey)) { | |
791 | - entityItem.Attributes.SetLong(_timestampKey, DateTime.Now.Ticks); | |
541 | + if (!entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) { | |
542 | + entityItem.Attributes.SetLong(SteelAspects._timestampKey, DateTime.Now.Ticks); | |
792 | 543 | } |
793 | 544 | } |
794 | 545 | |
795 | - internal TimeSpan GetTimestampElapsed(EntityItem entityItem) | |
546 | + protected TimeSpan GetTimestampElapsed(EntityItem entityItem) | |
796 | 547 | { |
797 | - if (entityItem.Attributes.HasAttribute(_timestampKey)) { | |
798 | - var ts = TimeSpan.FromTicks(entityItem.Attributes.GetLong(_timestampKey)); | |
548 | + if (entityItem.Attributes.HasAttribute(SteelAspects._timestampKey)) { | |
549 | + var ts = TimeSpan.FromTicks(entityItem.Attributes.GetLong(SteelAspects._timestampKey)); | |
799 | 550 | return ts.Subtract(TimeSpan.FromTicks(DateTime.Now.Ticks)).Negate(); |
800 | 551 | } |
801 | 552 | return TimeSpan.Zero; |
@@ -1,10 +1,121 @@ | ||
1 | 1 | using System; |
2 | + | |
3 | +using Vintagestory.API.Client; | |
4 | +using Vintagestory.API.Common; | |
5 | +using Vintagestory.API.MathTools; | |
6 | +using Vintagestory.GameContent; | |
7 | + | |
2 | 8 | namespace ElementalTools |
3 | 9 | { |
4 | - public class PackCarburization_Renderer | |
10 | + public class PackCarburization_Renderer : IInFirepitRenderer //FirepitContentsRenderer | |
5 | 11 | { |
6 | - public PackCarburization_Renderer( ) | |
12 | + private BlockPos pos; | |
13 | + private ICoreClientAPI clientAPI; | |
14 | + private ItemStack localStack; | |
15 | + private bool isInOutputSlot; | |
16 | + | |
17 | + private MeshRef carbpack_MeshRef; | |
18 | + private Matrixf carbpack_ModelMatrix = new Matrixf( ); | |
19 | + | |
20 | + private int textureId; | |
21 | + private float voxelHeight; | |
22 | + protected int glowLevel; | |
23 | + | |
24 | + public double RenderOrder { | |
25 | + get | |
26 | + { | |
27 | + return 0.5; | |
28 | + } | |
29 | + } | |
30 | + | |
31 | + public int RenderRange { | |
32 | + get | |
33 | + { | |
34 | + return 20; | |
35 | + } | |
36 | + } | |
37 | + | |
38 | + public PackCarburization_Renderer(ICoreClientAPI capi, ItemStack stack, BlockPos pos, bool isInOutputSlot) | |
39 | + { | |
40 | + this.clientAPI = capi; | |
41 | + this.localStack = stack; | |
42 | + this.pos = pos; | |
43 | + this.isInOutputSlot = isInOutputSlot; | |
44 | + | |
45 | + PackCarburization packBlock = clientAPI.World.GetBlock(stack.Collectible.Code) as PackCarburization; | |
46 | + | |
47 | + | |
48 | + MeshData pack_MeshData; | |
49 | + //path: "shapes/block/metallurgy/pack_carburization.json" | |
50 | + var shapePath = packBlock.Shape.Base.CopyWithPath("shapes/" + packBlock.Shape.Base.Path + ".json");//Why append filenames, can't Shape have a type-param?! | |
51 | + | |
52 | + #if DEBUG | |
53 | + capi.Logger.VerboseDebug("Shape-path: {0}", shapePath); | |
54 | + #endif | |
55 | + capi.Tesselator.TesselateShape(packBlock, Shape.TryGet(capi, shapePath), out pack_MeshData); | |
56 | + | |
57 | + carbpack_MeshRef = capi.Render.UploadMesh(pack_MeshData); | |
58 | + } | |
59 | + | |
60 | + | |
61 | + public void Dispose( ) | |
62 | + { | |
63 | + clientAPI.Event.UnregisterRenderer(this, EnumRenderStage.Opaque); | |
64 | + carbpack_MeshRef?.Dispose( ); | |
65 | + } | |
66 | + | |
67 | + public void OnCookingComplete( ) | |
68 | + { | |
69 | + isInOutputSlot = true; | |
70 | + //What Else?? | |
71 | + } | |
72 | + | |
73 | + | |
74 | + public void OnRenderFrame(float deltaTime, EnumRenderStage stage) | |
75 | + { | |
76 | + IRenderAPI renderAPI = clientAPI.Render; | |
77 | + Vec3d camPos = clientAPI.World.Player.Entity.CameraPos; | |
78 | + | |
79 | + renderAPI.GlDisableCullFace( ); | |
80 | + renderAPI.GlToggleBlend(true); | |
81 | + | |
82 | + IStandardShaderProgram shader = renderAPI.PreparedStandardShader(pos.X, pos.Y, pos.Z); | |
83 | + | |
84 | + shader.Tex2D = clientAPI.BlockTextureAtlas.AtlasTextureIds[0]; | |
85 | + shader.DontWarpVertices = 0; | |
86 | + shader.AddRenderFlags = 0; | |
87 | + shader.RgbaAmbientIn = renderAPI.AmbientColor; | |
88 | + shader.RgbaFogIn = renderAPI.FogColor; | |
89 | + shader.FogMinIn = renderAPI.FogMin; | |
90 | + shader.FogDensityIn = renderAPI.FogDensity; | |
91 | + shader.RgbaTint = ColorUtil.WhiteArgbVec; | |
92 | + shader.NormalShaded = 1; | |
93 | + shader.ExtraGodray = 0; | |
94 | + shader.ExtraGlow = glowLevel; | |
95 | + shader.SsaoAttn = 0; | |
96 | + shader.AlphaTest = 0.05f; | |
97 | + shader.OverlayOpacity = 0; | |
98 | + | |
99 | + //TODO: Change constants to work for Carburization pack sizes / offsets... | |
100 | + shader.ModelMatrix = carbpack_ModelMatrix | |
101 | + .Identity( ) | |
102 | + .Translate(pos.X - camPos.X + 0.001f, pos.Y - camPos.Y, pos.Z - camPos.Z - 0.001f) | |
103 | + .Translate(0f, 1 / 16f, 0f) | |
104 | + .Values; | |
105 | + | |
106 | + shader.ViewMatrix = renderAPI.CameraMatrixOriginf; | |
107 | + shader.ProjectionMatrix = renderAPI.CurrentProjectionMatrix; | |
108 | + | |
109 | + renderAPI.RenderMesh(carbpack_MeshRef); | |
110 | + | |
111 | + shader.Stop( ); | |
112 | + } | |
113 | + | |
114 | + | |
115 | + public void OnUpdate(float temperature) | |
7 | 116 | { |
117 | + //Correct GLOW INCANDESCENT level? | |
118 | + this.glowLevel = ( int )(temperature / 100); | |
8 | 119 | } |
9 | 120 | } |
10 | 121 | } |
@@ -0,0 +1,57 @@ | ||
1 | +{ | |
2 | + code: "crusie_lamp", | |
3 | + behaviors: [ | |
4 | + { name: "UnstableFalling", properties: { | |
5 | + attachableFaces: ["up", "down"], | |
6 | + impactDamageMul: 10, | |
7 | + attachmentAreas: { | |
8 | + "down": { x1: 7, y1: 15, z1: 7, x2: 8, y2: 15, z2: 8 }, | |
9 | + "up": { x1: 7, y1: 0, z1: 7, x2: 8, y2: 0, z2: 8 } | |
10 | + } | |
11 | + }} | |
12 | + ], | |
13 | + creativeinventory: { "decorative": ["*"] }, | |
14 | + textures: { | |
15 | + "fuel": { base:"block/candle" }, | |
16 | + "iron": { base: "block/metal/black_iron2" }, | |
17 | + "wick": { base:"block/candle" }, | |
18 | + }, | |
19 | + shape: { base: "block/metal/crusie_lamp" }, | |
20 | + drawtype: "json", | |
21 | + blockmaterial: "Metal", | |
22 | + sidesolid: { all: false }, | |
23 | + sideopaque: { all: false }, | |
24 | + resistance: 3, | |
25 | + lightHsv: [9, 3, 16], | |
26 | + lightAbsorption: 0, | |
27 | + collisionSelectionBox: { x1: 0.0625, y1: 0, z1: 0.0625, x2: 0.9375, y2: 1, z2: 0.9375 }, | |
28 | + sounds: { | |
29 | + hit: "block/chandelier-hit", | |
30 | + break: "block/chandelier-break", | |
31 | + }, | |
32 | + particleProperties: [ | |
33 | + { | |
34 | + posOffset: [ | |
35 | + { avg: 0.5, var: 0 },{ avg: 0.7, var: 0 },{ avg: 0.7, var: 0 } | |
36 | + ], | |
37 | + velocity: [ | |
38 | + { avg: 0.07, var: 0.06 },{ avg: 0.1, var: 0 },{ avg: 0.1, var: 0 } | |
39 | + ], | |
40 | + hsvaColor: [ | |
41 | + { avg: 48, var: 0 }, { avg: 1, var: 0 }, | |
42 | + { avg: 1, var: 0 }, { avg: 132, var: 123 } | |
43 | + ], | |
44 | + quantity: { avg: 5, var: 0 }, | |
45 | + lifeLength: { avg: 0.14, var: 0.07 }, | |
46 | + gravityEffect: { avg: -0.12, var: -0.03 }, | |
47 | + size: { avg: 0.02, var: 0.01 }, | |
48 | + particleModel: "Quad", | |
49 | + sizeEvolve: { transform: "linear", factor: 0.1 }, | |
50 | + opacityEvolve: { transform: "quadratic", factor: -20 }, | |
51 | + dieInLiquid: true, | |
52 | + terrainCollision: false, | |
53 | + windAffectednes: 0.5, | |
54 | + vertexFlags: 255 | |
55 | + } | |
56 | + ], | |
57 | +} | |
\ No newline at end of file |
@@ -0,0 +1,38 @@ | ||
1 | +{ | |
2 | + code: "metal_cards", | |
3 | + classByType: { | |
4 | + "metal_cards-blister_steel": "ConsolidatableCards", | |
5 | + }, | |
6 | + variantgroups: [ | |
7 | + { code: "metal", states: ["iron", "blister_steel" ] }, | |
8 | + ], | |
9 | + shape: { base: "fma:item/material/cards" }, | |
10 | + texture: { base: "fma:metal/blister_steel" }, | |
11 | + creativeinventory: { "general": ["*"], "items": ["*"] }, | |
12 | + | |
13 | + maxstacksize: 1, | |
14 | + materialDensity: 9000, | |
15 | + fpHandTransform: { | |
16 | + translation: { x: 0.1, y: 0.4, z: 0.4 }, | |
17 | + rotation: { x: -20, y: 71, z: 61 }, | |
18 | + scale: 2.77 | |
19 | + }, | |
20 | + guiTransform: { | |
21 | + rotate: false, | |
22 | + translation: { x: 3, y: 0, z: 0 }, | |
23 | + rotation: { x: -8, y: -152, z: 142 }, | |
24 | + origin: { x: 0.5, y: 0.05, z: 0.4 }, | |
25 | + scale: 3.53 | |
26 | + }, | |
27 | + groundTransform: { | |
28 | + translation: { x: 0, y: 0, z: 0 }, | |
29 | + rotation: { x: 90, y: 0, z: 0 }, | |
30 | + origin: { x: 0.5, y: 0, z: 0.55 }, | |
31 | + scale: 3.5 | |
32 | + }, | |
33 | + tpHandTransform: { | |
34 | + translation: { x: -0.54, y: -0.08, z: -0.48 }, | |
35 | + rotation: { x: 0, y: 0, z: -10 }, | |
36 | + scale: 1 | |
37 | + } | |
38 | +} | |
\ No newline at end of file |
@@ -0,0 +1,106 @@ | ||
1 | +{ | |
2 | + "editor": { | |
3 | + "allAngles": true, | |
4 | + "entityTextureMode": false | |
5 | + }, | |
6 | + "textureWidth": 16, | |
7 | + "textureHeight": 16, | |
8 | + "textureSizes": { | |
9 | + }, | |
10 | + "textures": { | |
11 | + "steel": "block/metal/ingot/steel", | |
12 | + "flint2": "block/stone/flint" | |
13 | + }, | |
14 | + "elements": [ | |
15 | + { | |
16 | + "name": "Flint", | |
17 | + "from": [ 7.0, 0.0, 7.0 ], | |
18 | + "to": [ 9.75, 1.25, 9.75 ], | |
19 | + "rotationOrigin": [ 8.0, 0.0, 8.0 ], | |
20 | + "rotationY": 11.0, | |
21 | + "faces": { | |
22 | + "north": { "texture": "#flint2", "uv": [ 0.0, 0.0, 2.5, 1.0 ] }, | |
23 | + "east": { "texture": "#flint2", "uv": [ 8.5, 7.0, 11.0, 8.0 ] }, | |
24 | + "south": { "texture": "#flint2", "uv": [ 5.5, 8.5, 8.0, 9.5 ] }, | |
25 | + "west": { "texture": "#flint2", "uv": [ 3.5, 9.0, 6.0, 10.0 ] }, | |
26 | + "up": { "texture": "#flint2", "uv": [ 6.0, 5.0, 8.5, 7.5 ] }, | |
27 | + "down": { "texture": "#flint2", "uv": [ 1.5, 9.0, 4.0, 11.5 ] } | |
28 | + } | |
29 | + }, | |
30 | + { | |
31 | + "name": "Striker1", | |
32 | + "from": [ 10.5, 0.0, 6.5 ], | |
33 | + "to": [ 11.5, 1.0, 10.0 ], | |
34 | + "rotationOrigin": [ 11.0, 0.0, 6.0 ], | |
35 | + "faces": { | |
36 | + "north": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, | |
37 | + "east": { "texture": "#steel", "uv": [ 4.0, 2.5, 7.5, 3.5 ] }, | |
38 | + "south": { "texture": "#steel", "uv": [ 3.0, 4.0, 4.0, 5.0 ] }, | |
39 | + "west": { "texture": "#steel", "uv": [ 6.0, 8.5, 9.5, 9.5 ] }, | |
40 | + "up": { "texture": "#steel", "uv": [ 4.5, 7.5, 5.5, 11.0 ] }, | |
41 | + "down": { "texture": "#steel", "uv": [ 2.5, 2.5, 3.5, 6.0 ] } | |
42 | + }, | |
43 | + "children": [ | |
44 | + { | |
45 | + "name": "Striker2", | |
46 | + "from": [ 1.0, 0.0, 0.0 ], | |
47 | + "to": [ 2.5, 1.0, 0.5 ], | |
48 | + "rotationOrigin": [ 1.0, 0.0, 0.0 ], | |
49 | + "faces": { | |
50 | + "north": { "texture": "#steel", "uv": [ 11.5, 6.5, 13.0, 7.5 ] }, | |
51 | + "east": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] }, | |
52 | + "south": { "texture": "#steel", "uv": [ 11.5, 7.5, 13.0, 8.5 ] }, | |
53 | + "west": { "texture": "#steel", "uv": [ 6.0, 1.0, 6.5, 2.0 ] }, | |
54 | + "up": { "texture": "#steel", "uv": [ 2.0, 4.5, 3.5, 5.0 ] }, | |
55 | + "down": { "texture": "#steel", "uv": [ 1.5, 3.5, 3.0, 4.0 ] } | |
56 | + }, | |
57 | + "children": [ | |
58 | + { | |
59 | + "name": "Striker2e", | |
60 | + "from": [ 1.5, 0.0, 0.0 ], | |
61 | + "to": [ 2.0, 1.0, 1.0 ], | |
62 | + "rotationOrigin": [ 2.0, 0.0, 1.0 ], | |
63 | + "faces": { | |
64 | + "north": { "texture": "#steel", "uv": [ 9.5, 12.0, 10.0, 13.0 ] }, | |
65 | + "east": { "texture": "#steel", "uv": [ 12.0, 9.5, 13.0, 10.5 ] }, | |
66 | + "south": { "texture": "#steel", "uv": [ 7.0, 11.5, 7.5, 12.5 ] }, | |
67 | + "west": { "texture": "#steel", "uv": [ 9.0, 9.0, 10.0, 10.0 ] }, | |
68 | + "up": { "texture": "#steel", "uv": [ 4.5, 3.5, 5.0, 4.5 ] }, | |
69 | + "down": { "texture": "#steel", "uv": [ 5.5, 4.0, 6.0, 5.0 ] } | |
70 | + } | |
71 | + } | |
72 | + ] | |
73 | + }, | |
74 | + { | |
75 | + "name": "Striker3", | |
76 | + "from": [ 1.0, 0.0, 3.0 ], | |
77 | + "to": [ 2.5, 1.0, 3.5 ], | |
78 | + "rotationOrigin": [ 1.0, 0.0, 2.0 ], | |
79 | + "faces": { | |
80 | + "north": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.5, 1.0 ] }, | |
81 | + "east": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] }, | |
82 | + "south": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.5, 1.0 ] }, | |
83 | + "west": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] }, | |
84 | + "up": { "texture": "#steel", "uv": [ 4.0, 4.5, 5.5, 5.0 ] }, | |
85 | + "down": { "texture": "#steel", "uv": [ 2.0, 1.5, 3.5, 2.0 ] } | |
86 | + }, | |
87 | + "children": [ | |
88 | + { | |
89 | + "name": "Striker3e", | |
90 | + "from": [ 1.5, 0.0, -0.5 ], | |
91 | + "to": [ 2.0, 1.0, 0.5 ], | |
92 | + "rotationOrigin": [ 2.0, 0.0, 0.0 ], | |
93 | + "faces": { | |
94 | + "north": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] }, | |
95 | + "east": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, | |
96 | + "south": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] }, | |
97 | + "west": { "texture": "#steel", "uv": [ 0.0, 0.0, 1.0, 1.0 ] }, | |
98 | + "up": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] }, | |
99 | + "down": { "texture": "#steel", "uv": [ 0.0, 0.0, 0.5, 1.0 ] } | |
100 | + } | |
101 | + } | |
102 | + ] | |
103 | + } | |
104 | + ] | |
105 | + } | |
106 | + ]} | |
\ No newline at end of file |
@@ -35,7 +35,26 @@ | ||
35 | 35 | "item-shears-*":"Steel Shears", |
36 | 36 | "item-shovel-*":"Steel Shovel", |
37 | 37 | "item-sharpening_stone":"Sharpening Whetstones", |
38 | + "item-metal_cards-iron":"Metal cards (Iron)", | |
39 | + "item-metal_cards-blister_steel":"Metal cards (Blister Steel)", | |
40 | + "itemdesc-metal_cards-*":"Seven small card shaped metal plates.", | |
38 | 41 | "itemdesc-sharpening_stone":"Use in combination with _DULL_ steel items and grease to sharpen", |
39 | 42 | "craftinginfo-primitive_steelmaking-title":"Steel making: (Pack Carburization process)", |
40 | - "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.", | |
43 | + "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.", | |
44 | + "metalname-blister_steel":"Blister Steel", | |
45 | + "metalname-shear_steel":"Shear Steel", | |
46 | + "prop-metal":"Metal: {0},\n", | |
47 | + "prop-temper":"Temper: {0},\n", | |
48 | + "prop-edge":"Edge: {0},\n", | |
49 | + "sharpness-0":"Rough", | |
50 | + "sharpness-1":"Dull", | |
51 | + "sharpness-2":"Honed", | |
52 | + "sharpness-3":"Keen", | |
53 | + "sharpness-4":"Sharp", | |
54 | + "sharpness-5":"Razor", | |
55 | + "hardness-0":"Soft", | |
56 | + "hardness-1":"Mild", | |
57 | + "hardness-2":"Medium", | |
58 | + "hardness-3":"Hard", | |
59 | + "hardness-4":"Brittle", | |
41 | 60 | } |
\ No newline at end of file |
@@ -0,0 +1,10 @@ | ||
1 | +{ | |
2 | + ingredientPattern: "T S", | |
3 | + ingredients: { | |
4 | + "T": { type: "item", code: "fma:hammerhead-*", name: "metal" , allowedVariants: ["blister_steel", "shear_steel"] }, | |
5 | + "S": { type: "item", code: "game:stick" } | |
6 | + }, | |
7 | + width: 1, | |
8 | + height: 2, | |
9 | + output: { type: "item", code: "fma:hammer-{metal}", quantity: 1 } | |
10 | +} |
@@ -0,0 +1,10 @@ | ||
1 | +{ | |
2 | + ingredientPattern: "T S", | |
3 | + ingredients: { | |
4 | + "T": { type: "item", code: "fma:speartip-*", name: "metal", allowedVariants: ["blister_steel", "shear_steel"] }, | |
5 | + "S": { type: "item", code: "game:stick" } | |
6 | + }, | |
7 | + width: 1, | |
8 | + height: 2, | |
9 | + output: { type: "item", code: "fma:spear-{metal}", quantity: 1 } | |
10 | +} | |
\ No newline at end of file |
@@ -0,0 +1,16 @@ | ||
1 | +{ | |
2 | + ingredient: { type: "item", code: "ingot-iron" }, | |
3 | + pattern: [ | |
4 | + [ | |
5 | + "## ## ## ##", | |
6 | + "## ## ## ##", | |
7 | + "## ## ## ##", | |
8 | + "", | |
9 | + "## ## ##", | |
10 | + "## ## ##", | |
11 | + "## ## ##", | |
12 | + ] | |
13 | + ], | |
14 | + name: "Metal Cards recipie", | |
15 | + output: { type: "item", code: "metal_cards-iron" } | |
16 | +} |
@@ -0,0 +1,93 @@ | ||
1 | +{ | |
2 | + "editor": { | |
3 | + "allAngles": true, | |
4 | + "entityTextureMode": false | |
5 | + }, | |
6 | + "textureWidth": 16, | |
7 | + "textureHeight": 8, | |
8 | + "textureSizes": { | |
9 | + }, | |
10 | + "textures": { | |
11 | + "blister_steel": "/home/librarian/Documents/Project/DotNet/First_Machine_Age/ElementalTools/assets/fma/textures/metal/blister_steel", | |
12 | + "handle": "item/tool/material/handle" | |
13 | + }, | |
14 | + "elements": [ | |
15 | + { | |
16 | + "name": "grip", | |
17 | + "from": [ 8.0, 0.125, 8.125 ], | |
18 | + "to": [ 13.0, 1.125, 9.125 ], | |
19 | + "rotationOrigin": [ 8.0, 0.0, 8.0 ], | |
20 | + "rotationX": -45.0, | |
21 | + "faces": { | |
22 | + "north": { "texture": "#handle", "uv": [ 10.5, 4.75, 15.5, 5.75 ] }, | |
23 | + "east": { "texture": "#handle", "uv": [ 12.5, 3.25, 13.5, 4.25 ] }, | |
24 | + "south": { "texture": "#handle", "uv": [ 10.0, 3.25, 15.0, 4.25 ] }, | |
25 | + "west": { "texture": "#handle", "uv": [ 8.0, 4.0, 9.0, 5.0 ] }, | |
26 | + "up": { "texture": "#handle", "uv": [ 2.0, 4.25, 7.0, 5.25 ] }, | |
27 | + "down": { "texture": "#handle", "uv": [ 8.5, 4.5, 13.5, 5.5 ] } | |
28 | + }, | |
29 | + "children": [ | |
30 | + { | |
31 | + "name": "BladeBack", | |
32 | + "from": [ -5.9, 0.471, -0.182 ], | |
33 | + "to": [ 0.0, 0.571, 1.008 ], | |
34 | + "rotationOrigin": [ 0.0, 0.5, 0.5 ], | |
35 | + "rotationX": -45.0, | |
36 | + "faces": { | |
37 | + "north": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 0.25 ], "enabled": false }, | |
38 | + "east": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false }, | |
39 | + "south": { "texture": "#blister_steel", "uv": [ 3.0, 2.75, 8.5, 3.0 ] }, | |
40 | + "west": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false }, | |
41 | + "up": { "texture": "#blister_steel", "uv": [ 7.0, 5.0, 12.5, 6.0 ] }, | |
42 | + "down": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 1.0 ], "enabled": false } | |
43 | + } | |
44 | + }, | |
45 | + { | |
46 | + "name": "BladeFront", | |
47 | + "from": [ -5.9, 0.54, -0.25 ], | |
48 | + "to": [ 0.0, 0.66, 0.95 ], | |
49 | + "rotationOrigin": [ 0.0, 0.6, 0.5 ], | |
50 | + "rotationX": -41.0, | |
51 | + "faces": { | |
52 | + "north": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 0.25 ], "enabled": false }, | |
53 | + "east": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false }, | |
54 | + "south": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 0.25 ], "enabled": false }, | |
55 | + "west": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 1.0, 0.25 ], "enabled": false }, | |
56 | + "up": { "texture": "#blister_steel", "uv": [ 0.0, 0.0, 5.5, 1.0 ], "enabled": false }, | |
57 | + "down": { "texture": "#blister_steel", "uv": [ 10.5, 7.0, 16.0, 8.0 ] } | |
58 | + } | |
59 | + }, | |
60 | + { | |
61 | + "name": "Slope1", | |
62 | + "from": [ -7.089, -0.18, 0.42 ], | |
63 | + "to": [ -5.589, 0.5, 0.52 ], | |
64 | + "rotationOrigin": [ -5.7, 0.5, 0.5 ], | |
65 | + "rotationX": 45.0, | |
66 | + "faces": { | |
67 | + "north": { "texture": "#blister_steel", "uv": [ 1.0, 7.5, 2.5, 8.0 ], "rotation": 180 }, | |
68 | + "east": { "texture": "#blister_steel", "uv": [ 8.5, 5.0, 9.0, 5.5 ], "enabled": false }, | |
69 | + "south": { "texture": "#blister_steel", "uv": [ 6.5, 3.0, 8.0, 3.5 ], "enabled": false }, | |
70 | + "west": { "texture": "#blister_steel", "uv": [ 9.0, 3.5, 9.5, 4.0 ], "enabled": false }, | |
71 | + "up": { "texture": "#blister_steel", "uv": [ 8.0, 6.0, 9.5, 6.25 ], "enabled": false }, | |
72 | + "down": { "texture": "#blister_steel", "uv": [ 5.0, 3.5, 6.5, 3.75 ], "enabled": false } | |
73 | + } | |
74 | + }, | |
75 | + { | |
76 | + "name": "Slope2", | |
77 | + "from": [ -7.24, 0.56, 0.43 ], | |
78 | + "to": [ -5.65, 1.14, 0.487 ], | |
79 | + "rotationOrigin": [ -5.5, 0.5, 0.5 ], | |
80 | + "rotationX": 46.0, | |
81 | + "rotationZ": 25.0, | |
82 | + "faces": { | |
83 | + "north": { "texture": "#blister_steel", "uv": [ 1.0, 7.5, 2.5, 8.0 ], "rotation": 180 }, | |
84 | + "east": { "texture": "#blister_steel", "uv": [ 8.5, 5.0, 9.0, 5.5 ], "enabled": false }, | |
85 | + "south": { "texture": "#blister_steel", "uv": [ 6.5, 4.5, 8.0, 5.0 ] }, | |
86 | + "west": { "texture": "#blister_steel", "uv": [ 3.5, 5.5, 4.0, 6.0 ] }, | |
87 | + "up": { "texture": "#blister_steel", "uv": [ 3.0, 6.75, 4.5, 7.0 ] }, | |
88 | + "down": { "texture": "#blister_steel", "uv": [ 5.0, 3.5, 6.5, 3.75 ], "enabled": false } | |
89 | + } | |
90 | + } | |
91 | + ] | |
92 | + } | |
93 | + ]} | |
\ No newline at end of file |
@@ -8,14 +8,14 @@ | ||
8 | 8 | "textureSizes": { |
9 | 9 | }, |
10 | 10 | "textures": { |
11 | - "blister_steel": "fma:metal/blister_steel" | |
12 | 11 | }, |
13 | 12 | "elements": [ |
14 | 13 | { |
15 | 14 | "name": "card1", |
16 | - "from": [ 6.5, 0.0, 4.0 ], | |
17 | - "to": [ 9.5, 2.0, 5.0 ], | |
15 | + "from": [ 6.4, 0.0, 4.1 ], | |
16 | + "to": [ 9.4, 2.0, 5.1 ], | |
18 | 17 | "rotationOrigin": [ 8.0, 0.0, 8.0 ], |
18 | + "rotationY": 3.0, | |
19 | 19 | "faces": { |
20 | 20 | "north": { "texture": "#blister_steel", "uv": [ 7.0, 6.0, 10.0, 8.0 ] }, |
21 | 21 | "east": { "texture": "#blister_steel", "uv": [ 5.5, 2.0, 6.5, 4.0 ] }, |
@@ -46,6 +46,7 @@ | ||
46 | 46 | "to": [ 9.5, 2.0, 7.5 ], |
47 | 47 | "rotationOrigin": [ 8.0, 0.0, 8.0 ], |
48 | 48 | "rotationX": -5.0, |
49 | + "rotationY": -6.0, | |
49 | 50 | "faces": { |
50 | 51 | "north": { "texture": "#blister_steel", "uv": [ 7.0, 6.0, 10.0, 8.0 ] }, |
51 | 52 | "east": { "texture": "#blister_steel", "uv": [ 6.0, 2.0, 7.0, 4.0 ] }, |
@@ -72,8 +73,8 @@ | ||
72 | 73 | }, |
73 | 74 | { |
74 | 75 | "name": "card5", |
75 | - "from": [ 6.5, 0.0, 8.75 ], | |
76 | - "to": [ 9.5, 2.0, 9.75 ], | |
76 | + "from": [ 6.5, -0.1, 8.75 ], | |
77 | + "to": [ 9.5, 1.9, 9.75 ], | |
77 | 78 | "rotationOrigin": [ 8.0, 0.0, 8.0 ], |
78 | 79 | "rotationX": -7.0, |
79 | 80 | "faces": { |
@@ -87,8 +88,8 @@ | ||
87 | 88 | }, |
88 | 89 | { |
89 | 90 | "name": "card6", |
90 | - "from": [ 6.5, 0.0, 10.0 ], | |
91 | - "to": [ 9.5, 1.0, 12.0 ], | |
91 | + "from": [ 6.5, 0.0, 9.9 ], | |
92 | + "to": [ 9.5, 1.0, 11.9 ], | |
92 | 93 | "rotationOrigin": [ 8.0, 0.0, 7.0 ], |
93 | 94 | "rotationY": -3.0, |
94 | 95 | "faces": { |
@@ -102,8 +103,8 @@ | ||
102 | 103 | }, |
103 | 104 | { |
104 | 105 | "name": "card7", |
105 | - "from": [ 6.5, -2.5, 13.0 ], | |
106 | - "to": [ 9.5, -0.5, 14.0 ], | |
106 | + "from": [ 6.5, -2.5, 12.9 ], | |
107 | + "to": [ 9.5, -0.5, 13.9 ], | |
107 | 108 | "rotationOrigin": [ 8.0, -2.0, 8.0 ], |
108 | 109 | "rotationX": -28.0, |
109 | 110 | "faces": { |
@@ -8,6 +8,7 @@ | ||
8 | 8 | "textureSizes": { |
9 | 9 | }, |
10 | 10 | "textures": { |
11 | + "steel-file": "fma:/metal/steel-file" | |
11 | 12 | }, |
12 | 13 | "elements": [ |
13 | 14 | { |
@@ -17,12 +18,12 @@ | ||
17 | 18 | "rotationOrigin": [ 2.4, 0.48, 4.2 ], |
18 | 19 | "rotationY": 5.0, |
19 | 20 | "faces": { |
20 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
21 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] }, | |
22 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
23 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] }, | |
24 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] }, | |
25 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] } | |
21 | + "north": { "texture": "#steel-file", "uv": [ 4.5, 4.0, 6.5, 12.5 ], "rotation": 90, "autoUv": false }, | |
22 | + "east": { "texture": "#steel-file", "uv": [ 8.5, 9.5, 9.5, 10.0 ] }, | |
23 | + "south": { "texture": "#steel-file", "uv": [ 5.0, 6.5, 6.5, 14.5 ], "rotation": 90, "autoUv": false }, | |
24 | + "west": { "texture": "#steel-file", "uv": [ 8.5, 9.0, 9.5, 9.5 ] }, | |
25 | + "up": { "texture": "#steel-file", "uv": [ 4.0, 2.0, 5.5, 14.0 ], "rotation": 90, "autoUv": false }, | |
26 | + "down": { "texture": "#steel-file", "uv": [ 4.0, 1.5, 5.5, 13.5 ], "rotation": 270, "autoUv": false } | |
26 | 27 | }, |
27 | 28 | "children": [ |
28 | 29 | { |
@@ -30,12 +31,12 @@ | ||
30 | 31 | "from": [ -1.8, 0.0, 0.48 ], |
31 | 32 | "to": [ 0.0, 0.09, 0.78 ], |
32 | 33 | "faces": { |
33 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] }, | |
34 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.3, 0.3 ] }, | |
35 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] }, | |
36 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.3, 0.3 ] }, | |
37 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] }, | |
38 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.8, 0.3 ] } | |
34 | + "north": { "texture": "#steel-file", "uv": [ 9.0, 9.5, 10.5, 10.0 ] }, | |
35 | + "east": { "texture": "#steel-file", "uv": [ 10.5, 9.5, 11.0, 10.0 ] }, | |
36 | + "south": { "texture": "#steel-file", "uv": [ 10.0, 11.5, 11.5, 12.0 ] }, | |
37 | + "west": { "texture": "#steel-file", "uv": [ 11.0, 10.5, 11.5, 11.0 ] }, | |
38 | + "up": { "texture": "#steel-file", "uv": [ 9.5, 11.0, 11.0, 11.5 ] }, | |
39 | + "down": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 11.0, 10.5 ] } | |
39 | 40 | } |
40 | 41 | } |
41 | 42 | ] |
@@ -48,12 +49,12 @@ | ||
48 | 49 | "rotationX": -45.0, |
49 | 50 | "rotationY": 1.0, |
50 | 51 | "faces": { |
51 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
52 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
53 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
54 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
55 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
56 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] } | |
52 | + "north": { "texture": "#steel-file", "uv": [ 5.5, 5.5, 6.5, 13.5 ], "rotation": 270, "autoUv": false }, | |
53 | + "east": { "texture": "#steel-file", "uv": [ 8.5, 8.5, 9.0, 9.0 ] }, | |
54 | + "south": { "texture": "#steel-file", "uv": [ 5.0, 5.0, 6.0, 13.0 ], "rotation": 90, "autoUv": false }, | |
55 | + "west": { "texture": "#steel-file", "uv": [ 7.5, 0.0, 8.5, 4.0 ], "autoUv": false }, | |
56 | + "up": { "texture": "#steel-file", "uv": [ 4.0, 4.5, 5.0, 13.5 ], "rotation": 90, "autoUv": false }, | |
57 | + "down": { "texture": "#steel-file", "uv": [ 5.5, 5.5, 6.5, 13.0 ], "rotation": 270, "autoUv": false } | |
57 | 58 | }, |
58 | 59 | "children": [ |
59 | 60 | { |
@@ -61,12 +62,12 @@ | ||
61 | 62 | "from": [ -1.8, 0.25, 0.2 ], |
62 | 63 | "to": [ 0.0, 0.34, 0.5 ], |
63 | 64 | "faces": { |
64 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
65 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
66 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
67 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
68 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
69 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] } | |
65 | + "north": { "texture": "#steel-file", "uv": [ 10.5, 10.5, 12.0, 11.0 ] }, | |
66 | + "east": { "texture": "#steel-file", "uv": [ 10.0, 9.5, 10.5, 10.0 ] }, | |
67 | + "south": { "texture": "#steel-file", "uv": [ 10.0, 11.5, 11.5, 12.0 ] }, | |
68 | + "west": { "texture": "#steel-file", "uv": [ 10.0, 11.0, 10.5, 11.5 ] }, | |
69 | + "up": { "texture": "#steel-file", "uv": [ 9.0, 10.5, 10.5, 11.0 ] }, | |
70 | + "down": { "texture": "#steel-file", "uv": [ 9.0, 11.0, 10.5, 11.5 ] } | |
70 | 71 | } |
71 | 72 | } |
72 | 73 | ] |
@@ -74,16 +75,16 @@ | ||
74 | 75 | { |
75 | 76 | "name": "FileSurface3", |
76 | 77 | "from": [ 7.4, 0.0, 11.2 ], |
77 | - "to": [ 15.2, 0.09, 12.4 ], | |
78 | + "to": [ 15.2, 0.25, 12.4 ], | |
78 | 79 | "rotationOrigin": [ 5.0, 0.48, -1.0 ], |
79 | 80 | "rotationY": -22.5, |
80 | 81 | "faces": { |
81 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
82 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] }, | |
83 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
84 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ] }, | |
85 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] }, | |
86 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ] } | |
82 | + "north": { "texture": "#steel-file", "uv": [ 7.5, 9.0, 12.5, 13.5 ], "enabled": false, "autoUv": false }, | |
83 | + "east": { "texture": "#steel-file", "uv": [ 7.5, 9.0, 13.0, 9.5 ], "autoUv": false }, | |
84 | + "south": { "texture": "#steel-file", "uv": [ 7.0, 8.0, 13.5, 15.0 ], "enabled": false, "autoUv": false }, | |
85 | + "west": { "texture": "#steel-file", "uv": [ 7.5, 10.0, 12.5, 10.5 ], "autoUv": false }, | |
86 | + "up": { "texture": "#steel-file", "uv": [ 8.5, 9.0, 13.0, 12.5 ], "enabled": false, "autoUv": false }, | |
87 | + "down": { "texture": "#steel-file", "uv": [ 4.0, 16.0, 6.5, 0.0 ], "rotation": 90, "autoUv": false } | |
87 | 88 | }, |
88 | 89 | "children": [ |
89 | 90 | { |
@@ -91,12 +92,12 @@ | ||
91 | 92 | "from": [ -1.8, 0.0, 0.5 ], |
92 | 93 | "to": [ 0.0, 0.09, 0.8 ], |
93 | 94 | "faces": { |
94 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
95 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
96 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
97 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
98 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
99 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] } | |
95 | + "north": { "texture": "#steel-file", "uv": [ 10.0, 10.0, 11.5, 10.5 ] }, | |
96 | + "east": { "texture": "#steel-file", "uv": [ 10.5, 11.5, 11.0, 12.0 ] }, | |
97 | + "south": { "texture": "#steel-file", "uv": [ 10.0, 11.5, 11.5, 12.0 ] }, | |
98 | + "west": { "texture": "#steel-file", "uv": [ 11.5, 11.0, 12.0, 11.5 ] }, | |
99 | + "up": { "texture": "#steel-file", "uv": [ 10.0, 10.5, 11.5, 11.0 ] }, | |
100 | + "down": { "texture": "#steel-file", "uv": [ 10.0, 9.0, 11.5, 9.5 ] } | |
100 | 101 | } |
101 | 102 | }, |
102 | 103 | { |
@@ -106,12 +107,12 @@ | ||
106 | 107 | "rotationOrigin": [ 0.0, 0.0, -0.05 ], |
107 | 108 | "rotationX": -50.0, |
108 | 109 | "faces": { |
109 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
110 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
111 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
112 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
113 | - "up": { "texture": "#metal", "uv": [ 2.5, 5.5, 10.0, 6.5 ] }, | |
114 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false } | |
110 | + "north": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
111 | + "east": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
112 | + "south": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
113 | + "west": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
114 | + "up": { "texture": "#steel-file", "uv": [ 4.5, 0.0, 6.5, 16.0 ], "rotation": 90, "autoUv": false }, | |
115 | + "down": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false } | |
115 | 116 | } |
116 | 117 | }, |
117 | 118 | { |
@@ -121,12 +122,12 @@ | ||
121 | 122 | "rotationOrigin": [ 0.0, 1.0, 0.05 ], |
122 | 123 | "rotationX": 50.0, |
123 | 124 | "faces": { |
124 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
125 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
126 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
127 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
128 | - "up": { "texture": "#metal", "uv": [ 2.5, 5.5, 10.0, 6.5 ] }, | |
129 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false } | |
125 | + "north": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
126 | + "east": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
127 | + "south": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 0.5 ], "enabled": false }, | |
128 | + "west": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 1.0, 0.5 ], "enabled": false }, | |
129 | + "up": { "texture": "#steel-file", "uv": [ 4.0, 0.0, 6.5, 16.0 ], "rotation": 90, "autoUv": false }, | |
130 | + "down": { "texture": "#steel-file", "uv": [ 0.0, 0.0, 7.5, 1.0 ], "enabled": false } | |
130 | 131 | } |
131 | 132 | } |
132 | 133 | ] |
@@ -138,12 +139,12 @@ | ||
138 | 139 | "rotationOrigin": [ 2.4, 0.48, 4.2 ], |
139 | 140 | "rotationY": -1.0, |
140 | 141 | "faces": { |
141 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
142 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
143 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
144 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
145 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] }, | |
146 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 7.5, 0.5 ] } | |
142 | + "north": { "texture": "#steel-file", "uv": [ 5.0, 5.0, 5.5, 15.0 ], "rotation": 270, "autoUv": false }, | |
143 | + "east": { "texture": "#steel-file", "uv": [ 11.0, 12.0, 11.5, 12.5 ] }, | |
144 | + "south": { "texture": "#steel-file", "uv": [ 5.0, 4.0, 5.5, 15.0 ], "rotation": 90, "autoUv": false }, | |
145 | + "west": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 10.0, 10.5 ] }, | |
146 | + "up": { "texture": "#steel-file", "uv": [ 5.0, 3.0, 5.5, 15.0 ], "rotation": 90, "autoUv": false }, | |
147 | + "down": { "texture": "#steel-file", "uv": [ 5.0, 3.0, 5.5, 15.0 ], "rotation": 270, "autoUv": false } | |
147 | 148 | }, |
148 | 149 | "children": [ |
149 | 150 | { |
@@ -151,12 +152,12 @@ | ||
151 | 152 | "from": [ -1.8, 0.125, 0.02 ], |
152 | 153 | "to": [ 0.0, 0.215, 0.32 ], |
153 | 154 | "faces": { |
154 | - "north": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
155 | - "east": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
156 | - "south": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
157 | - "west": { "texture": "#metal", "uv": [ 0.0, 0.0, 0.5, 0.5 ] }, | |
158 | - "up": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] }, | |
159 | - "down": { "texture": "#metal", "uv": [ 0.0, 0.0, 1.5, 0.5 ] } | |
155 | + "north": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 11.0, 10.5 ] }, | |
156 | + "east": { "texture": "#steel-file", "uv": [ 9.0, 9.5, 9.5, 10.0 ] }, | |
157 | + "south": { "texture": "#steel-file", "uv": [ 9.0, 10.0, 10.5, 10.5 ] }, | |
158 | + "west": { "texture": "#steel-file", "uv": [ 9.0, 10.5, 9.5, 11.0 ] }, | |
159 | + "up": { "texture": "#steel-file", "uv": [ 9.5, 10.0, 11.0, 10.5 ] }, | |
160 | + "down": { "texture": "#steel-file", "uv": [ 10.5, 9.5, 12.0, 10.0 ] } | |
160 | 161 | } |
161 | 162 | } |
162 | 163 | ] |
@@ -1,13 +1,13 @@ | ||
1 | 1 | { |
2 | 2 | "type": "code", |
3 | 3 | "name": "Era of STEEL.", |
4 | - "description" : "Anchient techniques for making STEEL, in your very own forge - today!", | |
4 | + "description" : "The OLD technique for making steel items and Quench-Hardening them.", | |
5 | 5 | "authors": ["Melchior"], |
6 | 6 | "ModID":"eraofsteel", |
7 | - "version": "0.1.2", | |
7 | + "version": "0.1.4", | |
8 | 8 | "dependencies": { |
9 | - "game": "1.13.4", | |
9 | + "game": "1.17.0", | |
10 | 10 | "survival": "" |
11 | 11 | }, |
12 | - "website": "http://nowebsite.nope" | |
12 | + "website": "" | |
13 | 13 | } |