Added Slimer
Added Green Slime
This commit is contained in:
parent
ac911768d8
commit
8c2c2e5aa0
@ -12,7 +12,7 @@ namespace Decimation.Content.Items.Weapons.Arachnus
|
||||
protected override string ItemTooltip => "Unleashe molten ashes upon your foes.";
|
||||
protected override DamageType DamagesType => DamageType.Ranged;
|
||||
protected override int Damages => 800;
|
||||
protected override string Projectile => "MoltenStyngerBolt";
|
||||
protected override string ProjectileName => "MoltenStyngerBolt";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -9,7 +9,7 @@ namespace Decimation.Content.Items.Weapons.Arachnus
|
||||
protected override string ItemName => "Glaive Weaver";
|
||||
protected override string ItemTooltip => "Your palm burns as you wield this godly weapon.";
|
||||
protected override int Damages => 850;
|
||||
protected override string Projectile => "ArchingSolarBlade";
|
||||
protected override string ProjectileName => "ArchingSolarBlade";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -13,7 +13,7 @@ namespace Decimation.Content.Items.Weapons.Arachnus
|
||||
protected override int Damages => 880;
|
||||
protected override DamageType DamagesType => DamageType.Magic;
|
||||
protected override bool VanillaProjectile => true;
|
||||
protected override string Projectile => "HeatRay";
|
||||
protected override string ProjectileName => "HeatRay";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -13,7 +13,7 @@ namespace Decimation.Content.Items.Weapons.Bloodshot
|
||||
protected override string ItemTooltip => "Bathe your enemies in boiling blood.";
|
||||
protected override DamageType DamagesType => DamageType.Magic;
|
||||
protected override int Damages => 14;
|
||||
protected override string Projectile => "BloodBeamFriendly";
|
||||
protected override string ProjectileName => "BloodBeamFriendly";
|
||||
|
||||
|
||||
protected override void InitWeapon()
|
||||
|
||||
@ -14,7 +14,7 @@ namespace Decimation.Content.Items.Weapons.Bloodshot
|
||||
protected override string ItemTooltip => "Turns wooden arrows into siphon arrows.";
|
||||
protected override DamageType DamagesType => DamageType.Ranged;
|
||||
protected override int Damages => 20;
|
||||
protected override string Projectile => "WoodenArrowFriendly";
|
||||
protected override string ProjectileName => "WoodenArrowFriendly";
|
||||
protected override bool VanillaProjectile => true;
|
||||
|
||||
protected override void InitWeapon()
|
||||
|
||||
@ -13,7 +13,7 @@ namespace Decimation.Content.Items.Weapons.Bloodshot
|
||||
protected override string ItemName => "Vampiric Shiv";
|
||||
protected override string ItemTooltip => "Heal 10% of damages inflicted";
|
||||
protected override int Damages => 12;
|
||||
protected override string Projectile => "Tooth";
|
||||
protected override string ProjectileName => "Tooth";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -10,7 +10,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
protected override string ItemName => "Hour Hand";
|
||||
protected override string ItemTooltip => "The sands of time flow in your favor!";
|
||||
protected override int Damages => 45;
|
||||
protected override string Projectile => "HourHandProjectile";
|
||||
protected override string ProjectileName => "HourHandProjectile";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -11,7 +11,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
protected override string ItemName => "Multigrain Sword";
|
||||
protected override string ItemTooltip => "Smells like honeysuckle";
|
||||
protected override int Damages => 30;
|
||||
protected override string Projectile => "Stinger";
|
||||
protected override string ProjectileName => "Stinger";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -7,7 +7,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
protected override string ItemName => "Rod of Lightning";
|
||||
protected override int Damages => 90;
|
||||
protected override DamageType DamagesType => DamageType.Magic;
|
||||
protected override string Projectile => "LightningSphere";
|
||||
protected override string ProjectileName => "LightningSphere";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
39
Content/Items/Weapons/Slimer.cs
Normal file
39
Content/Items/Weapons/Slimer.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using Decimation.Content.Projectiles;
|
||||
using Decimation.Lib.Items;
|
||||
using Decimation.Lib.Util;
|
||||
using Decimation.Lib.Util.Builder;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace Decimation.Content.Items.Weapons
|
||||
{
|
||||
public class Slimer : DecimationWeapon
|
||||
{
|
||||
protected override string ItemName => "The Slimer";
|
||||
protected override string ItemTooltip => "Doesn't hurt, but this stuff is sticky!";
|
||||
protected override int Damages => 0;
|
||||
protected override DamageType DamagesType => DamageType.Ranged;
|
||||
protected override int ProjectileId => ModContent.ProjectileType<GreenSlime>();
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
item.CloneDefaults(ItemID.SlimeGun);
|
||||
item.width = 42;
|
||||
item.height = 26;
|
||||
item.value = Item.buyPrice(silver: 40);
|
||||
item.rare = Rarity.Green.GetRarityValue();
|
||||
}
|
||||
|
||||
protected override ModRecipe GetRecipe()
|
||||
{
|
||||
return new RecipeBuilder(this)
|
||||
.WithIngredient(ItemID.SlimeGun)
|
||||
.WithIngredient(ItemID.Gel, 50)
|
||||
.WithIngredient(ItemID.ArcheryPotion)
|
||||
.WithIngredient(ItemID.MudBlock, 25)
|
||||
.WithStation(TileID.Anvils)
|
||||
.Build();
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Content/Items/Weapons/Slimer.png
Normal file
BIN
Content/Items/Weapons/Slimer.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 582 B |
@ -13,7 +13,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
protected override string ItemTooltip => "Uses pebbles and marbles as ammo";
|
||||
protected override DamageType DamagesType => DamageType.Throw;
|
||||
protected override int Damages => 9;
|
||||
protected override string Ammo => "Pebble";
|
||||
protected override string AmmoName => "Pebble";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -12,7 +12,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
protected override string ItemTooltip => "Uses pebbles and marbles as ammo";
|
||||
protected override DamageType DamagesType => DamageType.Ranged;
|
||||
protected override int Damages => 7;
|
||||
protected override string Ammo => "Pebble";
|
||||
protected override string AmmoName => "Pebble";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -16,7 +16,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
protected override string ItemTooltip => "Feel the rage of Kronos by your side.";
|
||||
protected override DamageType DamagesType => DamageType.Ranged;
|
||||
protected override int Damages => 950;
|
||||
protected override string Projectile => "TitanicStyngerBolt";
|
||||
protected override string ProjectileName => "TitanicStyngerBolt";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -12,7 +12,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
{
|
||||
protected override string ItemName => "Titanic Pike";
|
||||
protected override int Damages => 120;
|
||||
protected override string Projectile => "TitanicPikeProjectile";
|
||||
protected override string ProjectileName => "TitanicPikeProjectile";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
@ -16,7 +16,7 @@ namespace Decimation.Content.Items.Weapons
|
||||
|
||||
protected override string ItemName => "Vampiric Edge";
|
||||
protected override int Damages => 54;
|
||||
protected override string Projectile => "Tooth";
|
||||
protected override string ProjectileName => "Tooth";
|
||||
|
||||
protected override void InitWeapon()
|
||||
{
|
||||
|
||||
130
Content/Projectiles/GreenSlime.cs
Normal file
130
Content/Projectiles/GreenSlime.cs
Normal file
@ -0,0 +1,130 @@
|
||||
using Decimation.Content.Buffs.Debuffs;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace Decimation.Content.Projectiles
|
||||
{
|
||||
public class GreenSlime : DecimationProjectile
|
||||
{
|
||||
private static readonly int SlimedBuff = ModContent.BuffType<Slimed>();
|
||||
|
||||
public override string Texture => "Terraria/Projectile_" + ProjectileID.SlimeGun;
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
projectile.CloneDefaults(ProjectileID.SlimeGun);
|
||||
projectile.aiStyle = -1;
|
||||
}
|
||||
|
||||
public override void AI()
|
||||
{
|
||||
projectile.scale -= 0.015f;
|
||||
if (projectile.scale <= 0f)
|
||||
{
|
||||
projectile.velocity *= 5f;
|
||||
projectile.oldVelocity = projectile.velocity;
|
||||
projectile.Kill();
|
||||
}
|
||||
|
||||
if (projectile.ai[0] > 3f)
|
||||
{
|
||||
if (projectile.owner == Main.myPlayer)
|
||||
{
|
||||
Rectangle projRectangle = new Rectangle((int) projectile.position.X, (int) projectile.position.Y,
|
||||
projectile.width, projectile.height);
|
||||
for (int n = 0; n < 200; n++)
|
||||
if (Main.npc[n].active && !Main.npc[n].dontTakeDamage && Main.npc[n].lifeMax > 1)
|
||||
{
|
||||
Rectangle npcRectangle = new Rectangle((int) Main.npc[n].position.X,
|
||||
(int) Main.npc[n].position.Y, Main.npc[n].width, Main.npc[n].height);
|
||||
if (projRectangle.Intersects(npcRectangle))
|
||||
{
|
||||
Main.npc[n].AddBuff(SlimedBuff, 1500);
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
|
||||
for (int p = 0; p < 255; p++)
|
||||
if (p != projectile.owner && Main.player[p].active && !Main.player[p].dead)
|
||||
{
|
||||
Rectangle playerRectangle = new Rectangle((int) Main.player[p].position.X,
|
||||
(int) Main.player[p].position.Y, Main.player[p].width, Main.player[p].height);
|
||||
if (projRectangle.Intersects(playerRectangle))
|
||||
{
|
||||
Main.player[p].AddBuff(SlimedBuff, 1500, false);
|
||||
projectile.Kill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
projectile.ai[0] += Main.rand.Next(0, 5);
|
||||
if (projectile.ai[0] > 30f) projectile.velocity.Y += 0.1f;
|
||||
|
||||
int dustAlpha = 175;
|
||||
Color dustColor = new Color(0, 255, 60, 100);
|
||||
for (int i = 0; i < 6; i++)
|
||||
{
|
||||
Vector2 val57 = projectile.velocity * i / 6f;
|
||||
int num622 = 6;
|
||||
int dust = Dust.NewDust(projectile.position + Vector2.One * 6f, projectile.width - num622 * 2,
|
||||
projectile.height - num622 * 2, 4, 0f, 0f, dustAlpha, dustColor, 1.2f);
|
||||
Dust dust96;
|
||||
Dust dust2;
|
||||
if (Main.rand.Next(2) == 0)
|
||||
{
|
||||
dust96 = Main.dust[dust];
|
||||
dust2 = dust96;
|
||||
dust2.alpha += 25;
|
||||
}
|
||||
|
||||
if (Main.rand.Next(2) == 0)
|
||||
{
|
||||
dust96 = Main.dust[dust];
|
||||
dust2 = dust96;
|
||||
dust2.alpha += 25;
|
||||
}
|
||||
|
||||
if (Main.rand.Next(2) == 0)
|
||||
{
|
||||
dust96 = Main.dust[dust];
|
||||
dust2 = dust96;
|
||||
dust2.alpha += 25;
|
||||
}
|
||||
|
||||
Main.dust[dust].noGravity = true;
|
||||
dust96 = Main.dust[dust];
|
||||
dust2 = dust96;
|
||||
dust2.velocity *= 0.3f;
|
||||
dust96 = Main.dust[dust];
|
||||
dust2 = dust96;
|
||||
dust2.velocity += projectile.velocity * 0.5f;
|
||||
Main.dust[dust].position = projectile.Center;
|
||||
Main.dust[dust].position.X -= val57.X;
|
||||
Main.dust[dust].position.Y -= val57.Y;
|
||||
dust96 = Main.dust[dust];
|
||||
dust2 = dust96;
|
||||
dust2.velocity *= 0.2f;
|
||||
}
|
||||
|
||||
if (Main.rand.Next(4) == 0)
|
||||
{
|
||||
int num624 = 6;
|
||||
int num625 = Dust.NewDust(projectile.position + Vector2.One * 6f, projectile.width - num624 * 2,
|
||||
projectile.height - num624 * 2, 4, 0f, 0f, dustAlpha, dustColor, 1.2f);
|
||||
Dust dust97 = Main.dust[num625];
|
||||
Dust dust2 = dust97;
|
||||
dust2.velocity *= 0.5f;
|
||||
dust97 = Main.dust[num625];
|
||||
dust2 = dust97;
|
||||
dust2.velocity += projectile.velocity * 0.5f;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
projectile.ai[0] += 1f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,55 +1,11 @@
|
||||
using Decimation.Lib.Util;
|
||||
using System;
|
||||
using Decimation.Lib.Util;
|
||||
using Terraria;
|
||||
|
||||
namespace Decimation.Lib.Items
|
||||
{
|
||||
public abstract class DecimationWeapon : DecimationItem
|
||||
{
|
||||
protected virtual DamageType DamagesType { get; } = DamageType.Melee;
|
||||
protected virtual string Projectile { get; } = null;
|
||||
protected virtual string Ammo { get; } = null;
|
||||
protected virtual bool VanillaProjectile { get; } = false;
|
||||
protected virtual bool VanillaAmmo { get; } = false;
|
||||
|
||||
protected abstract int Damages { get; }
|
||||
protected abstract void InitWeapon();
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
this.item.useStyle = 1;
|
||||
this.item.autoReuse = false;
|
||||
this.item.useTurn = true;
|
||||
this.item.maxStack = 1;
|
||||
|
||||
switch (this.DamagesType)
|
||||
{
|
||||
case DamageType.Magic:
|
||||
this.item.magic = true;
|
||||
break;
|
||||
case DamageType.Ranged:
|
||||
this.item.ranged = true;
|
||||
break;
|
||||
case DamageType.Throw:
|
||||
this.item.thrown = true;
|
||||
break;
|
||||
default:
|
||||
this.item.melee = true;
|
||||
break;
|
||||
}
|
||||
|
||||
InitWeapon();
|
||||
|
||||
this.item.damage = this.Damages;
|
||||
|
||||
if (this.Projectile != null)
|
||||
this.item.shoot = ItemUtils.GetIdFromName(this.Projectile, typeof(Projectile), this.VanillaProjectile);
|
||||
|
||||
if (this.Ammo != null)
|
||||
this.item.useAmmo = ItemUtils.GetIdFromName(this.Ammo, typeof(Item), this.VanillaAmmo);
|
||||
|
||||
if (this.item.melee) this.item.noMelee = false;
|
||||
}
|
||||
|
||||
public enum DamageType
|
||||
{
|
||||
Melee,
|
||||
@ -57,5 +13,55 @@ namespace Decimation.Lib.Items
|
||||
Throw,
|
||||
Ranged
|
||||
}
|
||||
|
||||
protected virtual DamageType DamagesType { get; } = DamageType.Melee;
|
||||
[Obsolete("Use ProjectileId instead")] protected virtual string ProjectileName { get; } = null;
|
||||
protected virtual int ProjectileId { get; } = -1;
|
||||
[Obsolete("Use AmmoId instead")] protected virtual string AmmoName { get; } = null;
|
||||
protected virtual int AmmoId { get; } = -1;
|
||||
[Obsolete] protected virtual bool VanillaProjectile { get; } = false;
|
||||
[Obsolete] protected virtual bool VanillaAmmo { get; } = false;
|
||||
|
||||
protected abstract int Damages { get; }
|
||||
protected abstract void InitWeapon();
|
||||
|
||||
protected override void Init()
|
||||
{
|
||||
item.useStyle = 1;
|
||||
item.autoReuse = false;
|
||||
item.useTurn = true;
|
||||
item.maxStack = 1;
|
||||
|
||||
switch (DamagesType)
|
||||
{
|
||||
case DamageType.Magic:
|
||||
item.magic = true;
|
||||
break;
|
||||
case DamageType.Ranged:
|
||||
item.ranged = true;
|
||||
break;
|
||||
case DamageType.Throw:
|
||||
item.thrown = true;
|
||||
break;
|
||||
default:
|
||||
item.melee = true;
|
||||
break;
|
||||
}
|
||||
|
||||
InitWeapon();
|
||||
|
||||
item.damage = Damages;
|
||||
|
||||
if (ProjectileName != null)
|
||||
item.shoot =
|
||||
ItemUtils.GetIdFromName(ProjectileName, typeof(Projectile), VanillaProjectile);
|
||||
if (ProjectileId > -1) item.shoot = ProjectileId;
|
||||
|
||||
if (AmmoName != null)
|
||||
item.useAmmo = ItemUtils.GetIdFromName(AmmoName, typeof(Item), VanillaAmmo);
|
||||
if (AmmoId > -1) item.ammo = AmmoId;
|
||||
|
||||
if (item.melee) item.noMelee = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user