using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using ClassesManagerReborn;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using Photon.Pun;
using Ported_FFC_Classic.Extensions;
using Ported_FFC_Classic.Monobehaviors;
using Ported_FFC_Classic.Utils;
using ToggleCardsCategories;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnityEngine;
using WeaponsManager;
[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.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: AssemblyVersion("0.0.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace Ported_FFC_Classic
{
public class CardHolder : MonoBehaviour
{
public List<GameObject> Cards;
public List<GameObject> HiddenCards;
public static Dictionary<string, CardInfo> cards = new Dictionary<string, CardInfo>();
internal void RegisterCards()
{
foreach (GameObject card in Cards)
{
CustomCard.RegisterUnityCard(card, "PFFCC", card.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null);
CustomCardCategories.instance.UpdateAndPullCategoriesFromCard(card.GetComponent<CardInfo>());
cards.Add(card.GetComponent<CardInfo>().cardName, card.GetComponent<CardInfo>());
}
foreach (GameObject hiddenCard in HiddenCards)
{
CustomCard.RegisterUnityCard(hiddenCard, "PFFCC", hiddenCard.GetComponent<CardInfo>().cardName, false, (Action<CardInfo>)null);
CustomCardCategories.instance.UpdateAndPullCategoriesFromCard(hiddenCard.GetComponent<CardInfo>());
Cards.instance.AddHiddenCard(hiddenCard.GetComponent<CardInfo>());
cards.Add(hiddenCard.GetComponent<CardInfo>().cardName, hiddenCard.GetComponent<CardInfo>());
}
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("root.port.fluxxfield.fluxxfieldscardsclassic", "Port of FFC - Classic", "4.5")]
[BepInProcess("Rounds.exe")]
public class PFFCC : BaseUnityPlugin
{
private const string ModId = "root.port.fluxxfield.fluxxfieldscardsclassic";
private const string ModName = "Port of FFC - Classic";
private const string Version = "4.5";
public const string ModInitials = "PFFCC";
internal static AssetBundle assets;
public static PFFCC instance { get; private set; }
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
Harmony val = new Harmony("root.port.fluxxfield.fluxxfieldscardsclassic");
val.PatchAll();
assets = AssetUtils.LoadAssetBundleFromResources("pffcart", typeof(PFFCC).Assembly);
if ((Object)(object)assets == (Object)null)
{
Debug.Log((object)"Failed to load PFFC asset bundle");
}
ToggleCardsCategoriesManager.instance.RegisterCategories("PFFCC");
assets.LoadAsset<GameObject>("CardHolder").GetComponent<CardHolder>().RegisterCards();
}
private void Start()
{
instance = this;
}
}
}
namespace Ported_FFC_Classic.Utils
{
public class PreventRecursion
{
private static GameObject _stopRecursion;
internal static GameObject stopRecursion
{
get
{
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Expected O, but got Unknown
if ((Object)(object)_stopRecursion != (Object)null)
{
return _stopRecursion;
}
_stopRecursion = new GameObject("StopRecursion", new Type[1] { typeof(StopRecursion) });
Object.DontDestroyOnLoad((Object)(object)_stopRecursion);
return _stopRecursion;
}
set
{
}
}
internal static ObjectsToSpawn stopRecursionObjectToSpawn
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
ObjectsToSpawn val = new ObjectsToSpawn();
val.AddToProjectile = stopRecursion;
return val;
}
set
{
}
}
}
public class DestroyOnUnparentAfterInitialized : MonoBehaviour
{
private static bool initialized;
private bool isOriginal = false;
private void Start()
{
if (initialized)
{
isOriginal = true;
}
}
private void LateUpdate()
{
if (!isOriginal && (Object)(object)((Component)this).gameObject.transform.parent == (Object)null)
{
Object.Destroy((Object)(object)((Component)this).gameObject);
}
}
}
public class SpawnBulletsEffect : MonoBehaviour
{
private float initialDelay = 1f;
private int numBullets = 1;
private int numShot = 0;
private Gun gunToShootFrom = null;
private List<Vector3> directionsToShoot = new List<Vector3>();
private List<Vector3> positionsToShootFrom = new List<Vector3>();
private float timeBetweenShots = 0f;
private float timeSinceLastShot;
private GameObject newWeaponsBase;
private Player player;
private void Awake()
{
player = ((Component)this).gameObject.GetComponent<Player>();
}
private void Start()
{
ResetTimer();
timeSinceLastShot += initialDelay;
}
private void Update()
{
if (numShot >= numBullets || (Object)(object)gunToShootFrom == (Object)null)
{
Object.Destroy((Object)(object)this);
}
else if (Time.time >= timeSinceLastShot + timeBetweenShots)
{
Shoot();
}
}
private void OnDisable()
{
Object.Destroy((Object)(object)this);
}
private void OnDestroy()
{
Object.Destroy((Object)(object)newWeaponsBase);
}
private void Shoot()
{
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_0080: 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_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_010a: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_017e: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: 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_019f: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
int num = (gunToShootFrom.lockGunToDefault ? 1 : (gunToShootFrom.numberOfProjectiles + Mathf.RoundToInt(gunToShootFrom.chargeNumberOfProjectilesTo * 0f)));
for (int i = 0; i < gunToShootFrom.projectiles.Length; i++)
{
for (int j = 0; j < num; j++)
{
Vector3 val = ((directionsToShoot.Count != 0) ? directionsToShoot[numShot % directionsToShoot.Count] : Vector3.down);
if (gunToShootFrom.spread != 0f)
{
float multiplySpread = gunToShootFrom.multiplySpread;
float num2 = Random.Range(0f - gunToShootFrom.spread, gunToShootFrom.spread);
num2 /= (1f + gunToShootFrom.projectileSpeed * 0.5f) * 0.5f;
val += Vector3.Cross(val, Vector3.forward) * num2 * multiplySpread;
}
if ((bool)typeof(Gun).InvokeMember("CheckIsMine", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, gunToShootFrom, new object[0]))
{
Vector3 val2 = ((positionsToShootFrom.Count != 0) ? positionsToShootFrom[numShot % positionsToShootFrom.Count] : Vector3.zero);
GameObject val3 = PhotonNetwork.Instantiate(((Object)gunToShootFrom.projectiles[i].objectToSpawn.gameObject).name, val2, Quaternion.LookRotation(val), (byte)0, (object[])null);
if (PhotonNetwork.OfflineMode)
{
RPCA_Shoot(val3.GetComponent<PhotonView>().ViewID, num, 1f, Random.Range(0f, 1f));
continue;
}
((Component)this).gameObject.GetComponent<PhotonView>().RPC("RPCA_Shoot", (RpcTarget)0, new object[4]
{
val3.GetComponent<PhotonView>().ViewID,
num,
1f,
Random.Range(0f, 1f)
});
}
}
}
ResetTimer();
}
[PunRPC]
private void RPCA_Shoot(int bulletViewID, int numProj, float dmgM, float seed)
{
GameObject gameObject = ((Component)PhotonView.Find(bulletViewID)).gameObject;
gunToShootFrom.BulletInit(gameObject, numProj, dmgM, seed, true);
numShot++;
}
public void SetGun(Gun gun)
{
//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_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Expected O, but got Unknown
newWeaponsBase = Object.Instantiate<GameObject>(((Component)((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>()).gameObject, new Vector3(500f, 500f, -100f), Quaternion.identity);
Object.DontDestroyOnLoad((Object)(object)newWeaponsBase);
foreach (Transform item in newWeaponsBase.transform)
{
Transform val = item;
if ((Object)(object)((Component)val).GetComponentInChildren<Renderer>() != (Object)null)
{
Renderer[] componentsInChildren = ((Component)val).GetComponentsInChildren<Renderer>();
foreach (Renderer val2 in componentsInChildren)
{
val2.enabled = false;
}
}
}
gunToShootFrom = newWeaponsBase.GetComponent<Gun>();
CopyGunStats(gun, gunToShootFrom);
}
public void SetNumBullets(int num)
{
numBullets = num;
}
public void SetPosition(Vector3 pos)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
positionsToShootFrom = new List<Vector3> { pos };
}
public void SetDirection(Vector3 dir)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
directionsToShoot = new List<Vector3> { dir };
}
public void SetPositions(List<Vector3> pos)
{
positionsToShootFrom = pos;
}
public void SetDirections(List<Vector3> dir)
{
directionsToShoot = dir;
}
public void SetTimeBetweenShots(float delay)
{
timeBetweenShots = delay;
}
public void SetInitialDelay(float delay)
{
initialDelay = delay;
}
private void ResetTimer()
{
timeSinceLastShot = Time.time;
}
public static void CopyGunStats(Gun copyFromGun, Gun copyToGun)
{
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_03fc: Unknown result type (might be due to invalid IL or missing references)
copyToGun.ammo = copyFromGun.ammo;
copyToGun.ammoReg = copyFromGun.ammoReg;
copyToGun.attackID = copyFromGun.attackID;
copyToGun.attackSpeed = copyFromGun.attackSpeed;
copyToGun.attackSpeedMultiplier = copyFromGun.attackSpeedMultiplier;
copyToGun.bodyRecoil = copyFromGun.bodyRecoil;
copyToGun.bulletDamageMultiplier = copyFromGun.bulletDamageMultiplier;
copyToGun.bulletPortal = copyFromGun.bulletPortal;
copyToGun.bursts = copyFromGun.bursts;
copyToGun.chargeDamageMultiplier = copyFromGun.chargeDamageMultiplier;
copyToGun.chargeEvenSpreadTo = copyFromGun.chargeEvenSpreadTo;
copyToGun.chargeNumberOfProjectilesTo = copyFromGun.chargeNumberOfProjectilesTo;
copyToGun.chargeRecoilTo = copyFromGun.chargeRecoilTo;
copyToGun.chargeSpeedTo = copyFromGun.chargeSpeedTo;
copyToGun.chargeSpreadTo = copyFromGun.chargeSpreadTo;
copyToGun.cos = copyFromGun.cos;
copyToGun.currentCharge = copyFromGun.currentCharge;
copyToGun.damage = copyFromGun.damage;
copyToGun.damageAfterDistanceMultiplier = copyFromGun.damageAfterDistanceMultiplier;
copyToGun.defaultCooldown = copyFromGun.defaultCooldown;
copyToGun.dmgMOnBounce = copyFromGun.dmgMOnBounce;
copyToGun.dontAllowAutoFire = copyFromGun.dontAllowAutoFire;
copyToGun.drag = copyFromGun.drag;
copyToGun.dragMinSpeed = copyFromGun.dragMinSpeed;
copyToGun.evenSpread = copyFromGun.evenSpread;
copyToGun.explodeNearEnemyDamage = copyFromGun.explodeNearEnemyDamage;
copyToGun.explodeNearEnemyRange = copyFromGun.explodeNearEnemyRange;
copyToGun.forceSpecificAttackSpeed = copyFromGun.forceSpecificAttackSpeed;
copyToGun.forceSpecificShake = copyFromGun.forceSpecificShake;
copyToGun.gravity = copyFromGun.gravity;
copyToGun.hitMovementMultiplier = copyFromGun.hitMovementMultiplier;
copyToGun.ignoreWalls = copyFromGun.ignoreWalls;
copyToGun.isProjectileGun = copyFromGun.isProjectileGun;
copyToGun.isReloading = copyFromGun.isReloading;
copyToGun.knockback = copyFromGun.knockback;
copyToGun.lockGunToDefault = copyFromGun.lockGunToDefault;
copyToGun.multiplySpread = copyFromGun.multiplySpread;
copyToGun.numberOfProjectiles = copyFromGun.numberOfProjectiles;
copyToGun.objectsToSpawn = copyFromGun.objectsToSpawn;
copyToGun.overheatMultiplier = copyFromGun.overheatMultiplier;
copyToGun.percentageDamage = copyFromGun.percentageDamage;
copyToGun.player = copyFromGun.player;
copyToGun.projectielSimulatonSpeed = copyFromGun.projectielSimulatonSpeed;
copyToGun.projectileColor = copyFromGun.projectileColor;
copyToGun.projectiles = copyFromGun.projectiles;
copyToGun.projectileSize = copyFromGun.projectileSize;
copyToGun.projectileSpeed = copyFromGun.projectileSpeed;
copyToGun.randomBounces = copyFromGun.randomBounces;
copyToGun.recoil = copyFromGun.recoil;
copyToGun.recoilMuiltiplier = copyFromGun.recoilMuiltiplier;
copyToGun.reflects = copyFromGun.reflects;
copyToGun.reloadTime = copyFromGun.reloadTime;
copyToGun.reloadTimeAdd = copyFromGun.reloadTimeAdd;
copyToGun.shake = copyFromGun.shake;
copyToGun.shakeM = copyFromGun.shakeM;
copyToGun.ShootPojectileAction = copyFromGun.ShootPojectileAction;
((Weapon)copyToGun).sinceAttack = ((Weapon)copyFromGun).sinceAttack;
copyToGun.size = copyFromGun.size;
copyToGun.slow = copyFromGun.slow;
copyToGun.smartBounce = copyFromGun.smartBounce;
copyToGun.spawnSkelletonSquare = copyFromGun.spawnSkelletonSquare;
copyToGun.speedMOnBounce = copyFromGun.speedMOnBounce;
copyToGun.spread = copyFromGun.spread;
copyToGun.teleport = copyFromGun.teleport;
copyToGun.timeBetweenBullets = copyFromGun.timeBetweenBullets;
copyToGun.timeToReachFullMovementMultiplier = copyFromGun.timeToReachFullMovementMultiplier;
copyToGun.unblockable = copyFromGun.unblockable;
copyToGun.useCharge = copyFromGun.useCharge;
copyToGun.waveMovement = copyFromGun.waveMovement;
Traverse.Create((object)copyToGun).Field("attackAction").SetValue((object)(Action)Traverse.Create((object)copyFromGun).Field("attackAction").GetValue());
Traverse.Create((object)copyToGun).Field("gunID").SetValue((object)(int)Traverse.Create((object)copyFromGun).Field("gunID").GetValue());
Traverse.Create((object)copyToGun).Field("spreadOfLastBullet").SetValue((object)(float)Traverse.Create((object)copyFromGun).Field("spreadOfLastBullet").GetValue());
Traverse.Create((object)copyToGun).Field("forceShootDir").SetValue((object)(Vector3)Traverse.Create((object)copyFromGun).Field("forceShootDir").GetValue());
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
}
namespace Ported_FFC_Classic.Patches
{
[Serializable]
[HarmonyPatch(typeof(ProjectileHit), "Hit")]
internal class ProjectileHitPatchHit
{
private static bool Prefix(ProjectileHit __instance, HitInfo hit, bool forceCall)
{
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: 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_00b3: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00c8: 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)
HealthHandler val = null;
if (Object.op_Implicit((Object)(object)hit.transform))
{
val = ((Component)hit.transform).GetComponent<HealthHandler>();
}
if (Object.op_Implicit((Object)(object)val))
{
Player component = ((Component)val).GetComponent<Player>();
if ((Object)(object)component != (Object)null && __instance.ownPlayer.teamID == component.teamID && __instance.ownPlayer.data.stats.GetAdditionalData().JokesOnYou)
{
((Component)__instance).GetComponent<ProjectileHit>().RemoveOwnPlayerFromPlayersHit();
((Component)__instance).GetComponent<ProjectileHit>().AddPlayerToHeld(val);
MoveTransform component2 = ((Component)__instance).GetComponent<MoveTransform>();
component2.velocity *= -1f;
Transform transform = ((Component)__instance).transform;
transform.position += ((Component)__instance).GetComponent<MoveTransform>().velocity * TimeHandler.deltaTime;
((Component)__instance).GetComponent<RayCastTrail>().WasBlocked();
if (__instance.destroyOnBlock)
{
ExtensionMethods.InvokeMethod((object)__instance, "DestroyMe", Array.Empty<object>());
}
__instance.sinceReflect = 0f;
return false;
}
}
return true;
}
}
[Serializable]
[HarmonyPatch(typeof(HealthHandler), "Heal")]
public class JuggernautPatch
{
private static void Prefix(HealthHandler __instance, ref float healAmount)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Expected O, but got Unknown
Player val = (Player)ExtensionMethods.GetFieldValue((object)__instance, "player");
healAmount *= val.data.stats.GetAdditionalData().healing;
}
}
[Serializable]
[HarmonyPatch(typeof(HealthHandler), "DoDamage")]
public class Patch
{
private static void Prefix(HealthHandler __instance, ref Vector2 damage, Player damagingPlayer)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
//IL_0053: 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: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
if (!((Object)(object)damagingPlayer == (Object)(Player)ExtensionMethods.GetFieldValue((object)__instance, "player")) && !((Object)(object)damagingPlayer == (Object)null))
{
float damageReduction = CharacterStatModifiersExtension.GetAdditionalData((CharacterStatModifiers)ExtensionMethods.GetFieldValue((object)__instance, "stats")).damageReduction;
if (damageReduction > 0f)
{
damage -= damage * damageReduction;
}
}
}
}
}
namespace Ported_FFC_Classic.Monobehaviors
{
public class Barret50CalMono : MonoBehaviour
{
private RightLeftMirrorSpring ammoPos;
private GameObject barrel;
private GameObject barrel2;
private Gun gun;
private InstantKillHitEffect hitEffect;
private static GameObject _InstantKillObj;
private GameObject oldIcon;
private string oldName;
private Player player;
private GameObject scope;
private WeaponManager weaponManager;
public static GameObject InstantKillObj
{
get
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
if ((Object)(object)_InstantKillObj == (Object)null)
{
_InstantKillObj = new GameObject("A_InstantKill", new Type[1] { typeof(InstantKillHitEffect) });
Object.DontDestroyOnLoad((Object)(object)_InstantKillObj);
}
return _InstantKillObj;
}
}
private void Awake()
{
player = ((Component)this).gameObject.GetComponentInParent<Player>();
weaponManager = ((Component)player).gameObject.GetComponent<WeaponManager>();
gun = weaponManager.weapons[0];
}
private void Start()
{
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: 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_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0213: Unknown result type (might be due to invalid IL or missing references)
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_022a: Unknown result type (might be due to invalid IL or missing references)
//IL_022f: Unknown result type (might be due to invalid IL or missing references)
//IL_024e: Unknown result type (might be due to invalid IL or missing references)
//IL_0295: Unknown result type (might be due to invalid IL or missing references)
//IL_02c2: Unknown result type (might be due to invalid IL or missing references)
//IL_02c7: Unknown result type (might be due to invalid IL or missing references)
if (player.data.view.IsMine)
{
oldName = weaponManager.names[0];
weaponManager.names[0] = "Barrett .50 Cal";
oldIcon = weaponManager.icons[0];
oldIcon.SetActive(false);
GameObject val = PFFCC.assets.LoadAsset<GameObject>("I_Barrett50Cal");
weaponManager.icons[0] = Object.Instantiate<GameObject>(val, oldIcon.transform.parent);
Object.Destroy((Object)(object)val);
weaponManager.UpdateIcons();
}
barrel = ((Component)((Component)gun).transform.Find("Spring").Find("Barrel")).gameObject;
barrel2 = Object.Instantiate<GameObject>(barrel, ((Component)gun).transform.Find("Spring"));
scope = Object.Instantiate<GameObject>(barrel, ((Component)gun).transform.Find("Spring"));
scope.transform.localScale = new Vector3(0.65f, 0.2f, 1f);
scope.transform.localPosition = new Vector3(-0.3f, 0.6f, 0f);
RightLeftMirrorSpring component = scope.GetComponent<RightLeftMirrorSpring>();
component.leftPos = new Vector3(0.3f, 0.6f, 0f);
((Behaviour)scope.GetComponent<BoxCollider2D>()).enabled = false;
Vector3 localScale = barrel.transform.localScale;
barrel2.transform.localScale = Vector3.Scale(new Vector3(3.5f, 1f, 1f), localScale);
RightLeftMirrorSpring component2 = barrel2.GetComponent<RightLeftMirrorSpring>();
Vector3 leftPos = component2.leftPos;
Vector3 val2 = (Vector3)ExtensionMethods.GetFieldValue((object)component2, "rightPos");
component2.leftPos = new Vector3(0.15f, 1.1f, 0f);
barrel2.transform.localPosition = new Vector3(-0.15f, 1.1f, 0f);
GameObject gameObject = ((Component)((Component)gun).transform.Find("Spring").Find("Ammo")).gameObject;
gameObject.transform.localPosition = new Vector3(-0.2f, 0f, 0f);
ammoPos = gameObject.AddComponent<RightLeftMirrorSpring>();
ammoPos.leftPos = new Vector3(0.2f, 0f, 0f);
Gun obj = gun;
obj.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(obj.ShootPojectileAction, new Action<GameObject>(OnShootProjectileAction));
}
public void OnShootProjectileAction(GameObject obj)
{
//IL_001c: 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)
if (weaponManager.activeWeapon == 0)
{
TrailRenderer componentInChildren = obj.GetComponentInChildren<TrailRenderer>();
componentInChildren.startColor = Color.red;
componentInChildren.endColor = Color.red;
Object.Instantiate<GameObject>(InstantKillObj, obj.transform);
}
}
private void Update()
{
if (weaponManager.activeWeapon == 0)
{
((Component)player.data.weaponHandler.gun).GetComponentInChildren<GunAmmo>().maxAmmo = player.data.stats.GetAdditionalData().extendedMags;
player.data.weaponHandler.gun.bursts = 1;
player.data.weaponHandler.gun.numberOfProjectiles = 1;
}
}
private void OnDestroy()
{
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
Object.Destroy((Object)(object)hitEffect);
Object.Destroy((Object)(object)scope);
Object.Destroy((Object)(object)barrel2);
Object.Destroy((Object)(object)ammoPos);
WeaponManager component = ((Component)player).gameObject.GetComponent<WeaponManager>();
component.names[0] = oldName;
component.icons[0] = oldIcon;
oldIcon.SetActive(true);
((Component)((Component)gun).transform.Find("Spring").Find("Ammo")).transform.localPosition = new Vector3(0f, 0f, 0f);
}
}
public class InstantKillHitEffect : RayHitEffect
{
public bool active = true;
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: 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_0078: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)hit.transform) || !active)
{
return (HasToReturn)1;
}
Player component = ((Component)hit.transform).GetComponent<Player>();
if (component != null && (Object)(object)component != (Object)null)
{
if (component.data.stats.remainingRespawns > 0)
{
component.data.view.RPC("RPCA_Die_Phoenix", (RpcTarget)0, new object[1] { hit.normal });
}
else
{
component.data.view.RPC("RPCA_Die", (RpcTarget)0, new object[1] { hit.normal });
}
}
return (HasToReturn)1;
}
}
[HarmonyPatch(typeof(ProjectileCollision), "Die")]
internal class ProjectileCollision_Patch_Die
{
private static void Postfix(ProjectileCollision __instance)
{
ProjectileHit componentInParent = ((Component)__instance).GetComponentInParent<ProjectileHit>();
bool? obj;
if (componentInParent == null)
{
obj = null;
}
else
{
GameObject ownWeapon = componentInParent.ownWeapon;
obj = ((ownWeapon == null) ? null : ownWeapon.GetComponent<Gun>()?.GetData().pierce);
}
bool? flag = obj;
if (flag.GetValueOrDefault())
{
ExtensionMethods.SetFieldValue((object)__instance, "hasCollided", (object)false);
}
}
}
[HarmonyPatch(typeof(Gun), "ResetStats")]
internal class GunPatchResetStats
{
private static void Prefix(Gun __instance)
{
__instance.GetData().pierce = false;
}
}
public class GunAdditionalData
{
public bool pierce = false;
}
public static class GunExtensions
{
private static readonly ConditionalWeakTable<Gun, GunAdditionalData> additionalData = new ConditionalWeakTable<Gun, GunAdditionalData>();
public static GunAdditionalData GetData(this Gun instance)
{
return additionalData.GetOrCreateValue(instance);
}
}
[HarmonyPatch(typeof(ProjectileHit), "RPCA_DoHit")]
internal class ProjectileHit_Patch_RPCA_DoHit_Pierce
{
[CompilerGenerated]
private sealed class <Transpiler>d__1 : IEnumerable<CodeInstruction>, IEnumerable, IEnumerator<CodeInstruction>, IEnumerator, IDisposable
{
private int <>1__state;
private CodeInstruction <>2__current;
private int <>l__initialThreadId;
private IEnumerable<CodeInstruction> instructions;
public IEnumerable<CodeInstruction> <>3__instructions;
private MethodInfo <m_DestroyMe>5__1;
private MethodInfo <m_DestroyMeHandlePierce>5__2;
private IEnumerator<CodeInstruction> <>s__3;
private CodeInstruction <instruction>5__4;
CodeInstruction IEnumerator<CodeInstruction>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Transpiler>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
<>l__initialThreadId = Environment.CurrentManagedThreadId;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || (uint)(num - 1) <= 2u)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<m_DestroyMe>5__1 = null;
<m_DestroyMeHandlePierce>5__2 = null;
<>s__3 = null;
<instruction>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Expected O, but got Unknown
try
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<m_DestroyMe>5__1 = ExtensionMethods.GetMethodInfo(typeof(ProjectileHit), "DestroyMe");
<m_DestroyMeHandlePierce>5__2 = ExtensionMethods.GetMethodInfo(typeof(ProjectileHit_Patch_RPCA_DoHit_Pierce), "DestroyMeHandlePierce");
<>s__3 = instructions.GetEnumerator();
<>1__state = -3;
break;
case 1:
<>1__state = -3;
<>2__current = new CodeInstruction(OpCodes.Call, (object)<m_DestroyMeHandlePierce>5__2);
<>1__state = 2;
return true;
case 2:
<>1__state = -3;
goto IL_012e;
case 3:
{
<>1__state = -3;
goto IL_012e;
}
IL_012e:
<instruction>5__4 = null;
break;
}
if (<>s__3.MoveNext())
{
<instruction>5__4 = <>s__3.Current;
if (CodeInstructionExtensions.Calls(<instruction>5__4, <m_DestroyMe>5__1))
{
<>2__current = new CodeInstruction(OpCodes.Ldloc_0, (object)null);
<>1__state = 1;
return true;
}
<>2__current = <instruction>5__4;
<>1__state = 3;
return true;
}
<>m__Finally1();
<>s__3 = null;
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
if (<>s__3 != null)
{
<>s__3.Dispose();
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
[DebuggerHidden]
IEnumerator<CodeInstruction> IEnumerable<CodeInstruction>.GetEnumerator()
{
<Transpiler>d__1 <Transpiler>d__;
if (<>1__state == -2 && <>l__initialThreadId == Environment.CurrentManagedThreadId)
{
<>1__state = 0;
<Transpiler>d__ = this;
}
else
{
<Transpiler>d__ = new <Transpiler>d__1(0);
}
<Transpiler>d__.instructions = <>3__instructions;
return <Transpiler>d__;
}
[DebuggerHidden]
IEnumerator IEnumerable.GetEnumerator()
{
return ((IEnumerable<CodeInstruction>)this).GetEnumerator();
}
}
private static void DestroyMeHandlePierce(ProjectileHit instance, HitInfo hit)
{
if ((Object)(object)instance.ownWeapon == (Object)null)
{
ExtensionMethods.InvokeMethod((object)instance, "DestroyMe", Array.Empty<object>());
return;
}
GameObject ownWeapon = instance.ownWeapon;
if (!((ownWeapon == null) ? null : ownWeapon.GetComponent<Gun>()?.GetData()?.pierce).GetValueOrDefault())
{
ExtensionMethods.InvokeMethod((object)instance, "DestroyMe", Array.Empty<object>());
}
else
{
Transform transform = hit.transform;
if (((transform != null) ? ((Component)transform).GetComponent<HealthHandler>() : null) == null)
{
Collider2D collider = hit.collider;
if (((collider != null) ? ((Component)collider).GetComponentInParent<Damagable>() : null) == null)
{
ExtensionMethods.InvokeMethod((object)instance, "DestroyMe", Array.Empty<object>());
}
}
}
GameObject gameObject = ((Component)instance).gameObject;
InstantKillHitEffect instantKillHitEffect = ((gameObject != null) ? gameObject.GetComponentInChildren<InstantKillHitEffect>() : null);
if (instantKillHitEffect != null)
{
instantKillHitEffect.active = false;
}
instance.damage *= 0.75f;
}
[IteratorStateMachine(typeof(<Transpiler>d__1))]
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Transpiler>d__1(-2)
{
<>3__instructions = instructions
};
}
}
public class SizeMattersMono : MonoBehaviour
{
[CompilerGenerated]
private sealed class <reset>d__7 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public SizeMattersMono <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <reset>d__7(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
try
{
CharacterStatModifiers stats = <>4__this._player.data.stats;
stats.movementSpeed -= <>4__this.movementSpeedDelta;
CharacterStatModifiers stats2 = <>4__this._player.data.stats;
stats2.gravity -= <>4__this.gravtyDelta;
CharacterStatModifiers stats3 = <>4__this._player.data.stats;
stats3.sizeMultiplier -= <>4__this.sizeDelta;
<>4__this.movementSpeedDelta = 0f;
<>4__this.gravtyDelta = 0f;
<>4__this.sizeDelta = 0f;
}
catch
{
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private float lastHealthPercet;
private float sizeDelta = 0f;
private float movementSpeedDelta = 0f;
private float gravtyDelta = 0f;
private Player _player;
private void Start()
{
if ((Object)(object)_player == (Object)null)
{
_player = ((Component)this).gameObject.GetComponentInParent<Player>();
}
GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => reset()));
}
private void Update()
{
if (!((Object)(object)_player == (Object)null) && _player.data.stats.GetAdditionalData().hasAdaptiveSizing)
{
float num = _player.data.health / _player.data.maxHealth;
if (Mathf.Clamp(num, 0f, 1f) != lastHealthPercet)
{
lastHealthPercet = num;
CharacterStatModifiers stats = _player.data.stats;
stats.movementSpeed -= movementSpeedDelta;
CharacterStatModifiers stats2 = _player.data.stats;
stats2.gravity -= gravtyDelta;
CharacterStatModifiers stats3 = _player.data.stats;
stats3.sizeMultiplier -= sizeDelta;
movementSpeedDelta = _player.data.stats.movementSpeed * (_player.data.stats.GetAdditionalData().adaptiveMovementSpeed - _player.data.stats.GetAdditionalData().adaptiveMovementSpeed * num);
gravtyDelta = (0f - _player.data.stats.gravity) * (_player.data.stats.GetAdditionalData().adaptiveGravity - _player.data.stats.GetAdditionalData().adaptiveGravity * num);
sizeDelta = _player.data.stats.sizeMultiplier * (Mathf.Clamp(num, 0f, 1f) / 2f + 0.5f) - _player.data.stats.sizeMultiplier;
CharacterStatModifiers stats4 = _player.data.stats;
stats4.movementSpeed += movementSpeedDelta;
CharacterStatModifiers stats5 = _player.data.stats;
stats5.gravity += gravtyDelta;
CharacterStatModifiers stats6 = _player.data.stats;
stats6.sizeMultiplier += sizeDelta;
ExtensionMethods.InvokeMethod((object)_player.data.stats, "ConfigureMassAndSize", Array.Empty<object>());
}
}
}
[IteratorStateMachine(typeof(<reset>d__7))]
public IEnumerator reset()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <reset>d__7(0)
{
<>4__this = this
};
}
}
internal class WildCardMono : MonoBehaviour
{
public void Start()
{
ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)PFFCC.instance, 5, (Action)delegate
{
Player player = ((Component)this).GetComponentInParent<Player>();
CardInfo[] array = (from c in CardManager.cards.Values
where (Object)(object)c.cardInfo != (Object)(object)CardHolder.cards["Wildcard"] && (Object)(object)((Component)c.cardInfo).GetComponent<Gun>() != (Object)null && ((Component)c.cardInfo).GetComponent<Gun>().reflects > 0 && c.enabled && Cards.instance.PlayerIsAllowedCard(player, c.cardInfo)
select c.cardInfo).ToArray();
ExtensionMethods.Shuffle<CardInfo>((IList<CardInfo>)array);
CardInfo val = array[0];
List<CardInfo> list = player.data.currentCards.ToList();
list.Add(val);
Cards.instance.AddCardToPlayer(player, val, false, "", 0f, 0f);
Object.Destroy((Object)(object)this);
});
}
}
}
namespace Ported_FFC_Classic.Cards.Jester
{
public class KingOfFoolsHitSurfaceEffect : HitSurfaceEffect
{
public class KingOfFoolsGun : Gun
{
}
private readonly Random _rng = new Random();
private const int BaseChance = 15;
public override void Hit(Vector2 position, Vector2 normal, Vector2 velocity)
{
//IL_0064: 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_0076: Unknown result type (might be due to invalid IL or missing references)
Player componentInParent = ((Component)this).gameObject.GetComponentInParent<Player>();
int kingOfFools = componentInParent.data.stats.GetAdditionalData().kingOfFools;
int num = _rng.Next(1, 101);
if (kingOfFools != 0 && num <= kingOfFools * 15 && PhotonNetwork.IsMasterClient)
{
NetworkingManager.RPC(typeof(KingOfFoolsHitSurfaceEffect), "DoKingOfFoolsRPC", new object[4] { position, normal, velocity, componentInParent.playerID });
}
}
[UnboundRPC]
public static void DoKingOfFoolsRPC(Vector2 position, Vector2 normal, Vector2 velocity, int playerID)
{
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: 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_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: 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_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID);
Gun component = ((Component)((Component)val).GetComponent<Holding>().holdable).GetComponent<Gun>();
Gun newGun = (Gun)(object)((Component)val).gameObject.AddComponent<KingOfFoolsGun>();
SpawnBulletsEffect spawnBulletsEffect = ((Component)val).gameObject.AddComponent<SpawnBulletsEffect>();
Vector2 val2 = Vector2.op_Implicit(Vector3.Cross(Vector3.forward, Vector2.op_Implicit(normal)));
Vector2 normalized = ((Vector2)(ref val2)).normalized;
List<Vector3> positions = GetPositions(position, normal, normalized);
List<Vector3> directions = GetDirections(position, positions);
spawnBulletsEffect.SetPositions(positions);
spawnBulletsEffect.SetDirections(directions);
spawnBulletsEffect.SetNumBullets(1);
spawnBulletsEffect.SetTimeBetweenShots(0f);
spawnBulletsEffect.SetInitialDelay(0f);
SpawnBulletsEffect.CopyGunStats(component, newGun);
newGun.spread = 0.2f;
newGun.numberOfProjectiles = 1;
newGun.projectiles = (from e in Enumerable.Range(0, newGun.numberOfProjectiles)
from x in newGun.projectiles
select x).ToList().Take(newGun.numberOfProjectiles).ToArray();
newGun.damage = Mathf.Clamp(newGun.damage / 2f, 0.5f, float.MaxValue);
newGun.projectileSpeed = Mathf.Clamp(((Vector2)(ref velocity)).magnitude / 100f, 0.1f, 1f);
newGun.damageAfterDistanceMultiplier = 1f;
List<ObjectsToSpawn> list = newGun.objectsToSpawn.ToList();
list.Add(PreventRecursion.stopRecursionObjectToSpawn);
newGun.objectsToSpawn = list.ToArray();
newGun.projectileColor = new Color(1f, 13f / 15f, 0f);
spawnBulletsEffect.SetGun(newGun);
}
private static List<Vector3> GetPositions(Vector2 position, Vector2 normal, Vector2 parallel)
{
//IL_0008: 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_000f: 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_001e: 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_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)
List<Vector3> list = new List<Vector3>();
list.Add(Vector2.op_Implicit(position + 0.2f * normal + 0.1f * parallel));
return list;
}
private static List<Vector3> GetDirections(Vector2 position, List<Vector3> shootPos)
{
//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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: 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)
List<Vector3> list = new List<Vector3>();
foreach (Vector3 shootPo in shootPos)
{
Vector2 val = Vector2.op_Implicit(shootPo) - position;
list.Add(Vector2.op_Implicit(((Vector2)(ref val)).normalized));
}
return list;
}
}
public class WayOfTheJesterMono : MonoBehaviour
{
private const float Damage = 0.05f;
private float deltaDamage = 0f;
private const float MovementSpeed = 0.01f;
private float deltaMovementSpeed = 0f;
private const float ProjectileSpeed = 0.03f;
private float deltaProjectileSpeed = 0f;
private int _bounces;
private Gun _gun;
private Player _player;
private int _previousBounces = 0;
private CharacterStatModifiers _stats;
public void Start()
{
if ((Object)(object)_player == (Object)null)
{
_player = ((Component)this).gameObject.GetComponentInParent<Player>();
}
}
private void Update()
{
if (!((Object)(object)_player == (Object)null))
{
_stats = _player.data.stats;
_gun = ((Component)((Component)_player).GetComponent<Holding>().holdable).GetComponent<Gun>();
int num = 25;
_bounces = Mathf.Clamp(_gun.reflects, 0, num);
if (_bounces != _previousBounces)
{
_previousBounces = _bounces;
CharacterStatModifiers stats = _stats;
stats.movementSpeed -= deltaMovementSpeed;
Gun gun = _gun;
gun.damage -= deltaDamage;
Gun gun2 = _gun;
gun2.projectileSpeed -= deltaProjectileSpeed;
deltaMovementSpeed = _stats.movementSpeed * 0.01f * (float)_bounces;
deltaDamage = _gun.damage * 0.05f * (float)_bounces;
deltaProjectileSpeed = _gun.projectileSpeed * (float)_bounces * 0.03f;
CharacterStatModifiers stats2 = _stats;
stats2.movementSpeed += deltaMovementSpeed;
Gun gun3 = _gun;
gun3.damage += deltaDamage;
Gun gun4 = _gun;
gun4.projectileSpeed += deltaProjectileSpeed;
}
}
}
}
}
namespace Ported_FFC_Classic.Cards.Juggernaut
{
public class ArmorPlatingMono : MonoBehaviour
{
[CompilerGenerated]
private sealed class <SyncOdds>d__3 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public int playerID;
public ArmorPlatingMono <>4__this;
private bool[] <bools>5__1;
private int <i>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <SyncOdds>d__3(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<bools>5__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
if (!PhotonNetwork.IsMasterClient)
{
return false;
}
<bools>5__1 = new bool[1000];
<i>5__2 = 0;
while (<i>5__2 < 1000)
{
<bools>5__1[<i>5__2] = ((Random.Range(0, 10) == 0) ? true : false);
int num = <i>5__2 + 1;
<i>5__2 = num;
}
NetworkingManager.RPC(typeof(ArmorPlatingMono), "OddsRPCA", new object[2] { playerID, <bools>5__1 });
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public List<bool> reflect_rolls;
public int indx;
public void Start()
{
GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)((IGameModeHandler gm) => SyncOdds(((Component)this).GetComponentInParent<Player>().playerID)));
}
[IteratorStateMachine(typeof(<SyncOdds>d__3))]
public IEnumerator SyncOdds(int playerID)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <SyncOdds>d__3(0)
{
<>4__this = this,
playerID = playerID
};
}
[UnboundRPC]
public static void OddsRPCA(int playerID, bool[] bools)
{
Player val = PlayerManager.instance.players.Find((Player p) => p.playerID == playerID);
ArmorPlatingMono componentInChildren = ((Component)val).GetComponentInChildren<ArmorPlatingMono>();
if (!((Object)(object)componentInChildren == (Object)null))
{
componentInChildren.reflect_rolls = bools.ToList();
componentInChildren.indx = 0;
}
}
public bool Reflect()
{
return reflect_rolls[indx++ % 1000];
}
}
[Serializable]
[HarmonyPatch(typeof(ProjectileHit), "Hit")]
internal class ProjectileHitPatchHit
{
private static bool Prefix(ProjectileHit __instance, HitInfo hit, bool forceCall)
{
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//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_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
HealthHandler val = null;
if (Object.op_Implicit((Object)(object)hit.transform))
{
val = ((Component)hit.transform).GetComponent<HealthHandler>();
}
if (Object.op_Implicit((Object)(object)val))
{
Player component = ((Component)val).GetComponent<Player>();
if ((Object)(object)component != (Object)null && (Object)(object)((Component)component).GetComponentInChildren<ArmorPlatingMono>() != (Object)null && ((Component)component).GetComponentInChildren<ArmorPlatingMono>().Reflect())
{
((Component)__instance).GetComponent<ProjectileHit>().RemoveOwnPlayerFromPlayersHit();
((Component)__instance).GetComponent<ProjectileHit>().AddPlayerToHeld(val);
MoveTransform component2 = ((Component)__instance).GetComponent<MoveTransform>();
component2.velocity *= -1f;
Transform transform = ((Component)__instance).transform;
transform.position += ((Component)__instance).GetComponent<MoveTransform>().velocity * TimeHandler.deltaTime;
((Component)__instance).GetComponent<RayCastTrail>().WasBlocked();
if (__instance.destroyOnBlock)
{
ExtensionMethods.InvokeMethod((object)__instance, "DestroyMe", Array.Empty<object>());
}
__instance.sinceReflect = 0f;
return false;
}
}
return true;
}
}
}
namespace Ported_FFC_Classic.Extensions
{
[Serializable]
public class CharacterStatModifiersAdditionalData
{
public bool JokesOnYou;
public bool hasAdaptiveSizing;
public float adaptiveMovementSpeed;
public float adaptiveGravity;
public float healing;
public float damageReduction;
public int extendedMags;
public int kingOfFools;
public CharacterStatModifiersAdditionalData()
{
JokesOnYou = false;
hasAdaptiveSizing = false;
adaptiveMovementSpeed = 0f;
adaptiveGravity = 0f;
healing = 1f;
damageReduction = 0f;
extendedMags = 1;
kingOfFools = 0;
}
}
public static class CharacterStatModifiersExtension
{
[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
private class CharacterStatModifiersPatchResetStats
{
private static void Prefix(CharacterStatModifiers __instance)
{
CharacterStatModifiersAdditionalData additionalData = __instance.GetAdditionalData();
additionalData.JokesOnYou = false;
additionalData.adaptiveMovementSpeed = 0f;
additionalData.adaptiveGravity = 0f;
additionalData.hasAdaptiveSizing = false;
additionalData.healing = 1f;
additionalData.damageReduction = 0f;
additionalData.extendedMags = 1;
additionalData.kingOfFools = 0;
}
}
public static readonly ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData> Data = new ConditionalWeakTable<CharacterStatModifiers, CharacterStatModifiersAdditionalData>();
public static CharacterStatModifiersAdditionalData GetAdditionalData(this CharacterStatModifiers statModifiers)
{
return Data.GetOrCreateValue(statModifiers);
}
public static void AddData(this CharacterStatModifiers statModifiers, CharacterStatModifiersAdditionalData value)
{
try
{
Data.Add(statModifiers, value);
}
catch (Exception ex)
{
Debug.LogError((object)ex);
}
}
}
public class PFFCStats : MonoBehaviour
{
public bool JokesOnYou = false;
public bool hasAdaptiveSizing = false;
public bool pierce = false;
public float adaptiveMovementSpeed = 0f;
public float adaptiveGravity = 0f;
public float healing = 1f;
public float damageReduction = 0f;
public int extendedMags = 0;
public int kingOfFools = 0;
public void Apply(Player player)
{
player.data.stats.GetAdditionalData().JokesOnYou = JokesOnYou || player.data.stats.GetAdditionalData().JokesOnYou;
player.data.stats.GetAdditionalData().hasAdaptiveSizing = hasAdaptiveSizing || player.data.stats.GetAdditionalData().hasAdaptiveSizing;
((Component)player).gameObject.GetComponent<WeaponManager>().weapons[0].GetData().pierce = pierce || ((Component)player).gameObject.GetComponent<WeaponManager>().weapons[0].GetData().pierce;
player.data.stats.GetAdditionalData().adaptiveMovementSpeed += adaptiveMovementSpeed;
player.data.stats.GetAdditionalData().adaptiveGravity += adaptiveGravity;
player.data.stats.GetAdditionalData().healing *= healing;
player.data.stats.GetAdditionalData().damageReduction += damageReduction;
player.data.stats.GetAdditionalData().extendedMags += extendedMags;
player.data.stats.GetAdditionalData().kingOfFools += kingOfFools;
}
}
[HarmonyPatch(typeof(ApplyCardStats), "ApplyStats")]
public class ApplyPlayerStatsPatch
{
private static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade)
{
((Component)__instance).GetComponent<PFFCStats>()?.Apply(___playerToUpgrade);
}
}
}
namespace Ported_FFC_Classic.Classes
{
internal class JesterClass : ClassHandler
{
[CompilerGenerated]
private sealed class <Init>d__0 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public JesterClass <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Init>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
ClassesRegistry.Register(CardHolder.cards["Jester"], (CardType)1, 0);
ClassesRegistry.Register(CardHolder.cards["Joke's On You!"], (CardType)16, CardHolder.cards["Jester"], 0);
ClassesRegistry.Register(CardHolder.cards["King of Fools"], (CardType)16, CardHolder.cards["Jester"], 2);
ClassesRegistry.Register(CardHolder.cards["Way of the Jester"], (CardType)16, CardHolder.cards["Jester"], 0);
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[IteratorStateMachine(typeof(<Init>d__0))]
public override IEnumerator Init()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Init>d__0(0)
{
<>4__this = this
};
}
}
internal class JuggernautClass : ClassHandler
{
[CompilerGenerated]
private sealed class <Init>d__0 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public JuggernautClass <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Init>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
ClassesRegistry.Register(CardHolder.cards["Juggernaut"], (CardType)1, 0);
ClassesRegistry.Register(CardHolder.cards["Conditioning"], (CardType)16, CardHolder.cards["Juggernaut"], 0);
ClassesRegistry.Register(CardHolder.cards["Size Matters"], (CardType)16, CardHolder.cards["Juggernaut"], 0);
ClassesRegistry.Register(CardHolder.cards["Armor Plating"], (CardType)16, CardHolder.cards["Juggernaut"], 0);
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[IteratorStateMachine(typeof(<Init>d__0))]
public override IEnumerator Init()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Init>d__0(0)
{
<>4__this = this
};
}
}
internal class LightGunnerClass : ClassHandler
{
[CompilerGenerated]
private sealed class <Init>d__0 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public LightGunnerClass <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Init>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
ClassesRegistry.Register(CardHolder.cards["Light Gunner"], (CardType)1, 0);
ClassesRegistry.Register(CardHolder.cards["Fast Mags"], (CardType)16, CardHolder.cards["Light Gunner"], 0);
ClassesRegistry.Register(CardHolder.cards["Battle Experience"], (CardType)16, CardHolder.cards["Light Gunner"], 0);
ClassesRegistry.Register(CardHolder.cards["LMG"], (CardType)4, CardHolder.cards["Light Gunner"], 0);
ClassesRegistry.Register(CardHolder.cards["DMR"], (CardType)4, CardHolder.cards["Light Gunner"], 0);
ClassesRegistry.Register(CardHolder.cards["Assault Rifle"], (CardType)4, CardHolder.cards["Light Gunner"], 0);
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <PostInit>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public LightGunnerClass <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PostInit>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
ClassesRegistry.Get(CardHolder.cards["LMG"]).Blacklist(CardHolder.cards["DMR"]).Blacklist(CardHolder.cards["Assault Rifle"]);
ClassesRegistry.Get(CardHolder.cards["DMR"]).Blacklist(CardHolder.cards["LMG"]).Blacklist(CardHolder.cards["Assault Rifle"]);
ClassesRegistry.Get(CardHolder.cards["Assault Rifle"]).Blacklist(CardHolder.cards["DMR"]).Blacklist(CardHolder.cards["LMG"]);
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[IteratorStateMachine(typeof(<Init>d__0))]
public override IEnumerator Init()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Init>d__0(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<PostInit>d__1))]
public override IEnumerator PostInit()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <PostInit>d__1(0)
{
<>4__this = this
};
}
}
internal class AstronomerClass : ClassHandler
{
[CompilerGenerated]
private sealed class <Init>d__0 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public AstronomerClass <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <Init>d__0(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
ClassesRegistry.Register(CardHolder.cards["Marksman"], (CardType)1, 0);
ClassesRegistry.Register(CardHolder.cards["AP Rounds"], (CardType)16, CardHolder.cards["Marksman"], 0);
ClassesRegistry.Register(CardHolder.cards["Barrett .50 Cal"], (CardType)8, CardHolder.cards["Marksman"], 0);
ClassesRegistry.Register(CardHolder.cards["Extended Rifle Mag"], (CardType)16, CardHolder.cards["Barrett .50 Cal"], 0);
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[IteratorStateMachine(typeof(<Init>d__0))]
public override IEnumerator Init()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <Init>d__0(0)
{
<>4__this = this
};
}
}
}