Elin Decompiled Documentation EA 23.359.1 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 ApplyFix ()
 
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 (long _a, int start, int step, int rate=75)
 
static int sqrt (int a)
 
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
 
Version startVersion
 
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< Thing > lostThings = new List<Thing>()
 
GamePrincipal principal = new GamePrincipal()
 
SurvivalManager survival
 
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, IGlobalValue > referenceMap = 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]
 
bool IsSurvival [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 8 of file Game.cs.

Member Function Documentation

◆ _Create()

void Game._Create ( )
inline

Definition at line 824 of file Game.cs.

825 {
826 principal = IO.DeepCopy(EClass.setting.start.principals[0]);
827 idDifficulty = 1;
828 config.snapFreePos = (config.slope = (config.autoWall = true));
829 config.autoCombat.abortOnAllyDead = true;
830 config.autoCombat.abortOnHalfHP = true;
831 config.autoCombat.bUseHotBar = true;
832 config.autoCombat.bUseInventory = true;
833 config.autoCombat.bDontChangeTarget = true;
834 config.autoCombat.abortOnKill = true;
835 config.autoCombat.abortOnItemLoss = true;
836 seed = EClass.rnd(10000);
837 Debug.Log("creating game: " + id + " seed:" + seed);
839 uniforms.Import();
844 foreach (Spatial value in spatials.map.Values)
845 {
846 value.SetMainFaction(factions.Find(value.source.faction.IsEmpty("wilds")));
847 }
849 cards.container_shipping = ThingGen.Create("container_shipping");
850 cards.container_deliver = ThingGen.Create("container_delivery");
851 cards.container_deposit = ThingGen.Create("container_deposit");
852 bp = new GameBlueprint();
853 bp.Create();
854 }
Version version
Definition: BaseCore.cs:17
void OnCreateGame()
Definition: DomainManager.cs:7
Definition: EClass.cs:6
static Core core
Definition: EClass.cs:7
static int rnd(long a)
Definition: EClass.cs:59
static GameSetting setting
Definition: EClass.cs:35
Faction Find(string id)
List< GamePrincipal > principals
Definition: GameSetting.cs:249
StartSetting start
Definition: GameSetting.cs:352
GameBlueprint bp
Definition: Game.cs:248
new Player player
Definition: Game.cs:180
ReligionManager religions
Definition: Game.cs:159
GamePrincipal principal
Definition: Game.cs:225
DomainManager domains
Definition: Game.cs:165
SpatialManager spatials
Definition: Game.cs:153
PCCUniformManager uniforms
Definition: Game.cs:195
Version startVersion
Definition: Game.cs:171
new World world
Definition: Game.cs:177
int idDifficulty
Definition: Game.cs:207
int seed
Definition: Game.cs:201
FactionManager factions
Definition: Game.cs:162
Definition: IO.cs:10
void OnCreateGame()
Definition: Player.cs:1432
static Spatial CreateRecursive(string id, Spatial parent=null)
Definition: SpatialGen.cs:3
GlobalSpatialList map
SourceZone.Row source
Definition: Spatial.cs:453
virtual void SetMainFaction(Faction f)
Definition: Spatial.cs:646
static Thing Create(string id, int idMat=-1, int lv=-1)
Definition: ThingGen.cs:53
Definition: World.cs:4

References EClass.core, 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, BaseCore.version, and world.

Referenced by Create().

◆ AddAdventurer()

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

Definition at line 1040 of file Game.cs.

1041 {
1042 if (z == null)
1043 {
1044 List<Zone> source = world.region.ListTowns();
1045 do
1046 {
1047 z = source.RandomItem();
1048 }
1049 while ((z is Zone_SubTown && EClass.rnd(5) != 0) || z == EClass.pc.currentZone);
1050 }
1051 Chara chara = CharaGen.Create(id);
1052 chara.SetHomeZone(z);
1053 chara.global.transition = new ZoneTransition
1054 {
1055 state = ZoneTransition.EnterState.RandomVisit
1056 };
1057 z.AddCard(chara);
1058 cards.listAdv.Add(chara);
1059 }
List< Chara > listAdv
Definition: CardManager.cs:64
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Definition: Chara.cs:10
Chara SetHomeZone(Zone zone)
Definition: Chara.cs:1523
Zone currentZone
Definition: Chara.cs:261
static Chara pc
Definition: EClass.cs:15
CardManager cards
Definition: Game.cs:156
List< Zone > ListTowns()
Definition: Region.cs:273
Region region
Definition: World.cs:23
Card AddCard(Card t, Point point)
Definition: Zone.cs:2160

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

◆ AddAdventurers()

void Game.AddAdventurers ( )
inline

Definition at line 1013 of file Game.cs.

1014 {
1015 List<Zone> source = world.region.ListTowns();
1016 string[] array = new string[8] { "adv_kiria", "adv_gaki", "adv_wini", "adv_verna", "adv_ivory", "adv_mesherada", "adv_yukiimo", "adv_schwert" };
1017 for (int i = 0; i < EClass.setting.balance.numAdv; i++)
1018 {
1019 Zone zone = source.RandomItem();
1020 if (zone is Zone_SubTown && EClass.rnd(5) != 0)
1021 {
1022 i--;
1023 continue;
1024 }
1025 if (i >= array.Length && i < array.Length + 2)
1026 {
1028 }
1029 Chara chara = CharaGen.Create((i < array.Length) ? array[i] : ((EClass.rnd(10) == 0) ? "adv_fairy" : "adv"));
1030 chara.SetHomeZone(zone);
1031 chara.global.transition = new ZoneTransition
1032 {
1033 state = ZoneTransition.EnterState.RandomVisit
1034 };
1035 zone.AddCard(chara);
1036 cards.listAdv.Add(chara);
1037 }
1038 }
static void Set(CardBlueprint _bp=null)
static CardBlueprint Chara(int lv, Rarity rarity=Rarity.Normal)
BalanceSetting balance
Definition: GameSetting.cs:356
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 ApplyFix().

◆ ApplyFix()

void Game.ApplyFix ( )
inline

Definition at line 467 of file Game.cs.

468 {
469 Debug.Log("ApplyFix");
471 if (cards.listAdv.Count == 0)
472 {
474 }
475 quests.list.ForeachReverse(delegate(Quest q)
476 {
477 if (!(q is QuestRandom))
478 {
479 foreach (Quest item in quests.list)
480 {
481 if (q != item && item.id == q.id)
482 {
483 quests.list.Remove(item);
484 break;
485 }
486 }
487 }
488 });
489 quests.globalList.ForeachReverse(delegate(Quest q)
490 {
491 if (!(q is QuestRandom))
492 {
493 foreach (Quest global in quests.globalList)
494 {
495 if (q != global && global.id == q.id)
496 {
497 quests.globalList.Remove(global);
498 break;
499 }
500 }
501 }
502 });
503 version.IsBelow(0, 23, 356);
504 if (version.IsBelow(0, 23, 354))
505 {
506 FixElement(EClass.pc, 1421);
507 FixElement(EClass.pc, 6904);
508 }
509 if (version.IsBelow(0, 23, 345))
510 {
511 Zone zone = spatials.Find("oldkeep");
512 if (zone != null && zone.visitCount > 0)
513 {
514 zone.SetInt(4, 1);
515 }
516 }
517 if (version.IsBelow(0, 23, 336))
518 {
519 AddAdventurer("adv_schwert");
520 }
521 TryAddQuest("into_darkness", "exile_kettle");
522 if (version.IsBelow(0, 23, 221) && EClass.game.quests.IsCompleted("curry"))
523 {
525 }
526 if (version.IsBelow(0, 23, 185))
527 {
528 player.resetPrincipal = true;
529 }
530 if (version.IsBelow(0, 23, 182))
531 {
532 foreach (Chara value in cards.globalCharas.Values)
533 {
534 if (!value.IsUnique && value.c_lockedAge != 0)
535 {
536 value.elements.SetBase(1243, 1);
537 }
538 }
539 }
540 if (version.IsBelow(0, 23, 155))
541 {
542 AddAdventurer("adv_yukiimo");
543 }
544 if (version.IsBelow(0, 23, 100))
545 {
546 int num = player.recipes.knownRecipes.TryGetValue("trainingDummy_heavy", 0);
547 if (num != 0)
548 {
549 player.recipes.knownRecipes["trainingDummy_heavy1"] = num;
550 }
551 }
552 if (version.IsBelow(0, 23, 96))
553 {
554 EClass.game.principal = IO.DeepCopy(EClass.setting.start.principals[0]);
555 }
557 {
559 EClass.game.principal.id = -1;
560 EClass.game.principal.permadeath = gameDifficultySetting.deleteGameOnDeath;
561 EClass.game.principal.disableManualSave = !gameDifficultySetting.allowManualSave;
562 EClass.core.actionsNextFrame.Add(delegate
563 {
564 EClass.ui.AddLayer<LayerWorldSetting>();
565 });
566 }
567 if (version.IsBelow(0, 23, 93))
568 {
570 Debug.Log("■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■feafefaeffaeaffeaaeaefseasfaefaef");
571 while (TryAddRecipe())
572 {
573 }
574 }
575 if (version.IsBelow(0, 23, 72))
576 {
577 foreach (Chara value2 in EClass.game.cards.globalCharas.Values)
578 {
579 if (!value2.isDead)
580 {
581 value2.c_wasInPcParty = false;
582 }
583 }
584 }
585 if (version.IsBelow(0, 23, 59))
586 {
587 while (TryDestroy())
588 {
589 }
590 }
592 {
593 world.SendPackage(ThingGen.CreateParcel(null, ThingGen.Create("bone_duponne")));
594 }
595 if (version.IsBelow(0, 23, 195))
596 {
597 Zone zone2 = spatials.Find("startVillage2");
598 if (zone2 != null && zone2.visitCount > 0)
599 {
601 }
602 }
603 if (version.IsBelow(0, 23, 52))
604 {
605 player.flags.toggleHotbarHighlightActivated = true;
606 }
607 if (version.IsBelow(0, 23, 51))
608 {
609 foreach (Chara value3 in EClass.game.cards.globalCharas.Values)
610 {
611 if (!(value3.id != "adv") && value3.IsPCFaction)
612 {
613 value3.idSkin = value3.uid % (value3.source._tiles.Length - 4) / 2 * 2 + ((!value3.IsMale) ? 1 : 0);
614 }
615 }
616 }
617 if (version.IsBelow(0, 22, 91))
618 {
619 TryAddQuestIfActive("demitas_spellwriter", "into_darkness");
620 }
621 if (version.IsBelow(0, 22, 86))
622 {
623 Chara chara = cards.globalCharas.Find("demitas");
624 if (chara != null && chara._works != null && chara._works.Count > 0)
625 {
626 chara._works[0] = 51;
627 }
628 }
629 if (version.IsBelow(0, 22, 86))
630 {
631 TryAddQuest("farris_tulip", "greatDebt");
632 }
633 if (version.IsBelow(0, 22, 86))
634 {
635 TryAddQuest("exile_whisper", "exile_kettle");
636 }
637 if (version.IsBelow(0, 22, 85))
638 {
639 TryAddQuest("exile_meet", "pre_debt");
640 }
641 if (version.IsBelow(0, 22, 60) && EClass.game.quests.Get<QuestDebt>() != null)
642 {
643 Chara chara2 = cards.globalCharas.Find("loytel");
644 Debug.Log("Loytelfix: " + chara2.homeZone);
645 if (chara2.homeZone == null || !chara2.homeZone.IsPCFaction)
646 {
648 chara2.homeZone = EClass.pc.homeBranch.owner;
649 chara2.RemoveEditorTag(EditorTag.Invulnerable);
650 }
651 }
652 if (version.IsBelow(0, 22, 52) && quests.completedIDs.Contains("vernis_gold"))
653 {
654 quests.Add("pre_debt", "farris");
655 }
656 if (quests.completedIDs.Contains("farris_tulip"))
657 {
658 quests.globalList.ForeachReverse(delegate(Quest q)
659 {
660 if (q.id == "farris_tulip")
661 {
662 quests.globalList.Remove(q);
663 }
664 });
665 }
666 quests.list.ForeachReverse(delegate(Quest q)
667 {
668 if (q is QuestDialog && quests.completedIDs.Contains(q.id))
669 {
670 quests.list.Remove(q);
671 }
672 });
673 if (version.IsBelow(0, 22, 20))
674 {
675 foreach (Chara value4 in cards.globalCharas.Values)
676 {
677 value4.SetBool(18, enable: false);
678 }
679 }
680 if (version.IsBelow(0, 22, 22))
681 {
682 if (EClass.pc.faithElements != null)
683 {
685 }
686 foreach (Element item2 in EClass.pc.elements.ListElements((Element e) => e.source.categorySub == "god"))
687 {
688 EClass.pc.SetFeat(item2.id, 0);
689 }
691 }
692 if (version.IsBelow(0, 22, 45))
693 {
694 player.debt = 20000000;
695 }
696 static void FixElement(Chara c, int idEle)
697 {
698 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);
699 if (c.c_genes != null)
700 {
701 num2 += c.c_genes.CountDNA(idEle);
702 }
703 foreach (BodySlot slot in c.body.slots)
704 {
705 if (slot.thing != null && slot.thing.c_DNA != null)
706 {
707 num2 += ((slot.thing.c_DNA.GetElement(idEle) != null) ? 1 : 0);
708 }
709 }
710 Element orCreateElement = c.elements.GetOrCreateElement(idEle);
711 if (num2 > 0 && orCreateElement.ValueWithoutLink != num2)
712 {
713 Debug.Log("FixElement: " + orCreateElement.Name + "/" + orCreateElement.vBase + "/" + orCreateElement.vSource + "/" + num2);
714 orCreateElement.vBase = num2 - orCreateElement.vSource;
715 }
716 if (orCreateElement is Ability && orCreateElement.Value > 0 && orCreateElement.vPotential < 0)
717 {
718 Debug.Log("FixElement(Ability): " + orCreateElement.Name + "/" + orCreateElement.Value + "/" + orCreateElement.vPotential + "/" + num2);
719 orCreateElement.vPotential = 0;
720 }
721 }
722 void TryAddQuest(string idQuest, string idReqQuest)
723 {
724 if (quests.completedIDs.Contains(idReqQuest) && !quests.completedIDs.Contains(idQuest) && quests.GetGlobal(idQuest) == null && quests.Get(idQuest) == null)
725 {
726 quests.Add(idQuest);
727 }
728 }
729 void TryAddQuestIfActive(string idQuest, string idReqQuest)
730 {
731 if (quests.Get(idReqQuest) != null && !quests.completedIDs.Contains(idQuest) && quests.GetGlobal(idQuest) == null && quests.Get(idQuest) == null)
732 {
733 quests.Add(idQuest);
734 }
735 }
736 bool TryAddRecipe()
737 {
738 foreach (string key in player.recipes.knownRecipes.Keys)
739 {
740 if (key.Length > 1 && key[0] == 'b')
741 {
742 RecipeSource recipeSource = RecipeManager.Get(key + "-p");
743 if (recipeSource != null && !player.recipes.knownRecipes.ContainsKey(recipeSource.id))
744 {
745 Debug.Log(recipeSource.id);
746 player.recipes.Add(recipeSource.id, showEffect: false);
747 return true;
748 }
749 recipeSource = RecipeManager.Get(key.Replace("-p", ""));
750 if (recipeSource != null && !player.recipes.knownRecipes.ContainsKey(recipeSource.id))
751 {
752 Debug.Log(recipeSource.id);
753 player.recipes.Add(recipeSource.id, showEffect: false);
754 return true;
755 }
756 }
757 }
758 return false;
759 }
760 static bool TryDestroy()
761 {
762 for (int i = 0; i < EClass.pc.party.members.Count; i++)
763 {
764 Chara chara3 = EClass.pc.party.members[i];
765 Debug.Log(chara3.id + "/" + chara3.uid + "/" + chara3._cints[1]);
766 for (int j = 0; j < EClass.pc.party.members.Count; j++)
767 {
768 Chara chara4 = EClass.pc.party.members[j];
769 if (i != j && chara3.uid == chara4.uid)
770 {
771 EClass.pc.party.uidMembers.RemoveAt(j);
772 EClass.pc.party.members.RemoveAt(j);
773 chara4.Destroy();
774 Debug.Log("Destroyed");
775 return true;
776 }
777 }
778 }
779 return false;
780 }
781 }
EditorTag
Definition: EditorTag.cs:2
List< Action > actionsNextFrame
Definition: BaseCore.cs:31
Thing thing
Definition: BodySlot.cs:8
Chara Find(string id)
Definition: CardManager.cs:20
GlobalCharaList globalCharas
Definition: CardManager.cs:46
int c_lockedAge
Definition: Card.cs:1393
void RemoveEditorTag(EditorTag tag)
Definition: Card.cs:2743
ElementContainerCard elements
Definition: Card.cs:42
string id
Definition: Card.cs:36
bool IsUnique
Definition: Card.cs:2143
bool IsMale
Definition: Card.cs:2454
int uid
Definition: Card.cs:125
void Destroy()
Definition: Card.cs:5314
DNA c_DNA
Definition: Card.cs:1933
void SetBool(string id, bool enable)
Definition: Card.cs:2562
int[] _cints
Definition: Chara.cs:84
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:10601
Party party
Definition: Chara.cs:45
override bool IsPCFaction
Definition: Chara.cs:691
Zone homeZone
Definition: Chara.cs:273
void RefreshFaithElement()
Definition: Chara.cs:10918
ElementContainer faithElements
Definition: Chara.cs:40
FactionBranch homeBranch
Definition: Chara.cs:1122
bool isDead
Definition: Chara.cs:395
List< int > _works
Definition: Chara.cs:54
SourceRace.Row race
Definition: Chara.cs:470
Element GetElement(int id)
Definition: DNA.cs:806
static Game game
Definition: EClass.cs:9
static UI ui
Definition: EClass.cs:17
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 ValueWithoutLink
Definition: ELEMENT.cs:303
int id
Definition: ELEMENT.cs:259
int vBase
Definition: ELEMENT.cs:261
SourceElement.Row source
Definition: ELEMENT.cs:282
int vPotential
Definition: ELEMENT.cs:265
int Value
Definition: ELEMENT.cs:301
virtual string Name
Definition: ELEMENT.cs:313
int vSource
Definition: ELEMENT.cs:271
void AddMemeber(Chara c)
List< GameDifficultySetting > difficulties
Definition: GameSetting.cs:247
void AddAdventurers()
Definition: Game.cs:1013
void AddAdventurer(string id, Zone z=null)
Definition: Game.cs:1040
QuestManager quests
Definition: Game.cs:183
Version version
Definition: Game.cs:168
List< int > uidMembers
Definition: Party.cs:12
List< Chara > members
Definition: Party.cs:19
RecipeManager recipes
Definition: Player.cs:1176
bool resetPrincipal
Definition: Player.cs:1259
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
int GetPhase(string id)
bool IsCompleted(string id)
List< Quest > globalList
Definition: QuestManager.cs:14
Quest Get(string id)
Quest GetGlobal(string id)
Definition: Quest.cs:7
string id
Definition: Quest.cs:31
static void BuildList()
static RecipeSource Get(string id)
Dictionary< string, int > knownRecipes
void Add(string id, bool showEffect=true)
Zone Find(string id)
void SetInt(int id, int value=0)
Definition: Spatial.cs:580
int visitCount
Definition: Spatial.cs:154
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
static Thing CreateCassette(int id)
Definition: ThingGen.cs:238
void SendPackage(Thing p)
Definition: World.cs:68
bool IsPCFaction
Definition: Zone.cs:480
bool IsBelow(int _major, int _minor, int _batch)
Definition: Version.cs:49

