Added the new coilhead behaviour to the knight Added treasure room puzzle for bedroom Changed many LogInfo into LogDebug Removed jank animator override stuff (no offense) Changed how treasure rooms lock their doors to work in multiplayer Removed basement scripts
47 lines
1.4 KiB
C#
47 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using DunGen;
|
|
using UnityEngine;
|
|
|
|
namespace ScarletMansion.GamePatch.Props {
|
|
public class FloorPropBasedOnFloor : RandomProp {
|
|
|
|
public GameObject topFloorPrefab;
|
|
public List<GameObject> secondFloorPrefabs;
|
|
public GameObject mainFloorPrefab;
|
|
public List<GameObject> basementFloorPrefabs;
|
|
public GameObject bottomFloorPrefab;
|
|
|
|
public override void Process(RandomStream randomStream, Tile tile) {
|
|
var baseY = KnightSpawnManager.Instance.transform.position.y;
|
|
var currentY = tile.transform.position.y;
|
|
|
|
var floor = Mathf.RoundToInt((currentY - baseY) / 8f);
|
|
Plugin.logger.LogDebug($"F{floor}");
|
|
// fuck it im lazy
|
|
GameObject p;
|
|
if (floor == 0) {
|
|
p = mainFloorPrefab;
|
|
} else if (floor == 1) {
|
|
p = secondFloorPrefabs[randomStream.Next(secondFloorPrefabs.Count)];
|
|
} else if (floor == -1) {
|
|
p = basementFloorPrefabs[randomStream.Next(basementFloorPrefabs.Count)];
|
|
} else if (floor >= 2) {
|
|
p = topFloorPrefab;
|
|
} else {
|
|
p = bottomFloorPrefab;
|
|
}
|
|
|
|
var gameObject = GameObject.Instantiate(p);
|
|
var gameObjectTransform = gameObject.transform;
|
|
gameObjectTransform.parent = transform;
|
|
|
|
gameObjectTransform.localPosition = Vector3.zero;
|
|
gameObjectTransform.localRotation = Quaternion.identity;
|
|
}
|
|
|
|
}
|
|
}
|