Skip to content

Commit

Permalink
feat: add maggi instant noodle pack item
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantanrk committed Jun 7, 2024
1 parent 39d1ad0 commit 74fee24
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 1 deletion.
32 changes: 32 additions & 0 deletions CustomScriptableObject/MaggiInstantNoodlePackItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using LethalLib.Modules;
using UnityEngine;

namespace DingusThings.CustomScriptableObject
{
internal class MaggiInstantNoodlePackItem
{
public static void Register()
{
string itemName = "Maggi Instant Noodle pack";
AssetBundle? bundle = DingusThings.Bundle;
if (bundle == null)
{
DingusThings.Logger.LogError(itemName + " failed to load.");
return;
}

int rarity = 70;
Item item = bundle.LoadAsset<Item>("Assets/DingusThings/Items/MaggiInstantNoodlePack.asset");
PhysicsProp physicsProp = item.spawnPrefab.AddComponent<PhysicsProp>();
physicsProp.grabbable = true;
physicsProp.grabbableToEnemies = true;
physicsProp.isInFactory = true;
physicsProp.itemProperties = item;

// register scrap
NetworkPrefabs.RegisterNetworkPrefab(item.spawnPrefab);
Utilities.FixMixerGroups(item.spawnPrefab);
Items.RegisterScrap(item, rarity, Levels.LevelTypes.All);
}
}
}
1 change: 1 addition & 0 deletions DingusThings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private void Awake()
MyHeartItem.Register();
SteamGiftCardItem.Register();
LifebuoyBarSoapItem.Register();
MaggiInstantNoodlePackItem.Register();

Logger.LogInfo($"{PluginString} has loaded!");
}
Expand Down
2 changes: 1 addition & 1 deletion DingusThings.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<AssemblyName>milodinosaur.DingusThings</AssemblyName>
<Product>DingusThings</Product>
<!-- Change to whatever version you're currently on. -->
<Version>1.2.2</Version>
<Version>1.3.0</Version>
</PropertyGroup>

<!-- Project Properties -->
Expand Down

0 comments on commit 74fee24

Please sign in to comment.