-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
33 changed files
with
568 additions
and
55 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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>()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
} | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.