Skip to content

Commit

Permalink
feat: register indomie instant noodle pack item
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantanrk committed Jun 8, 2024
1 parent 74fee24 commit 6c1d9c7
Show file tree
Hide file tree
Showing 5 changed files with 61 additions and 34 deletions.
43 changes: 43 additions & 0 deletions CustomScriptableObject/InstantNoodlePackItem.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
using LethalLib.Modules;
using UnityEngine;

namespace DingusThings.CustomScriptableObject
{
internal class InstantNoodlePackItem
{
public static void Register()
{
AssetBundle? bundle = DingusThings.Bundle;
if (bundle == null)
{
DingusThings.Logger.LogError("Instant noodle packs failed to load.");
return;
}

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

// register scrap
NetworkPrefabs.RegisterNetworkPrefab(maggiItem.spawnPrefab);
Utilities.FixMixerGroups(maggiItem.spawnPrefab);
Items.RegisterScrap(maggiItem, rarity, Levels.LevelTypes.All);

Item indomieItem = bundle.LoadAsset<Item>("Assets/DingusThings/Items/IndomieInstantNoodlePack.asset");
PhysicsProp indomiePhysicsProp = indomieItem.spawnPrefab.AddComponent<PhysicsProp>();
indomiePhysicsProp.grabbable = true;
indomiePhysicsProp.grabbableToEnemies = true;
indomiePhysicsProp.isInFactory = true;
indomiePhysicsProp.itemProperties = maggiItem;

// register scrap
NetworkPrefabs.RegisterNetworkPrefab(indomieItem.spawnPrefab);
Utilities.FixMixerGroups(indomieItem.spawnPrefab);
Items.RegisterScrap(indomieItem, rarity, Levels.LevelTypes.All);
}
}
}
32 changes: 0 additions & 32 deletions CustomScriptableObject/MaggiInstantNoodlePackItem.cs

This file was deleted.

2 changes: 1 addition & 1 deletion DingusThings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private void Awake()
MyHeartItem.Register();
SteamGiftCardItem.Register();
LifebuoyBarSoapItem.Register();
MaggiInstantNoodlePackItem.Register();
InstantNoodlePackItem.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.3.0</Version>
<Version>1.3.1</Version>
</PropertyGroup>

<!-- Project Properties -->
Expand Down
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,22 @@ Yet another Lethal Company custom scrap pack
Model made by me
</td>
</tr>
<tr>
<td>
Maggi Instant Noodle pack
</td>
<td>
Model made by me
</td>
</tr>
<tr>
<td>
Indomie Instant Noodle pack
</td>
<td>
Model made by me
</td>
</tr>
</table>

Assets: https://github.com/ryantanrk/DingusThings-Assets
Expand Down

0 comments on commit 6c1d9c7

Please sign in to comment.