using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using InControl;
using Jotunn.Utils;
using ModdingUtils.Extensions;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using OwlCards.Cards;
using OwlCards.Extensions;
using OwlCards.Logic;
using OwlCards.UI;
using Photon.Pun;
using RarityBundle;
using RarityLib.Utils;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("OwlCards")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+5da5be21f41c47bed2deba071dbfc643d7e6d1ab")]
[assembly: AssemblyProduct("OwlCards")]
[assembly: AssemblyTitle("OwlCards")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace OwlCards
{
internal static class OptionMenu
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static UnityAction <>9__0_0;
public static UnityAction<float> <>9__1_0;
public static UnityAction<float> <>9__1_1;
public static UnityAction<float> <>9__1_2;
public static UnityAction<float> <>9__1_3;
public static UnityAction<float> <>9__1_4;
internal void <CreateMenu>b__0_0()
{
}
internal void <CreateMenuUI>b__1_0(float newValue)
{
OwlCards.instance.soulGainedPerRound.Value = newValue;
}
internal void <CreateMenuUI>b__1_1(float newValue)
{
OwlCards.instance.soulGainedPerPointWon.Value = newValue;
}
internal void <CreateMenuUI>b__1_2(float newValue)
{
OwlCards.instance.soulOnGameStart.Value = newValue;
}
internal void <CreateMenuUI>b__1_3(float newValue)
{
OwlCards.instance.rerollSoulCost.Value = newValue;
}
internal void <CreateMenuUI>b__1_4(float newValue)
{
OwlCards.instance.extraPickSoulCost.Value = newValue;
}
}
public static void CreateMenu()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Expected O, but got Unknown
object obj = <>c.<>9__0_0;
if (obj == null)
{
UnityAction val = delegate
{
};
<>c.<>9__0_0 = val;
obj = (object)val;
}
Unbound.RegisterMenu("OwlCards", (UnityAction)obj, (Action<GameObject>)CreateMenuUI, (GameObject)null, false);
}
private static void CreateMenuUI(GameObject menu)
{
TextMeshProUGUI val = default(TextMeshProUGUI);
MenuHandler.CreateText("OwlCards Options", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("Hello and welcome to my first version of my first round mod", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
Slider val2 = default(Slider);
MenuHandler.CreateSlider("Soul points passively earned per round (not applied to round winner)", menu, 30, 0f, 2f, OwlCards.instance.soulGainedPerRound.Value, (UnityAction<float>)delegate(float newValue)
{
OwlCards.instance.soulGainedPerRound.Value = newValue;
}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateSlider("Extra soul gained per point won (not applied to round winner)", menu, 30, 0f, 1f, OwlCards.instance.soulGainedPerPointWon.Value, (UnityAction<float>)delegate(float newValue)
{
OwlCards.instance.soulGainedPerPointWon.Value = newValue;
}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateSlider("Starting Soul", menu, 30, 0f, 5f, OwlCards.instance.soulOnGameStart.Value, (UnityAction<float>)delegate(float newValue)
{
OwlCards.instance.soulOnGameStart.Value = newValue;
}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateSlider("Cost of reroll (block button)", menu, 30, 0.5f, 3f, OwlCards.instance.rerollSoulCost.Value, (UnityAction<float>)delegate(float newValue)
{
OwlCards.instance.rerollSoulCost.Value = newValue;
}, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateText("", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateSlider("Cost of extra pick (fire button)", menu, 30, 1f, 10f, OwlCards.instance.extraPickSoulCost.Value, (UnityAction<float>)delegate(float newValue)
{
OwlCards.instance.extraPickSoulCost.Value = newValue;
}, ref val2, true, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.HibouGlorieux.Rounds.OwlCards", "OwlCards", "0.1.0")]
[BepInProcess("Rounds.exe")]
public class OwlCards : BaseUnityPlugin
{
private const string ModId = "com.HibouGlorieux.Rounds.OwlCards";
public const string ModName = "OwlCards";
public const string Version = "0.1.0";
public const string ModInitials = "OWL";
private const string LogPrefix = "OwlCards: ";
public readonly AssetBundle Bundle = AssetUtils.LoadAssetBundleFromResources("owlcards", typeof(OwlCards).Assembly);
public ConfigEntry<float> soulOnGameStart;
public ConfigEntry<float> soulGainedPerRound;
public ConfigEntry<float> soulGainedPerPointWon;
public ConfigEntry<float> rerollSoulCost;
public ConfigEntry<float> extraPickSoulCost;
private List<int[]> pointWinnersID = new List<int[]>();
public static OwlCards instance { get; private set; }
private void Awake()
{
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cc: Expected O, but got Unknown
instance = this;
soulGainedPerRound = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "soulGainedPerRound", 0.5f, "How much soul resource is earned passively each round");
soulGainedPerPointWon = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "soulGainedPerPointWon", 0.25f, "How much soul resource is earned passively each round");
soulOnGameStart = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "soulOnGameStart", 1f, "How much soul you have when a game starts");
rerollSoulCost = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "rerollSoulCost", 1f, "how much soul does it cost to reroll");
extraPickSoulCost = ((BaseUnityPlugin)this).Config.Bind<float>("OwlCards", "extraPickSoulCost", 4f, "how much soul does it cost to do an extra pick");
Harmony val = new Harmony("com.HibouGlorieux.Rounds.OwlCards");
val.PatchAll();
}
private void Start()
{
BuildCards();
Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)OwlCardValidation);
OptionMenu.CreateMenu();
((Component)this).gameObject.AddComponent<Reroll>();
((Component)this).gameObject.AddComponent<Manager>();
GameModeManager.AddHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)UpdatePlayerResourcesRoundEnd);
GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)TrackPointWinners);
Unbound.RegisterHandshake("com.HibouGlorieux.Rounds.OwlCards", (Action)OnHandShakeCompleted);
GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)OnGameStart, 600);
}
private IEnumerator OnGameStart(IGameModeHandler handler)
{
OwlCardCategory.InitializeRarityCategories();
Card[] cards = CardManager.cards.Values.ToArray();
Card[] array = cards;
foreach (Card card in array)
{
if (!card.cardInfo.categories.Contains(OwlCardCategory.rarityCategories[card.cardInfo.rarity]))
{
card.cardInfo.categories = card.cardInfo.categories.Append(OwlCardCategory.rarityCategories[card.cardInfo.rarity]).ToArray();
}
}
yield break;
}
private void OnHandShakeCompleted()
{
if (PhotonNetwork.IsMasterClient)
{
NetworkingManager.RPC_Others(typeof(OwlCards), "SyncSettings", new object[1] { new float[5] { soulGainedPerRound.Value, soulGainedPerPointWon.Value, soulOnGameStart.Value, rerollSoulCost.Value, extraPickSoulCost.Value } });
}
}
[UnboundRPC]
private static void SyncSettings(float[] settings)
{
instance.soulGainedPerRound.Value = settings[0];
instance.soulGainedPerPointWon.Value = settings[1];
instance.soulOnGameStart.Value = settings[2];
instance.rerollSoulCost.Value = settings[3];
instance.extraPickSoulCost.Value = settings[4];
}
private IEnumerator TrackPointWinners(IGameModeHandler gm)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
gm.GetPointWinners();
pointWinnersID.Add((int[])gm.GetPointWinners().Clone());
}
yield break;
}
private bool OwlCardValidation(Player player, CardInfo cardInfo)
{
if (cardInfo.categories.Contains(OwlCardCategory.modCategory) && AOwlCard.conditions.ContainsKey(cardInfo.cardName))
{
return AOwlCard.conditions[cardInfo.cardName](player.data.stats.GetAdditionalData().Soul);
}
return true;
}
private void BuildCards()
{
CustomCard.BuildCard<SoulLeech>();
CustomCard.BuildCard<FeedMe>();
CustomCard.BuildCard<LastHitter>();
CustomCard.BuildCard<Resolution>();
CustomCard.BuildCard<SoulExhaustion>();
CustomCard.BuildCard<FunKiller>();
CustomCard.BuildCard<CorruptedPower>();
CustomCard.BuildCard<Dedication>();
CustomCard.BuildCard<Bargain>();
CustomCard.BuildCard<OpenBar>();
CustomCard.BuildCard<Pious>();
}
private IEnumerator UpdatePlayerResourcesRoundEnd(IGameModeHandler gm)
{
if (!PhotonNetwork.OfflineMode && !PhotonNetwork.IsMasterClient)
{
yield break;
}
int[] winningPlayersID = gm.GetRoundWinners();
Dictionary<int, float> newSoulValues = new Dictionary<int, float>();
Player[] array = PlayerManager.instance.players.ToArray();
foreach (Player player in array)
{
if (!winningPlayersID.Contains(player.playerID))
{
newSoulValues.Add(player.playerID, player.data.stats.GetAdditionalData().Soul + soulGainedPerRound.Value);
}
}
pointWinnersID.RemoveAt(pointWinnersID.Count - 1);
float soulEarnedWithPoints = 0f;
foreach (int[] pointWinners in pointWinnersID)
{
int[] array2 = pointWinners;
foreach (int pointWinner in array2)
{
if (!winningPlayersID.Contains(pointWinner))
{
Player player2 = Utils.GetPlayerWithID(pointWinner);
if (newSoulValues.ContainsKey(player2.playerID))
{
newSoulValues[player2.playerID] += soulGainedPerPointWon.Value;
}
else
{
newSoulValues.Add(player2.playerID, player2.data.stats.GetAdditionalData().Soul + soulGainedPerPointWon.Value);
}
soulEarnedWithPoints += soulGainedPerPointWon.Value;
}
}
}
KeyValuePair<int, float>[] pairs = newSoulValues.ToArray();
int[] playerIDs = pairs.Select((KeyValuePair<int, float> p) => p.Key).ToArray();
float[] souls = pairs.Select((KeyValuePair<int, float> p) => p.Value).ToArray();
OwlCardsData.UpdateSoul(playerIDs, souls);
pointWinnersID.Clear();
Log("End of round total points earned with Points won: " + soulEarnedWithPoints);
}
private void OnDestroy()
{
GameModeManager.RemoveHook("RoundEnd", (Func<IGameModeHandler, IEnumerator>)UpdatePlayerResourcesRoundEnd);
GameModeManager.RemoveHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)TrackPointWinners);
}
public static void Log(string msg)
{
}
}
internal class OwlCardsException : Exception
{
public OwlCardsException(string msg)
: base(msg)
{
}
}
internal class Reroll : MonoBehaviour
{
public static Reroll instance;
public Dictionary<int, List<(int drawsUntilTriggered, CardCategory[] blacklist)>> specialDraws = new Dictionary<int, List<(int, CardCategory[])>>();
public void AddSpecialDraw(int playerID, int drawsUntilTriggered, CardCategory[] blacklist)
{
if (specialDraws.ContainsKey(playerID))
{
specialDraws[playerID].Add((drawsUntilTriggered, blacklist));
return;
}
List<(int, CardCategory[])> value = new List<(int, CardCategory[])>();
specialDraws.Add(playerID, value);
specialDraws[playerID].Add((drawsUntilTriggered, blacklist));
}
private void Start()
{
instance = this;
GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)CheckRerolls, 800);
}
private void OnDestroy()
{
GameModeManager.RemoveHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)CheckRerolls);
}
private void Update()
{
int pickrID = CardChoice.instance.pickrID;
if (pickrID == -1)
{
return;
}
FieldInfo fieldInfo = AccessTools.Field(typeof(CardChoice), "isPlaying");
bool flag = (bool)fieldInfo.GetValue(CardChoice.instance);
float soul = Utils.GetPlayerWithID(pickrID).data.stats.GetAdditionalData().Soul;
if (flag || !(soul >= OwlCards.instance.rerollSoulCost.Value))
{
return;
}
PlayerActions[] array = null;
array = PlayerManager.instance.GetActionsFromPlayer(CardChoice.instance.pickrID);
if (array == null)
{
return;
}
for (int i = 0; i < array.Length; i++)
{
if (array[i] != null)
{
PlayerAction block = array[i].Block;
if (((OneAxisInputControl)block).WasPressed)
{
RerollCards(pickrID, OwlCards.instance.rerollSoulCost.Value);
break;
}
if (((OneAxisInputControl)array[i].Fire).WasPressed && soul >= OwlCards.instance.extraPickSoulCost.Value)
{
FieldInfo fieldInfo2 = AccessTools.Field(typeof(CardChoice), "currentlySelectedCard");
int index = (int)fieldInfo2.GetValue(CardChoice.instance);
FieldRef<CardChoice, List<GameObject>> val = AccessTools.FieldRefAccess<CardChoice, List<GameObject>>("spawnedCards");
List<GameObject> list = val.Invoke(CardChoice.instance);
RerollCards(pickrID, OwlCards.instance.extraPickSoulCost.Value, list[index]);
break;
}
}
}
}
[UnboundRPC]
private static void UpdateRerollValue_RPC(int[] playerIDs, int[] newValues)
{
for (int i = 0; i < playerIDs.Length; i++)
{
int playerID = playerIDs[i];
int num = newValues[i];
OwlCardsData additionalData = Utils.GetPlayerWithID(playerID).data.stats.GetAdditionalData();
FieldInfo fieldInfo = AccessTools.Field(typeof(OwlCardsData), "_rerolls");
fieldInfo.SetValue(additionalData, num);
}
}
private IEnumerator ReplaceCards()
{
FieldInfo isPlayingField = AccessTools.Field(typeof(CardChoice), "isPlaying");
isPlayingField.SetValue(CardChoice.instance, true);
FieldRef<object, List<GameObject>> spawnedCardsRef = AccessTools.FieldRefAccess<List<GameObject>>(typeof(CardChoice), "spawnedCards");
List<GameObject> spawnedCards = spawnedCardsRef.Invoke((object)CardChoice.instance);
for (int i = 0; i < spawnedCards.Count; i++)
{
spawnedCards[i].GetComponentInChildren<CardVisuals>().Pick();
yield return (object)new WaitForSecondsRealtime(0.1f);
}
spawnedCards.Clear();
yield return (object)new WaitForSecondsRealtime(0.2f);
((Component)CardChoice.instance).GetComponent<PhotonView>().RPC("RPCA_DonePicking", (RpcTarget)0, Array.Empty<object>());
isPlayingField.SetValue(CardChoice.instance, false);
}
private void PickCard(GameObject cardToPick)
{
CardChoice.instance.Pick(cardToPick, (Object)(object)cardToPick == (Object)null);
CardChoice.instance.pickrID = -1;
}
public void AddReroll(int[] playersIDs, int[] newRerollsValue = null)
{
if (newRerollsValue == null)
{
newRerollsValue = new int[playersIDs.Length];
for (int i = 0; i < newRerollsValue.Length; i++)
{
CharacterStatModifiers stats = Utils.GetPlayerWithID(playersIDs[i]).data.stats;
newRerollsValue[i] = stats.GetAdditionalData().Rerolls + 1;
}
}
object[] array = new object[2] { playersIDs, newRerollsValue };
NetworkingManager.RPC(typeof(Reroll), "UpdateRerollValue_RPC", array);
}
public void Add1Reroll(int playerID)
{
AddReroll(new int[1] { playerID });
}
private void RerollCards(int pickrID, float soulUsed, GameObject cardToPick = null)
{
OwlCardsData.UpdateSoul(pickrID, Utils.GetPlayerWithID(pickrID).data.stats.GetAdditionalData().Soul - soulUsed);
Add1Reroll(pickrID);
if (PhotonNetwork.OfflineMode)
{
PickCard(cardToPick);
}
else if (Object.op_Implicit((Object)(object)cardToPick))
{
PickCard(cardToPick);
}
else
{
((MonoBehaviour)this).StartCoroutine(ReplaceCards());
}
}
private IEnumerator CheckRerolls(IGameModeHandler gm)
{
int pickrID = -1;
List<CardCategory> blacklist = new List<CardCategory>();
Player chosenPlayer = null;
Player[] array = PlayerManager.instance.players.ToArray();
foreach (Player player in array)
{
CharacterStatModifiers stats = player.data.stats;
if (stats.GetAdditionalData().Rerolls <= 0)
{
continue;
}
pickrID = player.playerID;
chosenPlayer = player;
if (!specialDraws.ContainsKey(pickrID))
{
break;
}
List<(int drawsUntilTriggered, CardCategory[] blacklist)> specialDraw = specialDraws[pickrID];
for (int j = 0; j < specialDraw.Count; j++)
{
if (specialDraw[j].drawsUntilTriggered == 0)
{
blacklist = specialDraw[j].blacklist.ToList();
specialDraw.RemoveAt(j);
break;
}
specialDraw[j] = (specialDraw[j].drawsUntilTriggered - 1, specialDraw[j].blacklist);
}
specialDraws[pickrID] = specialDraw;
break;
}
if (pickrID == -1 || (Object)(object)chosenPlayer == (Object)null)
{
yield break;
}
OwlCardsData additionalData = OwlCardsData.GetData(pickrID);
FieldInfo rerollsField = AccessTools.Field(typeof(OwlCardsData), "_rerolls");
rerollsField.SetValue(additionalData, additionalData.Rerolls - 1);
if (blacklist.Count > 0)
{
CharacterStatModifiersExtension.GetAdditionalData(chosenPlayer.data.stats).blacklistedCategories.AddRange(blacklist);
}
yield return GameModeManager.TriggerHook("PlayerPickStart");
CardChoiceVisuals.instance.Show((from i in Enumerable.Range(0, PlayerManager.instance.players.Count)
where PlayerManager.instance.players[i].playerID == pickrID
select i).First(), true);
yield return CardChoice.instance.DoPick(1, pickrID, (PickerType)1);
foreach (CardCategory cardCategory in blacklist)
{
CharacterStatModifiersExtension.GetAdditionalData(chosenPlayer.data.stats).blacklistedCategories.Remove(cardCategory);
}
yield return (object)new WaitForSecondsRealtime(0.1f);
yield return GameModeManager.TriggerHook("PlayerPickEnd");
yield return (object)new WaitForSecondsRealtime(0.1f);
}
}
internal class Utils
{
public static Player GetPlayerWithID(int playerID)
{
List<Player> players = PlayerManager.instance.players;
for (int i = 0; i < players.Count; i++)
{
if (players[i].playerID == playerID)
{
return players[i];
}
}
return null;
}
public static int[] GetOtherPlayersIDs(int myPlayerID)
{
int[] array = new int[PlayerManager.instance.players.Count - 1];
int num = 0;
Player[] array2 = PlayerManager.instance.players.ToArray();
foreach (Player val in array2)
{
if (val.playerID != myPlayerID)
{
array[num++] = val.playerID;
}
}
return array;
}
}
}
namespace OwlCards.UI
{
internal class Manager : MonoBehaviour
{
public static Manager instance;
private GameObject canvas = null;
private GameObject soulFill = null;
private int playerSoulFillID = -1;
private Dictionary<int, GameObject> soulCounters = new Dictionary<int, GameObject>();
private List<Action<float>> handlers = new List<Action<float>>();
private void Awake()
{
instance = this;
}
private void Start()
{
GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)BuildUI);
GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)ClearUI);
GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickEnd);
}
private IEnumerator OnPlayerPickEnd(IGameModeHandler gm)
{
playerSoulFillID = -1;
soulFill.SetActive(false);
yield break;
}
private void OnDestroy()
{
GameModeManager.RemoveHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)OnPlayerPickEnd);
GameModeManager.RemoveHook("GameStart", (Func<IGameModeHandler, IEnumerator>)BuildUI);
GameModeManager.RemoveHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)ClearUI);
}
private IEnumerator BuildUI(IGameModeHandler handler)
{
BuildCanvas();
BuildFillUI();
BuildSoulCounters();
yield break;
}
private IEnumerator ClearUI(IGameModeHandler handler)
{
RemoveCanvas();
yield break;
}
public void BuildCanvas()
{
GameObject val = OwlCards.instance.Bundle.LoadAsset<GameObject>("OC_UI_Canvas");
GameObject val2 = GameObject.Find("UI_Game");
canvas = Object.Instantiate<GameObject>(val, val2.transform);
}
public void UpdateFillUI(float soulValue)
{
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01da: Unknown result type (might be due to invalid IL or missing references)
//IL_01fa: Unknown result type (might be due to invalid IL or missing references)
//IL_02df: Unknown result type (might be due to invalid IL or missing references)
//IL_02db: Unknown result type (might be due to invalid IL or missing references)
//IL_0313: Unknown result type (might be due to invalid IL or missing references)
//IL_030f: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)soulFill))
{
Transform child = soulFill.transform.GetChild(0);
Image component = ((Component)child.GetChild(0)).GetComponent<Image>();
Text component2 = ((Component)child.GetChild(1)).GetComponent<Text>();
component2.text = string.Format(soulValue.ToString("G3") + " Soul");
component.fillAmount = ((soulValue > 1f) ? (soulValue - Mathf.Floor(soulValue)) : soulValue);
Image component3 = ((Component)child).GetComponent<Image>();
((Graphic)component3).color = Color.white;
component.fillOrigin = 0;
if (soulValue < 0f)
{
component.fillOrigin = 1;
((Graphic)component).color = Color.red;
component.fillAmount = Mathf.Clamp(Mathf.Abs(soulValue), 0f, 1f);
}
if (soulValue > 0f)
{
((Graphic)component).color = new Color(0f, 1f, 0.38f, 1f);
}
if (soulValue > 1f)
{
((Graphic)component3).color = ((Graphic)component).color;
((Graphic)component).color = new Color(0f, 1f, 0.82f, 1f);
}
if (soulValue > 2f)
{
((Graphic)component3).color = ((Graphic)component).color;
((Graphic)component).color = new Color(0f, 0.27f, 1f, 1f);
}
if (soulValue > 3f)
{
((Graphic)component3).color = ((Graphic)component).color;
((Graphic)component).color = new Color(0.63f, 0f, 1f, 1f);
}
if (soulValue > 4f)
{
((Graphic)component3).color = ((Graphic)component).color;
((Graphic)component).color = new Color(1f, 0.58f, 0f, 1f);
}
Color val = default(Color);
((Color)(ref val))..ctor(0.42f, 0.42f, 0.42f, 1f);
Color val2 = default(Color);
((Color)(ref val2))..ctor(0.22f, 0.91f, 0.91f, 1f);
Color val3 = default(Color);
((Color)(ref val3))..ctor(1f, 0.51f, 0.33f, 1f);
string text = "Press <color=blue>Block</color> to reroll cards\n <i>(costs " + OwlCards.instance.rerollSoulCost.Value.ToString("G3") + " soul)</i>";
string text2 = "Press <color=red>Fire</color> to pick an extra card\n <i>(costs " + OwlCards.instance.extraPickSoulCost.Value.ToString("G3") + " soul)</i>";
((Graphic)((Component)soulFill.transform.GetChild(1)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.rerollSoulCost.Value) ? val : val2);
((Graphic)((Component)soulFill.transform.GetChild(2)).GetComponent<Image>()).color = ((soulValue < OwlCards.instance.extraPickSoulCost.Value) ? val : val3);
((Component)soulFill.transform.GetChild(1)).GetComponentInChildren<Text>().text = text;
((Component)soulFill.transform.GetChild(2)).GetComponentInChildren<Text>().text = text2;
}
}
public void BuildFillUI()
{
if (!Object.op_Implicit((Object)(object)soulFill))
{
playerSoulFillID = -1;
GameObject val = OwlCards.instance.Bundle.LoadAsset<GameObject>("OC_UI_SoulFill");
if (!Object.op_Implicit((Object)(object)canvas))
{
BuildCanvas();
}
soulFill = Object.Instantiate<GameObject>(val, canvas.transform);
soulFill.SetActive(false);
}
}
private void Update()
{
if (Object.op_Implicit((Object)(object)soulFill) && CardChoice.instance.pickrID != -1 && playerSoulFillID != CardChoice.instance.pickrID)
{
playerSoulFillID = CardChoice.instance.pickrID;
soulFill.SetActive(true);
UpdateFillUI(OwlCardsData.GetData(playerSoulFillID).Soul);
}
}
public void BuildSoulCounters()
{
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
int num = 0;
if (!Object.op_Implicit((Object)(object)canvas))
{
BuildCanvas();
}
Player[] array = PlayerManager.instance.players.ToArray();
foreach (Player val in array)
{
GameObject val2 = GameObject.Find("CardViz");
Transform child = val2.transform.GetChild(3 + num);
GameObject val3 = OwlCards.instance.Bundle.LoadAsset<GameObject>("OC_UI_SoulCounter");
GameObject val4 = Object.Instantiate<GameObject>(val3, canvas.transform);
int playerID = val.playerID;
soulCounters[playerID] = val4;
Action<float> action = delegate(float x)
{
OnSoulValueChanged(playerID, x);
};
handlers.Add(action);
val.data.stats.GetAdditionalData().soulChanged += action;
Text component = val4.GetComponent<Text>();
component.text = string.Format(val.data.stats.GetAdditionalData().Soul.ToString("F2"));
Vector3 localPosition = val4.transform.localPosition;
Canvas component2 = ((Component)val2.transform.parent).GetComponent<Canvas>();
localPosition.y = child.localPosition.y * component2.scaleFactor / canvas.GetComponent<Canvas>().scaleFactor;
val4.transform.localPosition = localPosition;
num++;
}
}
public void OnSoulValueChanged(int playerID, float newValue)
{
Text component = soulCounters[playerID].GetComponent<Text>();
component.text = string.Format(newValue.ToString("F2"));
if (playerID == playerSoulFillID && soulFill.activeSelf)
{
UpdateFillUI(newValue);
}
}
public void RemoveCounters()
{
int[] array = soulCounters.Keys.ToArray();
foreach (int num in array)
{
Utils.GetPlayerWithID(num).data.stats.GetAdditionalData().soulChanged -= handlers[num];
Object.Destroy((Object)(object)soulCounters[num]);
}
handlers.Clear();
soulCounters.Clear();
}
public void RemoveCanvas()
{
RemoveFill();
RemoveCounters();
if (Object.op_Implicit((Object)(object)canvas))
{
Object.Destroy((Object)(object)canvas);
}
canvas = null;
soulCounters = new Dictionary<int, GameObject>();
}
public void RemoveFill()
{
if (Object.op_Implicit((Object)(object)soulFill))
{
playerSoulFillID = -1;
Object.Destroy((Object)(object)soulFill);
soulFill = null;
}
}
}
}
namespace OwlCards.Logic
{
internal class FeedMe_Logic : WasHitEffect
{
private Player player;
private float soulLeftToGainThisPoint = 0.3f;
private void Start()
{
player = ((Component)this).GetComponent<Player>();
GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)ResetLimitGainedPerPoint);
}
private IEnumerator ResetLimitGainedPerPoint(IGameModeHandler gm)
{
OwlCards.Log("FeedMe gave " + (0.3f - soulLeftToGainThisPoint) + " rerolls this round point");
soulLeftToGainThisPoint = 0.3f;
yield break;
}
public override void WasDealtDamage(Vector2 damage, bool selfDamage)
{
if (!selfDamage && soulLeftToGainThisPoint > 0f)
{
float num = ((Vector2)(ref damage)).magnitude / 1000f;
num = Mathf.Min(soulLeftToGainThisPoint, num);
float num2 = player.data.stats.GetAdditionalData().Soul + num;
OwlCardsData.UpdateSoul(new int[1] { player.playerID }, new float[1] { num2 });
soulLeftToGainThisPoint -= num;
}
}
private void OnDestroy()
{
GameModeManager.RemoveHook("PointStart", (Func<IGameModeHandler, IEnumerator>)ResetLimitGainedPerPoint);
}
}
[DisallowMultipleComponent]
internal class LastHitter_Logic : DealtDamageEffect
{
private Player owner;
public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
{
if (!selfDamage && Object.op_Implicit((Object)(object)damagedPlayer) && ((Vector2)(ref damage)).magnitude > damagedPlayer.data.health)
{
((MonoBehaviour)this).StartCoroutine("CheckIfPlayerDied", (object)damagedPlayer);
}
}
private IEnumerator CheckIfPlayerDied(Player damagedPlayer)
{
yield return (object)new WaitForEndOfFrame();
if (damagedPlayer.data.dead)
{
float newSoul = owner.data.stats.GetAdditionalData().Soul + 0.25f;
OwlCardsData.UpdateSoul(new int[1] { owner.playerID }, new float[1] { newSoul });
}
}
private void Start()
{
owner = ((Component)this).GetComponent<Player>();
}
}
[DisallowMultipleComponent]
internal class SoulExhaustion_Logic : HitEffect
{
public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
{
if (!selfDamage && Object.op_Implicit((Object)(object)damagedPlayer))
{
float soul = damagedPlayer.data.stats.GetAdditionalData().Soul;
float slowValue = SoulExhaustion.GetSlowValue(soul);
OwlCards.Log("Applying slow value: " + slowValue + " with soulValue: " + soul);
damagedPlayer.data.stats.RPCA_AddSlow(slowValue, false);
}
}
}
[DisallowMultipleComponent]
internal class SoulLeech_Logic : DealtDamageEffect
{
private Player player;
private Dictionary<int, float> soulLeftToStealThisPoint = new Dictionary<int, float>();
private void Start()
{
player = ((Component)this).GetComponent<Player>();
GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)ResetStats);
}
private IEnumerator ResetStats(IGameModeHandler gm)
{
soulLeftToStealThisPoint.Clear();
yield break;
}
public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer)
{
if (!selfDamage && Object.op_Implicit((Object)(object)damagedPlayer))
{
if (!soulLeftToStealThisPoint.ContainsKey(damagedPlayer.playerID))
{
soulLeftToStealThisPoint.Add(damagedPlayer.playerID, 0.15f);
}
float num = soulLeftToStealThisPoint[damagedPlayer.playerID];
if (!(num <= 0f))
{
float num2 = ((Vector2)(ref damage)).magnitude / damagedPlayer.data.maxHealth / 5f;
num2 = Mathf.Min(num2, num);
int[] playersIDs = new int[2] { player.playerID, damagedPlayer.playerID };
float[] newSoulValues = new float[2]
{
player.data.stats.GetAdditionalData().Soul + num2,
player.data.stats.GetAdditionalData().Soul - num2
};
OwlCardsData.UpdateSoul(playersIDs, newSoulValues);
soulLeftToStealThisPoint[damagedPlayer.playerID] -= num2;
OwlCards.Log("Stole: " + num2 + " steal from playerID: " + damagedPlayer.playerID + " to me: " + player.playerID);
}
}
}
private void OnDestroy()
{
GameModeManager.RemoveHook("PointStart", (Func<IGameModeHandler, IEnumerator>)ResetStats);
}
}
}
namespace OwlCards.Extensions
{
[Serializable]
public class OwlCardsData
{
private float _soul;
private int _rerolls;
public float Soul
{
get
{
return _soul;
}
private set
{
if (_soul != value)
{
_soul = value;
this.soulChanged?.Invoke(value);
}
}
}
public int Rerolls => _rerolls;
public event Action<float> soulChanged;
[UnboundRPC]
private static void UpdateSoul_RPC(int[] playersIDs, float[] newSoulValues)
{
for (int i = 0; i < playersIDs.Length; i++)
{
int playerID = playersIDs[i];
float soul = newSoulValues[i];
OwlCardsData additionalData = Utils.GetPlayerWithID(playerID).data.stats.GetAdditionalData();
additionalData.Soul = soul;
}
}
public static void UpdateSoul(int[] playersIDs, float[] newSoulValues)
{
object[] array = new object[2] { playersIDs, newSoulValues };
NetworkingManager.RPC(typeof(OwlCardsData), "UpdateSoul_RPC", array);
}
public static void UpdateSoul(int playerID, float newSoulValue)
{
UpdateSoul(new int[1] { playerID }, new float[1] { newSoulValue });
}
public static OwlCardsData GetData(int playerID)
{
return GetData(Utils.GetPlayerWithID(playerID));
}
public static OwlCardsData GetData(Player player)
{
return player.data.stats.GetAdditionalData();
}
public OwlCardsData()
{
_soul = OwlCards.instance.soulOnGameStart.Value;
_rerolls = 0;
}
}
public static class CharacterStatModifiersExtension
{
public static readonly ConditionalWeakTable<CharacterStatModifiers, OwlCardsData> data = new ConditionalWeakTable<CharacterStatModifiers, OwlCardsData>();
public static OwlCardsData GetAdditionalData(this CharacterStatModifiers statModifiers)
{
return data.GetOrCreateValue(statModifiers);
}
public static void AddData(this CharacterStatModifiers statModifiers, OwlCardsData value)
{
try
{
data.Add(statModifiers, value);
}
catch (Exception)
{
}
}
}
[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
internal class CharacterStatModifiersPatchResetStats
{
private static void Prefix(CharacterStatModifiers __instance)
{
OwlCardsData additionalData = __instance.GetAdditionalData();
if (additionalData.Soul != OwlCards.instance.soulOnGameStart.Value)
{
MethodInfo methodInfo = AccessTools.PropertySetter(typeof(OwlCardsData), "Soul");
methodInfo.Invoke(additionalData, new object[1] { OwlCards.instance.soulOnGameStart.Value });
}
FieldInfo fieldInfo = AccessTools.Field(typeof(OwlCardsData), "_rerolls");
fieldInfo.SetValue(additionalData, 0);
}
}
}
namespace OwlCards.Cards
{
internal abstract class AOwlCard : CustomCard
{
public static Dictionary<string, Func<float, bool>> conditions = new Dictionary<string, Func<float, bool>>();
public abstract void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block);
public sealed override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
cardInfo.categories = (CardCategory[])(object)new CardCategory[1] { OwlCardCategory.modCategory };
SetupCard_child(cardInfo, gun, cardStats, statModifiers, block);
}
protected string RarityToColorString(Rarity rarity)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
Rarity rarityData = RarityUtils.GetRarityData(rarity);
if (rarity == Rarities.Common)
{
return rarityData.name;
}
Color color = rarityData.color;
int num = (int)(255f * color.r);
int num2 = (int)(255f * color.g);
int num3 = (int)(255f * color.b);
return "<#" + num.ToString("X2") + num2.ToString("X2") + num3.ToString("X2") + ">" + rarityData.name + "</color>";
}
protected GameObject GetCardArt(string name)
{
try
{
return OwlCards.instance.Bundle.LoadAsset<GameObject>(name);
}
catch
{
return null;
}
}
protected override GameObject GetCardArt()
{
return null;
}
public override string GetModName()
{
return "OWL";
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
}
internal static class OwlCardCategory
{
public static CardCategory modCategory = CustomCardCategories.instance.CardCategory("OwlCards");
public static CardCategory soulCondition = CustomCardCategories.instance.CardCategory("OwlCards-SoulCondition");
public static Dictionary<Rarity, CardCategory> rarityCategories = new Dictionary<Rarity, CardCategory>();
public static void InitializeRarityCategories()
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
if (rarityCategories.Count == 0)
{
Rarity[] array = RarityUtils.Rarities.Values.ToArray();
Rarity[] array2 = array;
foreach (Rarity val in array2)
{
rarityCategories.Add(val.value, CustomCardCategories.instance.CardCategory("OwlCards-" + val.name));
}
}
}
public static CardCategory[] GetRarityCategoryAndLower(Rarity rarity, bool bGetReverseArray)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
return GetRarityCategories((Rarity)0, rarity, bGetReverseArray);
}
public static CardCategory[] GetRarityCategoryAndHigher(Rarity rarity, bool bGetReverseArray)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
return GetRarityCategories(rarity, Rarities.Divine, bGetReverseArray);
}
public static CardCategory[] GetRarityCategories(Rarity lowestRarity, Rarity highestRarity, bool bGetReverseArray)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
CardCategory[] array = (CardCategory[])(object)new CardCategory[0];
float relativeRarity = RarityUtils.GetRarityData(lowestRarity).relativeRarity;
float relativeRarity2 = RarityUtils.GetRarityData(highestRarity).relativeRarity;
if (relativeRarity < relativeRarity2)
{
throw new OwlCardsException("GetRarityCategories called with invalid low/high parameters");
}
foreach (KeyValuePair<Rarity, CardCategory> rarityCategory in rarityCategories)
{
rarityCategory.Deconstruct(out var key, out var value);
Rarity val = key;
CardCategory element = value;
float relativeRarity3 = RarityUtils.GetRarityData(val).relativeRarity;
if (relativeRarity3 <= relativeRarity && relativeRarity3 >= relativeRarity2)
{
if (!bGetReverseArray)
{
array = array.Append(element).ToArray();
}
}
else if (bGetReverseArray)
{
array = array.Append(element).ToArray();
}
}
return array;
}
}
internal class Bargain : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => soul >= 2f;
if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
{
cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
}
CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul - 3f);
}
CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => RarityUtils.GetRarityData(cardInfo.rarity).calculatedRarity <= RarityUtils.GetRarityData(Rarities.Exotic).calculatedRarity), 1000);
Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
CardBarUtils.instance.ShowAtEndOfPhase(player, randomCardWithCondition);
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Bargain";
}
protected override string GetDescription()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return "You trade part of your soul for a random " + RarityToColorString(Rarities.Exotic) + " or rarer card";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = false,
stat = "Soul",
amount = "-2",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_Bargain");
}
protected override Rarity GetRarity()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
return Rarities.Uncommon;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
internal class CorruptedPower : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
AOwlCard.conditions[((CustomCard)this).GetTitle()] = delegate
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
foreach (CardInfo item in Cards.active)
{
if (item.rarity == Rarities.Epic)
{
return true;
}
}
return false;
};
if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
{
cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
}
CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
int[] otherPlayersIDs = Utils.GetOtherPlayersIDs(player.playerID);
Reroll.instance.AddReroll(otherPlayersIDs);
}
CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => RarityUtils.GetRarityData(cardInfo.rarity).calculatedRarity <= RarityUtils.GetRarityData(Rarities.Epic).calculatedRarity), 1000);
Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
CardBarUtils.instance.ShowCard(player, randomCardWithCondition);
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Corrupted Power";
}
protected override string GetDescription()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return "Acquire a random " + RarityToColorString(Rarities.Epic) + " or rarer card";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = false,
stat = "Pick for everyone else",
amount = "+1",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_CorruptedPower");
}
protected override Rarity GetRarity()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
return Rarities.Rare;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
internal class Dedication : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul + 1f);
}
CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => cardInfo.rarity == Rarities.Common), 1000);
Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
CardBarUtils.instance.ShowCard(player, randomCardWithCondition);
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Dedication";
}
protected override string GetDescription()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return "Gives you a random " + RarityToColorString(Rarities.Common) + " card";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = true,
stat = "Soul",
amount = "+1",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_Dedication");
}
protected override Rarity GetRarity()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
return Rarities.Uncommon;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
internal class FeedMe : AOwlCard
{
public const float soulPointsToGainPerPoint = 0.3f;
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
statModifiers.health = 1.5f;
cardInfo.allowMultiple = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
ExtensionMethods.GetOrAddComponent<FeedMe_Logic>(((Component)player).gameObject, false);
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
FeedMe_Logic component = ((Component)player).gameObject.GetComponent<FeedMe_Logic>();
if (Object.op_Implicit((Object)(object)component))
{
Object.Destroy((Object)(object)component);
}
}
protected override string GetTitle()
{
return "Feed Me";
}
protected override string GetDescription()
{
return "Learn how to assimilate bullets that hit you to strengthen your soul";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = true,
stat = "Health",
amount = "+50%",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_FeedMe");
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)0;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)8;
}
}
internal class FunKiller : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => soul >= 1.5f && PlayerManager.instance.players.Count > 3;
if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
{
cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
}
cardInfo.allowMultiple = false;
CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
int[] array = new int[PlayerManager.instance.players.Count];
float[] array2 = new float[PlayerManager.instance.players.Count];
for (int i = 0; i < array.Length; i++)
{
int playerID = PlayerManager.instance.players[i].playerID;
float soul = OwlCardsData.GetData(playerID).Soul;
soul = ((playerID != player.playerID) ? (soul - 0.5f) : (soul - 2f));
array[i] = playerID;
array2[i] = soul;
}
OwlCardsData.UpdateSoul(array, array2);
Reroll.instance.Add1Reroll(player.playerID);
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Fun Killer";
}
protected override string GetDescription()
{
return "Reroll your cards and drain everyone's soul.";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[2]
{
new CardInfoStat
{
positive = false,
stat = "Soul",
amount = "-1.5",
simepleAmount = (SimpleAmount)0
},
new CardInfoStat
{
positive = true,
stat = "Others' Souls",
amount = "-0.5",
simepleAmount = (SimpleAmount)0
}
};
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)1;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
[Description("LastHitter")]
internal class LastHitter : AOwlCard
{
public const float soulGainedPerKill = 0.25f;
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
gun.damage = 1.25f;
gun.reloadTime = 1.25f;
gun.ammo = -1;
cardInfo.allowMultiple = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
ExtensionMethods.GetOrAddComponent<LastHitter_Logic>(((Component)player).gameObject, false);
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
LastHitter_Logic component = ((Component)player).gameObject.GetComponent<LastHitter_Logic>();
if (Object.op_Implicit((Object)(object)component))
{
Object.Destroy((Object)(object)component);
}
}
protected override string GetTitle()
{
return "Last Hitter";
}
protected override string GetDescription()
{
return "Earn some Soul whenever you make a kill";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: Expected O, but got Unknown
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[4]
{
new CardInfoStat
{
positive = true,
stat = "Damage",
amount = "+25%",
simepleAmount = (SimpleAmount)2
},
new CardInfoStat
{
positive = false,
stat = "Ammo",
amount = "-1",
simepleAmount = (SimpleAmount)6
},
new CardInfoStat
{
positive = false,
stat = "Projectile Size",
amount = "Smaller",
simepleAmount = (SimpleAmount)9
},
new CardInfoStat
{
positive = false,
stat = "Reload",
amount = "+25%",
simepleAmount = (SimpleAmount)6
}
};
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)1;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)0;
}
}
internal class OpenBar : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
int[] otherPlayersIDs = Utils.GetOtherPlayersIDs(player.playerID);
float[] array = new float[otherPlayersIDs.Length];
for (int i = 0; i < otherPlayersIDs.Length; i++)
{
array[i] = OwlCardsData.GetData(otherPlayersIDs[i]).Soul + 1f;
}
OwlCardsData.UpdateSoul(otherPlayersIDs, array);
}
CardInfo randomCardWithCondition = Cards.instance.GetRandomCardWithCondition(player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)((CardInfo cardInfo, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats) => RarityUtils.GetRarityData(cardInfo.rarity).calculatedRarity <= RarityUtils.GetRarityData(Rarities.Rare).calculatedRarity), 1000);
Cards.instance.AddCardToPlayer(player, randomCardWithCondition, false, "", 0f, 0f, true);
CardBarUtils.instance.ShowCard(player, randomCardWithCondition);
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "OpenBar";
}
protected override string GetDescription()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return "You get a random " + RarityToColorString(Rarities.Rare) + " or rarer card";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = false,
stat = "Others Soul",
amount = "+1",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_OpenBar");
}
protected override Rarity GetRarity()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
return Rarities.Uncommon;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
internal class Pious : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => soul >= 3f;
if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
{
cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
}
CardInfoExtension.GetAdditionalData(cardInfo).canBeReassigned = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul - 3f);
Reroll.instance.Add1Reroll(player.playerID);
}
CardCategory[] rarityCategories = OwlCardCategory.GetRarityCategories(Rarities.Exotic, Rarities.Rare, bGetReverseArray: true);
Reroll.instance.AddSpecialDraw(player.playerID, 0, rarityCategories);
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Pious";
}
protected override string GetDescription()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
return "You get to pick a card among " + RarityToColorString(Rarities.Exotic) + " or " + RarityToColorString(Rarities.Rare) + " cards";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = false,
stat = "Soul",
amount = "-3",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_Pious");
}
protected override Rarity GetRarity()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
return Rarities.Rare;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
internal class Resolution : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
statModifiers.regen = 5f;
statModifiers.health = 1.1f;
statModifiers.secondsToTakeDamageOver = 1f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
OwlCardsData.UpdateSoul(player.playerID, OwlCardsData.GetData(player).Soul + 0.5f);
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Resolution";
}
protected override string GetDescription()
{
return "";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Expected O, but got Unknown
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_0092: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b7: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[4]
{
new CardInfoStat
{
positive = true,
stat = "Health",
amount = "+10%",
simepleAmount = (SimpleAmount)0
},
new CardInfoStat
{
positive = true,
stat = "Regen",
amount = "+5",
simepleAmount = (SimpleAmount)0
},
new CardInfoStat
{
positive = true,
stat = "Decay",
amount = "+1s",
simepleAmount = (SimpleAmount)0
},
new CardInfoStat
{
positive = true,
stat = "Soul",
amount = "+0.5",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_Resolution");
}
protected override Rarity GetRarity()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
return Rarities.Common;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)2;
}
}
internal class Soul : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => false;
if (!cardInfo.categories.Contains(OwlCardCategory.soulCondition))
{
cardInfo.categories = cardInfo.categories.Append(OwlCardCategory.soulCondition).ToArray();
}
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
float soul = player.data.stats.GetAdditionalData().Soul;
OwlCardsData.UpdateSoul(new int[1] { player.playerID }, new float[1] { soul + 1f });
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Soul";
}
protected override string GetDescription()
{
return "";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = true,
stat = "Soul",
amount = "+1",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_Soul");
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)0;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
[Description("SoulExhaustion")]
internal class SoulExhaustion : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
gun.projectileSpeed = 1.15f;
gun.attackSpeed = 1.25f;
cardInfo.allowMultiple = false;
}
public static float GetSlowValue(float soulValue)
{
return Mathf.Lerp(1f, 0.2f, (soulValue - 1.5f) / 5f);
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
ExtensionMethods.GetOrAddComponent<SoulExhaustion_Logic>(((Component)player).gameObject, false);
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
SoulExhaustion_Logic component = ((Component)player).gameObject.GetComponent<SoulExhaustion_Logic>();
if (Object.op_Implicit((Object)(object)component))
{
Object.Destroy((Object)(object)component);
}
}
protected override string GetTitle()
{
return "Soul Exhaustion";
}
protected override string GetDescription()
{
return "Your bullets exhaust your target, slowing them down the less Soul they have.";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[2]
{
new CardInfoStat
{
positive = true,
stat = "Projectile Speed",
amount = "+15%",
simepleAmount = (SimpleAmount)1
},
new CardInfoStat
{
positive = true,
stat = "Attack Speed",
amount = "+25%",
simepleAmount = (SimpleAmount)1
}
};
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)1;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)7;
}
}
internal class SoulLeech : AOwlCard
{
public const float rerollLeeched = 0.1f;
public const float maxLeechPerRoundPerPlayer = 0.15f;
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
statModifiers.lifeSteal = 0.2f;
gun.damage = 0.85f;
cardInfo.allowMultiple = false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
ExtensionMethods.GetOrAddComponent<SoulLeech_Logic>(((Component)player).gameObject, false);
}
}
private void MyCustomDamageDealt(Vector2 whatIsThisIDontEvenKnow, bool bThisIsABoolean)
{
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
SoulLeech_Logic component = ((Component)player).GetComponent<SoulLeech_Logic>();
if (Object.op_Implicit((Object)(object)component))
{
Object.Destroy((Object)(object)component);
}
}
protected override string GetTitle()
{
return "Soul Leech";
}
protected override string GetDescription()
{
return "Your bullets steal Soul";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[2]
{
new CardInfoStat
{
positive = true,
stat = "Lifesteal",
amount = "+20%",
simepleAmount = (SimpleAmount)2
},
new CardInfoStat
{
positive = false,
stat = "Damage",
amount = "-15%",
simepleAmount = (SimpleAmount)5
}
};
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)1;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)6;
}
}
internal class Soulless : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
AOwlCard.conditions[((CustomCard)this).GetTitle()] = (float soul) => false;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (PhotonNetwork.OfflineMode || PhotonNetwork.IsMasterClient)
{
OwlCardsData.UpdateSoul(new int[1] { player.playerID }, new float[1]);
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Soulless";
}
protected override string GetDescription()
{
return "";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = false,
stat = "Soul",
amount = "0",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_Soulless");
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)0;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
internal class SoulRejuvenation : AOwlCard
{
public override void SetupCard_child(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
statModifiers.regen = 8f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override string GetTitle()
{
return "Soul Rejuvenation";
}
protected override string GetDescription()
{
return "What doesn't kill grows your soul";
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = true,
stat = "Regen",
amount = "+8",
simepleAmount = (SimpleAmount)0
}
};
}
protected override GameObject GetCardArt()
{
return GetCardArt("C_SoulRejuvenation");
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)0;
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)3;
}
}
}