hote still has pml scaling?? what?

also fixies for sand elem
This commit is contained in:
Altixal committed 2023-03-10 07:50:50 +07:00
1 parent d22f601cff
commit c91ad69fdf
5 files changed
+19 -39

No files matched your search

+13 -23
View File
@@ -1,6 +1,7 @@
using CalamityMod.Buffs.Summon;
using CalamityMod.CalPlayer;
using CalamityMod.Projectiles.Summon;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
@@ -9,6 +10,8 @@ namespace CalamityMod.Items.Accessories
{
public class WifeinaBottle : ModItem
{
public const int ElementalDamage = 45;
public override void SetStaticDefaults()
{
SacrificeTotal = 1;
@@ -25,38 +28,24 @@ namespace CalamityMod.Items.Accessories
Item.accessory = true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded)
{
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.elementalHeart)
{
return false;
}
return true;
}
public override bool CanEquipAccessory(Player player, int slot, bool modded) => !player.Calamity().elementalHeart;
public override void UpdateAccessory(Player player, bool hideVisual)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.sandWaifu = true;
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<SandyWaifu>()) == -1)
{
player.AddBuff(ModContent.BuffType<SandyWaifu>(), 3600, true);
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<SandElementalMinion>()] < 1)
{
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(45);
Projectile.NewProjectile(player.GetSource_Accessory(Item), player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<SandElementalMinion>(), damage, 2f, Main.myPlayer, 0f, 0f);
}
}
SpawnElemental(player);
}
public override void UpdateVanity(Player player)
{
CalamityPlayer modPlayer = player.Calamity();
modPlayer.sandWaifuVanity = true;
SpawnElemental(player);
}
public void SpawnElemental(Player player)
{
if (player.whoAmI == Main.myPlayer)
{
if (player.FindBuffIndex(ModContent.BuffType<SandyWaifu>()) == -1)
@@ -65,8 +54,9 @@ namespace CalamityMod.Items.Accessories
}
if (player.ownedProjectileCounts[ModContent.ProjectileType<SandElementalMinion>()] < 1)
{
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(45);
Projectile.NewProjectile(player.GetSource_Accessory(Item), player.Center.X, player.Center.Y, 0f, -1f, ModContent.ProjectileType<SandElementalMinion>(), damage, 2f, Main.myPlayer, 0f, 0f);
int damage = (int)player.GetTotalDamage<SummonDamageClass>().ApplyTo(ElementalDamage);
var p = Projectile.NewProjectileDirect(player.GetSource_Accessory(Item), player.Center, -Vector2.UnitY, ModContent.ProjectileType<SandElementalMinion>(), damage, 2f, Main.myPlayer);
p.originalDamage = ElementalDamage;
}
}
}
+2 -1
View File
@@ -35,7 +35,8 @@ namespace CalamityMod.Projectiles.Summon
{
if (Projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SandMark>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SandMark>(), Projectile.damage, Projectile.knockBack, Projectile.owner, 0f, 0f);
p.originalDamage = Projectile.originalDamage;
}
}
}
+1 -13
View File
@@ -257,18 +257,6 @@ namespace CalamityMod.Projectiles.Summon
}
}
}
public override bool? CanDamage()
{
Player player = Main.player[Projectile.owner];
CalamityPlayer modPlayer = player.Calamity();
if (modPlayer.sandWaifuVanity || modPlayer.allWaifusVanity)
{
return false;
}
else
{
return null;
}
}
public override bool? CanDamage() => false;
}
}
+2 -1
View File
@@ -132,7 +132,8 @@ namespace CalamityMod.Projectiles.Summon
Projectile.localAI[1] += 1f;
if (Projectile.localAI[1] == 60f && Projectile.owner == Main.myPlayer)
{
Projectile.NewProjectile(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SandTornado>(), Projectile.damage, 2f, Projectile.owner, 0f, 0f);
var p = Projectile.NewProjectileDirect(Projectile.GetSource_FromThis(), Projectile.Center, Vector2.Zero, ModContent.ProjectileType<SandTornado>(), Projectile.damage, 2f, Projectile.owner, 0f, 0f);
p.originalDamage = Projectile.originalDamage;
}
if (Projectile.localAI[1] >= 120f)
{
+1 -1
View File
@@ -23,7 +23,7 @@ namespace CalamityMod.Projectiles.Summon
Projectile.friendly = true;
Projectile.tileCollide = false;
Projectile.minion = true;
Projectile.penetrate = NPC.downedMoonlord ? -1 : 3;
Projectile.penetrate = 3;
Projectile.timeLeft = 1200;
Projectile.usesLocalNPCImmunity = true;
Projectile.localNPCHitCooldown = 20;