Elin Decompiled Documentation EA 23.182 Nightly
Loading...
Searching...
No Matches
Game Class Reference
Inheritance diagram for Game:
EClass

Classes

class  Config
 
class  Flags
 

Public Member Functions

void OnUpdate ()
 
void OnLoad ()
 
void OnGameInstantiated ()
 
void _Create ()
 
void StartNewGame ()
 
void AddAdventurers ()
 
void AddAdventurer (string id, Zone z=null)
 
void GotoTitle (bool showDialog=true)
 
void Quit ()
 
bool Save (bool isAutoSave=false, bool silent=false)
 
void OnBeforeSave ()
 
void Kill ()
 
void Pause (Action onUnpause=null)
 

Static Public Member Functions

static new void Wait (float a, Point p)
 
static new void Wait (float a, Card c)
 
static void Wait (float a)
 
static bool TryLoad (string id, bool cloud, Action onLoad)
 
static void Load (string id, bool cloud)
 
static void Create (string _id=null, bool cloud=false)
 
static void OnBeforeInstantiate ()
 
- Static Public Member Functions inherited from EClass
static int rndSeed (int a, int seed)
 
static int rnd (long a)
 
static int rnd (int a)
 
static int curve (int a, int start, int step, int rate=75)
 
static int rndHalf (int a)
 
static float rndf (float a)
 
static int rndSqrt (int a)
 
static void Wait (float a, Card c)
 
static void Wait (float a, Point p)
 
static int Bigger (int a, int b)
 
static int Smaller (int a, int b)
 

Public Attributes

SpatialManager spatials = new SpatialManager()
 
CardManager cards = new CardManager()
 
ReligionManager religions = new ReligionManager()
 
FactionManager factions = new FactionManager()
 
DomainManager domains = new DomainManager()
 
Version version
 
PartyManager parties = new PartyManager()
 
new World world
 
new Player player = new Player()
 
QuestManager quests = new QuestManager()
 
RelationManager relations = new RelationManager()
 
MsgLog log
 
PCCUniformManager uniforms = new PCCUniformManager()
 
TeleportManager teleports = new TeleportManager()
 
int seed
 
int idPrologue
 
int idDifficulty
 
int dateScratch
 
double backupTime
 
Flags flags = new Flags()
 
Config config = new Config()
 
List< ThinglostThings = new List<Thing>()
 
GamePrincipal principal = new GamePrincipal()
 
int gameSpeedIndex = 1
 
int lastGameSpeedIndex = 1
 
int sessionMin
 
int countLoadedMaps
 
int saveCount
 
float timeSinceStart
 
bool isLoading
 
bool isKilling
 
bool isCloud
 
GameBlueprint bp
 
GameUpdater updater = new GameUpdater()
 
Zone activeZone
 
Zone lastActiveZone
 
Dictionary< string, IGlobalValuereferenceMap = new Dictionary<string, IGlobalValue>()
 
HashSet< Texture2D > loadedTextures = new HashSet<Texture2D>()
 

Static Public Attributes

static Game Instance
 
static float waitTimer
 
static string id
 
static bool isPaused
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

static bool IsWaiting [get]
 
Prologue Prologue [get]
 
bool UseGrid [get]
 
bool altUI [get]
 
bool altInv [get]
 
bool altCraft [get]
 
bool altAbility [get]
 
Zone StartZone [get]
 
- Properties inherited from EClass
static Game game [get]
 
static bool AdvMode [get]
 
static Player player [get]
 
static Chara pc [get]
 
static UI ui [get]
 
static Map _map [get]
 
static Zone _zone [get]
 
static FactionBranch Branch [get]
 
static FactionBranch BranchOrHomeBranch [get]
 
static Faction Home [get]
 
static Faction Wilds [get]
 
static Scene scene [get]
 
static BaseGameScreen screen [get]
 
static GameSetting setting [get]
 
static GameData gamedata [get]
 
static ColorProfile Colors [get]
 
static World world [get]
 
static SourceManager sources [get]
 
static SourceManager editorSources [get]
 
static SoundManager Sound [get]
 
static CoreDebug debug [get]
 

Private Member Functions

void OnSerializing (StreamingContext context)
 
void OnDeserializing (StreamingContext context)
 

Private Attributes

float welcomeTimer
 

Detailed Description

Definition at line 7 of file Game.cs.

Member Function Documentation

◆ _Create()

void Game._Create ( )
inline

Definition at line 737 of file Game.cs.

738 {
739 principal = IO.DeepCopy(EClass.setting.start.principals[0]);
740 idDifficulty = 1;
741 config.snapFreePos = (config.slope = (config.autoWall = true));
742 config.autoCombat.abortOnAllyDead = true;
743 config.autoCombat.abortOnHalfHP = true;
744 config.autoCombat.bUseHotBar = true;
745 config.autoCombat.bUseInventory = true;
746 config.autoCombat.bDontChangeTarget = true;
747 config.autoCombat.abortOnKill = true;
748 config.autoCombat.abortOnItemLoss = true;
749 seed = EClass.rnd(10000);
750 Debug.Log("creating game: " + id + " seed:" + seed);
751 uniforms.Import();
756 foreach (Spatial value in spatials.map.Values)
757 {
758 value.SetMainFaction(factions.Find(value.source.faction.IsEmpty("wilds")));
759 }
761 cards.container_shipping = ThingGen.Create("container_shipping");
762 cards.container_deliver = ThingGen.Create("container_delivery");
763 cards.container_deposit = ThingGen.Create("container_deposit");
764 bp = new GameBlueprint();
765 bp.Create();
766 }
void OnCreateGame()
Definition: DomainManager.cs:7
Definition: EClass.cs:5
static int rnd(long a)
Definition: EClass.cs:58
static GameSetting setting
Definition: EClass.cs:34
Faction Find(string id)
List< GamePrincipal > principals
Definition: GameSetting.cs:244
StartSetting start
Definition: GameSetting.cs:305
GameBlueprint bp
Definition: Game.cs:241
new Player player
Definition: Game.cs:176
ReligionManager religions
Definition: Game.cs:158
GamePrincipal principal
Definition: Game.cs:221
DomainManager domains
Definition: Game.cs:164
SpatialManager spatials
Definition: Game.cs:152
PCCUniformManager uniforms
Definition: Game.cs:191
new World world
Definition: Game.cs:173
int idDifficulty
Definition: Game.cs:203
int seed
Definition: Game.cs:197
FactionManager factions
Definition: Game.cs:161
Definition: IO.cs:11
void OnCreateGame()
Definition: Player.cs:1268
static Spatial CreateRecursive(string id, Spatial parent=null)
Definition: SpatialGen.cs:3
GlobalSpatialList map
SourceZone.Row source
Definition: Spatial.cs:441
virtual void SetMainFaction(Faction f)
Definition: Spatial.cs:632
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: World.cs:4

References ZoneBlueprint.Create(), ThingGen.Create(), SpatialGen.CreateRecursive(), Debug, FactionManager.Find(), SpatialManager.map, DomainManager.OnCreateGame(), FactionManager.OnCreateGame(), Player.OnCreateGame(), ReligionManager.OnCreateGame(), GameSetting.StartSetting.principals, EClass.rnd(), seed, Spatial.SetMainFaction(), EClass.setting, Spatial.source, GameSetting.start, and world.

Referenced by Create().

◆ AddAdventurer()

void Game.AddAdventurer ( string  id,
Zone  z = null 
)
inline

Definition at line 933 of file Game.cs.

