Added Yukari pit hallway tile

Changed generation to use dungeonflow nodes
Made map smaller
Updated mimics patch to not be dumb
This commit is contained in:
LadyAliceMargatroid 2024-05-01 03:51:41 -07:00
parent cdadd75ee9
commit 6613191d7e
14 changed files with 223 additions and 84 deletions

View file

@ -0,0 +1,89 @@
using GameNetcodeStuff;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using UnityEngine;
namespace ScarletMansion.GamePatch.Components
{
public class ScarletYukariTrigger : MonoBehaviour {
public static int audioClipIndex = -1;
public bool sinkingLocalPlayer;
public float movementHinderence = 1.6f;
public float sinkingSpeedMultiplier = 0.21f;
private void OnTriggerStay(Collider other) {
var otherGameObject = other.gameObject;
if (!otherGameObject.CompareTag("Player")) {
return;
}
var comp = otherGameObject.GetComponent<PlayerControllerB>();
if (comp != GameNetworkManager.Instance.localPlayerController) return;
// sanity check
if (audioClipIndex == -1) comp.statusEffectAudioIndex = 0;
comp.statusEffectAudioIndex = audioClipIndex;
if (comp.isSinking) return;
if (sinkingLocalPlayer){
if (!comp.CheckConditionsForSinkingInQuicksand()) {
StopSinkingLocalPlayer(comp);
}
return;
}
if (comp.CheckConditionsForSinkingInQuicksand()){
Debug.Log("Set local player to sinking");
sinkingLocalPlayer = true;
comp.sourcesCausingSinking++;
comp.isMovementHindered++;
comp.hinderedMultiplier *= movementHinderence;
comp.sinkingSpeedMultiplier = sinkingSpeedMultiplier;
}
}
private void OnTriggerExit(Collider other){
OnExit(other);
}
public void OnExit(Collider other){
if (!sinkingLocalPlayer) {
Debug.Log("Yukari is not sinking local player");
return;
}
Debug.Log("Yukari is sinking something");
var otherGameObject = other.gameObject;
if (!otherGameObject.CompareTag("Player")){
return;
}
Debug.Log("Yukari is sinking a player");
var comp = otherGameObject.GetComponent<PlayerControllerB>();
if (comp != GameNetworkManager.Instance.localPlayerController) return;
Debug.Log("Yukari is sinking local player");
StopSinkingLocalPlayer(comp);
}
private void StopSinkingLocalPlayer(PlayerControllerB player) {
if (!sinkingLocalPlayer) return;
Plugin.logger.LogInfo("Stopping");
sinkingLocalPlayer = false;
player.sourcesCausingSinking = Mathf.Clamp(player.sourcesCausingSinking - 1, 0, 100);
player.isMovementHindered = Mathf.Clamp(player.isMovementHindered - 1, 0, 100);
player.hinderedMultiplier = Mathf.Clamp(player.hinderedMultiplier / movementHinderence - 1, 1f, 100f);
}
}
}