References AddAdventurers(), cards, ElementContainerCard.CheckSkillActions(), Debug, Card.elements, item, QuestManager.list, CardManager.listAdv, EClass.pc, and quests.

Referenced by OnLoad().

◆ Create()

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

Definition at line 783 of file Game.cs.

784 {
785 id = _id ?? GameIO.GetNewId(cloud ? CorePath.RootSaveCloud : CorePath.RootSave, "world_");
787 EClass.core.game = (Instance = new Game());
788 EClass.core.game.isCloud = cloud;
792 }
static string RootSave
Definition: CorePath.cs:202
static string RootSaveCloud
Definition: CorePath.cs:204
Game game
Definition: Core.cs:72
Definition: GameIO.cs:11
static string GetNewId(string path, string prefix="", int start=1)
Definition: GameIO.cs:376
static void ResetTemp()
Definition: GameIO.cs:54
Definition: Game.cs:9
void _Create()
Definition: Game.cs:824
static void OnBeforeInstantiate()
Definition: Game.cs:794
static Game Instance
Definition: Game.cs:144
void OnGameInstantiated()
Definition: Game.cs:799

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 1061 of file Game.cs.

1062 {
1063 if (showDialog)
1064 {
1065 Dialog.YesNo("dialog_gotoTitle", delegate
1066 {
1067 if (EClass.game.Save(isAutoSave: true))
1068 {
1069 EClass.scene.Init(Scene.Mode.Title);
1070 }
1071 });
1072 }
1073 else
1074 {
1075 EClass.scene.Init(Scene.Mode.Title);
1076 }
1077 }
Definition: Dialog.cs:7
static Dialog YesNo(string langDetail, Action actionYes, Action actionNo=null, string langYes="yes", string langNo="no")
Definition: Dialog.cs:252
static Scene scene
Definition: EClass.cs:31
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1090
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 1163 of file Game.cs.

