This commit is contained in:
Ozzatron committed 2019-11-07 23:30:33 -05:00
commit e14b5da8bd
22 files changed
+285 -17

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
using CalamityMod.Projectiles.Pets;
using Terraria;
using Terraria.ModLoader;
namespace CalamityMod.Buffs.Pets
{
public class BabyGhostBellBuff : ModBuff
{
public override void SetDefaults()
{
DisplayName.SetDefault("Baby Ghost Bell");
Description.SetDefault("Be careful not to pop the bubble");
Main.buffNoTimeDisplay[Type] = true;
Main.lightPet[Type] = true;
}
public override void Update(Player player, ref int buffIndex)
{
player.buffTime[buffIndex] = 18000;
player.Calamity().babyGhostBell = true;
bool petProjectileNotSpawned = player.ownedProjectileCounts[ModContent.ProjectileType<BabyGhostBell>()] <= 0;
if (petProjectileNotSpawned && player.whoAmI == Main.myPlayer)
{
Projectile.NewProjectile(player.position.X + (float)(player.width / 2), player.position.Y + (float)(player.height / 2), 0f, 0f, ModContent.ProjectileType<BabyGhostBell>(), 0, 0f, player.whoAmI, 0f, 0f);
}
}
}
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 568 B

+6 -3
View File
@@ -159,6 +159,7 @@ namespace CalamityMod.CalPlayer
public bool trashMan = false;
public int trashManChest = -1;
public bool astrophage = false;
public bool babyGhostBell = false;
// Rage
public const int stressMax = 10000;
@@ -849,6 +850,7 @@ namespace CalamityMod.CalPlayer
kendra = false;
trashMan = false;
astrophage = false;
babyGhostBell = false;
onyxExcavator = false;
angryDog = false;
fab = false;
@@ -2928,7 +2930,7 @@ namespace CalamityMod.CalPlayer
int breathLoss = 2;
int lifeLossAtZeroBreath = 3;
int lightStrength = 0 +
((player.lightOrb || player.crimsonHeart || player.magicLantern) ? 1 : 0) + //1
((player.lightOrb || player.crimsonHeart || player.magicLantern || babyGhostBell) ? 1 : 0) + //1
(aquaticEmblem ? 1 : 0) + //2
(player.arcticDivingGear ? 1 : 0) + //3
(jellyfishNecklace ? 1 : 0) + //4
@@ -7396,6 +7398,7 @@ namespace CalamityMod.CalPlayer
rareItemList.Add(ModContent.ItemType<RustedJingleBell>());
break;
}*/
rareItemList.Add(ModContent.ItemType<RustedJingleBell>());
if (Main.hardMode)
{
rareItemList.Add(ModContent.ItemType<SerpentsBite>());
@@ -7609,11 +7612,11 @@ namespace CalamityMod.CalPlayer
{
caughtType = ModContent.ItemType<SerpentsBite>();
}
/*else if (sunkenFish <= 3 && sunkenFish >= 5) //3%
else if (sunkenFish <= 3 && sunkenFish >= 5) //3%
{
caughtType = ModContent.ItemType<RustedJingleBell>();
}
else if (sunkenFish <= 2 && sunkenFish >= 0) //3%
/*else if (sunkenFish <= 2 && sunkenFish >= 0) //3%
{
caughtType = ModContent.ItemType<SparklingEmpress>();
}*/
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Items.Fishing
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Glimmering Gemfish");
Tooltip.SetDefault("Right click to extract herbs and seeds");
Tooltip.SetDefault("Right click to extract gems");
}
public override void SetDefaults()
@@ -0,0 +1,35 @@
using CalamityMod.Buffs.Pets;
using CalamityMod.Projectiles.Pets;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Items.Fishing.SunkenSeaCatches
{
public class RustedJingleBell : ModItem
{
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Rusted Jingle Bell");
Tooltip.SetDefault("Summons a baby ghost bell light pet\n" +
"Provides a good amount of light while underwater");
}
public override void SetDefaults()
{
item.CloneDefaults(ItemID.WispinaBottle);
item.shoot = ModContent.ProjectileType<BabyGhostBell>();
item.buffType = ModContent.BuffType<BabyGhostBellBuff>();
item.value = Item.sellPrice(gold: 5);
item.rare = 3;
}
public override void UseStyle(Player player)
{
if (player.whoAmI == Main.myPlayer && player.itemTime == 0)
{
player.AddBuff(item.buffType, 3600, true);
}
}
}
}
+8 -1
View File
@@ -1,5 +1,7 @@
using CalamityMod.Items.Placeables.Ores;
using CalamityMod.Tiles.Furniture.CraftingStations;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using Terraria;
using Terraria.DataStructures;
using Terraria.ModLoader;
@@ -24,7 +26,12 @@ namespace CalamityMod.Items.Materials
item.Calamity().postMoonLordRarity = 15;
}
public override void Update(ref float gravity, ref float maxFallSpeed)
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
CalamityUtils.DrawItemGlowmask(item, spriteBatch, 15, rotation, ModContent.GetTexture("CalamityMod/Items/Materials/AuricBarGlow"));
}
public override void Update(ref float gravity, ref float maxFallSpeed)
{
maxFallSpeed = 0f;
float num = (float)Main.rand.Next(90, 111) * 0.01f;
Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

+2
View File
@@ -41,10 +41,12 @@ namespace CalamityMod.Items.PermanentBoosters
}
return true;
}
public override void PostDrawInWorld(SpriteBatch spriteBatch, Color lightColor, Color alphaColor, float rotation, float scale, int whoAmI)
{
CalamityUtils.DrawItemGlowmask(item, spriteBatch, 3, rotation, ModContent.GetTexture("CalamityMod/Items/PermanentBoosters/EctoheartGlow"));
}
public override bool UseItem(Player player)
{
if (player.itemAnimation > 0 && player.itemTime == 0)
+5 -1
View File
@@ -62,7 +62,6 @@ namespace CalamityMod.NPCs.CeaselessVoid
npc.noGravity = true;
npc.noTileCollide = true;
npc.boss = true;
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit");
npc.DeathSound = SoundID.NPCDeath14;
}
@@ -380,6 +379,11 @@ namespace CalamityMod.NPCs.CeaselessVoid
public override void HitEffect(int hitDirection, double damage)
{
if (npc.soundDelay == 0)
{
npc.soundDelay = 20;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit"), npc.Center);
}
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 173, hitDirection, -1f, 0, default, 1f);
+5 -1
View File
@@ -52,7 +52,6 @@ namespace CalamityMod.NPCs.DevourerofGods
npc.behindTiles = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit");
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
for (int k = 0; k < npc.buffImmune.Length; k++)
@@ -731,6 +730,11 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void HitEffect(int hitDirection, double damage)
{
if (npc.soundDelay == 0)
{
npc.soundDelay = 20;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit"), npc.Center);
}
if (npc.life <= 0)
{
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DoGHead"), 1f);
+5 -1
View File
@@ -66,7 +66,6 @@ namespace CalamityMod.NPCs.DevourerofGods
npc.behindTiles = true;
npc.noGravity = true;
npc.noTileCollide = true;
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit");
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
for (int k = 0; k < npc.buffImmune.Length; k++)
@@ -996,6 +995,11 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void HitEffect(int hitDirection, double damage)
{
if (npc.soundDelay == 0)
{
npc.soundDelay = 20;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit"), npc.Center);
}
if (npc.life <= 0)
{
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DoGS"), 1f);
+5 -1
View File
@@ -39,7 +39,6 @@ namespace CalamityMod.NPCs.DevourerofGods
npc.noGravity = true;
npc.noTileCollide = true;
npc.canGhostHeal = false;
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit");
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.boss = true;
@@ -161,6 +160,11 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void HitEffect(int hitDirection, double damage)
{
if (npc.soundDelay == 0)
{
npc.soundDelay = 20;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit"), npc.Center);
}
if (npc.life <= 0)
{
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DoGTail"), 1f);
+5 -1
View File
@@ -39,7 +39,6 @@ namespace CalamityMod.NPCs.DevourerofGods
npc.noGravity = true;
npc.noTileCollide = true;
npc.canGhostHeal = false;
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit");
npc.DeathSound = SoundID.NPCDeath14;
npc.netAlways = true;
npc.boss = true;
@@ -227,6 +226,11 @@ namespace CalamityMod.NPCs.DevourerofGods
public override void HitEffect(int hitDirection, double damage)
{
if (npc.soundDelay == 0)
{
npc.soundDelay = 20;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/OtherworldlyHit"), npc.Center);
}
if (npc.life <= 0)
{
Gore.NewGore(npc.position, npc.velocity, mod.GetGoreSlot("Gores/DoGS5"), 1f);
+5 -1
View File
@@ -34,7 +34,6 @@ namespace CalamityMod.NPCs.NormalNPCs
npc.buffImmune[BuffID.CursedInferno] = false;
npc.lavaImmune = true;
npc.value = Item.buyPrice(0, 0, 50, 0);
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ScornHurt");
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/ScornDeath");
banner = npc.type;
bannerItem = ModContent.ItemType<ScornEaterBanner>();
@@ -159,6 +158,11 @@ namespace CalamityMod.NPCs.NormalNPCs
public override void HitEffect(int hitDirection, double damage)
{
if (npc.soundDelay == 0)
{
npc.soundDelay = 15;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ScornHurt"), npc.Center);
}
for (int k = 0; k < 5; k++)
{
Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f);
+5 -1
View File
@@ -92,7 +92,6 @@ namespace CalamityMod.NPCs.Providence
music = calamityModMusic.GetSoundSlot(SoundType.Music, "Sounds/Music/ProvidenceTheme");
else
music = MusicID.LunarBoss;
npc.HitSound = mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ProvidenceHurt");
npc.DeathSound = mod.GetLegacySoundSlot(SoundType.NPCKilled, "Sounds/NPCKilled/ProvidenceDeath");
bossBag = ModContent.ItemType<ProvidenceBag>();
}
@@ -1260,6 +1259,11 @@ namespace CalamityMod.NPCs.Providence
public override void HitEffect(int hitDirection, double damage)
{
if(npc.soundDelay == 0)
{
npc.soundDelay = 20;
Main.PlaySound(mod.GetLegacySoundSlot(SoundType.NPCHit, "Sounds/NPCHit/ProvidenceHurt"), npc.Center);
}
for (int k = 0; k < 15; k++)
Dust.NewDust(npc.position, npc.width, npc.height, 244, hitDirection, -1f, 0, default, 1f);
+162
View File
@@ -0,0 +1,162 @@
using CalamityMod.CalPlayer;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using System;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace CalamityMod.Projectiles.Pets
{
public class BabyGhostBell : ModProjectile
{
private bool underwater = false;
public override void SetStaticDefaults()
{
DisplayName.SetDefault("Baby Ghost Bell");
Main.projFrames[projectile.type] = 4;
Main.projPet[projectile.type] = true;
ProjectileID.Sets.LightPet[projectile.type] = true;
}
public override void SetDefaults()
{
projectile.netImportant = true;
projectile.width = 30;
projectile.height = 30;
projectile.friendly = true;
projectile.penetrate = -1;
projectile.timeLeft *= 5;
}
public override void AI()
{
Player player = Main.player[projectile.owner];
if (!player.active)
{
projectile.active = false;
return;
}
CalamityPlayer modPlayer = player.Calamity();
if (player.dead)
{
modPlayer.babyGhostBell = false;
}
if (modPlayer.babyGhostBell)
{
projectile.timeLeft = 2;
}
underwater = Collision.DrownCollision(player.position, player.width, player.height, player.gravDir);
if (underwater)
{
Lighting.AddLight(projectile.Center, 0.3f, 0.9f, 1.5f);
}
else
{
Lighting.AddLight(projectile.Center, 0.1f, 0.3f, 0.5f);
}
float num16 = 0.5f;
projectile.tileCollide = false;
int num17 = 100;
Vector2 vector3 = new Vector2(projectile.position.X + (float)projectile.width * 0.5f, projectile.position.Y + (float)projectile.height * 0.5f);
float num18 = Main.player[projectile.owner].position.X + (float)(Main.player[projectile.owner].width / 2) - vector3.X;
float num19 = Main.player[projectile.owner].position.Y + (float)(Main.player[projectile.owner].height / 2) - vector3.Y;
num19 += (float)Main.rand.Next(-10, 21);
num18 += (float)Main.rand.Next(-10, 21);
num18 += (float)(60 * -(float)Main.player[projectile.owner].direction);
num19 -= 60f;
float num20 = (float)Math.Sqrt((double)(num18 * num18 + num19 * num19));
float num21 = 18f;
if (num20 < (float)num17 && Main.player[projectile.owner].velocity.Y == 0f &&
projectile.position.Y + (float)projectile.height <= Main.player[projectile.owner].position.Y + (float)Main.player[projectile.owner].height &&
!Collision.SolidCollision(projectile.position, projectile.width, projectile.height))
{
projectile.ai[0] = 0f;
if (projectile.velocity.Y < -6f)
{
projectile.velocity.Y = -6f;
}
}
if (num20 > 2000f)
{
projectile.position.X = Main.player[projectile.owner].Center.X - (float)(projectile.width / 2);
projectile.position.Y = Main.player[projectile.owner].Center.Y - (float)(projectile.height / 2);
projectile.netUpdate = true;
}
if (num20 < 50f)
{
if (Math.Abs(projectile.velocity.X) > 2f || Math.Abs(projectile.velocity.Y) > 2f)
{
projectile.velocity *= 0.99f;
}
num16 = 0.01f;
}
else
{
if (num20 < 100f)
{
num16 = 0.1f;
}
if (num20 > 300f)
{
num16 = 1f;
}
num20 = num21 / num20;
num18 *= num20;
num19 *= num20;
}
if (projectile.velocity.X < num18)
{
projectile.velocity.X = projectile.velocity.X + num16;
if (num16 > 0.05f && projectile.velocity.X < 0f)
{
projectile.velocity.X = projectile.velocity.X + num16;
}
}
if (projectile.velocity.X > num18)
{
projectile.velocity.X = projectile.velocity.X - num16;
if (num16 > 0.05f && projectile.velocity.X > 0f)
{
projectile.velocity.X = projectile.velocity.X - num16;
}
}
if (projectile.velocity.Y < num19)
{
projectile.velocity.Y = projectile.velocity.Y + num16;
if (num16 > 0.05f && projectile.velocity.Y < 0f)
{
projectile.velocity.Y = projectile.velocity.Y + num16 * 2f;
}
}
if (projectile.velocity.Y > num19)
{
projectile.velocity.Y = projectile.velocity.Y - num16;
if (num16 > 0.05f && projectile.velocity.Y > 0f)
{
projectile.velocity.Y = projectile.velocity.Y - num16 * 2f;
}
}
if ((double)projectile.velocity.X >= 0.25)
{
projectile.direction = -1;
}
else if ((double)projectile.velocity.X < -0.25)
{
projectile.direction = 1;
}
projectile.spriteDirection = projectile.direction;
projectile.rotation = projectile.velocity.X * 0.05f;
projectile.frameCounter++;
if (projectile.frameCounter > 6)
{
projectile.frame++;
projectile.frameCounter = 0;
}
if (projectile.frame > 3)
{
projectile.frame = 0;
}
}
}
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

@@ -1,4 +1,6 @@
using CalamityMod.CalPlayer;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.Providence;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
@@ -29,11 +31,12 @@ namespace CalamityMod.Projectiles.Typeless.FiniteUse
public override void ModifyHitNPC(NPC target, ref int damage, ref float knockback, ref bool crit, ref int hitDirection)
{
if (target.HitSound != SoundID.NPCHit4 && target.HitSound != SoundID.NPCHit41 && target.HitSound != SoundID.NPCHit2 &&
if ((target.HitSound != SoundID.NPCHit4 && target.HitSound != SoundID.NPCHit41 && target.HitSound != SoundID.NPCHit2 &&
target.HitSound != SoundID.NPCHit5 && target.HitSound != SoundID.NPCHit11 && target.HitSound != SoundID.NPCHit30 &&
target.HitSound != SoundID.NPCHit34 && target.HitSound != SoundID.NPCHit36 && target.HitSound != SoundID.NPCHit42 &&
target.HitSound != SoundID.NPCHit49 && target.HitSound != SoundID.NPCHit52 && target.HitSound != SoundID.NPCHit53 &&
target.HitSound != SoundID.NPCHit54 && target.HitSound != null)
target.HitSound != SoundID.NPCHit54 && target.HitSound != null) || target.type == ModContent.NPCType<Providence>() ||
target.type == ModContent.NPCType<Eidolist>() || target.type == ModContent.NPCType<ScornEater>())
{
damage += target.lifeMax / 25; //400 + 80 = 480 + (100000 / 25 = 4000) = 4480, if crit = 5600 = 5.6% of boss HP
}
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Sounds.Custom
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
{
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * 1f;
soundInstance.Volume = volume * 1.25f;
soundInstance.Pan = pan;
Main.PlaySoundInstance(soundInstance);
return soundInstance;
+1 -1
View File
@@ -9,7 +9,7 @@ namespace CalamityMod.Sounds.Custom
public override SoundEffectInstance PlaySound(ref SoundEffectInstance soundInstance, float volume, float pan, SoundType type)
{
soundInstance = sound.CreateInstance();
soundInstance.Volume = volume * 1f;
soundInstance.Volume = volume * 1.2f;
soundInstance.Pan = pan;
Main.PlaySoundInstance(soundInstance);
return soundInstance;
+1 -1
View File
@@ -1,5 +1,5 @@
author = MountainDrew
version = 1.4.2.107
version = 1.4.2.108
displayName = Calamity Mod (No Calamity Music)
homepage = https://forums.terraria.org/index.php?threads/calamity-mod.44065/
buildIgnore = .vs\*, Properties\*, *.csproj, *.user, obj\*, bin\*, *.config, .git\*, LICENSE, README.md, .editorconfig, .gitignore, .gitattributes