Removed Field Generators.
This commit is contained in:
1 parent
8413f40c7e
commit
c375ccc044
10 files changed
+30
-230
No files matched your search
@@ -163,12 +163,6 @@ namespace CalamityMod
|
||||
TEBaseTurret.ReadSyncPacket(mod, reader);
|
||||
break;
|
||||
|
||||
|
||||
case CalamityModMessageType.DraedonFieldGeneratorSync:
|
||||
int entityID2 = reader.ReadInt32();
|
||||
(TileEntity.ByID[entityID2] as TEDraedonFieldGenerator).Time = reader.ReadInt32();
|
||||
(TileEntity.ByID[entityID2] as TEDraedonFieldGenerator).ActiveTimer = reader.ReadInt32();
|
||||
break;
|
||||
case CalamityModMessageType.SyncCalamityNPCAIArray:
|
||||
byte npcIndex2 = reader.ReadByte();
|
||||
Main.npc[npcIndex2].Calamity().newAI[0] = reader.ReadSingle();
|
||||
@@ -249,7 +243,6 @@ namespace CalamityMod
|
||||
SyncCalamityNPCAIArray,
|
||||
ProvidenceDyeConditionSync, // We shouldn't fucking need this. Die in a hole, Multiplayer.
|
||||
PSCChallengeSync, // See above
|
||||
DraedonFieldGeneratorSync,
|
||||
|
||||
// These message types were written by Ozz. They are Ozz's working tile entity netcode. Do not touch them.
|
||||
PowerCellFactory,
|
||||
|
||||
@@ -1,13 +1,12 @@
|
||||
using CalamityMod.Tiles;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Tiles.Plates;
|
||||
using CalamityMod.Walls;
|
||||
using CalamityMod.Walls.DraedonStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections.Generic;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Walls.DraedonStructures;
|
||||
using CalamityMod.Tiles.Plates;
|
||||
using CalamityMod.Walls;
|
||||
|
||||
namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
{
|
||||
@@ -370,7 +369,10 @@ namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
var tile351 = new TileDefinitionStructure(ModContent.TileType<LaboratoryElectricPanel>()).UseHeaders(0, 75, 1, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 396, 36);
|
||||
var tile352 = new TileDefinitionStructure(ModContent.TileType<LaboratoryShelf>()).UseHeaders(0, 71, 1, 4128).UseFrame(180, 0).UseWall((ushort)ModContent.WallType<LaboratoryPlateBeam>(), 252, 36);
|
||||
var tile353 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 11, 0, 0).UseWall((ushort)ModContent.WallType<LaboratoryPlateBeam>(), 396, 0);
|
||||
var tile354 = new TileDefinitionStructure(ModContent.TileType<DraedonFactoryFieldGenerator>()).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 108, 36);
|
||||
|
||||
// HAND EDITED BY OZZATRON: Removed Field Generators from the game, so this is now air.
|
||||
var tile354 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 108, 36);
|
||||
|
||||
var tile355 = new TileDefinitionStructure(ModContent.TileType<HazardChevronPanels>()).UseHeaders(0, 103, 1, 32).UseFrame(54, 0).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 252, 36);
|
||||
var tile356 = new TileDefinitionStructure(ModContent.TileType<HazardChevronPanels>()).UseHeaders(0, 155, 2, 32).UseFrame(36, 36).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 396, 72);
|
||||
var tile357 = new TileDefinitionStructure(ModContent.TileType<RustedPipes>()).UseHeaders(0, 164, 2, 32).UseFrame(144, 72).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 144, 72);
|
||||
@@ -1105,7 +1107,10 @@ namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
var tile1086 = new TileDefinitionStructure(ModContent.TileType<LaboratoryElectricPanel>()).UseHeaders(0, 131, 1, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 108, 36);
|
||||
var tile1087 = new TileDefinitionStructure(ModContent.TileType<LaboratoryElectricPanel>()).UseHeaders(0, 66, 1, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 72, 36);
|
||||
var tile1088 = new TileDefinitionStructure(ModContent.TileType<LaboratoryShelf>()).UseHeaders(0, 136, 2, 8224).UseFrame(144, 0).UseWall((ushort)ModContent.WallType<LaboratoryPlateBeam>(), 288, 72);
|
||||
var tile1089 = new TileDefinitionStructure(ModContent.TileType<DraedonFactoryFieldGenerator>()).UseHeaders(0, 136, 2, 32).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 288, 72);
|
||||
|
||||
// HAND EDITED BY OZZATRON: Removed Field Generators from the game, so this is now air.
|
||||
var tile1089 = new TileDefinitionStructure(TileID.Dirt).UseHeaders(0, 136, 2, 32).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 288, 72);
|
||||
|
||||
var tile1090 = new TileDefinitionStructure(ModContent.TileType<HazardChevronPanels>()).UseHeaders(0, 147, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 108, 36);
|
||||
var tile1091 = new TileDefinitionStructure(ModContent.TileType<HazardChevronPanels>()).UseHeaders(0, 82, 1, 32).UseFrame(36, 36).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 72, 36);
|
||||
var tile1092 = new TileDefinitionStructure(ModContent.TileType<RustedPipes>()).UseHeaders(0, 132, 4, 32).UseFrame(108, 72).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 144, 144);
|
||||
|
||||
@@ -708,7 +708,10 @@ namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
var tile688 = new TileDefinitionStructure(ModContent.TileType<Elumplate>()).UseHeaders(0, 136, 2, 32).UseFrame(18, 18).UseWall((ushort)ModContent.WallType<ElumplateWall>(), 288, 72);
|
||||
var tile689 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(32, 71, 2, 0).UseLiquid(LiquidState.Lava, 255).UseWall((ushort)ModContent.WallType<ElumplateWall>(), 252, 72);
|
||||
var tile690 = new TileDefinitionStructure(ModContent.TileType<Elumplate>()).UseHeaders(0, 103, 2, 32).UseFrame(54, 36).UseWall((ushort)ModContent.WallType<ElumplateWall>(), 252, 72);
|
||||
var tile691 = new TileDefinitionStructure(ModContent.TileType<DraedonFactoryFieldGenerator>()).UseHeaders(0, 131, 1, 32).UseWall((ushort)WallID.IceUnsafe, 108, 36);
|
||||
|
||||
// HAND EDITED BY OZZATRON: Removed Field Generators from the game, so this is now air.
|
||||
var tile691 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 32).UseWall((ushort)WallID.IceUnsafe, 108, 36);
|
||||
|
||||
var tile692 = new TileDefinitionStructure(ModContent.TileType<LaboratoryPlating>()).UseHeaders(0, 83, 4, 8224).UseFrame(36, 54).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 108, 144);
|
||||
var tile693 = new TileDefinitionStructure(ModContent.TileType<LaboratoryPlating>()).UseHeaders(0, 0, 0, 12320).UseFrame(18, 72);
|
||||
var tile694 = new TileDefinitionStructure(ModContent.TileType<LaboratoryPlating>()).UseHeaders(0, 32, 0, 4128).UseFrame(90, 54);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using CalamityMod.Tiles;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Tiles.Plates;
|
||||
using CalamityMod.Walls;
|
||||
@@ -11,7 +10,7 @@ using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
{
|
||||
public class PlanetoidLaboratorySchematic
|
||||
public class PlanetoidLaboratorySchematic
|
||||
{
|
||||
[GeneratedCode("ScreenCaptureToSchematic", "1.0.2")]
|
||||
public static ColorTileMap GetMap()
|
||||
@@ -344,7 +343,10 @@ namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
var tile326 = new TileDefinitionStructure(ModContent.TileType<DraedonHologram>()).UseHeaders(0, 66, 2, 32).UseFrame(16, 96).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 72, 72);
|
||||
var tile327 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 66, 0, 32).UseFrame(0, 540).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 72, 0);
|
||||
var tile328 = new TileDefinitionStructure(TileID.HangingLanterns).UseHeaders(0, 66, 1, 32).UseFrame(0, 558).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 72, 36);
|
||||
var tile329 = new TileDefinitionStructure(ModContent.TileType<DraedonFactoryFieldGenerator>()).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 108, 36);
|
||||
|
||||
// HAND EDITED BY OZZATRON: Removed Field Generators from the game, so this is now air.
|
||||
var tile329 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 108, 36);
|
||||
|
||||
var tile330 = new TileDefinitionStructure(ModContent.TileType<HazardChevronPanels>()).UseHeaders(0, 17, 0, 32).UseFrame(126, 72).UseWall((ushort)ModContent.WallType<LaboratoryPlateBeam>(), 36, 0);
|
||||
var tile331 = new TileDefinitionStructure(ModContent.TileType<Cinderplate>()).UseHeaders(0, 82, 1, 32).UseFrame(36, 0).UseWall((ushort)ModContent.WallType<CinderplateWall>(), 72, 36);
|
||||
var tile332 = new TileDefinitionStructure(ModContent.TileType<Cinderplate>()).UseHeaders(0, 168, 2, 32).UseFrame(54, 18).UseWall((ushort)ModContent.WallType<CinderplateWall>(), 288, 72);
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
using CalamityMod.Tiles;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Walls.DraedonStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using System.CodeDom.Compiler;
|
||||
using System.Collections.Generic;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using CalamityMod.Walls.DraedonStructures;
|
||||
|
||||
namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
{
|
||||
@@ -187,7 +186,10 @@ namespace CalamityMod.Schematics.AutoGeneratedContent
|
||||
var tile171 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 66, 1, 0).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 72, 36);
|
||||
var tile172 = new TileDefinitionStructure(ModContent.TileType<AgedSecurityChestTile>()).UseHeaders(0, 136, 2, 32).UseWall((ushort)ModContent.WallType<LaboratoryPanelWall>(), 288, 72);
|
||||
var tile173 = new TileDefinitionStructure(ModContent.TileType<AgedSecurityChestTile>()).UseHeaders(0, 66, 1, 32).UseFrame(0, 18).UseWall((ushort)ModContent.WallType<LaboratoryPlateBeam>(), 72, 36);
|
||||
var tile174 = new TileDefinitionStructure(ModContent.TileType<DraedonFactoryFieldGenerator>()).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 108, 36);
|
||||
|
||||
// HAND EDITED BY OZZATRON: Removed Field Generators from the game, so this is now air.
|
||||
var tile174 = new TileDefinitionStructure(TileID.Dirt, false).UseHeaders(0, 131, 1, 32).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 108, 36);
|
||||
|
||||
var tile175 = new TileDefinitionStructure(ModContent.TileType<HazardChevronPanels>()).UseHeaders(0, 82, 1, 32).UseFrame(126, 72).UseWall((ushort)ModContent.WallType<LaboratoryPlatingWall>(), 72, 36);
|
||||
var tile176 = new TileDefinitionStructure(ModContent.TileType<AgedLaboratoryTerminal>()).UseHeaders(0, 136, 2, 32).UseFrame(18, 0).UseWall((ushort)ModContent.WallType<LaboratoryPlateBeam>(), 288, 72);
|
||||
var tile177 = new TileDefinitionStructure(ModContent.TileType<AgedLaboratoryTerminal>()).UseHeaders(0, 1, 1, 32).UseFrame(18, 18).UseWall((ushort)WallID.SapphireGemspark, 36, 36);
|
||||
|
||||
@@ -1,76 +0,0 @@
|
||||
using CalamityMod.Projectiles.Enemy;
|
||||
using CalamityMod.Tiles.DraedonStructures;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Terraria;
|
||||
using Terraria.ID;
|
||||
using Terraria.ModLoader;
|
||||
|
||||
namespace CalamityMod.TileEntities
|
||||
{
|
||||
public class TEDraedonFieldGenerator : ModTileEntity
|
||||
{
|
||||
public int Time;
|
||||
public int ActiveTimer;
|
||||
public const int ActiveTimerMax = 45;
|
||||
public const float Radius = 660f;
|
||||
public override bool ValidTile(int i, int j)
|
||||
{
|
||||
Tile tile = Main.tile[i, j];
|
||||
return tile.active() && tile.type == ModContent.TileType<DraedonFactoryFieldGenerator>();
|
||||
}
|
||||
public override void Update()
|
||||
{
|
||||
Player player = Main.player[Player.FindClosest(Position.ToVector2() * 16, 1, 1)];
|
||||
Vector2 positionWorldCoords = Position.ToVector2() * 16f;
|
||||
if (Vector2.Distance(player.Center, positionWorldCoords) < Radius && !player.dead)
|
||||
{
|
||||
if (ActiveTimer < ActiveTimerMax)
|
||||
ActiveTimer++;
|
||||
Time++;
|
||||
|
||||
if (Time % 75 == 74)
|
||||
{
|
||||
float speed = 5f;
|
||||
Vector2 aimOffset = (player.velocity + player.oldVelocity) * 0.5f * player.Distance(positionWorldCoords) / (speed * speed);
|
||||
Vector2 velocity = Vector2.Normalize(player.Center - positionWorldCoords + aimOffset) * speed;
|
||||
Projectile.NewProjectileDirect(positionWorldCoords, velocity, ModContent.ProjectileType<DraedonLaser>(), 27, 4f);
|
||||
}
|
||||
if (Time % 150 == 149)
|
||||
{
|
||||
for (int i = 0; i < 9; i++)
|
||||
{
|
||||
float angle = i / 9f * MathHelper.TwoPi;
|
||||
Projectile.NewProjectileDirect(positionWorldCoords, Vector2.Normalize(player.Center - positionWorldCoords).RotatedBy(angle) * 7f, ModContent.ProjectileType<DraedonLaser>(), 27, 4f);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ActiveTimer > 0)
|
||||
{
|
||||
ActiveTimer--;
|
||||
ClientToServerSync();
|
||||
}
|
||||
}
|
||||
public override int Hook_AfterPlacement(int i, int j, int type, int style, int direction)
|
||||
{
|
||||
if (Main.netMode == NetmodeID.MultiplayerClient)
|
||||
{
|
||||
NetMessage.SendTileSquare(Main.myPlayer, i, j, 3);
|
||||
NetMessage.SendData(MessageID.TileEntityPlacement, -1, -1, null, i, j, Type, 0f, 0, 0, 0);
|
||||
return -1;
|
||||
}
|
||||
return Place(i, j);
|
||||
}
|
||||
public void ClientToServerSync()
|
||||
{
|
||||
if (Main.netMode != NetmodeID.SinglePlayer)
|
||||
{
|
||||
var netMessage = CalamityMod.Instance.GetPacket();
|
||||
netMessage.Write((byte)CalamityModMessageType.DraedonFieldGeneratorSync);
|
||||
netMessage.Write(ID);
|
||||
netMessage.Write(Time);
|
||||
netMessage.Write(ActiveTimer);
|
||||
netMessage.Send();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -541,17 +541,16 @@ namespace CalamityMod.Tiles
|
||||
}
|
||||
public override bool CanKillTile(int i, int j, int type, ref bool blockDamaged)
|
||||
{
|
||||
int[] indestructableTiles = new int[]
|
||||
int[] invincibleTiles = new int[]
|
||||
{
|
||||
ModContent.TileType<DraedonLabTurret>(),
|
||||
ModContent.TileType<DraedonFactoryFieldGenerator>(),
|
||||
ModContent.TileType<AstralBeacon>()
|
||||
};
|
||||
// Prevent tiles below an astral beacon from being destroyed.
|
||||
// Prevent tiles below invincible tiles from being destroyed. This is like chests in vanilla.
|
||||
if (CalamityUtils.ParanoidTileRetrieval(i, j - 1).active() &&
|
||||
CalamityUtils.ParanoidTileRetrieval(i, j).type !=
|
||||
CalamityUtils.ParanoidTileRetrieval(i, j - 1).type &&
|
||||
indestructableTiles.Contains(CalamityUtils.ParanoidTileRetrieval(i, j - 1).type))
|
||||
invincibleTiles.Contains(CalamityUtils.ParanoidTileRetrieval(i, j - 1).type))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,128 +0,0 @@
|
||||
using CalamityMod.TileEntities;
|
||||
using Microsoft.Xna.Framework;
|
||||
using Microsoft.Xna.Framework.Graphics;
|
||||
using System;
|
||||
using Terraria;
|
||||
using Terraria.DataStructures;
|
||||
using Terraria.ModLoader;
|
||||
using Terraria.ObjectData;
|
||||
|
||||
namespace CalamityMod.Tiles.DraedonStructures
|
||||
{
|
||||
public class DraedonFactoryFieldGenerator : ModTile
|
||||
{
|
||||
public override void SetDefaults()
|
||||
{
|
||||
Main.tileLighted[Type] = true;
|
||||
Main.tileFrameImportant[Type] = true;
|
||||
Main.tileNoAttach[Type] = true;
|
||||
Main.tileLavaDeath[Type] = false;
|
||||
Main.tileWaterDeath[Type] = false;
|
||||
TileObjectData.newTile.CopyFrom(TileObjectData.Style1x1);
|
||||
TileObjectData.newTile.HookPostPlaceMyPlayer = new PlacementHook(ModContent.GetInstance<TEDraedonFieldGenerator>().Hook_AfterPlacement, -1, 0, true);
|
||||
TileObjectData.newTile.LavaDeath = false;
|
||||
TileObjectData.addTile(Type);
|
||||
ModTranslation name = CreateMapEntryName();
|
||||
name.SetDefault("Field Generator");
|
||||
AddMapEntry(new Color(53, 49, 52), name);
|
||||
minPick = 65;
|
||||
}
|
||||
|
||||
public TEDraedonFieldGenerator RetrieveTileEntity(int i, int j)
|
||||
{
|
||||
int determinedID = ModContent.GetInstance<TEDraedonFieldGenerator>().Find(i, j);
|
||||
if (determinedID == -1 || !(TileEntity.ByID[determinedID] is TEDraedonFieldGenerator))
|
||||
{
|
||||
ModTileEntity modTileEntity = ModTileEntity.ConstructFromType(ModContent.GetInstance<TEDraedonFieldGenerator>().type);
|
||||
modTileEntity.Position = new Point16(i, j);
|
||||
modTileEntity.ID = TileEntity.AssignNewID();
|
||||
modTileEntity.type = ModContent.GetInstance<TEDraedonFieldGenerator>().type;
|
||||
TileEntity.ByID[modTileEntity.ID] = modTileEntity;
|
||||
TileEntity.ByPosition[modTileEntity.Position] = modTileEntity;
|
||||
determinedID = modTileEntity.ID;
|
||||
}
|
||||
return (TEDraedonFieldGenerator)TileEntity.ByID[determinedID];
|
||||
}
|
||||
|
||||
public override bool CanExplode(int i, int j) => false;
|
||||
|
||||
public override bool CreateDust(int i, int j, ref int type)
|
||||
{
|
||||
Dust.NewDust(new Vector2(i, j) * 16f, 16, 16, 226);
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void NumDust(int i, int j, bool fail, ref int num)
|
||||
{
|
||||
num = fail ? 1 : 3;
|
||||
}
|
||||
|
||||
public override void PostDraw(int i, int j, SpriteBatch spriteBatch)
|
||||
{
|
||||
TEDraedonFieldGenerator charger = RetrieveTileEntity(i, j);
|
||||
Color drawColor = Color.Lerp(new Color(73, 68, 72), Color.Cyan, Utils.InverseLerp(0f, TEDraedonFieldGenerator.ActiveTimerMax, charger.ActiveTimer, true));
|
||||
|
||||
int xPos = Main.tile[i, j].frameX;
|
||||
int yPos = Main.tile[i, j].frameY;
|
||||
Texture2D glowmask = ModContent.GetTexture("CalamityMod/Tiles/DraedonStructures/DraedonFactoryFieldGeneratorGlow");
|
||||
Vector2 screenOffset = Main.drawToScreen ? Vector2.Zero : new Vector2(Main.offScreenRange);
|
||||
Vector2 drawOffset = new Vector2(i * 16 - Main.screenPosition.X, j * 16 - Main.screenPosition.Y) + screenOffset;
|
||||
Tile trackTile = Main.tile[i, j];
|
||||
if (!trackTile.halfBrick() && trackTile.slope() == 0)
|
||||
{
|
||||
spriteBatch.Draw(glowmask, drawOffset, new Rectangle?(new Rectangle(xPos, yPos, 18, 18)), drawColor, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
else if (trackTile.halfBrick())
|
||||
{
|
||||
spriteBatch.Draw(glowmask, drawOffset + new Vector2(0f, 8f), new Rectangle?(new Rectangle(xPos, yPos, 18, 8)), drawColor, 0.0f, Vector2.Zero, 1f, SpriteEffects.None, 0.0f);
|
||||
}
|
||||
|
||||
Vector2 positionWorldCoords = new Vector2(i, j) * 16f;
|
||||
Player player = Main.player[Player.FindClosest(positionWorldCoords, 1, 1)];
|
||||
if (player.Distance(positionWorldCoords) < 1600f)
|
||||
{
|
||||
Texture2D laserTexture = ModContent.GetTexture("CalamityMod/ExtraTextures/Lasers/RedLightningTexture");
|
||||
Vector2[] pointsToDraw = new Vector2[65];
|
||||
for (int k = 0; k < pointsToDraw.Length; k++)
|
||||
{
|
||||
float angle = k / (float)pointsToDraw.Length * MathHelper.TwoPi;
|
||||
pointsToDraw[k] = angle.ToRotationVector2() * TEDraedonFieldGenerator.Radius;
|
||||
pointsToDraw[k] += drawOffset;
|
||||
pointsToDraw[k] += Main.rand.NextVector2Circular(1f, 1f);
|
||||
|
||||
angle = (k + 1) % pointsToDraw.Length / (float)pointsToDraw.Length * MathHelper.TwoPi;
|
||||
pointsToDraw[(k + 1) % pointsToDraw.Length] = angle.ToRotationVector2() * TEDraedonFieldGenerator.Radius;
|
||||
pointsToDraw[(k + 1) % pointsToDraw.Length] += drawOffset;
|
||||
pointsToDraw[(k + 1) % pointsToDraw.Length] += Main.rand.NextVector2Circular(1f, 1f);
|
||||
|
||||
if (trackTile.halfBrick())
|
||||
pointsToDraw[k] += Vector2.UnitY * 8f;
|
||||
if (trackTile.halfBrick())
|
||||
pointsToDraw[(k + 1) % pointsToDraw.Length] += Vector2.UnitY * 8f;
|
||||
|
||||
DelegateMethods.c_1 = Color.Cyan;
|
||||
DelegateMethods.f_1 = 1f;
|
||||
DelegateMethods.c_1 *= Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.X - player.Center.X), true) *
|
||||
Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.Y - player.Center.Y), true);
|
||||
DelegateMethods.f_1 *= Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.X - player.Center.X), true) *
|
||||
Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.Y - player.Center.Y), true);
|
||||
Utils.DrawLaser(spriteBatch, laserTexture, pointsToDraw[k], pointsToDraw[(k + 1) % pointsToDraw.Length], new Vector2(0.3f), new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw));
|
||||
|
||||
DelegateMethods.c_1 = Color.White * 0.7f;
|
||||
DelegateMethods.f_1 = 0.7f;
|
||||
DelegateMethods.c_1 *= Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.X - player.Center.X), true) *
|
||||
Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.Y - player.Center.Y), true);
|
||||
DelegateMethods.f_1 *= Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.X - player.Center.X), true) *
|
||||
Utils.InverseLerp(TEDraedonFieldGenerator.Radius, TEDraedonFieldGenerator.Radius - 300f, Math.Abs(positionWorldCoords.Y - player.Center.Y), true);
|
||||
Utils.DrawLaser(spriteBatch, laserTexture, pointsToDraw[k], pointsToDraw[(k + 1) % pointsToDraw.Length], new Vector2(0.6f), new Utils.LaserLineFraming(DelegateMethods.LightningLaserDraw));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void KillTile(int i, int j, ref bool fail, ref bool effectOnly, ref bool noItem)
|
||||
{
|
||||
TEDraedonFieldGenerator generator = RetrieveTileEntity(i, j);
|
||||
generator.Kill(i, j);
|
||||
}
|
||||
}
|
||||
}
|
||||
File renamed without changes.
|
Before Width: | Height: | Size: 280 B After Width: | Height: | Size: 280 B |
File renamed without changes.
|
Before Width: | Height: | Size: 149 B After Width: | Height: | Size: 149 B |
Reference in new issue
Block a user