1164 {
1165 isKilling = true;
1166 Debug.Log("Killing Game: IsStarted? " + EClass.core.IsGameStarted);
1168 {
1169 EClass.ui.OnKillGame();
1172 }
1173 EClass.core.game = (Instance = null);
1174 EClass.Sound.currentPlaylist = null;
1175 Window.dictTab.Clear();
1176 foreach (Texture2D loadedTexture in loadedTextures)
1177 {
1178 if (loadedTexture != null)
1179 {
1180 UnityEngine.Object.Destroy(loadedTexture);
1181 }
1182 }
1183 }
bool IsGameStarted
Definition: Core.cs:87
HashSet< Texture2D > loadedTextures
Definition: Game.cs:258
Zone activeZone
Definition: Game.cs:252
bool isKilling
Definition: Game.cs:244
void OnKillGame()
Definition: Scene.cs:343
Definition: Window.cs:13
static Dictionary< string, int > dictTab
Definition: Window.cs:596
void OnKillGame()
Definition: Zone.cs:1864

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

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

◆ Load()

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

Definition at line 322 of file Game.cs.

323 {
324 string text = (cloud ? CorePath.RootSaveCloud : CorePath.RootSave) + id;
325 Debug.Log("Loading: " + id + ": " + text);
326 if (EClass.game != null)
327 {
328 EClass.game.Kill();
329 }
331 GameIOContext data = new GameIOContext(text);
332 BaseModManager.PublishEvent("elin.game.pre_load", data);
333 EClass.core.game = GameIO.LoadGame(id, text, cloud);
334 EClass.game.isCloud = cloud;
335 EClass.game.isLoading = true;
339 EClass.scene.Init(Scene.Mode.StartGame);
340 if (EClass.game.altInv)
341 {
342 SoundManager.ignoreSounds = true;
344 {
345 EClass.ui.OpenFloatInv();
346 }
347 SoundManager.ignoreSounds = true;
349 {
350 EClass.ui.ToggleAbility();
351 }
352 SoundManager.ignoreSounds = false;
353 TooltipManager.Instance.HideTooltips(immediate: true);
354 }
355 if ((bool)WidgetSideScreen.Instance)
356 {
358 }
359 EClass.game.isLoading = false;
360 BaseModManager.PublishEvent("elin.game.post_load", data);
361 }
static void PublishEvent(string eventId, object data=null)
static void ClearTemp()
Definition: GameIO.cs:64
static Game LoadGame(string id, string root, bool cloud)
Definition: GameIO.cs:174
void Kill()
Definition: Game.cs:1163
bool altInv
Definition: Game.cs:270
void OnLoad()
Definition: Game.cs:363
bool layerAbility
Definition: Player.cs:35
bool layerInventory
Definition: Player.cs:33
Pref pref
Definition: Player.cs:1092
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, BaseModManager.PublishEvent(), 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 794 of file Game.cs.

