using System;
using System.CodeDom.Compiler;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using CinnamonFlavour.Extensions;
using HarmonyLib;
using Photon.Pun;
using Sonigon;
using SoundImplementation;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.Utils;
using UnityEngine;
using UnityEngine.Audio;
using UnityEngine.Events;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("0.0.0.0")]
internal class ThisAssembly
{
[GeneratedCode("ThisAssembly.Project", "1.0.0")]
[CompilerGenerated]
public static class Project
{
public const string RootNamespace = "CinnamonFlavour";
public const string AssemblyName = "CinnamonFlavour";
public const string TargetFrameworkVersion = "v4.7.2";
public const string TargetFrameworkIdentifier = ".NETFramework";
public const string TargetFrameworkMoniker = ".NETFramework,Version=v4.7.2";
public const string Version = "0.6.0";
}
}
namespace CinnamonFlavour
{
public class Brand : MonoBehaviour
{
private static readonly float s_baseDamagePercentage = 0.015f;
private static readonly float s_damageRate = 0.2f;
private float _radius;
private Color _color;
private List<GameObject> _lineTargets;
private List<float> _sparkCooldowns;
private float _damageCooldown;
private Player _player;
public Player Brander { get; set; }
public Color Color
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return _color;
}
set
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: 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_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
_color = value;
Color val = _color * 0.25f;
val.a = 1f;
LineRenderer[] componentsInChildren = ((Component)this).GetComponentsInChildren<LineRenderer>(true);
foreach (LineRenderer val2 in componentsInChildren)
{
val2.startColor = val;
val2.endColor = val;
}
}
}
private void Start()
{
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Expected O, but got Unknown
_radius = ((Component)((Component)this).transform.Find("Circle")).GetComponent<LineEffect>().radius;
_lineTargets = new List<GameObject>();
_sparkCooldowns = new List<float>();
_player = ((Component)this).GetComponentInParent<Player>();
LineEffect[] componentsInChildren = ((Component)((Component)this).transform.Find("Lines")).GetComponentsInChildren<LineEffect>();
foreach (LineEffect val in componentsInChildren)
{
GameObject val2 = new GameObject("LineTarget");
val2.transform.SetParent(((Component)this).transform);
SetRandomPositionOnRadius(val2);
_sparkCooldowns.Add(GetRandomSparkDuration());
_lineTargets.Add(val2);
val.Play(((Component)this).transform, val2.transform, 0f);
}
}
private void Update()
{
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < _sparkCooldowns.Count; i++)
{
_sparkCooldowns[i] -= Time.deltaTime;
if (_sparkCooldowns[i] <= 0f)
{
SetRandomPositionOnRadius(_lineTargets[i]);
_sparkCooldowns[i] = GetRandomSparkDuration();
}
}
_damageCooldown -= Time.deltaTime;
if (_damageCooldown <= 0f)
{
float num = _player.data.maxHealth * Brander.data.stats.GetAdditionalData().BrandDamageMultiplier * s_baseDamagePercentage;
((Damagable)_player.data.healthHandler).TakeDamage(Vector2.up * num, Vector2.op_Implicit(((Component)this).transform.position), (GameObject)null, (Player)null, true, false);
if (Brander.data.stats.GetAdditionalData().EnableBrandLifeSteal)
{
Brander.data.healthHandler.Heal(num * Brander.data.stats.lifeSteal);
}
_damageCooldown = s_damageRate;
}
}
private void SetRandomPositionOnRadius(GameObject target)
{
//IL_001f: 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_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
int num = Random.Range(0, 360);
target.transform.localPosition = Quaternion.Euler(0f, 0f, (float)num) * Vector2.op_Implicit(Vector2.up * _radius * 1.2f);
}
private static float GetRandomSparkDuration()
{
return Random.Range(0.1f, 0.5f);
}
}
public class BrandHandler : MonoBehaviour
{
private Player _player;
private CharacterData _data;
private Dictionary<int, float> _brandDurations;
private Dictionary<int, GameObject> _brands;
private GameObject _brandPrefab;
private GameObject _brandContainer;
private void Awake()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Expected O, but got Unknown
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
_brandPrefab = (GameObject)CinnamonFlavour.CustomResources["Brand"];
_brandContainer = new GameObject("Brands");
_brandContainer.transform.SetParent(((Component)this).transform);
_brandContainer.transform.localPosition = Vector3.zero;
}
private void Start()
{
_player = ((Component)this).GetComponent<Player>();
_data = _player.data;
HealthHandler healthHandler = _data.healthHandler;
healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(Reset));
_brandDurations = new Dictionary<int, float>();
_brands = new Dictionary<int, GameObject>();
}
private void OnDestroy()
{
HealthHandler healthHandler = _data.healthHandler;
healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(Reset));
}
public void Brand(Player brander)
{
CharacterStatModifiers stats = brander.data.stats;
float duration = stats.GetAdditionalData().BrandDuration * stats.GetAdditionalData().BrandDurationMultiplier;
Brand(brander.playerID, duration);
}
internal void Brand(int branderID, float duration)
{
if (_player.data.view.IsMine)
{
if (PhotonNetwork.OfflineMode)
{
RPCA_Brand(branderID, duration);
return;
}
_player.data.view.RPC("RPCA_Brand", (RpcTarget)0, new object[2] { branderID, duration });
}
}
[PunRPC]
private void RPCA_Brand(int branderID, float duration)
{
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
Player val = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == branderID));
if (!_brandDurations.ContainsKey(branderID))
{
_brandDurations.Add(branderID, 0f);
GameObject val2 = Object.Instantiate<GameObject>(_brandPrefab, _brandContainer.transform);
SpawnedAttack orAddComponent = ExtensionMethods.GetOrAddComponent<SpawnedAttack>(val2, false);
orAddComponent.spawner = val;
Brand component = val2.GetComponent<Brand>();
component.Brander = val;
component.Color = PlayerSkinBank.GetPlayerSkinColors(branderID).color;
_brands.Add(branderID, val2);
}
_brandDurations[branderID] = duration;
if (Object.op_Implicit((Object)(object)val))
{
val.data.stats.GetAdditionalData().PlayerBrandedAction?.Invoke(_player);
}
}
public bool IsBrandedBy(Player player)
{
return _brandDurations.ContainsKey(player.playerID);
}
private void Update()
{
foreach (int item in _brandDurations.Keys.ToList())
{
_brandDurations[item] -= Time.deltaTime;
if (_brandDurations[item] <= 0f)
{
ExpireBrand(item);
}
}
}
private void ExpireBrand(int branderID)
{
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
Player val = ((IEnumerable<Player>)PlayerManager.instance.players).FirstOrDefault((Func<Player, bool>)((Player p) => p.playerID == branderID));
if (Object.op_Implicit((Object)(object)val))
{
List<BrandObjectsToSpawn> list = val.data.stats.GetAdditionalData().BrandObjectsToSpawn.Where((BrandObjectsToSpawn x) => x.Trigger == BrandObjectsToSpawn.SpawnTrigger.Expire).ToList();
SpawnedAttack component = _brands[branderID].GetComponent<SpawnedAttack>();
foreach (BrandObjectsToSpawn item in list)
{
BrandObjectsToSpawn.SpawnObject(item, Vector2.op_Implicit(((Component)_player).transform.position), val, component);
}
}
Object.Destroy((Object)(object)_brands[branderID]);
_brandDurations.Remove(branderID);
_brands.Remove(branderID);
}
public void Reset()
{
_brandDurations = new Dictionary<int, float>();
foreach (GameObject item in _brands.Values.ToList())
{
Object.Destroy((Object)(object)item);
}
_brands = new Dictionary<int, GameObject>();
}
}
public class BrandObjectsToSpawn
{
public enum SpawnTrigger
{
Expire
}
public GameObject Effect { get; set; } = null;
public SpawnTrigger Trigger { get; set; } = SpawnTrigger.Expire;
public int Stacks { get; set; } = 1;
public bool ScaleStacks { get; set; } = false;
public float ScaleStackMultiplier { get; set; } = 0f;
public float ScaleFromBrandDamage { get; set; } = 0f;
public float ScaleFromDamageToBranded { get; set; } = 0f;
public static GameObject SpawnObject(BrandObjectsToSpawn objectToSpawn, Vector2 position, Player spawner, SpawnedAttack spawnedAttack)
{
//IL_0007: 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_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: 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_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
GameObject val = Object.Instantiate<GameObject>(objectToSpawn.Effect, Vector2.op_Implicit(position), Quaternion.identity);
spawnedAttack.CopySpawnedAttackTo(val);
if (objectToSpawn.ScaleStacks && objectToSpawn.ScaleStackMultiplier > 0f)
{
Transform transform = val.transform;
transform.localScale *= 1f + objectToSpawn.ScaleStackMultiplier * (float)(objectToSpawn.Stacks - 1);
}
if (objectToSpawn.ScaleFromBrandDamage > 0f)
{
float brandDamageMultiplier = spawner.data.stats.GetAdditionalData().BrandDamageMultiplier;
Transform transform2 = val.transform;
transform2.localScale *= brandDamageMultiplier * objectToSpawn.ScaleFromBrandDamage;
}
if (objectToSpawn.ScaleFromDamageToBranded > 0f)
{
float damageToBranded = spawner.data.weaponHandler.gun.GetAdditionalData().DamageToBranded;
Transform transform3 = val.transform;
transform3.localScale *= damageToBranded * objectToSpawn.ScaleFromDamageToBranded;
}
return val;
}
}
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
public sealed class CardAttribute : Attribute
{
}
public enum CardInfoStatType
{
Positive,
Negative
}
public class AirBurstAttachment : MonoBehaviour
{
[SerializeField]
private GameObject _objectToSpawn = null;
private ProjectileHit _projectileHit;
private SpawnedAttack _attack;
private Player _spawner;
private Player[] _opponents;
private void Start()
{
_projectileHit = ((Component)this).GetComponentInParent<ProjectileHit>();
_attack = ((Component)_projectileHit).GetComponent<SpawnedAttack>();
_spawner = _attack.spawner;
_opponents = PlayerManager.instance.players.Where((Player p) => p.teamID != _spawner.teamID).ToArray();
}
private void Update()
{
//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_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0108: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
if (!((Object)(object)_projectileHit == (Object)null))
{
BrandHandler componentInParent = ((Component)((Component)this).transform).GetComponentInParent<BrandHandler>();
Player[] array = (from p in _opponents
where !p.data.dead
where ((Component)p).GetComponent<BrandHandler>().IsBrandedBy(_spawner)
where Vector2.Distance(Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)p).transform.position)) <= 3f
select p).ToArray();
if (array.Length != 0)
{
GameObject val = Object.Instantiate<GameObject>(_objectToSpawn, ((Component)this).transform.position, Quaternion.identity);
_attack.CopySpawnedAttackTo(val);
ProjectileHit projectileHit = _projectileHit;
HitInfo val2 = new HitInfo
{
transform = ((Component)array[0]).transform,
point = Vector2.op_Implicit(((Component)this).transform.position)
};
Vector3 val3 = ((Component)array[0]).transform.position - ((Component)this).transform.position;
val2.normal = Vector2.op_Implicit(((Vector3)(ref val3)).normalized);
((RayHit)projectileHit).Hit(val2, false);
}
}
}
}
public class BorrowedTimeAttachment : MonoBehaviour
{
private readonly float _reloadTimeMultiplier = 0.58823526f;
private readonly float _blockCooldownMultiplier = 0.5f;
private float _updateCooldown = 0f;
private bool _isActive;
private Player _player;
private CharacterData _data;
private GunAmmo _ammo;
private void Start()
{
_player = ((Component)this).GetComponentInParent<Player>();
_data = ((Component)this).GetComponentInParent<CharacterData>();
HealthHandler healthHandler = _data.healthHandler;
healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(Stop));
_ammo = ((Component)_data.weaponHandler.gun).GetComponentInChildren<GunAmmo>();
}
private void OnDestroy()
{
HealthHandler healthHandler = _data.healthHandler;
healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(Stop));
}
private void PlayerBranded(Player player)
{
Activate();
}
private void Update()
{
_updateCooldown -= Time.deltaTime;
if (!(_updateCooldown > 0f))
{
bool flag = (from p in PlayerManager.instance.players
where !p.data.dead
where p.teamID != _player.teamID
select p).Any((Player p) => ((Component)p).GetComponent<BrandHandler>().IsBrandedBy(_player));
if (!_isActive && flag)
{
Activate();
}
if (_isActive && !flag)
{
Stop();
}
_updateCooldown = 0.1f;
}
}
private void Activate()
{
if (!_isActive)
{
_isActive = true;
GunAmmo ammo = _ammo;
ammo.reloadTimeMultiplier *= _reloadTimeMultiplier;
float num = (float)ExtensionMethods.GetFieldValue((object)_ammo, "reloadCounter");
ExtensionMethods.SetFieldValue((object)_ammo, "reloadCounter", (object)(num * _reloadTimeMultiplier));
Block block = _data.block;
block.cdMultiplier *= _blockCooldownMultiplier;
Block block2 = _data.block;
block2.counter *= _blockCooldownMultiplier;
}
}
private void Stop()
{
if (_isActive)
{
_isActive = false;
GunAmmo ammo = _ammo;
ammo.reloadTimeMultiplier /= _reloadTimeMultiplier;
float num = (float)ExtensionMethods.GetFieldValue((object)_ammo, "reloadCounter");
ExtensionMethods.SetFieldValue((object)_ammo, "reloadCounter", (object)(num / _reloadTimeMultiplier));
Block block = _data.block;
block.cdMultiplier /= _blockCooldownMultiplier;
Block block2 = _data.block;
block2.counter /= _blockCooldownMultiplier;
}
}
}
public class BrandingProjectileAttachment : MonoBehaviour
{
private readonly float _range = 6f;
private Player _spawner;
private void Start()
{
_spawner = ((Component)this).GetComponentInParent<SpawnedAttack>().spawner;
BrandNearby();
}
private void BrandNearby()
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
Vector3 point = ((Component)this).transform.position;
List<Player> list = (from p in PlayerManager.instance.players
where p.teamID != _spawner.teamID
where !p.data.dead
where !p.data.block.IsBlocking()
where PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(point), p).canSee
where Vector2.Distance(Vector2.op_Implicit(point), Vector2.op_Implicit(((Component)p).transform.position)) <= _range
select p).ToList();
foreach (Player item in list)
{
((Component)((Component)item).transform).GetComponent<BrandHandler>().Brand(_spawner);
}
}
}
public class BrandingProjectileHit : RayHitEffect
{
private bool _done;
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
Player spawner = ((Component)this).GetComponentInParent<SpawnedAttack>().spawner;
Transform transform = hit.transform;
Player val = ((transform != null) ? ((Component)transform).GetComponentInParent<Player>() : null);
if (_done || !Object.op_Implicit((Object)(object)val) || val.teamID == spawner.teamID)
{
return (HasToReturn)1;
}
((Component)((Component)val).transform).GetComponent<BrandHandler>().Brand(spawner);
_done = true;
return (HasToReturn)1;
}
}
public class CodependentAttachment : MonoBehaviour
{
private Player _player;
private Gun _gun;
private GunAmmo _gunAmmo;
private void Start()
{
_player = ((Component)this).GetComponent<Player>();
_gun = _player.data.weaponHandler.gun;
_gunAmmo = ((Component)_gun).GetComponentInChildren<GunAmmo>();
Gun gun = _gun;
gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, new Action<GameObject>(OnShoot));
}
private void OnDestroy()
{
Gun gun = _gun;
gun.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(gun.ShootPojectileAction, new Action<GameObject>(OnShoot));
}
private void OnShoot(GameObject projectile)
{
if ((from p in PlayerManager.instance.players
where !p.data.dead
where p.teamID != _player.teamID
select p).Any((Player p) => ((Component)p).GetComponent<BrandHandler>().IsBrandedBy(_player)))
{
ReloadAmmo();
}
}
private void ReloadAmmo()
{
int num = (int)ExtensionMethods.GetFieldValue((object)_gunAmmo, "currentAmmo");
_gun.isReloading = false;
ExtensionMethods.SetFieldValue((object)_gunAmmo, "currentAmmo", (object)(num + 1));
ExtensionMethods.InvokeMethod((object)_gunAmmo, "SoundStopReloadInProgress", Array.Empty<object>());
ExtensionMethods.InvokeMethod((object)_gunAmmo, "SetActiveBullets", new object[1] { false });
}
}
public class HighNoonAttachment : MonoBehaviour
{
[SerializeField]
private SoundEvent _soundActivate = null;
private bool _isActive;
private float _activeDuration;
private WeaponHandler _wh;
private Player _player;
private CharacterStatModifiers _stats;
private GameObject _lineEffectPrefab;
private List<LineEffect> _lineEffects = new List<LineEffect>();
private void Start()
{
_soundActivate.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
_wh = ((Component)this).GetComponentInParent<WeaponHandler>();
_player = ((Component)this).GetComponentInParent<Player>();
_stats = ((Component)this).GetComponentInParent<CharacterStatModifiers>();
_lineEffectPrefab = ((Component)((Component)this).transform.Find("LineEffect")).gameObject;
CharacterStatModifiers stats = _stats;
stats.OnReloadDoneAction = (Action<int>)Delegate.Combine(stats.OnReloadDoneAction, new Action<int>(OnReloadDone));
CharacterStatModifiers stats2 = _stats;
stats2.OutOfAmmpAction = (Action<int>)Delegate.Combine(stats2.OutOfAmmpAction, new Action<int>(OnReloadStarted));
}
private void OnDestroy()
{
CharacterStatModifiers stats = _stats;
stats.OnReloadDoneAction = (Action<int>)Delegate.Remove(stats.OnReloadDoneAction, new Action<int>(OnReloadDone));
}
private void OnReloadDone(int bullets)
{
int shots = Mathf.Min(_stats.GetAdditionalData().ShotsAfterReload, Mathf.CeilToInt((float)bullets / (float)_wh.gun.numberOfProjectiles));
((MonoBehaviour)this).StartCoroutine(Shoot(shots));
}
private void OnReloadStarted(int bullets)
{
_isActive = true;
List<Player> list = (from p in PlayerManager.instance.players
where !p.data.dead
where p.teamID != _player.teamID
where !p.data.block.IsBlocking()
where PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), p).canSee
select p).ToList();
foreach (Player item in list)
{
((Component)item).GetComponent<BrandHandler>().Brand(_player);
GameObject val = Object.Instantiate<GameObject>(_lineEffectPrefab, ((Component)this).transform);
LineEffect component = val.GetComponent<LineEffect>();
_lineEffects.Add(component);
component.Play(((Component)this).transform, ((Component)item).transform, 0f);
SoundManager.Instance.PlayAtPosition(_soundActivate, SoundManager.Instance.GetTransform(), ((Component)item).transform);
}
if (list.Count > 0)
{
_isActive = true;
_activeDuration = 0.2f;
}
}
private void Update()
{
if (!_isActive)
{
return;
}
_activeDuration -= Time.deltaTime;
if (!(_activeDuration <= 0f))
{
return;
}
foreach (LineEffect lineEffect in _lineEffects)
{
lineEffect.Stop();
Object.Destroy((Object)(object)((Component)lineEffect).gameObject);
}
_lineEffects.Clear();
_isActive = false;
}
private IEnumerator Shoot(int shots)
{
IEnumerable<Player> opponents = PlayerManager.instance.players.Where((Player p) => p.teamID != _player.teamID);
for (int i = 0; i < shots; i++)
{
yield return (object)new WaitForSeconds(0.1f);
if (_wh.gun.isReloading)
{
break;
}
List<Player> visibleBrandedOpponents = (from p in opponents
where !p.data.dead
where ((Component)((Component)p).transform).GetComponent<BrandHandler>().IsBrandedBy(_player)
where PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), p).canSee
select p).ToList();
if (visibleBrandedOpponents.Count == 0)
{
break;
}
Player target = visibleBrandedOpponents[Random.Range(0, visibleBrandedOpponents.Count)];
Vector3 targetPos = ((Component)target).transform.position;
Vector3 myPos = ((Component)this).transform.position;
Vector3 compensation = (float)ExtensionMethods.InvokeMethod((object)_wh.gun, "GetRangeCompensation", new object[1] { Vector3.Distance(targetPos, myPos) }) * Vector3.up;
ExtensionMethods.SetFieldValue((object)_wh.gun, "forceShootDir", (object)(compensation + targetPos - myPos));
bool didShoot = ((Weapon)_wh.gun).Attack(0f, true, 1f, 1f, true);
ExtensionMethods.SetFieldValue((object)_wh.gun, "forceShootDir", (object)Vector3.zero);
if (!didShoot)
{
break;
}
}
}
}
public class LifelineAttachment : MonoBehaviour
{
private GameObject _giveEffectTemplate;
private List<GameObject> _giveEffects;
private CharacterData _data;
private float _cooldown = 0f;
private List<Player> _currentTargets = new List<Player>();
[SerializeField]
private SoundEvent _soundHeal = null;
private void Start()
{
_data = ((Component)this).GetComponentInParent<CharacterData>();
_soundHeal.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
_giveEffectTemplate = ((Component)((Component)this).transform.Find("Give")).gameObject;
_giveEffects = new List<GameObject> { _giveEffectTemplate };
}
private void Update()
{
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
_cooldown -= Time.deltaTime;
if (_cooldown > 0f || _data.stats.lifeSteal == 0f)
{
return;
}
_currentTargets = PlayerManager.instance.players.FindAll((Player p) => !p.data.dead).FindAll((Player p) => p.teamID != _data.player.teamID).FindAll((Player p) => ((Component)p).GetComponent<BrandHandler>().IsBrandedBy(_data.player));
if (_giveEffects.Count < _currentTargets.Count)
{
AddGiveEffects(_currentTargets.Count - _giveEffects.Count);
}
else if (_giveEffects.Count > _currentTargets.Count)
{
RemoveGiveEffects(Math.Min(_giveEffects.Count - 1, _giveEffects.Count - _currentTargets.Count));
}
for (int i = 0; i < _currentTargets.Count; i++)
{
_giveEffects[i].transform.position = ((Component)_currentTargets[i]).transform.position;
}
if (_currentTargets.Count > 0)
{
SoundManager.Instance.PlayAtPosition(_soundHeal, SoundManager.Instance.GetTransform(), ((Component)this).transform);
ParticleSystem[] componentsInChildren = ((Component)this).GetComponentsInChildren<ParticleSystem>();
foreach (ParticleSystem val in componentsInChildren)
{
val.Play();
}
}
_cooldown = 0.2f;
}
private void LateUpdate()
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < _currentTargets.Count; i++)
{
_giveEffects[i].transform.position = ((Component)_currentTargets[i]).transform.position;
}
}
private void AddGiveEffects(int count)
{
for (int i = 0; i < count; i++)
{
_giveEffects.Add(Object.Instantiate<GameObject>(_giveEffectTemplate, ((Component)this).transform));
}
}
private void RemoveGiveEffects(int count)
{
for (int i = 0; i < count; i++)
{
Object.Destroy((Object)(object)_giveEffects[_giveEffects.Count - 1]);
_giveEffects.RemoveAt(_giveEffects.Count - 1);
}
}
}
public class LoadedQuestionAttachment : MonoBehaviour
{
private CharacterData _data;
private GunAmmo _ammo;
private int _activeDuration;
private bool _isParticleSystemActive;
private GameObject _effectPrefab;
private Transform _particleTransform;
private ParticleSystem[] _particleSystems;
[SerializeField]
private SoundEvent _soundActivate = null;
private void Awake()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
_effectPrefab = (GameObject)CinnamonFlavour.CustomResources["E_LoadedQuestion"];
_soundActivate.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
}
private void Start()
{
_particleTransform = ((Component)this).transform.GetChild(0);
_particleSystems = ((Component)this).GetComponentsInChildren<ParticleSystem>();
_data = ((Component)this).GetComponentInParent<CharacterData>();
_ammo = ((Component)_data.weaponHandler.gun).GetComponentInChildren<GunAmmo>();
HealthHandler healthHandler = _data.healthHandler;
healthHandler.reviveAction = (Action)Delegate.Combine(healthHandler.reviveAction, new Action(Reset));
Gun gun = _data.weaponHandler.gun;
gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, new Action<GameObject>(Attack));
}
private void OnDestroy()
{
HealthHandler healthHandler = _data.healthHandler;
healthHandler.reviveAction = (Action)Delegate.Remove(healthHandler.reviveAction, new Action(Reset));
Gun gun = _data.weaponHandler.gun;
gun.ShootPojectileAction = (Action<GameObject>)Delegate.Remove(gun.ShootPojectileAction, new Action<GameObject>(Attack));
}
private void Reset()
{
_activeDuration = 0;
}
private void Update()
{
//IL_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_00c9: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)_data))
{
return;
}
Gun gun = _data.weaponHandler.gun;
int numberOfProjectiles = gun.numberOfProjectiles;
int num = (int)ExtensionMethods.GetFieldValue((object)_ammo, "currentAmmo");
bool flag = num <= numberOfProjectiles && !gun.isReloading;
if (flag && _activeDuration == 0)
{
_activeDuration = numberOfProjectiles;
}
if (!flag && _activeDuration > 0)
{
_activeDuration = 0;
}
if (_activeDuration > 0)
{
_particleTransform.position = ((Component)gun).transform.position;
_particleTransform.rotation = ((Component)gun).transform.rotation;
}
if (_activeDuration > 0 && !_isParticleSystemActive)
{
SoundManager.Instance.PlayAtPosition(_soundActivate, SoundManager.Instance.GetTransform(), ((Component)this).transform);
ParticleSystem[] particleSystems = _particleSystems;
foreach (ParticleSystem val in particleSystems)
{
val.Play();
}
_isParticleSystemActive = true;
}
if (_activeDuration == 0 && _isParticleSystemActive)
{
ParticleSystem[] particleSystems2 = _particleSystems;
foreach (ParticleSystem val2 in particleSystems2)
{
val2.Stop();
}
_isParticleSystemActive = false;
}
}
private void Attack(GameObject projectile)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: 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)
SpawnedAttack component = projectile.GetComponent<SpawnedAttack>();
if (Object.op_Implicit((Object)(object)component) && _activeDuration > 0)
{
component.SetColor(Color32.op_Implicit(new Color32((byte)100, (byte)0, (byte)0, byte.MaxValue)));
Object.Instantiate<GameObject>(_effectPrefab, projectile.transform.position, projectile.transform.rotation, projectile.transform);
_activeDuration--;
}
}
}
public class LoadedQuestionProjectileHit : RayHitEffect
{
[SerializeField]
private SoundEvent _hitSound = null;
private bool _done;
private GameObject _lineEffectPrefab;
private void Start()
{
_hitSound.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
_lineEffectPrefab = ((Component)((Component)this).transform.Find("LineEffect")).gameObject;
}
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_013f: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Unknown result type (might be due to invalid IL or missing references)
if (_done || !Object.op_Implicit((Object)(object)hit.transform))
{
return (HasToReturn)1;
}
Vector2 point = hit.point + hit.normal * 0.1f;
Player brander = ((Component)this).GetComponentInParent<SpawnedAttack>().spawner;
List<Player> list = (from p in PlayerManager.instance.players
where p.teamID != brander.teamID
where !p.data.dead
where !p.data.block.IsBlocking()
where PlayerManager.instance.CanSeePlayer(point, p).canSee
select p).ToList();
foreach (Player item in list)
{
((Component)((Component)item).transform).GetComponent<BrandHandler>().Brand(brander);
SoundManager.Instance.PlayAtPosition(_hitSound, SoundManager.Instance.GetTransform(), ((Component)item).transform);
LineEffect lineEffect = Object.Instantiate<GameObject>(_lineEffectPrefab, Vector2.op_Implicit(point), Quaternion.identity).GetComponent<LineEffect>();
lineEffect.Play(((Component)item).transform, ((Component)this).transform.position, 0f);
ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)Unbound.Instance, 0.2f, (Action)delegate
{
Object.Destroy((Object)(object)((Component)lineEffect).gameObject);
});
}
_done = true;
return (HasToReturn)1;
}
}
public class MenaceAttachment : MonoBehaviour
{
private readonly float _range = 6f;
[SerializeField]
private SoundEvent _soundActivate = null;
private float _cooldown = 0f;
private LineEffect _circleLineEffect;
private PlayLineAnimation _circlePlayLineAnimation;
private GameObject _lineEffectTemplate;
private List<GameObject> _lineEffects = new List<GameObject>();
private void Awake()
{
_soundActivate.variables.audioMixerGroup = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
_lineEffectTemplate = ((Component)((Component)this).transform.Find("LineEffect")).gameObject;
_circleLineEffect = ((Component)((Component)this).transform.Find("Circle")).GetComponent<LineEffect>();
_circlePlayLineAnimation = ((Component)((Component)this).transform.Find("Circle")).GetComponent<PlayLineAnimation>();
}
public void Update()
{
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
_cooldown -= Time.deltaTime;
if (_cooldown > 0f)
{
return;
}
foreach (GameObject lineEffect in _lineEffects)
{
Object.Destroy((Object)(object)lineEffect);
}
_lineEffects.Clear();
float range = _range * ((Component)this).transform.localScale.x;
_circleLineEffect.radius = range * 0.75f;
Player brander = ((Component)((Component)this).transform).GetComponentInParent<Player>();
IEnumerable<Player> enumerable = from p in PlayerManager.instance.players
where p.teamID != brander.teamID
where !p.data.dead
where Vector2.Distance(Vector2.op_Implicit(((Component)brander).transform.position), Vector2.op_Implicit(((Component)p).transform.position)) <= range
where !((Component)p).GetComponent<BrandHandler>().IsBrandedBy(brander)
where PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)brander).transform.position), p).canSee
select p;
foreach (Player item in enumerable)
{
((Component)((Component)item).transform).GetComponent<BrandHandler>().Brand(brander);
_lineEffectTemplate.SetActive(false);
GameObject val = Object.Instantiate<GameObject>(_lineEffectTemplate, ((Component)this).transform);
val.GetComponent<LineEffect>().Play(((Component)this).transform, ((Component)item).transform, 0f);
_lineEffects.Add(val);
}
if (_lineEffects.Count > 0)
{
SoundManager.Instance.PlayAtPosition(_soundActivate, SoundManager.Instance.GetTransform(), ((Component)this).transform);
}
if (enumerable.Any())
{
_circlePlayLineAnimation.PlayWidth();
_circlePlayLineAnimation.PlayOffset();
}
_cooldown = 0.2f;
}
}
public class PressureAttachment : MonoBehaviour
{
private readonly float _hpMultiplier = 3f;
private readonly float _speedMultiplier = 1.5f;
private readonly float _jumpMultiplier = 1.25f;
private float _updateCooldown = 0f;
private bool _isActive;
private Player _player;
private CharacterData _data;
[SerializeField]
private UnityEvent _startEvent = null;
[SerializeField]
private UnityEvent _endEvent = null;
private void Start()
{
_player = ((Component)this).GetComponentInParent<Player>();
_data = ((Component)this).GetComponentInParent<CharacterData>();
}
private void Update()
{
_updateCooldown -= Time.deltaTime;
if (!(_updateCooldown > 0f))
{
bool flag = (from p in PlayerManager.instance.players
where !p.data.dead
where p.teamID != _player.teamID
select p).Any((Player p) => ((Component)p).GetComponent<BrandHandler>().IsBrandedBy(_player));
if (!_isActive && flag)
{
Activate();
}
if (_isActive && !flag)
{
Stop();
}
_updateCooldown = 0.1f;
}
}
private void Activate()
{
if (!_isActive)
{
_isActive = true;
CharacterStatModifiers stats = _data.stats;
stats.movementSpeed *= _speedMultiplier;
CharacterStatModifiers stats2 = _data.stats;
stats2.jump *= _jumpMultiplier;
CharacterData data = _data;
data.health *= _hpMultiplier;
CharacterData data2 = _data;
data2.maxHealth *= _hpMultiplier;
ExtensionMethods.InvokeMethod((object)_data.stats, "ConfigureMassAndSize", Array.Empty<object>());
_startEvent.Invoke();
}
}
public void Stop()
{
if (_isActive)
{
_isActive = false;
CharacterStatModifiers stats = _data.stats;
stats.movementSpeed /= _speedMultiplier;
CharacterStatModifiers stats2 = _data.stats;
stats2.jump /= _jumpMultiplier;
CharacterData data = _data;
data.health /= _hpMultiplier;
CharacterData data2 = _data;
data2.maxHealth /= _hpMultiplier;
ExtensionMethods.InvokeMethod((object)_data.stats, "ConfigureMassAndSize", Array.Empty<object>());
_endEvent.Invoke();
}
}
}
public class RiposteAttachment : MonoBehaviour
{
private WeaponHandler _wh;
private Player _player;
private CharacterStatModifiers _stats;
private void Start()
{
_wh = ((Component)this).GetComponentInParent<WeaponHandler>();
_player = ((Component)this).GetComponentInParent<Player>();
_stats = ((Component)this).GetComponentInParent<CharacterStatModifiers>();
Block block = _player.data.block;
block.BlockRechargeAction = (Action)Delegate.Combine(block.BlockRechargeAction, new Action(OnBlockRefreshed));
}
private void OnDestroy()
{
Block block = _player.data.block;
block.BlockRechargeAction = (Action)Delegate.Remove(block.BlockRechargeAction, new Action(OnBlockRefreshed));
}
private void OnBlockRefreshed()
{
((MonoBehaviour)this).StartCoroutine(Shoot(_stats.GetAdditionalData().ShotsAfterBlockRefresh));
}
private IEnumerator Shoot(int shots)
{
IEnumerable<Player> opponents = PlayerManager.instance.players.Where((Player p) => p.teamID != _player.teamID);
for (int i = 0; i < shots; i++)
{
yield return (object)new WaitForSeconds(0.1f);
if (_wh.gun.isReloading)
{
break;
}
List<Player> visibleBrandedOpponents = (from p in opponents
where !p.data.dead
where ((Component)((Component)p).transform).GetComponent<BrandHandler>().IsBrandedBy(_player)
where PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)this).transform.position), p).canSee
select p).ToList();
if (visibleBrandedOpponents.Count == 0)
{
break;
}
Player target = visibleBrandedOpponents[Random.Range(0, visibleBrandedOpponents.Count)];
Vector3 targetPos = ((Component)target).transform.position;
Vector3 myPos = ((Component)this).transform.position;
Vector3 compensation = (float)ExtensionMethods.InvokeMethod((object)_wh.gun, "GetRangeCompensation", new object[1] { Vector3.Distance(targetPos, myPos) }) * Vector3.up;
ExtensionMethods.SetFieldValue((object)_wh.gun, "forceShootDir", (object)(compensation + targetPos - myPos));
bool didShoot = ((Weapon)_wh.gun).Attack(0f, true, 1f, 1f, true);
ExtensionMethods.SetFieldValue((object)_wh.gun, "forceShootDir", (object)Vector3.zero);
if (!didShoot)
{
break;
}
}
}
public void BlockTrigger()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
float range = 8f * ((Component)this).transform.localScale.x;
Player brander = ((Component)((Component)this).transform).GetComponentInParent<Player>();
IEnumerable<Player> enumerable = from p in PlayerManager.instance.players
where p.teamID != brander.teamID
where Vector2.Distance(Vector2.op_Implicit(((Component)brander).transform.position), Vector2.op_Implicit(((Component)p).transform.position)) <= range
where PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)brander).transform.position), p).canSee
select p;
foreach (Player item in enumerable)
{
((Component)((Component)item).transform).GetComponent<BrandHandler>().Brand(brander);
}
}
}
[Card]
public sealed class AirBurst : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: 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_0029: Expected O, but got Unknown
//IL_0029: 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_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Expected O, but got Unknown
gun.objectsToSpawn = (ObjectsToSpawn[])(object)new ObjectsToSpawn[1]
{
new ObjectsToSpawn
{
AddToProjectile = (GameObject)CinnamonFlavour.CustomResources["A_AirBurst"],
direction = (Direction)2,
scaleStacks = false
}
};
gun.attackSpeed = 1.5f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
gun.GetAdditionalData().BrandChance += 0.2f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Air Burst";
}
protected override string GetDescription()
{
return "Your bullets explode near branded opponents";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[2]
{
Utils.CreateCardInfoStat("+20%", "Brand chance", CardInfoStatType.Positive, (SimpleAmount)2),
Utils.CreateCardInfoStat("-33%", "ATKSPD", CardInfoStatType.Negative, (SimpleAmount)6)
};
}
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;
}
}
[Card]
public sealed class BorrowedTime : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
GameObject val = new GameObject("A_BorrowedTime", new Type[1] { typeof(BorrowedTimeAttachment) });
val.transform.SetParent(((Component)player).transform);
characterStats.GetAdditionalData().BrandDuration -= 0.25f;
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
GameObject gameObject = ((Component)((Component)player).transform.Find("A_BorrowedTime")).gameObject;
if ((Object)(object)gameObject != (Object)null)
{
Object.Destroy((Object)(object)gameObject);
}
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Borrowed Time";
}
protected override string GetDescription()
{
return "+70% reload speed and -50% block cooldown while an opponent has your brand";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[1] { Utils.CreateCardInfoStat("-0.25s", "Brand duration", CardInfoStatType.Negative, (SimpleAmount)5) };
}
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;
}
}
public abstract class CinnamonFlavourCard : CustomCard
{
public override string GetModName()
{
return "Cinnamon Flavour";
}
private void Start()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
GameObject val = new GameObject("ModNameText");
RectTransform[] componentsInChildren = ((Component)this).GetComponentsInChildren<RectTransform>();
RectTransform val2 = ((IEnumerable<RectTransform>)componentsInChildren).FirstOrDefault((Func<RectTransform, bool>)((RectTransform obj) => ((Object)((Component)obj).gameObject).name == "EdgePart (2)"));
if ((Object)(object)val2 != (Object)null)
{
GameObject gameObject = ((Component)val2).gameObject;
val.gameObject.transform.SetParent(gameObject.transform);
TextMeshProUGUI val3 = val.gameObject.AddComponent<TextMeshProUGUI>();
((TMP_Text)val3).text = ((CustomCard)this).GetModName().Replace(" ", "\n");
((TMP_Text)val3).autoSizeTextContainer = true;
val.transform.localEulerAngles = new Vector3(0f, 0f, 135f);
val.transform.localScale = Vector3.one;
val.transform.localPosition = new Vector3(-75f, -75f, 0f);
((TMP_Text)val3).alignment = (TextAlignmentOptions)1026;
((TMP_Text)val3).alpha = 0.1f;
((TMP_Text)val3).fontSize = 54f;
}
}
}
[Card]
public sealed class Codependent : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
gun.attackSpeed = 2f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
ExtensionMethods.GetOrAddComponent<CodependentAttachment>(((Component)player).gameObject, false);
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
CodependentAttachment component = ((Component)player).gameObject.GetComponent<CodependentAttachment>();
if ((Object)(object)component != (Object)null)
{
Object.Destroy((Object)(object)component);
}
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Codependent";
}
protected override string GetDescription()
{
return "Don't consume ammo while an opponent has your brand";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[1] { Utils.CreateCardInfoStat("-50%", "ATKSPD", CardInfoStatType.Negative, (SimpleAmount)3) };
}
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;
}
}
[Card]
public sealed class EarTags : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
characterStats.GetAdditionalData().BrandDuration += 10f;
characterStats.GetAdditionalData().BrandDamageMultiplier = 0f;
gun.GetAdditionalData().BrandChance += 0.2f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Ear Tags";
}
protected override string GetDescription()
{
return "Your brands deal no damage";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[2]
{
Utils.CreateCardInfoStat("+10s", "Brand duration", CardInfoStatType.Positive, (SimpleAmount)4),
Utils.CreateCardInfoStat("+20%", "Brand chance", CardInfoStatType.Positive, (SimpleAmount)2)
};
}
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;
}
}
[Card]
public sealed class Enmity : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
gun.attackSpeed = 0.8f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
gun.GetAdditionalData().BrandChance += 0.2f;
characterStats.GetAdditionalData().BrandDamageMultiplier *= 1.5f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Enmity";
}
protected override string GetDescription()
{
return "";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[3]
{
Utils.CreateCardInfoStat("+50%", "Brand DMG", CardInfoStatType.Positive, (SimpleAmount)2),
Utils.CreateCardInfoStat("+20%", "Chance to brand", CardInfoStatType.Positive, (SimpleAmount)1),
Utils.CreateCardInfoStat("+25%", "ATKSPD", CardInfoStatType.Positive, (SimpleAmount)2)
};
}
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;
}
}
[Card]
public sealed class HighNoon : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
statModifiers.AddObjectToPlayer = (GameObject)CinnamonFlavour.CustomResources["A_HighNoon"];
statModifiers.automaticReload = false;
gun.reloadTimeAdd = 0.5f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
characterStats.GetAdditionalData().ShotsAfterReload++;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "High Noon";
}
protected override string GetDescription()
{
return "Brand visible opponents on reload start. Shoot at a branded opponent after reloading.\n<nobr>Disables continuous reloading.</nobr></size>";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[1] { Utils.CreateCardInfoStat("+0.5s", "Reload time", CardInfoStatType.Negative, (SimpleAmount)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)0;
}
}
[Card]
public sealed class HotIron : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
gun.GetAdditionalData().BrandChance += 0.2f;
characterStats.GetAdditionalData().BrandDuration += 1f;
characterStats.GetAdditionalData().BrandDamageMultiplier *= 1.25f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Hot Iron";
}
protected override string GetDescription()
{
return "";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[3]
{
Utils.CreateCardInfoStat("+20%", "Chance to brand", CardInfoStatType.Positive, (SimpleAmount)3),
Utils.CreateCardInfoStat("+1s", "Brand duration", CardInfoStatType.Positive, (SimpleAmount)2),
Utils.CreateCardInfoStat("+25%", "Brand DMG", CardInfoStatType.Positive, (SimpleAmount)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;
}
}
[Card]
public sealed class Lifeline : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
statModifiers.AddObjectToPlayer = (GameObject)CinnamonFlavour.CustomResources["A_Lifeline"];
statModifiers.lifeSteal = 0.3f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
characterStats.GetAdditionalData().EnableBrandLifeSteal = true;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Lifeline";
}
protected override string GetDescription()
{
return "Steal hp from branded opponents";
}
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)2;
}
protected override CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[1] { Utils.CreateCardInfoStat("+30%", "Life steal", CardInfoStatType.Positive, (SimpleAmount)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;
}
}
[Card]
public sealed class LoadedQuestion : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
statModifiers.AddObjectToPlayer = (GameObject)CinnamonFlavour.CustomResources["A_LoadedQuestion"];
statModifiers.automaticReload = false;
gun.reloadTimeAdd = 0.25f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Loaded Question";
}
protected override string GetDescription()
{
return "Your last shot brands visible opponents.\nDisables continuous reloading.";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[1] { Utils.CreateCardInfoStat("+0.25s", "Reload time", CardInfoStatType.Negative, (SimpleAmount)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)0;
}
}
[Card]
public sealed class Menace : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
statModifiers.AddObjectToPlayer = (GameObject)CinnamonFlavour.CustomResources["A_Menace"];
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Menace";
}
protected override string GetDescription()
{
return "Brand nearby opponents";
}
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)2;
}
protected override CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[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)0;
}
}
[Card]
public sealed class ModernTools : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
gun.reloadTime = 0.75f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
gun.GetAdditionalData().BrandChance += 0.2f;
characterStats.GetAdditionalData().BrandDuration += 1f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Modern Tools";
}
protected override string GetDescription()
{
return "";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[3]
{
Utils.CreateCardInfoStat("+20%", "Chance to brand", CardInfoStatType.Positive, (SimpleAmount)3),
Utils.CreateCardInfoStat("+1s", "Brand duration", CardInfoStatType.Positive, (SimpleAmount)2),
Utils.CreateCardInfoStat("-25%", "Reload time", CardInfoStatType.Positive, (SimpleAmount)5)
};
}
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;
}
}
[Card]
public sealed class OSHA : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
block.cdMultiplier = 0.75f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
gun.GetAdditionalData().BrandChance += 0.2f;
characterStats.GetAdditionalData().BrandDuration += 2f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "OSHA";
}
protected override string GetDescription()
{
return "";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[3]
{
Utils.CreateCardInfoStat("+20%", "Chance to brand", CardInfoStatType.Positive, (SimpleAmount)3),
Utils.CreateCardInfoStat("+2s", "Brand duration", CardInfoStatType.Positive, (SimpleAmount)3),
Utils.CreateCardInfoStat("-25%", "Block cooldown", CardInfoStatType.Positive, (SimpleAmount)5)
};
}
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;
}
}
[Card]
public sealed class Pressure : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
statModifiers.AddObjectToPlayer = (GameObject)CinnamonFlavour.CustomResources["A_Pressure"];
statModifiers.lifeSteal = 0.3f;
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Pressure";
}
protected override string GetDescription()
{
return "+200% HP and +50% movement speed while an opponent has your brand";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[1] { Utils.CreateCardInfoStat("+30%", "Life steal", CardInfoStatType.Positive, (SimpleAmount)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;
}
}
[Card]
public sealed class Riposte : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Expected O, but got Unknown
statModifiers.AddObjectToPlayer = (GameObject)CinnamonFlavour.CustomResources["A_Riposte"];
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
ExtensionMethods.GetOrAddComponent<RiposteAttachment>(((Component)player).gameObject, false);
characterStats.GetAdditionalData().ShotsAfterBlockRefresh++;
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
Object.Destroy((Object)(object)((Component)player).gameObject.GetComponent<RiposteAttachment>());
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Riposte";
}
protected override string GetDescription()
{
return "Brand nearby enemies when you block. Shoot at a branded opponent on block refresh.";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[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)0;
}
}
[Card]
public sealed class Scarring : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
characterStats.GetAdditionalData().BrandDurationMultiplier *= 2f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Scarring";
}
protected override string GetDescription()
{
return "";
}
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)2;
}
protected override CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[1] { Utils.CreateCardInfoStat("+100%", "Brand duration", CardInfoStatType.Positive, (SimpleAmount)4) };
}
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;
}
}
[Card]
public sealed class ThermalDetonation : CinnamonFlavourCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Expected O, but got Unknown
GameObject effect = (GameObject)CinnamonFlavour.CustomResources["A_BrandExplosion"];
BrandObjectsToSpawn brandObjectsToSpawn = characterStats.GetAdditionalData().BrandObjectsToSpawn.FirstOrDefault((BrandObjectsToSpawn x) => ((Object)x.Effect).name == ((Object)effect).name);
if (brandObjectsToSpawn == null)
{
characterStats.GetAdditionalData().BrandObjectsToSpawn.Add(new BrandObjectsToSpawn
{
Effect = effect,
Trigger = BrandObjectsToSpawn.SpawnTrigger.Expire,
ScaleStacks = true,
ScaleStackMultiplier = 2f,
ScaleFromBrandDamage = 1.25f
});
}
else
{
brandObjectsToSpawn.Stacks++;
}
characterStats.GetAdditionalData().BrandDurationMultiplier *= 0.5f;
characterStats.GetAdditionalData().BrandDamageMultiplier *= 0.75f;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
return new GameObject();
}
protected override string GetTitle()
{
return "Thermal Detonation";
}
protected override string GetDescription()
{
return "Your brands explode when they expire";
}
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 CardInfoStat[] GetStats()
{
return (CardInfoStat[])(object)new CardInfoStat[2]
{
Utils.CreateCardInfoStat("-50%", "Brand duration", CardInfoStatType.Negative, (SimpleAmount)7),
Utils.CreateCardInfoStat("-25%", "Brand DMG", CardInfoStatType.Negative, (SimpleAmount)6)
};
}
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;
}
}
[BepInPlugin("io.olavim.rounds.cinnamonflavour", "CinnamonFlavour", "0.6.0")]
public sealed class CinnamonFlavour : BaseUnityPlugin
{
public const string ModId = "io.olavim.rounds.cinnamonflavour";
public const string ModName = "CinnamonFlavour";
public const string ModVersion = "0.6.0";
internal static Dictionary<string, object> RoundsResources { get; } = new Dictionary<string, object>();
internal static Dictionary<string, object> CustomResources { get; } = new Dictionary<string, object>();
private static AssetBundle LoadAssetBundle(string name)
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
using Stream stream = executingAssembly.GetManifestResourceStream("CinnamonFlavour.Assets." + name);
return AssetBundle.LoadFromStream(stream);
}
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
new Harmony("io.olavim.rounds.cinnamonflavour").PatchAll();
}
private void Start()
{
AssetBundle val = LoadAssetBundle("attachments");
AssetBundle val2 = LoadAssetBundle("sfx");
SoundEvent[] array = Resources.FindObjectsOfTypeAll<SoundEvent>();
foreach (SoundEvent val3 in array)
{
RoundsResources.TryAdd(((Object)val3).name, val3);
}
GameObject[] array2 = val.LoadAllAssets<GameObject>();
foreach (GameObject val4 in array2)
{
CustomResources.Add(((Object)val4).name, val4);
}
SoundEvent[] array3 = val2.LoadAllAssets<SoundEvent>();
foreach (SoundEvent val5 in array3)
{
CustomResources.Add(((Object)val5).name, val5);
}
foreach (Type item in from type in Assembly.GetExecutingAssembly().GetTypes()
where type.GetCustomAttribute<CardAttribute>() != null
select type)
{
AccessTools.Method(typeof(CustomCard), "BuildCard", (Type[])null, (Type[])null).MakeGenericMethod(item).Invoke(null, null);
}
}
}
[RequireComponent(typeof(SoundUnityEventPlayer))]
public class SFXVolumeFix : MonoBehaviour
{
private void Awake()
{
AudioMixerGroup group = SoundVolumeManager.Instance.audioMixer.FindMatchingGroups("SFX")[0];
SoundUnityEventPlayer component = ((Component)this).GetComponent<SoundUnityEventPlayer>();
SetAudioMixerGroup(component.soundStart, group);
SetAudioMixerGroup(component.soundStartLoop, group);
SetAudioMixerGroup(component.soundEnd, group);
}
private void SetAudioMixerGroup(SoundEvent soundEvent, AudioMixerGroup group)
{
if (Object.op_Implicit((Object)(object)soundEvent))
{
soundEvent.variables.audioMixerGroup = group;
}
}
}
public static class Utils
{
public static CardInfoStat CreateCardInfoStat(string amount, string stat, CardInfoStatType type, SimpleAmount simpleAmount = 0)
{
//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_000d: 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_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
return new CardInfoStat
{
amount = amount,
stat = stat,
simepleAmount = simpleAmount,
positive = (type == CardInfoStatType.Positive)
};
}
}
}
namespace CinnamonFlavour.Patches
{
[HarmonyPatch(typeof(DevConsole), "Send")]
internal class Debug_DevConsolePatch_Send
{
private static bool Prefix(string message)
{
if (message.StartsWith("/brand"))
{
string[] array = message.Split(new char[1] { ' ' });
int branderID = ((array.Length > 1) ? int.Parse(array[1]) : 0);
int targetID = ((array.Length > 2) ? int.Parse(array[2]) : 0);
float duration = ((array.Length > 3) ? float.Parse(array[3]) : 3600f);
Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == targetID);
if (!Object.op_Implicit((Object)(object)val))
{
Debug.Log((object)("Invalid target: " + targetID));
}
((Component)((Component)val).transform).GetComponent<BrandHandler>().Brand(branderID, duration);
return false;
}
if (message.StartsWith("/resetbrands"))
{
foreach (Player player in PlayerManager.instance.players)
{
((Component)((Component)player).transform).GetComponent<BrandHandler>().Reset();
}
return false;
}
return true;
}
}
[HarmonyPatch(typeof(LevelManager), "SpawnMap")]
internal class Debug_LevelManagerPatch_SpawnMap
{
private static bool Prefix(string message)
{
return !message.StartsWith("/brand") && !message.StartsWith("/resetbrands");
}
}
[HarmonyPatch(typeof(Gun), "ApplyProjectileStats")]
internal class GunPatch_ApplyProjectileStats
{
private static void Prefix(Gun __instance, GameObject obj, float randomSeed)
{
obj.GetComponent<ProjectileHit>().GetAdditionalData().WillBrand = randomSeed < __instance.GetAdditionalData().BrandChance;
}
}
[HarmonyPatch(typeof(Player), "FullReset")]
internal class PlayerPatch_FullReset
{
private static void Prefix(Player __instance)
{
((Component)((Component)__instance).transform).GetComponent<BrandHandler>()?.Reset();
}
}
[HarmonyPatch(typeof(Player), "Awake")]
internal class PlayerPatch_Awake
{
private static void Prefix(Player __instance)
{
((Component)__instance).gameObject.AddComponent<BrandHandler>();
}
}
[HarmonyPatch(typeof(ProjectileHit), "Start")]
internal class ProjectileHitPatch_Start
{
private static void Prefix(ProjectileHit __instance)
{
//IL_0023: 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)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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_0091: Expected O, but got Unknown
if (__instance.GetAdditionalData().WillBrand)
{
((Component)__instance).GetComponent<SpawnedAttack>().SetColor(Color32.op_Implicit(new Color32((byte)100, (byte)0, (byte)0, byte.MaxValue)));
ExtensionMethods.GetOrAddComponent<BrandingProjectileHit>(((Component)__instance).gameObject, false);
List<ObjectsToSpawn> list = __instance.objectsToSpawn.ToList();
list.Add(new ObjectsToSpawn
{
effect = (GameObject)CinnamonFlavour.CustomResources["A_BrandingProjectile"],
direction = (Direction)2,
normalOffset = 0.05f,
stickToAllTargets = true,
scaleStacks = false
});
__instance.objectsToSpawn = list.ToArray();
}
}
}
[HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")]
internal class ProjectileHitPatch_RPCADoHit
{
private static void Prefix(ProjectileHit __instance, int viewID, bool wasBlocked)
{
if (viewID != -1)
{
PhotonView photonView = PhotonNetwork.GetPhotonView(viewID);
BrandHandler component = ((Component)((Component)photonView).transform).GetComponent<BrandHandler>();
if (Object.op_Implicit((Object)(object)component) && component.IsBrandedBy(__instance.ownPlayer))
{
Gun component2 = __instance.ownWeapon.GetComponent<Gun>();
__instance.damage *= component2.GetAdditionalData().DamageToBranded;
}
}
}
}
}
namespace CinnamonFlavour.Extensions
{
public class CharacterStatModifiersAdditionalData
{
private float _brandDuration = 2f;
private float _brandDamageMultiplier = 1f;
public Action<Vector2, bool, Player> DealtDamageToPlayerAction = null;
public Action<Player> PlayerBrandedAction = null;
public int ShotsAfterReload { get; set; } = 0;
public int ShotsAfterBlockRefresh { get; set; } = 0;
public float BrandDuration
{
get
{
return Mathf.Max(0.25f, _brandDuration);
}
set
{
_brandDuration = value;
}
}
public float BrandDamageMultiplier
{
get
{
return Mathf.Max(0f, _brandDamageMultiplier);
}
set
{
_brandDamageMultiplier = value;
}
}
public float BrandDurationMultiplier { get; set; } = 1f;
public List<BrandObjectsToSpawn> BrandObjectsToSpawn { get; set; } = new List<BrandObjectsToSpawn>();
public bool EnableBrandLifeSteal { get; set; } = false;
}
public static class CharacterStatModifiersExtension
{
public static readonly ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData> data = new ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData>();
public static CharacterStatModifiersAdditionalData GetAdditionalData(this CharacterStatModifiers characterstats)
{
return data.GetOrCreateValue(characterstats);
}
}
[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
internal class CharacterStatModifiersPatch_ResetStats
{
private static void Prefix(CharacterStatModifiers __instance)
{
__instance.GetAdditionalData().ShotsAfterReload = 0;
__instance.GetAdditionalData().ShotsAfterBlockRefresh = 0;
__instance.GetAdditionalData().EnableBrandLifeSteal = false;
__instance.GetAdditionalData().BrandDuration = 1f;
__instance.GetAdditionalData().BrandDurationMultiplier = 1f;
__instance.GetAdditionalData().BrandDamageMultiplier = 1f;
__instance.GetAdditionalData().BrandObjectsToSpawn = new List<BrandObjectsToSpawn>();
__instance.GetAdditionalData().DealtDamageToPlayerAction = null;
__instance.GetAdditionalData().PlayerBrandedAction = null;
}
}
[HarmonyPatch(typeof(CharacterStatModifiers), "DealtDamage")]
internal class CharacterStatModifiersPatch_DealtDamage
{
private static void Postfix(CharacterStatModifiers __instance, Vector2 damage, bool selfDamage, Player damagedPlayer)
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)damagedPlayer != (Object)null)
{
__instance.GetAdditionalData().DealtDamageToPlayerAction?.Invoke(damage, selfDamage, damagedPlayer);
}
}
}
public class GunAdditionalData
{
private float _damageToBranded = 1f;
public float DamageToBranded
{
get
{
return Mathf.Max(0.25f, _damageToBranded);
}
set
{
_damageToBranded = value;
}
}
public float BrandChance { get; set; } = 0f;
}
public static class GunExtension
{
public static readonly ConditionalWeakTable<Gun, GunAdditionalData> data = new ConditionalWeakTable<Gun, GunAdditionalData>();
public static GunAdditionalData GetAdditionalData(this Gun gun)
{
return data.GetOrCreateValue(gun);
}
}
[HarmonyPatch(typeof(Gun), "ResetStats")]
internal class GunPatch_ResetStats
{
private static void Prefix(Gun __instance)
{
__instance.GetAdditionalData().BrandChance = 0f;
__instance.GetAdditionalData().DamageToBranded = 1f;
}
}
public class ProjectileHitAdditionalData
{
public bool WillBrand { get; set; } = false;
}
public static class ProjectileHitExtension
{
public static readonly ConditionalWeakTable<ProjectileHit, ProjectileHitAdditionalData> data = new ConditionalWeakTable<ProjectileHit, ProjectileHitAdditionalData>();
public static ProjectileHitAdditionalData GetAdditionalData(this ProjectileHit hit)
{
return data.GetOrCreateValue(hit);
}
}
}