934 {
935 if (z == null)
936 {
937 List<Zone> source = world.region.ListTowns();
938 do
939 {
940 z = source.RandomItem();
941 }
942 while ((z is Zone_SubTown && EClass.rnd(5) != 0) || z == EClass.pc.currentZone);
943 }
944 Chara chara = CharaGen.Create(id);
945 chara.SetHomeZone(z);
946 chara.global.transition = new ZoneTransition
947 {
948 state = ZoneTransition.EnterState.RandomVisit
949 };
950 z.AddCard(chara);
951 cards.listAdv.Add(chara);
952 }
List< Chara > listAdv
Definition: CardManager.cs:64
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Definition: Chara.cs:10
void SetHomeZone(Zone zone)
Definition: Chara.cs:1408
Zone currentZone
Definition: Chara.cs:253
static Chara pc
Definition: EClass.cs:14
CardManager cards
Definition: Game.cs:155
List< Zone > ListTowns()
Definition: Region.cs:274
Region region
Definition: World.cs:23
Card AddCard(Card t, Point point)
Definition: Zone.cs:1925

References CharaGen.Create(), Chara.currentZone, CardManager.listAdv, EClass.pc, EClass.rnd(), Chara.SetHomeZone(), and world.

◆ AddAdventurers()

void Game.AddAdventurers ( )
inline

Definition at line 906 of file Game.cs.

907 {
908 List<Zone> source = world.region.ListTowns();
909 string[] array = new string[7] { "adv_kiria", "adv_gaki", "adv_wini", "adv_verna", "adv_ivory", "adv_mesherada", "adv_yukiimo" };
910 for (int i = 0; i < EClass.setting.balance.numAdv; i++)
911 {
912 Zone zone = source.RandomItem();
913 if (zone is Zone_SubTown && EClass.rnd(5) != 0)
914 {
915 i--;
916 continue;
917 }
918 if (i >= array.Length && i < array.Length + 2)
919 {
921 }
922 Chara chara = CharaGen.Create((i < array.Length) ? array[i] : ((EClass.rnd(10) == 0) ? "adv_fairy" : "adv"));
923 chara.SetHomeZone(zone);
924 chara.global.transition = new ZoneTransition
925 {
926 state = ZoneTransition.EnterState.RandomVisit
927 };
928 zone.AddCard(chara);
929 cards.listAdv.Add(chara);
930 }
931 }
static void Set(CardBlueprint _bp)
static CardBlueprint Chara(int lv, Rarity rarity=Rarity.Normal)
BalanceSetting balance
Definition: GameSetting.cs:309
Definition: Zone.cs:12

References Zone.AddCard(), GameSetting.balance, CardBlueprint.Chara(), CharaGen.Create(), CardManager.listAdv, GameSetting.BalanceSetting.numAdv, EClass.rnd(), CardBlueprint.Set(), Chara.SetHomeZone(), EClass.setting, and world.

Referenced by OnLoad().

◆ Create()

static void Game.Create ( string  _id = null,
bool  cloud = false 
)
inlinestatic

Definition at line 695 of file Game.cs.

696 {
697 id = _id ?? GameIO.GetNewId(cloud ? CorePath.RootSaveCloud : CorePath.RootSave, "world_");
699 EClass.core.game = (Instance = new Game());
700 EClass.core.game.isCloud = cloud;
704 }
static string RootSave
Definition: CorePath.cs:206
static string RootSaveCloud
Definition: CorePath.cs:208
Game game
Definition: Core.cs:72
static Core core
Definition: EClass.cs:6
Definition: GameIO.cs:10
static string GetNewId(string path, string prefix="", int start=1)
Definition: GameIO.cs:352
static void ResetTemp()
Definition: GameIO.cs:51
Definition: Game.cs:8
void _Create()
Definition: Game.cs:737
static void OnBeforeInstantiate()
Definition: Game.cs:706
static Game Instance
Definition: Game.cs:143
void OnGameInstantiated()
Definition: Game.cs:711

References _Create(), EClass.core, Core.game, GameIO.GetNewId(), OnGameInstantiated(), GameIO.ResetTemp(), CorePath.RootSave, and CorePath.RootSaveCloud.

Referenced by LayerEditBio.OnAfterAddLayer(), LayerEmbark.OnAfterAddLayer(), and CoreDebug.QuickStart().

◆ GotoTitle()

void Game.GotoTitle ( bool  showDialog = true)
inline

Definition at line 954 of file Game.cs.

955 {
956 if (showDialog)
957 {
958 Dialog.YesNo("dialog_gotoTitle", delegate
959 {
960 if (EClass.game.Save(isAutoSave: true))
961 {
962 EClass.scene.Init(Scene.Mode.Title);
963 }
964 });
965 }
966 else
967 {
968 EClass.scene.Init(Scene.Mode.Title);
969 }
970 }
Definition: Dialog.cs:7
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
Definition: Dialog.cs:244
static Game game
Definition: EClass.cs:8
static Scene scene
Definition: EClass.cs:30
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:983
Definition: Scene.cs:8
void Init(Mode newMode)
Definition: Scene.cs:178
Mode
Definition: Scene.cs:10

References EClass.game, Scene.Init(), Save(), EClass.scene, and Dialog.YesNo().

Referenced by LayerPauseMenu.OnClickTitle(), and HotItemContext.Show().

◆ Kill()

void Game.Kill ( )
inline

Definition at line 1053 of file Game.cs.

1054 {
1055 isKilling = true;
1056 Debug.Log("Killing Game: IsStarted? " + EClass.core.IsGameStarted);
1058 {
1059 EClass.ui.OnKillGame();
1062 }
1063 EClass.core.game = (Instance = null);
1064 EClass.Sound.currentPlaylist = null;
1065 Window.dictTab.Clear();
1066 foreach (Texture2D loadedTexture in loadedTextures)
1067 {
1068 if (loadedTexture != null)
1069 {
1070 UnityEngine.Object.Destroy(loadedTexture);
1071 }
1072 }
1073 }
bool IsGameStarted
Definition: Core.cs:84
static UI ui
Definition: EClass.cs:16
HashSet< Texture2D > loadedTextures
Definition: Game.cs:251
Zone activeZone
Definition: Game.cs:245
bool isKilling
Definition: Game.cs:237
void OnKillGame()
Definition: Scene.cs:341
Definition: Window.cs:13
static Dictionary< string, int > dictTab
Definition: Window.cs:596
void OnKillGame()
Definition: Zone.cs:1666

References EClass.core, Debug, Window.dictTab, Core.IsGameStarted, Scene.OnKillGame(), Zone.OnKillGame(), EClass.scene, and EClass.ui.

Referenced by Scene.Init(), Load(), and Core.SetLang().

◆ Load()

static void Game.Load ( string  id,
bool  cloud 
)
inlinestatic

Definition at line 313 of file Game.cs.

314 {
315 string text = (cloud ? CorePath.RootSaveCloud : CorePath.RootSave) + id;
316 Debug.Log("Loading: " + id + ": " + text);
317 if (EClass.game != null)
318 {
319 EClass.game.Kill();
320 }
322 EClass.core.game = GameIO.LoadGame(id, text, cloud);
323 EClass.game.isCloud = cloud;
324 EClass.game.isLoading = true;
328 EClass.scene.Init(Scene.Mode.StartGame);
329 if (EClass.game.altInv)
330 {
331 SoundManager.ignoreSounds = true;
333 {
334 EClass.ui.OpenFloatInv();
335 }
336 SoundManager.ignoreSounds = true;
338 {
339 EClass.ui.ToggleAbility();
340 }
341 SoundManager.ignoreSounds = false;
342 TooltipManager.Instance.HideTooltips(immediate: true);
343 }
344 if ((bool)WidgetSideScreen.Instance)
345 {
347 }
348 EClass.game.isLoading = false;
349 }
static void ClearTemp()
Definition: GameIO.cs:61
static Game LoadGame(string id, string root, bool cloud)
Definition: GameIO.cs:150
void Kill()
Definition: Game.cs:1053
bool altInv
Definition: Game.cs:263
void OnLoad()
Definition: Game.cs:351
bool layerAbility
Definition: Player.cs:35
bool layerInventory
Definition: Player.cs:33
Pref pref
Definition: Player.cs:933
static TooltipManager Instance
void HideTooltips(bool immediate=false)
static WidgetSideScreen Instance
override void OnChangeResolution()

References altInv, GameIO.ClearTemp(), Debug, EClass.game, TooltipManager.HideTooltips(), Scene.Init(), TooltipManager.Instance, WidgetSideScreen.Instance, Kill(), Player.Pref.layerAbility, Player.Pref.layerInventory, GameIO.LoadGame(), OnBeforeInstantiate(), WidgetSideScreen.OnChangeResolution(), OnGameInstantiated(), OnLoad(), player, Player.pref, CorePath.RootSave, EClass.scene, and EClass.ui.

Referenced by AM_Adv._OnUpdateInput(), Map.Reload(), and CoreDebug.UpdateInput().

◆ OnBeforeInstantiate()

static void Game.OnBeforeInstantiate ( )
inlinestatic

Definition at line 706 of file Game.cs.

707 {
708 Player.seedHallucination = 0;
709 }

Referenced by Load().

◆ OnBeforeSave()

void Game.OnBeforeSave ( )
inline

Definition at line 1039 of file Game.cs.

1040 {
1041 foreach (Zone zone in spatials.Zones)
1042 {
1043 zone.OnBeforeSave();
1044 }
1046 foreach (Spatial item in spatials.listDestryoed)
1047 {
1048 item.DeleteMapRecursive();
1049 }
1050 spatials.listDestryoed.Clear();
1051 }
void OnBeforeSave()
Definition: Player.cs:1376
List< Zone > Zones
List< Spatial > listDestryoed
void OnBeforeSave()
Definition: Spatial.cs:654

References item, SpatialManager.listDestryoed, Player.OnBeforeSave(), Spatial.OnBeforeSave(), and SpatialManager.Zones.

◆ OnDeserializing()

void Game.OnDeserializing ( StreamingContext  context)
inlineprivate

Definition at line 1100 of file Game.cs.

1101 {
1102 Debug.Log("#io game OnDeserializing");
1103 Instance = this;
1104 }

References Debug.

◆ OnGameInstantiated()

void Game.OnGameInstantiated ( )
inline

Definition at line 711 of file Game.cs.

712 {
713 HotItemHeld.taskBuild = null;
714 InvOwner.Trader = (InvOwner.Main = null);
715 LayerDrama.currentQuest = null;
716 BookList.Init();
717 ContentGallery.lastPage = 0;
718 ContentGallery.listMode = false;
719 if (!Application.isEditor || !EClass.debug.enable)
720 {
722 }
723 foreach (Chara value in cards.globalCharas.Values)
724 {
725 if (value.uid == player.uidChara)
726 {
727 player.chara = value;
728 break;
729 }
730 }
732 EClass.ui.widgets.OnGameInstantiated();
733 EClass.Sound.ResetPlaylist();
734 EClass.core.config.ApplyFPS(force: true);
735 }
static void OnGameInstantiated()
Definition: ActionMode.cs:247
static void Init()
Definition: BookList.cs:22
GlobalCharaList globalCharas
Definition: CardManager.cs:46
int uid
Definition: Card.cs:120
void ApplyFPS(bool force=false)
Definition: CoreConfig.cs:834
bool enable
Definition: CoreDebug.cs:285
CoreConfig config
Definition: Core.cs:70
static CoreDebug debug
Definition: EClass.cs:48
static SoundManager Sound
Definition: EClass.cs:46
int uidChara
Definition: Player.cs:792
static void BuildList()

References CoreConfig.ApplyFPS(), RecipeManager.BuildList(), Core.config, EClass.core, EClass.debug, CoreDebug.enable, CardManager.globalCharas, BookList.Init(), ActionMode.OnGameInstantiated(), EClass.Sound, EClass.ui, Card.uid, and Player.uidChara.

Referenced by Create(), and Load().

◆ OnLoad()

void Game.OnLoad ( )
inline

Definition at line 351 of file Game.cs.

352 {
353 domains.OnLoad();
356 world._OnLoad();
357 player.OnLoad();
359 {
360 EClass.pc.party.members.ForEach(delegate(Chara c)
361 {
362 c.currentZone = EClass.pc.homeZone;
363 c.global.transition = new ZoneTransition
364 {
365 state = ZoneTransition.EnterState.Return
366 };
367 });
368 }
369 player.zone = EClass.pc.currentZone;
370 EClass.pc.currentZone.lastActive = world.date.GetRaw();
371 if (spatials.Find("somewhere") == null)
372 {
373 SpatialGen.Create("somewhere", world.region, register: true);
374 }
375 EClass.pc.homeZone.isKnown = true;
378 foreach (Thing item in EClass.pc.things.List((Thing t) => t.Num <= 0 || t.isDestroyed))
379 {
380 item.parent.RemoveCard(item);
381 }
382 foreach (Thing item2 in EClass.pc.things.List((Thing t) => t.trait is TraitChestMerchant))
383 {
384 item2.Destroy();
385 }
386 foreach (Thing item3 in EClass.pc.things.List((Thing t) => t.invY == 1 && t.invX == -1))
387 {
388 item3.invY = 0;
389 }
390 foreach (Chara value in EClass.game.cards.globalCharas.Values)
391 {
392 if (value.id == "demitas" && value.faction.id == "wilds")
393 {
395 }
396 if (value.memberType == FactionMemberType.Livestock && !value.IsPCFaction)
397 {
398 value.memberType = FactionMemberType.Default;
399 }
400 if (!value.isDyed && value.HasTag(CTAG.random_color))
401 {
402 value.DyeRandom();
403 }
404 }
405 foreach (FactionBranch child in EClass.pc.faction.GetChildren())
406 {
407 foreach (Chara member in child.members)
408 {
409 if (!member.isDead && (member.currentZone == null || member.currentZone.id == "somewhere"))
410 {
411 Debug.Log("exception: Moving invalid chara: " + member.Name + "/" + member.currentZone?.ToString() + "/" + member.homeBranch?.ToString() + "/" + member.faction);
412 member.MoveZone(child.owner, ZoneTransition.EnterState.RandomVisit);
413 }
414 member.RefreshWorkElements(child.owner.elements);
415 member.Refresh();
416 }
417 }
418 EClass.pc.angle = player.angle;
420 if (cards.listAdv.Count == 0)
421 {
423 }
424 quests.list.ForeachReverse(delegate(Quest q)
425 {
426 if (!(q is QuestRandom))
427 {
428 foreach (Quest item4 in quests.list)
429 {
430 if (q != item4 && item4.id == q.id)
431 {
432 quests.list.Remove(item4);
433 break;
434 }
435 }
436 }
437 });
438 quests.globalList.ForeachReverse(delegate(Quest q)
439 {
440 if (!(q is QuestRandom))
441 {
442 foreach (Quest global in quests.globalList)
443 {
444 if (q != global && global.id == q.id)
445 {
446 quests.globalList.Remove(global);
447 break;
448 }
449 }
450 }
451 });
452 TryAddQuest("into_darkness", "exile_kettle");
453 if (version.IsBelow(0, 23, 182))
454 {
455 foreach (Chara value2 in cards.globalCharas.Values)
456 {
457 if (!value2.IsUnique && value2.c_lockedAge != 0)
458 {
459 value2.elements.SetBase(1243, 1);
460 }
461 }
462 }
463 if (version.IsBelow(0, 23, 155))
464 {
465 AddAdventurer("adv_yukiimo");
466 }
467 if (version.IsBelow(0, 23, 100))
468 {
469 int num = player.recipes.knownRecipes.TryGetValue("trainingDummy_heavy", 0);
470 if (num != 0)
471 {
472 player.recipes.knownRecipes["trainingDummy_heavy1"] = num;
473 }
474 }
475 if (version.IsBelow(0, 23, 96))
476 {
477 EClass.game.principal = IO.DeepCopy(EClass.setting.start.principals[0]);
478 player.resetPrincipal = true;
479 }
481 {
483 EClass.game.principal.id = -1;
484 EClass.game.principal.permadeath = gameDifficultySetting.deleteGameOnDeath;
485 EClass.game.principal.disableManualSave = !gameDifficultySetting.allowManualSave;
486 EClass.core.actionsNextFrame.Add(delegate
487 {
488 EClass.ui.AddLayer<LayerWorldSetting>();
489 });
490 }
491 if (version.IsBelow(0, 23, 93))
492 {
494 Debug.Log("â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– â– feafefaeffaeaffeaaeaefseasfaefaef");
495 while (TryAddRecipe())
496 {
497 }
498 }
499 if (version.IsBelow(0, 23, 72))
500 {
501 foreach (Chara value3 in EClass.game.cards.globalCharas.Values)
502 {
503 if (!value3.isDead)
504 {
505 value3.c_wasInPcParty = false;
506 }
507 }
508 }
509 if (version.IsBelow(0, 23, 59))
510 {
511 while (TryDestroy())
512 {
513 }
514 }
515 if (version.IsBelow(0, 23, 52))
516 {
517 player.flags.toggleHotbarHighlightActivated = true;
518 }
519 if (version.IsBelow(0, 23, 51))
520 {
521 foreach (Chara value4 in EClass.game.cards.globalCharas.Values)
522 {
523 if (!(value4.id != "adv") && value4.IsPCFaction)
524 {
525 value4.idSkin = value4.uid % (value4.source._tiles.Length - 4) / 2 * 2 + ((!value4.IsMale) ? 1 : 0);
526 }
527 }
528 }
529 if (version.IsBelow(0, 22, 91))
530 {
531 TryAddQuestIfActive("demitas_spellwriter", "into_darkness");
532 }
533 if (version.IsBelow(0, 22, 86))
534 {
535 Chara chara = cards.globalCharas.Find("demitas");
536 if (chara != null && chara._works != null && chara._works.Count > 0)
537 {
538 chara._works[0] = 51;
539 }
540 }
541 if (version.IsBelow(0, 22, 86))
542 {
543 TryAddQuest("farris_tulip", "greatDebt");
544 }
545 if (version.IsBelow(0, 22, 86))
546 {
547 TryAddQuest("exile_whisper", "exile_kettle");
548 }
549 if (version.IsBelow(0, 22, 85))
550 {
551 TryAddQuest("exile_meet", "pre_debt");
552 }
553 if (version.IsBelow(0, 22, 60) && EClass.game.quests.Get<QuestDebt>() != null)
554 {
555 Chara chara2 = cards.globalCharas.Find("loytel");
556 Debug.Log("Loytelfix: " + chara2.homeZone);
557 if (chara2.homeZone == null || !chara2.homeZone.IsPCFaction)
558 {
560 chara2.homeZone = EClass.pc.homeBranch.owner;
561 chara2.RemoveEditorTag(EditorTag.Invulnerable);
562 }
563 }
564 if (version.IsBelow(0, 22, 52) && quests.completedIDs.Contains("vernis_gold"))
565 {
566 quests.Add("pre_debt", "farris");
567 }
568 if (quests.completedIDs.Contains("farris_tulip"))
569 {
570 quests.globalList.ForeachReverse(delegate(Quest q)
571 {
572 if (q.id == "farris_tulip")
573 {
574 quests.globalList.Remove(q);
575 }
576 });
577 }
578 quests.list.ForeachReverse(delegate(Quest q)
579 {
580 if (q is QuestDialog && quests.completedIDs.Contains(q.id))
581 {
582 quests.list.Remove(q);
583 }
584 });
585 if (version.IsBelow(0, 22, 20))
586 {
587 foreach (Chara value5 in cards.globalCharas.Values)
588 {
589 value5.SetBool(18, enable: false);
590 }
591 }
592 if (version.IsBelow(0, 22, 22))
593 {
594 if (EClass.pc.faithElements != null)
595 {
597 }
598 foreach (Element item5 in EClass.pc.elements.ListElements((Element e) => e.source.categorySub == "god"))
599 {
600 EClass.pc.SetFeat(item5.id, 0);
601 }
603 }
604 if (version.IsBelow(0, 22, 45))
605 {
606 player.debt = 20000000;
607 }
609 {
611 }
612 if (cards.container_deposit == null)
613 {
614 cards.container_deposit = ThingGen.Create("container_deposit");
615 if (player.bankMoney > 0)
616 {
618 }
619 }
620 foreach (Quest item6 in quests.list)
621 {
622 if (item6 is QuestSequence && !EClass.sources.quests.map.ContainsKey(item6.idSource))
623 {
624 item6.phase = 0;
625 }
626 }
627 foreach (Quest global2 in quests.globalList)
628 {
629 if (global2 is QuestSequence && !EClass.sources.quests.map.ContainsKey(global2.idSource))
630 {
631 global2.phase = 0;
632 }
633 }
634 void TryAddQuest(string idQuest, string idReqQuest)
635 {
636 if (quests.completedIDs.Contains(idReqQuest) && !quests.completedIDs.Contains(idQuest) && quests.GetGlobal(idQuest) == null && quests.Get(idQuest) == null)
637 {
638 quests.Add(idQuest);
639 }
640 }
641 void TryAddQuestIfActive(string idQuest, string idReqQuest)
642 {
643 if (quests.Get(idReqQuest) != null && !quests.completedIDs.Contains(idQuest) && quests.GetGlobal(idQuest) == null && quests.Get(idQuest) == null)
644 {
645 quests.Add(idQuest);
646 }
647 }
648 bool TryAddRecipe()
649 {
650 foreach (string key in player.recipes.knownRecipes.Keys)
651 {
652 if (key.Length > 1 && key[0] == 'b')
653 {
654 RecipeSource recipeSource = RecipeManager.Get(key + "-p");
655 if (recipeSource != null && !player.recipes.knownRecipes.ContainsKey(recipeSource.id))
656 {
657 Debug.Log(recipeSource.id);
658 player.recipes.Add(recipeSource.id, showEffect: false);
659 return true;
660 }
661 recipeSource = RecipeManager.Get(key.Replace("-p", ""));
662 if (recipeSource != null && !player.recipes.knownRecipes.ContainsKey(recipeSource.id))
663 {
664 Debug.Log(recipeSource.id);
665 player.recipes.Add(recipeSource.id, showEffect: false);
666 return true;
667 }
668 }
669 }
670 return false;
671 }
672 static bool TryDestroy()
673 {
674 for (int i = 0; i < EClass.pc.party.members.Count; i++)
675 {
676 Chara chara3 = EClass.pc.party.members[i];
677 Debug.Log(chara3.id + "/" + chara3.uid + "/" + chara3._cints[1]);
678 for (int j = 0; j < EClass.pc.party.members.Count; j++)
679 {
680 Chara chara4 = EClass.pc.party.members[j];
681 if (i != j && chara3.uid == chara4.uid)
682 {
683 EClass.pc.party.uidMembers.RemoveAt(j);
684 EClass.pc.party.members.RemoveAt(j);
685 chara4.Destroy();
686 Debug.Log("Destroyed");
687 return true;
688 }
689 }
690 }
691 return false;
692 }
693 }
CTAG
Definition: CTAG.cs:2
EditorTag
Definition: EditorTag.cs:2
FactionMemberType
void SetBool(int id, bool enable)
Definition: BaseCard.cs:20
List< Action > actionsNextFrame
Definition: BaseCore.cs:31
Version version
Definition: BaseCore.cs:17
Chara Find(string id)
Definition: CardManager.cs:20
Thing container_deposit
Definition: CardManager.cs:58
int c_lockedAge
Definition: Card.cs:1327
bool isDestroyed
Definition: Card.cs:73
void RemoveEditorTag(EditorTag tag)
Definition: Card.cs:2572
ElementContainerCard elements
Definition: Card.cs:39
string id
Definition: Card.cs:33
bool IsUnique
Definition: Card.cs:2053
int invY
Definition: Card.cs:1917
bool IsMale
Definition: Card.cs:2346
string Name
Definition: Card.cs:2099
bool HasTag(CTAG tag)
Definition: Card.cs:2557
void DyeRandom()
Definition: Card.cs:5703
Trait trait
Definition: Card.cs:51
bool isDyed
Definition: Card.cs:444
void Destroy()
Definition: Card.cs:4850
ThingContainer things
Definition: Card.cs:36
int invX
Definition: Card.cs:1905
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3034
int Num
Definition: Card.cs:156
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1688
int[] _cints
Definition: Chara.cs:82
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:8529
Faction faction
Definition: Chara.cs:425
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9327
Party party
Definition: Chara.cs:43
override bool IsPCFaction
Definition: Chara.cs:669
FactionMemberType memberType
Definition: Chara.cs:46
Zone homeZone
Definition: Chara.cs:265
void RefreshFaithElement()
Definition: Chara.cs:9621
ElementContainer faithElements
Definition: Chara.cs:38
FactionBranch homeBranch
Definition: Chara.cs:1052
bool isDead
Definition: Chara.cs:387
List< int > _works
Definition: Chara.cs:52
void MoveZone(string alias)
Definition: Chara.cs:3245
void OnLoad()
Definition: CoreDebug.cs:690
int GetRaw(int offsetHours=0)
Definition: Date.cs:322
static SourceManager sources
Definition: EClass.cs:42
List< Element > ListElements(Func< Element, bool > shoudList=null, Comparison< Element > comparison=null)
void SetParent(Card c)
Element SetBase(string alias, int v, int potential=0)
int id
Definition: ELEMENT.cs:248
SourceElement.Row source
Definition: ELEMENT.cs:271
List< Chara > members
void AddMemeber(Chara c)
List< FactionBranch > GetChildren()
Definition: FACTION.cs:202
string id
Definition: FACTION.cs:129
List< GameDifficultySetting > difficulties
Definition: GameSetting.cs:242
void AddAdventurers()
Definition: Game.cs:906
void AddAdventurer(string id, Zone z=null)
Definition: Game.cs:933
QuestManager quests
Definition: Game.cs:179
Version version
Definition: Game.cs:167
List< int > uidMembers
Definition: Party.cs:11
List< Chara > members
Definition: Party.cs:18
RecipeManager recipes
Definition: Player.cs:1017
float angle
Definition: Player.cs:891
bool resetPrincipal
Definition: Player.cs:1097
void OnLoad()
Definition: Player.cs:1352
int bankMoney
Definition: Player.cs:837
HashSet< string > completedIDs
Definition: QuestManager.cs:17
List< Quest > list
Definition: QuestManager.cs:11
Quest Add(string id, string idGlobalChara=null)
Definition: QuestManager.cs:29
List< Quest > globalList
Definition: QuestManager.cs:14
Quest Get(string id)
Quest GetGlobal(string id)
Definition: Quest.cs:7
virtual string idSource
Definition: Quest.cs:149
string id
Definition: Quest.cs:31
static RecipeSource Get(string id)
Dictionary< string, int > knownRecipes
void Add(string id, bool showEffect=true)
void OnVersionUpdate()
SourceQuest quests
static Spatial Create(string id, Spatial parent, bool register, int x=-99999, int y=-99999, int icon=0)
Definition: SpatialGen.cs:16
Zone Find(string id)
void _OnLoad()
Definition: Spatial.cs:663
bool destryoed
Definition: Spatial.cs:45
string id
Definition: Spatial.cs:13
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
void RefreshGridRecursive()
Definition: Thing.cs:8
GameDate date
Definition: World.cs:6
override string ToString()
Definition: Zone.cs:540
ElementContainerZone elements
Definition: Zone.cs:43
bool IsPCFaction
Definition: Zone.cs:466
override bool Equals(object obj)
Definition: Version.cs:95
bool IsBelow(int _major, int _minor, int _batch)
Definition: Version.cs:31

References Spatial._OnLoad(), AddAdventurers(), FactionBranch.AddMemeber(), Player.angle, cards, ElementContainerCard.CheckSkillActions(), SpatialGen.Create(), Chara.currentZone, World.date, EClass.debug, Debug, Card.Destroy(), Spatial.destryoed, domains, Card.DyeRandom(), Card.elements, Zone.elements, Chara.faction, factions, SpatialManager.Find(), EClass.game, Faction.GetChildren(), Date.GetRaw(), CardManager.globalCharas, Card.HasTag(), Chara.homeBranch, Chara.homeZone, Card.id, Faction.id, Spatial.id, Card.invX, Card.invY, Chara.isDead, Card.isDestroyed, Card.isDyed, Chara.IsPCFaction, item, QuestManager.list, ThingContainer.List(), CardManager.listAdv, FactionBranch.members, Party.members, Chara.memberType, Chara.MoveZone(), Card.Name, Card.Num, CoreDebug.OnLoad(), DomainManager.OnLoad(), FactionManager.OnLoad(), Player.OnLoad(), ReligionManager.OnLoad(), FactionBranch.owner, Chara.party, EClass.pc, player, quests, Chara.Refresh(), ThingContainer.RefreshGridRecursive(), Chara.RefreshWorkElements(), World.region, religions, spatials, Card.things, Zone.ToString(), Card.trait, and world.

Referenced by Load().

◆ OnSerializing()

void Game.OnSerializing ( StreamingContext  context)
inlineprivate

Definition at line 1094 of file Game.cs.

1095 {
1096 Debug.Log("#io game OnSerializing");
1097 }

References Debug.

◆ OnUpdate()

void Game.OnUpdate ( )
inline

Definition at line 289 of file Game.cs.

290 {
291 backupTime += Time.deltaTime;
292 waitTimer -= Time.deltaTime;
293 timeSinceStart += Time.deltaTime;
294 player.stats.timeElapsed += Time.deltaTime;
296 {
297 flags.IsWelcomeMessageShown = true;
298 }
300 }
void FixedUpdate()
Definition: GameUpdater.cs:436
bool IsWelcomeMessageShown
Definition: Game.cs:119
GameUpdater updater
Definition: Game.cs:243
static float waitTimer
Definition: Game.cs:145
Flags flags
Definition: Game.cs:212
double backupTime
Definition: Game.cs:209
float timeSinceStart
Definition: Game.cs:233
double timeElapsed
Definition: Player.cs:66
Stats stats
Definition: Player.cs:936

References backupTime, GameUpdater.FixedUpdate(), flags, Game.Flags.IsWelcomeMessageShown, player, Player.stats, Player.Stats.timeElapsed, timeSinceStart, updater, and waitTimer.

Referenced by Core.Update().

◆ Pause()

void Game.Pause ( Action  onUnpause = null)
inline

Definition at line 1075 of file Game.cs.

1076 {
1077 isPaused = true;
1078 LayerPause layerPause = EClass.ui.AddLayer<LayerPause>();
1079 Game lastGame = EClass.game;
1080 if (onUnpause == null)
1081 {
1082 return;
1083 }
1084 layerPause.SetOnKill(delegate
1085 {
1086 if (EClass.core.IsGameStarted && lastGame == EClass.game)
1087 {
1088 onUnpause();
1089 }
1090 });
1091 }
static bool isPaused
Definition: Game.cs:149
Layer SetOnKill(Action action)
Definition: Layer.cs:579

References EClass.core, EClass.game, Core.IsGameStarted, Layer.SetOnKill(), and EClass.ui.

Referenced by ZoneEventQuest.OnTickRound(), and ZoneEventQuest.SpawnBoss().

◆ Quit()

void Game.Quit ( )
inline

Definition at line 972 of file Game.cs.

973 {
974 Dialog.YesNo("dialog_quit", delegate
975 {
976 if (EClass.game.Save())
977 {
978 EClass.core.Quit();
979 }
980 });
981 }

References EClass.game, Save(), and Dialog.YesNo().

Referenced by EUtil.ExitGame(), LayerPauseMenu.OnClickExit(), and HotItemContext.Show().

◆ Save()

bool Game.Save ( bool  isAutoSave = false,
bool  silent = false 
)
inline

Definition at line 983 of file Game.cs.

984 {
985 if (EClass.ui.IsDragging)
986 {
987 EClass.ui.EndDrag(canceled: true);
988 }
989 if (isAutoSave && EClass.debug.ignoreAutoSave)
990 {
991 return true;
992 }
993 bool flag = EClass.core.config.game.autoBackup && backupTime >= (double)(EClass.core.config.game.backupInterval * 60 * 30);
994 if (flag)
995 {
996 backupTime = 0.0;
997 }
999 countLoadedMaps = 0;
1000 player.pref.layerInventory = EClass.ui.layerFloat.GetLayer<LayerInventory>();
1002 {
1003 player.pref.layerAbility = EClass.ui.layerFloat.GetLayer<LayerAbility>();
1004 }
1005 player.pref.layerCraft = EClass.ui.layerFloat.GetLayer<LayerCraftFloat>();
1006 player.angle = EClass.pc.angle;
1008 EClass.ui.widgets.UpdateConfigs();
1009 GameIndex gameIndex = null;
1010 try
1011 {
1012 OnBeforeSave();
1013 gameIndex = GameIO.SaveGame();
1014 }
1015 catch (Exception ex)
1016 {
1017 EClass.ui.Say(ex.Message);
1018 SE.Beep();
1019 Msg.Say("error_save");
1020 return false;
1021 }
1022 if (flag)
1023 {
1024 GameIO.MakeBackup(gameIndex);
1025 EClass.ui.Say("backupDone");
1026 }
1027 if (!silent)
1028 {
1029 if (!isAutoSave)
1030 {
1031 SE.WriteJournal();
1032 }
1033 Msg.Say("saved");
1034 }
1035 saveCount++;
1036 return true;
1037 }
float angle
Definition: Card.cs:69
new GameConfig game
Definition: CoreConfig.cs:602
void TryUpdatePlayedHour()
Definition: CoreConfig.cs:808
bool ignoreAutoSave
Definition: CoreDebug.cs:125
static GameIndex SaveGame()
Definition: GameIO.cs:79
static void MakeBackup(GameIndex index, string suffix="")
Definition: GameIO.cs:112
int countLoadedMaps
Definition: Game.cs:229
int saveCount
Definition: Game.cs:231
void OnBeforeSave()
Definition: Game.cs:1039
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58

References Card.angle, CoreConfig.GameConfig.backupInterval, Core.config, EClass.core, EClass.debug, CoreConfig.game, CoreDebug.ignoreAutoSave, Player.Pref.layerInventory, GameIO.MakeBackup(), EClass.pc, Player.pref, GameIO.SaveGame(), Msg.Say(), CoreConfig.TryUpdatePlayedHour(), EClass.ui, and BaseCore.version.

Referenced by AM_Adv._OnUpdateInput(), LayerSleep.Advance(), LayerNewZone.Embark(), GotoTitle(), Scene.Init(), Chara.MoveZone(), LayerPauseMenu.OnClickSave(), TraitDeedRelocate.OnRead(), DramaManager.ParseLine(), Quit(), Map.Reload(), HotItemContext.Show(), and CoreDebug.UpdateInput().

◆ StartNewGame()

void Game.StartNewGame ( )
inline

Definition at line 768 of file Game.cs.

769 {
770 EClass.pc.homeZone = StartZone;
773 Prologue prologue = EClass.game.Prologue;
774 CharaGen.Create("fiama").SetGlobal(EClass.game.StartZone, prologue.posFiama.x, prologue.posFiama.y);
775 CharaGen.Create("ashland").SetGlobal(EClass.game.StartZone, prologue.posAsh.x, prologue.posAsh.y);
776 if ((bool)LayerTitle.actor)
777 {
778 world.date.hour = EClass.game.Prologue.hour;
780 Player obj = player;
781 Chara chara = EClass.pc;
782 Zone zone2 = (EClass.pc.homeZone = EClass.game.spatials.Find(EClass.game.Prologue.idStartZone));
783 Zone zone4 = (chara.currentZone = zone2);
784 obj.zone = zone4;
785 EClass.pc.global.transition = new ZoneTransition
786 {
787 state = ZoneTransition.EnterState.Exact,
789 z = EClass.game.Prologue.startZ
790 };
791 EClass.pc.hp = EClass.pc.MaxHP;
794 EClass.pc.AddCondition<ConFaint>(200, force: true);
795 }
796 else
797 {
798 EClass.pc.homeZone = EClass.game.spatials.Find(EClass.game.Prologue.idStartZone);
799 Zone zone5 = null;
800 ZoneTransition transition = new ZoneTransition
801 {
802 state = ZoneTransition.EnterState.Auto
803 };
804 Chara c = EClass.game.cards.globalCharas.Find("ashland");
805 switch (EClass.debug.startScene)
806 {
807 case CoreDebug.StartScene.Zone:
809 transition = new ZoneTransition
810 {
811 state = ZoneTransition.EnterState.Exact,
813 z = EClass.game.Prologue.startZ
814 };
815 break;
816 case CoreDebug.StartScene.Home:
817 case CoreDebug.StartScene.Story_Test:
819 transition = new ZoneTransition
820 {
821 state = ZoneTransition.EnterState.Exact,
823 z = EClass.game.Prologue.startZ
824 };
825 break;
826 case CoreDebug.StartScene.Home_Cave:
827 EClass.game.idPrologue = 2;
829 transition = new ZoneTransition
830 {
831 state = ZoneTransition.EnterState.Exact,
833 z = EClass.game.Prologue.startZ
834 };
835 break;
836 case CoreDebug.StartScene.MeetFarris:
837 {
838 Zone parent4 = EClass.game.spatials.Find("nymelle");
839 zone5 = SpatialGen.Create("nymelle", parent4, register: true) as Zone;
840 zone5.lv = -2;
841 EClass.game.quests.Start("exploration", c, assignQuest: false);
842 break;
843 }
844 case CoreDebug.StartScene.NymelleBoss:
845 {
846 Zone parent3 = EClass.game.spatials.Find("nymelle");
847 zone5 = SpatialGen.Create("nymelle_boss", parent3, register: true) as Zone;
848 zone5.lv = -5;
849 EClass.game.quests.Start("exploration", c, assignQuest: false).ChangePhase(2);
850 break;
851 }
852 case CoreDebug.StartScene.AfterNymelle:
854 transition = new ZoneTransition
855 {
856 state = ZoneTransition.EnterState.Exact,
858 z = EClass.game.Prologue.startZ
859 };
860 EClass.game.quests.Start("exploration", c, assignQuest: false).ChangePhase(5);
861 EClass.game.quests.globalList.Add(Quest.Create("sharedContainer").SetClient(c, assignQuest: false));
862 EClass.game.quests.globalList.Add(Quest.Create("crafter").SetClient(c, assignQuest: false));
863 EClass.game.quests.globalList.Add(Quest.Create("defense").SetClient(c, assignQuest: false));
864 break;
865 case CoreDebug.StartScene.Melilith:
866 {
867 Zone parent2 = EClass.game.spatials.Find("cursed_manor");
868 zone5 = SpatialGen.Create("cursed_manor_dungeon", parent2, register: true) as Zone;
869 zone5.lv = -5;
870 break;
871 }
872 case CoreDebug.StartScene.Tefra:
873 {
874 Zone parent = EClass.game.spatials.Find("vernis");
875 zone5 = SpatialGen.Create("vernis_mine", parent, register: true) as Zone;
876 zone5.lv = -7;
877 break;
878 }
879 }
880 if (zone5 != null)
881 {
882 Player obj2 = player;
883 Chara chara2 = EClass.pc;
884 Zone zone2 = (EClass.pc.homeZone = zone5);
885 Zone zone4 = (chara2.currentZone = zone2);
886 obj2.zone = zone4;
887 EClass.pc.global.transition = transition;
888 }
889 else
890 {
891 Player obj3 = player;
892 Zone zone4 = (EClass.pc.currentZone = EClass.game.spatials.Find(EClass.debug.startZone));
893 obj3.zone = zone4;
894 EClass.pc.global.transition = new ZoneTransition
895 {
896 state = ZoneTransition.EnterState.Return
897 };
898 }
899 }
900 EClass.pc.homeZone.isKnown = true;
903 EClass.scene.Init(Scene.Mode.StartGame);
904 }
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:8769
Chara SetGlobal(Zone _home, int x, int z)
Definition: Chara.cs:1444
override int MaxHP
Definition: Chara.cs:706
Stats mana
Definition: Chara.cs:1136
Stats stamina
Definition: Chara.cs:1128
string startZone
Definition: CoreDebug.cs:105
StartScene startScene
Definition: CoreDebug.cs:95
PartyManager parties
Definition: Game.cs:170
Prologue Prologue
Definition: Game.cs:257
Zone StartZone
Definition: Game.cs:269
static void KillActor()
Definition: LayerTitle.cs:191
static EmbarkActor actor
Definition: LayerTitle.cs:25
Party Create(Chara leader)
Definition: PartyManager.cs:9
Definition: Player.cs:11
void OnStartNewGame()
Definition: Player.cs:1301
Vector2Int posAsh
Definition: Prologue.cs:21
string idStartZone
Definition: Prologue.cs:7
Vector2Int posFiama
Definition: Prologue.cs:23
int hour
Definition: Prologue.cs:19
int startX
Definition: Prologue.cs:9
Quest Start(string id, string idGlobalChara)
Definition: QuestManager.cs:41
void ChangePhase(int a)
Definition: Quest.cs:572
Quest SetClient(Chara c, bool assignQuest=true)
Definition: Quest.cs:380
static Quest Create(string _id, string _idPerson=null, Chara c=null)
Definition: Quest.cs:241
Stats Set(int[] _raw, int _rawIndex, Chara _CC)
Definition: Stats.cs:109
virtual int max
Definition: Stats.cs:68

