From 61b2ae9a62511d16dede4958818307aa9f6b1541 Mon Sep 17 00:00:00 2001 From: nathomp3 Date: Sat, 6 Nov 2021 22:35:39 -0400 Subject: [PATCH 1/2] Updated rareties --- Items/ChlorophyteStaff.cs | 3 +-- Items/ShroomiteStaff.cs | 7 +++---- Items/SpectreStaff.cs | 2 +- Projectiles/ShroomiteProjectile.cs | 5 +++++ build.txt | 2 +- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Items/ChlorophyteStaff.cs b/Items/ChlorophyteStaff.cs index 0d39c1f..c579a97 100644 --- a/Items/ChlorophyteStaff.cs +++ b/Items/ChlorophyteStaff.cs @@ -25,7 +25,7 @@ public override void SetDefaults() item.useAnimation = 36; item.useStyle = ItemUseStyleID.SwingThrow; item.value = 10; - item.rare = ItemRarityID.Blue; + item.rare = ItemRarityID.Lime; item.UseSound = SoundID.Item1; item.mana = 10; item.noMelee = true; @@ -45,7 +45,6 @@ public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); recipe.AddIngredient(ItemID.ChlorophyteBar, 9); - recipe.AddIngredient(ItemID.TurtleShell, 1); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/ShroomiteStaff.cs b/Items/ShroomiteStaff.cs index 9e9f63a..b3e64ca 100644 --- a/Items/ShroomiteStaff.cs +++ b/Items/ShroomiteStaff.cs @@ -18,14 +18,14 @@ public override void SetStaticDefaults() public override void SetDefaults() { - item.damage = 30; + item.damage = 40; item.width = 40; item.height = 40; item.useTime = 36; item.useAnimation = 36; item.useStyle = ItemUseStyleID.SwingThrow; item.value = 10; - item.rare = ItemRarityID.Blue; + item.rare = ItemRarityID.Lime; item.UseSound = SoundID.Item1; item.mana = 10; item.noMelee = true; @@ -44,8 +44,7 @@ public override bool Shoot(Player player, ref Vector2 position, ref float speedX public override void AddRecipes() { ModRecipe recipe = new ModRecipe(mod); - recipe.AddIngredient(ItemID.ChlorophyteBar, 9); - recipe.AddIngredient(ItemID.TurtleShell, 1); + recipe.AddIngredient(ItemID.ShroomiteBar, 9); recipe.AddTile(TileID.MythrilAnvil); recipe.SetResult(this); recipe.AddRecipe(); diff --git a/Items/SpectreStaff.cs b/Items/SpectreStaff.cs index 355e0bd..917f140 100644 --- a/Items/SpectreStaff.cs +++ b/Items/SpectreStaff.cs @@ -25,7 +25,7 @@ public override void SetDefaults() item.useAnimation = 36; item.useStyle = ItemUseStyleID.SwingThrow; item.value = 10; - item.rare = ItemRarityID.Blue; + item.rare = ItemRarityID.Yellow; item.UseSound = SoundID.Item1; item.mana = 10; item.noMelee = true; diff --git a/Projectiles/ShroomiteProjectile.cs b/Projectiles/ShroomiteProjectile.cs index 1fe8a15..0522f60 100644 --- a/Projectiles/ShroomiteProjectile.cs +++ b/Projectiles/ShroomiteProjectile.cs @@ -24,5 +24,10 @@ public override bool MinionContactDamage() { return true; } + public override bool OnTileCollide(Vector2 oldVelocity) + { + projectile.Kill(); + return true; + } } } diff --git a/build.txt b/build.txt index 9dffb77..4290a8a 100644 --- a/build.txt +++ b/build.txt @@ -1,4 +1,4 @@ displayName = DubNation author = Penguin -version = 0.3.0 +version = 0.3.1 homepage = https://github.com/Nick-NCSU/DubNationMod \ No newline at end of file From d47b97d7283014c4f99066a1c775625237543212 Mon Sep 17 00:00:00 2001 From: nathomp3 Date: Sat, 6 Nov 2021 23:10:39 -0400 Subject: [PATCH 2/2] Added staff type --- Buffs/ScourgeBuff.cs | 32 +++++++++++ Buffs/ScourgeBuff.png | Bin 0 -> 627 bytes Items/ScourgeStaff.cs | 59 ++++++++++++++++++++ Items/ScourgeStaff.png | Bin 0 -> 744 bytes Items/WoodStaff.cs | 2 +- Projectiles/ScourgeMinion.cs | 102 ++++++++++++++++++++++++++++++++++ Projectiles/ScourgeMinion.png | Bin 0 -> 4747 bytes 7 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 Buffs/ScourgeBuff.cs create mode 100644 Buffs/ScourgeBuff.png create mode 100644 Items/ScourgeStaff.cs create mode 100644 Items/ScourgeStaff.png create mode 100644 Projectiles/ScourgeMinion.cs create mode 100644 Projectiles/ScourgeMinion.png diff --git a/Buffs/ScourgeBuff.cs b/Buffs/ScourgeBuff.cs new file mode 100644 index 0000000..69a83c6 --- /dev/null +++ b/Buffs/ScourgeBuff.cs @@ -0,0 +1,32 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace DubNation.Buffs +{ + public class ScourgeBuff : ModBuff + { + public override void SetDefaults() + { + DisplayName.SetDefault("Scourge Minion"); + Description.SetDefault("The scourge minion will fight for you"); + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + } + + public override void Update(Player player, ref int buffIndex) + { + if (player.ownedProjectileCounts[ModContent.ProjectileType()] > 0) + { + player.buffTime[buffIndex] = 18000; + } + else + { + player.DelBuff(buffIndex); + buffIndex--; + } + } + } +} diff --git a/Buffs/ScourgeBuff.png b/Buffs/ScourgeBuff.png new file mode 100644 index 0000000000000000000000000000000000000000..eaee8795e72710a93d98a58acc1ab6f7a171150a GIT binary patch literal 627 zcmV-(0*w8MP)EX>4Tx04R}tkv&MmKpe$iQ>CI62Rn##$WWau_=Px16^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=H{g6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UwP&La) z#baVNw<-o+(T4y8Odu>VQ%|H9Gw>W=_we!cF3PjK&;2?2mAuISpGZ8%bi*RvAfDN@ zbk6(4Ay$$U;&b9LgDyz?$aUG}H_ki6e@tQNECM zS>e3JS*_Gq>z@3D!MwJT<~q$V;#figNr;e9Lm3rVh|;Q&Vj@NRF%SQ+<4=-HCRZ7Z z91EyIh2;3b|KNAGW?^d5O$x?eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{002u#L_t(Y$75g^1#|+8Wa#-%C38r&^gj_|G`E!ImJ?$z zNtQDWRN@-7m{7K(S^{FBah@N1K~2x>Hfrg>SUOsOjDq1;Xbe~!0{~a77z5Kg2SNY< N002ovPDHLkV1j}H2B-i4 literal 0 HcmV?d00001 diff --git a/Items/ScourgeStaff.cs b/Items/ScourgeStaff.cs new file mode 100644 index 0000000..fa7b57c --- /dev/null +++ b/Items/ScourgeStaff.cs @@ -0,0 +1,59 @@ +using Microsoft.Xna.Framework; +using System; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + + +namespace DubNation.Items +{ + public class ScourgeStaff : ModItem + { + public override void SetStaticDefaults() + { + DisplayName.SetDefault("Scourge Staff"); + Tooltip.SetDefault("Summons a scourge minion to fight for you"); + ItemID.Sets.GamepadWholeScreenUseRange[item.type] = true; + ItemID.Sets.LockOnIgnoresCollision[item.type] = true; + } + + public override void SetDefaults() + { + item.damage = 8; + item.width = 40; + item.height = 40; + item.useTime = 36; + item.useAnimation = 36; + item.useStyle = ItemUseStyleID.SwingThrow; + item.value = 10; + item.rare = ItemRarityID.White; + item.UseSound = SoundID.Item1; + item.mana = 1; + item.noMelee = true; + item.summon = true; + item.buffType = ModContent.BuffType(); + item.shoot = ModContent.ProjectileType(); + } + + public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack) + { + player.AddBuff(item.buffType, 2); + position = Main.MouseWorld; + return true; + } + + public override void AddRecipes() + { + Mod calamity = ModLoader.GetMod("CalamityMod"); + if (calamity != null) + { + ModRecipe recipe = new ModRecipe(mod); + recipe.AddIngredient(calamity.ItemType("VictoryShard"), 4); + recipe.AddIngredient(ItemID.SandBlock, 10); + recipe.AddTile(TileID.WorkBenches); + recipe.SetResult(this); + recipe.AddRecipe(); + } + } + } +} diff --git a/Items/ScourgeStaff.png b/Items/ScourgeStaff.png new file mode 100644 index 0000000000000000000000000000000000000000..cb9c0654fa9a29d7632bb838d6ac37afd67b55f3 GIT binary patch literal 744 zcmVP)EX>4Tx04R}tkv&MmKpe$iQ>CI+2Rn#3WT;Lph>AE$6^me@v=v%)FuC*#nlvOS zE{=k0!NHHks)LKOt`4q(Aou~|=H{g6A|?JWDYS_3;J6>}?mh0_0Yam~RI_UWP&La) z#baVNw<-o+(T4y8L@*#RQ%|H9Gw>W=_we!cF3PjK&;2?2mAuISpGZ8%bi*RvAfDN@ zbk6(4Ay$$U;&bANK^G)`9%C|}6B ztZ?4qtX68Qbx;1nU|w5EbDicW;#figNr;e9Lm3rVh|;Q&Vj@NRF%SQU<4=-HCRZ7Z z91EyIh2;3b|KNAGW?^d5O$x?eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{006*AL_t(o!_ClH5yDUq1<@WnVFM+|K?ybxmHbgaNb;6h zZYwy|hG_TObpbGCoFwoQCkOn+J)SQ!Wt_~xJ)8va2v-g~!<7PCaAm+&TnVrTmk#X3 zr20zGhHKrdVf&=cnl^v1aYBXDlOD4Yv05;qNu#!Ue;aKpeX z+z>Dm*A2|Zbpb1I&A=*L6R;9@3arK*0u^w(Ko#6ypb~BaRKtA%6>)E%Dh|MuaR3)( a9KZ_J377^+0KJj`0000()); + } + if (player.HasBuff(ModContent.BuffType())) + { + projectile.timeLeft = 2; + } + #endregion + + #region Movement + Vector2 down = new Vector2(0, 1); + projectile.velocity = (projectile.velocity + down); + #endregion + + #region Animation and visuals + // So it will lean slightly towards the direction it's moving + projectile.rotation = projectile.velocity.X * 0.05f; + + // This is a simple "loop through all frames from top to bottom" animation + int frameSpeed = 5; + projectile.frameCounter++; + if (projectile.frameCounter >= frameSpeed) + { + projectile.frameCounter = 0; + projectile.frame++; + if (projectile.frame >= Main.projFrames[projectile.type]) + { + projectile.frame = 0; + } + } + + // Some visuals here + Lighting.AddLight(projectile.Center, Color.White.ToVector3() * 0.78f); + #endregion + + } + } +} diff --git a/Projectiles/ScourgeMinion.png b/Projectiles/ScourgeMinion.png new file mode 100644 index 0000000000000000000000000000000000000000..4ff46a66024b311d2892d24e7c53bcac75e13c35 GIT binary patch literal 4747 zcmV;65_Ii}P) zaB^>EX>4U6ba`-PAZ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