New Auric Ore + effects fixes for ores
This commit is contained in:
1 parent
34c4951881
commit
822fb28752
7 files changed
+113
-10
No files matched your search
@@ -46,6 +46,7 @@ using CalamityMod.Projectiles.Melee;
|
||||
using CalamityMod.Projectiles.Rogue;
|
||||
using CalamityMod.Projectiles.Summon;
|
||||
using CalamityMod.Projectiles.Typeless;
|
||||
using CalamityMod.Tiles.Ores;
|
||||
using CalamityMod.UI;
|
||||
using CalamityMod.World;
|
||||
using Microsoft.Xna.Framework;
|
||||
@@ -91,6 +92,9 @@ namespace CalamityMod.CalPlayer
|
||||
}
|
||||
OldPositions[0] = Player.position;
|
||||
|
||||
// Tile effects for touching tiles
|
||||
HandleTileEffects();
|
||||
|
||||
// Hurt the nearest NPC to the mouse if using the burning mouse.
|
||||
if (blazingCursorDamage || blazingCursorVisuals)
|
||||
HandleBlazingMouseEffects();
|
||||
@@ -484,6 +488,36 @@ namespace CalamityMod.CalPlayer
|
||||
#endregion
|
||||
|
||||
#region Misc Effects
|
||||
private void HandleTileEffects()
|
||||
{
|
||||
foreach (Point touchedTile in Collision.GetEntityEdgeTiles(Player))
|
||||
{
|
||||
Tile tile = Main.tile[touchedTile];
|
||||
if (tile != null && tile.HasTile && tile.HasUnactuatedTile)
|
||||
{
|
||||
if (tile.TileType == ModContent.TileType<AuricOre>())
|
||||
{
|
||||
//player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 2);
|
||||
Player.AddBuff(BuffID.Electrified, 300);
|
||||
AuricOre.Animate = true;
|
||||
Player.RemoveAllGrapplingHooks();
|
||||
//if (!Player.immune)
|
||||
{
|
||||
var velocity = Vector2.Normalize(Player.Center - touchedTile.ToWorldCoordinates());
|
||||
Player.Hurt(PlayerDeathReason.ByCustomReason(Player.name + " was not worthy"), 100, 0);
|
||||
Player.velocity += velocity * 50f; // Adjust to make it more or less insane
|
||||
SoundEngine.PlaySound(new SoundStyle("CalamityMod/Sounds/Custom/ExoMechs/TeslaShoot1"));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (tile.TileType == ModContent.TileType<AstralOre>())
|
||||
{
|
||||
Player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 2);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
private void HandleBlazingMouseEffects()
|
||||
{
|
||||
// The sigil's brightness slowly fades away every frame if not incinerating anything.
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
ItemDrop = ModContent.ItemType<Items.Placeables.Ores.AerialiteOre>();
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Aerialite Ore");
|
||||
AddMapEntry(new Color(103, 103, 186), name);
|
||||
AddMapEntry(new Color(145, 255, 255), name);
|
||||
MineResist = 2f;
|
||||
MinPick = 65;
|
||||
HitSound = SoundID.Tink;
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace CalamityMod.Tiles.Ores
|
||||
DustType = 33;
|
||||
//ItemDrop = ModContent.ItemType<Items.Placeables.Ores.AerialiteOre>();
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Aerialite Ore");
|
||||
name.SetDefault("Disenchanted Aerialite Ore");
|
||||
AddMapEntry(new Color(204, 170, 81), name);
|
||||
MineResist = 2f;
|
||||
MinPick = 65;
|
||||
|
||||
@@ -70,11 +70,11 @@ namespace CalamityMod.Tiles.Ores
|
||||
b = 0.07f;
|
||||
}
|
||||
|
||||
public override void FloorVisuals(Player player)
|
||||
{
|
||||
player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 2);
|
||||
base.FloorVisuals(player);
|
||||
}
|
||||
//public override void FloorVisuals(Player player)
|
||||
//{
|
||||
// player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 2);
|
||||
// base.FloorVisuals(player);
|
||||
//}
|
||||
|
||||
public override bool TileFrame(int i, int j, ref bool resetFrame, ref bool noBreak)
|
||||
{
|
||||
|
||||
+72
-3
@@ -1,16 +1,27 @@
|
||||
using Microsoft.Xna.Framework;
|
||||
using CalamityMod.Buffs.DamageOverTime;
|
||||
using CalamityMod.Tiles.Astral;
|
||||
using Terraria;
|
||||
using Terraria.Audio;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ID;
|
||||
using ReLogic.Content;
|
||||
using Terraria.ObjectData;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using Terraria.DataStructures;
|
||||
|
||||
namespace CalamityMod.Tiles.Ores
|
||||
{
|
||||
public class AuricOre : ModTile
|
||||
{
|
||||
public static readonly SoundStyle MineSound = new("CalamityMod/Sounds/Custom/AuricMine", 3);
|
||||
public static bool Animate;
|
||||
internal static Texture2D GlowTexture;
|
||||
public override void SetStaticDefaults()
|
||||
{
|
||||
if (!Main.dedServ)
|
||||
GlowTexture = ModContent.Request<Texture2D>("CalamityMod/Tiles/Ores/AuricOreGlow", AssetRequestMode.ImmediateLoad).Value;
|
||||
AnimationFrameHeight = 270;
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileSolid[Type] = true;
|
||||
Main.tileMergeDirt[Type] = true;
|
||||
@@ -45,9 +56,67 @@ namespace CalamityMod.Tiles.Ores
|
||||
|
||||
public override void ModifyLight(int i, int j, ref float r, ref float g, ref float b)
|
||||
{
|
||||
r = 0.20f;
|
||||
g = 0.16f;
|
||||
b = 0.00f;
|
||||
if (!Animate)
|
||||
{return;}
|
||||
r = 0.48f;
|
||||
g = 0.80f;
|
||||
b = 0.93f;
|
||||
}
|
||||
public override void AnimateTile(ref int frame, ref int frameCounter)
|
||||
{
|
||||
if (!Animate)
|
||||
{return;}
|
||||
frameCounter++;
|
||||
if (frameCounter > 4)
|
||||
{
|
||||
frameCounter = 0;
|
||||
frame++;
|
||||
if (frame > 7)
|
||||
{
|
||||
Animate = false;
|
||||
frame = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*public override void FloorVisuals(Player player)
|
||||
{
|
||||
//player.AddBuff(ModContent.BuffType<AstralInfectionDebuff>(), 2);
|
||||
player.AddBuff(BuffID.Electrified, 300);
|
||||
base.FloorVisuals(player);
|
||||
Animate = true;
|
||||
player.RemoveAllGrapplingHooks();
|
||||
}*/
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
int xPos = Main.tile[i, j].TileFrameX;
|
||||
int yPos = Main.tile[i, j].TileFrameY;
|
||||
Texture2D glowmask = ModContent.Request<Texture2D>("CalamityMod/Tiles/Ores/AuricOreGlow").Value;
|
||||
Vector2 zero = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
|
||||
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + zero;
|
||||
Color drawColour = GetDrawColour(i, j, new Color(225, 255, 255, 255));
|
||||
Tile trackTile = Main.tile[i, j];
|
||||
double num6 = Main.time * 0.08;
|
||||
if (!trackTile.IsHalfBlock && trackTile.Slope == 0)
|
||||
{
|
||||
Main.spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
else if (trackTile.IsHalfBlock)
|
||||
{
|
||||
Main.spriteBatch.Draw(glowmask, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), drawColour, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
}
|
||||
private Color GetDrawColour(int i, int j, Color colour)
|
||||
{
|
||||
int colType = Main.tile[i, j].TileColor;
|
||||
Color paintCol = WorldGen.paintColor(colType);
|
||||
if (colType >= 13 && colType <= 24)
|
||||
{
|
||||
colour.R = (byte)(paintCol.R / 255f * colour.R);
|
||||
colour.G = (byte)(paintCol.G / 255f * colour.G);
|
||||
colour.B = (byte)(paintCol.B / 255f * colour.B);
|
||||
}
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 76 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 69 KiB |
Reference in new issue
Block a user