|
|
@@ -6,6 +6,9 @@ namespace Subworlds.Scripts
|
|
|
{
|
|
|
public class OldChestScript : MonoBehaviour
|
|
|
{
|
|
|
+ private static int[] dropsLoot = new int[] { 1, 2, 3, 4, 11, 12, 13, 14, 21, 22, 23, 24, 31, 32, 33, 34 };
|
|
|
+ private static int[] dropsEmblem = new int[] { 101, 102, 103, 104, 111, 112, 113, 114, 121, 122, 123, 124, 131, 132, 133, 134 };
|
|
|
+
|
|
|
private bool opened = false;
|
|
|
|
|
|
private void Awake()
|
|
|
@@ -42,9 +45,27 @@ namespace Subworlds.Scripts
|
|
|
private IEnumerator DropLocalLoot()
|
|
|
{
|
|
|
yield return new WaitForSeconds(0.2f);
|
|
|
- var item = GadgetCoreAPI.EmptyItem();
|
|
|
- item.id = Core.itemOldTex.GetID();
|
|
|
- GadgetCoreAPI.DropItemLocal(gameObject.transform.position, item);
|
|
|
+ if (Random.Range(0, 3) == 0)
|
|
|
+ {
|
|
|
+ var item = GadgetCoreAPI.EmptyItem();
|
|
|
+ item.id = Core.itemOldTex.GetID();
|
|
|
+ GadgetCoreAPI.DropItemLocal(gameObject.transform.position, item);
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ var item = GadgetCoreAPI.EmptyItem();
|
|
|
+ item.id = dropsEmblem[Random.Range(0, dropsEmblem.Length)];
|
|
|
+ GadgetCoreAPI.DropItemLocal(gameObject.transform.position, item);
|
|
|
+ }
|
|
|
+ for (int i = 0; i < 3; i++)
|
|
|
+ {
|
|
|
+ if (Random.Range(0, 3) > 0)
|
|
|
+ {
|
|
|
+ var item = GadgetCoreAPI.EmptyItem();
|
|
|
+ item.id = dropsLoot[Random.Range(0, dropsLoot.Length)];
|
|
|
+ GadgetCoreAPI.DropItemLocal(gameObject.transform.position, item);
|
|
|
+ }
|
|
|
+ }
|
|
|
yield return new WaitForSeconds(0.2f);
|
|
|
GadgetCoreAPI.SpawnExp(gameObject.transform.position, 25);
|
|
|
yield return new WaitForSeconds(0.2f);
|
|
|
@@ -54,7 +75,7 @@ namespace Subworlds.Scripts
|
|
|
yield break;
|
|
|
}
|
|
|
|
|
|
- private static Texture2D textureOldChestOpen = GadgetCoreAPI.LoadTexture2D("oldChestOpen.png");
|
|
|
+ private static Texture2D textureOldChestOpen = GadgetCoreAPI.LoadTexture2D("Ship/oldChestOpen.png");
|
|
|
|
|
|
[RPC]
|
|
|
private void OpenMat()
|