Elin Decompiled Documentation EA 23.270 Nightly Patch 1
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 (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< ThinglostThings = 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, 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]
 
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 771 of file Game.cs.

772 {
773 principal = IO.DeepCopy(EClass.setting.start.principals[0]);
774 idDifficulty = 1;
775 config.snapFreePos = (config.slope = (config.autoWall = true));
776 config.autoCombat.abortOnAllyDead = true;
777 config.autoCombat.abortOnHalfHP = true;
778 config.autoCombat.bUseHotBar = true;
779 config.autoCombat.bUseInventory = true;
780 config.autoCombat.bDontChangeTarget = true;
781 config.autoCombat.abortOnKill = true;
782 config.autoCombat.abortOnItemLoss = true;
783 seed = EClass.rnd(10000);
784 Debug.Log("creating game: " + id + " seed:" + seed);
786 uniforms.Import();
791 foreach (Spatial value in spatials.map.Values)
792 {
793 value.SetMainFaction(factions.Find(value.source.faction.IsEmpty("wilds")));
794 }
796 cards.container_shipping = ThingGen.Create("container_shipping");
797 cards.container_deliver = ThingGen.Create("container_delivery");
798 cards.container_deposit = ThingGen.Create("container_deposit");
799 bp = new GameBlueprint();
800 bp.Create();
801 }
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:244
StartSetting start
Definition: GameSetting.cs:305
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:11
void OnCreateGame()
Definition: Player.cs:1350
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 985 of file Game.cs.

986 {
987 if (z == null)
988 {
989 List<Zone> source = world.region.ListTowns();
990 do
991 {
992 z = source.RandomItem();
993 }
994 while ((z is Zone_SubTown && EClass.rnd(5) != 0) || z == EClass.pc.currentZone);
995 }
996 Chara chara = CharaGen.Create(id);
997 chara.SetHomeZone(z);
998 chara.global.transition = new ZoneTransition
999 {
1000 state = ZoneTransition.EnterState.RandomVisit
1001 };
1002 z.AddCard(chara);
1003 cards.listAdv.Add(chara);
1004 }
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:1449
Zone currentZone
Definition: Chara.cs:257
static Chara pc
Definition: EClass.cs:15
CardManager cards
Definition: Game.cs:156
List< Zone > ListTowns()
Definition: Region.cs:271
Region region
Definition: World.cs:23
Card AddCard(Card t, Point point)
Definition: Zone.cs:1992

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

◆ AddAdventurers()

void Game.AddAdventurers ( )
inline

Definition at line 958 of file Game.cs.

959 {
960 List<Zone> source = world.region.ListTowns();
961 string[] array = new string[7] { "adv_kiria", "adv_gaki", "adv_wini", "adv_verna", "adv_ivory", "adv_mesherada", "adv_yukiimo" };
962 for (int i = 0; i < EClass.setting.balance.numAdv; i++)
963 {
964 Zone zone = source.RandomItem();
965 if (zone is Zone_SubTown && EClass.rnd(5) != 0)
966 {
967 i--;
968 continue;
969 }
970 if (i >= array.Length && i < array.Length + 2)
971 {
973 }
974 Chara chara = CharaGen.Create((i < array.Length) ? array[i] : ((EClass.rnd(10) == 0) ? "adv_fairy" : "adv"));
975 chara.SetHomeZone(zone);
976 chara.global.transition = new ZoneTransition
977 {
978 state = ZoneTransition.EnterState.RandomVisit
979 };
980 zone.AddCard(chara);
981 cards.listAdv.Add(chara);
982 }
983 }
static void Set(CardBlueprint _bp=null)
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 730 of file Game.cs.

731 {
732 id = _id ?? GameIO.GetNewId(cloud ? CorePath.RootSaveCloud : CorePath.RootSave, "world_");
734 EClass.core.game = (Instance = new Game());
735 EClass.core.game.isCloud = cloud;
739 }
static string RootSave
Definition: CorePath.cs:210
static string RootSaveCloud
Definition: CorePath.cs:212
Game game
Definition: Core.cs:72
Definition: GameIO.cs:11
static string GetNewId(string path, string prefix="", int start=1)
Definition: GameIO.cs:355
static void ResetTemp()
Definition: GameIO.cs:54
Definition: Game.cs:9
void _Create()
Definition: Game.cs:771
static void OnBeforeInstantiate()
Definition: Game.cs:741
static Game Instance
Definition: Game.cs:144
void OnGameInstantiated()
Definition: Game.cs:746

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

