2using System.Collections.Generic;
4using System.Runtime.Serialization;
103 if (!Input.GetKey(KeyCode.LeftShift))
105 return Input.GetKey(KeyCode.RightShift);
148 public static string id;
152 [JsonProperty(Order = -90)]
155 [JsonProperty(Order = -80)]
158 [JsonProperty(Order = -100)]
161 [JsonProperty(Order = -60)]
164 [JsonProperty(Order = -50)]
195 public PCCUniformManager
uniforms =
new PCCUniformManager();
256 public Dictionary<string, IGlobalValue>
referenceMap =
new Dictionary<string, IGlobalValue>();
293 public static void Wait(
float a)
303 player.stats.timeElapsed += Time.deltaTime;
306 flags.IsWelcomeMessageShown =
true;
311 public static bool TryLoad(
string id,
bool cloud, Action onLoad)
322 public static void Load(
string id,
bool cloud)
325 Debug.Log(
"Loading: " +
id +
": " + text);
331 GameIOContext data =
new GameIOContext(text);
334 EClass.game.isCloud = cloud;
335 EClass.game.isLoading =
true;
342 SoundManager.ignoreSounds =
true;
347 SoundManager.ignoreSounds =
true;
352 SoundManager.ignoreSounds =
false;
359 EClass.game.isLoading =
false;
377 state = ZoneTransition.EnterState.Return
387 EClass.pc.homeZone.isKnown =
true;
404 if (value.
id ==
"demitas" && value.
faction.
id ==
"wilds")
442 if (q != item4 && item4.id == q.id)
444 quests.list.Remove(item4);
456 if (q != global && global.id == q.id)
458 quests.globalList.Remove(global);
464 TryAddQuest(
"into_darkness",
"exile_kettle");
469 if (version.
IsBelow(0, 23, 185))
471 player.resetPrincipal =
true;
473 if (version.
IsBelow(0, 23, 182))
483 if (version.
IsBelow(0, 23, 155))
485 AddAdventurer(
"adv_yukiimo");
487 if (version.
IsBelow(0, 23, 100))
495 if (version.
IsBelow(0, 23, 96))
502 EClass.game.principal.id = -1;
504 EClass.game.principal.disableManualSave = !gameDifficultySetting.
allowManualSave;
510 if (version.
IsBelow(0, 23, 93))
513 Debug.Log(
"â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– feafefaeffaeaffeaaeaefseasfaefaef");
514 while (TryAddRecipe())
518 if (version.
IsBelow(0, 23, 72))
524 value3.c_wasInPcParty =
false;
528 if (version.
IsBelow(0, 23, 59))
538 if (version.
IsBelow(0, 23, 195))
540 Zone zone = spatials.
Find(
"startVillage2");
546 if (version.
IsBelow(0, 23, 52))
548 player.flags.toggleHotbarHighlightActivated =
true;
550 if (version.
IsBelow(0, 23, 51))
556 value4.idSkin = value4.uid % (value4.source._tiles.Length - 4) / 2 * 2 + ((!value4.
IsMale) ? 1 : 0);
560 if (version.
IsBelow(0, 22, 91))
562 TryAddQuestIfActive(
"demitas_spellwriter",
"into_darkness");
564 if (version.
IsBelow(0, 22, 86))
567 if (chara !=
null && chara.
_works !=
null && chara.
_works.Count > 0)
572 if (version.
IsBelow(0, 22, 86))
574 TryAddQuest(
"farris_tulip",
"greatDebt");
576 if (version.
IsBelow(0, 22, 86))
578 TryAddQuest(
"exile_whisper",
"exile_kettle");
580 if (version.
IsBelow(0, 22, 85))
582 TryAddQuest(
"exile_meet",
"pre_debt");
597 quests.
Add(
"pre_debt",
"farris");
603 if (q.
id ==
"farris_tulip")
605 quests.globalList.Remove(q);
609 quests.
list.ForeachReverse(delegate(
Quest q)
613 quests.list.Remove(q);
616 if (version.
IsBelow(0, 22, 20))
620 value5.
SetBool(18, enable:
false);
623 if (version.
IsBelow(0, 22, 22))
635 if (version.
IsBelow(0, 22, 45))
637 player.debt = 20000000;
667 if (item7.Value ==
null)
672 void TryAddQuest(
string idQuest,
string idReqQuest)
679 void TryAddQuestIfActive(
string idQuest,
string idReqQuest)
681 if (quests.
Get(idReqQuest) !=
null && !quests.
completedIDs.Contains(idQuest) && quests.
GetGlobal(idQuest) ==
null && quests.
Get(idQuest) ==
null)
690 if (key.Length > 1 && key[0] ==
'b')
710 static bool TryDestroy()
719 if (i != j && chara3.
uid == chara4.
uid)
724 Debug.Log(
"Destroyed");
733 public static void Create(
string _id =
null,
bool cloud =
false)
736 OnBeforeInstantiate();
737 EClass.core.game = (Instance =
new Game());
738 EClass.core.game.isCloud = cloud;
746 Player.seedHallucination = 0;
751 HotItemHeld.taskBuild =
null;
752 InvOwner.Trader = (InvOwner.Main =
null);
753 LayerDrama.currentQuest =
null;
754 ContentGallery.lastPage = 0;
755 ContentGallery.listMode =
false;
764 player.chara = value;
769 EClass.
ui.widgets.OnGameInstantiated();
778 config.snapFreePos = (config.slope = (config.autoWall =
true));
779 config.autoCombat.abortOnAllyDead =
true;
780 config.autoCombat.abortOnHalfHP =
true;
781 config.autoCombat.bUseHotBar =
true;
782 config.autoCombat.bUseInventory =
true;
783 config.autoCombat.bDontChangeTarget =
true;
784 config.autoCombat.abortOnKill =
true;
785 config.autoCombat.abortOnItemLoss =
true;
787 Debug.Log(
"creating game: " +
id +
" seed:" +
seed);
794 foreach (
Spatial value
in spatials.
map.Values)
808 EClass.pc.homeZone = StartZone;
828 Zone zone4 = (chara.currentZone = zone2);
834 z = EClass.game.Prologue.startZ
847 state = ZoneTransition.EnterState.Auto
858 z = EClass.game.Prologue.startZ
868 z = EClass.game.Prologue.startZ
872 EClass.game.idPrologue = 3;
878 z = EClass.game.Prologue.startZ
882 EClass.game.idPrologue = 2;
888 z = EClass.game.Prologue.startZ
913 z = EClass.game.Prologue.startZ
939 Zone zone2 = (EClass.pc.homeZone = zone5);
940 Zone zone4 = (chara2.currentZone = zone2);
942 EClass.pc.global.transition = transition;
951 state = ZoneTransition.EnterState.Return
955 EClass.pc.homeZone.isKnown =
true;
965 List<Zone> source =
world.region.ListTowns();
966 string[] array =
new string[7] {
"adv_kiria",
"adv_gaki",
"adv_wini",
"adv_verna",
"adv_ivory",
"adv_mesherada",
"adv_yukiimo" };
969 Zone zone = source.RandomItem();
975 if (i >= array.Length && i < array.Length + 2)
983 state = ZoneTransition.EnterState.RandomVisit
994 List<Zone> source =
world.region.ListTowns();
997 z = source.RandomItem();
1005 state = ZoneTransition.EnterState.RandomVisit
1019 EClass.scene.Init(Scene.Mode.Title);
1040 public bool Save(
bool isAutoSave =
false,
bool silent =
false)
1056 countLoadedMaps = 0;
1075 catch (Exception ex)
1108 item.DeleteMapRecursive();
1123 EClass.core.game = (Instance =
null);
1124 EClass.Sound.currentPlaylist =
null;
1126 foreach (Texture2D loadedTexture
in loadedTextures)
1128 if (loadedTexture !=
null)
1130 UnityEngine.Object.Destroy(loadedTexture);
1135 public void Pause(Action onUnpause =
null)
1140 if (onUnpause ==
null)
1156 Debug.Log(
"#io game OnSerializing");
1162 Debug.Log(
"#io game OnDeserializing");
static void OnGameInstantiated()
void SetBool(int id, bool enable)
List< Action > actionsNextFrame
static void PublishEvent(string eventId, object data=null)
static void Set(CardBlueprint _bp=null)
static CardBlueprint Chara(int lv, Rarity rarity=Rarity.Normal)
GlobalCharaList globalCharas
void RemoveEditorTag(EditorTag tag)
ElementContainerCard elements
Thing Add(string id, int num=1, int lv=1)
static Chara Create(string id, int lv=-1)
void Refresh(bool calledRecursive=false)
void RefreshWorkElements(ElementContainer parent=null)
Condition AddCondition(string id, int p=100, bool force=false)
void SetFeat(int id, int value=1, bool msg=false)
Chara SetHomeZone(Zone zone)
Chara SetGlobal(Zone _home, int x, int z)
override bool IsPCFaction
FactionMemberType memberType
void RefreshFaithElement()
ElementContainer faithElements
void MoveZone(string alias)
void ApplyFPS(bool force=false)
void TryUpdatePlayedHour()
static string RootSaveCloud
int GetRaw(int offsetHours=0)
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
static SourceManager sources
static SoundManager Sound
static GameSetting setting
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
Element SetBase(string alias, int v, int potential=0)
List< FactionBranch > GetChildren()
static string GetNewId(string path, string prefix="", int start=1)
static string pathCurrentSave
static bool CanLoad(string root)
static GameIndex SaveGame()
static Game LoadGame(string id, string root, bool cloud)
static void MakeBackup(GameIndex index, string suffix="")
List< GameDifficultySetting > difficulties
List< GamePrincipal > principals
List< Prologue > prologues
ConfigPreference preference
ConfigAutoCombat autoCombat
bool IsWelcomeMessageShown
void OnSerializing(StreamingContext context)
void _OnDeserialized(StreamingContext context)
void OnSerializing(StreamingContext context)
HashSet< Texture2D > loadedTextures
Dictionary< string, IGlobalValue > referenceMap
static void OnBeforeInstantiate()
ReligionManager religions
static void Load(string id, bool cloud)
static bool TryLoad(string id, bool cloud, Action onLoad)
void GotoTitle(bool showDialog=true)
bool Save(bool isAutoSave=false, bool silent=false)
PCCUniformManager uniforms
TeleportManager teleports
static void Create(string _id=null, bool cloud=false)
void OnDeserializing(StreamingContext context)
void Pause(Action onUnpause=null)
static new void Wait(float a, Card c)
static new void Wait(float a, Point p)
void AddAdventurer(string id, Zone z=null)
RelationManager relations
void OnGameInstantiated()
static void Wait(float a)
Layer SetOnKill(Action action)
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Party Create(Chara leader)
HashSet< string > completedIDs
Quest Add(string id, string idGlobalChara=null)
bool IsCompleted(string id)
Quest Start(string id, string idGlobalChara)
Quest GetGlobal(string id)
static Quest Create(string _id, string _idPerson=null, Chara c=null, bool assignQuest=true)
Quest SetClient(Chara c, bool assignQuest=true)
static RecipeSource Get(string id)
Dictionary< string, int > knownRecipes
void Add(string id, bool showEffect=true)
static Spatial Create(string id, Spatial parent, bool register, int x=-99999, int y=-99999, int icon=0)
static Spatial CreateRecursive(string id, Spatial parent=null)
List< Spatial > listDestryoed
virtual void SetMainFaction(Faction f)
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
void RefreshGridRecursive()
static Thing CreateParcel(string idLang=null, params Thing[] things)
static Thing CreateCassette(int id)
static Thing Create(string id, int idMat=-1, int lv=-1)
static Dictionary< string, int > dictTab
override string ToString()
ElementContainerZone elements
Card AddCard(Card t, Point point)
override bool Equals(object obj)
bool IsBelow(int _major, int _minor, int _batch)