2using System.Collections.Generic;
3using CreativeSpore.SuperTilemapEditor;
49 public ParticleSystem
rain;
51 public ParticleSystem
snow;
137 public List<ISyncScreen>
syncList =
new List<ISyncScreen>();
144 public Dictionary<Card, ActorEx>
dictActorEx =
new Dictionary<Card, ActorEx>();
153 InvokeRepeating(
"RefreshActorEx", 0.5f, 0.5f);
162 Application.OpenURL(
Lang.
isJP ?
"https://ylvania.org/elin_dev.html" :
"https://ylvania.org/elin_dev_e.html");
173 Application.OpenURL(
Lang.
isJP ?
"https://ylvania.org/elin_dev.html" :
"https://ylvania.org/elin_dev_e.html");
180 Debug.Log(
"Scene.Init:" + newMode);
197 SoundManager.bgmVolumeMod = (SoundManager.bgmDumpMod = 0f);
224 EMono.player.target =
null;
232 EMono.core.config.game.ignoreWarnCrime = (EMono.core.config.game.ignoreWarnMana = (EMono.core.config.game.ignoreWarnDisassemble = (EMono.core.config.game.ignoreWarnSlaughter =
false)));
234 CellDetail.count = 0;
237 EMono.player.Agent.renderer.isSynced =
true;
245 Popper.scale = (EMono._zone.IsRegion ?
new Vector3(1.7f, 1.7f, 1f) : Vector3.one);
272 EMono.screen.tileMap.activeCount = 0;
300 EMono.player.onStartZone =
null;
302 ActionMode.LastBuildMode =
null;
330 EMono.
ui.widgets.Activate(
"QuestTracker");
369 SoundManager.speed = (EMono.core.IsGameStarted ? Mathf.Clamp(
actionMode.
gameSpeed * 0.75f, 1f, 2f) : 1f);
386 EInput.isShiftDown =
true;
390 EInput.isAltDown =
true;
397 EInput.isShiftDown =
true;
401 EInput.isAltDown =
true;
408 EInput.isShiftDown =
true;
412 EInput.isAltDown =
true;
415 EInput.hasShiftChanged = EInput.isShiftDown != isShiftDown;
436 num = (EInput.wheel = 0);
438 Slider componentOf2 =
InputModuleEX.GetComponentOf<Slider>();
442 componentOf2.value += (componentOf2.wholeNumbers ? ((float)num) : (0.1f * (float)num));
443 num = (EInput.wheel = 0);
449 if ((
bool)componentOf3)
459 num = (EInput.wheel = 0);
462 if (
EMono.
ui.contextMenu.isActive)
464 Slider componentOf4 =
InputModuleEX.GetComponentOf<Slider>();
465 if ((
bool)componentOf4)
467 componentOf4.value += (componentOf4.wholeNumbers ? ((float)num) : (0.1f * (float)num));
468 num = (EInput.wheel = 0);
473 if ((
bool)componentOf5)
475 num = (EInput.wheel = 0);
476 if (componentOf5.verticalScrollbar.isActiveAndEnabled)
482 if ((
bool)componentOf6 && componentOf6.onInputWheel !=
null)
485 num = (EInput.wheel = 0);
491 if (layer !=
null && layer.
windows.Count > 0)
496 num = (EInput.wheel = 0);
514 godray.SetActive(enable:
false);
530 srTarget.enabled =
true;
534 srTarget.transform.parent.position = position;
538 srTarget.enabled =
false;
543 EMono.player.pickupDelay = 0f;
574 EMono.player.deathDialog =
true;
575 EMono.player.returnInfo =
null;
576 EMono.player.ignoreFallOver = 1;
581 string lastWord = list.RandomItem();
591 EInput.haltInput =
false;
592 Dialog.
InputName(
"dialogLastword", lastWord, delegate(
bool cancel,
string text)
599 obj.deathMsg = obj.deathMsg + Lang.space + lastWord.Bracket(1);
603 Msg.
Say(lastWord.Bracket(1));
604 List<string> list2 =
new List<string>();
611 list2.Add(
"pc_revive_town".lang(lastTown.Name));
613 list2.Add(
"pc_revive");
614 list2.Add(
"pc_gameover");
618 list2.Add(
"pc_gameover");
620 Debug.Log(list2.Count);
623 EMono.ui.CloseLayers();
624 Dialog.List(
"pc_deathChoice".lang(), list2, (string j) => j, delegate(int c, string d)
626 EMono.player.deathDialog = false;
627 if (!EMono.game.principal.permadeath && (c == 0 || (addTownRevive && c == 1)))
629 EMono.pc.MakeGrave(lastWord);
631 EMono.pc.RecalculateFOV();
632 Zone zone = EMono.player.spawnZone ?? EMono.pc.homeZone;
633 if (addTownRevive && c == 0)
637 if (EMono.game.activeZone == zone)
639 EMono.pc.Teleport(EMono._zone.GetSpawnPos(EMono.pc, ZoneTransition.EnterState.Return).GetNearestPoint() ?? EMono._map.GetCenterPos(), silent: true, force: true);
643 EMono.player.deathZoneMove = true;
644 EMono.pc.MoveZone(zone, ZoneTransition.EnterState.Return);
646 EMono.screen.FocusPC();
648 if (EMono.player.stats.death == 0)
650 Tutorial.Reserve(
"death");
652 EMono.player.stats.death++;
653 if (EMono.player.stats.days <= 90)
655 EMono.player.stats.death2++;
660 EMono.game.GotoTitle(showDialog: false);
685 EMono.player.wasDirtyWeight =
false;
691 else if (
EMono.
ui.mouseInfo.gameObject.activeSelf)
742 EMono.player.lastTransition =
null;
761 CursorSystem.position.z = -100f;
795 foreach (Transform componentsInDirectChild
in EMono.
ui.rectDynamic.GetComponentsInDirectChildren<Transform>())
797 if (componentsInDirectChild.gameObject.tag !=
"IgnoreDestroy" && !componentsInDirectChild.GetComponent<
TC>())
799 UnityEngine.Object.Destroy(componentsInDirectChild.gameObject);
811 skyBG.SetActive(bg.
skyBox);
812 skyBG.sharedMaterial = bg.
mat;
813 skyPlane.SetActive(bg.
plane);
814 skyPlane.sharedMaterial = bg.
mat;
815 cam.clearFlags = ((!EMono.core.config.graphic.alwaysClearCamera && bg.
skyBox) ? CameraClearFlags.Depth : CameraClearFlags.Color);
842 ScreenGrading grading = camSupport.
grading;
843 ScreenGradingProfile.Lut lut = grading.lut;
845 if (conf.
idLut ==
"None")
851 lut.tex = Resources.Load<Texture2D>(
"Scene/Profile/Lut/" + conf.
idLut);
857 grading.SetGrading();
864 m.EnableKeyword(
"WAVE_ON");
865 Vector4[] array =
new Vector4[4]
867 new Vector4(-2f, -1f, -1f, 1f),
868 new Vector4(1f, 0f, 1f, 1f),
869 new Vector4(2f, 1f, -1f, 1f),
870 new Vector4(-1f, 0f, 1f, 1f)
872 m.SetVector(
"_WaveDir", array[conf.
seaDir - 1]);
876 m.DisableKeyword(
"WAVE_ON");
976 hideBalloon = !hideBalloon;
977 EMono.
ui.ShowBalloon(!hideBalloon);
1006 SoundManager.bgmDumpMod = 0f;
1007 foreach (
ActorEx value
in dictActorEx.Values)
1015 foreach (
ActorEx value
in dictActorEx.Values)
1019 dictActorEx.Clear();
1024 ActorEx actorEx = dictActorEx.TryGetValue(c);
1025 if (!(actorEx !=
null))
1028 onBeforeSetOwner?.Invoke(actorEx);
1030 dictActorEx.Add(c, actorEx);
1036 ActorEx actorEx = dictActorEx.TryGetValue(c);
1037 if (!(actorEx ==
null))
1040 dictActorEx.Remove(c);
1047 for (
int i = 0; i < array.Length; i++)
1058 pivot =
new Vector2(sprite.pivot.x / (sprite.bounds.size.x * 100f), sprite.pivot.y / (sprite.bounds.size.y * 100f))
1070 for (
int i = 0; i < array.Length; i++)
1078 for (
int i = 0; i < array.Length; i++)
1092 for (
int num = syncList.Count - 1; num >= 0; num--)
1095 if (syncScreen.
Sync != syncFrame)
1098 syncList.RemoveAt(num);
1102 RenderObject.syncFrame = syncFrame;
1107 Transform transform =
Util.Instantiate<Transform>(
"Scene/Prefab/" + id);
1108 transform.name = id;
1109 loadedPrefabs.Add(transform.gameObject);
1115 foreach (GameObject loadedPrefab
in loadedPrefabs)
1117 UnityEngine.Object.Destroy(loadedPrefab);
1119 loadedPrefabs.Clear();
1124 GameObject gameObject = GameObject.Find(
id);
1125 if ((
bool)gameObject)
1127 UnityEngine.Object.DestroyImmediate(gameObject);
static void CancelKeepPlaying()
void SetPressedAction(ButtonState button)
virtual void RefreshArrow()
virtual void OnBeforeUpdate()
virtual void OnUpdateCursor()
void Pause(bool sound=false)
void Activate(bool toggle=true, bool forceActivate=false)
virtual void OnAfterUpdate()
void WaitForEndOfFrame(Action action)
virtual void OnChangeHour()
BaseTileSelector tileSelector
void UpdateShaders(float time=0f)
static void PublishEvent(string eventId, object data=null)
MeshPass passAutoTileWater
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void DamageHP(long dmg, AttackSource attackSource=AttackSource.None, Card origin=null)
void PlayAnime(AnimeID id, bool force=false)
override bool IsAliveInCurrentZone
void Stumble(int mtp=100)
bool ignoreLinuxModWarning
bool ignoreParallelsWarning
static void SetCursor(CursorInfo info=null, int _priority=0)
static CursorSystem Instance
static void TryWarn(string lang, Action action, bool yes=true, string text=null)
static Dialog InputName(string langDetail, string text, Action< bool, string > onClose, InputType inputType=InputType.Default)
static GameSetting setting
static BaseGameScreen screen
static SoundManager Sound
static EffectManager Instance
static void DeleteGame(string id, bool cloud, bool deleteBackup=true)
bool Save(bool isAutoSave=false, bool silent=false)
ZoneTransition transition
static string[] GetList(string id)
static LayerAbility Instance
void SetDuration(float duration, Action onKill)
static void Apply(string id)
static ModItemList< Sprite > sprites
List< ModItem< T > > list
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
ZoneTransition lastTransition
void RefreshCurrentHotItem()
ref Vector3 PositionCenter()
void Build(Point _p, Mode _mode=Mode.Passive)
static void Apply(string id)
void Revelation(string idTalk, int chance=100)
List< ISyncScreen > syncList
ParticleSystem psRainSplashWater
void ToggleHighlightArea()
DamageTextRenderer damageTextRenderer
ParticleSystem godrayDust
GameSetting.RenderSetting.MapBGSetting bg
Dictionary< Card, ActorEx > dictActorEx
void ToggleBirdView(bool sound=true)
void DestroyPrefab(string id)
void RemoveActorEx(Card c)
Transform LoadPrefab(string id)
CameraFilterPack_Atmosphere_Rain filterRain
ParticleSystem psRainSplash
SoundSource sfxUnderwater
void AddActorEx(Card c, Action< ActorEx > onBeforeSetOwner=null)
ParticleSystem etherBlossom
GameScreenNoMap screenNoMap
AudioListener audioListener
ParticleSystem[] blizzards
void FocusAndPause(Point pos, int a)
List< GameObject > loadedPrefabs
GameScreenElona screenElona
ParticleSystem[] blossoms
static Sprite Get(string id)
static Dictionary< string, Sprite > dict
static UIDropdown activeInstance
static WidgetMainText Instance
void RefreshElectricity()
virtual FlockController.SpawnType FlockType
virtual bool IsUnderwater