1007 {
1008 if (showDialog)
1009 {
1010 Dialog.YesNo("dialog_gotoTitle", delegate
1011 {
1012 if (EClass.game.Save(isAutoSave: true))
1013 {
1014 EClass.scene.Init(Scene.Mode.Title);
1015 }
1016 });
1017 }
1018 else
1019 {
1020 EClass.scene.Init(Scene.Mode.Title);
1021 }
1022 }
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:9
static Scene scene
Definition: EClass.cs:31
bool Save(bool isAutoSave=false, bool silent=false)
Definition: Game.cs:1035
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 1105 of file Game.cs.

1106 {
1107 isKilling = true;
1108 Debug.Log("Killing Game: IsStarted? " + EClass.core.IsGameStarted);
1110 {
1111 EClass.ui.OnKillGame();
1114 }
1115 EClass.core.game = (Instance = null);
1116 EClass.Sound.currentPlaylist = null;
1117 Window.dictTab.Clear();
1118 foreach (Texture2D loadedTexture in loadedTextures)
1119 {
1120 if (loadedTexture != null)
1121 {
1122 UnityEngine.Object.Destroy(loadedTexture);
1123 }
1124 }
1125 }
bool IsGameStarted
Definition: Core.cs:84
static UI ui
Definition: EClass.cs:17
HashSet< Texture2D > loadedTextures
Definition: Game.cs:258
Zone activeZone
Definition: Game.cs:252
bool isKilling
Definition: Game.cs:244
void OnKillGame()
Definition: Scene.cs:341
Definition: Window.cs:13
static Dictionary< string, int > dictTab
Definition: Window.cs:596
void OnKillGame()
Definition: Zone.cs:1702

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 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 EClass.core.game = GameIO.LoadGame(id, text, cloud);
332 EClass.game.isCloud = cloud;
333 EClass.game.isLoading = true;
337 EClass.scene.Init(Scene.Mode.StartGame);
338 if (EClass.game.altInv)
339 {
340 SoundManager.ignoreSounds = true;
342 {
343 EClass.ui.OpenFloatInv();
344 }
345 SoundManager.ignoreSounds = true;
347 {
348 EClass.ui.ToggleAbility();
349 }
350 SoundManager.ignoreSounds = false;
351 TooltipManager.Instance.HideTooltips(immediate: true);
352 }
353 if ((bool)WidgetSideScreen.Instance)
354 {
356 }
357 EClass.game.isLoading = false;
358 }
static void ClearTemp()
Definition: GameIO.cs:64
static Game LoadGame(string id, string root, bool cloud)
Definition: GameIO.cs:153
void Kill()
Definition: Game.cs:1105
bool altInv
Definition: Game.cs:270
void OnLoad()
Definition: Game.cs:360
bool layerAbility
Definition: Player.cs:35
bool layerInventory
Definition: Player.cs:33
Pref pref
Definition: Player.cs:1013
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 741 of file Game.cs.

742 {
743 Player.seedHallucination = 0;
744 }

Referenced by Load().

◆ OnBeforeSave()

void Game.OnBeforeSave ( )
inline

Definition at line 1091 of file Game.cs.

1092 {
1093 foreach (Zone zone in spatials.Zones)
1094 {
1095 zone.OnBeforeSave();
1096 }
1098 foreach (Spatial item in spatials.listDestryoed)
1099 {
1100 item.DeleteMapRecursive();
1101 }
1102 spatials.listDestryoed.Clear();
1103 }
void OnBeforeSave()
Definition: Player.cs:1458
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 1152 of file Game.cs.

1153 {
1154 Debug.Log("#io game OnDeserializing");
1155 Instance = this;
1156 }

References Debug.

◆ OnGameInstantiated()

void Game.OnGameInstantiated ( )
inline

Definition at line 746 of file Game.cs.

747 {
748 HotItemHeld.taskBuild = null;
749 InvOwner.Trader = (InvOwner.Main = null);
750 LayerDrama.currentQuest = null;
751 ContentGallery.lastPage = 0;
752 ContentGallery.listMode = false;
753 if (!Application.isEditor || !EClass.debug.enable)
754 {
756 }
757 foreach (Chara value in cards.globalCharas.Values)
758 {
759 if (value.uid == player.uidChara)
760 {
761 player.chara = value;
762 break;
763 }
764 }
766 EClass.ui.widgets.OnGameInstantiated();
767 EClass.Sound.ResetPlaylist();
768 EClass.core.config.ApplyFPS(force: true);
769 }
static void OnGameInstantiated()
Definition: ActionMode.cs:247
GlobalCharaList globalCharas
Definition: CardManager.cs:46
int uid
Definition: Card.cs:123
void ApplyFPS(bool force=false)
Definition: CoreConfig.cs:841
bool enable
Definition: CoreDebug.cs:286
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:869
static void BuildList()

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

