This commit is contained in:
Andrew Marheine committed 2020-05-02 10:07:51 -05:00
commit 1133ae8e2a
9 files changed
+44 -10

No files matched your search

+3
View File
@@ -26,6 +26,8 @@ namespace CalamityMod.Buffs
{
player.lavaMax += 420;
}
// Rogue weapons benefit from vanilla throwing crit, so don't double-increase rogue crit chance with these buffs.
/*
else if (type == BuffID.Rage)
{
player.Calamity().throwingCrit += 10;
@@ -34,6 +36,7 @@ namespace CalamityMod.Buffs
{
player.Calamity().throwingCrit += 2;
}
*/
else if (type >= BuffID.NebulaUpDmg1 && type <= BuffID.NebulaUpDmg3)
{
float nebulaDamage = 0.075f * (float)player.nebulaLevelDamage; //7.5% to 22.5%
+10 -2
View File
@@ -9228,7 +9228,8 @@ namespace CalamityMod.CalPlayer
player.rangedCrit += boost;
player.magicCrit += boost;
player.thrownCrit += boost;
throwingCrit += boost;
// Rogue weapons benefit from throwing crit AND rogue crit, so don't add both.
// throwingCrit += boost;
}
#endregion
@@ -9289,7 +9290,14 @@ namespace CalamityMod.CalPlayer
// This doesn't trigger stealth strike effects (ConsumeStealthStrike instead of StealthStrike)
// so non-rogue weapons can't call lasers down from the sky and such.
// Using any item which deals no damage or is a tool doesn't consume stealth.
bool playerUsingWeapon = player.HeldItem.damage > 0 && player.HeldItem.pick <= 0 && player.HeldItem.hammer <= 0 && player.HeldItem.axe <= 0;
Item it = player.HeldItem;
bool hasDamage = it.damage > 0;
bool isPickaxe = it.pick > 0;
bool isAxe = it.axe > 0;
bool isHammer = it.hammer > 0;
bool isPlaced = it.createTile != 0;
bool producesNoHitboxes = it.shoot == 0 && it.useStyle == ItemUseStyleID.SwingThrow && it.noMelee;
bool playerUsingWeapon = hasDamage && !(isPickaxe || isAxe || isHammer || isPlaced || producesNoHitboxes);
if (!stealthStrikeThisFrame && player.itemAnimation == player.itemAnimationMax - 1 && playerUsingWeapon)
ConsumeStealthByAttacking();
}
+5 -2
View File
@@ -20,16 +20,19 @@ namespace CalamityMod.Items.Weapons.Rogue
item.summon = false;
}
// Simply add the player's dedicated rogue damage.
// Rogue weapons are internally throwing so they already benefit from throwing damage boosts.
// 5E-06 to prevent downrounding is not needed anymore, added by TML itself
public override void ModifyWeaponDamage(Player player, ref float add, ref float mult, ref float flat)
{
add += player.Calamity().throwingDamage - 1f;
}
// Calculates a rogue weapon's crit chance using the player's rogue crit chance.
// Simply add the player's dedicated rogue crit chance.
// Rogue crit isn't boosted by Calamity universal crit boosts, so this won't double-add universal crit.
public override void GetWeaponCrit(Player player, ref int crit)
{
crit = item.crit + player.Calamity().throwingCrit;
crit += player.Calamity().throwingCrit;
}
public override float UseTimeMultiplier(Player player)
+1 -1
View File
@@ -50,7 +50,7 @@ namespace CalamityMod.Items.Weapons.Summon
position = Main.MouseWorld;
speedX = 0;
speedY = 0;
for (int x = 0; x < 1000; x++)
for (int x = 0; x < Main.maxProjectiles; x++)
{
Projectile projectile = Main.projectile[x];
if (projectile.active && projectile.owner == player.whoAmI && projectile.type == ModContent.ProjectileType<SolarGod>())
@@ -11,7 +11,8 @@ namespace CalamityMod.Items.Weapons.Summon
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Tundra Flame Blossoms Staff");
Tooltip.SetDefault("Summons three unusual flowers over your head");
Tooltip.SetDefault("Summons three unusual flowers over your head\n" +
"Each flower consumes one minion slot");
}
public override void SetDefaults()
@@ -32,9 +33,19 @@ namespace CalamityMod.Items.Weapons.Summon
item.shootSpeed = 10f;
item.summon = true;
}
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] <= 0;
public override bool CanUseItem(Player player) => player.ownedProjectileCounts[item.shoot] < 3; //If you already have all 3, no need to resummon
public override bool Shoot(Player player, ref Vector2 position, ref float speedX, ref float speedY, ref int type, ref int damage, ref float knockBack)
{
for (int x = 0; x < Main.maxProjectiles; x++)
{
Projectile proj = Main.projectile[x];
if (proj.active && proj.owner == player.whoAmI && proj.type == type)
{
proj.Kill();
}
}
for (int i = 0; i < 3; i++)
{
Projectile blossom = Projectile.NewProjectileDirect(player.Center, Vector2.Zero, type, damage, knockBack, player.whoAmI, 0f, 0f);
+1
View File
@@ -836,6 +836,7 @@ namespace CalamityMod
sAssociation.Call("AddMinionInfo", ItemType<ForgottenApexWand>(), BuffType<ApexSharkBuff>(), ProjectileType<ApexShark>());
sAssociation.Call("AddMinionInfo", ItemType<DeepseaStaff>(), BuffType<AquaticStar>(), ProjectileType<AquaticStarMinion>());
sAssociation.Call("AddMinionInfo", ItemType<SunGodStaff>(), BuffType<SolarSpiritGod>(), ProjectileType<SolarGod>());
sAssociation.Call("AddMinionInfo", ItemType<TundraFlameBlossomsStaff>(), BuffType<TundraFlameBlossomsBuff>(), ProjectileType<TundraFlameBlossom>());
sAssociation.Call("AddMinionInfo", ItemType<DormantBrimseeker>(), BuffType<DormantBrimseekerBuff>(), ProjectileType<DormantBrimseekerBab>());
sAssociation.Call("AddMinionInfo", ItemType<IgneousExaltation>(), BuffType<IgneousExaltationBuff>(), ProjectileType<IgneousBlade>());
sAssociation.Call("AddMinionInfo", ItemType<BlightedEyeStaff>(), BuffType<CalamitasEyes>(), new List<int>() { ProjectileType<Calamitamini>(), ProjectileType<Cataclymini>(), ProjectileType<Catastromini>()}, new List<float>() {1-(1f/3f), 2f/3f, 2f/3f});
@@ -1041,6 +1041,9 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void NPCLoot()
{
// Stop the countdown -- if you kill DoG in less than 60 frames, this will stop another one from spawning.
CalamityWorld.DoGSecondStageCountdown = 0;
DropHelper.DropBags(npc);
DropHelper.DropItem(npc, ModContent.ItemType<SupremeHealingPotion>(), 8, 14);
+1 -1
View File
@@ -48,7 +48,7 @@ namespace CalamityMod.Projectiles.Summon
projectile.timeLeft = 2;
}
}
projectile.Center = Main.player[projectile.owner].Center + (projectile.ai[1] / 32f).ToRotationVector2() * 95f;
projectile.Center = player.Center + (projectile.ai[1] / 32f).ToRotationVector2() * 95f;
projectile.scale = 1f + (float)Math.Sin(projectile.ai[1] / 40f) * 0.085f;
projectile.Opacity = 1f - (float)Math.Sin(projectile.ai[1] / 45f) * 0.1f - 0.1f; // Range of 1f to 0.8f
projectile.rotation += MathHelper.ToRadians(5f);
+7 -2
View File
@@ -5,6 +5,7 @@ using Terraria;
using Terraria.ModLoader;
using CalamityMod.World;
using Microsoft.Xna.Framework.Input;
using System.Collections.Generic;
namespace CalamityMod.UI
{
@@ -257,10 +258,14 @@ namespace CalamityMod.UI
private static void CheckGarbageCornerPos()
{
if (rageDrawPos.X <= 60f && rageDrawPos.Y <= 20f)
// This should only happen if something happens to the config file.
if (rageDrawPos == Vector2.Zero)
rageDrawPos = new Vector2(DefaultRagePosX, DefaultRagePosY);
if (adrenDrawPos.X <= 60f && adrenDrawPos.Y <= 20f)
rageDrawPos = Vector2.Clamp(rageDrawPos, Vector2.Zero, new Vector2(Main.screenWidth - 104f, Main.screenHeight - 24f));
if (adrenDrawPos == Vector2.Zero)
adrenDrawPos = new Vector2(DefaultAdrenPosX, DefaultAdrenPosY);
adrenDrawPos = Vector2.Clamp(adrenDrawPos, Vector2.Zero, new Vector2(Main.screenWidth - 104f, Main.screenHeight - 24f));
}
private static Vector2 GetShakeOffset()