Hello world

This commit is contained in:
2022-11-03 22:48:29 +01:00
parent c73a88f392
commit 76561273a8
16 changed files with 219 additions and 0 deletions
+19
View File
@@ -0,0 +1,19 @@
using Terraria;
using Terraria.GameContent.ItemDropRules;
using Terraria.ID;
using Terraria.ModLoader;
using YHTMod.Items;
namespace YHTMod.Changes;
public class NpcLoot : GlobalNPC
{
public override void ModifyNPCLoot(NPC npc, NPCLoot npcLoot) {
int id = npc.type;
if (NPCID.Sets.CountsAsCritter[id]) {
npcLoot.Add(ItemDropRule.Common(ModContent.ItemType<MithrilPebbleOfPigSmiting>(), 400, 1, 1));
}
}
}
+42
View File
@@ -0,0 +1,42 @@
using Terraria.GameContent.Creative;
using Terraria.ID;
using Terraria.ModLoader;
using YHTMod.Projectiles.Weapons;
namespace YHTMod.Items;
public class CopperSwordOnAStick : ModItem {
public override void SetStaticDefaults() {
DisplayName.SetDefault("Copper Sword On A Stick");
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}
public override void SetDefaults() {
Item.DamageType = DamageClass.Melee;
Item.damage = 3;
Item.width = 80;
Item.height = 80;
Item.useTime = 7;
Item.useAnimation = 7;
Item.useStyle = ItemUseStyleID.Rapier;
Item.knockBack = 2f;
Item.value = 100;
Item.rare = ItemRarityID.White;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.crit = 1;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.shootSpeed = 1f;
Item.shoot = ModContent.ProjectileType<CopperSwordOnAStickProjectile>();
}
public override void AddRecipes() {
CreateRecipe()
.AddIngredient(ItemID.Wood, 5)
.AddIngredient(ItemID.Rope, 5)
.AddIngredient(ItemID.CopperShortsword)
.Register();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

+47
View File
@@ -0,0 +1,47 @@
using Terraria.GameContent.Creative;
using Terraria.ID;
using Terraria.ModLoader;
using YHTMod.Projectiles.Weapons;
namespace YHTMod.Items;
public class MithrilPebbleOfPigSmiting : ModItem {
public override void SetStaticDefaults() {
DisplayName.SetDefault("Mithril Pebble of Pig Smiting");
Tooltip.SetDefault(
"For you see long ago this pebble was forged in the fiery pits of Tartarus. By the grand black smith of Lucifer himself. In a time before the world began there were\n" +
"pigs that roamed the world of aincrad. They took what they pleased and did what they wanted. The humans tried to survive but the pigs were too powerful. Then a man stood against the hogs!\n" +
"His name... Well its not a Him its a Her...HER name...was...Akane! Lucifer crafted this mighty weapon for Akane. Amd she threw it Over and Over, Again and Again. She freed\n" +
"the humans but the pigs wouldn't give up! In a mighty battle Akane fell to the Hogs Hero, Becon! Like Bacon but with a 'E' instead of a 'A'. ANYWAY Becon used his Cleaver to strike\n" +
"down Akane. And the pebble fell. One of the hogs tried to pick it up but that hog died as soon as he touched the stone. Another Hero picked up the pebble. It was Akanes Apprentice. Sophie.\n" +
"The hogs ran from the battle feild as Sophie threw the pebble. Striking many of them down. But there were too many. After returning home Sophie trained hard and set off to find Becon.\n" +
"She killed hog after hog looking for him. One little piggy spilled and told her when he was. She made Becon, Into Bacon. Battle after battle the Hogs Became weaker. With time so did Sophie.\n" +
"She died because she ate too much Pork. And the Pebble was passed too Marjosa. He made a decision. Instead of killing them all. He made them walk on four legs. He would eat them and keep them\n" +
"locked up where they cant escape. Some Hogs rebelled but most of them went with it. Accepting defeat. Then as Marjosa was Hunting wild Hogs. 3 appeared at once. Taking him by surprise.\n" +
"They hit him with there sharp horns. Marjosa hit the with the Mighty Pebble killing them all but he was weak and far from anyone who could offer help. And Thus, Marjosa\n" +
"Guardian of the Pebble fell to his knees and passed from this world. Leaving behind the mighty weapon. For he knew. One day its power would be required once more.\n" +
"But the Legacy of the pebble lives on.");
CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[Type] = 1;
}
public override void SetDefaults() {
Item.DamageType = DamageClass.Ranged;
Item.damage = 16;
Item.width = 8;
Item.height = 8;
Item.useTime = 20;
Item.useAnimation = 20;
Item.useStyle = ItemUseStyleID.Swing;
Item.knockBack = 2f;
Item.value = 100;
Item.rare = ItemRarityID.Green;
Item.UseSound = SoundID.Item1;
Item.autoReuse = true;
Item.crit = 2;
Item.noMelee = true;
Item.noUseGraphic = true;
Item.shootSpeed = 20f;
Item.shoot = ModContent.ProjectileType<MithrilPebbleOfPigSmitingProjectile>();
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

@@ -0,0 +1,32 @@
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace YHTMod.Projectiles.Weapons;
class CopperSwordOnAStickProjectile : ModProjectile {
public override void SetDefaults() {
Projectile.width = 80;
Projectile.height = 80;
Projectile.friendly = true;
Projectile.penetrate = -1;
Projectile.tileCollide = false;
Projectile.DamageType = DamageClass.Melee;
Projectile.ownerHitCheck = true;
Projectile.extraUpdates = 1;
Projectile.timeLeft = 300;
Projectile.aiStyle = ProjAIStyleID.ShortSword;
}
public override void AI() {
base.AI();
float random = (float) (Random.Shared.NextDouble() / 5f);
Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.PiOver2 - MathHelper.PiOver4 * Projectile.spriteDirection;
Projectile.rotation += random;
DrawOriginOffsetX = 0;
DrawOffsetX = 0;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

@@ -0,0 +1,31 @@
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace YHTMod.Projectiles.Weapons;
class MithrilPebbleOfPigSmitingProjectile : ModProjectile {
public override void SetDefaults() {
Projectile.width = 8;
Projectile.height = 8;
Projectile.friendly = true;
Projectile.penetrate = 1;
Projectile.tileCollide = true;
Projectile.DamageType = DamageClass.Ranged;
Projectile.ownerHitCheck = true;
Projectile.extraUpdates = 1;
Projectile.timeLeft = 300;
Projectile.aiStyle = ProjAIStyleID.ThrownProjectile;
Projectile.light = 0.3f;
}
public override void AI() {
base.AI();
DrawOriginOffsetX = 0;
DrawOffsetX = 0;
int dust = Dust.NewDust(Projectile.Center, 1, 1, DustID.Mythril, 0f, 0f, 0, default(Color), 1f);
Main.dust[dust].noGravity = true;
Main.dust[dust].velocity *= 0.3f;
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 562 B

+16
View File
@@ -0,0 +1,16 @@
{
"profiles": {
"Terraria": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "$(tMLPath)",
"workingDirectory": "$(tMLSteamPath)"
},
"TerrariaServer": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "$(tMLServerPath)",
"workingDirectory": "$(tMLSteamPath)"
}
}
}
+9
View File
@@ -0,0 +1,9 @@
using Terraria.ModLoader;
namespace YHTMod {
public class YHTMod : Mod {
public YHTMod() {
}
}
}
+13
View File
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\tModLoader.targets" />
<PropertyGroup>
<AssemblyName>YHTMod</AssemblyName>
<TargetFramework>net6.0</TargetFramework>
<PlatformTarget>AnyCPU</PlatformTarget>
<LangVersion>latest</LangVersion>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="tModLoader.CodeAssist" Version="0.1.*" />
</ItemGroup>
</Project>
+3
View File
@@ -0,0 +1,3 @@
displayName = YHT Mod
author = YouHaveTrouble
version = 0.1
+1
View File
@@ -0,0 +1 @@
Bunch of random additions ranging from QoL to random references
+6
View File
@@ -0,0 +1,6 @@
{
"sdk": {
"rollForward": "latestMajor",
"allowPrerelease": true
}
}
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB