Skip to content

Commit

Permalink
Holy moley batman
Browse files Browse the repository at this point in the history
Woah, memes and a fucking SCP.
  • Loading branch information
V2LenKagamine committed Jun 18, 2023
1 parent fc46910 commit 84a2c49
Show file tree
Hide file tree
Showing 33 changed files with 568 additions and 55 deletions.
Binary file modified .vs/LensRands/DesignTimeBuild/.dtbcache.v2
Binary file not shown.
Binary file modified .vs/LensRands/v17/.suo
Binary file not shown.
Binary file added Assets/Buffs/Nerfed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Buffs/RoseBuff.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Buffs/StunProbed.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Items/Accessories/RoseShield.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Items/Misc/Nerf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Items/Misc/Wumpa.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Items/Toys/BouncyBalls.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Projectiles/BouncyBall.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Projectiles/Nerf.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Projectiles/RealKnife999.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Assets/Sounds/speen.ogg
Binary file not shown.
File renamed without changes.
18 changes: 18 additions & 0 deletions Common/DropRules/LensItemSources.cs
Original file line number Diff line number Diff line change
@@ -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<Wumpa>());
}
}
}
}
31 changes: 31 additions & 0 deletions Content/Buffs/Nerfed.cs
Original file line number Diff line number Diff line change
@@ -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);
}
}
}
}
23 changes: 23 additions & 0 deletions Content/Buffs/RoseQuartsBuff.cs
Original file line number Diff line number Diff line change
@@ -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<LensPlayer>().RoseDefended = true;
}
}
}
25 changes: 25 additions & 0 deletions Content/Buffs/StunProbed.cs
Original file line number Diff line number Diff line change
@@ -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;
}
}
}
16 changes: 8 additions & 8 deletions Content/Items/Accessories/RORMisc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
49 changes: 49 additions & 0 deletions Content/Items/Accessories/RoseShield.cs
Original file line number Diff line number Diff line change
@@ -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<LensPlayer>().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<LensPlayer>().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<RoseQuartsBuff>(), 30);
}
}
}
}
}
59 changes: 59 additions & 0 deletions Content/Items/Memes/SCP3108.cs
Original file line number Diff line number Diff line change
@@ -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<NerfingGun>();
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<Nerfed>(), 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();
}
}
}
113 changes: 113 additions & 0 deletions Content/Items/Memes/Toys.cs
Original file line number Diff line number Diff line change
@@ -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<BouncyBallP>();
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;
}
}

}
}
Loading

0 comments on commit 84a2c49

Please sign in to comment.