Redone some code due to changes to DunGenPlus
Added audio to radios Made dungeon bigger but branch paths shorter Increased lighting chance
This commit is contained in:
parent
d382a3137d
commit
a46f833b27
@ -46,12 +46,6 @@ namespace ScarletMansionMimicsPatch {
|
||||
public override bool IsMyInteriorLoaded => ScarletMansion.DunGenPatch.Patch.active;
|
||||
|
||||
public override void OnMimicCreated(MimicDoor mimicDoor, Doorway doorway) {
|
||||
var c = doorway.transform.parent.GetComponentInChildren<DunGenPlus.Components.DoorwayCleanup>();
|
||||
if (c != null) {
|
||||
c.overrideConnector = true;
|
||||
c.overrideNoDoorway = true;
|
||||
}
|
||||
|
||||
var fixfireexit = doorway.GetComponentInChildren<FixFireExit>(true);
|
||||
fixfireexit.ForcefullyEnableDoorway();
|
||||
|
||||
|
@ -181,7 +181,7 @@ namespace ScarletMansion.Configs {
|
||||
dungeonLightingPrefix,
|
||||
"0 Lights Weight",
|
||||
1,
|
||||
"The weight that none of the spawned light sources (desk lamps, wall lamps, chandeliers) in a given tile will emit light. With the default weight spread of [1, 7, 2], there is a 10% chance that even in a room filled with lamps, none of them will emit light.",
|
||||
"The weight that none of the spawned light sources (desk lamps, wall lamps, chandeliers) in a given tile will emit light. With the default weight spread of [1, 6, 3], there is a 10% chance that even in a room filled with lamps, none of them will emit light.",
|
||||
new ConfigEntryBundleExtraParameters(VerifyLightingValues, false),
|
||||
new AcceptableValueRange<int>(0, 99)
|
||||
);
|
||||
@ -190,7 +190,7 @@ namespace ScarletMansion.Configs {
|
||||
dungeonLightingPrefix,
|
||||
"1 Light Weight",
|
||||
7,
|
||||
"The weight that only 1 of the spawned light sources (desk lamps, wall lamps, chandeliers) in a given tile will emit light. With the default weight spread of [1, 7, 2], there is a 70% chance that even in a room filled with lamps, only one of them will emit light.",
|
||||
"The weight that only 1 of the spawned light sources (desk lamps, wall lamps, chandeliers) in a given tile will emit light. With the default weight spread of [1, 6, 3], there is a 60% chance that even in a room filled with lamps, only one of them will emit light.",
|
||||
new ConfigEntryBundleExtraParameters(VerifyLightingValues, false),
|
||||
new AcceptableValueRange<int>(0, 99)
|
||||
);
|
||||
@ -199,7 +199,7 @@ namespace ScarletMansion.Configs {
|
||||
dungeonLightingPrefix,
|
||||
"2 Lights Weight",
|
||||
2,
|
||||
"The weight that only 2 of the spawned light sources (desk lamps, wall lamps, chandeliers) in a given tile will emit light. With the default weight spread of [1, 7, 2], there is a 20% chance that even in a room filled with lamps, only two of them will emit light.",
|
||||
"The weight that only 2 of the spawned light sources (desk lamps, wall lamps, chandeliers) in a given tile will emit light. With the default weight spread of [1, 6, 3], there is a 30% chance that even in a room filled with lamps, only two of them will emit light.",
|
||||
new ConfigEntryBundleExtraParameters(VerifyLightingValues, true),
|
||||
new AcceptableValueRange<int>(0, 99)
|
||||
);
|
||||
|
@ -33,9 +33,9 @@ namespace ScarletMansion.Configs
|
||||
new ChangeFloat ( dunGenLengthMultiFactor, 0.3333333f ),
|
||||
|
||||
new ChangeInt ( mainPathCount, 3 ),
|
||||
new ChangeMinMaxInt ( mainPathLength, 4, 5 ),
|
||||
new ChangeMinMaxInt ( mainPathLength, 6, 7 ),
|
||||
|
||||
new ChangeBranchingPath( branchPathSectionOne, 2, 4, 1, 2 ),
|
||||
new ChangeBranchingPath( branchPathSectionOne, 1, 2, 1, 2 ),
|
||||
new ChangeBranchingPath( branchPathSectionTwo, 1, 2, 1, 2 ),
|
||||
new ChangeBranchingPath( branchPathSectionThree, 0, 1, 0, 1 ),
|
||||
|
||||
@ -135,8 +135,8 @@ namespace ScarletMansion.Configs
|
||||
new ChangeInt ( hallwayLightsWeight, 150 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 150 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 1 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 8 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 2 )
|
||||
new ChangeInt ( lightsSpawnOneWeight, 6 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 3 )
|
||||
);
|
||||
|
||||
var brightLighting = new ChangeList(
|
||||
@ -145,8 +145,8 @@ namespace ScarletMansion.Configs
|
||||
new ChangeInt ( hallwayLightsWeight, 450 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 450 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 0 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 7 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 3 )
|
||||
new ChangeInt ( lightsSpawnOneWeight, 3 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 7 )
|
||||
);
|
||||
|
||||
var darkLighting = new ChangeList(
|
||||
@ -154,8 +154,8 @@ namespace ScarletMansion.Configs
|
||||
"Makes light sources much less common.",
|
||||
new ChangeInt ( hallwayLightsWeight, 50 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 50 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 2 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 8 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 3 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 7 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 0 )
|
||||
);
|
||||
|
||||
|
@ -33,7 +33,7 @@ namespace ScarletMansion.Configs {
|
||||
new ChangeFloat ( dunGenLengthMultiFactor, 0.3333333f ),
|
||||
|
||||
new ChangeInt ( mainPathCount, 3 ),
|
||||
new ChangeMinMaxInt ( mainPathLength, 3, 4 ),
|
||||
new ChangeMinMaxInt ( mainPathLength, 4, 5 ),
|
||||
|
||||
new ChangeBranchingPath( branchPathSectionOne, 4, 6, 1, 2 ),
|
||||
new ChangeBranchingPath( branchPathSectionTwo, 2, 3, 1, 2 ),
|
||||
@ -135,8 +135,8 @@ namespace ScarletMansion.Configs {
|
||||
new ChangeInt ( hallwayLightsWeight, 150 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 150 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 1 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 8 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 2 )
|
||||
new ChangeInt ( lightsSpawnOneWeight, 6 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 3 )
|
||||
);
|
||||
|
||||
var brightLighting = new ChangeList(
|
||||
@ -145,8 +145,8 @@ namespace ScarletMansion.Configs {
|
||||
new ChangeInt ( hallwayLightsWeight, 450 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 450 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 0 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 7 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 3 )
|
||||
new ChangeInt ( lightsSpawnOneWeight, 3 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 7 )
|
||||
);
|
||||
|
||||
var darkLighting = new ChangeList(
|
||||
@ -154,8 +154,8 @@ namespace ScarletMansion.Configs {
|
||||
"Makes light sources much less common.",
|
||||
new ChangeInt ( hallwayLightsWeight, 50 ),
|
||||
new ChangeInt ( ceilingLightsWeight, 50 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 2 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 8 ),
|
||||
new ChangeInt ( lightsSpawnZeroWeight, 3 ),
|
||||
new ChangeInt ( lightsSpawnOneWeight, 7 ),
|
||||
new ChangeInt ( lightsSpawnTwoWeight, 0 )
|
||||
);
|
||||
|
||||
|
@ -7,7 +7,7 @@ using UnityEngine;
|
||||
using DunGen;
|
||||
|
||||
namespace ScarletMansion {
|
||||
public class FloorCleanUpParent : MonoBehaviour, IDungeonCompleteReceiver {
|
||||
public class FloorCleanUpParent : MonoBehaviour {
|
||||
|
||||
public FloorCleanup[] children;
|
||||
|
||||
@ -15,7 +15,11 @@ namespace ScarletMansion {
|
||||
children = GetComponentsInChildren<FloorCleanup>();
|
||||
}
|
||||
|
||||
public void OnDungeonComplete(Dungeon dungeon) {
|
||||
void Awake(){
|
||||
DunGenPlus.Managers.DoorwayManager.AddActionHook(DunGenPlus.Components.Scripting.DunGenScriptingHook.OnMainEntranceTeleportSpawned, OnDungeonComplete);
|
||||
}
|
||||
|
||||
public void OnDungeonComplete() {
|
||||
var anyChanges = true;
|
||||
while(anyChanges) {
|
||||
anyChanges = false;
|
||||
|
@ -21,6 +21,11 @@ namespace ScarletMansion.GamePatch.Components {
|
||||
[Header("Songs")]
|
||||
public AudioClip[] audioClips;
|
||||
|
||||
[Header("SFX")]
|
||||
public AudioSource sfxAudioSource;
|
||||
public AudioClip clickBigClip;
|
||||
public AudioClip clickSmallClip;
|
||||
|
||||
[Header("References")]
|
||||
public AudioSource audioSource;
|
||||
public float maxVolume = 1f;
|
||||
@ -103,6 +108,7 @@ namespace ScarletMansion.GamePatch.Components {
|
||||
if (playing) AttemptTurnOn();
|
||||
else AttemptTurnOff();
|
||||
|
||||
sfxAudioSource.PlayOneShot(clickBigClip);
|
||||
}
|
||||
|
||||
[ServerRpc(RequireOwnership = false)]
|
||||
@ -115,6 +121,8 @@ namespace ScarletMansion.GamePatch.Components {
|
||||
public void ToggleVolumeSwitchClientRpc(int volume){
|
||||
this.volume = volume;
|
||||
audioSource.volume = maxVolume * (volume * 0.1f);
|
||||
|
||||
sfxAudioSource.PlayOneShot(clickSmallClip);
|
||||
}
|
||||
|
||||
[ServerRpc(RequireOwnership = false)]
|
||||
@ -132,6 +140,8 @@ namespace ScarletMansion.GamePatch.Components {
|
||||
if (playing && audioSource.isPlaying) audioSource.Stop();
|
||||
audioSource.clip = audioClips[audioIndex];
|
||||
AttemptTurnOn();
|
||||
|
||||
sfxAudioSource.PlayOneShot(clickBigClip);
|
||||
}
|
||||
|
||||
public void AttemptTurnOff(){
|
||||
|
@ -0,0 +1,19 @@
|
||||
using DunGen;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace ScarletMansion.GamePatch.FixValues
|
||||
{
|
||||
public class FixHallwayLightValueScaleVer: FixBaseClass<RandomPrefabWithScale> {
|
||||
public void Awake(){
|
||||
var weight = target.Props.Weights[1];
|
||||
var value = Plugin.CurrentConfigDungeon.GetHallwayLightsWeight;
|
||||
weight.MainPathWeight = value;
|
||||
weight.BranchPathWeight = value;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
@ -62,8 +62,6 @@ namespace ScarletMansion {
|
||||
var foyerFile = new ConfigFile(Path.Combine(Paths.ConfigPath, $"{modGUID}.foyer.cfg"), true);
|
||||
ConfigFoyer = new ConfigDungeonFoyer(foyerFile);
|
||||
|
||||
ConfigFoyer.SerializerTest();
|
||||
|
||||
var basementFile = new ConfigFile(Path.Combine(Paths.ConfigPath, $"{modGUID}.basement.cfg"), true);
|
||||
ConfigBasement = new ConfigDungeonBasement(basementFile);
|
||||
|
||||
|
@ -213,6 +213,7 @@
|
||||
<Compile Include="GamePatch\FixValues\FixCeilingLightValue.cs" />
|
||||
<Compile Include="GamePatch\FixValues\FixFireExit.cs" />
|
||||
<Compile Include="GamePatch\FixValues\FixHallwayLightValue.cs" />
|
||||
<Compile Include="GamePatch\FixValues\FixHallwayLightValueScaleVer.cs" />
|
||||
<Compile Include="GamePatch\FixValues\FixHoverIcon.cs" />
|
||||
<Compile Include="GamePatch\FixValues\FixRandomMapObject.cs" />
|
||||
<Compile Include="GamePatch\FixValues\FixSpawnItemGroup.cs" />
|
||||
|
Loading…
x
Reference in New Issue
Block a user