2using System.Collections.Generic;
3using System.Runtime.Serialization;
102 if (!Input.GetKey(KeyCode.LeftShift))
104 return Input.GetKey(KeyCode.RightShift);
147 public static string id;
151 [JsonProperty(Order = -90)]
154 [JsonProperty(Order = -80)]
157 [JsonProperty(Order = -100)]
160 [JsonProperty(Order = -60)]
163 [JsonProperty(Order = -50)]
191 public PCCUniformManager
uniforms =
new PCCUniformManager();
249 public Dictionary<string, IGlobalValue>
referenceMap =
new Dictionary<string, IGlobalValue>();
284 public static void Wait(
float a)
294 player.stats.timeElapsed += Time.deltaTime;
297 flags.IsWelcomeMessageShown =
true;
302 public static bool TryLoad(
string id,
bool cloud, Action onLoad)
313 public static void Load(
string id,
bool cloud)
316 Debug.Log(
"Loading: " +
id +
": " + text);
323 EClass.game.isCloud = cloud;
324 EClass.game.isLoading =
true;
331 SoundManager.ignoreSounds =
true;
336 SoundManager.ignoreSounds =
true;
341 SoundManager.ignoreSounds =
false;
344 EClass.game.isLoading =
false;
361 state = ZoneTransition.EnterState.Return
371 EClass.pc.homeZone.isKnown =
true;
388 if (value.
id ==
"demitas" && value.
faction.
id ==
"wilds")
426 if (q != item4 && item4.id == q.id)
428 quests.list.Remove(item4);
440 if (q != global && global.id == q.id)
442 quests.globalList.Remove(global);
449 if (questDebt !=
null && questDebt.
stage == 6)
451 if (player.
debt == 19900000)
456 if (player.
debt == 19530000)
460 player.debt = 19500000;
464 TryAddQuest(
"into_darkness",
"exile_kettle");
465 if (version.
IsBelow(0, 23, 100))
473 if (version.
IsBelow(0, 23, 96))
476 player.resetPrincipal =
true;
481 EClass.game.principal.id = -1;
483 EClass.game.principal.disableManualSave = !gameDifficultySetting.
allowManualSave;
489 if (version.
IsBelow(0, 23, 93))
492 Debug.Log(
"â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– feafefaeffaeaffeaaeaefseasfaefaef");
493 while (TryAddRecipe())
497 if (version.
IsBelow(0, 23, 72))
503 value2.c_wasInPcParty =
false;
507 if (version.
IsBelow(0, 23, 59))
513 if (version.
IsBelow(0, 23, 52))
515 player.flags.toggleHotbarHighlightActivated =
true;
517 if (version.
IsBelow(0, 23, 51))
523 value3.idSkin = value3.uid % (value3.source._tiles.Length - 4) / 2 * 2 + ((!value3.
IsMale) ? 1 : 0);
527 if (version.
IsBelow(0, 22, 91))
529 TryAddQuestIfActive(
"demitas_spellwriter",
"into_darkness");
531 if (version.
IsBelow(0, 22, 86))
534 if (chara !=
null && chara.
_works !=
null && chara.
_works.Count > 0)
539 if (version.
IsBelow(0, 22, 86))
541 TryAddQuest(
"farris_tulip",
"greatDebt");
543 if (version.
IsBelow(0, 22, 86))
545 TryAddQuest(
"exile_whisper",
"exile_kettle");
547 if (version.
IsBelow(0, 22, 85))
549 TryAddQuest(
"exile_meet",
"pre_debt");
564 quests.
Add(
"pre_debt",
"farris");
570 if (q.
id ==
"farris_tulip")
572 quests.globalList.Remove(q);
576 quests.
list.ForeachReverse(delegate(
Quest q)
580 quests.list.Remove(q);
583 if (version.
IsBelow(0, 22, 20))
587 value4.
SetBool(18, enable:
false);
590 if (version.
IsBelow(0, 22, 22))
602 if (version.
IsBelow(0, 22, 45))
604 player.debt = 20000000;
632 void TryAddQuest(
string idQuest,
string idReqQuest)
639 void TryAddQuestIfActive(
string idQuest,
string idReqQuest)
641 if (quests.
Get(idReqQuest) !=
null && !quests.
completedIDs.Contains(idQuest) && quests.
GetGlobal(idQuest) ==
null && quests.
Get(idQuest) ==
null)
650 if (key.Length > 1 && key[0] ==
'b')
670 static bool TryDestroy()
679 if (i != j && chara3.
uid == chara4.
uid)
684 Debug.Log(
"Destroyed");
693 public static void Create(
string _id =
null,
bool cloud =
false)
696 OnBeforeInstantiate();
697 EClass.core.game = (Instance =
new Game());
698 EClass.core.game.isCloud = cloud;
706 Player.seedHallucination = 0;
711 HotItemHeld.taskBuild =
null;
712 InvOwner.Trader = (InvOwner.Main =
null);
713 LayerDrama.currentQuest =
null;
715 ContentGallery.lastPage = 0;
716 ContentGallery.listMode =
false;
725 player.chara = value;
730 EClass.
ui.widgets.OnGameInstantiated();
739 config.snapFreePos = (config.slope = (config.autoWall =
true));
740 config.autoCombat.abortOnAllyDead =
true;
741 config.autoCombat.abortOnHalfHP =
true;
742 config.autoCombat.bUseHotBar =
true;
743 config.autoCombat.bUseInventory =
true;
744 config.autoCombat.bDontChangeTarget =
true;
745 config.autoCombat.abortOnKill =
true;
746 config.autoCombat.abortOnItemLoss =
true;
748 Debug.Log(
"creating game: " +
id +
" seed:" +
seed);
754 foreach (
Spatial value
in spatials.
map.Values)
768 EClass.pc.homeZone = StartZone;
781 Zone zone4 = (chara.currentZone = zone2);
787 z = EClass.game.Prologue.startZ
800 state = ZoneTransition.EnterState.Auto
811 z = EClass.game.Prologue.startZ
821 z = EClass.game.Prologue.startZ
825 EClass.game.idPrologue = 2;
831 z = EClass.game.Prologue.startZ
856 z = EClass.game.Prologue.startZ
882 Zone zone2 = (EClass.pc.homeZone = zone5);
883 Zone zone4 = (chara2.currentZone = zone2);
885 EClass.pc.global.transition = transition;
894 state = ZoneTransition.EnterState.Return
898 EClass.pc.homeZone.isKnown =
true;
906 List<Zone> source =
world.region.ListTowns();
907 string[] array =
new string[6] {
"adv_kiria",
"adv_gaki",
"adv_wini",
"adv_verna",
"adv_ivory",
"adv_mesherada" };
910 Zone zone = source.RandomItem();
916 if (i >= array.Length && i < array.Length + 2)
924 state = ZoneTransition.EnterState.RandomVisit
939 EClass.scene.Init(Scene.Mode.Title);
960 public bool Save(
bool isAutoSave =
false,
bool silent =
false)
1025 item.DeleteMapRecursive();
1040 EClass.core.game = (Instance =
null);
1041 EClass.Sound.currentPlaylist =
null;
1043 foreach (Texture2D loadedTexture
in loadedTextures)
1045 if (loadedTexture !=
null)
1047 UnityEngine.Object.Destroy(loadedTexture);
1052 public void Pause(Action onUnpause =
null)
1057 if (onUnpause ==
null)
1073 Debug.Log(
"#io game OnSerializing");
1079 Debug.Log(
"#io game OnDeserializing");
static void OnGameInstantiated()
void SetBool(int id, bool enable)
List< Action > actionsNextFrame
static void Set(CardBlueprint _bp)
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 SetHomeZone(Zone zone)
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 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)
List< FactionBranch > GetChildren()
static string GetNewId(string path, string prefix="", int start=1)
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)
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)
Quest Start(string id, string idGlobalChara)
Quest GetGlobal(string id)
Quest SetClient(Chara c, bool assignQuest=true)
static Quest Create(string _id, string _idPerson=null, Chara c=null)
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 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)