Skip to content
This repository has been archived by the owner on Jan 24, 2019. It is now read-only.

Commit

Permalink
Motherboard refactor and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Jofairden committed Aug 23, 2017
1 parent 7688b02 commit 7ee09f8
Show file tree
Hide file tree
Showing 42 changed files with 907 additions and 571 deletions.
16 changes: 0 additions & 16 deletions Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,21 +56,6 @@ public static bool NoBiomeNormalSpawn(NPCSpawnInfo spawnInfo)
}
#endregion

public static void Downed(this TremorWorld.Boss boss, bool state)
=> TremorWorld.downedBoss[boss] = state;

public static bool Downed(this TremorWorld.Boss boss)
=> TremorWorld.downedBoss[boss];

public static Item SpawnItem(this ModNPC npc, short type, int stack = 1)
=> SpawnItem(npc.npc, type, stack);

public static Item SpawnItem(this NPC npc, short type, int stack = 1)
=> Main.item[Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, type, stack)];

public static Item SpawnItem(Vector2 position, Vector2 size, short type, int stack = 1)
=> Main.item[Item.NewItem((int)position.X, (int)position.Y, (int)size.X, (int)size.Y, type, stack)];

public static Vector2 RandomPosition(Vector2 pos1, Vector2 pos2)
{
Random rnd = new Random();
Expand Down Expand Up @@ -369,7 +354,6 @@ public static void DropItems(Vector2 position, Vector2 randomBox, params Drop[]
}
}
}

}

public struct Drop
Expand Down
2 changes: 1 addition & 1 deletion Items/InfernoSkull.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public override void ModifyTooltips(List<TooltipLine> tooltips)

public override bool CanUseItem(Player player)
{
return player.position.Y / 16f > Main.maxTilesY - 200 && TremorWorld.Boss.Trinity.Downed() && !NPC.AnyNPCs(mod.NPCType("Andas"));
return player.position.Y / 16f > Main.maxTilesY - 200 && TremorWorld.Boss.Trinity.IsDowned() && !NPC.AnyNPCs(mod.NPCType("Andas"));
}

public override void AddRecipes()
Expand Down
18 changes: 0 additions & 18 deletions Motherboard_CreeperSpawning.cs

This file was deleted.

2 changes: 1 addition & 1 deletion NPCs/Alchemaster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BadApple"));
}
TremorWorld.Boss.Alchemaster.Downed(true);
TremorWorld.Boss.Alchemaster.Downed();

}
}
Expand Down
2 changes: 1 addition & 1 deletion NPCs/Alchemist.cs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public override void SetupShop(Chest shop, ref int nextSlot)
shop.item[nextSlot].SetDefaults(mod.ItemType("Nitro"));
nextSlot++;
}
if (TremorWorld.Boss.Alchemaster.Downed())
if (TremorWorld.Boss.Alchemaster.IsDowned())
{
shop.item[nextSlot].SetDefaults(mod.ItemType("Pyro"));
nextSlot++;
Expand Down
2 changes: 1 addition & 1 deletion NPCs/ArabianMerchant.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public override void SetDefaults()

public override bool CanTownNPCSpawn(int numTownNPCs, int money)
{
if (TremorWorld.Boss.Rukh.Downed())
if (TremorWorld.Boss.Rukh.IsDowned())
{
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion NPCs/Barmadillo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo)
int x = spawnInfo.spawnTileX;
int y = spawnInfo.spawnTileY;
int tile = Main.tile[x, y].type;
return Main.hardMode && TremorWorld.Boss.Trinity.Downed() && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.002f : 0f;
return Main.hardMode && TremorWorld.Boss.Trinity.IsDowned() && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.002f : 0f;
}
}
}
2 changes: 1 addition & 1 deletion NPCs/Brutallisk.cs
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("BrutalliskMask"));
}
TremorWorld.Boss.Brutallisk.Downed(true);
TremorWorld.Boss.Brutallisk.Downed();
}
}

Expand Down
2 changes: 1 addition & 1 deletion NPCs/CogLord.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ public void CogMessage(string Message)
}
public override void NPCLoot()
{
TremorWorld.Boss.CogLord.Downed(true);
TremorWorld.Boss.CogLord.Downed();
if (Main.netMode != 1)
{
if (Main.expertMode)
Expand Down
2 changes: 1 addition & 1 deletion NPCs/CyberKing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CyberKingMask"));
}
TremorWorld.Boss.CyberKing.Downed(true);
TremorWorld.Boss.CyberKing.Downed();
}
}
}
2 changes: 1 addition & 1 deletion NPCs/DevourerofPlanets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo)
int x = spawnInfo.spawnTileX;
int y = spawnInfo.spawnTileY;
int tile = Main.tile[x, y].type;
return Main.hardMode && TremorWorld.Boss.Trinity.Downed() && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f;
return Main.hardMode && TremorWorld.Boss.Trinity.IsDowned() && !spawnInfo.player.ZoneDungeon && y > Main.rockLayer ? 0.005f : 0f;
}

public override void HitEffect(int hitDirection, double damage)
Expand Down
2 changes: 1 addition & 1 deletion NPCs/Dragon_HeadB.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public override void NPCLoot()
Item.NewItem(npc.position, npc.Size, mod.ItemType<AncientDragonTrophy>());
}

TremorWorld.Boss.AncientDragon.Downed(true);
TremorWorld.Boss.AncientDragon.Downed();
}


Expand Down
2 changes: 1 addition & 1 deletion NPCs/EvilCorn.cs
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("CornJavelin"), Main.rand.Next(15, 45));
}
TremorWorld.Boss.EvilCorn.Downed(true);
TremorWorld.Boss.EvilCorn.Downed();

}
}
Expand Down
2 changes: 1 addition & 1 deletion NPCs/FrostKing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ public override void NPCLoot()
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FrostoneOre"), Main.rand.Next(24, 42));
}
TremorWorld.Boss.FrostKing.Downed(true);
TremorWorld.Boss.FrostKing.Downed();
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion NPCs/FungusBeetle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public override void NPCLoot()
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, mod.ItemType("FungusElement"), Main.rand.Next(10, 23));
}
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width, npc.height, 28, Main.rand.Next(9, 22));
TremorWorld.Boss.FungusBeetle.Downed(true);
TremorWorld.Boss.FungusBeetle.Downed();
}
}

Expand Down
2 changes: 1 addition & 1 deletion NPCs/GhostWarrior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public override float SpawnChance(NPCSpawnInfo spawnInfo)
int x = spawnInfo.spawnTileX;
int y = spawnInfo.spawnTileY;
int tile = Main.tile[x, y].type;
return (Helper.NormalSpawn(spawnInfo) && Helper.NoZoneAllowWater(spawnInfo)) && TremorWorld.Boss.Trinity.Downed() && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f;
return (Helper.NormalSpawn(spawnInfo) && Helper.NoZoneAllowWater(spawnInfo)) && TremorWorld.Boss.Trinity.IsDowned() && NPC.downedMoonlord && Main.hardMode && !Main.dayTime && y < Main.worldSurface ? 0.005f : 0f;
}
}
}
2 changes: 1 addition & 1 deletion NPCs/HeaterOfWorldsHead.cs
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ private void DropLoot()
if (Main.rand.NextBool(10))
npc.SpawnItem((short)mod.ItemType<HeaterOfWorldsTrophy>());

TremorWorld.Boss.HeaterofWorlds.Downed(true);
TremorWorld.Boss.HeaterofWorlds.Downed();
}
}
}
Loading

0 comments on commit 7ee09f8

Please sign in to comment.