Moved wikithis support to WeakReferenceSupport and added some more wikithis edge cases

This commit is contained in:
ben-tk committed 2022-08-21 01:58:50 -04:00
1 parent d93701aaf0
commit 0e841eaa8b
7 files changed
+97 -24

No files matched your search

+1 -20
View File
@@ -83,8 +83,6 @@ namespace CalamityMod
{
public class CalamityMod : Mod
{
public const string CalamityWikiURL = "calamitymod.wiki.gg";
// TODO -- A huge amount of random floating variables exist here.
// These should all be moved to other files, whether that's CalamityLists or brand new ModSystems.
// It is best to have a ton of small ModSystems.
@@ -222,24 +220,7 @@ namespace CalamityMod
ForegroundDrawing.ForegroundManager.Load();
// Wikithis support
if (wikithis is not null)
{
wikithis.Call("AddModURL", this, CalamityWikiURL);
// Clear up name conflicts
// Items
wikithis.Call(1, new List<int>() { ModContent.ItemType<BloodOrange>() }, "Blood Orange (calamity)");
wikithis.Call(1, new List<int>() { ModContent.ItemType<Elderberry>() }, "Elderberry (calamity)");
wikithis.Call(1, new List<int>() { ModContent.ItemType<PineapplePet>() }, "Pineapple (calamity)");
wikithis.Call(1, new List<int>() { ModContent.ItemType<TrashmanTrashcan>() }, "Trash Can (pet)");
wikithis.Call(1, new List<int>() { ModContent.ItemType<Butcher>() }, "Butcher (weapon)");
wikithis.Call(1, new List<int>() { ModContent.ItemType<SandstormGun>() }, "Sandstorm (weapon)");
wikithis.Call(1, new List<int>() { ModContent.ItemType<Thunderstorm>() }, "Thunderstorm (weapon)");
// Enemies
wikithis.Call(2, new List<int>() { ModContent.NPCType<Catfish>() }, "Catfish (enemy)");
wikithis.Call(2, new List<int>() { ModContent.NPCType<Hive>() }, "Hive (enemy)");
wikithis.Call(2, new List<int>() { ModContent.NPCType<OldDukeToothBall>() }, "Tooth Ball (Old Duke)");
}
WeakReferenceSupport.WikiThisSupport();
}
CooldownRegistry.Load();
+92
View File
@@ -29,6 +29,7 @@ using CalamityMod.Items.Weapons.Typeless;
using CalamityMod.NPCs.AcidRain;
using CalamityMod.NPCs.AdultEidolonWyrm;
using CalamityMod.NPCs.AquaticScourge;
using CalamityMod.NPCs.Astral;
using CalamityMod.NPCs.AstrumAureus;
using CalamityMod.NPCs.AstrumDeus;
using CalamityMod.NPCs.BrimstoneElemental;
@@ -46,7 +47,9 @@ using CalamityMod.NPCs.ExoMechs.Thanatos;
using CalamityMod.NPCs.GreatSandShark;
using CalamityMod.NPCs.HiveMind;
using CalamityMod.NPCs.Leviathan;
using CalamityMod.NPCs.NormalNPCs;
using CalamityMod.NPCs.OldDuke;
using CalamityMod.NPCs.Other;
using CalamityMod.NPCs.Perforator;
using CalamityMod.NPCs.PlaguebringerGoliath;
using CalamityMod.NPCs.Polterghast;
@@ -56,6 +59,7 @@ using CalamityMod.NPCs.Ravager;
using CalamityMod.NPCs.Signus;
using CalamityMod.NPCs.SlimeGod;
using CalamityMod.NPCs.StormWeaver;
using CalamityMod.NPCs.SulphurousSea;
using CalamityMod.NPCs.SunkenSea;
using CalamityMod.NPCs.SupremeCalamitas;
using CalamityMod.NPCs.TownNPCs;
@@ -115,6 +119,8 @@ namespace CalamityMod
internal class WeakReferenceSupport
{
public const string CalamityWikiURL = "calamitymod.wiki.gg";
private static readonly Dictionary<string, float> BossDifficulty = new Dictionary<string, float>
{
{ "DesertScourge", 1.6f },
@@ -166,6 +172,92 @@ namespace CalamityMod
SummonersAssociationSupport();
}
public static void WikiThisSupport()
{
CalamityMod calamity = GetInstance<CalamityMod>();
Mod wiki = calamity.wikithis;
if (wiki is null)
return;
wiki.Call("AddModURL", calamity, CalamityWikiURL);
// Clear up name conflicts
void ItemRedirect(int item, string pageName)
{
wiki.Call(1, new List<int>() { item }, pageName);
}
void EnemyRedirect(int item, string pageName)
{
wiki.Call(2, new List<int>() { item }, pageName);
}
// Items
ItemRedirect(ModContent.ItemType<BloodOrange>(), "Blood Orange (calamity)");
ItemRedirect(ModContent.ItemType<Elderberry>(), "Elderberry (calamity)");
ItemRedirect(ModContent.ItemType<PineapplePet>(), "Pineapple (calamity)");
ItemRedirect(ModContent.ItemType<TrashmanTrashcan>(), "Trash Can (pet)");
ItemRedirect(ModContent.ItemType<Butcher>(), "Butcher (weapon)");
ItemRedirect(ModContent.ItemType<SandstormGun>(), "Sandstorm (weapon)");
ItemRedirect(ModContent.ItemType<Thunderstorm>(), "Thunderstorm (weapon)");
// Lore items
ItemRedirect(ModContent.ItemType<KnowledgeAquaticScourge>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeAstralInfection>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeAstrumAureus>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeAstrumDeus>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeBloodMoon>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeBrainofCthulhu>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeBrimstoneCrag>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeBrimstoneElemental>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeCalamitas>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeCalamitasClone>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeCorruption>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeCrabulon>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeCrimson>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeCryogen>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeDesertScourge>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeDestroyer>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeDevourerofGods>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeDragonfolly>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeDukeFishron>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeEaterofWorlds>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeExoMechs>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeEyeofCthulhu>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeGolem>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeHiveMind>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeKingSlime>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeLeviathanAnahita>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeLunaticCultist>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeMechs>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeMoonLord>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeOcean>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeOldDuke>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgePerforators>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgePlaguebringerGoliath>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgePlantera>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgePolterghast>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeProfanedGuardians>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeProvidence>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeQueenBee>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeRavager>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeSentinels>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeSkeletron>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeSkeletronPrime>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeSlimeGod>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeSulphurSea>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeTwins>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeUnderworld>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeWallofFlesh>(), "Lore#Lore_Items");
ItemRedirect(ModContent.ItemType<KnowledgeYharon>(), "Lore#Lore_Items");
// Enemies
EnemyRedirect(ModContent.NPCType<Catfish>(), "Catfish (enemy)");
EnemyRedirect(ModContent.NPCType<HiveEnemy>(), "Hive (enemy)");
EnemyRedirect(ModContent.NPCType<KingSlimeJewel>(), "Crown Jewel (enemy)");
EnemyRedirect(ModContent.NPCType<OldDukeToothBall>(), "Tooth Ball (Old Duke)");
EnemyRedirect(ModContent.NPCType<CalamitasEnchantDemon>(), "Enchantment");
EnemyRedirect(ModContent.NPCType<LeviathanStart>(), "%3F%3F%3F");
}
// Wrapper function to add bosses to Boss Checklist.
private static void AddBoss(Mod bossChecklist, Mod hostMod, string name, float difficulty, int npcType, Func<bool> downed, object summon,
List<int> collection, string instructions, string despawn, Func<bool> available, Action<SpriteBatch, Rectangle, Color> portrait = null, string bossHeadTex = null)
@@ -17,7 +17,7 @@ using CalamityMod.Sounds;
namespace CalamityMod.NPCs.Astral
{
public class Hive : ModNPC
public class HiveEnemy : ModNPC
{
private static Texture2D glowmask;
File renamed without changes.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

+1 -1
View File
@@ -6,7 +6,7 @@ namespace CalamityMod.Projectiles.Summon
{
public class Hive : ModProjectile
{
public override string Texture => "CalamityMod/NPCs/Astral/Hive";
public override string Texture => "CalamityMod/NPCs/Astral/HiveEnemy";
public override void SetStaticDefaults()
{
+1 -1
View File
@@ -847,7 +847,7 @@ namespace CalamityMod
npc = ModContent.NPCType<AstralachneaGround>();
break;
case 40:
npc = ModContent.NPCType<Hive>();
npc = ModContent.NPCType<HiveEnemy>();
break;
case 41:
npc = ModContent.NPCType<StellarCulex>();
+1 -1
View File
@@ -289,7 +289,7 @@ namespace CalamityMod
{ ModContent.NPCType<BigSightseer>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },
{ ModContent.NPCType<FusionFeeder>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },
{ ModContent.NPCType<Hadarian>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },
{ ModContent.NPCType<Hive>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },
{ ModContent.NPCType<HiveEnemy>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },
{ ModContent.NPCType<Hiveling>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },
{ ModContent.NPCType<Mantis>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },
{ ModContent.NPCType<Nova>(), new Tuple<bool, int[]>(false, CalamityMod.astralEnemyImmunities) },