361 {
362 domains.OnLoad();
365 world._OnLoad();
366 player.OnLoad();
368 {
369 EClass.pc.party.members.ForEach(delegate(Chara c)
370 {
371 c.currentZone = EClass.pc.homeZone;
372 c.global.transition = new ZoneTransition
373 {
374 state = ZoneTransition.EnterState.Return
375 };
376 });
377 }
378 player.zone = EClass.pc.currentZone;
379 EClass.pc.currentZone.lastActive = world.date.GetRaw();
380 if (spatials.Find("somewhere") == null)
381 {
382 SpatialGen.Create("somewhere", world.region, register: true);
383 }
384 EClass.pc.homeZone.isKnown = true;
387 foreach (Thing item in EClass.pc.things.List((Thing t) => t.Num <= 0 || t.isDestroyed))
388 {
389 item.parent.RemoveCard(item);
390 }
391 foreach (Thing item2 in EClass.pc.things.List((Thing t) => t.trait is TraitChestMerchant))
392 {
393 item2.Destroy();
394 }
395 foreach (Thing item3 in EClass.pc.things.List((Thing t) => t.invY == 1 && t.invX == -1))
396 {
397 item3.invY = 0;
398 }
399 foreach (Chara value in EClass.game.cards.globalCharas.Values)
400 {
401 if (value.id == "demitas" && value.faction.id == "wilds")
402 {
404 }
405 if (value.memberType == FactionMemberType.Livestock && !value.IsPCFaction)
406 {
407 value.memberType = FactionMemberType.Default;
408 }
409 if (!value.isDyed && value.HasTag(CTAG.random_color))
410 {
411 value.DyeRandom();
412 }
413 }
414 foreach (FactionBranch child in EClass.pc.faction.GetChildren())
415 {
416 foreach (Chara member in child.members)
417 {
418 if (!member.isDead && (member.currentZone == null || member.currentZone.id == "somewhere"))
419 {
420 Debug.Log("exception: Moving invalid chara: " + member.Name + "/" + member.currentZone?.ToString() + "/" + member.homeBranch?.ToString() + "/" + member.faction);
421 member.MoveZone(child.owner, ZoneTransition.EnterState.RandomVisit);
422 }
423 member.RefreshWorkElements(child.owner.elements);
424 member.Refresh();
425 }
426 }
427 EClass.pc.angle = player.angle;
429 if (cards.listAdv.Count == 0)
430 {
432 }
433 quests.list.ForeachReverse(delegate(Quest q)
434 {
435 if (!(q is QuestRandom))
436 {
437 foreach (Quest item4 in quests.list)
438 {
439 if (q != item4 && item4.id == q.id)
440 {
441 quests.list.Remove(item4);
442 break;
443 }
444 }
445 }
446 });
447 quests.globalList.ForeachReverse(delegate(Quest q)
448 {
449 if (!(q is QuestRandom))
450 {
451 foreach (Quest global in quests.globalList)
452 {
453 if (q != global && global.id == q.id)
454 {
455 quests.globalList.Remove(global);
456 break;
457 }
458 }
459 }
460 });
461 TryAddQuest("into_darkness", "exile_kettle");
462 if (version.IsBelow(0, 23, 221) && EClass.game.quests.IsCompleted("curry"))
463 {
465 }
466 if (version.IsBelow(0, 23, 185))
467 {
468 player.resetPrincipal = true;
469 }
470 if (version.IsBelow(0, 23, 182))
471 {
472 foreach (Chara value2 in cards.globalCharas.Values)
473 {
474 if (!value2.IsUnique && value2.c_lockedAge != 0)
475 {
476 value2.elements.SetBase(1243, 1);
477 }
478 }
479 }
480 if (version.IsBelow(0, 23, 155))
481 {
482 AddAdventurer("adv_yukiimo");
483 }
484 if (version.IsBelow(0, 23, 100))
485 {
486 int num = player.recipes.knownRecipes.TryGetValue("trainingDummy_heavy", 0);
487 if (num != 0)
488 {
489 player.recipes.knownRecipes["trainingDummy_heavy1"] = num;
490 }
491 }
492 if (version.IsBelow(0, 23, 96))
493 {
494 EClass.game.principal = IO.DeepCopy(EClass.setting.start.principals[0]);
495 }
497 {
499 EClass.game.principal.id = -1;
500 EClass.game.principal.permadeath = gameDifficultySetting.deleteGameOnDeath;
501 EClass.game.principal.disableManualSave = !gameDifficultySetting.allowManualSave;
502 EClass.core.actionsNextFrame.Add(delegate
503 {
504 EClass.ui.AddLayer<LayerWorldSetting>();
505 });
506 }
507 if (version.IsBelow(0, 23, 93))
508 {
510 Debug.Log("■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■feafefaeffaeaffeaaeaefseasfaefaef");
511 while (TryAddRecipe())
512 {
513 }
514 }
515 if (version.IsBelow(0, 23, 72))
516 {
517 foreach (Chara value3 in EClass.game.cards.globalCharas.Values)
518 {
519 if (!value3.isDead)
520 {
521 value3.c_wasInPcParty = false;
522 }
523 }
524 }
525 if (version.IsBelow(0, 23, 59))
526 {
527 while (TryDestroy())
528 {
529 }
530 }
532 {
533 world.SendPackage(ThingGen.CreateParcel(null, ThingGen.Create("bone_duponne")));
534 }
535 if (version.IsBelow(0, 23, 195))
536 {
537 Zone zone = spatials.Find("startVillage2");
538 if (zone != null && zone.visitCount > 0)
539 {
541 }
542 }
543 if (version.IsBelow(0, 23, 52))
544 {
545 player.flags.toggleHotbarHighlightActivated = true;
546 }
547 if (version.IsBelow(0, 23, 51))
548 {
549 foreach (Chara value4 in EClass.game.cards.globalCharas.Values)
550 {
551 if (!(value4.id != "adv") && value4.IsPCFaction)
552 {
553 value4.idSkin = value4.uid % (value4.source._tiles.Length - 4) / 2 * 2 + ((!value4.IsMale) ? 1 : 0);
554 }
555 }
556 }
557 if (version.IsBelow(0, 22, 91))
558 {
559 TryAddQuestIfActive("demitas_spellwriter", "into_darkness");
560 }
561 if (version.IsBelow(0, 22, 86))
562 {
563 Chara chara = cards.globalCharas.Find("demitas");
564 if (chara != null && chara._works != null && chara._works.Count > 0)
565 {
566 chara._works[0] = 51;
567 }
568 }
569 if (version.IsBelow(0, 22, 86))
570 {
571 TryAddQuest("farris_tulip", "greatDebt");
572 }
573 if (version.IsBelow(0, 22, 86))
574 {
575 TryAddQuest("exile_whisper", "exile_kettle");
576 }
577 if (version.IsBelow(0, 22, 85))
578 {
579 TryAddQuest("exile_meet", "pre_debt");
580 }
581 if (version.IsBelow(0, 22, 60) && EClass.game.quests.Get<QuestDebt>() != null)
582 {
583 Chara chara2 = cards.globalCharas.Find("loytel");
584 Debug.Log("Loytelfix: " + chara2.homeZone);
585 if (chara2.homeZone == null || !chara2.homeZone.IsPCFaction)
586 {
588 chara2.homeZone = EClass.pc.homeBranch.owner;
589 chara2.RemoveEditorTag(EditorTag.Invulnerable);
590 }
591 }
592 if (version.IsBelow(0, 22, 52) && quests.completedIDs.Contains("vernis_gold"))
593 {
594 quests.Add("pre_debt", "farris");
595 }
596 if (quests.completedIDs.Contains("farris_tulip"))
597 {
598 quests.globalList.ForeachReverse(delegate(Quest q)
599 {
600 if (q.id == "farris_tulip")
601 {
602 quests.globalList.Remove(q);
603 }
604 });
605 }
606 quests.list.ForeachReverse(delegate(Quest q)
607 {
608 if (q is QuestDialog && quests.completedIDs.Contains(q.id))
609 {
610 quests.list.Remove(q);
611 }
612 });
613 if (version.IsBelow(0, 22, 20))
614 {
615 foreach (Chara value5 in cards.globalCharas.Values)
616 {
617 value5.SetBool(18, enable: false);
618 }
619 }
620 if (version.IsBelow(0, 22, 22))
621 {
622 if (EClass.pc.faithElements != null)
623 {
625 }
626 foreach (Element item5 in EClass.pc.elements.ListElements((Element e) => e.source.categorySub == "god"))
627 {
628 EClass.pc.SetFeat(item5.id, 0);
629 }
631 }
632 if (version.IsBelow(0, 22, 45))
633 {
634 player.debt = 20000000;
635 }
637 {
639 }
640 if (cards.container_deposit == null)
641 {
642 cards.container_deposit = ThingGen.Create("container_deposit");
643 if (player.bankMoney > 0)
644 {
646 }
647 }
648 foreach (Quest item6 in quests.list)
649 {
650 if (item6 is QuestSequence && !EClass.sources.quests.map.ContainsKey(item6.idSource))
651 {
652 item6.phase = 0;
653 }
654 }
655 foreach (Quest global2 in quests.globalList)
656 {
657 if (global2 is QuestSequence && !EClass.sources.quests.map.ContainsKey(global2.idSource))
658 {
659 global2.phase = 0;
660 }
661 }
662 foreach (KeyValuePair<int, Spatial> item7 in EClass.game.spatials.map.ToList())
663 {
664 if (item7.Value == null)
665 {
666 EClass.game.spatials.map.Remove(item7.Key);
667 }
668 }
669 void TryAddQuest(string idQuest, string idReqQuest)
670 {
671 if (quests.completedIDs.Contains(idReqQuest) && !quests.completedIDs.Contains(idQuest) && quests.GetGlobal(idQuest) == null && quests.Get(idQuest) == null)
672 {
673 quests.Add(idQuest);
674 }
675 }
676 void TryAddQuestIfActive(string idQuest, string idReqQuest)
677 {
678 if (quests.Get(idReqQuest) != null && !quests.completedIDs.Contains(idQuest) && quests.GetGlobal(idQuest) == null && quests.Get(idQuest) == null)
679 {
680 quests.Add(idQuest);
681 }
682 }
683 bool TryAddRecipe()
684 {
685 foreach (string key in player.recipes.knownRecipes.Keys)
686 {
687 if (key.Length > 1 && key[0] == 'b')
688 {
689 RecipeSource recipeSource = RecipeManager.Get(key + "-p");
690 if (recipeSource != null && !player.recipes.knownRecipes.ContainsKey(recipeSource.id))
691 {
692 Debug.Log(recipeSource.id);
693 player.recipes.Add(recipeSource.id, showEffect: false);
694 return true;
695 }
696 recipeSource = RecipeManager.Get(key.Replace("-p", ""));
697 if (recipeSource != null && !player.recipes.knownRecipes.ContainsKey(recipeSource.id))
698 {
699 Debug.Log(recipeSource.id);
700 player.recipes.Add(recipeSource.id, showEffect: false);
701 return true;
702 }
703 }
704 }
705 return false;
706 }
707 static bool TryDestroy()
708 {
709 for (int i = 0; i < EClass.pc.party.members.Count; i++)
710 {
711 Chara chara3 = EClass.pc.party.members[i];
712 Debug.Log(chara3.id + "/" + chara3.uid + "/" + chara3._cints[1]);
713 for (int j = 0; j < EClass.pc.party.members.Count; j++)
714 {
715 Chara chara4 = EClass.pc.party.members[j];
716 if (i != j && chara3.uid == chara4.uid)
717 {
718 EClass.pc.party.uidMembers.RemoveAt(j);
719 EClass.pc.party.members.RemoveAt(j);
720 chara4.Destroy();
721 Debug.Log("Destroyed");
722 return true;
723 }
724 }
725 }
726 return false;
727 }
728 }
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
Chara Find(string id)
Definition: CardManager.cs:20
Thing container_deposit
Definition: CardManager.cs:58
int c_lockedAge
Definition: Card.cs:1354
bool isDestroyed
Definition: Card.cs:76
void RemoveEditorTag(EditorTag tag)
Definition: Card.cs:2613
ElementContainerCard elements
Definition: Card.cs:42
string id
Definition: Card.cs:36
bool IsUnique
Definition: Card.cs:2092
int invY
Definition: Card.cs:1956
bool IsMale
Definition: Card.cs:2387
string Name
Definition: Card.cs:2140
bool HasTag(CTAG tag)
Definition: Card.cs:2598
void DyeRandom()
Definition: Card.cs:6147
Trait trait
Definition: Card.cs:54
bool isDyed
Definition: Card.cs:459
void Destroy()
Definition: Card.cs:5103
ThingContainer things
Definition: Card.cs:39
int invX
Definition: Card.cs:1944
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3100
int Num
Definition: Card.cs:159
void Refresh(bool calledRecursive=false)
Definition: Chara.cs:1747
int[] _cints
Definition: Chara.cs:82
void RefreshWorkElements(ElementContainer parent=null)
Definition: Chara.cs:9023
Faction faction
Definition: Chara.cs:429
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9902
Party party
Definition: Chara.cs:43
override bool IsPCFaction
Definition: Chara.cs:673
FactionMemberType memberType
Definition: Chara.cs:46
Zone homeZone
Definition: Chara.cs:269
void RefreshFaithElement()
Definition: Chara.cs:10216
ElementContainer faithElements
Definition: Chara.cs:38
FactionBranch homeBranch
Definition: Chara.cs:1068
bool isDead
Definition: Chara.cs:391
List< int > _works
Definition: Chara.cs:52
void MoveZone(string alias)
Definition: Chara.cs:3331
void OnLoad()
Definition: CoreDebug.cs:710
int GetRaw(int offsetHours=0)
Definition: Date.cs:326
static SourceManager sources
Definition: EClass.cs:43
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:255
SourceElement.Row source
Definition: ELEMENT.cs:278
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:958
void AddAdventurer(string id, Zone z=null)
Definition: Game.cs:985
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:1097
float angle
Definition: Player.cs:971
bool resetPrincipal
Definition: Player.cs:1177
void OnLoad()
Definition: Player.cs:1434
int bankMoney
Definition: Player.cs:914
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
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:677
bool destryoed
Definition: Spatial.cs:45
string id
Definition: Spatial.cs:13
int visitCount
Definition: Spatial.cs:154
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)
void RefreshGridRecursive()
static Thing CreateParcel(string idLang=null, params Thing[] things)
Definition: ThingGen.cs:42
static Thing CreateCassette(int id)
Definition: ThingGen.cs:230
Definition: Thing.cs:8
GameDate date
Definition: World.cs:6
void SendPackage(Thing p)
Definition: World.cs:68
override string ToString()
Definition: Zone.cs:552
ElementContainerZone elements
Definition: Zone.cs:43
bool IsPCFaction
Definition: Zone.cs:473
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 1146 of file Game.cs.

