Fixed treasure room event for bedroom Fixed painting's interaction with MattyFixes Fixed critical damage bug introduced by v62 Increased lights spawn for all presets by a lot Added Coroner compatibility Added Scarlet Devil Mansion (moon) to the interior's spawn list Lights now have a chance of flickering and dying
39 lines
894 B
C#
39 lines
894 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Unity.Netcode;
|
|
using UnityEngine;
|
|
|
|
namespace ScarletMansion.GamePatch.Components.TreasureRoom {
|
|
public class TreasureRoomDoorStatus : NetworkBehaviour {
|
|
|
|
public GameObject[] doorStatusTargets;
|
|
public TreasureRoom treasureRoom;
|
|
public AudioSource audioSource;
|
|
|
|
private int previousCount;
|
|
|
|
[ClientRpc]
|
|
public void UpdateDoorStatusClientRpc(int count) {
|
|
var i = 0;
|
|
while(i < count && i < doorStatusTargets.Length) {
|
|
doorStatusTargets[i].SetActive(true);
|
|
++i;
|
|
}
|
|
|
|
while(i < doorStatusTargets.Length) {
|
|
doorStatusTargets[i].SetActive(false);
|
|
++i;
|
|
}
|
|
|
|
if (count > previousCount) {
|
|
audioSource.PlayOneShot(audioSource.clip);
|
|
}
|
|
|
|
previousCount = count;
|
|
}
|
|
|
|
}
|
|
}
|