mirror of
				https://github.com/chev2/terraria-mods.git
				synced 2025-10-30 08:11:37 +00:00 
			
		
		
		
	Add LifeSourcesLight and ZenithRecipeTooltips mods
This commit is contained in:
		
							parent
							
								
									ca0fc1a6ee
								
							
						
					
					
						commit
						5b1b7e5780
					
				
					 16 changed files with 197 additions and 0 deletions
				
			
		
							
								
								
									
										17
									
								
								LifeSourcesLight/LifeSourcesLight.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										17
									
								
								LifeSourcesLight/LifeSourcesLight.cs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,17 @@ | ||||||
|  | using Terraria.ModLoader; | ||||||
|  | using Terraria; | ||||||
|  | using Terraria.ID; | ||||||
|  | 
 | ||||||
|  | namespace LifeSourcesLight | ||||||
|  | { | ||||||
|  | 	public class LifeSourcesLight : Mod | ||||||
|  | 	{ | ||||||
|  |         public override void Load() | ||||||
|  |         { | ||||||
|  |             Main.tileLighted[TileID.Heart] = true; | ||||||
|  |             Main.tileLighted[TileID.LifeFruit] = true; | ||||||
|  | 
 | ||||||
|  |             base.Load(); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										13
									
								
								LifeSourcesLight/LifeSourcesLight.csproj
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								LifeSourcesLight/LifeSourcesLight.csproj
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|  |   <Import Project="..\tModLoader.targets" /> | ||||||
|  |   <PropertyGroup> | ||||||
|  |     <AssemblyName>LifeSourcesLight</AssemblyName> | ||||||
|  |     <TargetFramework>net6.0</TargetFramework> | ||||||
|  |     <PlatformTarget>AnyCPU</PlatformTarget> | ||||||
|  |     <LangVersion>latest</LangVersion> | ||||||
|  |   </PropertyGroup> | ||||||
|  |   <ItemGroup> | ||||||
|  |     <PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" /> | ||||||
|  |   </ItemGroup> | ||||||
|  | </Project> | ||||||
							
								
								
									
										22
									
								
								LifeSourcesLight/LightOverrideHeartCrystal.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								LifeSourcesLight/LightOverrideHeartCrystal.cs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | ||||||
|  | using Terraria; | ||||||
|  | using Terraria.ID; | ||||||
|  | using Terraria.ModLoader; | ||||||
|  | 
 | ||||||
|  | namespace LifeSourcesLight | ||||||
|  | { | ||||||
|  |     public class LightOverrideHeartCrystal : GlobalTile | ||||||
|  |     { | ||||||
|  |         // Modify overall light brightness | ||||||
|  |         private static readonly float LifeCrystalBrightCoefficient = 0.7f; | ||||||
|  | 
 | ||||||
|  |         public override void ModifyLight(int i, int j, int type, ref float r, ref float g, ref float b) | ||||||
|  |         { | ||||||
|  |             if (type == TileID.Heart) | ||||||
|  |             { | ||||||
|  |                 r = (255f / 255f) * LifeCrystalBrightCoefficient; | ||||||
|  |                 g = (38f / 255f)  * LifeCrystalBrightCoefficient; | ||||||
|  |                 b = (106f / 255f) * LifeCrystalBrightCoefficient; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										22
									
								
								LifeSourcesLight/LightOverrideLifeFruit.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										22
									
								
								LifeSourcesLight/LightOverrideLifeFruit.cs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,22 @@ | ||||||
|  | using Terraria; | ||||||
|  | using Terraria.ID; | ||||||
|  | using Terraria.ModLoader; | ||||||
|  | 
 | ||||||
|  | namespace LifeSourcesLight | ||||||
|  | { | ||||||
|  |     public class LightOverrideLifeFruit : GlobalTile | ||||||
|  |     { | ||||||
|  |         // Modify overall light brightness | ||||||
|  |         private static readonly float LifeFruitBrightCoefficient = 0.7f; | ||||||
|  | 
 | ||||||
|  |         public override void ModifyLight(int i, int j, int type, ref float r, ref float g, ref float b) | ||||||
|  |         { | ||||||
|  |             if (type == TileID.LifeFruit) | ||||||
|  |             { | ||||||
|  |                 r = (170f / 255f) * LifeFruitBrightCoefficient; | ||||||
|  |                 g = (221f / 255f) * LifeFruitBrightCoefficient; | ||||||
|  |                 b = (43f / 255f)  * LifeFruitBrightCoefficient; | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										16
									
								
								LifeSourcesLight/Properties/launchSettings.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								LifeSourcesLight/Properties/launchSettings.json
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | ||||||
|  | { | ||||||
|  |   "profiles": { | ||||||
|  |     "Terraria": { | ||||||
|  |       "commandName": "Executable", | ||||||
|  |       "executablePath": "dotnet", | ||||||
|  |       "commandLineArgs": "$(tMLPath)", | ||||||
|  |       "workingDirectory": "$(tMLSteamPath)" | ||||||
|  |     }, | ||||||
|  |     "TerrariaServer": { | ||||||
|  |       "commandName": "Executable", | ||||||
|  |       "executablePath": "dotnet", | ||||||
|  |       "commandLineArgs": "$(tMLServerPath)", | ||||||
|  |       "workingDirectory": "$(tMLSteamPath)" | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										5
									
								
								LifeSourcesLight/build.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								LifeSourcesLight/build.txt
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,5 @@ | ||||||
|  | displayName = Heart Crystal & Life Fruit Glow | ||||||
|  | author = Chev | ||||||
|  | version = 1.0.0 | ||||||
|  | homepage = https://github.com/chev2/terraria-mods | ||||||
|  | side = Client | ||||||
							
								
								
									
										1
									
								
								LifeSourcesLight/description.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								LifeSourcesLight/description.txt
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | ||||||
|  | Makes heart crystals & life fruits emit light. | ||||||
							
								
								
									
										
											BIN
										
									
								
								LifeSourcesLight/icon.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								LifeSourcesLight/icon.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 4.9 KiB | 
|  | @ -1,2 +1,7 @@ | ||||||
| # terraria-mods | # terraria-mods | ||||||
| My mods for Terraria's tModLoader. | My mods for Terraria's tModLoader. | ||||||
|  | 
 | ||||||
|  | ## Mods list | ||||||
|  | 
 | ||||||
|  | * **LifeSourcesLight** - Makes heart crystals & life fruits emit light. | ||||||
|  | * **ZenithRecipeTooltips** - Shows "Required for Zenith" in the tooltips of every sword used in the Zenith crafting recipe. | ||||||
|  |  | ||||||
							
								
								
									
										53
									
								
								ZenithRecipeTooltips/HookZenithIngredientTooltips.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										53
									
								
								ZenithRecipeTooltips/HookZenithIngredientTooltips.cs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,53 @@ | ||||||
|  | using System.Collections.Generic; | ||||||
|  | using Terraria; | ||||||
|  | using Terraria.ID; | ||||||
|  | using Terraria.ModLoader; | ||||||
|  | 
 | ||||||
|  | namespace ZenithRecipeTooltips | ||||||
|  | { | ||||||
|  |     public class HookZenithIngredientTooltips : GlobalItem | ||||||
|  |     { | ||||||
|  |         private static readonly Dictionary<int, bool> RecipeItemIDs = new() | ||||||
|  |         { | ||||||
|  |             { ItemID.CopperShortsword, true }, | ||||||
|  |             { ItemID.EnchantedSword, true }, | ||||||
|  |             { ItemID.BeeKeeper, true }, | ||||||
|  |             { ItemID.Starfury, true }, | ||||||
|  |             { ItemID.Seedler, true }, | ||||||
|  |             { ItemID.TheHorsemansBlade, true }, | ||||||
|  |             { ItemID.InfluxWaver, true }, | ||||||
|  |             { ItemID.StarWrath, true }, | ||||||
|  |             { ItemID.Meowmere, true }, | ||||||
|  |             { ItemID.TerraBlade, true } | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|  |         private static readonly string TooltipPrefixColor = "E10643"; | ||||||
|  | 
 | ||||||
|  |         private static bool IsMaterialTooltip(TooltipLine line) | ||||||
|  |         { | ||||||
|  |             return line.Name == "Material"; | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public override void ModifyTooltips(Item item, List<TooltipLine> tooltips) | ||||||
|  |         { | ||||||
|  |             if (RecipeItemIDs.ContainsKey(item.type)) | ||||||
|  |             { | ||||||
|  |                 TooltipLine tooltip = new(Mod, "RequiredForZenith", $"[c/{TooltipPrefixColor}:Required for Zenith]"); | ||||||
|  | 
 | ||||||
|  |                 int materialLineIndex = tooltips.FindIndex(IsMaterialTooltip); | ||||||
|  | 
 | ||||||
|  |                 // If we found the index where the "Material" tooltip is | ||||||
|  |                 if (materialLineIndex > 0) | ||||||
|  |                 { | ||||||
|  |                     tooltips.Insert(materialLineIndex + 1, tooltip); | ||||||
|  |                 // If we didn't, just append it to the end | ||||||
|  |                 } else | ||||||
|  |                 { | ||||||
|  |                     tooltips.Add(tooltip); | ||||||
|  |                 } | ||||||
|  |             } | ||||||
|  | 
 | ||||||
|  |             base.ModifyTooltips(item, tooltips); | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										16
									
								
								ZenithRecipeTooltips/Properties/launchSettings.json
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								ZenithRecipeTooltips/Properties/launchSettings.json
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | ||||||
|  | { | ||||||
|  |   "profiles": { | ||||||
|  |     "Terraria": { | ||||||
|  |       "commandName": "Executable", | ||||||
|  |       "executablePath": "dotnet", | ||||||
|  |       "commandLineArgs": "$(tMLPath)", | ||||||
|  |       "workingDirectory": "$(tMLSteamPath)" | ||||||
|  |     }, | ||||||
|  |     "TerrariaServer": { | ||||||
|  |       "commandName": "Executable", | ||||||
|  |       "executablePath": "dotnet", | ||||||
|  |       "commandLineArgs": "$(tMLServerPath)", | ||||||
|  |       "workingDirectory": "$(tMLSteamPath)" | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
							
								
								
									
										8
									
								
								ZenithRecipeTooltips/ZenithRecipeTooltips.cs
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										8
									
								
								ZenithRecipeTooltips/ZenithRecipeTooltips.cs
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,8 @@ | ||||||
|  | using Terraria.ModLoader; | ||||||
|  | 
 | ||||||
|  | namespace ZenithRecipeTooltips | ||||||
|  | { | ||||||
|  |     public class ZenithRecipeTooltips : Mod | ||||||
|  |     { | ||||||
|  |     } | ||||||
|  | } | ||||||
							
								
								
									
										13
									
								
								ZenithRecipeTooltips/ZenithRecipeTooltips.csproj
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								ZenithRecipeTooltips/ZenithRecipeTooltips.csproj
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,13 @@ | ||||||
|  | <?xml version="1.0" encoding="utf-8"?> | ||||||
|  | <Project Sdk="Microsoft.NET.Sdk"> | ||||||
|  |   <Import Project="..\tModLoader.targets" /> | ||||||
|  |   <PropertyGroup> | ||||||
|  |     <AssemblyName>ZenithRecipeTooltips</AssemblyName> | ||||||
|  |     <TargetFramework>net6.0</TargetFramework> | ||||||
|  |     <PlatformTarget>AnyCPU</PlatformTarget> | ||||||
|  |     <LangVersion>latest</LangVersion> | ||||||
|  |   </PropertyGroup> | ||||||
|  |   <ItemGroup> | ||||||
|  |     <PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" /> | ||||||
|  |   </ItemGroup> | ||||||
|  | </Project> | ||||||
							
								
								
									
										5
									
								
								ZenithRecipeTooltips/build.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								ZenithRecipeTooltips/build.txt
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,5 @@ | ||||||
|  | displayName = Zenith Recipe Tooltips | ||||||
|  | author = Chev | ||||||
|  | version = 1.0.0 | ||||||
|  | homepage = https://github.com/chev2/terraria-mods | ||||||
|  | side = Client | ||||||
							
								
								
									
										1
									
								
								ZenithRecipeTooltips/description.txt
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										1
									
								
								ZenithRecipeTooltips/description.txt
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1 @@ | ||||||
|  | Shows "Required for Zenith" in the tooltips of every sword used in the Zenith crafting recipe. | ||||||
							
								
								
									
										
											BIN
										
									
								
								ZenithRecipeTooltips/icon.png
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								ZenithRecipeTooltips/icon.png
									
										
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 7.2 KiB | 
		Loading…
	
	Add table
		
		Reference in a new issue
	
	 Chev
						Chev