795 {
796 Player.seedHallucination = 0;
797 }

Referenced by Load().

◆ OnBeforeSave()

void Game.OnBeforeSave ( )
inline

Definition at line 1149 of file Game.cs.

1150 {
1151 foreach (Zone zone in spatials.Zones)
1152 {
1153 zone.OnBeforeSave();
1154 }
1156 foreach (Spatial item in spatials.listDestryoed)
1157 {
1158 item.DeleteMapRecursive();
1159 }
1160 spatials.listDestryoed.Clear();
1161 }
void OnBeforeSave()
Definition: Player.cs:1540
List< Zone > Zones
List< Spatial > listDestryoed
void OnBeforeSave()
Definition: Spatial.cs:668

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

◆ OnDeserializing()

void Game.OnDeserializing ( StreamingContext  context)
inlineprivate

Definition at line 1210 of file Game.cs.

1211 {
1212 Debug.Log("#io game OnDeserializing");
1213 Instance = this;
1214 }

References Debug.

◆ OnGameInstantiated()

void Game.OnGameInstantiated ( )
inline

Definition at line 799 of file Game.cs.

800 {
801 HotItemHeld.taskBuild = null;
802 InvOwner.Trader = (InvOwner.Main = null);
803 LayerDrama.currentQuest = null;
804 ContentGallery.lastPage = 0;
805 ContentGallery.listMode = false;
806 if (!Application.isEditor || !EClass.debug.enable)
807 {
809 }
810 foreach (Chara value in cards.globalCharas.Values)
811 {
812 if (value.uid == player.uidChara)
813 {
814 player.chara = value;
815 break;
816 }
817 }
819 EClass.ui.widgets.OnGameInstantiated();
820 EClass.Sound.ResetPlaylist();
821 EClass.core.config.ApplyFPS(force: true);
822 }
static void OnGameInstantiated()
Definition: ActionMode.cs:247
void ApplyFPS(bool force=false)
Definition: CoreConfig.cs:865
bool enable
Definition: CoreDebug.cs:302
CoreConfig config
Definition: Core.cs:70
static CoreDebug debug
Definition: EClass.cs:49
static SoundManager Sound
Definition: EClass.cs:47
int uidChara
Definition: Player.cs:945

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

Referenced by Create(), and Load().

◆ OnLoad()

void Game.OnLoad ( )
inline

Definition at line 363 of file Game.cs.

