using System;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using Jotunn.Utils;
using MapsExt;
using MapsExt.MapObjects;
using MapsExt.Properties;
using UnboundLib;
using UnityEngine;
using VanillaMapObjects.MapObjectProperties;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("VanillaMapObjects")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("VanillaMapObjects")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("0bce3a9f-2245-4a2c-94bf-5710d9eecded")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace VanillaMapObjects
{
public static class RoundsExtensions
{
private class ExtraRopeData
{
public Action<SpringJoint2D> ropeListener = delegate
{
};
}
private static readonly ConditionalWeakTable<MapObjet_Rope, ExtraRopeData> s_ropeData = new ConditionalWeakTable<MapObjet_Rope, ExtraRopeData>();
internal static void OnJointAdded(this MapObjet_Rope instance, Action<SpringJoint2D> cb)
{
ExtraRopeData orCreateValue = s_ropeData.GetOrCreateValue(instance);
orCreateValue.ropeListener = (Action<SpringJoint2D>)Delegate.Combine(orCreateValue.ropeListener, cb);
}
internal static void JointAdded(this MapObjet_Rope instance, SpringJoint2D joint)
{
s_ropeData.GetOrCreateValue(instance).ropeListener(joint);
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.rsmind.rounds.vanillamapobjects", "VanillaMapObjects", "1.1.0")]
[BepInProcess("Rounds.exe")]
public class VanillaMapObjects : BaseUnityPlugin
{
[HarmonyPatch(typeof(MapObjet_Rope), "AddJoint")]
private static class RopePatch_AddJoint
{
public static void Postfix(MapObjet_Rope __instance, SpringJoint2D ___joint)
{
__instance.JointAdded(___joint);
}
}
private const string ModId = "com.rsmind.rounds.vanillamapobjects";
private const string ModName = "VanillaMapObjects";
public const string Version = "1.1.0";
public static AssetBundle MapObjectAssets = AssetUtils.LoadAssetBundleFromResources("smashers", typeof(VanillaMapObjects).Assembly);
public static VanillaMapObjects 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("com.rsmind.rounds.vanillamapobjects");
val.PatchAll();
}
private void Start()
{
instance = this;
}
}
}
namespace VanillaMapObjects.MapObjects
{
public class SpringyRopeData : MapObjectData
{
[SerializeField]
private Vector2 _pos1;
[SerializeField]
private Vector2 _pos2;
[SerializeField]
private float _frequency;
[SerializeField]
private float _damping;
public SpringyRopePositionProperty Position
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return new SpringyRopePositionProperty(_pos1, _pos2);
}
set
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
_pos1 = value.StartPosition;
_pos2 = value.EndPosition;
}
}
public SpringyRopeAttributesProperty Attributes
{
get
{
return new SpringyRopeAttributesProperty(_frequency, _damping);
}
set
{
_frequency = value.Frequency;
_damping = value.DampingRatio;
}
}
public SpringyRopeData()
{
Position = new SpringyRopePositionProperty();
Attributes = new SpringyRopeAttributesProperty();
}
}
[MapObject(typeof(SpringyRopeData))]
public class SpringyRope : IMapObject
{
public virtual GameObject Prefab => MapObjectManager.LoadCustomAsset<GameObject>("Rope");
public virtual void OnInstantiate(GameObject instance)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
instance.GetComponent<MapObjet_Rope>().jointType = (JointType)0;
}
}
public class AdjustableMassBoxBgData : BoxData
{
[SerializeField]
private float _mass;
public MassProperty Mass
{
get
{
return new MassProperty(_mass);
}
set
{
_mass = ((ValueProperty<float>)value).Value;
}
}
public AdjustableMassBoxBgData()
{
Mass = new MassProperty(20f);
}
}
[MapObject(typeof(AdjustableMassBoxBgData))]
public class AdjustableMassBoxBg : IMapObject
{
public virtual GameObject Prefab => MapObjectManager.LoadCustomAsset<GameObject>("Box Background");
public virtual void OnInstantiate(GameObject instance)
{
}
}
public class AdjustableMassBoxData : BoxData
{
[SerializeField]
private float _mass;
public MassProperty Mass
{
get
{
return new MassProperty(_mass);
}
set
{
_mass = ((ValueProperty<float>)value).Value;
}
}
public AdjustableMassBoxData()
{
Mass = new MassProperty(20f);
}
}
[MapObject(typeof(AdjustableMassBoxData))]
public class AdjustableMassBox : IMapObject
{
public virtual GameObject Prefab => MapObjectManager.LoadCustomAsset<GameObject>("Box");
public virtual void OnInstantiate(GameObject instance)
{
}
}
public class AdjustableMassSawData : SawDynamicData
{
[SerializeField]
private float _mass;
public MassProperty Mass
{
get
{
return new MassProperty(_mass);
}
set
{
_mass = ((ValueProperty<float>)value).Value;
}
}
public AdjustableMassSawData()
{
Mass = new MassProperty(500f);
}
}
[MapObject(typeof(AdjustableMassSawData))]
public class AdjustableMassSaw : IMapObject
{
public virtual GameObject Prefab => MapObjectManager.LoadCustomAsset<GameObject>("Saw Dynamic");
public virtual void OnInstantiate(GameObject instance)
{
}
}
public class AdjustableHealthBoxData : BoxDestructibleData
{
[SerializeField]
private float _health;
[SerializeField]
private float _mass;
public BoxHealthProperty Health
{
get
{
return new BoxHealthProperty(_health);
}
set
{
_health = ((ValueProperty<float>)value).Value;
}
}
public MassProperty Mass
{
get
{
return new MassProperty(_mass);
}
set
{
_mass = ((ValueProperty<float>)value).Value;
}
}
public AdjustableHealthBoxData()
{
Health = new BoxHealthProperty(100f);
Mass = new MassProperty(20f);
}
}
[MapObject(typeof(AdjustableHealthBoxData))]
public class AdjustableHealthBox : IMapObject
{
public virtual GameObject Prefab => MapObjectManager.LoadCustomAsset<GameObject>("Box Destructible");
public virtual void OnInstantiate(GameObject instance)
{
}
}
public class MovingPlatformData : SpatialMapObjectData
{
[SerializeField]
private Vector2[] _positions;
[SerializeField]
private float _spring;
[SerializeField]
private float _timeAtPos;
public MoveSequenceProperty Value
{
get
{
return new MoveSequenceProperty(_positions, _spring, _timeAtPos);
}
set
{
_positions = value.Positions;
_spring = value.Spring;
_timeAtPos = value.TimeAtPos;
}
}
public MovingPlatformData()
{
Value = new MoveSequenceProperty();
}
}
[MapObject(typeof(MovingPlatformData))]
public class MovingPlatform : IMapObject
{
public virtual GameObject Prefab => VanillaMapObjects.MapObjectAssets.LoadAsset<GameObject>("MovingPlatform");
public virtual void OnInstantiate(GameObject instance)
{
}
}
public class WreckingBallData : SpatialMapObjectData
{
[SerializeField]
private float _mass;
public MassProperty Mass
{
get
{
return new MassProperty(_mass);
}
set
{
_mass = ((ValueProperty<float>)value).Value;
}
}
public WreckingBallData()
{
Mass = new MassProperty(500f);
}
}
[MapObject(typeof(WreckingBallData))]
public class WreckingBall : IMapObject
{
public virtual GameObject Prefab => VanillaMapObjects.MapObjectAssets.LoadAsset<GameObject>("Ball_Big");
public virtual void OnInstantiate(GameObject instance)
{
}
}
public class SmasherData : SpatialMapObjectData
{
[SerializeField]
private float _delay;
public DelayProperty Delay
{
get
{
return new DelayProperty(_delay);
}
set
{
_delay = ((ValueProperty<float>)value).Value;
}
}
public SmasherData()
{
Delay = new DelayProperty();
}
}
[MapObject(typeof(SmasherData))]
public class Smasher : IMapObject
{
public virtual GameObject Prefab => VanillaMapObjects.MapObjectAssets.LoadAsset<GameObject>("smasher 2.0");
public virtual void OnInstantiate(GameObject instance)
{
}
}
}
namespace VanillaMapObjects.MapObjectProperties
{
public class MoveSequenceProperty : IProperty
{
[SerializeField]
private Vector2[] _positions;
[SerializeField]
private float _spring;
[SerializeField]
private float _timeAtPos;
public Vector2[] Positions
{
get
{
return _positions;
}
set
{
_positions = value;
}
}
public float Spring
{
get
{
return _spring;
}
set
{
_spring = value;
}
}
public float TimeAtPos
{
get
{
return _timeAtPos;
}
set
{
_timeAtPos = value;
}
}
public MoveSequenceProperty()
{
_positions = (Vector2[])(object)new Vector2[2];
_spring = 500f;
_timeAtPos = 0f;
}
public MoveSequenceProperty(Vector2[] positions, float spring, float timeAtPos)
{
_positions = positions;
_spring = spring;
_timeAtPos = timeAtPos;
}
}
[PropertySerializer(typeof(MoveSequenceProperty))]
public class MoveSequencePropertySerializer : IPropertyWriter<MoveSequenceProperty>
{
public virtual void WriteProperty(MoveSequenceProperty property, GameObject target)
{
ExtensionMethods.GetOrAddComponent<MoveSequencePropertyInstance>(target, false).Value = property;
MoveSequence val = target.GetComponent<MoveSequence>() ?? throw new ArgumentException("GameObject does not have a move sequence script", "target");
val.positions = property.Positions;
val.spring = property.Spring;
val.timeAtPos = property.TimeAtPos;
}
}
public class MoveSequencePropertyInstance : MonoBehaviour
{
public MoveSequenceProperty Value { get; set; } = new MoveSequenceProperty();
}
public class BoxHealthProperty : ValueProperty<float>, ILinearProperty<BoxHealthProperty>, ILinearProperty, IProperty
{
[SerializeField]
private readonly float _delay;
public override float Value => _delay;
public BoxHealthProperty()
{
}
public BoxHealthProperty(float health)
{
_delay = health;
}
public override bool Equals(ValueProperty<float> other)
{
return base.Equals(other) || ((ValueProperty<float>)this).Value == other.Value;
}
public BoxHealthProperty Lerp(BoxHealthProperty end, float t)
{
return new BoxHealthProperty(Mathf.Lerp(((ValueProperty<float>)this).Value, ((ValueProperty<float>)end).Value, t));
}
public IProperty Lerp(IProperty end, float t)
{
return (IProperty)(object)Lerp((BoxHealthProperty)(object)end, t);
}
public static implicit operator BoxHealthProperty(float delay)
{
return new BoxHealthProperty(delay);
}
public static implicit operator float(BoxHealthProperty prop)
{
return ((ValueProperty<float>)prop).Value;
}
public static BoxHealthProperty operator +(BoxHealthProperty a, BoxHealthProperty b)
{
return ((ValueProperty<float>)a).Value + ((ValueProperty<float>)b).Value;
}
public static BoxHealthProperty operator -(BoxHealthProperty a, BoxHealthProperty b)
{
return ((ValueProperty<float>)a).Value - ((ValueProperty<float>)b).Value;
}
}
[PropertySerializer(typeof(BoxHealthProperty))]
public class BoxHealthPropertySerializer : IPropertyWriter<BoxHealthProperty>
{
public virtual void WriteProperty(BoxHealthProperty property, GameObject target)
{
ExtensionMethods.GetOrAddComponent<BoxHealthPropertyInstance>(target, false).Health = property;
DamagableEvent val = target.GetComponent<DamagableEvent>() ?? throw new ArgumentException("GameObject does not have a damageable script", "target");
val.maxHP = ((ValueProperty<float>)property).Value;
val.currentHP = ((ValueProperty<float>)property).Value;
}
}
public class BoxHealthPropertyInstance : MonoBehaviour
{
public BoxHealthProperty Health { get; set; } = new BoxHealthProperty();
}
public class MassProperty : ValueProperty<float>, ILinearProperty<MassProperty>, ILinearProperty, IProperty
{
[SerializeField]
private readonly float _mass;
public override float Value => _mass;
public MassProperty()
{
}
public MassProperty(float mass)
{
_mass = mass;
}
public override bool Equals(ValueProperty<float> other)
{
return base.Equals(other) || ((ValueProperty<float>)this).Value == other.Value;
}
public MassProperty Lerp(MassProperty end, float t)
{
return new MassProperty(Mathf.Lerp(((ValueProperty<float>)this).Value, ((ValueProperty<float>)end).Value, t));
}
public IProperty Lerp(IProperty end, float t)
{
return (IProperty)(object)Lerp((MassProperty)(object)end, t);
}
public static implicit operator MassProperty(float mass)
{
return new MassProperty(mass);
}
public static implicit operator float(MassProperty prop)
{
return ((ValueProperty<float>)prop).Value;
}
public static MassProperty operator +(MassProperty a, MassProperty b)
{
return ((ValueProperty<float>)a).Value + ((ValueProperty<float>)b).Value;
}
public static MassProperty operator -(MassProperty a, MassProperty b)
{
return ((ValueProperty<float>)a).Value - ((ValueProperty<float>)b).Value;
}
}
[PropertySerializer(typeof(MassProperty))]
public class MassPropertySerializer : IPropertyWriter<MassProperty>
{
public virtual void WriteProperty(MassProperty property, GameObject target)
{
ExtensionMethods.GetOrAddComponent<MassPropertyInstance>(target, false).Mass = property;
Rigidbody2D val = target.GetComponent<Rigidbody2D>() ?? throw new ArgumentException("GameObject does not have a rigidbody script", "target");
val.mass = ((ValueProperty<float>)property).Value * 1000f;
}
}
public class MassPropertyInstance : MonoBehaviour
{
public MassProperty Mass { get; set; } = new MassProperty();
}
public class DelayProperty : ValueProperty<float>, ILinearProperty<DelayProperty>, ILinearProperty, IProperty
{
[SerializeField]
private readonly float _delay;
public override float Value => _delay;
public DelayProperty()
{
}
public DelayProperty(float delay)
{
_delay = delay;
}
public override bool Equals(ValueProperty<float> other)
{
return base.Equals(other) || ((ValueProperty<float>)this).Value == other.Value;
}
public DelayProperty Lerp(DelayProperty end, float t)
{
return new DelayProperty(Mathf.Lerp(((ValueProperty<float>)this).Value, ((ValueProperty<float>)end).Value, t));
}
public IProperty Lerp(IProperty end, float t)
{
return (IProperty)(object)Lerp((DelayProperty)(object)end, t);
}
public static implicit operator DelayProperty(float delay)
{
return new DelayProperty(delay);
}
public static implicit operator float(DelayProperty prop)
{
return ((ValueProperty<float>)prop).Value;
}
public static DelayProperty operator +(DelayProperty a, DelayProperty b)
{
return ((ValueProperty<float>)a).Value + ((ValueProperty<float>)b).Value;
}
public static DelayProperty operator -(DelayProperty a, DelayProperty b)
{
return ((ValueProperty<float>)a).Value - ((ValueProperty<float>)b).Value;
}
}
[PropertySerializer(typeof(DelayProperty))]
public class DelayPropertySerializer : IPropertyWriter<DelayProperty>
{
public virtual void WriteProperty(DelayProperty property, GameObject target)
{
ExtensionMethods.GetOrAddComponent<DelayPropertyInstance>(target, false).Delay = property;
DelayEvent val = target.GetComponentInChildren<DelayEvent>() ?? throw new ArgumentException("GameObject does not have a delay script", "target");
val.time = ((ValueProperty<float>)property).Value;
}
}
public class DelayPropertyInstance : MonoBehaviour
{
public DelayProperty Delay { get; set; } = new DelayProperty();
}
public class SpringyRopeAttributesProperty : IProperty, IEquatable<SpringyRopeAttributesProperty>
{
[SerializeField]
private float _frequency;
[SerializeField]
private float _damping;
public float Frequency
{
get
{
return _frequency;
}
set
{
_frequency = value;
}
}
public float DampingRatio
{
get
{
return _damping;
}
set
{
_damping = value;
}
}
public SpringyRopeAttributesProperty()
{
_frequency = 1f;
_damping = 0f;
}
public SpringyRopeAttributesProperty(float frequency, float damping)
{
_frequency = frequency;
_damping = damping;
}
public bool Equals(SpringyRopeAttributesProperty other)
{
return Frequency == other.Frequency && DampingRatio == other.DampingRatio;
}
public override bool Equals(object other)
{
return other is SpringyRopeAttributesProperty other2 && Equals(other2);
}
public override int GetHashCode()
{
return (Frequency, DampingRatio).GetHashCode();
}
public static bool operator ==(SpringyRopeAttributesProperty a, SpringyRopeAttributesProperty b)
{
return a.Equals(b);
}
public static bool operator !=(SpringyRopeAttributesProperty a, SpringyRopeAttributesProperty b)
{
return !a.Equals(b);
}
}
[PropertySerializer(typeof(SpringyRopeAttributesProperty))]
public class SpringyRopeAttributesPropertySerializer : IPropertyWriter<SpringyRopeAttributesProperty>
{
public virtual void WriteProperty(SpringyRopeAttributesProperty property, GameObject target)
{
ExtensionMethods.GetOrAddComponent<SpringyRopeAttributesPropertyInstance>(target, false).Attributes = property;
MapObjet_Rope rope = target.GetComponent<MapObjet_Rope>();
rope.OnJointAdded(delegate(SpringJoint2D joint)
{
if (Object.op_Implicit((Object)(object)joint))
{
ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)rope, 1, (Action)delegate
{
joint.frequency = property.Frequency;
joint.dampingRatio = property.DampingRatio;
});
}
});
}
}
public class SpringyRopeAttributesPropertyInstance : MonoBehaviour
{
public SpringyRopeAttributesProperty Attributes { get; set; } = new SpringyRopeAttributesProperty();
}
public class SpringyRopePositionProperty : IProperty, IEquatable<SpringyRopePositionProperty>
{
[SerializeField]
private Vector2 _pos1;
[SerializeField]
private Vector2 _pos2;
public Vector2 StartPosition
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return _pos1;
}
set
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
_pos1 = value;
}
}
public Vector2 EndPosition
{
get
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
return _pos2;
}
set
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
_pos2 = value;
}
}
public SpringyRopePositionProperty()
{
//IL_0017: 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_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = Vector2.op_Implicit(((Component)MainCam.instance.cam).transform.position);
_pos1 = val + Vector2.up;
_pos2 = val + Vector2.down;
}
public SpringyRopePositionProperty(Vector2 startPosition, Vector2 endPosition)
{
//IL_0009: 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_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
_pos1 = startPosition;
_pos2 = endPosition;
}
public bool Equals(SpringyRopePositionProperty other)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: 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)
//IL_001c: 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)
Vector2 val = StartPosition;
int result;
if (((Vector2)(ref val)).Equals(other.StartPosition))
{
val = EndPosition;
result = (((Vector2)(ref val)).Equals(other.EndPosition) ? 1 : 0);
}
else
{
result = 0;
}
return (byte)result != 0;
}
public override bool Equals(object other)
{
return other is SpringyRopePositionProperty other2 && Equals(other2);
}
public override int GetHashCode()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
return (StartPosition, EndPosition).GetHashCode();
}
public static bool operator ==(SpringyRopePositionProperty a, SpringyRopePositionProperty b)
{
return a.Equals(b);
}
public static bool operator !=(SpringyRopePositionProperty a, SpringyRopePositionProperty b)
{
return !a.Equals(b);
}
}
[PropertySerializer(typeof(SpringyRopePositionProperty))]
public class RopePositionPropertySerializer : IPropertyWriter<SpringyRopePositionProperty>
{
public virtual void WriteProperty(SpringyRopePositionProperty property, GameObject target)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
target.transform.position = Vector2.op_Implicit(property.StartPosition);
target.transform.GetChild(0).position = Vector2.op_Implicit(property.EndPosition);
MapObjet_Rope rope = target.GetComponent<MapObjet_Rope>();
rope.OnJointAdded(delegate(SpringJoint2D joint)
{
if (Object.op_Implicit((Object)(object)joint))
{
ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)rope, 1, (Action)delegate
{
joint.autoConfigureDistance = false;
});
}
});
}
}
}