diff --git a/.vs/LensRands/DesignTimeBuild/.dtbcache.v2 b/.vs/LensRands/DesignTimeBuild/.dtbcache.v2 index f78f08e..1d44671 100644 Binary files a/.vs/LensRands/DesignTimeBuild/.dtbcache.v2 and b/.vs/LensRands/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/LensRands/v17/.suo b/.vs/LensRands/v17/.suo index b190a35..9505d17 100644 Binary files a/.vs/LensRands/v17/.suo and b/.vs/LensRands/v17/.suo differ diff --git a/Assets/Buffs/Nerfed.png b/Assets/Buffs/Nerfed.png new file mode 100644 index 0000000..ca31f4c Binary files /dev/null and b/Assets/Buffs/Nerfed.png differ diff --git a/Assets/Buffs/RoseBuff.png b/Assets/Buffs/RoseBuff.png new file mode 100644 index 0000000..98765a9 Binary files /dev/null and b/Assets/Buffs/RoseBuff.png differ diff --git a/Assets/Buffs/StunProbed.png b/Assets/Buffs/StunProbed.png new file mode 100644 index 0000000..891b181 Binary files /dev/null and b/Assets/Buffs/StunProbed.png differ diff --git a/Assets/Items/Accessories/RoseShield.png b/Assets/Items/Accessories/RoseShield.png new file mode 100644 index 0000000..7db08b5 Binary files /dev/null and b/Assets/Items/Accessories/RoseShield.png differ diff --git a/Assets/Items/Misc/Nerf.png b/Assets/Items/Misc/Nerf.png new file mode 100644 index 0000000..008f4a5 Binary files /dev/null and b/Assets/Items/Misc/Nerf.png differ diff --git a/Assets/Items/Misc/Wumpa.png b/Assets/Items/Misc/Wumpa.png new file mode 100644 index 0000000..a997a0e Binary files /dev/null and b/Assets/Items/Misc/Wumpa.png differ diff --git a/Assets/Items/Toys/BouncyBalls.png b/Assets/Items/Toys/BouncyBalls.png new file mode 100644 index 0000000..403d0e2 Binary files /dev/null and b/Assets/Items/Toys/BouncyBalls.png differ diff --git a/Assets/Projectiles/BouncyBall.png b/Assets/Projectiles/BouncyBall.png new file mode 100644 index 0000000..af90110 Binary files /dev/null and b/Assets/Projectiles/BouncyBall.png differ diff --git a/Assets/Projectiles/Nerf.png b/Assets/Projectiles/Nerf.png new file mode 100644 index 0000000..774f1a8 Binary files /dev/null and b/Assets/Projectiles/Nerf.png differ diff --git a/Assets/Projectiles/RealKnife999.png b/Assets/Projectiles/RealKnife999.png new file mode 100644 index 0000000..b2b1d53 Binary files /dev/null and b/Assets/Projectiles/RealKnife999.png differ diff --git a/Assets/Sounds/speen.ogg b/Assets/Sounds/speen.ogg new file mode 100644 index 0000000..dce7d08 Binary files /dev/null and b/Assets/Sounds/speen.ogg differ diff --git a/Common/DropRules/GlobalRorDrops.cs b/Common/DropRules/LensGlobalDrops.cs similarity index 100% rename from Common/DropRules/GlobalRorDrops.cs rename to Common/DropRules/LensGlobalDrops.cs diff --git a/Common/DropRules/LensItemSources.cs b/Common/DropRules/LensItemSources.cs new file mode 100644 index 0000000..e7a91b7 --- /dev/null +++ b/Common/DropRules/LensItemSources.cs @@ -0,0 +1,18 @@ +using LensRands.Content.Items.Memes; +using Terraria; +using Terraria.DataStructures; +using Terraria.ModLoader; + +namespace LensRands.Common.DropRules +{ + public sealed class WumpaDrop : GlobalItem + { + public override void OnSpawn(Item item, IEntitySource source) + { + if (source is EntitySource_ShakeTree && Main.rand.NextBool(1000)) + { + Item.NewItem(source,item.position,ModContent.ItemType()); + } + } + } +} diff --git a/Content/Buffs/Nerfed.cs b/Content/Buffs/Nerfed.cs new file mode 100644 index 0000000..655b03d --- /dev/null +++ b/Content/Buffs/Nerfed.cs @@ -0,0 +1,31 @@ +using System; +using Terraria; +using Terraria.ModLoader; + +namespace LensRands.Content.Buffs +{ + public class Nerfed : ModBuff + { + public override string Texture => LensRands.AssetsPath + "Buffs/Nerfed"; + + public override void SetStaticDefaults() + { + Main.buffNoSave[Type] = true; + Main.buffNoTimeDisplay[Type] = true; + Main.debuff[Type] = true; + } + public override void Update(NPC npc, ref int buffIndex) + { + if (npc.buffTime[buffIndex] == 9) + { + if (npc.defense > 0) + { + npc.defense = Math.Clamp((int)(npc.defense * 0.75f), 0, npc.defense); + } + npc.life = (int)(npc.life * 0.75f); + npc.velocity *= 0.75f; + npc.damage = (int)(npc.damage * 0.75f); + } + } + } +} diff --git a/Content/Buffs/RoseQuartsBuff.cs b/Content/Buffs/RoseQuartsBuff.cs new file mode 100644 index 0000000..48911b9 --- /dev/null +++ b/Content/Buffs/RoseQuartsBuff.cs @@ -0,0 +1,23 @@ +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; +using LensRands.Systems; + +namespace LensRands.Content.Buffs +{ + public class RoseQuartsBuff : ModBuff + { + public override string Texture => LensRands.AssetsPath + "Buffs/RoseBuff"; + + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + BuffID.Sets.NurseCannotRemoveDebuff[Type] = true; + } + public override void Update(Player player, ref int buffIndex) + { + player.GetModPlayer().RoseDefended = true; + } + } +} diff --git a/Content/Buffs/StunProbed.cs b/Content/Buffs/StunProbed.cs new file mode 100644 index 0000000..54a2bc5 --- /dev/null +++ b/Content/Buffs/StunProbed.cs @@ -0,0 +1,25 @@ +using Microsoft.Xna.Framework; +using Terraria; +using Terraria.ModLoader; + +namespace LensRands.Content.Buffs +{ + public class StunProbed : ModBuff + { + public override string Texture => LensRands.AssetsPath + "Buffs/StunProbed"; + + public override void SetStaticDefaults() + { + Main.debuff[Type] = true; + Main.buffNoSave[Type] = true; + } + public override void Update(NPC npc, ref int buffIndex) + { + npc.velocity = Vector2.Zero; + } + public override void Update(Player player, ref int buffIndex) + { + player.velocity = Vector2.Zero; + } + } +} diff --git a/Content/Items/Accessories/RORMisc.cs b/Content/Items/Accessories/RORMisc.cs index 31fc3c2..18c2e50 100644 --- a/Content/Items/Accessories/RORMisc.cs +++ b/Content/Items/Accessories/RORMisc.cs @@ -154,31 +154,31 @@ public override void UpdateAccessory(Player player, bool hideVisual) public class RoRPearl : RORBoss { public override string Texture => base.Texture + "Pearl"; - public readonly int PearlHealth = 50; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(PearlHealth); + public readonly float PearlHealth = 0.1f; + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((int)(PearlHealth * 100)); public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += PearlHealth; + player.statLifeMax2 += (int)(player.statLifeMax * (1f + PearlHealth)); } } public class IrradiantPearl : RORBoss { public override string Texture => base.Texture + "IrradiantPearl"; - public readonly int PearlHealth = 50; - public readonly int PearlMana = 50; + public readonly float PearlHealth = 0.1f; + public readonly float PearlMana = 0.1f; public readonly float PearlDmg = 0.1f; public readonly float PearlDefence = 0.1f; public readonly float PearlRunSpeed = 0.1f; public readonly float PearlAtkSpeed = 0.1f; public readonly float crit = 10f; - public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(PearlHealth,PearlMana,(int)(PearlDmg * 100), (int)(PearlAtkSpeed * 100),crit,(int)(PearlDefence * 100), (int)(PearlRunSpeed * 100)); + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs((int)(PearlHealth*100), (int)(PearlMana*100),(int)(PearlDmg * 100), (int)(PearlAtkSpeed * 100),crit,(int)(PearlDefence * 100), (int)(PearlRunSpeed * 100)); public override void UpdateAccessory(Player player, bool hideVisual) { - player.statLifeMax2 += PearlHealth; - player.statManaMax2 += PearlMana; + player.statLifeMax2 += (int)(player.statLifeMax * (1f + PearlHealth)); + player.statManaMax2 += (int)(player.statManaMax * (1f + PearlMana)); player.statDefense *= 1f + PearlDefence; player.moveSpeed *= 1f + PearlRunSpeed; player.GetDamage(DamageClass.Generic) *= 1f + PearlDmg; diff --git a/Content/Items/Accessories/RoseShield.cs b/Content/Items/Accessories/RoseShield.cs new file mode 100644 index 0000000..60f49e8 --- /dev/null +++ b/Content/Items/Accessories/RoseShield.cs @@ -0,0 +1,49 @@ + +using LensRands.Systems; +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; +using LensRands.Content.Buffs; +using Terraria.Localization; + +namespace LensRands.Content.Items.Accessories +{ + public class RoseShield : ModItem + { + public readonly int DmgReduc = 5; + public override string Texture => LensRands.AssetsPath + "Items/Accessories/RoseShield"; + + public override void AddRecipes() + { + CreateRecipe() + .AddIngredient(ItemID.Ruby) + .AddIngredient(ItemID.Diamond) + .AddIngredient(ItemID.Glass, 20) + .AddTile(TileID.GlassKiln) + .Register(); + } + + public override LocalizedText Tooltip => base.Tooltip.WithFormatArgs(DmgReduc); + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.rare = ItemRarityID.Pink; + Item.accessory = true; + } + + public override void UpdateAccessory(Player player, bool hideVisual) + { + player.GetModPlayer().RoseQuarts = true; + if (player.whoAmI != Main.myPlayer && player.miscCounter % 15 == 0) + { + Player localPlayer = Main.player[Main.myPlayer]; + if (localPlayer.team == player.team && player.team != 0 && player.Distance(localPlayer.Center) <= 800 && !player.GetModPlayer().RoseQuarts) + { + // The buff is used to visually indicate to the player that they are defended, and is also synchronized automatically to other players, letting them know that we were defended at the time we took the hit + localPlayer.AddBuff(ModContent.BuffType(), 30); + } + } + } + } +} diff --git a/Content/Items/Memes/SCP3108.cs b/Content/Items/Memes/SCP3108.cs new file mode 100644 index 0000000..248aab7 --- /dev/null +++ b/Content/Items/Memes/SCP3108.cs @@ -0,0 +1,59 @@ +using LensRands.Content.Buffs; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace LensRands.Content.Items.Memes +{ + public class SCP3108 : ModItem + { + public override string Texture => LensRands.AssetsPath + "Items/Misc/Nerf"; + public override void SetDefaults() + { + Item.width = 32; + Item.height = 32; + Item.useTime = 60; + Item.useAnimation = 60; + Item.scale = 0.5f; + Item.damage = 1; + Item.useStyle = ItemUseStyleID.Shoot; + Item.rare = ItemRarityID.LightRed; + Item.noMelee = true; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 6f; + } + } + public class NerfingGun : ModProjectile + { + public override string Texture => LensRands.AssetsPath + "Projectiles/Nerf"; + public override void SetDefaults() + { + Projectile.width = 4; //The width of projectile hitbox + Projectile.height = 4; //The height of projectile hitbox + Projectile.aiStyle = -1; //The ai style of the projectile, please reference the source code of Terraria + Projectile.friendly = true; //Can the projectile deal damage to enemies? + Projectile.hostile = false; //Can the projectile deal damage to the player? + Projectile.penetrate = -1; //How many monsters the projectile can penetrate. (OnTileCollide below also decrements penetrate for bounces as well) + Projectile.timeLeft = 300; //The live time for the projectile (60 = 1 second, so 600 is 10 seconds) + Projectile.ignoreWater = true; //Does the projectile's speed be influenced by water? + Projectile.tileCollide = true; //Can the projectile collide with tiles? + Projectile.extraUpdates = 0; //Set to above 0 if you want the projectile to update multiple time in a frame + } + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (!target.boss) + { + target.AddBuff(ModContent.BuffType(), 10); + } + } + public override void AI() + { + if (Projectile.timeLeft <= 280) + { + Projectile.velocity.Y += 0.05f; + } + Projectile.spriteDirection = Projectile.velocity.X > 0 ? 1 : -1; + Projectile.rotation = Projectile.velocity.ToRotation(); + } + } +} diff --git a/Content/Items/Memes/Toys.cs b/Content/Items/Memes/Toys.cs new file mode 100644 index 0000000..1f233b4 --- /dev/null +++ b/Content/Items/Memes/Toys.cs @@ -0,0 +1,113 @@ +using System; +using Microsoft.Xna.Framework; +using rail; +using Terraria; +using Terraria.ID; +using Terraria.ModLoader; + +namespace LensRands.Content.Items.Memes +{ + public class BouncyBalls : ModItem + { + + public override string Texture => LensRands.AssetsPath + "Items/Toys/BouncyBalls"; + public override void SetDefaults() + { + Item.rare = ItemRarityID.Pink; + Item.height = 16; + Item.width = 16; + Item.useTime = 20; + Item.useAnimation = 20; + Item.noUseGraphic = true; + Item.damage = 0; + Item.autoReuse = true; + Item.noMelee = true; + Item.useStyle = ItemUseStyleID.Swing; + Item.shoot = ModContent.ProjectileType(); + Item.shootSpeed = 3f; + } + public override void AddRecipes() + { + CreateRecipe() + .AddIngredient(ItemID.PinkGel,50) + .Register(); + } + } + public class BouncyBallP : ModProjectile + { + public override string Texture => LensRands.AssetsPath + "Projectiles/BouncyBall"; + public override void SetDefaults() + { + Projectile.width = 8; + Projectile.height = 8; + Projectile.aiStyle = -1; + Projectile.friendly = false; + Projectile.hostile = false; + Projectile.penetrate = -1; + Projectile.timeLeft = 900; + Projectile.ignoreWater = true; + Projectile.tileCollide = true; + } + public override void AI() + { + if (Projectile.timeLeft < 840) + { + BootlegOnHit(); + } + Projectile.velocity.Y += 0.1f; + float rotate = Projectile.velocity.X > 0 ? 12.25f : -12.25f; + Projectile.rotation += MathHelper.ToRadians(rotate); + } + private void BootlegOnHit() + { + foreach (Player player in Main.player) + { + if (Projectile.Hitbox.Intersects(player.Hitbox)) + { + Boing2(Projectile.velocity); + } + } + } + public override bool OnTileCollide(Vector2 oldVelocity) + { + Boing(oldVelocity); + return false; + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + Boing2(Projectile.velocity); + } + public override bool? CanCutTiles() + { + return false; + } + public override bool? CanHitNPC(NPC target) + { + return true; + } + + private void Boing(Vector2 oldVelocity) + { + if (Projectile.velocity.X != oldVelocity.X && Math.Abs(oldVelocity.X) > 0.1f) + { + Projectile.velocity.X = oldVelocity.X * -0.99f; + } + if (Projectile.velocity.Y != oldVelocity.Y && Math.Abs(oldVelocity.Y) > 0.1f) + { + Projectile.velocity.Y = oldVelocity.Y * -0.99f; + } + } + private void Boing2(Vector2 oldVelocity) + { + + Projectile.velocity.X = oldVelocity.X * -0.99f; + + if (Projectile.velocity.Y > 0 ? -0.1f != oldVelocity.Y : 0.1f != oldVelocity.Y && Math.Abs(oldVelocity.Y) > 0.1f) + { + Projectile.velocity.Y = oldVelocity.Y * -0.99f; + } + } + + } +} diff --git a/Content/Items/Memes/WizardStaff.cs b/Content/Items/Memes/WizardStaff.cs index ac532ed..f9150be 100644 --- a/Content/Items/Memes/WizardStaff.cs +++ b/Content/Items/Memes/WizardStaff.cs @@ -7,7 +7,6 @@ using Terraria.DataStructures; using Microsoft.Xna.Framework; using Terraria.Audio; -using static Humanizer.In; namespace LensRands.Content.Items.Memes { @@ -48,7 +47,8 @@ public class WizardStaffProjectile : ModProjectile private static readonly List ProjTypes = new() { - "PenisBlast!" + "PenisBlast!", + "Speen" }; public override void SetDefaults() { @@ -77,11 +77,11 @@ public override void AI() { SetupTheBomb(); } + BootlegOnHit(owner); switch (ProjTypes[(int)WhatToDoToday]) { case "PenisBlast!": - { - BootlegOnHit(owner); + { TickTock(out bool timetodie); if (timetodie && WhoWeHit != -1) { @@ -95,6 +95,15 @@ public override void AI() } break; } + case "Speen": + { + if (WhoWeHit != -1 && Main.GameUpdateCount % 10 == 0) + { + Player victim = Main.player[WhoWeHit]; + victim.direction *= -1; + } + break; + } default: { Main.NewText("LensRands: Who broke the fucking wizard projectile?!?!"); @@ -108,7 +117,7 @@ public override void AI() } private void BlastWillAndTestament(Player owner) { - if (WhoWeHit != -1) + if (WhoWeHit != -1 && WhoWeHit != Projectile.owner && !DoneFuckedUp) { Player victim = Main.player[WhoWeHit]; if (!victim.dead) @@ -130,8 +139,13 @@ public override bool OnTileCollide(Vector2 oldVelocity) WaitForIt = (4 * 60) + 15; Projectile.timeLeft = (4 * 60) + 25; SoundEngine.PlaySound(AudioSys.GetBentLoser, Projectile.position); - YouCantSeeMe(); - ForceSync(); + break; + } + case "Speen": + { + Projectile.timeLeft = (2 * 60); + WhoWeHit = Projectile.owner; + SoundEngine.PlaySound(AudioSys.Speen, Projectile.position); break; } default: @@ -140,6 +154,8 @@ public override bool OnTileCollide(Vector2 oldVelocity) break; } } + YouCantSeeMe(); + ForceSync(); return false; } private void DoTheFunny(Player player) @@ -152,8 +168,13 @@ private void DoTheFunny(Player player) Projectile.timeLeft = (4 * 60) + 25; WhoWeHit = player.whoAmI; SoundEngine.PlaySound(AudioSys.GetBentLoser, Projectile.position); - YouCantSeeMe(); - ForceSync(); + break; + } + case "Speen": + { + Projectile.timeLeft = (2 * 60); + WhoWeHit = player.whoAmI; + SoundEngine.PlaySound(AudioSys.Speen, Projectile.position); break; } default: @@ -162,6 +183,8 @@ private void DoTheFunny(Player player) break; } } + YouCantSeeMe(); + ForceSync(); } private void BootlegOnHit(Player owner) diff --git a/Content/Items/Memes/randomcrud.cs b/Content/Items/Memes/randomcrud.cs new file mode 100644 index 0000000..4a07501 --- /dev/null +++ b/Content/Items/Memes/randomcrud.cs @@ -0,0 +1,23 @@ +using Terraria.DataStructures; +using Terraria.ID; +using Terraria; +using Terraria.ModLoader; + +namespace LensRands.Content.Items.Memes +{ + public class Wumpa : ModItem + { + public override string Texture => LensRands.AssetsPath + "Items/Misc/Wumpa"; + public override void SetStaticDefaults() + { + Main.RegisterItemAnimation(Item.type, new DrawAnimationVertical(7, 14)); + ItemID.Sets.AnimatesAsSoul[Item.type] = true; + } + public override void SetDefaults() + { + Item.width = Item.height = 32; + Item.rare = ItemRarityID.Orange; + Item.maxStack = 30; + } + } +} diff --git a/Content/Items/Pets/Monika.cs b/Content/Items/Pets/Monika.cs index 3d3e769..941705b 100644 --- a/Content/Items/Pets/Monika.cs +++ b/Content/Items/Pets/Monika.cs @@ -145,7 +145,7 @@ public override void AI() bool fast = Movement(player); - if (MonikaAnimation == 0) + if (MonikaAnimation == 0 && Projectile.owner == Main.myPlayer) { float chance = Main.rand.NextFloat(1f); if (chance > 0f && chance <= 0.2f) @@ -329,10 +329,10 @@ private bool Movement(Player player) float velDistanceChange = 2f; // Calculates the desired resting position, aswell as some vectors used in velocity/rotation calculations - int dir = player.direction; + int dir = -player.direction; Projectile.direction = Projectile.spriteDirection = dir; - Vector2 desiredCenterRelative = new Vector2(dir == 1 ? dir * 30 : dir * 45 , -60f); + Vector2 desiredCenterRelative = new(dir == 1 ? dir * 30 : dir * 45 , -60f); // Add some sine motion desiredCenterRelative.Y += (float)Math.Sin(Main.GameUpdateCount / 120f * MathHelper.TwoPi) * 5; diff --git a/Content/Items/Weapons/RealKnife.cs b/Content/Items/Weapons/RealKnife.cs index d533e8b..788c3c8 100644 --- a/Content/Items/Weapons/RealKnife.cs +++ b/Content/Items/Weapons/RealKnife.cs @@ -63,7 +63,7 @@ public override bool AltFunctionUse(Player player) } public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback) { - if (player.GetModPlayer().HighestBossKilled < 5) + if (player.GetModPlayer().HighestBossKilled < 8) { return false; } @@ -73,7 +73,7 @@ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, player.GetModPlayer().KnifeTimer = 0; return base.Shoot(player, source, position, velocity, type, damage, knockback); } - if (player.altFunctionUse == 2 && !player.GetModPlayer().KnifeOut && player.statMana != 0) + if (player.altFunctionUse == 2 && !player.GetModPlayer().KnifeOut && player.statMana == player.statManaMax2) { player.GetModPlayer().KnifeOut = true; player.statMana -= player.statMana; @@ -87,7 +87,7 @@ public override void ModifyShootStats(Player player, ref Vector2 position, ref V if (player.altFunctionUse == 2 && player.GetModPlayer().KnifeOut) { LensPlayer plmp = player.GetModPlayer(); - int newdamage = player.statManaMax / 2 + damage; + int newdamage = player.statManaMax2 / 10 + damage; int timerint = (int)Math.Round(plmp.KnifeTimer); int timer; if (timerint <= 47) @@ -111,7 +111,8 @@ public override void ModifyShootStats(Player player, ref Vector2 position, ref V } case 2: { - newdamage += newdamage * 5; + newdamage = (int)(newdamage * 3.5f); + player.statMana = player.statManaMax2; SoundEngine.PlaySound(AudioSys.RealSlash, player.position); break; } @@ -132,21 +133,21 @@ public override void ModifyShootStats(Player player, ref Vector2 position, ref V { new KeyValuePair(0,5), //No bosses. new KeyValuePair(4,17), //Slime King - new KeyValuePair(5,25), //Eye,Projectile Gained. + new KeyValuePair(5,25), //Eye. new KeyValuePair(6,30), //Worm/Brain new KeyValuePair(7,35), //Bee - new KeyValuePair(8,39), //Skele - new KeyValuePair(9,43), //Deer - new KeyValuePair(10,45), //Woll - new KeyValuePair(11,50), //Queen - new KeyValuePair(12,65), //All Mechs - new KeyValuePair(13,80), //Plant - new KeyValuePair(14,105), //Golem + new KeyValuePair(8,39), //Skele, projectile gained + new KeyValuePair(9,42), //Deer + new KeyValuePair(10,50), //Woll + new KeyValuePair(11,55), //Queen + new KeyValuePair(12,70), //All Mechs + new KeyValuePair(13,90), //Plant + new KeyValuePair(14,110), //Golem new KeyValuePair(15,130), //Feesh - new KeyValuePair(16,135), //Empress - new KeyValuePair(17,145), //CultyBoi - new KeyValuePair(18,155), //All towers - new KeyValuePair(19,195), //Moonlol + new KeyValuePair(16,140), //Empress + new KeyValuePair(17,150), //CultyBoi + new KeyValuePair(18,160), //All towers + new KeyValuePair(19,215), //Moonlol }; public override void ModifyWeaponDamage(Player player, ref StatModifier damage) { @@ -190,19 +191,34 @@ public override void SetDefaults() { Projectile.width = 32; //The width of projectile hitbox Projectile.height = 124; //The height of projectile hitbox - Projectile.aiStyle = 27; //The ai style of the projectile, please reference the source code of Terraria + Projectile.aiStyle = -1; //The ai style of the projectile, please reference the source code of Terraria Projectile.friendly = true; //Can the projectile deal damage to enemies? Projectile.hostile = false; //Can the projectile deal damage to the player? Projectile.DamageType = DamageClass.Melee; Projectile.penetrate = -1; //How many monsters the projectile can penetrate. (OnTileCollide below also decrements penetrate for bounces as well) Projectile.timeLeft = 60; //The live time for the projectile (60 = 1 second, so 600 is 10 seconds) - Projectile.light = 1f; //How much light emit around the projectile Projectile.ignoreWater = true; //Does the projectile's speed be influenced by water? Projectile.tileCollide = false; //Can the projectile collide with tiles? Projectile.extraUpdates = 0; //Set to above 0 if you want the projectile to update multiple time in a frame Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 5; + Projectile.localNPCHitCooldown = 10; + } + public override void AI() + { + Lighting.AddLight(Projectile.Center, 1f, 0f, 0f); + Projectile.alpha += 4; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); + } + + public override void OnHitNPC(NPC target, NPC.HitInfo hit, int damageDone) + { + if (Main.myPlayer == Projectile.owner) + { + Vector2 vel2 = new(Main.rand.NextFloat(-0.5f, 0.5f), 1f); + Projectile p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), target.position, vel2, ModContent.ProjectileType(), 0, 0); + p.rotation = MathHelper.ToRadians(Main.rand.NextFloat(-15f, 16f)); + } } } @@ -213,20 +229,49 @@ public class RealKnifeProjectileT : ModProjectile public override void SetDefaults() { Projectile.width = 16; //The width of projectile hitbox - Projectile.height = 32; //The height of projectile hitbox - Projectile.aiStyle = 27; //The ai style of the projectile, please reference the source code of Terraria + Projectile.height = 16; //The height of projectile hitbox + Projectile.aiStyle = -1; //The ai style of the projectile, please reference the source code of Terraria Projectile.friendly = true; //Can the projectile deal damage to enemies? Projectile.hostile = false; //Can the projectile deal damage to the player? Projectile.DamageType = DamageClass.Melee; - Projectile.penetrate = -1; //How many monsters the projectile can penetrate. (OnTileCollide below also decrements penetrate for bounces as well) + Projectile.penetrate = 1; //How many monsters the projectile can penetrate. (OnTileCollide below also decrements penetrate for bounces as well) Projectile.timeLeft = 30; //The live time for the projectile (60 = 1 second, so 600 is 10 seconds) - Projectile.light = 0.25f; //How much light emit around the projectile Projectile.ignoreWater = true; //Does the projectile's speed be influenced by water? Projectile.tileCollide = false; //Can the projectile collide with tiles? Projectile.extraUpdates = 0; //Set to above 0 if you want the projectile to update multiple time in a frame Projectile.usesLocalNPCImmunity = true; - Projectile.localNPCHitCooldown = 10; + Projectile.localNPCHitCooldown = 20; + } + public override void AI() + { + Lighting.AddLight(Projectile.Center, 1f, 0f, 0f); + Projectile.alpha += 20; + Projectile.rotation = Projectile.velocity.ToRotation() + MathHelper.ToRadians(45f); + } + } + public class RealKnife999 : ModProjectile + { + + public override string Texture => LensRands.AssetsPath + "Projectiles/RealKnife999"; + public override void SetDefaults() + { + Projectile.width = 1; //The width of projectile hitbox + Projectile.height = 1; //The height of projectile hitbox + Projectile.aiStyle = -1; //The ai style of the projectile, please reference the source code of Terraria + Projectile.friendly = false; //Can the projectile deal damage to enemies? + Projectile.hostile = false; //Can the projectile deal damage to the player? + Projectile.penetrate = -1; //How many monsters the projectile can penetrate. (OnTileCollide below also decrements penetrate for bounces as well) + Projectile.timeLeft = 45; //The live time for the projectile (60 = 1 second, so 600 is 10 seconds) //How much light emit around the projectile + Projectile.ignoreWater = true; //Does the projectile's speed be influenced by water? + Projectile.tileCollide = false; //Can the projectile collide with tiles? + Projectile.extraUpdates = 0; //Set to above 0 if you want the projectile to update multiple time in a frame + } + public override void AI() + { + Projectile.alpha += 20; + Lighting.AddLight(Projectile.Center, 1f, 0f, 0f); + Projectile.velocity *= 0.8f; } } } diff --git a/Content/Items/Weapons/SS13.cs b/Content/Items/Weapons/SS13.cs index 12921d3..28881cc 100644 --- a/Content/Items/Weapons/SS13.cs +++ b/Content/Items/Weapons/SS13.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Text; using System.Threading.Tasks; +using LensRands.Content.Buffs; using Microsoft.Xna.Framework; using Terraria; using Terraria.ID; @@ -34,7 +35,7 @@ public override void SetDefaults() } public override void OnHitNPC(Player player, NPC target, NPC.HitInfo hit, int damageDone) { - target.velocity = Vector2.Zero; + target.AddBuff(ModContent.BuffType(), 300); } } } diff --git a/LensUtils/LensUtil.cs b/LensUtils/LensUtil.cs index 6a0e2eb..e8abfae 100644 --- a/LensUtils/LensUtil.cs +++ b/LensUtils/LensUtil.cs @@ -20,6 +20,19 @@ public static IEnumerable FindNearbyNPCs(float range, Vector2 worldPos, Lis } } + public static IEnumerable FindNearbyPlayers(float range,Vector2 worldPos, Player sourcePlayer = null,bool CheckTeam = false, List ignorePlayers = null) + { + ignorePlayers ??= new List(); + if (CheckTeam) + { + return Main.player.Where(player => player.DistanceSQ(worldPos) < range * range && sourcePlayer.team == player.team && !ignorePlayers.Contains(player.whoAmI)); + } + else + { + return Main.player.Where(player => player.DistanceSQ(worldPos) < range * range && !ignorePlayers.Contains(player.whoAmI)); + } + } + public static NPC FindClosestNPC(float range, Vector2 worldPos, bool checkCollision = true, List excludedNPCs = null) { excludedNPCs ??= new List(); diff --git a/Localization/en-US.hjson b/Localization/en-US.hjson index d04a3fd..10e3198 100644 --- a/Localization/en-US.hjson +++ b/Localization/en-US.hjson @@ -330,8 +330,8 @@ Mods: { DisplayName: Irradiant Pearl Tooltip: ''' - Increases health by {0}. - Increases mana by {1}. + Increases max health by {0}% of base max. + Increases mana by {1}% of base max. Increases damage by {2}%. Increases attack speed by {3}%. Increases critical chance by {4}%. @@ -345,7 +345,7 @@ Mods: { DisplayName: Pearl Tooltip: ''' - Increases health by {0}. + Increases max health by {0}% of base max. [c/FFFF00:Shiny.] ''' } @@ -528,6 +528,7 @@ Mods: { ''' [c/9E4638:I lost contact with that copy.] [c/9E4638:What happened to them?] + [c/FFFF00:From Doki Doki Takeover! Bad Ending.] ''' } @@ -627,10 +628,45 @@ Mods: { YourDemiseBox: { DisplayName: Your Demise EX - DPZ + Tooltip: + ''' + [c/9E4638:Should have known better than to] + [c/9E4638:mess with others love lifes.] + [c/FFFF00:From Doki Doki Takeover!+] + ''' + } + + RoseShield: { + DisplayName: Rose Quartz Shield + Tooltip: + ''' + Reduces damage taken by {0}%. + Friendly players nearby receive 60% of damage you take + as overheal. Players wearing this item are unaffected. + In Single Player, you instead receive 40% as overheal. + [c/FFFF00:Even better than Cookie Cat!] + ''' + } + + BouncyBalls: { + DisplayName: Bouncy Balls + Tooltip: "[c/FFFF00:Boing!]" + } + + Wumpa: { + DisplayName: Wumpa Fruit + Tooltip: "[c/FFFF00:Hey yea uh, what the fuck?]" + } + + SCP3108: { + DisplayName: Nerfing Gun Tooltip: ''' - [c/9E4638:Should have known better than to] - [c/9E4638:mess with others love lifes.] + Looks like a nerf gun, but seems to literally + 'nerf' anything it hits. You feel like you + really shouldn't point it at yourself. + Doesn't work on Powerful Enemies. + [c/FFFF00:Chaos Insurgency inbound.] ''' } } @@ -655,6 +691,9 @@ Mods: { ThrowingKnifeProjectile.DisplayName: Throwing Knife Projectile SThrowingKnifeProjectile.DisplayName: S Throwing Knife Projectile WizardStaffProjectile.DisplayName: Wizard Staff Projectile + RealKnife999.DisplayName: Real Knife999 + BouncyBallP.DisplayName: Bouncy Ball + NerfingGun.DisplayName: SCP3108-1 } Buffs: { @@ -712,11 +751,26 @@ Mods: { DisplayName: Tonic Affliction Description: You feel terrible. Most stats reduced by 5% per stack. You should see a doctor. Does nothing while under Spinel Tonic buff. } + + RoseQuartsBuff: { + DisplayName: Rose Quartz Tears + Description: Your Allies Pain strengthens your resolve! + } + + StunProbed: { + DisplayName: Stun Probed + Description: Stop Harmbatoning me fuckwit shitsec. + } + + Nerfed: { + DisplayName: Nerfed + Description: If you're reading this, it's too late. + } } Tiles: { MarkovBoxTile.MapEntry: Markov Music Box - YourDemiseBoxTile.MapEntry: Your Demise Box Tile + YourDemiseBoxTile.MapEntry: Your Demise Box } } } \ No newline at end of file diff --git a/Systems/LensPlayer.cs b/Systems/LensPlayer.cs index 145ebe1..5dc2307 100644 --- a/Systems/LensPlayer.cs +++ b/Systems/LensPlayer.cs @@ -22,10 +22,15 @@ public static LensPlayer Modplayer(Player player) //Misc public int HighestBossKilled = 0; + public bool MonikasListening; + //RealKnife public bool KnifeOut = false; public float KnifeTimer = 0f; - + //SU References + public bool RoseQuarts; + public bool RoseDefended; + public readonly float RoseDamageReduc = 0.05f; //Carrier & Carrier prime public bool CarrierOn; public readonly float CarrierChance = 0.1f; @@ -41,7 +46,7 @@ public static LensPlayer Modplayer(Player player) public int DamagedTimerMax = 240;//Make sure to yadda yadda ^^^ public bool OverhealWentUp; - public bool MonikasListening; + //RoR stuff public bool UkeleleOn; @@ -123,6 +128,7 @@ public static LensPlayer Modplayer(Player player) public int SpinelDebuffsTotal = 0; + //Overrides public override void OnHitByNPC(NPC npc, Player.HurtInfo hurtInfo) { @@ -130,6 +136,17 @@ public override void OnHitByNPC(NPC npc, Player.HurtInfo hurtInfo) { SpawnMonet(0, 0, 0, PenniesAmount); } + if (RoseQuarts && Main.netMode == NetmodeID.SinglePlayer) + { + AddOverheal(hurtInfo.Damage * 0.4f); + } + else if (RoseQuarts && !RoseDefended) + { + foreach (Player player in LensUtil.FindNearbyPlayers(800, Player.position, Player, true)) + { + player.GetModPlayer().AddOverheal(hurtInfo.Damage * 0.6f); + } + } } public override void OnHitByProjectile(Projectile proj, Player.HurtInfo hurtInfo) { @@ -137,6 +154,17 @@ public override void OnHitByProjectile(Projectile proj, Player.HurtInfo hurtInfo { SpawnMonet(0, 0, 0, PenniesAmount); } + if (RoseQuarts && Main.netMode == NetmodeID.SinglePlayer) + { + AddOverheal(hurtInfo.Damage * 0.4f); + } + else if (RoseQuarts && !RoseDefended) + { + foreach (Player player in LensUtil.FindNearbyPlayers(800, Player.position, Player, true)) + { + player.GetModPlayer().AddOverheal(hurtInfo.Damage * 0.6f); + } + } } public override bool ConsumableDodge(Player.HurtInfo info) { @@ -286,6 +314,10 @@ public override void OnHurt(Player.HurtInfo info) { info.Damage = (int)(info.Damage * (1f + GestureDamageInc)); } + if (RoseQuarts) + { + info.Damage = (int)(info.Damage * (1f - RoseDamageReduc)); + } } public override void PostUpdate() @@ -309,7 +341,6 @@ public override bool CanConsumeAmmo(Item weapon, Item ammo) } return true; } - public override void UpdateLifeRegen() { if (BungusActive && Player.active) @@ -346,6 +377,9 @@ public override void PostNurseHeal(NPC nurse, int health, bool removeDebuffs, in public override void ResetEffects() { + RoseQuarts = false; + RoseDefended = false; + //ROR CarrierOn = false; CarrierPrimeOn = false; UkeleleOn = false; diff --git a/Systems/ModSys/AudioSys.cs b/Systems/ModSys/AudioSys.cs index 6b5709d..311b5be 100644 --- a/Systems/ModSys/AudioSys.cs +++ b/Systems/ModSys/AudioSys.cs @@ -16,5 +16,7 @@ public class AudioSys : ModSystem public static readonly SoundStyle BADING = new(LensRands.AssetsPath + "Sounds/BADING"); public static readonly SoundStyle GetBentLoser = new(LensRands.AssetsPath + "Sounds/Explodeurdickandsmallurass"); + + public static readonly SoundStyle Speen = new(LensRands.AssetsPath + "Sounds/speen"); } } diff --git a/build.txt b/build.txt index 36e3eb0..10498ae 100644 --- a/build.txt +++ b/build.txt @@ -1,6 +1,6 @@ displayName = Len's Randoms author = Len Kagamine -version = 0.1 +version = 0.1.0.2 Side = Both modReferences = EasyPacketsLib buildIgnore = stuff/* \ No newline at end of file diff --git a/obj/Debug/net6.0/LensRands.csproj.AssemblyReference.cache b/obj/Debug/net6.0/LensRands.csproj.AssemblyReference.cache index 8847205..c3c1a50 100644 Binary files a/obj/Debug/net6.0/LensRands.csproj.AssemblyReference.cache and b/obj/Debug/net6.0/LensRands.csproj.AssemblyReference.cache differ