364 {
365 domains.OnLoad();
368 world._OnLoad();
369 player.OnLoad();
371 {
372 EClass.pc.party.members.ForEach(delegate(Chara c)
373 {
374 c.currentZone = EClass.pc.homeZone;
375 c.global.transition = new ZoneTransition
376 {
377 state = ZoneTransition.EnterState.Return
378 };
379 });
380 }
381 player.zone = EClass.pc.currentZone;
382 EClass.pc.currentZone.lastActive = world.date.GetRaw();
383 if (spatials.Find("somewhere") == null)
384 {
385 SpatialGen.Create("somewhere", world.region, register: true);
386 }
387 EClass.pc.homeZone.isKnown = true;
390 foreach (Thing item in EClass.pc.things.List((Thing t) => t.Num <= 0 || t.isDestroyed))
391 {
392 item.parent.RemoveCard(item);
393 }
394 foreach (Thing item2 in EClass.pc.things.List((Thing t) => t.trait is TraitChestMerchant))
395 {
396 item2.Destroy();
397 }
398 foreach (Thing item3 in EClass.pc.things.List((Thing t) => t.invY == 1 && t.invX == -1))
399 {
400 item3.invY = 0;
401 }
402 foreach (Chara value in EClass.game.cards.globalCharas.Values)
403 {
404 if (value.id == "demitas" && value.faction.id == "wilds")
405 {
407 }
408 if (value.memberType == FactionMemberType.Livestock && !value.IsPCFaction)
409 {
410 value.memberType = FactionMemberType.Default;
411 }
412 if (!value.isDyed && value.HasTag(CTAG.random_color))
413 {
414 value.DyeRandom();
415 }
416 }
417 foreach (FactionBranch child in EClass.pc.faction.GetChildren())
418 {
419 foreach (Chara member in child.members)
420 {
421 if (!member.isDead && (member.currentZone == null || member.currentZone.id == "somewhere"))
422 {
423 Debug.Log("exception: Moving invalid chara: " + member.Name + "/" + member.currentZone?.ToString() + "/" + member.homeBranch?.ToString() + "/" + member.faction);
424 member.MoveZone(child.owner, ZoneTransition.EnterState.RandomVisit);
425 }
426 member.RefreshWorkElements(child.owner.elements);
427 member.Refresh();
428 }
429 }
430 EClass.pc.angle = player.angle;
431 ApplyFix();
433 {
435 }
436 if (cards.container_deposit == null)
437 {
438 cards.container_deposit = ThingGen.Create("container_deposit");
439 if (player.bankMoney > 0)
440 {
442 }
443 }
444 foreach (Quest item4 in quests.list)
445 {
446 if (item4 is QuestSequence && !EClass.sources.quests.map.ContainsKey(item4.idSource))
447 {
448 item4.phase = 0;
449 }
450 }
451 foreach (Quest global in quests.globalList)
452 {
453 if (global is QuestSequence && !EClass.sources.quests.map.ContainsKey(global.idSource))
454 {
455 global.phase = 0;
456 }
457 }
458 foreach (KeyValuePair<int, Spatial> item5 in EClass.game.spatials.map.ToList())
459 {
460 if (item5.Value == null)
461 {
462 EClass.game.spatials.map.Remove(item5.Key);
463 }
464 }
465 }
CTAG
Definition: CTAG.cs:2
FactionMemberType
Thing container_deposit
Definition: CardManager.cs:58
bool isDestroyed
Definition: Card.cs:78
int invY
Definition: Card.cs:2007
string Name
Definition: Card.cs:2191
bool HasTag(CTAG tag)
Definition: Card.cs:2728
void DyeRandom()
Definition: Card.cs:6473
Trait trait
Definition: Card.cs:54
bool isDyed
Definition: Card.cs:461
ThingContainer things
Definition: Card.cs:39
int invX
Definition: Card.cs:1995
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3257
int Num
Definition: Card.cs:161
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1830
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9657
Faction faction
Definition: Chara.cs:433
FactionMemberType memberType
Definition: Chara.cs:48
void MoveZone(string alias)
Definition: Chara.cs:3607
void OnLoad()
Definition: CoreDebug.cs:746
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
static SourceManager sources
Definition: EClass.cs:43
List< Chara > members
List< FactionBranch > GetChildren()
Definition: FACTION.cs:202
string id
Definition: FACTION.cs:129
void ApplyFix()
Definition: Game.cs:467
float angle
Definition: Player.cs:1050
void OnLoad()
Definition: Player.cs:1516
int bankMoney
Definition: Player.cs:990
virtual string idSource
Definition: Quest.cs:149
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
void _OnLoad()
Definition: Spatial.cs:677
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:600
ElementContainerZone elements
Definition: Zone.cs:46
override bool Equals(object obj)
Definition: Version.cs:115

References Spatial._OnLoad(), Card.Add(), FactionBranch.AddMemeber(), Player.angle, ApplyFix(), Player.bankMoney, cards, CardManager.container_deposit, EClass.core, ThingGen.Create(), SpatialGen.Create(), Chara.currentZone, World.date, EClass.debug, Debug, Card.Destroy(), Spatial.destryoed, domains, Card.DyeRandom(), Zone.elements, Version.Equals(), Chara.faction, factions, SpatialManager.Find(), EClass.game, Faction.GetChildren(), Date.GetRaw(), CardManager.globalCharas, QuestManager.globalList, Card.HasTag(), Chara.homeBranch, Chara.homeZone, Card.id, Faction.id, Spatial.id, Quest.idSource, Card.invX, Card.invY, Chara.isDead, Card.isDestroyed, Card.isDyed, Chara.IsPCFaction, item, QuestManager.list, ThingContainer.List(), SpatialManager.map, FactionBranch.members, Party.members, Chara.memberType, Chara.MoveZone(), Card.Name, Card.Num, CoreDebug.OnLoad(), DomainManager.OnLoad(), FactionManager.OnLoad(), Player.OnLoad(), ReligionManager.OnLoad(), RecipeManager.OnVersionUpdate(), FactionBranch.owner, Chara.party, EClass.pc, player, quests, SourceManager.quests, Player.recipes, Chara.Refresh(), ThingContainer.RefreshGridRecursive(), Chara.RefreshWorkElements(), World.region, religions, EClass.sources, spatials, Card.things, Zone.ToString(), Card.trait, version, BaseCore.version, and world.

Referenced by Load().

◆ OnSerializing()

void Game.OnSerializing ( StreamingContext  context)
inlineprivate

Definition at line 1204 of file Game.cs.

1205 {
1206 Debug.Log("#io game OnSerializing");
1207 }

References Debug.

◆ OnUpdate()

void Game.OnUpdate ( )
inline

Definition at line 298 of file Game.cs.

299 {
300 backupTime += Time.deltaTime;
301 waitTimer -= Time.deltaTime;
302 timeSinceStart += Time.deltaTime;
303 player.stats.timeElapsed += Time.deltaTime;
305 {
306 flags.IsWelcomeMessageShown = true;
307 }
309 }
void FixedUpdate()
Definition: GameUpdater.cs:444
bool IsWelcomeMessageShown
Definition: Game.cs:120
GameUpdater updater
Definition: Game.cs:250
static float waitTimer
Definition: Game.cs:146
Flags flags
Definition: Game.cs:216
double backupTime
Definition: Game.cs:213
float timeSinceStart
Definition: Game.cs:240
double timeElapsed
Definition: Player.cs:66
Stats stats
Definition: Player.cs:1095

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 1185 of file Game.cs.

