Player instancing begone
This commit is contained in:
1 parent
afe790de40
commit
b4f7e539de
3 files changed
+18
-15
No files matched your search
@@ -148,8 +148,6 @@ namespace CalamityMod.CalPlayer
|
||||
public bool externalHeatImmunity = false;
|
||||
// NOTE -- With the Armageddon item removed from Calamity, this bool can only be set by other mods
|
||||
public bool disableAllDodges = false;
|
||||
public List<int> disabledSummonerNerfItems = new();
|
||||
public List<int> disabledSummonerNerfMinions = new();
|
||||
#endregion
|
||||
|
||||
#region Town NPC Shop Variables
|
||||
@@ -4744,7 +4742,7 @@ namespace CalamityMod.CalPlayer
|
||||
bool toolCheck = heldItem.pick == 0 && heldItem.axe == 0 && heldItem.hammer == 0;
|
||||
bool itemCanBeUsed = heldItem.useStyle != ItemUseStyleID.None;
|
||||
bool notAccessoryOrAmmo = !heldItem.accessory && heldItem.ammo == AmmoID.None;
|
||||
bool nerfNotDisabledByCalls = !disabledSummonerNerfItems.Contains(heldItem.type) && !disabledSummonerNerfMinions.Contains(proj.type);
|
||||
bool nerfNotDisabledByCalls = !CalamityLists.DisabledSummonerNerfItems.Contains(heldItem.type) && !CalamityLists.DisabledSummonerNerfMinions.Contains(proj.type);
|
||||
if (classCheck && itemCanBeUsed && toolCheck && notAccessoryOrAmmo && nerfNotDisabledByCalls)
|
||||
damage = (int)(damage * summonNerfMult);
|
||||
}
|
||||
|
||||
@@ -171,6 +171,9 @@ namespace CalamityMod
|
||||
|
||||
public static Dictionary<int, int> EncryptedSchematicIDRelationship;
|
||||
|
||||
public static List<int> DisabledSummonerNerfItems;
|
||||
public static List<int> DisabledSummonerNerfMinions;
|
||||
|
||||
public static void LoadLists()
|
||||
{
|
||||
donatorList = new List<string>()
|
||||
@@ -2755,6 +2758,9 @@ namespace CalamityMod
|
||||
[3] = ItemType<EncryptedSchematicHell>(),
|
||||
[4] = ItemType<EncryptedSchematicIce>(),
|
||||
};
|
||||
|
||||
DisabledSummonerNerfItems = new();
|
||||
DisabledSummonerNerfMinions = new();
|
||||
}
|
||||
|
||||
public static void UnloadLists()
|
||||
@@ -2854,6 +2860,9 @@ namespace CalamityMod
|
||||
DontCopyOriginalMinionAIList = null;
|
||||
|
||||
EncryptedSchematicIDRelationship = null;
|
||||
|
||||
DisabledSummonerNerfItems = null;
|
||||
DisabledSummonerNerfMinions = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-12
@@ -1409,39 +1409,35 @@ namespace CalamityMod
|
||||
#region Summoner Cross Class Nerf Disabling
|
||||
public static bool SetSummonerNerfDisabledByMinion(int type, bool disableNerf)
|
||||
{
|
||||
var calPlayer = Main.LocalPlayer.Calamity();
|
||||
|
||||
if (disableNerf && !calPlayer.disabledSummonerNerfMinions.Contains(type))
|
||||
if (disableNerf && !CalamityLists.DisabledSummonerNerfMinions.Contains(type))
|
||||
{
|
||||
calPlayer.disabledSummonerNerfMinions.Add(type);
|
||||
CalamityLists.DisabledSummonerNerfMinions.Add(type);
|
||||
return true;
|
||||
}
|
||||
else if (!disableNerf)
|
||||
{
|
||||
return calPlayer.disabledSummonerNerfMinions.Remove(type);
|
||||
return CalamityLists.DisabledSummonerNerfMinions.Remove(type);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
public static bool SetSummonerNerfDisabledByItem(int type, bool disableNerf)
|
||||
{
|
||||
var calPlayer = Main.LocalPlayer.Calamity();
|
||||
|
||||
if (disableNerf && !calPlayer.disabledSummonerNerfItems.Contains(type))
|
||||
if (disableNerf && !CalamityLists.DisabledSummonerNerfItems.Contains(type))
|
||||
{
|
||||
calPlayer.disabledSummonerNerfItems.Add(type);
|
||||
CalamityLists.DisabledSummonerNerfItems.Add(type);
|
||||
return true;
|
||||
}
|
||||
else if (!disableNerf)
|
||||
{
|
||||
return calPlayer.disabledSummonerNerfItems.Remove(type);
|
||||
return CalamityLists.DisabledSummonerNerfItems.Remove(type);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool GetSummonerNerfDisabledByMinion(int type) => Main.LocalPlayer.Calamity().disabledSummonerNerfMinions.Contains(type);
|
||||
public static bool GetSummonerNerfDisabledByItem(int type) => Main.LocalPlayer.Calamity().disabledSummonerNerfItems.Contains(type);
|
||||
public static bool GetSummonerNerfDisabledByMinion(int type) => CalamityLists.DisabledSummonerNerfMinions.Contains(type);
|
||||
public static bool GetSummonerNerfDisabledByItem(int type) => CalamityLists.DisabledSummonerNerfItems.Contains(type);
|
||||
#endregion
|
||||
|
||||
#region Call
|
||||
|
||||
Reference in new issue
Block a user