Galileo Gladius support
This commit is contained in:
1 parent
bb1f610461
commit
8653134f64
4 files changed
+101
-58
No files matched your search
@@ -21,7 +21,6 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Rapier;
|
||||
Item.useTurn = false;
|
||||
Item.useAnimation = 18;
|
||||
Item.useTime = 18;
|
||||
Item.width = 44;
|
||||
@@ -32,8 +31,8 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.knockBack = 9f;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.noUseGraphic = true;
|
||||
Item.shoot = ModContent.ProjectileType<CosmicShivProj>();
|
||||
Item.shootSpeed = 2.4f;
|
||||
|
||||
|
||||
@@ -1,9 +1,6 @@
|
||||
using Terraria.DataStructures;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Materials;
|
||||
using CalamityMod.Items.Placeables.Ores;
|
||||
using CalamityMod.Projectiles.Melee;
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Projectiles.Melee.Shortswords;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
@@ -23,8 +20,7 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Item.useStyle = ItemUseStyleID.Thrust;
|
||||
Item.useTurn = false;
|
||||
Item.useStyle = ItemUseStyleID.Rapier;
|
||||
Item.useAnimation = 10;
|
||||
Item.useTime = 10;
|
||||
Item.width = 44;
|
||||
@@ -33,62 +29,19 @@ namespace CalamityMod.Items.Weapons.Melee
|
||||
Item.DamageType = DamageClass.Melee;
|
||||
Item.knockBack = 10f;
|
||||
Item.UseSound = SoundID.Item1;
|
||||
Item.useTurn = true;
|
||||
Item.autoReuse = true;
|
||||
Item.shoot = ModContent.ProjectileType<GalileosMoon>();
|
||||
Item.shootSpeed = 14f;
|
||||
Item.noUseGraphic = true;
|
||||
Item.shoot = ModContent.ProjectileType<GalileoGladiusProj>();
|
||||
Item.shootSpeed = 2.4f;
|
||||
|
||||
Item.value = CalamityGlobalItem.Rarity13BuyPrice;
|
||||
Item.Calamity().customRarity = CalamityRarity.PureGreen;
|
||||
}
|
||||
|
||||
public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source, Vector2 position, Vector2 velocity, int type, int damage, float knockback)
|
||||
{
|
||||
int moonDamage = (int)(damage * 0.3333f);
|
||||
Projectile.NewProjectile(source, position.X, position.Y, Item.shootSpeed * player.direction, 0f, type, moonDamage, knockback, player.whoAmI, 0f, 0f);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void MeleeEffects(Player player, Rectangle hitbox)
|
||||
{
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
int num250 = Dust.NewDust(new Vector2((float)hitbox.X, (float)hitbox.Y), hitbox.Width, hitbox.Height, (Main.rand.NextBool(2) ? 20 : 176), (float)(player.direction * 2), 0f, 150, default, 1.3f);
|
||||
Main.dust[num250].velocity *= 0.2f;
|
||||
Main.dust[num250].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(Player player, NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
|
||||
SpawnMeteor(player);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player player, Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
|
||||
SpawnMeteor(player);
|
||||
}
|
||||
|
||||
private void SpawnMeteor(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var source = player.GetSource_ItemUse(Item);
|
||||
if (player.Calamity().galileoCooldown <= 0)
|
||||
{
|
||||
int damage = player.GetWeaponDamage(player.ActiveItem()) * 2;
|
||||
CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType<GalileosPlanet>(), damage, 15f, player.whoAmI);
|
||||
player.Calamity().galileoCooldown = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void AddRecipes()
|
||||
{
|
||||
CreateRecipe().
|
||||
AddIngredient(ItemID.Gladius). //This may be too rare for this recipe, we'll see I guess. - Merkalto
|
||||
AddIngredient(ItemID.Gladius).
|
||||
AddIngredient<Lumenyl>(8).
|
||||
AddIngredient<RuinousSoul>(5).
|
||||
AddIngredient<ExodiumCluster>(15).
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Terraria;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -15,7 +15,7 @@ namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Elemental Shiv");
|
||||
DisplayName.SetDefault("Elemental Shiv"); // TODO: Make this one function like PiercingStarlight
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using System;
|
||||
|
||||
using CalamityMod.Projectiles.BaseProjectiles;
|
||||
|
||||
namespace CalamityMod.Projectiles.Melee.Shortswords
|
||||
{
|
||||
public class GalileoGladiusProj : BaseShortswordProjectile
|
||||
{
|
||||
public override string Texture => "CalamityMod/Items/Weapons/Melee/GalileoGladius";
|
||||
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
DisplayName.SetDefault("Galileo Gladius"); // TODO: Make it function like Gladius, not like PiercingStarlight.
|
||||
}
|
||||
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Projectile.Size = new Vector2(24);
|
||||
Projectile.friendly = true;
|
||||
Projectile.penetrate = -1;
|
||||
Projectile.tileCollide = false;
|
||||
Projectile.scale = 1f;
|
||||
Projectile.DamageType = TrueMeleeDamageClass.Instance;
|
||||
Projectile.ownerHitCheck = true;
|
||||
Projectile.timeLeft = 360;
|
||||
Projectile.extraUpdates = 1;
|
||||
Projectile.hide = true;
|
||||
Projectile.ownerHitCheck = true;
|
||||
}
|
||||
|
||||
public override Action<Projectile> EffectBeforePullback => (proj) =>
|
||||
{
|
||||
int moonDamage = (int)(Projectile.damage * 0.3333f);
|
||||
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Projectile.velocity * 10f, ModContent.ProjectileType<GalileosMoon>(), moonDamage, Projectile.knockBack, Projectile.owner, 0f, 0f);
|
||||
};
|
||||
|
||||
public override void SetVisualOffsets()
|
||||
{
|
||||
const int HalfSpriteWidth = 42 / 2;
|
||||
const int HalfSpriteHeight = 46 / 2;
|
||||
|
||||
int HalfProjWidth = Projectile.width / 2;
|
||||
int HalfProjHeight = Projectile.height / 2;
|
||||
|
||||
DrawOriginOffsetX = 0;
|
||||
DrawOffsetX = -(HalfSpriteWidth - HalfProjWidth);
|
||||
DrawOriginOffsetY = -(HalfSpriteHeight - HalfProjHeight);
|
||||
}
|
||||
|
||||
public override void ExtraBehavior()
|
||||
{
|
||||
if (Main.rand.NextBool(5))
|
||||
{
|
||||
int num250 = Dust.NewDust(Projectile.position + Projectile.velocity, Projectile.width, Projectile.height, (Main.rand.NextBool(2) ? 20 : 176), (float)(Main.player[Projectile.owner].direction * 2), 0f, 150, default, 1.3f);
|
||||
Main.dust[num250].velocity *= 0.2f;
|
||||
Main.dust[num250].noGravity = true;
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnHitNPC(NPC target, int damage, float knockback, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
|
||||
SpawnMeteor(Main.player[Projectile.owner]);
|
||||
}
|
||||
|
||||
public override void OnHitPvp(Player target, int damage, bool crit)
|
||||
{
|
||||
target.AddBuff(ModContent.BuffType<Nightwither>(), 300);
|
||||
SpawnMeteor(Main.player[Projectile.owner]);
|
||||
}
|
||||
|
||||
private void SpawnMeteor(Player player)
|
||||
{
|
||||
if (player.whoAmI == Main.myPlayer)
|
||||
{
|
||||
var source = player.GetSource_FromThis();
|
||||
if (player.Calamity().galileoCooldown <= 0)
|
||||
{
|
||||
int damage = player.GetWeaponDamage(player.ActiveItem()) * 2;
|
||||
CalamityUtils.ProjectileRain(source, player.Center, 400f, 100f, 500f, 800f, 25f, ModContent.ProjectileType<GalileosPlanet>(), damage, 15f, player.whoAmI);
|
||||
player.Calamity().galileoCooldown = 15;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user