Skip to content

Commit 248a97e

Browse files
committed
- Grammar Fix
- Added ExplodeOnImpact to SCP018Data
1 parent 789fba7 commit 248a97e

3 files changed

Lines changed: 8 additions & 4 deletions

File tree

UncomplicatedCustomItems/API/Features/SpecificData/SCPItemData.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ public class SCP018Data : Data, ISCP018Data
6868
{
6969
public virtual float FriendlyFireTime { get; set; } = 2f;
7070
public virtual float FuseTime { get; set; } = 2f;
71+
public virtual bool ExplodeOnImpact { get; set; } = false;
7172
}
7273

7374
public class SCP1344Data : Data, ISCP1344Data

UncomplicatedCustomItems/Events/PlayerHandler.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public static void Register()
112112
PlayerEvent.ProcessedJailbirdMessage += OnJailbirdMessage;
113113
PlayerEvent.ThrewProjectile += OnProjectileThrew;
114114
PlayerEvent.ChangingAttachments += OnPlayerChangingAttachments;
115-
InventorySystem.InventoryExtensions.OnItemAdded += OnItemAdded;
115+
InventoryExtensions.OnItemAdded += OnItemAdded;
116116
}
117117

118118
public static void Unregister()
@@ -155,7 +155,7 @@ public static void Unregister()
155155
PlayerEvent.ProcessedJailbirdMessage -= OnJailbirdMessage;
156156
PlayerEvent.ThrewProjectile -= OnProjectileThrew;
157157
PlayerEvent.ChangingAttachments -= OnPlayerChangingAttachments;
158-
InventorySystem.InventoryExtensions.OnItemAdded -= OnItemAdded;
158+
InventoryExtensions.OnItemAdded -= OnItemAdded;
159159
}
160160

161161
private static void OnItemAdded(ReferenceHub hub, ItemBase itemBase, ItemPickupBase pickupBase)
@@ -215,6 +215,9 @@ private static void OnProjectileThrew(PlayerThrewProjectileEventArgs ev)
215215
case CustomItemType.SCPItem when summoned.CustomItem.CustomData is SCP018Data scp018data && ev.Projectile.Base is Scp018Projectile scp018:
216216
scp018._friendlyFireTime = scp018data.FriendlyFireTime;
217217
scp018._fuseTime = scp018data.FuseTime;
218+
if (scp018data.ExplodeOnImpact)
219+
scp018.gameObject.AddComponent<CollisionHandler>().Init(scp018.gameObject, scp018);
220+
218221
break;
219222

220223
default:
@@ -2209,7 +2212,7 @@ public static void OnFlippedCoin(PlayerFlippedCoinEventArgs ev)
22092212
{
22102213
if (ev.CoinItem == null || ev.Player == null)
22112214
return;
2212-
2215+
22132216
if (!Utilities.TryGetSummonedCustomItem(ev.CoinItem.Serial, out SummonedCustomItem customItem))
22142217
return;
22152218

UncomplicatedCustomItems/Plugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public override void Enable()
8282
#if EXILED
8383
if (LabApi.Loader.PluginLoader.EnabledPlugins.Any(p => p.Name == "UncomplicatedCustomItems"))
8484
{
85-
LogManager.Warn($"You have both Exiled and LabApi versions of UCI installed this is not supported! Remove on of these for UCI to be enabled.");
85+
LogManager.Warn($"You have both Exiled and LabApi versions of UCI installed this is not supported! Remove one of these for UCI to be enabled.");
8686
OnDisabled();
8787
return;
8888
}

0 commit comments

Comments
 (0)