1147 {
1148 Debug.Log("#io game OnSerializing");
1149 }

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:436
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:1016

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

1128 {
1129 isPaused = true;
1130 LayerPause layerPause = EClass.ui.AddLayer<LayerPause>();
1131 Game lastGame = EClass.game;
1132 if (onUnpause == null)
1133 {
1134 return;
1135 }
1136 layerPause.SetOnKill(delegate
1137 {
1138 if (EClass.core.IsGameStarted && lastGame == EClass.game)
1139 {
1140 onUnpause();
1141 }
1142 });
1143 }
static bool isPaused
Definition: Game.cs:150
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 1024 of file Game.cs.

1025 {
1026 Dialog.YesNo("dialog_quit", delegate
1027 {
1028 if (EClass.game.Save())
1029 {
1030 EClass.core.Quit();
1031 }
1032 });
1033 }

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

1036 {
1037 if (EClass.ui.IsDragging)
1038 {
1039 EClass.ui.EndDrag(canceled: true);
1040 }
1041 if (isAutoSave && EClass.debug.ignoreAutoSave)
1042 {
1043 return true;
1044 }
1045 bool flag = EClass.core.config.game.autoBackup && backupTime >= (double)(EClass.core.config.game.backupInterval * 60 * 30);
1046 if (flag)
1047 {
1048 backupTime = 0.0;
1049 }
1051 countLoadedMaps = 0;
1052 player.pref.layerInventory = EClass.ui.layerFloat.GetLayer<LayerInventory>();
1054 {
1055 player.pref.layerAbility = EClass.ui.layerFloat.GetLayer<LayerAbility>();
1056 }
1057 player.pref.layerCraft = EClass.ui.layerFloat.GetLayer<LayerCraftFloat>();
1058 player.angle = EClass.pc.angle;
1060 EClass.ui.widgets.UpdateConfigs();
1061 GameIndex gameIndex = null;
1062 try
1063 {
1064 OnBeforeSave();
1065 gameIndex = GameIO.SaveGame();
1066 }
1067 catch (Exception ex)
1068 {
1069 EClass.ui.Say(ex.Message);
1070 SE.Beep();
1071 Msg.Say("error_save");
1072 return false;
1073 }
1074 if (flag)
1075 {
1076 GameIO.MakeBackup(gameIndex);
1077 EClass.ui.Say("backupDone");
1078 }
1079 if (!silent)
1080 {
1081 if (!isAutoSave)
1082 {
1083 SE.WriteJournal();
1084 }
1085 Msg.Say("saved");
1086 }
1087 saveCount++;
1088 return true;
1089 }
float angle
Definition: Card.cs:72
new GameConfig game
Definition: CoreConfig.cs:609
void TryUpdatePlayedHour()
Definition: CoreConfig.cs:815
bool ignoreAutoSave
Definition: CoreDebug.cs:126
static GameIndex SaveGame()
Definition: GameIO.cs:82
static void MakeBackup(GameIndex index, string suffix="")
Definition: GameIO.cs:115
int countLoadedMaps
Definition: Game.cs:236
int saveCount
Definition: Game.cs:238
void OnBeforeSave()
Definition: Game.cs:1091
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(), Quit(), Map.Reload(), HotItemContext.Show(), and CoreDebug.UpdateInput().