1186 {
1187 isPaused = true;
1188 LayerPause layerPause = EClass.ui.AddLayer<LayerPause>();
1189 Game lastGame = EClass.game;
1190 if (onUnpause == null)
1191 {
1192 return;
1193 }
1194 layerPause.SetOnKill(delegate
1195 {
1196 if (EClass.core.IsGameStarted && lastGame == EClass.game)
1197 {
1198 onUnpause();
1199 }
1200 });
1201 }
static bool isPaused
Definition: Game.cs:150
Layer SetOnKill(Action action)
Definition: Layer.cs:584

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 1079 of file Game.cs.

1080 {
1081 Dialog.YesNo("dialog_quit", delegate
1082 {
1083 if (EClass.game.Save())
1084 {
1085 EClass.core.Quit();
1086 }
1087 });
1088 }

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 1090 of file Game.cs.

1091 {
1092 if (EClass.ui.IsDragging)
1093 {
1094 EClass.ui.EndDrag(canceled: true);
1095 }
1096 if (isAutoSave && EClass.debug.ignoreAutoSave)
1097 {
1098 return true;
1099 }
1100 bool flag = EClass.core.config.game.autoBackup && backupTime >= (double)(EClass.core.config.game.backupInterval * 60 * 30);
1101 if (flag)
1102 {
1103 backupTime = 0.0;
1104 }
1106 countLoadedMaps = 0;
1107 player.pref.layerInventory = EClass.ui.layerFloat.GetLayer<LayerInventory>();
1109 {
1110 player.pref.layerAbility = EClass.ui.layerFloat.GetLayer<LayerAbility>();
1111 }
1112 player.pref.layerCraft = EClass.ui.layerFloat.GetLayer<LayerCraftFloat>();
1113 player.angle = EClass.pc.angle;
1115 EClass.ui.widgets.UpdateConfigs();
1116 GameIndex gameIndex = null;
1117 try
1118 {
1119 GameIOContext data = new GameIOContext(GameIO.pathCurrentSave);
1120 BaseModManager.PublishEvent("elin.game.pre_save", data);
1121 OnBeforeSave();
1122 gameIndex = GameIO.SaveGame();
1123 BaseModManager.PublishEvent("elin.game.post_save", data);
1124 }
1125 catch (Exception ex)
1126 {
1127 EClass.ui.Say(ex.Message);
1128 SE.Beep();
1129 Msg.Say("error_save");
1130 return false;
1131 }
1132 if (flag)
1133 {
1134 GameIO.MakeBackup(gameIndex);
1135 EClass.ui.Say("backupDone");
1136 }
1137 if (!silent)
1138 {
1139 if (!isAutoSave)
1140 {
1141 SE.WriteJournal();
1142 }
1143 Msg.Say("saved");
1144 }
1145 saveCount++;
1146 return true;
1147 }
float angle
Definition: Card.cs:74
new GameConfig game
Definition: CoreConfig.cs:629
void TryUpdatePlayedHour()
Definition: CoreConfig.cs:839
bool ignoreAutoSave
Definition: CoreDebug.cs:142
static string pathCurrentSave
Definition: GameIO.cs:34
static GameIndex SaveGame()
Definition: GameIO.cs:82
static void MakeBackup(GameIndex index, string suffix="")
Definition: GameIO.cs:136
int countLoadedMaps
Definition: Game.cs:236
int saveCount
Definition: Game.cs:238
void OnBeforeSave()
Definition: Game.cs:1149
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(), GameIO.pathCurrentSave, EClass.pc, Player.pref, BaseModManager.PublishEvent(), 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(), Quit(), Map.Reload(), HotItemContext.Show(), and CoreDebug.UpdateInput().

◆ StartNewGame()

void Game.StartNewGame ( )
inline

Definition at line 856 of file Game.cs.

857 {
858 EClass.pc.homeZone = StartZone;
861 Prologue prologue = EClass.game.Prologue;
862 if (prologue.type == GameType.Survival)
863 {
865 }
866 else
867 {
868 CharaGen.Create("fiama").SetGlobal(EClass.game.StartZone, prologue.posFiama.x, prologue.posFiama.y);
869 CharaGen.Create("ashland").SetGlobal(EClass.game.StartZone, prologue.posAsh.x, prologue.posAsh.y);
870 }
871 if ((bool)LayerTitle.actor)
872 {
873 world.date.hour = EClass.game.Prologue.hour;
875 Player obj = player;
876 Chara chara = EClass.pc;
877 Zone zone = (EClass.pc.homeZone = EClass.game.spatials.Find(EClass.game.Prologue.idStartZone));
878 Zone zone3 = (chara.currentZone = zone);
879 obj.zone = zone3;
880 EClass.pc.global.transition = new ZoneTransition
881 {
882 state = ZoneTransition.EnterState.Exact,
884 z = EClass.game.Prologue.startZ
885 };
886 EClass.pc.hp = EClass.pc.MaxHP;
889 EClass.pc.AddCondition<ConFaint>(200, force: true);
890 }
891 else
892 {
893 EClass.pc.homeZone = EClass.game.spatials.Find(EClass.game.Prologue.idStartZone);
894 Zone zone5 = null;
895 ZoneTransition transition = new ZoneTransition
896 {
897 state = ZoneTransition.EnterState.Auto
898 };
899 Chara c = EClass.game.cards.globalCharas.Find("ashland");
900 switch (EClass.debug.startScene)
901 {
902 case CoreDebug.StartScene.Zone:
904 transition = new ZoneTransition
905 {
906 state = ZoneTransition.EnterState.Exact,
908 z = EClass.game.Prologue.startZ
909 };
910 break;
911 case CoreDebug.StartScene.Home:
912 case CoreDebug.StartScene.Story_Test:
914 transition = new ZoneTransition
915 {
916 state = ZoneTransition.EnterState.Exact,
918 z = EClass.game.Prologue.startZ
919 };
920 break;
921 case CoreDebug.StartScene.Survival:
922 EClass.game.idPrologue = 3;
924 transition = new ZoneTransition
925 {
926 state = ZoneTransition.EnterState.Exact,
928 z = EClass.game.Prologue.startZ
929 };
930 break;
931 case CoreDebug.StartScene.Home_Cave:
932 EClass.game.idPrologue = 2;
934 transition = new ZoneTransition
935 {
936 state = ZoneTransition.EnterState.Exact,
938 z = EClass.game.Prologue.startZ
939 };
940 break;
941 case CoreDebug.StartScene.MeetFarris:
942 {
943 Zone parent4 = EClass.game.spatials.Find("nymelle");
944 zone5 = SpatialGen.Create("nymelle", parent4, register: true) as Zone;
945 zone5.lv = -2;
946 EClass.game.quests.Start("exploration", c, assignQuest: false);
947 break;
948 }
949 case CoreDebug.StartScene.NymelleBoss:
950 {
951 Zone parent3 = EClass.game.spatials.Find("nymelle");
952 zone5 = SpatialGen.Create("nymelle_boss", parent3, register: true) as Zone;
953 zone5.lv = -5;
954 EClass.game.quests.Start("exploration", c, assignQuest: false).ChangePhase(2);
955 break;
956 }
957 case CoreDebug.StartScene.AfterNymelle:
959 transition = new ZoneTransition
960 {
961 state = ZoneTransition.EnterState.Exact,
963 z = EClass.game.Prologue.startZ
964 };
965 EClass.game.quests.Start("exploration", c, assignQuest: false).ChangePhase(5);
966 EClass.game.quests.globalList.Add(Quest.Create("sharedContainer").SetClient(c, assignQuest: false));
967 EClass.game.quests.globalList.Add(Quest.Create("crafter").SetClient(c, assignQuest: false));
968 EClass.game.quests.globalList.Add(Quest.Create("defense").SetClient(c, assignQuest: false));
969 break;
970 case CoreDebug.StartScene.Melilith:
971 {
972 Zone parent2 = EClass.game.spatials.Find("cursed_manor");
973 zone5 = SpatialGen.Create("cursed_manor_dungeon", parent2, register: true) as Zone;
974 zone5.lv = -5;
975 break;
976 }
977 case CoreDebug.StartScene.Tefra:
978 {
979 Zone parent = EClass.game.spatials.Find("vernis");
980 zone5 = SpatialGen.Create("vernis_mine", parent, register: true) as Zone;
981 zone5.lv = -7;
982 break;
983 }
984 }
985 if (zone5 != null)
986 {
987 Player obj2 = player;
988 Chara chara2 = EClass.pc;
989 Zone zone = (EClass.pc.homeZone = zone5);
990 Zone zone3 = (chara2.currentZone = zone);
991 obj2.zone = zone3;
992 EClass.pc.global.transition = transition;
993 }
994 else
995 {
996 Player obj3 = player;
997 Zone zone3 = (EClass.pc.currentZone = EClass.game.spatials.Find(EClass.debug.startZone));
998 obj3.zone = zone3;
999 EClass.pc.global.transition = new ZoneTransition
1000 {
1001 state = ZoneTransition.EnterState.Return
1002 };
1003 }
1004 }
1005 EClass.pc.homeZone.isKnown = true;
1008 EClass.scene.Init(Scene.Mode.StartGame);
1009 GameIOContext data = new GameIOContext((isCloud ? CorePath.RootSaveCloud : CorePath.RootSave) + id);
1010 BaseModManager.PublishEvent("elin.game.start_new", data);
1011 }
GameType
Definition: GameType.cs:2
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9912
Chara SetGlobal(Zone _home, int x, int z)
Definition: Chara.cs:1569
override int MaxHP
Definition: Chara.cs:728
Stats mana
Definition: Chara.cs:1238
Stats stamina
Definition: Chara.cs:1230
string startZone
Definition: CoreDebug.cs:122
StartScene startScene
Definition: CoreDebug.cs:112
SurvivalManager survival
Definition: Game.cs:228
PartyManager parties
Definition: Game.cs:174
Prologue Prologue
Definition: Game.cs:264
bool isCloud
Definition: Game.cs:246
Zone StartZone
Definition: Game.cs:278
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:1465
Vector2Int posAsh
Definition: Prologue.cs:23
string idStartZone
Definition: Prologue.cs:9
Vector2Int posFiama
Definition: Prologue.cs:25
int hour
Definition: Prologue.cs:21
GameType type
Definition: Prologue.cs:7
int startX
Definition: Prologue.cs:11
Quest Start(string id, string idGlobalChara)
Definition: QuestManager.cs:41
static Quest Create(string _id, string _idPerson=null, Chara c=null, bool assignQuest=true)
Definition: Quest.cs:241
void ChangePhase(int a)
Definition: Quest.cs:577
Quest SetClient(Chara c, bool assignQuest=true)
Definition: Quest.cs:380
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, BaseModManager.PublishEvent(), quests, CorePath.RootSave, CorePath.RootSaveCloud, EClass.scene, Stats.Set(), Quest.SetClient(), Chara.SetGlobal(), spatials, Chara.stamina, QuestManager.Start(), CoreDebug.startScene, Prologue.startX, CoreDebug.startZone, StartZone, and Prologue.type.

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

◆ TryLoad()

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

Definition at line 311 of file Game.cs.

312 {
314 {
315 onLoad();
316 return true;
317 }
318 EClass.ui.Say("incompatible");
319 return false;
320 }
static bool CanLoad(string root)
Definition: GameIO.cs:168

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 293 of file Game.cs.

294 {
295 waitTimer = a * (float)(EClass.core.config.game.waiter * 25) / 100f;
296 }

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 285 of file Game.cs.

286 {
287 if (c != null && c.isSynced && !c.IsPC)
288 {
289 Wait(a);
290 }
291 }
virtual bool IsPC
Definition: Card.cs:2197
virtual bool isSynced
Definition: Card.cs:2139
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 280 of file Game.cs.

281 {
282 _ = p?.IsSync;
283 }
bool IsSync
Definition: Point.cs:340

References Point.IsSync.

Referenced by EClass.Wait().

Member Data Documentation

◆ activeZone

◆ backupTime

double Game.backupTime

Definition at line 213 of file Game.cs.

Referenced by OnUpdate().

◆ bp

GameBlueprint Game.bp

Definition at line 248 of file Game.cs.

◆ cards

CardManager Game.cards = new CardManager()

Definition at line 156 of file Game.cs.

Referenced by ReligionManager.ジュアさまの薄い本をください(), QuestManager.Add(), Zone.AddGlobalCharasOnActivate(), QuestManager.AddQuestAsh(), QuestManager.AddQuestFiama(), Zone.AddRandomVisitor(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), ApplyFix(), LayerShippingResult.Awake(), TraitSalesTag.CanTagSale(), ElementContainerFaction.CheckDirty(), SurvivalManager.CheckLoytelDebt(), Faction.CountMembers(), Card.Create(), LayerInventory.CreateContainer(), Card.Destroy(), CharaExtension.DestroyImmediate(), Chara.Die(), Zone.FindSharedContainer(), CoreDebug.Fix_RemoveAshland(), CoreDebug.Fix_RemoveDemitas(), RefChara.Get(), DramaSequence.GetActor(), RefChara.GetAndCache(), Faction.HasMember(), TaskDump.IsValidContainer(), Faction.IsWearingPanty(), TaskDump.ListThingsToPut(), Zone_Specwing.OnActivate(), Faction.OnAdvanceMonth(), Zone_WindRest.OnAfterSimulate(), Trait.OnBarter(), Zone_Nymelle.OnBeforeSimulate(), QuestDefense.OnChangePhase(), QuestVernis.OnChangePhase(), DramaOutcome.OnClaimLand(), Quest.OnClickQuest(), QuestIntroInspector.OnComplete(), QuestSharedContainer.OnComplete(), TraitDrinkMilkMother.OnDrink(), QuestDialog.OnDropReward(), SurvivalManager.OnExpandFloor(), CustomCharaContent.OnGameLoad(), Zone_DungeonPuppy.OnGenerateMap(), ElementContainerFaction.OnJoinFaith(), ElementContainerFaction.OnLeaveFaith(), ZoneInstanceBout.OnLeaveZone(), ListPeopleParty.OnList(), ListPeopleRevive.OnList(), OnLoad(), TraitStoryBookHome.OnRead(), ListPeopleParty.OnRefreshMenu(), QuestDebt.OnStart(), QuestExploration.OnStart(), ZoneEventWedding.OnVisit(), Zone_Aquli.OnVisitNewMapOrRegenerate(), DramaManager.ParseLine(), InvOwnerDeliver.PayBill(), ActEffect.Proc(), DramaOutcome.QuestExploration_AfterComplete(), DramaOutcome.QuestExploration_AfterCrystal(), CoreDebug.QuickStart(), FactionBranch.ReceivePackages(), WindowChara.RefreshNote(), WindowChara.RefreshProfile(), LayerQuestBoard.RefreshRanking(), Chara.RemoveGlobal(), FactionBranch.RemoveMemeber(), CoreDebug.ResetPetUpgrades(), CharaMassTransfer.Restore(), SerializedCards.Restore(), Zone.Revive(), DramaOutcome.reward_stone_dream(), AI_Idle.Run(), TaskDump.Run(), World.SendPackage(), Meeting.SetChara(), Chara.SetGlobal(), FactionBranch.SetOwner(), UIFactionInfo.SetZone(), UIZoneInfo.SetZone(), GameDate.ShipGoods(), GameDate.ShipPackages(), QuestManager.Start(), StartNewGame(), Faction.TryPayBill(), GrowSystem.TryPick(), TraitBed.ValidateOwners(), EloPos.WriteNote(), and Thing.WriteNote().

◆ config

◆ countLoadedMaps

int Game.countLoadedMaps

Definition at line 236 of file Game.cs.

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

◆ dateScratch

int Game.dateScratch

Definition at line 210 of file Game.cs.

◆ domains

DomainManager Game.domains = new DomainManager()

Definition at line 165 of file Game.cs.

Referenced by OnLoad().

◆ factions

◆ flags

Flags Game.flags = new Flags()

Definition at line 216 of file Game.cs.

Referenced by OnUpdate().

◆ gameSpeedIndex

int Game.gameSpeedIndex = 1

◆ id

◆ idDifficulty

int Game.idDifficulty

Definition at line 207 of file Game.cs.

◆ idPrologue

int Game.idPrologue

Definition at line 204 of file Game.cs.

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

◆ Instance

Game Game.Instance
static

Definition at line 144 of file Game.cs.

◆ isCloud

bool Game.isCloud

◆ isKilling

bool Game.isKilling

Definition at line 244 of file Game.cs.

Referenced by LayerInventory.OnKill().

◆ isLoading

◆ isPaused

bool Game.isPaused
static

Definition at line 150 of file Game.cs.

Referenced by GameUpdater.CharaUpdater.FixedUpdate().

◆ lastActiveZone

Zone Game.lastActiveZone

Definition at line 254 of file Game.cs.

Referenced by LayerPeople.CreateSelectEmbarkMembers().

◆ lastGameSpeedIndex

int Game.lastGameSpeedIndex = 1

Definition at line 232 of file Game.cs.

Referenced by ActionMode.UnPause().

◆ loadedTextures

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

Definition at line 258 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 189 of file Game.cs.

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

◆ lostThings

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

Definition at line 222 of file Game.cs.

◆ parties

PartyManager Game.parties = new PartyManager()

Definition at line 174 of file Game.cs.

◆ player

new Player Game.player = new Player()

◆ principal

◆ quests

QuestManager Game.quests = new QuestManager()

Definition at line 183 of file Game.cs.

Referenced by InvOwnerDeliver._OnProcess(), ActPlan._Update(), QuestManager.Add(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), ApplyFix(), LayerShippingResult.Awake(), DramaCustomSequence.Build(), QuestVernis.CanUpdateOnTalk(), TraitDamnPool.CanUse(), SurvivalManager.CheckLoytelDebt(), 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_DungeonDead.OnActivate(), Zone_Exile.OnActivate(), Zone_Specwing.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(), Player.Flags.OnEnterZone(), Zone_DungeonPuppy.OnGenerateMap(), OnLoad(), TraitStoryBookHome.OnRead(), QuestExploration.OnStart(), QuestIntoDarkness.OnStart(), Player.OnStartNewGame(), ContentQuest.OnSwitchContent(), TraitDamnPool.OnUse(), 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(), TraitAshland.ShouldShowQuestIcon(), TraitFiama.ShouldShowQuestIcon(), CardRenderer.ShowBossText(), Chara.ShowDialog(), StartNewGame(), ActThrow.Throw(), 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 256 of file Game.cs.

◆ relations

RelationManager Game.relations = new RelationManager()

Definition at line 186 of file Game.cs.

Referenced by GameDate.AdvanceDay().

◆ religions

◆ saveCount

int Game.saveCount

Definition at line 238 of file Game.cs.

◆ seed

◆ sessionMin

int Game.sessionMin

Definition at line 234 of file Game.cs.

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

◆ spatials

◆ startVersion

Version Game.startVersion

Definition at line 171 of file Game.cs.

◆ survival

◆ teleports

◆ timeSinceStart

float Game.timeSinceStart

Definition at line 240 of file Game.cs.

Referenced by OnUpdate().

◆ uniforms

PCCUniformManager Game.uniforms = new PCCUniformManager()

Definition at line 195 of file Game.cs.

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

◆ updater

◆ version

Version Game.version

Definition at line 168 of file Game.cs.

Referenced by OnLoad().

◆ waitTimer

float Game.waitTimer
static

Definition at line 146 of file Game.cs.

Referenced by OnUpdate(), and Wait().

◆ welcomeTimer

float Game.welcomeTimer
private

Definition at line 260 of file Game.cs.

◆ world

Property Documentation

◆ altAbility

bool Game.altAbility
get

Definition at line 274 of file Game.cs.

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

◆ altCraft

bool Game.altCraft
get

Definition at line 272 of file Game.cs.

Referenced by Scene.Init().

◆ altInv

bool Game.altInv
get

◆ altUI

bool Game.altUI
get

Definition at line 268 of file Game.cs.

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

◆ IsSurvival

◆ IsWaiting

bool Game.IsWaiting
staticget

Definition at line 262 of file Game.cs.

Referenced by Scene.OnUpdate().

◆ Prologue

◆ StartZone

◆ UseGrid

bool Game.UseGrid
get

Definition at line 266 of file Game.cs.

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


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