References BaseCore.actionsNextFrame, LayerTitle.actor, Chara.AddCondition(), cards, Quest.ChangePhase(), EClass.core, PartyManager.Create(), Quest.Create(), CharaGen.Create(), SpatialGen.Create(), EClass.debug, CardManager.GlobalCharaList.Find(), SpatialManager.Find(), EClass.game, CardManager.globalCharas, QuestManager.globalList, Prologue.hour, Prologue.idStartZone, Scene.Init(), LayerTitle.KillActor(), Chara.mana, Stats.max, Chara.MaxHP, Player.OnStartNewGame(), EClass.pc, Prologue.posAsh, Prologue.posFiama, Prologue, quests, EClass.scene, Stats.Set(), Quest.SetClient(), Chara.SetGlobal(), spatials, Chara.stamina, QuestManager.Start(), CoreDebug.startScene, Prologue.startX, CoreDebug.startZone, and StartZone.

Referenced by CoreDebug.QuickStart(), and DramaOutcome.StartNewGame().

◆ TryLoad()

static bool Game.TryLoad ( string  id,
bool  cloud,
Action  onLoad 
)
inlinestatic

Definition at line 302 of file Game.cs.

303 {
305 {
306 onLoad();
307 return true;
308 }
309 EClass.ui.Say("incompatible");
310 return false;
311 }
static bool CanLoad(string root)
Definition: GameIO.cs:144

References GameIO.CanLoad(), CorePath.RootSave, CorePath.RootSaveCloud, and EClass.ui.

Referenced by AM_Adv._OnUpdateInput().

◆ Wait() [1/3]

static void Game.Wait ( float  a)
inlinestatic

Definition at line 284 of file Game.cs.

285 {
286 waitTimer = a * (float)(EClass.core.config.game.waiter * 25) / 100f;
287 }

References Core.config, EClass.core, CoreConfig.game, CoreConfig.GameConfig.waiter, and waitTimer.

◆ Wait() [2/3]

static new void Game.Wait ( float  a,
Card  c 
)
inlinestatic

Definition at line 276 of file Game.cs.

277 {
278 if (c != null && c.isSynced && !c.IsPC)
279 {
280 Wait(a);
281 }
282 }
virtual bool IsPC
Definition: Card.cs:2105
virtual bool isSynced
Definition: Card.cs:2049
Definition: Wait.cs:2

References Card.IsPC, and Card.isSynced.

◆ Wait() [3/3]

static new void Game.Wait ( float  a,
Point  p 
)
inlinestatic

Definition at line 271 of file Game.cs.

272 {
273 _ = p?.IsSync;
274 }
bool IsSync
Definition: Point.cs:332

References Point.IsSync.

Referenced by EClass.Wait().

Member Data Documentation

◆ activeZone

◆ backupTime

double Game.backupTime

Definition at line 209 of file Game.cs.

Referenced by OnUpdate().

◆ bp

GameBlueprint Game.bp

Definition at line 241 of file Game.cs.

◆ cards

CardManager Game.cards = new CardManager()

Definition at line 155 of file Game.cs.

Referenced by QuestManager.Add(), Zone.AddGlobalCharasOnActivate(), QuestManager.AddQuestAsh(), QuestManager.AddQuestFiama(), Zone.AddRandomVisitor(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), LayerShippingResult.Awake(), TraitSalesTag.CanTagSale(), ElementContainerFaction.CheckDirty(), Faction.CountMembers(), Card.Create(), LayerInventory.CreateContainer(), Card.Destroy(), Chara.Die(), CoreDebug.Fix_RemoveDemitas(), RefChara.Get(), RefChara.GetAndCache(), Faction.HasMember(), TaskDump.IsValidContainer(), Faction.IsWearingPanty(), TaskDump.ListThingsToPut(), Faction.OnAdvanceMonth(), Zone_WindRest.OnAfterSimulate(), Zone_Nymelle.OnBeforeSimulate(), QuestDefense.OnChangePhase(), QuestVernis.OnChangePhase(), DramaOutcome.OnClaimLand(), QuestIntroInspector.OnComplete(), QuestSharedContainer.OnComplete(), TraitDrinkMilkMother.OnDrink(), QuestDialog.OnDropReward(), Zone_DungeonPuppy.OnGenerateMap(), ElementContainerFaction.OnJoinFaith(), ElementContainerFaction.OnLeaveFaith(), ZoneInstanceBout.OnLeaveZone(), ListPeopleRevive.OnList(), OnLoad(), TraitStoryBookHome.OnRead(), QuestDebt.OnStart(), QuestExploration.OnStart(), InvOwnerDeliver.PayBill(), DramaOutcome.QuestExploration_AfterComplete(), DramaOutcome.QuestExploration_AfterCrystal(), FactionBranch.ReceivePackages(), WindowChara.RefreshProfile(), LayerQuestBoard.RefreshRanking(), Chara.RemoveGlobal(), CoreDebug.ResetPetUpgrades(), SerializedCards.Restore(), Zone.Revive(), AI_Idle.Run(), TaskDump.Run(), World.SendPackage(), Meeting.SetChara(), Chara.SetGlobal(), FactionBranch.SetOwner(), UIFactionInfo.SetZone(), UIZoneInfo.SetZone(), GameDate.ShipGoods(), GameDate.ShipPackages(), QuestManager.Start(), StartNewGame(), Zone.TryAddThingInSharedContainer(), Faction.TryPayBill(), GrowSystem.TryPick(), TraitBed.ValidateOwners(), and EloPos.WriteNote().

