From 955baeb14fcb2b6ace9c946685e8753fdc4c06dc Mon Sep 17 00:00:00 2001 From: GrafDimenzio Date: Sat, 21 Aug 2021 19:44:34 +0200 Subject: [PATCH] 11.0.0 --- MoreWeapons/Configs/C4Config.cs | 14 -- MoreWeapons/Configs/GrenadeLauncherConfig.cs | 4 +- MoreWeapons/Configs/MedkitGunConfig.cs | 4 +- MoreWeapons/Configs/Scp127Config.cs | 4 +- MoreWeapons/Configs/Scp1499Config.cs | 4 +- MoreWeapons/Configs/ShotGunConfig.cs | 29 --- MoreWeapons/Configs/SniperConfig.cs | 4 +- MoreWeapons/Configs/TranquilizerConfig.cs | 4 +- MoreWeapons/Configs/VaccinePistoleConfig.cs | 4 +- MoreWeapons/CustomItemType.cs | 7 +- MoreWeapons/EventHandlers.cs | 186 +++++-------------- MoreWeapons/MoreWeapons.csproj | 32 ++-- MoreWeapons/PluginClass.cs | 30 +-- MoreWeapons/Scripts/C4PlayerComponent.cs | 24 --- MoreWeapons/Scripts/ExplodeScript.cs | 9 +- MoreWeapons/Scripts/Scp1499PlayerScript.cs | 5 +- MoreWeapons/Scripts/StickyComponent.cs | 38 ---- MoreWeapons/packages.config | 8 +- 18 files changed, 95 insertions(+), 315 deletions(-) delete mode 100644 MoreWeapons/Configs/C4Config.cs delete mode 100644 MoreWeapons/Configs/ShotGunConfig.cs delete mode 100644 MoreWeapons/Scripts/C4PlayerComponent.cs delete mode 100644 MoreWeapons/Scripts/StickyComponent.cs diff --git a/MoreWeapons/Configs/C4Config.cs b/MoreWeapons/Configs/C4Config.cs deleted file mode 100644 index 955ec0b..0000000 --- a/MoreWeapons/Configs/C4Config.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.ComponentModel; -using Synapse.Config; - -namespace MoreWeapons.Configs -{ - public class C4Config : AbstractConfigSection - { - [Description("After how much seconds the C4 will explode by itself")] - public float FuseTime { get; set; } = 200f; - - [Description("When Enabled the Grenade will follow the object it is sticked on")] - public bool UpdatePosition { get; set; } = true; - } -} diff --git a/MoreWeapons/Configs/GrenadeLauncherConfig.cs b/MoreWeapons/Configs/GrenadeLauncherConfig.cs index 3afe790..9535911 100644 --- a/MoreWeapons/Configs/GrenadeLauncherConfig.cs +++ b/MoreWeapons/Configs/GrenadeLauncherConfig.cs @@ -1,5 +1,5 @@ -using Synapse.Config; -using System.ComponentModel; +using System.ComponentModel; +using Synapse.Config; namespace MoreWeapons.Configs { diff --git a/MoreWeapons/Configs/MedkitGunConfig.cs b/MoreWeapons/Configs/MedkitGunConfig.cs index b5983cf..f5d74ad 100644 --- a/MoreWeapons/Configs/MedkitGunConfig.cs +++ b/MoreWeapons/Configs/MedkitGunConfig.cs @@ -1,5 +1,5 @@ -using Synapse.Config; -using System.ComponentModel; +using System.ComponentModel; +using Synapse.Config; namespace MoreWeapons.Configs { diff --git a/MoreWeapons/Configs/Scp127Config.cs b/MoreWeapons/Configs/Scp127Config.cs index 77404c5..c83f93f 100644 --- a/MoreWeapons/Configs/Scp127Config.cs +++ b/MoreWeapons/Configs/Scp127Config.cs @@ -1,5 +1,5 @@ -using Synapse.Config; -using System.ComponentModel; +using System.ComponentModel; +using Synapse.Config; namespace MoreWeapons.Configs { diff --git a/MoreWeapons/Configs/Scp1499Config.cs b/MoreWeapons/Configs/Scp1499Config.cs index 755ec27..ba6eb0f 100644 --- a/MoreWeapons/Configs/Scp1499Config.cs +++ b/MoreWeapons/Configs/Scp1499Config.cs @@ -1,5 +1,5 @@ -using Synapse.Config; -using System.ComponentModel; +using System.ComponentModel; +using Synapse.Config; namespace MoreWeapons.Configs { diff --git a/MoreWeapons/Configs/ShotGunConfig.cs b/MoreWeapons/Configs/ShotGunConfig.cs deleted file mode 100644 index 9d1eda0..0000000 --- a/MoreWeapons/Configs/ShotGunConfig.cs +++ /dev/null @@ -1,29 +0,0 @@ -using Synapse.Config; -using System.ComponentModel; - -namespace MoreWeapons.Configs -{ - public class ShotGunConfig : AbstractConfigSection - { - [Description("The max amount of bullets that can be in the shotgun")] - public int MagazineSize { get; set; } = 8; - - [Description("How many bullets get shoot every time")] - public int BulletsPerShoot { get; set; } = 8; - - [Description("How big the spread should be")] - public float AimCone { get; set; } = 5; - - [Description("The damage amount if you hit the head")] - public int DamageHead { get; set; } = 15; - - [Description("The damage amount if you hit the arm")] - public int DamageArm { get; set; } = 5; - - [Description("The damage amount if you hit the leg")] - public int DamageLeg { get; set; } = 5; - - [Description("The damage amount if you hit the body")] - public int DamageBody { get; set; } = 8; - } -} diff --git a/MoreWeapons/Configs/SniperConfig.cs b/MoreWeapons/Configs/SniperConfig.cs index e6827a0..5a0d642 100644 --- a/MoreWeapons/Configs/SniperConfig.cs +++ b/MoreWeapons/Configs/SniperConfig.cs @@ -1,5 +1,5 @@ -using Synapse.Config; -using System.ComponentModel; +using System.ComponentModel; +using Synapse.Config; namespace MoreWeapons.Configs { diff --git a/MoreWeapons/Configs/TranquilizerConfig.cs b/MoreWeapons/Configs/TranquilizerConfig.cs index ef7ef99..5eb1df3 100644 --- a/MoreWeapons/Configs/TranquilizerConfig.cs +++ b/MoreWeapons/Configs/TranquilizerConfig.cs @@ -1,6 +1,6 @@ -using Synapse.Config; -using System.Collections.Generic; +using System.Collections.Generic; using System.ComponentModel; +using Synapse.Config; namespace MoreWeapons.Configs { diff --git a/MoreWeapons/Configs/VaccinePistoleConfig.cs b/MoreWeapons/Configs/VaccinePistoleConfig.cs index 3ca8761..5a29805 100644 --- a/MoreWeapons/Configs/VaccinePistoleConfig.cs +++ b/MoreWeapons/Configs/VaccinePistoleConfig.cs @@ -1,6 +1,6 @@ -using System.ComponentModel; +using System.Collections.Generic; +using System.ComponentModel; using Synapse.Config; -using System.Collections.Generic; namespace MoreWeapons.Configs { diff --git a/MoreWeapons/CustomItemType.cs b/MoreWeapons/CustomItemType.cs index 747917b..13b3652 100644 --- a/MoreWeapons/CustomItemType.cs +++ b/MoreWeapons/CustomItemType.cs @@ -4,13 +4,12 @@ public enum CustomItemType : int { Tranquilizer = 50, GrenadeLauncher, - ShotGun, - Sniper, + + Sniper = 53, Scp127, XlMedkit, Scp1499, - C4, - MedkitGun, + MedkitGun = 58, VaccinePistole, //Coming maybe in the Future :D diff --git a/MoreWeapons/EventHandlers.cs b/MoreWeapons/EventHandlers.cs index 7bbcf28..a41cdc8 100644 --- a/MoreWeapons/EventHandlers.cs +++ b/MoreWeapons/EventHandlers.cs @@ -1,10 +1,16 @@ using System.Collections.Generic; using System.Linq; +using InventorySystem; +using InventorySystem.Items.Firearms.BasicMessages; +using InventorySystem.Items.ThrowableProjectiles; using MEC; +using Mirror; using MoreWeapons.Scripts; using Synapse; using Synapse.Api; +using Synapse.Api.Enum; using Synapse.Api.Events.SynapseEventArguments; +using Synapse.Api.Items; using Synapse.Config; using UnityEngine; @@ -19,7 +25,6 @@ public EventHandlers() Server.Get.Events.Player.PlayerChangeItemEvent += OnEquip; Server.Get.Events.Player.LoadComponentsEvent += OnLoadComponents; Server.Get.Events.Player.PlayerDamageEvent += OnDamage; - Server.Get.Events.Player.PlayerDropAmmoEvent += OnDropAmmo; Server.Get.Events.Player.PlayerDropItemEvent += OnDrop; Server.Get.Events.Player.PlayerItemUseEvent += OnItemUse; Server.Get.Events.Player.PlayerPickUpItemEvent += OnPickup; @@ -49,7 +54,6 @@ private void OnEquip(Synapse.Api.Events.SynapseEventArguments.PlayerChangeItemEv //Tranquilizer //XLMedkit //SCP-1499 - //C4 private void OnItemUse(PlayerItemInteractEventArgs ev) { if (ev.Player.GetComponent().Stuned) @@ -61,29 +65,13 @@ private void OnItemUse(PlayerItemInteractEventArgs ev) switch (ev.CurrentItem?.ID) { case (int)CustomItemType.XlMedkit when ev.State == Synapse.Api.Events.SynapseEventArguments.ItemInteractState.Finalizing: - ev.Player.Inventory.AddItem(ItemType.Medkit, 0, 0, 0, 0); + ev.Player.Inventory.AddItem(ItemType.Medkit); break; case (int)CustomItemType.Scp1499 when ev.State == Synapse.Api.Events.SynapseEventArguments.ItemInteractState.Finalizing: ev.Player.GetComponent().Use1499(); ev.Allow = false; break; - - case (int)CustomItemType.C4 when ev.State == Synapse.Api.Events.SynapseEventArguments.ItemInteractState.Finalizing: - ev.Allow = false; - ev.CurrentItem.Destroy(); - - var grenade = ev.Player.GrenadeManager.availableGrenades[0].grenadeInstance.GetComponent(); - var pos = ev.Player.CameraReference.TransformPoint(grenade.throwStartPositionOffset); - var vel = grenade.throwForce * (ev.Player.CameraReference.forward + grenade.throwLinearVelocityOffset).normalized; - - var grenadeobj = Map.Get.SpawnGrenade(pos, vel, PluginClass.C4Config.FuseTime, Synapse.Api.Enum.GrenadeType.Grenade, ev.Player); - var component = grenadeobj.gameObject.AddComponent(); - component.owner = ev.Player.gameObject; - component.grenade = grenadeobj; - - ev.Player.GetComponent().C4.Add(grenadeobj); - break; } } @@ -123,6 +111,7 @@ private void OnShoot(PlayerShootEventArgs ev) switch (ev.Weapon?.ID) { case (int)CustomItemType.Tranquilizer: + ev.Player.PlayerInteract.OnInteract(); ev.Allow = false; ev.Weapon.Durabillity--; @@ -130,9 +119,8 @@ private void OnShoot(PlayerShootEventArgs ev) if (ev.Target != null) { ev.Target.GetComponent().Stun(); - ev.Player.WeaponManager.RpcConfirmShot(true, ev.Player.WeaponManager.curWeapon); + ev.Player.Connection.Send(new RequestMessage(0, RequestType.Hitmarker)); } - else ev.Player.WeaponManager.RpcConfirmShot(false, ev.Player.WeaponManager.curWeapon); break; case (int)CustomItemType.MedkitGun: @@ -143,9 +131,8 @@ private void OnShoot(PlayerShootEventArgs ev) if (ev.Target != null) { ev.Target.Heal(PluginClass.MedkitGunConfig.HealAmount); - ev.Player.WeaponManager.RpcConfirmShot(true, ev.Player.WeaponManager.curWeapon); + ev.Player.Connection.Send(new RequestMessage(0, RequestType.Hitmarker)); } - else ev.Player.WeaponManager.RpcConfirmShot(false, ev.Player.WeaponManager.curWeapon); break; case (int)CustomItemType.GrenadeLauncher: @@ -153,82 +140,38 @@ private void OnShoot(PlayerShootEventArgs ev) ev.Allow = false; ev.Weapon.Durabillity--; - var velocity = (ev.TargetPosition - ev.Player.Position) * PluginClass.GLConfig.ForceMultiplier; - var pos = ev.Player.CameraReference.TransformPoint( - ev.Player.GrenadeManager.availableGrenades[0].grenadeInstance.GetComponent().throwStartPositionOffset); + var defaultItem = InventoryItemLoader.AvailableItems[ItemType.GrenadeHE] as ThrowableItem; + var projectile = UnityEngine.Object.Instantiate(defaultItem.Projectile, defaultItem.Owner.PlayerCameraReference.position, + defaultItem.Owner.PlayerCameraReference.rotation); + var info = new InventorySystem.Items.Pickups.PickupSyncInfo + { + ItemId = defaultItem.ItemTypeId, + Locked = !defaultItem._repickupable, + Serial = 1, + Weight = defaultItem.Weight, + Position = projectile.transform.position, + Rotation = new LowPrecisionQuaternion(projectile.transform.rotation) + }; + projectile.NetworkInfo = info; + projectile.PreviousOwner = new Footprinting.Footprint(ev.Player.Hub); - var grenade = Map.Get.SpawnGrenade(pos, velocity, PluginClass.GLConfig.GrenadeFuseTime, Synapse.Api.Enum.GrenadeType.Grenade, ev.Player); + NetworkServer.Spawn(projectile.gameObject); - if (PluginClass.GLConfig.ExplodeOnCollison) + projectile.InfoReceived(default, info); + + if(projectile.TryGetComponent(out var rb)) { - var script = grenade.gameObject.AddComponent(); - script.owner = ev.Player.gameObject; + var settings = defaultItem.FullThrowSettings; + defaultItem.PropelBody(rb, settings.StartTorque, settings.StartVelocity * PluginClass.GLConfig.ForceMultiplier, settings.UpwardsFactor); } - break; - case (int)CustomItemType.ShotGun: - ev.Player.PlayerInteract.OnInteract(); - ev.Allow = false; + projectile.ServerActivate(); - var bullets = PluginClass.SGConfig.BulletsPerShoot; - if (ev.Weapon.Durabillity <= bullets) - bullets = (int)ev.Weapon.Durabillity; - var rays = new Ray[bullets]; - for (int i = 0; i < rays.Length; i++) - rays[i] = new Ray(ev.Player.CameraReference.position + ev.Player.CameraReference.forward, RandomAimcone() * ev.Player.CameraReference.forward); - - var hits = new RaycastHit[bullets]; - var didHit = new bool[hits.Length]; - for (int i = 0; i < hits.Length; i++) - didHit[i] = Physics.Raycast(rays[i], out hits[i], 500f, 1208246273); - - var component = ev.Player.GetComponent(); - var confirm = false; - for (int i = 0; i < hits.Length; i++) + if (PluginClass.GLConfig.ExplodeOnCollison) { - if (!didHit[i]) continue; - - var hitbox = hits[i].collider.GetComponent(); - if (hitbox != null) - { - var target = hits[i].collider.GetComponentInParent(); - - if (component.GetShootPermission(target.ClassManager)) - { - int damage; - switch (hitbox.id) - { - case HitBoxType.HEAD: damage = PluginClass.SGConfig.DamageHead; break; - case HitBoxType.ARM: damage = PluginClass.SGConfig.DamageArm; break; - case HitBoxType.LEG: damage = PluginClass.SGConfig.DamageLeg; break; - default: damage = PluginClass.SGConfig.DamageBody; break; - } - if (target.RoleType == RoleType.Scp106) - damage /= 10; - - target.Hurt(damage, DamageTypes.Mp7, ev.Player); - component.RpcPlaceDecal(true, (sbyte)target.ClassManager.Classes.SafeGet(target.RoleType).bloodType, hits[i].point + hits[i].normal * 0.01f, Quaternion.FromToRotation(Vector3.up, hits[i].normal)); - confirm = true; - } - - continue; - } - - var window = hits[i].collider.GetComponent(); - if (window != null) - { - window.ServerDamageWindow(PluginClass.SGConfig.DamageBody); - confirm = true; - continue; - } - - component.RpcPlaceDecal(false, component.curWeapon, hits[i].point + hits[i].normal * 0.01f, Quaternion.FromToRotation(Vector3.up, hits[i].normal)); + var script = projectile.gameObject.AddComponent(); + script.owner = ev.Player.gameObject; } - - for (int i = 0; i < bullets; i++) - component.RpcConfirmShot(confirm, component.curWeapon); - - ev.Weapon.Durabillity -= bullets; break; case (int)CustomItemType.VaccinePistole: @@ -238,16 +181,16 @@ private void OnShoot(PlayerShootEventArgs ev) if (ev.Target != null) { - ev.Player.WeaponManager.RpcConfirmShot(true, ev.Player.WeaponManager.curWeapon); + ev.Player.Connection.Send(new RequestMessage(0, RequestType.Hitmarker)); + if (ev.Target.RoleID == (int)RoleType.Scp0492) { - pos = ev.Target.Position; + var pos = ev.Target.Position; ev.Target.RoleID = PluginClass.VPConfig.ReplaceRoles.ElementAt(UnityEngine.Random.Range(0, PluginClass.VPConfig.ReplaceRoles.Count)); ev.Target.Position = pos; } else ev.Target.Hurt(PluginClass.VPConfig.Damage); } - else ev.Player.WeaponManager.RpcConfirmShot(false, ev.Player.WeaponManager.curWeapon); break; } } @@ -258,7 +201,7 @@ private void OnShoot(PlayerShootEventArgs ev) //SCP-127 //Sniper //GrenadeLauncher - //ShotGun + //VaccinePistole private void OnReload(PlayerReloadEventArgs ev) { switch (ev.Item?.ID) @@ -270,11 +213,11 @@ private void OnReload(PlayerReloadEventArgs ev) var reloadAmount = PluginClass.TzConfig.MagazineSize - ev.Item.Durabillity; - if (ev.Player.Ammo9 < reloadAmount * PluginClass.TzConfig.AmooNeededForOneShoot) - reloadAmount = ev.Player.Ammo9 / PluginClass.TzConfig.AmooNeededForOneShoot; + if (ev.Player.AmmoBox[AmmoType.Ammo9x19] < reloadAmount * PluginClass.TzConfig.AmooNeededForOneShoot) + reloadAmount = ev.Player.AmmoBox[AmmoType.Ammo9x19] / PluginClass.TzConfig.AmooNeededForOneShoot; ev.Item.Durabillity += reloadAmount; - ev.Player.Ammo9 -= (uint)reloadAmount * (uint)PluginClass.TzConfig.AmooNeededForOneShoot; + ev.Player.AmmoBox[AmmoType.Ammo9x19] -= (ushort)(reloadAmount * PluginClass.TzConfig.AmooNeededForOneShoot); break; case (int)CustomItemType.MedkitGun: @@ -304,11 +247,11 @@ private void OnReload(PlayerReloadEventArgs ev) reloadAmount = PluginClass.SnConfig.MagazineSize - ev.Item.Durabillity; - if (ev.Player.Ammo5 < reloadAmount * PluginClass.SnConfig.AmooNeededForOneShoot) - reloadAmount = ev.Player.Ammo5 / PluginClass.SnConfig.AmooNeededForOneShoot; + if (ev.Player.AmmoBox[AmmoType.Ammo556x45] < reloadAmount * PluginClass.SnConfig.AmooNeededForOneShoot) + reloadAmount = ev.Player.AmmoBox[AmmoType.Ammo556x45] / PluginClass.SnConfig.AmooNeededForOneShoot; ev.Item.Durabillity += reloadAmount; - ev.Player.Ammo5 -= (uint)reloadAmount * (uint)PluginClass.SnConfig.AmooNeededForOneShoot; + ev.Player.AmmoBox[AmmoType.Ammo556x45] -= (ushort)(reloadAmount * PluginClass.SnConfig.AmooNeededForOneShoot); break; case (int)CustomItemType.GrenadeLauncher: @@ -317,7 +260,7 @@ private void OnReload(PlayerReloadEventArgs ev) if (!PluginClass.GLConfig.CanBeReloaded) return; - foreach (var grenade in ev.Player.Inventory.Items.Where(x => x.ID == (int)ItemType.GrenadeFrag)) + foreach (var grenade in ev.Player.Inventory.Items.Where(x => x.ID == (int)ItemType.GrenadeHE)) { if (ev.Item.Durabillity >= PluginClass.GLConfig.MagazineSize) return; @@ -327,20 +270,6 @@ private void OnReload(PlayerReloadEventArgs ev) } break; - case (int)CustomItemType.ShotGun: - ev.Allow = false; - - if (ev.Item.Durabillity >= PluginClass.SGConfig.MagazineSize) return; - - reloadAmount = PluginClass.SGConfig.MagazineSize - ev.Item.Durabillity; - - if (ev.Player.Ammo9 < reloadAmount) - reloadAmount = ev.Player.Ammo9; - - ev.Item.Durabillity += reloadAmount; - ev.Player.Ammo9 -= (uint)reloadAmount; - break; - case (int)CustomItemType.VaccinePistole: ev.Allow = false; @@ -359,7 +288,6 @@ private void OnReload(PlayerReloadEventArgs ev) //Used by: //Tranquilizer //SCP-1499 - //C4 private void OnLoadComponents(LoadComponentEventArgs ev) { if (ev.Player.GetComponent() == null) @@ -367,9 +295,6 @@ private void OnLoadComponents(LoadComponentEventArgs ev) if (ev.Player.GetComponent() == null) ev.Player.AddComponent(); - - if (ev.Player.GetComponent() == null) - ev.Player.AddComponent(); } //Used by: @@ -388,7 +313,7 @@ private void OnDamage(PlayerDamageEventArgs ev) switch (ev.Killer.ItemInHand.ID) { - case (int)CustomItemType.Sniper when ev.HitInfo.GetDamageType() == DamageTypes.E11StandardRifle: + case (int)CustomItemType.Sniper when ev.HitInfo.Tool == DamageTypes.E11SR: ev.DamageAmount = ev.Victim.RoleType == RoleType.Scp106 ? PluginClass.SnConfig.Damage / 10f : PluginClass.SnConfig.Damage; break; } @@ -400,7 +325,7 @@ private void OnWaiting() { if (PluginClass.Scp1499Config.SpawnDoor) { - var door = Synapse.Api.Door.SpawnDoorVariant(doorSpawn.Parse().Position, Synapse.Api.Map.Get.GetRoom(RoomInformation.RoomType.HCZ_049).GameObject.transform.rotation); + var door = Synapse.Api.Door.SpawnDoorVariant(doorSpawn.Parse().Position, Synapse.Api.Map.Get.GetRoom(MapGeneration.RoomName.Hcz049).GameObject.transform.rotation); door.GameObject.GetComponent().ServerChangeLock(Interactables.Interobjects.DoorUtils.DoorLockReason.SpecialDoorFeature, true); } } @@ -412,14 +337,6 @@ private void OnSetClass(Synapse.Api.Events.SynapseEventArguments.PlayerSetClassE ev.Player.GetComponent().IsInDimension = false; } - //Used by: - //C4 - private void OnDropAmmo(Synapse.Api.Events.SynapseEventArguments.PlayerDropAmmoEventArgs ev) - { - if (ev.Player.GetComponent().ExplodeAll()) - ev.Allow = false; - } - private readonly SerializedMapPoint doorSpawn = new SerializedMapPoint("HCZ_049", -6.683522f, 264.0f, 24.09575f); @@ -441,14 +358,5 @@ private IEnumerator Refill() yield return Timing.WaitForSeconds(PluginClass.Scp127Config.ReloadIntervall); } } - - private Quaternion RandomAimcone() - { - return Quaternion.Euler( - UnityEngine.Random.Range(-PluginClass.SGConfig.AimCone, PluginClass.SGConfig.AimCone), - UnityEngine.Random.Range(-PluginClass.SGConfig.AimCone, PluginClass.SGConfig.AimCone), - UnityEngine.Random.Range(-PluginClass.SGConfig.AimCone, PluginClass.SGConfig.AimCone) - ); - } } } diff --git a/MoreWeapons/MoreWeapons.csproj b/MoreWeapons/MoreWeapons.csproj index 63e20d7..ec7d8ec 100644 --- a/MoreWeapons/MoreWeapons.csproj +++ b/MoreWeapons/MoreWeapons.csproj @@ -33,23 +33,23 @@ true - - ..\packages\Lib.Harmony.2.0.4\lib\net472\0Harmony.dll + + ..\packages\Lib.Harmony.2.1.1\lib\net472\0Harmony.dll - ..\packages\SynapseSL.2.6.0\lib\net472\Assembly-CSharp.dll + ..\packages\SynapseSL.2.7.0-dev4\lib\net472\Assembly-CSharp.dll - ..\packages\SynapseSL.2.6.0\lib\net472\Assembly-CSharp-firstpass.dll + ..\packages\SynapseSL.2.7.0-dev4\lib\net472\Assembly-CSharp-firstpass.dll - - ..\packages\LiteDB.5.0.9\lib\net45\LiteDB.dll + + ..\packages\LiteDB.5.0.11\lib\net45\LiteDB.dll - ..\packages\SynapseSL.2.6.0\lib\net472\Mirror.dll + ..\packages\SynapseSL.2.7.0-dev4\lib\net472\Mirror.dll - - ..\packages\SynapseSL.2.6.0\lib\net472\Synapse.dll + + ..\packages\SynapseSL.2.7.0-dev4\lib\net472\Synapse.dll @@ -64,20 +64,19 @@ - ..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.dll + ..\packages\SynapseSL.2.7.0-dev4\lib\net472\UnityEngine.dll - ..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.CoreModule.dll + ..\packages\SynapseSL.2.7.0-dev4\lib\net472\UnityEngine.CoreModule.dll - ..\packages\SynapseSL.2.6.0\lib\net472\UnityEngine.PhysicsModule.dll + ..\packages\SynapseSL.2.7.0-dev4\lib\net472\UnityEngine.PhysicsModule.dll - - ..\packages\YamlDotNet.8.1.2\lib\net45\YamlDotNet.dll + + ..\packages\YamlDotNet.11.2.1\lib\net45\YamlDotNet.dll - @@ -86,14 +85,11 @@ - - - diff --git a/MoreWeapons/PluginClass.cs b/MoreWeapons/PluginClass.cs index 8c890a0..b51c80f 100644 --- a/MoreWeapons/PluginClass.cs +++ b/MoreWeapons/PluginClass.cs @@ -1,6 +1,6 @@ -using Synapse.Api.Plugin; -using Synapse; +using Synapse; using Synapse.Api.Items; +using Synapse.Api.Plugin; namespace MoreWeapons { @@ -19,9 +19,6 @@ public class PluginClass : AbstractPlugin [Config(section = "GrenadeLauncher")] public static Configs.GrenadeLauncherConfig GLConfig { get; set; } - [Config(section = "ShotGun")] - public static Configs.ShotGunConfig SGConfig { get; set; } - [Config(section = "Scp-127")] public static Configs.Scp127Config Scp127Config { get; set; } @@ -34,9 +31,6 @@ public class PluginClass : AbstractPlugin [Config(section = "Scp1499")] public static Configs.Scp1499Config Scp1499Config { get; set; } - [Config(section = "C4")] - public static Configs.C4Config C4Config { get; set; } - [Config(section = "MedkitGun")] public static Configs.MedkitGunConfig MedkitGunConfig { get; set; } @@ -56,7 +50,7 @@ private void RegisterItems() { ID = (int)CustomItemType.Tranquilizer, Name = "Tranquilizer", - BasedItemType = ItemType.GunUSP + BasedItemType = ItemType.GunCOM18 }); Server.Get.ItemManager.RegisterCustomItem(new CustomItemInformation @@ -66,13 +60,6 @@ private void RegisterItems() Name = "GrenadeLauncher" }); - Server.Get.ItemManager.RegisterCustomItem(new CustomItemInformation - { - ID = (int)CustomItemType.ShotGun, - Name = "ShotGun", - BasedItemType = ItemType.GunUSP, - }); - Server.Get.ItemManager.RegisterCustomItem(new CustomItemInformation { ID = (int)CustomItemType.Sniper, @@ -83,7 +70,7 @@ private void RegisterItems() Server.Get.ItemManager.RegisterCustomItem(new CustomItemInformation { ID = (int)CustomItemType.Scp127, - BasedItemType = ItemType.GunProject90, + BasedItemType = ItemType.GunFSP9, Name = "Scp-127" }); @@ -103,14 +90,7 @@ private void RegisterItems() Server.Get.ItemManager.RegisterCustomItem(new CustomItemInformation { - BasedItemType = ItemType.GrenadeFrag, - ID = (int)CustomItemType.C4, - Name = "C4" - }); - - Server.Get.ItemManager.RegisterCustomItem(new CustomItemInformation - { - BasedItemType = ItemType.GunMP7, + BasedItemType = ItemType.GunFSP9, ID = (int)CustomItemType.MedkitGun, Name = "MedkitGun" }); diff --git a/MoreWeapons/Scripts/C4PlayerComponent.cs b/MoreWeapons/Scripts/C4PlayerComponent.cs deleted file mode 100644 index e256b28..0000000 --- a/MoreWeapons/Scripts/C4PlayerComponent.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using UnityEngine; - -namespace MoreWeapons.Scripts -{ - public class C4PlayerComponent : MonoBehaviour - { - public List C4 { get; } = new List(); - - public bool ExplodeAll() - { - var flag = false; - foreach (var grenade in C4.ToList()) - { - C4.Remove(grenade); - if (grenade == null) continue; - grenade.NetworkfuseTime = 0.10000000149011612; - flag = true; - } - return flag; - } - } -} diff --git a/MoreWeapons/Scripts/ExplodeScript.cs b/MoreWeapons/Scripts/ExplodeScript.cs index d2020b5..f5ed960 100644 --- a/MoreWeapons/Scripts/ExplodeScript.cs +++ b/MoreWeapons/Scripts/ExplodeScript.cs @@ -1,4 +1,6 @@ -using UnityEngine; +using InventorySystem.Items.Pickups; +using InventorySystem.Items.ThrowableProjectiles; +using UnityEngine; namespace MoreWeapons.Scripts { @@ -8,8 +10,9 @@ public class ExplodeScript : MonoBehaviour public void OnCollisionEnter(Collision col) { - if (col.gameObject == owner || col.gameObject.GetComponent() != null) return; - GetComponent().NetworkfuseTime = 0.10000000149011612; + if (col.gameObject == owner || GetComponent() is ExplosionGrenade) return; + var grenade = (GetComponent() as ExplosionGrenade); + grenade.DestroySelf(); } } } diff --git a/MoreWeapons/Scripts/Scp1499PlayerScript.cs b/MoreWeapons/Scripts/Scp1499PlayerScript.cs index 563e7bf..53d7e02 100644 --- a/MoreWeapons/Scripts/Scp1499PlayerScript.cs +++ b/MoreWeapons/Scripts/Scp1499PlayerScript.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using InventorySystem.Items.Usables; using MEC; using Synapse.Api; using Synapse.Api.Enum; @@ -33,9 +34,7 @@ public void Use1499() IsInDimension = false; - - player.VanillaInventory._cawi.usableCooldowns[3] = PluginClass.Scp1499Config.Cooldown; - player.VanillaInventory._cawi.RpcSetCooldown(3, PluginClass.Scp1499Config.Cooldown); + UsableItemsController.GetHandler(player.Hub).PersonalCooldowns[ItemType.SCP268] = PluginClass.Scp1499Config.Cooldown; Timing.KillCoroutines(kickcoroutine.ToArray()); } diff --git a/MoreWeapons/Scripts/StickyComponent.cs b/MoreWeapons/Scripts/StickyComponent.cs deleted file mode 100644 index 173b856..0000000 --- a/MoreWeapons/Scripts/StickyComponent.cs +++ /dev/null @@ -1,38 +0,0 @@ -using UnityEngine; - -namespace MoreWeapons.Scripts -{ - public class StickyComponent : MonoBehaviour - { - public GameObject owner; - public Grenades.Grenade grenade; - - public Vector3 relativePosition; - public GameObject collider = null; - - public void OnCollisionEnter(Collision col) - { - if (collider != null || col.gameObject == owner) return; - - var rig = gameObject.GetComponent(); - rig.useGravity = false; - rig.isKinematic = true; - grenade.NetworkserverVelocities = new Grenades.RigidbodyVelocityPair - { - angular = Vector3.zero, - linear = Vector3.zero - }; - - if (!PluginClass.C4Config.UpdatePosition) return; - - relativePosition = col.gameObject.transform.InverseTransformPoint(gameObject.transform.position); - collider = col.gameObject; - } - - public void Update() - { - if (collider != null) - gameObject.transform.position = collider.transform.TransformPoint(relativePosition); - } - } -} diff --git a/MoreWeapons/packages.config b/MoreWeapons/packages.config index 52adbad..3701fb1 100644 --- a/MoreWeapons/packages.config +++ b/MoreWeapons/packages.config @@ -1,8 +1,8 @@  - - - + + + - + \ No newline at end of file