SDM_LethalCompany_Mod/ScarletMansion/ScarletMansion/GamePatch/Props/FloorPropBasedOnFloor.cs
LadyAliceMargatroid 523e7ed898 Added BrachTileBoost system
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
2024-08-19 02:44:15 -07:00

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;
}
}
}