◆ config

◆ countLoadedMaps

int Game.countLoadedMaps

Definition at line 229 of file Game.cs.

Referenced by Zone.Activate(), and Scene.Init().

◆ dateScratch

int Game.dateScratch

Definition at line 206 of file Game.cs.

◆ domains

DomainManager Game.domains = new DomainManager()

Definition at line 164 of file Game.cs.

Referenced by OnLoad().

◆ factions

◆ flags

Flags Game.flags = new Flags()

Definition at line 212 of file Game.cs.

Referenced by OnUpdate().

◆ gameSpeedIndex

int Game.gameSpeedIndex = 1

◆ id

◆ idDifficulty

int Game.idDifficulty

Definition at line 203 of file Game.cs.

◆ idPrologue

int Game.idPrologue

Definition at line 200 of file Game.cs.

Referenced by DramaOutcome.fiama_gold(), UICharaMaker.ListModes(), and UICharaMaker.SetChara().

◆ Instance

Game Game.Instance
static

Definition at line 143 of file Game.cs.

◆ isCloud

◆ isKilling

bool Game.isKilling

Definition at line 237 of file Game.cs.

Referenced by LayerInventory.OnKill().

◆ isLoading

◆ isPaused

bool Game.isPaused
static

Definition at line 149 of file Game.cs.

Referenced by GameUpdater.CharaUpdater.FixedUpdate().

◆ lastActiveZone

Zone Game.lastActiveZone

Definition at line 247 of file Game.cs.

Referenced by LayerPeople.CreateSelectEmbarkMembers().

◆ lastGameSpeedIndex

int Game.lastGameSpeedIndex = 1

Definition at line 225 of file Game.cs.

Referenced by ActionMode.UnPause().

◆ loadedTextures

HashSet<Texture2D> Game.loadedTextures = new HashSet<Texture2D>()

Definition at line 251 of file Game.cs.

Referenced by Card.GetPaintSprite().

◆ log

MsgLog Game.log
Initial value:
= new MsgLog
{
id = "log"
}
Definition: MsgLog.cs:7

Definition at line 185 of file Game.cs.

Referenced by ContentChronicle.OnSwitchContent(), and Msg.SayRaw().

◆ lostThings

List<Thing> Game.lostThings = new List<Thing>()

Definition at line 218 of file Game.cs.

◆ parties

PartyManager Game.parties = new PartyManager()

Definition at line 170 of file Game.cs.

◆ player

new Player Game.player = new Player()

Definition at line 176 of file Game.cs.

Referenced by Core.Awake(), GameIndex.Create(), Load(), OnLoad(), OnUpdate(), and ItemCulture.Refresh().

◆ principal

◆ quests

QuestManager Game.quests = new QuestManager()

Definition at line 179 of file Game.cs.

Referenced by InvOwnerDeliver._OnProcess(), ActPlan._Update(), QuestManager.Add(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), DramaCustomSequence.Build(), QuestVernis.CanUpdateOnTalk(), Quest.Complete(), QuestCraft.Deliver(), QuestDeliver.Deliver(), AI_PlayMusic.Evaluate(), ZonePreEnterOnCompleteQuestInstance.Execute(), Player.ExitBorder(), Quest.Fail(), Recipe.GetQuestTrack(), Chara.GiveGift(), TraitDoorman_Fighter.GiveTrial(), TraitDoorman_Mage.GiveTrial(), TraitDoorman_Thief.GiveTrial(), DramaOutcome.guild_trial(), Quest.Init(), Scene.Init(), Chara.IsEscorted(), RecipeManager.ListSources(), DramaOutcome.melilith_friend(), Player.ModKarma(), Zone_Exile.OnActivate(), Trait.OnBarter(), QuestDefense.OnChangePhase(), DramaOutcome.OnClaimLand(), ItemQuestTracker.OnClickClose(), QuestIntroInspector.OnComplete(), QuestLoytelFarm.OnComplete(), QuestSharedContainer.OnComplete(), QuestShippingChest.OnComplete(), QuestVernis.OnComplete(), Quest.OnCompleteTask(), TCExtra.OnDraw(), QuestDialog.OnDropReward(), Zone_DungeonPuppy.OnGenerateMap(), OnLoad(), TraitStoryBookHome.OnRead(), QuestExploration.OnStart(), QuestIntoDarkness.OnStart(), Player.OnStartNewGame(), ContentQuest.OnSwitchContent(), DramaManager.ParseLine(), InvOwnerDeliver.PayBill(), DramaOutcome.poppy_found(), DramaOutcome.QuestDebt_reward(), DramaOutcome.QuestExploration_AfterComplete(), DramaOutcome.QuestExploration_AfterCrystal(), DramaOutcome.QuestExploration_MeetFarris(), DramaOutcome.QuestExploration_MeetFarris2(), CoreDebug.QuickStart(), ItemQuestTracker.Refresh(), LayerShippingResult.Refresh(), WidgetQuestTracker.Refresh(), TCOrbitChara.RefreshAll(), LayerQuestBoard.RefreshQuest(), CoreDebug.Reset_LoytelDebt(), RecipeUpdater.RunRecipe(), ItemQuest.SetQuest(), Chara.ShowDialog(), StartNewGame(), Chara.Tick(), Recipe.ToggleTrack(), Chara.TryDropBossLoot(), WidgetQuestTracker.TryShow(), TraitTeleporter.TryTeleport(), CoreDebug.UpdateInput(), and Zone.UpdateQuests().

◆ referenceMap

Dictionary<string, IGlobalValue> Game.referenceMap = new Dictionary<string, IGlobalValue>()

Definition at line 249 of file Game.cs.

◆ relations

RelationManager Game.relations = new RelationManager()

Definition at line 182 of file Game.cs.

Referenced by GameDate.AdvanceDay().

◆ religions

◆ saveCount

int Game.saveCount

Definition at line 231 of file Game.cs.

◆ seed

◆ sessionMin

int Game.sessionMin

Definition at line 227 of file Game.cs.

Referenced by QueueList< T >.GetTask(), and TaskList< T >.GetTask().

◆ spatials

◆ teleports

◆ timeSinceStart

float Game.timeSinceStart

Definition at line 233 of file Game.cs.

Referenced by OnUpdate().

◆ uniforms

PCCUniformManager Game.uniforms = new PCCUniformManager()

Definition at line 191 of file Game.cs.

Referenced by LayerEditPCC.Activate(), LayerEditPCC.Apply(), and Chara.ApplyJob().

◆ updater

◆ version

Version Game.version

Definition at line 167 of file Game.cs.

◆ waitTimer

float Game.waitTimer
static

Definition at line 145 of file Game.cs.

Referenced by OnUpdate(), and Wait().

◆ welcomeTimer

float Game.welcomeTimer
private

Definition at line 253 of file Game.cs.

◆ world

Property Documentation

◆ altAbility

bool Game.altAbility
get

Definition at line 267 of file Game.cs.

Referenced by LayerAbility.OnInit(), ButtonAbility.SetAct(), and UI.ToggleAbility().

◆ altCraft

bool Game.altCraft
get

Definition at line 265 of file Game.cs.

Referenced by Scene.Init().

◆ altInv

bool Game.altInv
get

◆ altUI

bool Game.altUI
get

Definition at line 261 of file Game.cs.

Referenced by ActionMode.Activate(), BuildMenu.Deactivate(), and BuildMenu.Init().

◆ IsWaiting

bool Game.IsWaiting
staticget

Definition at line 255 of file Game.cs.

Referenced by Scene.OnUpdate().

◆ Prologue

◆ StartZone

◆ UseGrid

bool Game.UseGrid
get

Definition at line 259 of file Game.cs.

Referenced by InvOwner.OnDrag(), and InvOwner.Transaction.Process().


The documentation for this class was generated from the following file: