Skip to content

Commit

Permalink
misc changes
Browse files Browse the repository at this point in the history
  • Loading branch information
UriBuilder committed Dec 30, 2022
1 parent 7cbdfbb commit c1f853a
Show file tree
Hide file tree
Showing 9 changed files with 106 additions and 20 deletions.
2 changes: 1 addition & 1 deletion Items/Weapons/Melee/PhaseDisc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public override bool Shoot(Player player, EntitySource_ItemUse_WithAmmo source,
public override void AddRecipes()
{
CreateRecipe()
.AddIngredient(ItemID.LightDisc, 5)
.AddIngredient<Vrang>()
.AddIngredient<Valari>()
.AddIngredient<AtmosphericEnergy>()
.AddTile(TileID.MythrilAnvil)
Expand Down
10 changes: 10 additions & 0 deletions NPCs/AequusNPC.cs
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,16 @@ public override void PostAI(NPC npc)

public override void DrawEffects(NPC npc, ref Color drawColor)
{
if (npc.HasBuff<SnowgraveDebuff>())
{
if (Main.GameUpdateCount % 9 == 0)
{
var d = Dust.NewDustDirect(npc.position, npc.width, npc.height, DustID.IceRod, Scale: Main.rand.NextFloat(0.6f, 1f));
d.velocity = npc.velocity * 0.5f;
d.noGravity = true;
d.fadeIn = d.scale + 0.5f;
}
}
if (npc.HasBuff<BoneRingWeakness>())
{
byte a = drawColor.A;
Expand Down
4 changes: 1 addition & 3 deletions NPCs/Friendly/Critter/OblivisionCritter.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using Aequus.Items.Consumables.Critters;
using Aequus.Particles.Dusts;
using Aequus.Particles.Dusts;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using ReLogic.Content;
Expand All @@ -20,7 +19,6 @@ public class OblivisionCritter : ModNPC
public override void SetStaticDefaults()
{
Main.npcFrameCount[Type] = 10;
Main.npcCatchable[Type] = true;
NPCID.Sets.CountsAsCritter[Type] = true;
NPCID.Sets.TrailingMode[Type] = 7;
NPCID.Sets.TrailCacheLength[Type] = 14;
Expand Down
37 changes: 32 additions & 5 deletions NPCs/GlobalNPCs/SpawnsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using Aequus.Biomes.Glimmer;
using Aequus.Common.ModPlayers;
using Aequus.NPCs.Friendly.Critter;
using Aequus.NPCs.Friendly.Town;
using Aequus.NPCs.Monsters.CrabCrevice;
using Aequus.NPCs.Monsters.Night;
using Aequus.NPCs.Monsters.Night.Glimmer;
Expand Down Expand Up @@ -40,10 +41,18 @@ public override void EditSpawnRate(Player player, ref int spawnRate, ref int max
maxSpawns = 0;
return;
}
if (player.ZoneSkyHeight && GaleStreamsBiome.TimeForMeteorSpawns())
if (player.ZoneSkyHeight)
{
spawnRate /= 2;
maxSpawns *= 2;
if (GaleStreamsBiome.TimeForMeteorSpawns())
{
spawnRate /= 2;
maxSpawns *= 2;
}
if (IsClose<SkyMerchant>(player))
{
spawnRate *= 3;
maxSpawns /= 3;
}
}
if (player.GetModPlayer<AequusPlayer>().ZoneGaleStreams)
{
Expand Down Expand Up @@ -109,8 +118,11 @@ public static void GaleStreamsEnemies(IDictionary<int, float> pool, NPCSpawnInfo
AdjustSpawns(pool, MathHelper.Lerp(1f, 0.25f, SpawnCondition.Sky.Chance));
if (Aequus.HardmodeTier && !(IsClose<RedSprite>(spawnInfo.Player) || IsClose<SpaceSquid>(spawnInfo.Player)))
{
pool.Add(ModContent.NPCType<RedSprite>(), 0.06f * SpawnCondition.Sky.Chance);
pool.Add(ModContent.NPCType<SpaceSquid>(), 0.06f * SpawnCondition.Sky.Chance);
//pool.Add(ModContent.NPCType<RedSprite>(), 0.06f * SpawnCondition.Sky.Chance);
if (!AequusWorld.downedSpaceSquid)
{
pool.Add(ModContent.NPCType<SpaceSquid>(), 0.06f * SpawnCondition.Sky.Chance);
}
}
if (!NPC.AnyNPCs(ModContent.NPCType<Vraine>()))
pool.Add(ModContent.NPCType<Vraine>(), 1f * SpawnCondition.Sky.Chance);
Expand Down Expand Up @@ -163,6 +175,21 @@ public override void EditSpawnPool(IDictionary<int, float> pool, NPCSpawnInfo sp
{
GaleStreamsEnemies(pool, spawnInfo);
}
if (spawnInfo.Player.ZoneSkyHeight)
{
if (AequusWorld.downedSpaceSquid && !IsClose<SpaceSquidFriendly>(spawnInfo.Player))
{
if (Main.tile[spawnInfo.SpawnTileX, spawnInfo.SpawnTileY + 1].IsFullySolid())
{
pool.Add(ModContent.NPCType<SpaceSquidFriendly>(), 0.1f);
AequusHelpers.dustDebug(spawnInfo.SpawnTileX, spawnInfo.SpawnTileY + 1, DustID.CursedTorch);
}
else
{
AequusHelpers.dustDebug(spawnInfo.SpawnTileX, spawnInfo.SpawnTileY + 1);
}
}
}
if (!Main.dayTime && surface)
{
if (GlimmerBiome.EventActive)
Expand Down
6 changes: 1 addition & 5 deletions NPCs/Monsters/Sky/GaleStreams/RedSprite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,8 @@ public override void SetStaticDefaults()
SpecificallyImmuneTo = new int[]
{
BuffID.OnFire,
BuffID.CursedInferno,
BuffID.Ichor,
BuffID.ShadowFlame,
BuffID.OnFire3,
BuffID.Bleeding,
BuffID.Frostburn,
BuffID.Frostburn2,
}
});

Expand Down
64 changes: 60 additions & 4 deletions NPCs/Monsters/Sky/GaleStreams/SpaceSquid.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Aequus;
using Aequus.Biomes;
using Aequus.Buffs.Debuffs;
using Aequus.Graphics;
using Aequus.Items.Armor.Vanity;
using Aequus.Items.Misc;
Expand Down Expand Up @@ -62,13 +63,12 @@ public override void SetStaticDefaults()
{
SpecificallyImmuneTo = new int[]
{
BuffID.OnFire,
BuffID.CursedInferno,
BuffID.Ichor,
BuffID.ShadowFlame,
BuffID.Bleeding,
BuffID.Frostburn,
BuffID.Frostburn2,
BuffID.Chilled,
BuffID.Frozen,
ModContent.BuffType<SnowgraveDebuff>(),
}
});

Expand Down Expand Up @@ -922,4 +922,60 @@ public Vector2 GetEyePos(Vector2 position)
return position + new Vector2(NPC.direction == 1 ? NPC.width - 4f : 4f, NPC.height / 2f - 2f);
}
}

public class SpaceSquidFriendly : ModNPC
{
public override void SetStaticDefaults()
{
NPCID.Sets.NPCBestiaryDrawOffset[Type] = new NPCID.Sets.NPCBestiaryDrawModifiers(0) { Hide = true, };
NPCID.Sets.ActsLikeTownNPC[Type] = true;
}

public override void SetDefaults()
{
NPC.width = 64;
NPC.height = 48;
NPC.friendly = true;
NPC.lifeMax = 2500;
NPC.defense = 10;
NPC.damage = 15;
NPC.dontTakeDamage = true;
NPC.dontTakeDamageFromHostiles = true;
NPC.aiStyle = -1;
NPC.knockBackResist = 0f;
NPC.behindTiles = true;
}

public override bool CanChat() => true;

public override void AI()
{
}

public override string GetChat()
{
return $"HELLO {Main.LocalPlayer.name}. EXCUSE TONE OF VOICE - AS USING [[⏁⍀⏃⋏⌇⌰⏃⏁⍜⍀]] TO TRANSLATE VOICE INTO TERRARIAN VOICE.";
}

public override void SetChatButtons(ref string button, ref string button2)
{
button = "Option 1";
button2 = "Rematch";
}

public override void OnChatButtonClicked(bool firstButton, ref bool shop)
{
if (!firstButton)
{
NPC.KillEffects();
NPC.active = false;
NPC.NewNPCDirect(NPC.GetSource_NaturalSpawn(), NPC.Center, ModContent.NPCType<SpaceSquid>());
}
}

public override bool PreDraw(SpriteBatch spriteBatch, Vector2 screenPos, Color drawColor)
{
return true;
}
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion Projectiles/Monster/RedSpriteProjs/RedSpriteThunderClap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public override void AI()
}
Projectile.ai[0] = Math.Max(minimumLength, Projectile.ai[0]);
float maxLength = Projectile.ai[0] + 96f;
if ((Main.player[Main.myPlayer].Center - center).Length() < 1000f)
if ((Main.player[Main.myPlayer].Center - new Vector2(center.X, center.Y + Projectile.ai[0])).Length() < 1000f)
{
if ((int)Projectile.localAI[0] == 0)
{
Expand Down
1 change: 0 additions & 1 deletion Tiles/AequusTile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public override void Load()
CheckCircles = new List<IndestructibleCircle>();
Circles = new List<IndestructibleCircle>();
PylonColors = new Dictionary<Point, Func<Color>>();

LoadHooks();
}

Expand Down

0 comments on commit c1f853a

Please sign in to comment.