◆ StartNewGame()

void Game.StartNewGame ( )
inline

Definition at line 803 of file Game.cs.

804 {
805 EClass.pc.homeZone = StartZone;
808 Prologue prologue = EClass.game.Prologue;
809 if (prologue.type == GameType.Survival)
810 {
812 }
813 else
814 {
815 CharaGen.Create("fiama").SetGlobal(EClass.game.StartZone, prologue.posFiama.x, prologue.posFiama.y);
816 CharaGen.Create("ashland").SetGlobal(EClass.game.StartZone, prologue.posAsh.x, prologue.posAsh.y);
817 }
818 if ((bool)LayerTitle.actor)
819 {
820 world.date.hour = EClass.game.Prologue.hour;
822 Player obj = player;
823 Chara chara = EClass.pc;
824 Zone zone2 = (EClass.pc.homeZone = EClass.game.spatials.Find(EClass.game.Prologue.idStartZone));
825 Zone zone4 = (chara.currentZone = zone2);
826 obj.zone = zone4;
827 EClass.pc.global.transition = new ZoneTransition
828 {
829 state = ZoneTransition.EnterState.Exact,
831 z = EClass.game.Prologue.startZ
832 };
833 EClass.pc.hp = EClass.pc.MaxHP;
836 EClass.pc.AddCondition<ConFaint>(200, force: true);
837 }
838 else
839 {
840 EClass.pc.homeZone = EClass.game.spatials.Find(EClass.game.Prologue.idStartZone);
841 Zone zone5 = null;
842 ZoneTransition transition = new ZoneTransition
843 {
844 state = ZoneTransition.EnterState.Auto
845 };
846 Chara c = EClass.game.cards.globalCharas.Find("ashland");
847 switch (EClass.debug.startScene)
848 {
849 case CoreDebug.StartScene.Zone:
851 transition = new ZoneTransition
852 {
853 state = ZoneTransition.EnterState.Exact,
855 z = EClass.game.Prologue.startZ
856 };
857 break;
858 case CoreDebug.StartScene.Home:
859 case CoreDebug.StartScene.Story_Test:
861 transition = new ZoneTransition
862 {
863 state = ZoneTransition.EnterState.Exact,
865 z = EClass.game.Prologue.startZ
866 };
867 break;
868 case CoreDebug.StartScene.Survival:
869 EClass.game.idPrologue = 3;
871 transition = new ZoneTransition
872 {
873 state = ZoneTransition.EnterState.Exact,
875 z = EClass.game.Prologue.startZ
876 };
877 break;
878 case CoreDebug.StartScene.Home_Cave:
879 EClass.game.idPrologue = 2;
881 transition = new ZoneTransition
882 {
883 state = ZoneTransition.EnterState.Exact,
885 z = EClass.game.Prologue.startZ
886 };
887 break;
888 case CoreDebug.StartScene.MeetFarris:
889 {
890 Zone parent4 = EClass.game.spatials.Find("nymelle");
891 zone5 = SpatialGen.Create("nymelle", parent4, register: true) as Zone;
892 zone5.lv = -2;
893 EClass.game.quests.Start("exploration", c, assignQuest: false);
894 break;
895 }
896 case CoreDebug.StartScene.NymelleBoss:
897 {
898 Zone parent3 = EClass.game.spatials.Find("nymelle");
899 zone5 = SpatialGen.Create("nymelle_boss", parent3, register: true) as Zone;
900 zone5.lv = -5;
901 EClass.game.quests.Start("exploration", c, assignQuest: false).ChangePhase(2);
902 break;
903 }
904 case CoreDebug.StartScene.AfterNymelle:
906 transition = new ZoneTransition
907 {
908 state = ZoneTransition.EnterState.Exact,
910 z = EClass.game.Prologue.startZ
911 };
912 EClass.game.quests.Start("exploration", c, assignQuest: false).ChangePhase(5);
913 EClass.game.quests.globalList.Add(Quest.Create("sharedContainer").SetClient(c, assignQuest: false));
914 EClass.game.quests.globalList.Add(Quest.Create("crafter").SetClient(c, assignQuest: false));
915 EClass.game.quests.globalList.Add(Quest.Create("defense").SetClient(c, assignQuest: false));
916 break;
917 case CoreDebug.StartScene.Melilith:
918 {
919 Zone parent2 = EClass.game.spatials.Find("cursed_manor");
920 zone5 = SpatialGen.Create("cursed_manor_dungeon", parent2, register: true) as Zone;
921 zone5.lv = -5;
922 break;
923 }
924 case CoreDebug.StartScene.Tefra:
925 {
926 Zone parent = EClass.game.spatials.Find("vernis");
927 zone5 = SpatialGen.Create("vernis_mine", parent, register: true) as Zone;
928 zone5.lv = -7;
929 break;
930 }
931 }
932 if (zone5 != null)
933 {
934 Player obj2 = player;
935 Chara chara2 = EClass.pc;
936 Zone zone2 = (EClass.pc.homeZone = zone5);
937 Zone zone4 = (chara2.currentZone = zone2);
938 obj2.zone = zone4;
939 EClass.pc.global.transition = transition;
940 }
941 else
942 {
943 Player obj3 = player;
944 Zone zone4 = (EClass.pc.currentZone = EClass.game.spatials.Find(EClass.debug.startZone));
945 obj3.zone = zone4;
946 EClass.pc.global.transition = new ZoneTransition
947 {
948 state = ZoneTransition.EnterState.Return
949 };
950 }
951 }
952 EClass.pc.homeZone.isKnown = true;
955 EClass.scene.Init(Scene.Mode.StartGame);
956 }
GameType
Definition: GameType.cs:2
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9263
Chara SetGlobal(Zone _home, int x, int z)
Definition: Chara.cs:1493
override int MaxHP
Definition: Chara.cs:710
Stats mana
Definition: Chara.cs:1168
Stats stamina
Definition: Chara.cs:1160
string startZone
Definition: CoreDebug.cs:106
StartScene startScene
Definition: CoreDebug.cs:96
SurvivalManager survival
Definition: Game.cs:228
PartyManager parties
Definition: Game.cs:174
Prologue Prologue
Definition: Game.cs:264
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:1383
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
void ChangePhase(int a)
Definition: Quest.cs:577
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, 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:147

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:2146
virtual bool isSynced
Definition: Card.cs:2088
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:344

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(), LayerShippingResult.Awake(), TraitSalesTag.CanTagSale(), ElementContainerFaction.CheckDirty(), SurvivalManager.CheckLoytelDebt(), Faction.CountMembers(), Card.Create(), LayerInventory.CreateContainer(), Card.Destroy(), Chara.Die(), 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(), Zone_Nymelle.OnBeforeSimulate(), QuestDefense.OnChangePhase(), QuestVernis.OnChangePhase(), DramaOutcome.OnClaimLand(), Quest.OnClickQuest(), QuestIntroInspector.OnComplete(), QuestSharedContainer.OnComplete(), TraitDrinkMilkMother.OnDrink(), QuestDialog.OnDropReward(), SurvivalManager.OnExpandFloor(), Zone_DungeonPuppy.OnGenerateMap(), ElementContainerFaction.OnJoinFaith(), ElementContainerFaction.OnLeaveFaith(), ZoneInstanceBout.OnLeaveZone(), ListPeopleRevive.OnList(), OnLoad(), TraitStoryBookHome.OnRead(), QuestDebt.OnStart(), QuestExploration.OnStart(), DramaManager.ParseLine(), InvOwnerDeliver.PayBill(), ActEffect.Proc(), DramaOutcome.QuestExploration_AfterComplete(), DramaOutcome.QuestExploration_AfterCrystal(), CoreDebug.QuickStart(), FactionBranch.ReceivePackages(), WindowChara.RefreshProfile(), LayerQuestBoard.RefreshRanking(), Chara.RemoveGlobal(), FactionBranch.RemoveMemeber(), 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 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

◆ 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()

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

Referenced by InvOwnerDeliver._OnProcess(), ActPlan._Update(), QuestManager.Add(), GameDate.AdvanceDay(), GameDate.AdvanceHour(), 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(), 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.

◆ 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: