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")
460 if (item5.Value ==
null)
469 Debug.Log(
"ApplyFix");
481 if (q != item && item.id == q.id)
483 quests.list.Remove(item);
495 if (q != global && global.id == q.id)
497 quests.globalList.Remove(global);
503 if (version.
IsBelow(0, 23, 360))
511 switch (item2.
source.categorySub)
519 if (item2.
vBase < dNABonus)
530 if (version.
IsBelow(0, 23, 354))
535 if (version.
IsBelow(0, 23, 345))
537 Zone zone = spatials.
Find(
"oldkeep");
543 if (version.
IsBelow(0, 23, 336))
545 AddAdventurer(
"adv_schwert");
547 TryAddQuest(
"into_darkness",
"exile_kettle");
552 if (version.
IsBelow(0, 23, 185))
554 player.resetPrincipal =
true;
556 if (version.
IsBelow(0, 23, 182))
566 if (version.
IsBelow(0, 23, 155))
568 AddAdventurer(
"adv_yukiimo");
570 if (version.
IsBelow(0, 23, 100))
578 if (version.
IsBelow(0, 23, 96))
585 EClass.game.principal.id = -1;
587 EClass.game.principal.disableManualSave = !gameDifficultySetting.
allowManualSave;
593 if (version.
IsBelow(0, 23, 93))
596 Debug.Log(
"â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– feafefaeffaeaffeaaeaefseasfaefaef");
597 while (TryAddRecipe())
601 if (version.
IsBelow(0, 23, 72))
607 value2.c_wasInPcParty =
false;
611 if (version.
IsBelow(0, 23, 59))
621 if (version.
IsBelow(0, 23, 195))
623 Zone zone2 = spatials.
Find(
"startVillage2");
629 if (version.
IsBelow(0, 23, 52))
631 player.flags.toggleHotbarHighlightActivated =
true;
633 if (version.
IsBelow(0, 23, 51))
639 value3.idSkin = value3.uid % (value3.source._tiles.Length - 4) / 2 * 2 + ((!value3.
IsMale) ? 1 : 0);
643 if (version.
IsBelow(0, 22, 91))
645 TryAddQuestIfActive(
"demitas_spellwriter",
"into_darkness");
647 if (version.
IsBelow(0, 22, 86))
650 if (chara !=
null && chara.
_works !=
null && chara.
_works.Count > 0)
655 if (version.
IsBelow(0, 22, 86))
657 TryAddQuest(
"farris_tulip",
"greatDebt");
659 if (version.
IsBelow(0, 22, 86))
661 TryAddQuest(
"exile_whisper",
"exile_kettle");
663 if (version.
IsBelow(0, 22, 85))
665 TryAddQuest(
"exile_meet",
"pre_debt");
680 quests.
Add(
"pre_debt",
"farris");
686 if (q.
id ==
"farris_tulip")
688 quests.globalList.Remove(q);
692 quests.
list.ForeachReverse(delegate(
Quest q)
696 quests.list.Remove(q);
699 if (version.
IsBelow(0, 22, 20))
703 value4.
SetBool(18, enable:
false);
706 if (version.
IsBelow(0, 22, 22))
718 if (version.
IsBelow(0, 22, 45))
720 player.debt = 20000000;
722 static void FixElement(
Chara c,
int idEle)
724 int num2 =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)c.
race.elementMap, idEle, 0) +
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)c.job.elementMap, idEle, 0);
725 if (c.c_genes !=
null)
727 num2 += c.c_genes.CountDNA(idEle);
729 foreach (
BodySlot slot
in c.body.slots)
736 Element orCreateElement = c.elements.GetOrCreateElement(idEle);
739 Debug.Log(
"FixElement: " + orCreateElement.
Name +
"/" + orCreateElement.
vBase +
"/" + orCreateElement.
vSource +
"/" + num2);
740 orCreateElement.vBase = num2 - orCreateElement.
vSource;
744 Debug.Log(
"FixElement(Ability): " + orCreateElement.
Name +
"/" + orCreateElement.
Value +
"/" + orCreateElement.
vPotential +
"/" + num2);
745 orCreateElement.vPotential = 0;
748 void TryAddQuest(
string idQuest,
string idReqQuest)
755 void TryAddQuestIfActive(
string idQuest,
string idReqQuest)
757 if (quests.
Get(idReqQuest) !=
null && !quests.
completedIDs.Contains(idQuest) && quests.
GetGlobal(idQuest) ==
null && quests.
Get(idQuest) ==
null)
766 if (key.Length > 1 && key[0] ==
'b')
786 static bool TryDestroy()
795 if (i != j && chara3.
uid == chara4.
uid)
800 Debug.Log(
"Destroyed");
809 public static void Create(
string _id =
null,
bool cloud =
false)
812 OnBeforeInstantiate();
813 EClass.core.game = (Instance =
new Game());
814 EClass.core.game.isCloud = cloud;
822 Player.seedHallucination = 0;
827 HotItemHeld.taskBuild =
null;
828 InvOwner.Trader = (InvOwner.Main =
null);
829 LayerDrama.currentQuest =
null;
830 ContentGallery.lastPage = 0;
831 ContentGallery.listMode =
false;
840 player.chara = value;
845 EClass.
ui.widgets.OnGameInstantiated();
854 config.snapFreePos = (config.slope = (config.autoWall =
true));
855 config.autoCombat.abortOnAllyDead =
true;
856 config.autoCombat.abortOnHalfHP =
true;
857 config.autoCombat.bUseHotBar =
true;
858 config.autoCombat.bUseInventory =
true;
859 config.autoCombat.bDontChangeTarget =
true;
860 config.autoCombat.abortOnKill =
true;
861 config.autoCombat.abortOnItemLoss =
true;
863 Debug.Log(
"creating game: " +
id +
" seed:" +
seed);
870 foreach (
Spatial value
in spatials.
map.Values)
884 EClass.pc.homeZone = StartZone;
904 Zone zone3 = (chara.currentZone = zone);
910 z = EClass.game.Prologue.startZ
923 state = ZoneTransition.EnterState.Auto
934 z = EClass.game.Prologue.startZ
944 z = EClass.game.Prologue.startZ
948 EClass.game.idPrologue = 3;
954 z = EClass.game.Prologue.startZ
958 EClass.game.idPrologue = 2;
964 z = EClass.game.Prologue.startZ
989 z = EClass.game.Prologue.startZ
1015 Zone zone = (EClass.pc.homeZone = zone5);
1016 Zone zone3 = (chara2.currentZone = zone);
1018 EClass.pc.global.transition = transition;
1027 state = ZoneTransition.EnterState.Return
1031 EClass.pc.homeZone.isKnown =
true;
1041 List<Zone> source =
world.region.ListTowns();
1042 string[] array =
new string[8] {
"adv_kiria",
"adv_gaki",
"adv_wini",
"adv_verna",
"adv_ivory",
"adv_mesherada",
"adv_yukiimo",
"adv_schwert" };
1045 Zone zone = source.RandomItem();
1051 if (i >= array.Length && i < array.Length + 2)
1059 state = ZoneTransition.EnterState.RandomVisit
1070 List<Zone> source =
world.region.ListTowns();
1073 z = source.RandomItem();
1081 state = ZoneTransition.EnterState.RandomVisit
1095 EClass.scene.Init(Scene.Mode.Title);
1116 public bool Save(
bool isAutoSave =
false,
bool silent =
false)
1132 countLoadedMaps = 0;
1151 catch (Exception ex)
1184 item.DeleteMapRecursive();
1199 EClass.core.game = (Instance =
null);
1200 EClass.Sound.currentPlaylist =
null;
1202 foreach (Texture2D loadedTexture
in loadedTextures)
1204 if (loadedTexture !=
null)
1206 UnityEngine.Object.Destroy(loadedTexture);
1211 public void Pause(Action onUnpause =
null)
1216 if (onUnpause ==
null)
1232 Debug.Log(
"#io game OnSerializing");
1238 Debug.Log(
"#io game OnDeserializing");
static void OnGameInstantiated()
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)
void SetBool(string id, bool enable)
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
Element GetElement(int id)
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)
Dictionary< int, Element > dict
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
void SetInt(int id, int value=0)
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)