using System;
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 System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using ForbiddenFoods;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using PEAKLib.Core;
using PEAKLib.Items;
using Peak.Afflictions;
using Photon.Pun;
using Photon.Voice.PUN;
using Sirenix.Utilities;
using TMPro;
using Unity.Mathematics;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.InputSystem;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Zorro.Core;
using Zorro.Core.CLI;
using Zorro.Core.Serizalization;
using pworld.Scripts.Extensions;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: IgnoresAccessChecksTo("Assembly-CSharp")]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("com.github.Fetalpile")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.0.2.0")]
[assembly: AssemblyInformationalVersion("0.0.2")]
[assembly: AssemblyProduct("com.github.Fetalpile")]
[assembly: AssemblyTitle("ForbiddenFoods")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.2.0")]
[module: UnverifiableCode]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[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;
}
}
}
public class Action_InflictSunburn : ItemAction
{
public float inflictionTime;
public float burnPerSecond;
}
public class Affliction_Golden : Affliction
{
public float moveSpeedMod = 0.5f;
public float climbSpeedMod = 0.75f;
public float climbDelay;
public float globmod = 1f;
public Affliction_Golden(float globmod)
{
this.globmod = globmod;
}
public override AfflictionType GetAfflictionType()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
return AttitudeCharacterAfflictions.GOLDEN;
}
public override void Stack(Affliction incomingAffliction)
{
base.totalTime = Mathf.Max(base.totalTime, incomingAffliction.totalTime);
}
public override void UpdateEffect()
{
if (base.character.data.isClimbing)
{
climbDelay = 0f;
base.bonusTime = 0f;
}
}
public override void OnApplied()
{
((Affliction)this).OnApplied();
base.totalTime = 40f;
CharacterMovement movement = base.character.refs.movement;
movement.movementModifier += moveSpeedMod * globmod;
CharacterClimbing climbing = base.character.refs.climbing;
climbing.climbSpeedMod += climbSpeedMod * globmod;
CharacterRopeHandling ropeHandling = base.character.refs.ropeHandling;
ropeHandling.climbSpeedMod += climbSpeedMod * globmod;
CharacterVineClimbing vineClimbing = base.character.refs.vineClimbing;
vineClimbing.climbSpeedMod += climbSpeedMod * globmod;
if (base.character.IsLocal)
{
((Component)base.character).GetComponent<AttitudePlayerAttachment>().StartGoldenAge();
}
base.bonusTime = climbDelay;
}
public override void OnRemoved()
{
((Affliction)this).OnRemoved();
CharacterMovement movement = base.character.refs.movement;
movement.movementModifier -= moveSpeedMod * globmod;
CharacterClimbing climbing = base.character.refs.climbing;
climbing.climbSpeedMod -= climbSpeedMod * globmod;
CharacterRopeHandling ropeHandling = base.character.refs.ropeHandling;
ropeHandling.climbSpeedMod -= climbSpeedMod * globmod;
CharacterVineClimbing vineClimbing = base.character.refs.vineClimbing;
vineClimbing.climbSpeedMod -= climbSpeedMod * globmod;
if (base.character.IsLocal)
{
((Component)base.character).GetComponent<AttitudePlayerAttachment>().EndGoldenAge();
}
}
public override void Serialize(BinarySerializer serializer)
{
serializer.WriteFloat(base.totalTime);
serializer.WriteFloat(moveSpeedMod);
serializer.WriteFloat(climbSpeedMod);
serializer.WriteFloat(climbDelay);
serializer.WriteFloat(globmod);
}
public override void Deserialize(BinaryDeserializer serializer)
{
base.totalTime = serializer.ReadFloat();
moveSpeedMod = serializer.ReadFloat();
climbSpeedMod = serializer.ReadFloat();
climbDelay = serializer.ReadFloat();
globmod = serializer.ReadFloat();
base.bonusTime = climbDelay;
}
}
public class Affliction_Hyped : Affliction
{
public float moveSpeedMod = 0.75f;
public float climbSpeedMod = 0.75f;
public float drowsyOnEnd;
private float cachedDrowsy;
public float climbDelay;
public float globmod = 1f;
public bool shouldRemoveExtraStamina;
public int causer;
public Affliction_Hyped(float globmod, bool shouldremove, int causerID)
{
this.globmod = globmod;
shouldRemoveExtraStamina = shouldremove;
causer = causerID;
}
public override AfflictionType GetAfflictionType()
{
return (AfflictionType)12220;
}
public override void Stack(Affliction incomingAffliction)
{
base.totalTime = Mathf.Max(base.totalTime, incomingAffliction.totalTime);
}
public override void UpdateEffect()
{
base.character.AddExtraStamina(-0.0005f * (shouldRemoveExtraStamina ? 1f : 0.5f) * ((!base.character.data.isClimbing) ? 0.5f : 1f));
if (base.character.data.isClimbing)
{
climbDelay = 0f;
base.bonusTime = 0f;
}
}
public override void OnApplied()
{
((Affliction)this).OnApplied();
base.totalTime = 50f;
CharacterMovement movement = base.character.refs.movement;
movement.movementModifier += moveSpeedMod * globmod;
CharacterClimbing climbing = base.character.refs.climbing;
climbing.climbSpeedMod += climbSpeedMod * globmod;
CharacterRopeHandling ropeHandling = base.character.refs.ropeHandling;
ropeHandling.climbSpeedMod += climbSpeedMod * globmod;
CharacterVineClimbing vineClimbing = base.character.refs.vineClimbing;
vineClimbing.climbSpeedMod += climbSpeedMod * globmod;
if (base.character.IsLocal)
{
GUIManager.instance.StartEnergyDrink();
}
cachedDrowsy = base.character.refs.afflictions.GetCurrentStatus((STATUSTYPE)6);
base.character.refs.afflictions.SubtractStatus((STATUSTYPE)6, 2f, false);
base.bonusTime = climbDelay;
}
public override void OnRemoved()
{
((Affliction)this).OnRemoved();
CharacterMovement movement = base.character.refs.movement;
movement.movementModifier -= moveSpeedMod * globmod;
CharacterClimbing climbing = base.character.refs.climbing;
climbing.climbSpeedMod -= climbSpeedMod * globmod;
CharacterRopeHandling ropeHandling = base.character.refs.ropeHandling;
ropeHandling.climbSpeedMod -= climbSpeedMod * globmod;
CharacterVineClimbing vineClimbing = base.character.refs.vineClimbing;
vineClimbing.climbSpeedMod -= climbSpeedMod * globmod;
GUIManager.instance.EndEnergyDrink();
}
public override void Serialize(BinarySerializer serializer)
{
serializer.WriteFloat(base.totalTime);
serializer.WriteFloat(moveSpeedMod);
serializer.WriteFloat(climbSpeedMod);
serializer.WriteFloat(drowsyOnEnd);
serializer.WriteFloat(cachedDrowsy);
serializer.WriteFloat(climbDelay);
serializer.WriteFloat(globmod);
serializer.WriteBool(shouldRemoveExtraStamina);
serializer.WriteInt(causer);
}
public override void Deserialize(BinaryDeserializer serializer)
{
base.totalTime = serializer.ReadFloat();
moveSpeedMod = serializer.ReadFloat();
climbSpeedMod = serializer.ReadFloat();
drowsyOnEnd = serializer.ReadFloat();
cachedDrowsy = serializer.ReadFloat();
climbDelay = serializer.ReadFloat();
globmod = serializer.ReadFloat();
shouldRemoveExtraStamina = serializer.ReadBool();
causer = serializer.ReadInt();
base.bonusTime = climbDelay;
}
}
public class AttitudeCharacterAfflictions : MonoBehaviourPunCallbacks
{
public enum STATUSTYPE
{
SUNBURN,
DEPRESSION
}
public static AfflictionType GOLDEN = (AfflictionType)12220;
public static AfflictionType HYPED = (AfflictionType)12221;
public static AfflictionType DRAINED = (AfflictionType)12222;
}
public static class AttitudeHandler
{
public static Dictionary<string, Attitude> attitudes = new Dictionary<string, Attitude>
{
{
"NONE",
new Attitude()
},
{
"BOOKWORM",
new BookWormAttitude()
},
{
"BULLY",
new BullyAttitude()
},
{
"CLASS_CLOWN",
new ClassClownAttitude()
},
{
"EXCITABLE",
new ExcitableAttitude()
},
{
"FREAK",
new FreakAttitude()
},
{
"GOLDEN_CHILD",
new GoldenChildAttitude()
},
{
"GOTH",
new GothAttitude()
},
{
"NAUGHTY",
new NaughtyAttitude()
},
{
"PICKY_EATER",
new PickyEaterAttitude()
},
{
"POINDEXTER",
new PoindexterAttitude()
},
{
"STICKY",
new StickyAttitude()
},
{
"SWEETIE",
new SweetieAttitude()
}
};
public static void Start()
{
}
public static bool IsCharacterAttitude(string att, Character cha)
{
if ((Object)(object)cha == (Object)null || (Object)(object)((Component)cha).gameObject.GetComponentInChildren<AttitudePlayerAttachment>() == (Object)null)
{
return false;
}
return ((Component)cha).gameObject.GetComponentInChildren<AttitudePlayerAttachment>().getCurrentAttitude() == attitudes.GetValueOrDefault(att);
}
public static bool IsCharacterAttitudeUnlocked(string att, Character cha)
{
if ((Object)(object)cha == (Object)null || (Object)(object)((Component)cha).gameObject.GetComponentInChildren<AttitudePlayerAttachment>() == (Object)null)
{
return false;
}
return ((Component)cha).gameObject.GetComponentInChildren<AttitudePlayerAttachment>().unlockedAttitudes.Contains(att);
}
public static void SetAttitude(string NewAttitude, Character cha)
{
if (!((Object)(object)cha == (Object)null) && !((Object)(object)((Component)cha).gameObject.GetComponentInChildren<AttitudePlayerAttachment>() == (Object)null))
{
((Component)cha).gameObject.GetComponentInChildren<AttitudePlayerAttachment>().setCurrentAttitude(NewAttitude);
}
}
public static string GetCurrentAttitude(Character cha)
{
return ((Component)cha).gameObject.GetComponentInChildren<AttitudePlayerAttachment>().getCurrentAttitude().getDictCode();
}
}
public class AttitudePlayerAttachment : MonoBehaviour
{
[CompilerGenerated]
private sealed class <IThrow>d__34 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public int myid;
public int id;
public float mod;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <IThrow>d__34(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0073: 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_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
{
<>1__state = -1;
Character component = ((Component)PhotonView.Find(myid)).GetComponent<Character>();
Character component2 = ((Component)PhotonView.Find(id)).GetComponent<Character>();
if (component2.IsLocal)
{
GamefeelHandler.instance.AddPerlinShake(15f, 0.5f, 15f);
}
if (mod != 0f)
{
Vector3 lookDirection = component.data.lookDirection;
((Vector3)(ref lookDirection)).Normalize();
Vector3 val = lookDirection * 1500f * mod;
component2.RPCA_Fall(1f);
component2.AddForce(val, 0.7f, 1f);
component2.refs.afflictions.AddStatus((STATUSTYPE)0, 0.025f * (mod * 0.01f), true);
if (component.refs.view.IsMine)
{
GUIManager.instance.Grasp();
}
else if (component2.refs.view.IsMine)
{
GUIManager.instance.InjuryFX(mod);
}
}
component2.GetBodypartRig((BodypartType)2).useGravity = true;
<>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 <delayedCurrent>d__23 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public AttitudePlayerAttachment <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <delayedCurrent>d__23(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Expected O, but got Unknown
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Expected O, but got Unknown
//IL_00fa: 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_012e: Unknown result type (might be due to invalid IL or missing references)
int num = <>1__state;
AttitudePlayerAttachment attitudePlayerAttachment = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
goto IL_004e;
case 1:
<>1__state = -1;
goto IL_004e;
case 2:
<>1__state = -1;
<>2__current = null;
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
<>2__current = null;
<>1__state = 4;
return true;
case 4:
<>1__state = -1;
<>2__current = (object)new WaitForSeconds(1.55f);
<>1__state = 5;
return true;
case 5:
{
<>1__state = -1;
GameObject val = Object.Instantiate<GameObject>(new GameObject(), ((Component)TransformExtensions.FindChildRecursive(GameObject.Find("Canvas_HUD").transform, "Inventory")).transform);
attitudePlayerAttachment.TMPGrade = val.AddComponent<TextMeshProUGUI>();
((TMP_Text)attitudePlayerAttachment.TMPGrade).outlineColor = Color32.op_Implicit(Color.black);
((TMP_Text)attitudePlayerAttachment.TMPGrade).outlineWidth = 10f;
val.transform.position = new Vector3(1850f, 175f, 0f);
((TMP_Text)attitudePlayerAttachment.TMPGrade).text = "";
((TMP_Text)attitudePlayerAttachment.TMPGrade).font = Resources.FindObjectsOfTypeAll<TMP_FontAsset>().ToList().Find((TMP_FontAsset x) => ((Object)x).name == "Montserrat-ExtraBold SDF");
((TMP_Text)attitudePlayerAttachment.TMPGrade).fontMaterial = Resources.FindObjectsOfTypeAll<Material>().ToList().Find((Material x) => ((Object)x).name == "Montserrat-ExtraBold SDF Material");
((Behaviour)attitudePlayerAttachment.TMPGrade).enabled = false;
GameObject val2 = Object.Instantiate<GameObject>(Plugin.goldenVFX, GameObject.Find("Volumes").transform);
attitudePlayerAttachment.goldenSVFX = val2.GetComponent<ScreenVFX>();
attitudePlayerAttachment.sparkle = Object.Instantiate<GameObject>(Plugin.sparkles, ((Component)attitudePlayerAttachment.parent.GetBodypart((BodypartType)2)).transform, false);
attitudePlayerAttachment.sparkleSys = attitudePlayerAttachment.sparkle.GetComponent<ParticleSystem>();
attitudePlayerAttachment.sparkleSys.Stop();
attitudePlayerAttachment.sparkleSys.Clear();
attitudePlayerAttachment.currentAttitude.OnAdd(attitudePlayerAttachment.parent);
return false;
}
IL_004e:
if (!Object.op_Implicit((Object)(object)Character.localCharacter))
{
<>2__current = null;
<>1__state = 1;
return true;
}
<>2__current = null;
<>1__state = 2;
return true;
}
}
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 Character parent;
public Character target;
public int tickcount;
public float grade = 100f;
public string gradeLetter = "N/A";
public bool isLocal;
public SpringJoint joint;
public bool isThrowing;
public float sinceSpecialPressTime;
public AttitudeCharacterInput input;
private Attitude currentAttitude = AttitudeHandler.attitudes.GetValueOrDefault("NONE", new Attitude());
public TextMeshProUGUI TMPGrade;
public ScreenVFX goldenSVFX;
public GameObject sparkle;
public ParticleSystem sparkleSys;
public List<string> unlockedAttitudes = AttitudeHandler.attitudes.Keys.ToList();
public void StartGoldenAge()
{
PExt.Restart(sparkleSys);
}
public void EndGoldenAge()
{
sparkleSys.Stop();
}
public void unlockAttitude(string tude)
{
if (isLocal && !unlockedAttitudes.Contains(tude))
{
unlockedAttitudes.Add(tude);
}
}
public Attitude getCurrentAttitude()
{
return currentAttitude;
}
public void setCurrentAttitude(string tude)
{
currentAttitude.OnRemove(parent);
if (unlockedAttitudes.Contains(tude) && !AttitudeHandler.attitudes.TryGetValue(tude, out currentAttitude))
{
Plugin.Log.LogError((object)(tude + " is Not A Valid Attitude"));
}
else
{
PlayerPrefs.SetString("shellworks:ATTITUDE", tude);
}
currentAttitude.OnAdd(parent);
}
public void setCurrentAttitude(Attitude tude)
{
if (isLocal)
{
currentAttitude = tude;
PlayerPrefs.SetString("shellworks:ATTITUDE", tude.getDictCode());
}
}
private void Start()
{
string @string = PlayerPrefs.GetString("shellworks:ATTITUDE");
parent = ((Component)this).GetComponentInParent<Character>();
if (unlockedAttitudes.Contains(@string) && !AttitudeHandler.attitudes.TryGetValue(@string, out currentAttitude))
{
Plugin.Log.LogError((object)(@string + " is Not A Valid Attitude"));
}
if (parent.view.IsMine)
{
((MonoBehaviour)this).StartCoroutine(delayedCurrent());
}
}
[IteratorStateMachine(typeof(<delayedCurrent>d__23))]
public IEnumerator delayedCurrent()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <delayedCurrent>d__23(0)
{
<>4__this = this
};
}
private void Update()
{
if (isLocal && Object.op_Implicit((Object)(object)Character.localCharacter) && currentAttitude != null)
{
input.Sample(playerMovementActive: true);
UpdateVariablesFixed();
}
}
private void FixedUpdate()
{
if (isLocal && Object.op_Implicit((Object)(object)Character.localCharacter) && currentAttitude != null)
{
currentAttitude.UpdateAttitude(parent, this);
tickcount++;
}
}
private void UpdateVariablesFixed()
{
if (input.specialWasPressed)
{
currentAttitude.onPress(parent, this);
}
if (input.specialIsHeld)
{
sinceSpecialPressTime += Time.fixedDeltaTime;
currentAttitude.onHeld(parent, this, sinceSpecialPressTime);
}
if (input.specialWasReleased)
{
currentAttitude.onRelease(parent, this, sinceSpecialPressTime);
sinceSpecialPressTime = 0f;
}
}
[PunRPC]
public void RPCA_AddStatusCurse(int target)
{
Character component = ((Component)PhotonView.Find(target)).GetComponent<Character>();
if (component.IsLocal)
{
Character.localCharacter.refs.afflictions.AddStatus((STATUSTYPE)5, 0.001f, false);
}
}
[PunRPC]
public void RPCA_AddStatusStamina(int target)
{
Character component = ((Component)PhotonView.Find(target)).GetComponent<Character>();
if (component.IsLocal)
{
component.AddStamina(0.001f);
}
}
[PunRPC]
public void RPCA_AddStatusStaminaCap(int target, int id, float stamina)
{
Character component = ((Component)PhotonView.Find(target)).GetComponent<Character>();
if (component.IsLocal)
{
Affliction val = (Affliction)(object)new Affliction_Hyped(stamina, shouldremove: false, id);
component.refs.afflictions.AddAffliction(val, false);
}
}
[PunRPC]
public void RPCA_RemoveStatusStaminaCap(int target, int id)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
Character component = ((Component)PhotonView.Find(target)).GetComponent<Character>();
Affliction val = default(Affliction);
if (component.IsLocal && component.refs.afflictions.HasAfflictionType((IEnumerable<Affliction>)component.refs.afflictions.afflictionList, AttitudeCharacterAfflictions.HYPED, ref val) && val is Affliction_Hyped affliction_Hyped && affliction_Hyped.causer == id)
{
component.refs.afflictions.RemoveAffliction(val, false);
}
}
[PunRPC]
public void RPCA_AddStatusExtraStamina(int target)
{
Character component = ((Component)PhotonView.Find(target)).GetComponent<Character>();
if (component.IsLocal)
{
component.AddExtraStamina(0.0005f);
}
}
[PunRPC]
public void RPCA_AddStinkoid(int id)
{
Character component = ((Component)PhotonView.Find(id)).GetComponent<Character>();
GameObject val = Object.Instantiate<GameObject>(Plugin.stinkcloud, ((Component)component.GetBodypart((BodypartType)2)).transform, false);
Plugin.Log.LogMessage((object)"STUNK");
}
[PunRPC]
public void RPCA_ThrowYay(float mod, int id, int myid)
{
((MonoBehaviour)this).StartCoroutine(IThrow(mod, id, myid));
}
[IteratorStateMachine(typeof(<IThrow>d__34))]
private IEnumerator IThrow(float mod, int id, int myid)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <IThrow>d__34(0)
{
mod = mod,
id = id,
myid = myid
};
}
[PunRPC]
public void RPCA_Punch(float mod, int id, int myid)
{
//IL_0047: 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_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: 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_0063: 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)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
Character component = ((Component)PhotonView.Find(myid)).GetComponent<Character>();
Character component2 = ((Component)PhotonView.Find(id)).GetComponent<Character>();
if (component2.IsLocal)
{
GamefeelHandler.instance.AddPerlinShake(15f * mod, 0.5f, 15f);
}
if (mod != 0f)
{
Vector3 val = Vector3.Normalize(component.Center - component2.Center);
Vector3 val2 = val * 2000f * mod;
component2.RPCA_Fall(1f);
component2.AddForce(val2, 0.7f, 1f);
component2.refs.afflictions.AddStatus((STATUSTYPE)0, 0.0125f * (mod * 0.05f), true);
if (!component.refs.view.IsMine && component2.refs.view.IsMine)
{
GUIManager.instance.InjuryFX(mod);
}
}
}
[PunRPC]
public void RPCA_BEHELD(int id, int myid)
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
Character component = ((Component)PhotonView.Find(myid)).GetComponent<Character>();
Character component2 = ((Component)PhotonView.Find(id)).GetComponent<Character>();
component2.DragTowards(((Component)component.GetBodypartRig((BodypartType)10)).transform.position, 150f);
component2.LimitFalling();
}
[PunRPC]
public void RPCA_GRISP(int id, int myid)
{
Character component = ((Component)PhotonView.Find(myid)).GetComponent<Character>();
Character component2 = ((Component)PhotonView.Find(id)).GetComponent<Character>();
if (component.GetTotalStamina() > component2.GetTotalStamina())
{
ItemSlot itemSlot = component.player.GetItemSlot(component.refs.items.currentSelectedSlot.Value);
component.player.AddItem(component2.data.currentItem.itemID, component2.data.currentItem.data, ref itemSlot);
component2.player.GetItemSlot(component2.refs.items.currentSelectedSlot.Value).prefab.Consume();
component2.player.GetItemSlot(component2.refs.items.currentSelectedSlot.Value).EmptyOut();
}
}
[PunRPC]
public void RPCA_UpdateAttitude(int id, string option)
{
}
}
public class Attitude
{
[Serializable]
public class AttitudeUIData
{
public string attitudeName;
public string likes;
public string dislikes;
public Texture2D icon;
public Vector3 iconPositionOffset;
public Vector3 iconRotationOffset;
public float iconScaleOffset = 1f;
public AttitudeUIData(string attitudeName, string likes, string dislikes, Texture2D icon)
{
this.attitudeName = attitudeName;
this.likes = likes;
this.dislikes = dislikes;
this.icon = icon;
}
public AttitudeUIData(string attitudeName, string likes, string dislikes, Texture2D icon, Vector3 iconPositionOffset, Vector3 iconRotationOffset, float iconScaleOffset)
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: 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)
this.attitudeName = attitudeName;
this.likes = likes;
this.dislikes = dislikes;
this.icon = icon;
this.iconPositionOffset = iconPositionOffset;
this.iconRotationOffset = iconRotationOffset;
this.iconScaleOffset = iconScaleOffset;
}
}
private AttitudeUIData baddata = new AttitudeUIData("NONE", "Water without any ice", "The term 'normie'", Icons.NONE);
private string dictcode = "NONE";
public virtual string getDictCode()
{
return dictcode;
}
public virtual AttitudeUIData GetUIData()
{
return baddata;
}
public virtual void OnAdd(Character cha)
{
}
public virtual void OnRemove(Character cha)
{
}
public virtual void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
}
public virtual void onHeld(Character cha, AttitudePlayerAttachment attitudePlayerAttachment, float sinceSpecialPressTime)
{
}
public virtual void onPress(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
}
public virtual void onRelease(Character cha, AttitudePlayerAttachment attitudePlayerAttachment, float sinceSpecialPressTime)
{
}
}
public class BookWormAttitude : Attitude
{
private AttitudeUIData uidata = new AttitudeUIData("BOOKWORM", "learning!", "long walks :(", Icons.BOOKWORM);
private string dictcode = "BOOKWORM";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
}
}
public class BullyAttitude : Attitude
{
public int timer = 10000;
private AttitudeUIData uidata = new AttitudeUIData("BULLY", "hurting others", "thinking about home.", Icons.BULLY);
private string dictcode = "BULLY";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void onPress(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
if (!cha.data.dead && (Object)(object)cha.data.currentItem == (Object)null)
{
attitudePlayerAttachment.target = GetTarget(cha);
_ = (Object)(object)attitudePlayerAttachment.target != (Object)null;
}
}
public override void onHeld(Character cha, AttitudePlayerAttachment attitudePlayerAttachment, float sinceSpecialPressTime)
{
if (cha.view.IsMine && (Object)(object)attitudePlayerAttachment.target != (Object)null)
{
HoldPlayer(cha, attitudePlayerAttachment, 0f);
Plugin.Log.LogMessage((object)("I:" + ((object)cha)?.ToString() + " am Trying to hold : " + (object)attitudePlayerAttachment.target));
}
}
public override void onRelease(Character cha, AttitudePlayerAttachment attitudePlayerAttachment, float sinceSpecialPressTime)
{
if (!((Object)(object)attitudePlayerAttachment.target != (Object)null))
{
return;
}
if (sinceSpecialPressTime >= 1f)
{
float num = sinceSpecialPressTime / 10f;
Plugin.Log.LogMessage((object)("Trying to throw : " + (object)attitudePlayerAttachment.target));
cha.view.RPC("RPCA_ThrowYay", (RpcTarget)0, new object[3]
{
num,
attitudePlayerAttachment.target.view.ViewID,
cha.view.ViewID
});
cha.UseStamina(num, true);
attitudePlayerAttachment.isThrowing = false;
attitudePlayerAttachment.target = null;
}
else if (cha.input.interactIsPressed)
{
if ((Object)(object)cha.data.currentItem == (Object)null && (Object)(object)attitudePlayerAttachment.target.data.currentItem != (Object)null)
{
cha.view.RPC("RPCA_GRISP", (RpcTarget)0, new object[2]
{
attitudePlayerAttachment.target.view.ViewID,
cha.view.ViewID
});
}
}
else if (sinceSpecialPressTime > 0.01f)
{
Plugin.Log.LogMessage((object)("Trying to BOP : " + (object)attitudePlayerAttachment.target));
cha.view.RPC("RPCA_Punch", (RpcTarget)0, new object[3]
{
sinceSpecialPressTime,
attitudePlayerAttachment.target.view.ViewID,
cha.view.ViewID
});
cha.UseStamina(sinceSpecialPressTime * 0.2f, true);
attitudePlayerAttachment.isThrowing = false;
attitudePlayerAttachment.target = null;
}
}
private void HoldPlayer(Character cha, AttitudePlayerAttachment attitudePlayerAttachment, float power)
{
cha.view.RPC("RPCA_BEHELD", (RpcTarget)0, new object[2]
{
attitudePlayerAttachment.target.view.ViewID,
cha.view.ViewID
});
cha.UseStamina((((Vector3)(ref attitudePlayerAttachment.target.data.worldMovementInput)).magnitude > 0f) ? (0.01f * attitudePlayerAttachment.target.GetTotalStamina()) : 0.001f, true);
if (cha.OutOfStamina())
{
Plugin.Log.LogMessage((object)("Dropped : " + (object)attitudePlayerAttachment.target));
cha.view.RPC("RPCA_ThrowYay", (RpcTarget)0, new object[3]
{
0,
attitudePlayerAttachment.target.view.ViewID,
cha.view.ViewID
});
attitudePlayerAttachment.isThrowing = false;
attitudePlayerAttachment.target = null;
}
}
private Character GetTarget(Character cha)
{
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
Character val = null;
float num = float.MaxValue;
foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
{
Plugin.Log.LogMessage((object)("Considering Yanking : " + (object)allPlayerCharacter));
float num2 = Vector3.Angle(((Component)MainCamera.instance).transform.forward, allPlayerCharacter.Center - ((Component)MainCamera.instance).transform.position);
if ((double)num2 < (double)num && (Object)(object)allPlayerCharacter != (Object)(object)cha && Vector3.Distance(allPlayerCharacter.Center, cha.Center) < 2f)
{
num = num2;
val = allPlayerCharacter;
}
}
Plugin.Log.LogMessage((object)("Trying to yank : " + (object)val));
return val;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
if (!cha.data.dead && !cha.refs.afflictions.m_inAirport && attitudePlayerAttachment.tickcount > timer)
{
attitudePlayerAttachment.tickcount = 0;
cha.refs.afflictions.AddStatus((STATUSTYPE)5, 0.025f, false);
}
}
}
public class ClassClownAttitude : Attitude
{
public static float threshold = 10f;
public int timer = 20;
private AttitudeUIData uidata = new AttitudeUIData("CLASS CLOWN", "making my friends happy!", "the inevitability of death...", Icons.CLASSCLOWN);
private string dictcode = "CLASS_CLOWN";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: 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)
if (attitudePlayerAttachment.tickcount <= timer)
{
return;
}
attitudePlayerAttachment.tickcount = 0;
foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
{
if (allPlayerCharacter.data.dead)
{
continue;
}
if (cha.data.dead)
{
if (Vector3.Distance(cha.Ghost.m_target.Center, allPlayerCharacter.Center) <= threshold)
{
cha.view.RPC("RPCA_AddStatusCurse", (RpcTarget)0, new object[1] { allPlayerCharacter.view.ViewID });
}
}
else if (Vector3.Distance(cha.Center, allPlayerCharacter.Center) <= threshold)
{
cha.view.RPC("RPCA_AddStatusStamina", (RpcTarget)0, new object[1] { allPlayerCharacter.view.ViewID });
if ((Object)(object)((Component)cha).gameObject.GetComponent<PhotonVoiceView>() != (Object)null && (Object)(object)((Component)cha).gameObject.GetComponent<PhotonVoiceView>().RecorderInUse != (Object)null && ((Component)cha).gameObject.GetComponent<PhotonVoiceView>().RecorderInUse.LevelMeter.CurrentAvgAmp > 0.01f)
{
cha.view.RPC("RPCA_AddStatusExtraStamina", (RpcTarget)0, new object[1] { allPlayerCharacter.view.ViewID });
}
}
}
}
}
public class ExcitableAttitude : Attitude
{
public static float threshold = 10.5f;
public static int timer = 250;
private AttitudeUIData uidata = new AttitudeUIData("EXCITABLE", "RUNNING FAST", "getting sleepy", Icons.EXCITABLE);
private string dictcode = "EXCITABLE";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void OnAdd(Character cha)
{
base.OnAdd(cha);
}
public override void onPress(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
if (!(cha.data.extraStamina > 0f))
{
return;
}
cha.refs.afflictions.AddAffliction((Affliction)(object)new Affliction_Hyped(cha.data.extraStamina, shouldremove: true, ((MonoBehaviourPun)cha).photonView.ViewID), false);
foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
{
if (!allPlayerCharacter.data.dead && (Object)(object)cha != (Object)(object)allPlayerCharacter && !cha.data.dead && Vector3.Distance(cha.Center, allPlayerCharacter.Center) <= threshold)
{
cha.view.RPC("RPCA_AddStatusStaminaCap", (RpcTarget)0, new object[3]
{
allPlayerCharacter.view.ViewID,
cha.view.ViewID,
cha.data.extraStamina
});
}
}
}
public override void onRelease(Character cha, AttitudePlayerAttachment attitudePlayerAttachment, float sinceSpecialPressTime)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
Affliction val = default(Affliction);
if (cha.refs.afflictions.HasAfflictionType((IEnumerable<Affliction>)cha.refs.afflictions.afflictionList, AttitudeCharacterAfflictions.HYPED, ref val))
{
cha.refs.afflictions.RemoveAffliction(val, false);
}
foreach (Character allPlayerCharacter in PlayerHandler.GetAllPlayerCharacters())
{
if (!allPlayerCharacter.data.dead && (Object)(object)cha != (Object)(object)allPlayerCharacter && !cha.data.dead)
{
cha.view.RPC("RPCA_RemoveStatusStaminaCap", (RpcTarget)0, new object[2]
{
((MonoBehaviourPun)allPlayerCharacter).photonView.ViewID,
((MonoBehaviourPun)cha).photonView.ViewID
});
}
}
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
if (attitudePlayerAttachment.tickcount % timer == 0 && !(cha.data.extraStamina > 0f))
{
cha.refs.afflictions.AddStatus((STATUSTYPE)6, 0.0125f, false);
}
}
}
public class FreakAttitude : Attitude
{
public static int timer = 1000;
private AttitudeUIData uidata = new AttitudeUIData("FREAK", "Gross stuff", "You.", Icons.FREAK);
private string dictcode = "FREAK";
private Random rand;
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
if (attitudePlayerAttachment.tickcount % timer == 0 && ((Random)(ref rand)).NextInt(100) == 0)
{
cha.view.RPC("RPCA_AddStinkoid", (RpcTarget)0, new object[1] { cha.view.ViewID });
}
}
}
public class GoldenChildAttitude : Attitude
{
public static int timer = 200;
private AttitudeUIData uidata = new AttitudeUIData("GOLDEN CHILD", "Being Praised For My Abilities", "When I Mess Up", Icons.GOLDENCHILD);
private string dictcode = "GOLDEN_CHILD";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
if (attitudePlayerAttachment.tickcount > timer)
{
attitudePlayerAttachment.tickcount = 0;
UpdateGrade(cha, attitudePlayerAttachment);
}
}
public override void OnAdd(Character cha)
{
((Behaviour)((Component)cha).GetComponent<AttitudePlayerAttachment>().TMPGrade).enabled = true;
UpdateGrade(cha, ((Component)cha).GetComponent<AttitudePlayerAttachment>());
}
public override void OnRemove(Character cha)
{
((Behaviour)((Component)cha).GetComponent<AttitudePlayerAttachment>().TMPGrade).enabled = false;
}
public void UpdateGrade(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: 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)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_0242: Unknown result type (might be due to invalid IL or missing references)
//IL_0294: Unknown result type (might be due to invalid IL or missing references)
//IL_02e6: Unknown result type (might be due to invalid IL or missing references)
//IL_037c: Unknown result type (might be due to invalid IL or missing references)
//IL_0335: Unknown result type (might be due to invalid IL or missing references)
float num = (attitudePlayerAttachment.grade = GradePercent(cha, attitudePlayerAttachment));
if (num >= 100f)
{
attitudePlayerAttachment.gradeLetter = "A++";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.yellow;
cha.refs.afflictions.AddAffliction((Affliction)(object)new Affliction_Golden(1.25f), false);
}
else if (num >= 98f)
{
attitudePlayerAttachment.gradeLetter = "A+";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.green;
cha.refs.afflictions.AddAffliction((Affliction)(object)new Affliction_Golden(0.95f), false);
}
else if (num >= 95f)
{
attitudePlayerAttachment.gradeLetter = "A";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.green;
cha.refs.afflictions.AddAffliction((Affliction)(object)new Affliction_Golden(0.5f), false);
}
else if (num >= 90f)
{
attitudePlayerAttachment.gradeLetter = "A-";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.green;
cha.refs.afflictions.AddAffliction((Affliction)(object)new Affliction_Golden(0.125f), false);
}
else if (num >= 88f)
{
attitudePlayerAttachment.gradeLetter = "B+";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.green;
cha.refs.afflictions.AddAffliction((Affliction)(object)new Affliction_Golden(0.0025f), false);
}
else if (num >= 85f)
{
attitudePlayerAttachment.gradeLetter = "B";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.green;
}
else if (num >= 80f)
{
attitudePlayerAttachment.gradeLetter = "B-";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.green;
}
else if (num >= 78f)
{
attitudePlayerAttachment.gradeLetter = "C+";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.red;
}
else if (num >= 75f)
{
attitudePlayerAttachment.gradeLetter = "C";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.red;
cha.view.RPC("RPCA_AddStatusCurse", (RpcTarget)0, new object[1] { cha.view.ViewID });
}
else if (num >= 70f)
{
attitudePlayerAttachment.gradeLetter = "C-";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.red;
cha.view.RPC("RPCA_AddStatusCurse", (RpcTarget)0, new object[1] { cha.view.ViewID });
}
else if (num >= 68f)
{
attitudePlayerAttachment.gradeLetter = "D+";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.red;
cha.view.RPC("RPCA_AddStatusCurse", (RpcTarget)0, new object[1] { cha.view.ViewID });
}
else if (num >= 65f)
{
attitudePlayerAttachment.gradeLetter = "D";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.red;
cha.view.RPC("RPCA_AddStatusCurse", (RpcTarget)0, new object[1] { cha.view.ViewID });
}
else if (num >= 60f)
{
attitudePlayerAttachment.gradeLetter = "D-";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.red;
cha.view.RPC("RPCA_AddStatusCurse", (RpcTarget)0, new object[1] { cha.view.ViewID });
}
else
{
attitudePlayerAttachment.gradeLetter = "F";
((Graphic)attitudePlayerAttachment.TMPGrade).color = Color.red;
cha.DieInstantly();
}
((TMP_Text)attitudePlayerAttachment.TMPGrade).text = attitudePlayerAttachment.gradeLetter;
}
public float GradePercent(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
float num = 100f;
num -= GradeDeductionByPlacement(cha, attitudePlayerAttachment);
num -= GradeDeductionByAilments(cha, attitudePlayerAttachment) * ((num == 100f) ? 1.75f : 1f);
return num + cha.data.extraStamina * 10f;
}
public float GradeDeductionByAilments(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
float num = 0f;
num = cha.refs.afflictions.statusSum - cha.refs.afflictions.GetCurrentStatus((STATUSTYPE)5);
return num * 30f;
}
public float GradeDeductionByPlacement(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
//IL_0064: Unknown result type (might be due to invalid IL or missing references)
//IL_006f: Unknown result type (might be due to invalid IL or missing references)
float num = 25f;
float num2 = 0f;
float num3 = 0f;
List<Character> allCharacters = Character.AllCharacters;
foreach (Character item in allCharacters)
{
num2 += 1f;
if (!item.isBot && !item.data.dead && !item.data.fullyPassedOut && (Object)(object)cha != (Object)(object)item && item.Center.y - cha.Center.y > 3f)
{
num3 += 1f;
}
}
return num / Mathf.Max(num2, 1f) * num3;
}
}
public class GothAttitude : Attitude
{
public int timer = 100;
private AttitudeUIData uidata = new AttitudeUIData("GOTH", "Death~", "the sun", Icons.GOTH);
private string dictcode = "GOTH";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: 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_0084: Unknown result type (might be due to invalid IL or missing references)
if (cha.data.dead || cha.refs.afflictions.m_inAirport || attitudePlayerAttachment.tickcount <= timer)
{
return;
}
attitudePlayerAttachment.tickcount = 0;
if (DayNightManager.instance.isDay == 1f)
{
float num = LightVolume.Instance().SamplePositionAlpha((((Component)cha.GetBodypart((BodypartType)13)).transform.position + ((Component)cha.GetBodypart((BodypartType)16)).transform.position) * 0.5f) * 1.75f;
num *= ((!cha.data.isCrouching) ? 0.75f : 1f);
Plugin.Log.LogMessage((object)("ll:" + num));
Plugin.Log.LogMessage((object)("total heat to add:" + num * 0.0125f));
if (num >= 0.25f)
{
cha.refs.afflictions.AddStatus((STATUSTYPE)8, 0.025f * num, false);
}
}
else if (Character.AllCharacters.Count == 1)
{
cha.refs.afflictions.AdjustStatus((STATUSTYPE)0, -0.0005f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)3, -0.0001f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)2, -0.0002f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)8, -0.00015f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)5, -1E-05f, false);
}
for (int i = 0; i < Character.AllCharacters.Count; i++)
{
if (Character.AllCharacters[i].data.dead && (Object)(object)Character.AllCharacters[i].Ghost.m_target == (Object)(object)cha)
{
cha.refs.afflictions.AdjustStatus((STATUSTYPE)0, -0.001f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)3, -0.0001f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)2, -0.0002f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)8, -0.00015f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)1, -0.0015f, false);
cha.refs.afflictions.AdjustStatus((STATUSTYPE)5, -1E-05f, false);
}
}
}
}
public class NaughtyAttitude : Attitude
{
private AttitudeUIData uidata = new AttitudeUIData("NAUGHTY", "HATE/KILL", "LOVE", Icons.NAUGHTY);
private string dictcode = "NAUGHTY";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
}
}
public class PickyEaterAttitude : Attitude
{
private AttitudeUIData uidata = new AttitudeUIData("PICKY EATER", "My favorite food!", "Yucky food...", Icons.PICKYEATER);
private string dictcode = "PICKY_EATER";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
}
public void EatDifferent()
{
}
}
public class PoindexterAttitude : Attitude
{
private AttitudeUIData uidata = new AttitudeUIData("POINDEXTER", "Teaching others.", "When people call me boring...", Icons.POINDEXTER);
private string dictcode = "POINDEXTER";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
}
}
public class StickyAttitude : Attitude
{
private AttitudeUIData uidata = new AttitudeUIData("STICKY", "THAT I CLING LIKE A GECKO", "WHEN OTHER KIDS GET STUCK TO ME", Icons.STICKY);
private string dictcode = "STICKY";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
}
}
public class SweetieAttitude : Attitude
{
public static int timer = 500;
private AttitudeUIData uidata = new AttitudeUIData("SWEETIE", "mytoybeartiffles", "ifilostmytoybear:(", Icons.SWEETIE);
private string dictcode = "SWEETIE";
public override string getDictCode()
{
return dictcode;
}
public override AttitudeUIData GetUIData()
{
return uidata;
}
public override void OnAdd(Character cha)
{
if (AttitudeHandler.IsCharacterAttitude("SWEETIE", cha))
{
cha.refs.items.SpawnItemInHand(((Object)((Component)Plugin.Tif).gameObject).name);
}
}
public override void OnRemove(Character cha)
{
ItemSlot[] itemSlots = cha.player.itemSlots;
foreach (ItemSlot val in itemSlots)
{
if (val.GetPrefabName() == ((Object)((Component)Plugin.Tif).gameObject).name)
{
val.prefab.Consume();
val.EmptyOut();
}
}
}
public override void UpdateAttitude(Character cha, AttitudePlayerAttachment attitudePlayerAttachment)
{
if (cha.data.dead || cha.refs.afflictions.m_inAirport || attitudePlayerAttachment.tickcount <= timer)
{
return;
}
attitudePlayerAttachment.tickcount = 0;
bool flag = true;
ItemSlot[] itemSlots = cha.player.itemSlots;
foreach (ItemSlot val in itemSlots)
{
if (val.GetPrefabName() == ((Object)((Component)Plugin.Tif).gameObject).name)
{
flag = false;
}
}
if (flag)
{
cha.refs.afflictions.AddStatus((STATUSTYPE)5, 0.0125f, false);
}
}
}
public class ActionMagazine : ItemAction
{
public override void RunAction()
{
MagazineHandler.instance.ToggleOpen();
}
}
public class MagazineButton : MonoBehaviour
{
public TMP_Text title;
public TMP_Text likes;
public TMP_Text dislikes;
public Button button;
public MagazineHandler manager;
public RawImage icon;
public RawImage lockedIcon;
public RawImage border;
public string attitude;
private int currentIndex;
public void SetButton(string tude, int index)
{
if (AttitudeHandler.attitudes.ContainsKey(tude))
{
((Component)this).gameObject.SetActive(true);
if (!AttitudeHandler.IsCharacterAttitudeUnlocked(tude, Character.localCharacter) && !manager.testUnlockAll)
{
((Component)lockedIcon).gameObject.SetActive(true);
((Component)icon).gameObject.SetActive(false);
title.text = "??????";
likes.text = "Likes:???";
dislikes.text = "Dislikes:???";
}
else
{
((Component)lockedIcon).gameObject.SetActive(false);
((Component)icon).gameObject.SetActive(true);
icon.texture = (Texture)(object)AttitudeHandler.attitudes.GetValueOrDefault(tude).GetUIData().icon;
title.text = AttitudeHandler.attitudes.GetValueOrDefault(tude).GetUIData().attitudeName;
likes.text = "Likes: " + AttitudeHandler.attitudes.GetValueOrDefault(tude).GetUIData().likes;
dislikes.text = "Dislikes: " + AttitudeHandler.attitudes.GetValueOrDefault(tude).GetUIData().dislikes;
}
}
else
{
((Component)this).gameObject.SetActive(false);
}
attitude = tude;
currentIndex = index;
}
public void Click()
{
if (AttitudeHandler.IsCharacterAttitudeUnlocked(attitude, Character.localCharacter) || manager.testUnlockAll)
{
manager.SetOption(attitude, currentIndex);
}
EventSystem.current.SetSelectedGameObject((GameObject)null);
}
}
public class MagazineHandler : MenuWindow
{
[CompilerGenerated]
private sealed class <CloseRoutine>d__22 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public MagazineHandler <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <CloseRoutine>d__22(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
int num = <>1__state;
MagazineHandler magazineHandler = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
Plugin.Log.LogDebug((object)("IT SHOULD CLOSE THIS:" + (object)magazineHandler.uiObject));
magazineHandler.closing = true;
magazineHandler.CameraIn();
<>2__current = (object)new WaitForSeconds(0.5f);
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
magazineHandler.uiObject.SetActive(false);
magazineHandler.closing = false;
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 static MagazineHandler instance;
public GameObject uiObject;
public MagazineButton[] buttons;
public Color inactiveBorderColor = Color.white;
public Color activeBorderColor = Color.black;
public bool testUnlockAll;
public bool closing;
public override bool openOnStart => false;
public override bool selectOnOpen => true;
public override Selectable objectToSelectOnOpen => (Selectable)(object)buttons[0].button;
public override bool closeOnPause => true;
public override bool closeOnUICancel => true;
public override bool autoHideOnClose => false;
public void Awake()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Expected O, but got Unknown
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Expected O, but got Unknown
//IL_0330: Unknown result type (might be due to invalid IL or missing references)
//IL_0335: Unknown result type (might be due to invalid IL or missing references)
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
instance = this;
uiObject = ((Component)((Component)this).gameObject.transform.GetChild(0)).gameObject;
((UnityEvent)((Component)TransformExtensions.FindChildRecursive(((Component)this).gameObject.transform, "UI_Close")).GetComponent<Button>().onClick).AddListener((UnityAction)delegate
{
((MenuWindow)((Component)this).GetComponent<MagazineHandler>()).Close();
});
GameObject gameObject = ((Component)TransformExtensions.FindChildRecursive(((Component)this).gameObject.transform, "GridMagazine")).gameObject;
int num = 0;
buttons = new MagazineButton[AttitudeHandler.attitudes.Count];
foreach (Attitude value in AttitudeHandler.attitudes.Values)
{
GameObject val = Object.Instantiate<GameObject>(Plugin.MagButton, gameObject.transform);
MagazineButton magazineButton = val.AddComponent<MagazineButton>();
magazineButton.button = val.GetComponent<Button>();
((UnityEvent)val.GetComponent<Button>().onClick).AddListener(new UnityAction(magazineButton.Click));
magazineButton.manager = this;
magazineButton.icon = ((Component)TransformExtensions.FindChildRecursive(val.transform, "Icon")).GetComponent<RawImage>();
magazineButton.lockedIcon = ((Component)TransformExtensions.FindChildRecursive(val.transform, "LockedIcon")).GetComponent<RawImage>();
magazineButton.border = ((Component)TransformExtensions.FindChildRecursive(val.transform, "Border")).GetComponent<RawImage>();
magazineButton.title = ((Component)TransformExtensions.FindChildRecursive(val.transform, "Title")).GetComponent<TMP_Text>();
magazineButton.title.font = Resources.FindObjectsOfTypeAll<TMP_FontAsset>().ToList().Find((TMP_FontAsset x) => ((Object)x).name == "Montserrat-ExtraBold SDF");
magazineButton.title.fontMaterial = Resources.FindObjectsOfTypeAll<Material>().ToList().Find((Material x) => ((Object)x).name == "Montserrat-ExtraBold SDF Material");
magazineButton.likes = ((Component)TransformExtensions.FindChildRecursive(val.transform, "Likes")).GetComponent<TMP_Text>();
magazineButton.likes.font = Resources.FindObjectsOfTypeAll<TMP_FontAsset>().ToList().Find((TMP_FontAsset x) => ((Object)x).name == "Montserrat-ExtraBold SDF");
magazineButton.likes.fontMaterial = Resources.FindObjectsOfTypeAll<Material>().ToList().Find((Material x) => ((Object)x).name == "Montserrat-ExtraBold SDF Material");
magazineButton.dislikes = ((Component)TransformExtensions.FindChildRecursive(val.transform, "Dislikes")).GetComponent<TMP_Text>();
magazineButton.dislikes.font = Resources.FindObjectsOfTypeAll<TMP_FontAsset>().ToList().Find((TMP_FontAsset x) => ((Object)x).name == "Montserrat-ExtraBold SDF");
magazineButton.dislikes.fontMaterial = Resources.FindObjectsOfTypeAll<Material>().ToList().Find((Material x) => ((Object)x).name == "Montserrat-ExtraBold SDF Material");
if (num == 3 || num == 4 || num == 5 || num == 9 || num == 10 || num == 11 || num == 15 || num == 16 || num == 17)
{
Vector3 position = magazineButton.title.transform.position;
position.x += 18f;
magazineButton.title.transform.position = position;
}
buttons[num++] = magazineButton;
}
uiObject.SetActive(false);
}
public void ToggleOpen()
{
if (closing)
{
return;
}
if (!((MenuWindow)this).isOpen)
{
((MenuWindow)this).Open();
for (int i = 0; i < AttitudeHandler.attitudes.Count; i++)
{
buttons[i].SetButton(AttitudeHandler.attitudes.Keys.ElementAt(i), i);
}
SetActiveButton(AttitudeHandler.GetCurrentAttitude(Character.localCharacter));
uiObject.SetActive(true);
}
else
{
((MenuWindow)this).Close();
}
}
public override void OnClose()
{
((MonoBehaviour)this).StartCoroutine(CloseRoutine());
}
[IteratorStateMachine(typeof(<CloseRoutine>d__22))]
public IEnumerator CloseRoutine()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <CloseRoutine>d__22(0)
{
<>4__this = this
};
}
public void CameraIn()
{
}
public void CameraOut()
{
}
public void SetActiveButton(string tude)
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: 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_0050: Unknown result type (might be due to invalid IL or missing references)
Color color = Singleton<Customization>.Instance.skins[GameHandler.GetService<PersistentPlayerDataService>().GetPlayerData(PhotonNetwork.LocalPlayer).customizationData.currentSkin].color;
for (int i = 0; i < buttons.Length; i++)
{
((Graphic)buttons[i].border).color = ((tude == buttons[i].attitude) ? ColorExtensions.Pow(color, 2f) : Color.clear);
}
}
public void SetOption(string option, int index)
{
AttitudeHandler.SetAttitude(option, Character.localCharacter);
Character.localCharacter.view.RPC("RPCA_UpdateAttitude", (RpcTarget)0, new object[2]
{
Character.localCharacter.view.ViewID,
option
});
SetActiveButton(option);
}
}
public class AttitudeAttribute : EnumAttr
{
public Attitude attitude { get; set; } = new Attitude();
public AttitudeAttribute(Attitude at)
{
attitude = at;
}
}
public class AttitudeCharacterInput : MonoBehaviour
{
public static InputAction action_special;
public bool specialWasPressed;
public bool specialIsHeld;
public bool specialWasReleased;
public static void Init()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
InputActionMap val = InputSystem.actions.actionMaps[0];
action_special = InputActionSetupExtensions.AddAction(val, "Special", (InputActionType)0, (string)null, (string)null, (string)null, (string)null, (string)null);
InputActionSetupExtensions.AddBinding(action_special, "<Keyboard>/f", (string)null, (string)null, (string)null);
}
public static void lateInit()
{
action_special.Enable();
}
internal void Sample(bool playerMovementActive)
{
ResetInput();
specialWasPressed = action_special.WasPressedThisFrame();
specialWasReleased = action_special.WasReleasedThisFrame();
specialIsHeld = action_special.IsPressed();
}
internal void SampleAlways()
{
}
internal void ResetInput()
{
specialWasPressed = false;
specialWasReleased = false;
specialIsHeld = false;
}
}
public static class Commands
{
[TypeParser(typeof(Attitude))]
public class AttitudeCLIParser : CLITypeParser
{
public override object Parse(string str)
{
return AttitudeHandler.attitudes.GetValueOrDefault(str);
}
public override List<ParameterAutocomplete> FindAutocomplete(string parameterText)
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
List<ParameterAutocomplete> list = new List<ParameterAutocomplete>();
if (string.IsNullOrEmpty(parameterText))
{
foreach (string key in AttitudeHandler.attitudes.Keys)
{
list.Add(new ParameterAutocomplete(key));
}
}
return list;
}
}
}
[AttributeUsage(AttributeTargets.Field, AllowMultiple = false, Inherited = true)]
public class EnumAttr : Attribute
{
}
public static class EnumExtension
{
public static EnumAttr GetAttr(this Enum value)
{
Type type = value.GetType();
FieldInfo field = type.GetField(value.ToString());
EnumAttr[] array = (EnumAttr[])field.GetCustomAttributes(typeof(EnumAttr), inherit: false);
if (array.Length == 0)
{
return null;
}
return array[0];
}
}
public static class Icons
{
public static Texture2D NONE = new Texture2D(2, 2);
public static Texture2D BOOKWORM = new Texture2D(2, 2);
public static Texture2D BULLY = new Texture2D(2, 2);
public static Texture2D CLASSCLOWN = new Texture2D(2, 2);
public static Texture2D EXCITABLE = new Texture2D(2, 2);
public static Texture2D FREAK = new Texture2D(2, 2);
public static Texture2D GOLDENCHILD = new Texture2D(2, 2);
public static Texture2D GOTH = new Texture2D(2, 2);
public static Texture2D NAUGHTY = new Texture2D(2, 2);
public static Texture2D PICKYEATER = new Texture2D(2, 2);
public static Texture2D POINDEXTER = new Texture2D(2, 2);
public static Texture2D STICKY = new Texture2D(2, 2);
public static Texture2D SWEETIE = new Texture2D(2, 2);
public static void Start()
{
ImageConversion.LoadImage(NONE, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-none.png")));
ImageConversion.LoadImage(BOOKWORM, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-bookworm.png")));
ImageConversion.LoadImage(BULLY, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-bully.png")));
ImageConversion.LoadImage(EXCITABLE, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-excitable.png")));
ImageConversion.LoadImage(FREAK, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-freak.png")));
ImageConversion.LoadImage(GOLDENCHILD, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-goldenchild.png")));
ImageConversion.LoadImage(GOTH, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-goth.png")));
ImageConversion.LoadImage(NAUGHTY, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-naughty.png")));
ImageConversion.LoadImage(POINDEXTER, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-pointdexter.png")));
ImageConversion.LoadImage(STICKY, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-sticky.png")));
ImageConversion.LoadImage(SWEETIE, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-sweetie.png")));
ImageConversion.LoadImage(PICKYEATER, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-pickyeaater.png")));
ImageConversion.LoadImage(CLASSCLOWN, File.ReadAllBytes(Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "icons/ICON-classclown.png")));
}
}
public static class SceneLoader
{
public static bool LoadedIslandStartup = true;
public static void Start()
{
SceneManager.sceneLoaded += OnSceneLoaded;
}
public static void OnSceneLoaded(Scene scene, LoadSceneMode mode)
{
if (((Scene)(ref scene)).name == "Airport")
{
GameObject val = GameObject.Find("GAME");
GameObject val2 = Object.Instantiate<GameObject>(Plugin.MagMan);
val2.transform.SetParent(val.transform);
GameObject val3 = GameObject.Find("PassportSpawner");
SpawnItemInHand val4 = val3.AddComponent<SpawnItemInHand>();
val4.item = Plugin.Bundle.LoadAsset<GameObject>("Maggy.prefab").GetComponent<Item>();
}
}
}
namespace BepInEx
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class BepInAutoPluginAttribute : Attribute
{
public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace BepInEx.Preloader.Core.Patching
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
[Conditional("CodeGeneration")]
internal sealed class PatcherAutoPluginAttribute : Attribute
{
public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null)
{
}
}
}
namespace ForbiddenFoods
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.github.Fetalpile", "ForbiddenFoods", "0.0.2")]
public class Plugin : BaseUnityPlugin
{
private class MyPatches
{
[HarmonyPatch(typeof(Character), "Start")]
[HarmonyPostfix]
private static void Character_Start(Character __instance)
{
if (!__instance.isBot && (Object)(object)__instance.player != (Object)null)
{
AttitudePlayerAttachment attitudePlayerAttachment = ((Component)__instance).gameObject.AddComponent<AttitudePlayerAttachment>();
attitudePlayerAttachment.isLocal = __instance.view.IsMine;
AttitudeCharacterInput input = ((Component)__instance).gameObject.AddComponent<AttitudeCharacterInput>();
attitudePlayerAttachment.input = input;
AttitudeCharacterInput.lateInit();
Log.LogInfo((object)("Added Component to: " + __instance.characterName));
}
}
[HarmonyPatch(typeof(Action_RestoreHunger), "RunAction")]
[HarmonyPrefix]
private static bool FixHunger(Action_RestoreHunger __instance)
{
if (AttitudeHandler.IsCharacterAttitude("PICKY_EATER", ((ItemActionBase)__instance).character))
{
float num = 0.9f;
if (((ItemActionBase)__instance).item.GetData<IntItemData>((DataEntryKey)1).Value == 2)
{
num = 1.5f;
((ItemActionBase)__instance).character.AddExtraStamina(num * 0.25f);
}
else
{
num = 0.5f;
}
((ItemActionBase)__instance).character.refs.afflictions.SubtractStatus((STATUSTYPE)1, __instance.restorationAmount * num, false);
return false;
}
return true;
}
[HarmonyPatch(typeof(CharacterAfflictions), "AddStatus")]
[HarmonyPrefix]
private static bool AddPoison(CharacterAfflictions __instance, ref STATUSTYPE statusType, ref float amount)
{
if (AttitudeHandler.IsCharacterAttitude("FREAK", __instance.character) && (int)statusType == 3)
{
return false;
}
return true;
}
[HarmonyPatch(typeof(CharacterMovement), "OnCollision")]
[HarmonyPrefix]
private static void CollideSpecial(CharacterMovement __instance, ref Collision collision, ref bool collisionEnter)
{
if (AttitudeHandler.IsCharacterAttitude("STICKY", __instance.character))
{
Character componentInParent = ((Component)collision.rigidbody).GetComponentInParent<Character>();
if (!((Object)(object)componentInParent == (Object)(object)__instance.character))
{
Object.op_Implicit((Object)(object)componentInParent);
}
}
}
[HarmonyPatch(typeof(Affliction), "CreateBlankAffliction")]
[HarmonyPostfix]
private static void CreateBlankAffliction(AfflictionType afflictionType, ref Affliction __result)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0001: 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_0017: Unknown result type (might be due to invalid IL or missing references)
if (afflictionType == AttitudeCharacterAfflictions.HYPED)
{
__result = (Affliction)(object)new Affliction_Hyped(1f, shouldremove: false, -1);
}
if (afflictionType == AttitudeCharacterAfflictions.GOLDEN)
{
__result = (Affliction)(object)new Affliction_Golden(1f);
}
}
}
public const string Id = "com.github.Fetalpile";
public static Plugin Instance { get; private set; }
internal static ManualLogSource Log { get; private set; }
internal static Harmony? Harmony { get; set; }
internal static AssetBundle Bundle { get; set; }
internal static AssetBundle BundleTiffles { get; set; }
internal static AssetBundle BundlePoison { get; set; }
internal static AssetBundle BundleSparkles { get; set; }
internal static AssetBundle BundleUI { get; set; }
internal static AssetBundle BundleButton { get; set; }
internal static AssetBundle BundleGolden { get; set; }
internal static GameObject MagButton { get; set; }
internal static GameObject MagMan { get; set; }
internal static GameObject Tiffles { get; set; }
internal static Item mag { get; set; }
internal static Item Tif { get; set; }
internal static GameObject stinkcloud { get; set; }
internal static GameObject sparkles { get; set; }
internal static GameObject goldenVFX { get; set; }
internal static ModDefinition Definition { get; set; }
public static string Name => "ForbiddenFoods";
public static string Version => "0.0.2";
public void Awake()
{
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_027a: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
Log = ((BaseUnityPlugin)this).Logger;
Definition = ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info.Metadata);
Instance = this;
Icons.Start();
AttitudeCharacterInput.Init();
string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "magazine");
Bundle = AssetBundle.LoadFromFile(text);
string text2 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "tiffles");
BundleTiffles = AssetBundle.LoadFromFile(text2);
Tiffles = BundleTiffles.LoadAsset<GameObject>("Stiffles.prefab");
string text3 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "golden");
BundleGolden = AssetBundle.LoadFromFile(text3);
goldenVFX = BundleGolden.LoadAsset<GameObject>("VFX_Screen_Golden.prefab");
((Renderer)goldenVFX.GetComponent<MeshRenderer>()).material.shader = Shader.Find("NickPost/Hot");
string text4 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "poisonstink");
BundlePoison = AssetBundle.LoadFromFile(text4);
stinkcloud = BundlePoison.LoadAsset<GameObject>("FREAK_STINK.prefab");
((Renderer)stinkcloud.GetComponent<ParticleSystemRenderer>()).material.shader = Shader.Find("Particle_Transparent");
stinkcloud.transform.position = Vector3.zero;
string text5 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "golden_sparkles");
BundleSparkles = AssetBundle.LoadFromFile(text5);
sparkles = BundleSparkles.LoadAsset<GameObject>("Golden_Sparkles.prefab");
sparkles.transform.position = Vector3.zero;
string text6 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "magazineui");
BundleUI = AssetBundle.LoadFromFile(text6);
MagMan = BundleUI.LoadAsset<GameObject>("MagazineManager.prefab");
MagMan.AddComponent<MagazineHandler>();
string text7 = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "magazinebutton");
BundleButton = AssetBundle.LoadFromFile(text7);
MagButton = BundleButton.LoadAsset<GameObject>("UI_MagazineButton.prefab");
Patch();
mag = Bundle.LoadAsset<GameObject>("Maggy.prefab").GetComponent<Item>();
ActionMagazine actionMagazine = ((Component)mag).gameObject.AddComponent<ActionMagazine>();
((ItemAction)actionMagazine).OnCastFinished = true;
Tif = Tiffles.GetComponent<Item>();
Log.LogInfo((object)Definition);
try
{
new ItemContent(mag).Register(Definition);
new ItemContent(Tif).Register(Definition);
}
catch (Exception ex)
{
Log.LogError((object)ex);
}
Harmony.CreateAndPatchAll(typeof(MyPatches), (string)null);
ConsoleCommands.TypeParsers.Add(typeof(Attitude), (CLITypeParser)(object)new Commands.AttitudeCLIParser());
SceneLoader.Start();
Log.LogInfo((object)("Plugin " + Name + " is loaded! Yay! :D"));
}
internal static void Patch()
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
if (Harmony == null)
{
Harmony = new Harmony(((BaseUnityPlugin)Instance).Info.Metadata.GUID);
}
Log.LogDebug((object)"Patching...");
Harmony.PatchAll();
Log.LogDebug((object)"Finished patching!");
}
}
}
namespace ForbiddenFoods.Patches
{
[HarmonyPatch(typeof(ItemCooking))]
internal class ItemCookingPatches
{
[HarmonyPrefix]
[HarmonyPatch("UpdateCookedBehavior")]
private static bool UpdateCookedBehaviorPrefix(ref ItemCooking __instance)
{
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
if (!__instance.setup)
{
__instance.setup = true;
__instance.renderers = ((Component)__instance).GetComponentsInChildren<MeshRenderer>();
Renderer[] combinedRenderers = GetCombinedRenderers(__instance);
__instance.defaultTints = (Color[])(object)new Color[combinedRenderers.Length];
for (int i = 0; i < combinedRenderers.Length; i++)
{
__instance.defaultTints[i] = combinedRenderers[i].material.GetColor("_Tint");
}
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch("CookVisually")]
private static bool CookVisuallyPrefix(ref ItemCooking __instance, int cookedAmount)
{
//IL_003a: 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)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
Renderer[] combinedRenderers = GetCombinedRenderers(__instance);
for (int i = 0; i < combinedRenderers.Length; i++)
{
if (cookedAmount > 0)
{
Debug.Log((object)$"Cooked amount is {cookedAmount}");
combinedRenderers[i].material.SetColor("_Tint", __instance.defaultTints[i] * ItemCooking.GetCookColor(cookedAmount));
}
}
return false;
}
private static Renderer[] GetCombinedRenderers(ItemCooking __instance)
{
SkinnedMeshRenderer[] componentsInChildren = ((Component)__instance).GetComponentsInChildren<SkinnedMeshRenderer>();
Renderer[] array = Array.Empty<Renderer>();
Renderer[] array2 = array;
Renderer[] renderers = (Renderer[])(object)__instance.renderers;
array = CollectionExtensions.AddRangeToArray<Renderer>(array2, renderers);
Renderer[] array3 = array;
renderers = (Renderer[])(object)componentsInChildren;
return CollectionExtensions.AddRangeToArray<Renderer>(array3, renderers);
}
}
[HarmonyPatch(typeof(Item))]
internal class ItemPatches
{
[HarmonyPrefix]
[HarmonyPatch("AddPropertyBlock")]
private static bool AddPropertyBlockPrefix(ref Item __instance)
{
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Expected O, but got Unknown
__instance.mainRenderer = (Renderer)(object)((Component)__instance).GetComponentInChildren<SkinnedMeshRenderer>();
if ((Object)(object)__instance.mainRenderer != (Object)null)
{
__instance.mpb = new MaterialPropertyBlock();
__instance.mainRenderer.GetPropertyBlock(__instance.mpb);
return false;
}
return true;
}
[HarmonyPrefix]
[HarmonyPatch("HoverEnter")]
private static bool HoverEnterPrefix(ref Item __instance)
{
__instance.mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 1f);
__instance.mainRenderer.SetPropertyBlock(__instance.mpb);
return false;
}
[HarmonyPrefix]
[HarmonyPatch("HoverExit")]
private static bool HoverExit(ref Item __instance)
{
__instance.mpb.SetFloat(Item.PROPERTY_INTERACTABLE, 0f);
__instance.mainRenderer.SetPropertyBlock(__instance.mpb);
return false;
}
[HarmonyPostfix]
[HarmonyPatch("HideRenderers")]
private static void HideRenderersPostfix(ref Item __instance)
{
LinqExtensions.ForEach<SkinnedMeshRenderer>((IEnumerable<SkinnedMeshRenderer>)((Component)__instance).GetComponentsInChildren<SkinnedMeshRenderer>(), (Action<SkinnedMeshRenderer>)delegate(SkinnedMeshRenderer meshRenderer)
{
((Renderer)meshRenderer).enabled = false;
});
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
public IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}