21 if (!this.useSubWidgetTheme)
23 return this.mainWidgets;
25 return this.subWidgets;
29 if (this.useSubWidgetTheme)
31 this.subWidgets = value;
34 this.mainWidgets = value;
45 return RefZone.Get(this.uidSpawnZone);
49 this.uidSpawnZone =
RefZone.Set(value);
55 public bool EnableDreamStory
65 public Zone LastTravelZone
69 return RefZone.Get(this.uidLastTravelZone);
79 return RefZone.Get(this.uidLastZone);
95 public int ContainerSearchDistance
99 return 1 +
EClass.pc.elements.GetFeatRef(1643, 0);
109 return Mathf.Min(Mathf.Max(
EClass.pc.CHA / 10, 1), 5) +
EClass.pc.Evalue(1645);
115 public int MaxExpKnowledge
125 public int MaxExpInfluence
135 public bool IsMageGuildMember
139 Quest quest =
EClass.game.quests.Get(
"guild_mage");
140 return quest !=
null && quest.phase >= 10;
146 public bool IsFighterGuildMember
150 Quest quest =
EClass.game.quests.Get(
"guild_fighter");
151 return quest !=
null && quest.phase >= 10;
157 public bool IsThiefGuildMember
161 Quest quest =
EClass.game.quests.Get(
"guild_thief");
162 return quest !=
null && quest.phase >= 10;
168 public bool IsMerchantGuildMember
172 Quest quest =
EClass.game.quests.Get(
"guild_merchant");
173 return quest !=
null && quest.phase >= 10;
179 public bool IsCriminal
188 public void OnCreateGame()
191 this.debt = 20000000;
192 this.chara =
CharaGen.Create(
"chara", -1);
193 this.chara.SetFaction(
EClass.Home);
194 this.chara.things.SetSize(7, 5);
195 this.chara.c_idTone =
"default";
196 this.chara.SetInt(56, 1);
197 this.chara.things.DestroyAll(
null);
198 this.chara.faith =
EClass.game.religions.Eyth;
199 this.chara.RefreshFaithElement();
200 this.uidChara = this.chara.uid;
201 Fav fav = IO.LoadFile<Fav>(CorePath.user +
"PCC/fav" +
EClass.rnd(3).ToString(),
false,
null);
202 this.chara.pccData = IO.Duplicate<PCCData>(fav.data);
203 this.chara._CreateRenderer();
204 this.RefreshDomain();
205 this._agent =
CharaGen.Create(
"chara", -1);
206 this._agent.c_altName =
"stash".lang();
207 EClass.player.title =
"master".lang();
208 this.nums.OnCreateGame();
209 this.hotbars.OnCreateGame();
210 this.baseActTime =
EClass.setting.defaultActPace;
211 this.flags.OnCreateGame();
212 this.sketches.Add(115);
213 this.pref.sort_ascending_shop =
true;
214 this.layerAbilityConfig.hideDepletedSpell =
true;
215 this.layerAbilityConfig.bgAlpha = 70;
216 this.memo =
"memo_blank".lang();
220 public void OnStartNewGame()
222 this.ModKeyItem(
"old_charm", 1,
false);
223 this.ModKeyItem(
"backpack", 1,
false);
224 EClass.player.knownBGMs.Add(1);
225 EClass.player.knownBGMs.Add(3);
226 EClass.player.questTracker =
true;
227 this.trackedCategories.Add(
"food");
228 this.trackedCategories.Add(
"drink");
229 this.trackedCategories.Add(
"resource");
230 EClass.game.quests.Start(
"main",
null,
true);
231 this.chara.hp = this.chara.MaxHP;
232 this.chara.SetFaith(
EClass.game.religions.list[0]);
233 this.chara.elements.SetBase(135, 1, 0);
234 this.chara.elements.SetBase(6003, 1, 0);
235 this.chara.elements.SetBase(6012, 1, 0);
236 this.chara.elements.SetBase(6015, 1, 0);
237 this.chara.elements.SetBase(6050, 1, 0);
238 List<Element> list =
new List<Element>();
243 foreach (
Element element
in list)
245 if (element.Value == 0)
247 EClass.pc.elements.Remove(element.id);
249 else if (element.HasTag(
"primary"))
251 element.vTempPotential = Mathf.Max(30, (element.ValueWithoutLink - 8) * 7);
254 foreach (
BodySlot slot
in this.chara.body.slots)
256 this.chara.body.Unequip(slot,
true);
258 this.chara.things.DestroyAll(
null);
260 this.dateTravel =
EClass.world.date.GetRaw(0);
261 this.uidLastTravelZone =
EClass.pc.currentZone.uid;
262 this.GenerateBackgroundText();
263 if (!
EClass.game.Difficulty.allowRevive)
265 EClass.pc.SetFeat(1220, 1,
false);
267 EClass.pc.elements.CheckSkillActions();
268 EClass.pc.hunger.value = 30;
269 EClass.pc.CalculateMaxStamina();
272 this.isEditor = Application.isEditor;
280 if (this.dataWindow !=
null)
282 Window.dictData = this.dataWindow;
285 if (Application.isEditor &&
EClass.debug.resetPlayerConfig && !
this.isEditor)
288 this.dataWindow.Clear();
291 t.c_windowSaveData =
null;
294 this.isEditor = Application.isEditor;
298 public void OnBeforeSave()
300 foreach (Layer comp
in EClass.ui.layerFloat.layers)
302 foreach (Window window
in comp.GetComponentsInDirectChildren(
true))
304 window.UpdateSaveData();
307 this.dataWindow = Window.dictData;
311 public void OnAdvanceRealHour()
314 Msg.Say(
"time_warn",
Player.realHour.ToString() ??
"",
null,
null,
null);
315 string text =
"time_warn_" +
Player.realHour.ToString();
316 if (LangGame.Has(text))
323 public void RefreshDomain()
325 this.domains.Clear();
326 for (
int i = 0; i <
EClass.pc.job.domain.Length; i += 2)
328 this.domains.Add(
EClass.pc.job.domain[i]);
336 foreach (
int id in this.domains)
338 elementContainer.GetOrCreateElement(
id).vSource = 1;
340 return elementContainer;
344 public Layer SelectDomain(Action onKill =
null)
349 if (row.categorySub ==
"eleAttack" && !row.tag.Contains(
"hidden") && (!row.tag.Contains(
"high") ||
EClass.pc.job.domain.Contains(row.id)))
357 foreach (int num in EClass.player.domains)
366 EClass.player.domains.Remove(s.id);
369 EClass.player.domains.Add(s.id);
370 }, delegate(List<UIList.ButtonPair> list)
372 bool flag = EClass.player.domains.Count >= 3 +
EClass.pc.Evalue(1402);
373 foreach (UIList.ButtonPair buttonPair in list)
375 UIButton button = (buttonPair.component as
ItemGeneral).button1;
379 foreach (
int num
in EClass.player.domains)
386 button.SetCheck(flag3);
387 for (
int i = 0; i < ((EClass.pc.job.id ==
"swordsage") ? 5 : 3); i++)
389 if (
EClass.pc.job.domain[i * 2] == row2.id)
394 button.interactable = (!flag2 && (!flag || flag3));
395 button.GetComponent<CanvasGroup>().enabled = !button.interactable;
397 }).SetOnKill(delegate
399 Action onKill2 = onKill;
409 public void RefreshEmptyAlly()
411 int num = this.MaxAlly - EClass.pc.party.members.Count + 1;
412 if (num != this.lastEmptyAlly)
414 this.lastEmptyAlly = num;
417 chara.RefreshSpeed();
423 public void GenerateBackgroundText()
425 string text = IO.LoadText(
new DirectoryInfo(CorePath.CorePackage.Background).GetFiles(
"*.txt").RandomItem<FileInfo>().FullName);
426 IO.SaveText(
GameIO.pathCurrentSave +
"background.txt", text);
430 public string GetBackgroundText()
432 StringBuilder stringBuilder =
new StringBuilder(IO.LoadText(
GameIO.pathCurrentSave +
"background.txt"));
433 stringBuilder.Replace(
"#name",
EClass.pc.NameSimple);
434 stringBuilder.Replace(
"#aka",
EClass.pc.Aka);
435 stringBuilder.Replace(
"#father",
EClass.pc.bio.nameDad);
436 stringBuilder.Replace(
"#mother",
EClass.pc.bio.nameMom);
437 stringBuilder.Replace(
"#birthloc2",
EClass.pc.bio.nameHome);
438 stringBuilder.Replace(
"#birthloc",
EClass.pc.bio.nameLoc);
439 stringBuilder.Replace(
"#job",
EClass.pc.job.GetName().AddArticle());
440 stringBuilder.Replace(
"#year",
EClass.pc.bio.birthYear.ToString() ??
"");
441 stringBuilder.Replace(
"#month",
EClass.pc.bio.birthMonth.ToString() ??
"");
442 stringBuilder.Replace(
"#day",
EClass.pc.bio.birthDay.ToString() ??
"");
443 stringBuilder.Replace(
"#he", (
EClass.pc.IsMale ?
"he" :
"she").lang());
444 stringBuilder.Replace(
"#his", (
EClass.pc.IsMale ?
"his" :
"her").lang());
445 stringBuilder.Replace(
"#him", (
EClass.pc.IsMale ?
"him" :
"her").lang());
446 string text =
"_period".lang();
447 string[] array = stringBuilder.ToString().Split(text, StringSplitOptions.None);
449 if (array.Length != 0)
451 foreach (
string text3
in array)
453 text2 += text3.ToTitleCase(
false);
454 if (text3 != text && text3 != Environment.NewLine && text3.Length > 2 && text3 != array[array.Length - 1])
460 return text2.TrimEnd(Environment.NewLine.ToCharArray());
464 public void EditBackgroundText()
466 Util.Run(
GameIO.pathCurrentSave +
"background.txt");
470 public void CreateEquip()
473 pc.body.AddBodyPart(45,
null);
476 EClass.pc.EQ_ID(
"lantern_old", -1, Rarity.Random);
478 pc.body.AddBodyPart(44,
null);
479 pc.EQ_ID(
"toolbelt", -1, Rarity.Random).c_IDTState = 0;
480 pc.EQ_ID(
"shirt", -1, Rarity.Random).c_IDTState = 0;
482 string id =
EClass.pc.job.id;
483 if (!(
id ==
"paladin"))
485 if (!(
id ==
"inquisitor"))
487 if (!(
id ==
"witch"))
489 if (
id ==
"swordsage")
491 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(50300, 1), 4));
492 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(50301, 1), 4));
493 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(50802, 1), 2));
494 pc.AddCard(
ThingGen.Create(
"tool_talisman", -1, -1));
499 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(8790, 1), 4));
504 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(8706, 1), 4));
509 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(8400, 1), 2));
512 if (!(
id ==
"wizard") && !(
id ==
"warmage") && !(
id ==
"priest") && !(
id ==
"witch"))
514 pc.AddCard(
ThingGen.Create(
"bandage", -1, -1).SetNum(6 +
EClass.rnd(3)));
518 foreach (
int id2
in EClass.player.domains)
522 foreach (
string text2
in element.source.tag)
528 if (text2 ==
"hand" || text2 ==
"arrow" || text2 ==
"bolt")
535 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(text + element.source.alias.Replace(
"ele",
""), 1), 4));
543 if (
EClass.pc.job.id ==
"priest")
545 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(8400, 1), 2));
548 pc.AddCard(
Player.<CreateEquip>g__SetSpellbook|170_0(
ThingGen.CreateSpellbook(8200, 1), 2));
552 public void DreamSpell()
554 int num =
EClass.pc.Evalue(1653);
555 if (num == 0 &&
EClass.pc.Evalue(1402) == 0 &&
EClass.rnd(4) != 0)
560 foreach (
int id in EClass.player.domains)
564 foreach (
string text
in element.source.tag)
571 if (text ==
"hand" || text ==
"arrow" || text ==
"bolt")
575 if (num >= 3 && (text ==
"ball" || text ==
"weapon" || text ==
"funnel" || text ==
"miasma"))
581 list.Add(
EClass.sources.elements.alias[text +
"_" + element.source.alias.Replace(
"ele",
"")]);
591 int mtp = (num == 0) ? 100 : (75 + num * 25);
592 if (num > 0 || element2 ==
null || element2.vPotential == 0)
594 Msg.Say(
"dream_spell", EClass.sources.elements.alias[row.aliasRef].GetText(
"altname", false).Split(
',', StringSplitOptions.None)[0].ToLower(), null, null, null);
595 EClass.pc.GainAbility(row.id, mtp);
600 public void SimulateFaction()
602 this.simulatingZone =
true;
607 if (factionBranch.owner != currentZone)
610 this.zone = factionBranch.owner;
620 this.zone = currentZone;
622 this.simulatingZone =
false;
626 public void ExitBorder(
ActPlan p =
null)
628 bool flag =
EClass.game.quests.HasFarAwayEscort(
false);
629 string textDialog = (flag ?
"ExitZoneEscort" :
"ExitZone").lang(
EClass._zone.Name,
null,
null,
null,
null);
630 bool flag2 = EClass.pc.pos.x == EClass._map.bounds.x || EClass.pc.pos.x == EClass._map.bounds.x + EClass._map.bounds.Width - 1 || EClass.pc.pos.z == EClass._map.bounds.z || EClass.pc.pos.z == EClass._map.bounds.z + EClass._map.bounds.Height - 1;
631 if (flag ||
EClass.core.config.game.confirmMapExit || (
EClass._zone.instance !=
null &&
EClass._zone.instance.WarnExit))
635 Dialog.YesNo(textDialog, delegate
637 EClass.game.quests.HasFarAwayEscort(
true);
644 p.TrySetAct(
"actNewZone", delegate()
646 Dialog.YesNo(textDialog, delegate
648 EClass.game.quests.HasFarAwayEscort(
true);
650 },
null,
"yes",
"no");
652 }, CursorSystem.MoveZone, flag2 ? 999 : 1);
662 p.TrySetAct(
"actNewZone", delegate()
666 }, CursorSystem.MoveZone, flag2 ? 999 : 1);
672 public bool CanExitBorder(
Point p)
674 return (
EClass._zone !=
EClass.game.StartZone ||
EClass.pc.homeBranch !=
null) && !EClass._zone.BlockBorderExit && (EClass.pc.held ==
null || !
EClass.pc.held.trait.CanOnlyCarry);
678 public void OnExitBorder(
Point p)
680 if (
EClass._zone.ParentZone.IsRegion)
689 else if (p.x > bounds.maxX)
693 else if (p.z < bounds.z)
702 float ratePos = (num == 1 || num == -1) ? ((float)(p.z - bounds.z) / (float)bounds.Height) : ((float)(p.x - bounds.x) / (float)bounds.Width);
709 this.EnterLocalZone(p2, trans,
false);
716 public void EnterLocalZone(
bool encounter =
false)
718 this.EnterLocalZone(
EClass.pc.pos.Copy(),
null, encounter);
724 if (
EClass._zone.IsRegion)
726 p.Set(p.x +
EClass.scene.elomap.minX, p.z +
EClass.scene.elomap.minY);
728 Zone zone =
EClass._zone.Region.GetZoneAt(p.x, p.z);
730 int roadDist =
EClass.scene.elomap.GetRoadDist(p.x, p.z);
731 int num = (EClass.pc.homeBranch ==
null) ? 0 :
EClass.pc.pos.Distance(
EClass.game.StartZone.mapX,
EClass.game.StartZone.mapY);
734 if (!
EClass._zone.Region.CanCreateZone(p))
736 Msg.Say(
"zoneBlocked");
739 int num2 = Mathf.Clamp(roadDist - 4, 0, 200) + Mathf.Clamp(num / 4, 0, 10);
742 num2 += roadDist - 20;
748 Debug.Log(
string.Concat(
new string[]
750 "encounter roadiDist:",
757 zone =
EClass._zone.Region.CreateZone(p);
758 zone._dangerLv = num2;
759 enemies = 2 + Mathf.Min(num2 / 10, 4) +
EClass.rnd(3 + Mathf.Min(num2 / 10, 4));
767 if (zone is
Zone_Void &&
EClass.player.CountKeyItem(
"license_void") == 0)
769 Msg.Say(
"voidClosed");
774 Msg.Say(
"zoneClosed");
779 Msg.Say(
"zoneNoEntrance");
785 ZoneTransition.EnterState state = encounter ? ZoneTransition.EnterState.Encounter : ((zone.RegionEnterState ==
ZoneTransition.EnterState.Dir) ?
ZoneTransition.DirToState(
EClass.pc.GetCurrentDir()) : zone.RegionEnterState);
791 EClass.pc.MoveZone(zone, trans);
803 public void MoveZone(
Zone z)
805 CursorSystem.ignoreCount = 15;
806 EClass.ui.hud.transRight.SetActive(
false);
808 if (this.zone.IsRegion)
810 this.dateTravel =
EClass.world.date.GetRaw(0);
825 if (
EClass.pc.currentZone ==
this.zone && !
this.zone.IsRegion &&
this.LastTravelZone !=
this.zone)
827 if (this.LastTravelZone !=
null)
829 int num =
EClass.world.date.GetElapsedHour(this.dateTravel);
831 if (this.distanceTravel > 2)
834 Msg.Say(
"travel", this.LastTravelZone.Name,
Date.GetText(
this.dateTravel,
Date.TextFormat.Travel), num2.ToString() ??
"", num.ToString() ??
"");
835 Msg.Say(
"travel2", this.distanceTravel.ToString() ??
"", ((
EClass.pc.party.members.Count == 1) ?
"you" :
"youAndCompanion").lang(),
null,
null);
838 chara.AddExp(this.distanceTravel / 3);
839 chara.elements.ModExp(240, 30 + this.distanceTravel * 5,
false);
843 this.distanceTravel = 0;
844 this.dateTravel =
EClass.world.date.GetRaw(0);
845 this.uidLastTravelZone = this.zone.uid;
847 this.regionMoveWarned =
false;
851 public void AddInventory(
Card c)
857 public void EndTurn(
bool consume =
true)
865 EInput.Consume(
false, 1);
868 EClass.player.baseActTime =
EClass.setting.defaultActPace;
872 public void ModFame(
int a)
878 if (a >= 0 && this.fame + a >= 5000 &&
EClass.player.CountKeyItem(
"license_adv") == 0)
880 a = 5000 - this.fame;
884 Msg.Say(
"gainFameLimit");
895 Msg.Say(
"gainFame", a.ToString() ??
"",
null,
null,
null);
899 Msg.Say(
"looseFame", (-a).ToString() ??
"",
null,
null,
null);
908 public void ModKeyItem(
string alias,
int num = 1,
bool msg =
true)
910 this.ModKeyItem(
EClass.sources.keyItems.alias[alias].id, num, msg);
914 public void ModKeyItem(
int id,
int num = 1,
bool msg =
true)
916 if (!this.keyItems.ContainsKey(
id))
918 this.keyItems.Add(
id, 0);
920 Dictionary<int, int> dictionary = this.keyItems;
921 dictionary[id] += num;
927 Msg.Say(
"get_keyItem",
EClass.sources.keyItems.map[
id].GetName(),
null,
null,
null);
930 SE.Play(
"keyitem_lose");
931 Msg.Say(
"lose_keyItem",
EClass.sources.keyItems.map[
id].GetName(),
null,
null,
null);
936 public int CountKeyItem(
string alias)
938 return this.CountKeyItem(
EClass.sources.keyItems.alias[alias].id);
942 public int CountKeyItem(
int id)
944 if (!this.keyItems.ContainsKey(
id))
948 return this.keyItems[id];
952 public void EquipTool(
Thing a,
bool setHotItem =
true)
954 if (a.GetRootCard() !=
EClass.pc)
956 if (a.parent is
Thing)
958 Msg.Say(
"movedToEquip", a, a.parent as
Thing,
null,
null);
960 a =
EClass.pc.AddThing(a,
true, -1, -1);
964 EClass.player.SetCurrentHotItem(a.trait.GetHotItem());
970 public void RefreshCurrentHotItem()
973 if (this.currentHotItem !=
null)
975 instance.buttonHotItem.Refresh();
976 if (this.currentHotItem is
HotItemHeld && this.currentHotItem.Thing !=
EClass.pc.held)
978 this.currentHotItem =
null;
980 else if (this.currentHotItem is
HotItemThing && (this.currentHotItem.Thing ==
null ||
this.currentHotItem.Thing.GetRootCard() !=
EClass.pc))
982 this.currentHotItem =
null;
985 if (
EClass.pc.held !=
null)
989 if (this.currentHotItem ==
null)
991 if (instance.selected != -1 && instance.selectedButton.card !=
null && instance.selectedButton.card.GetRootCard() ==
EClass.pc)
993 this.currentHotItem = instance.selectedButton.card.trait.GetHotItem();
997 this.currentHotItem = this.hotItemNoItem;
1000 if (this.currentHotItem != this.lastHotItem)
1002 if (this.lastHotItem !=
null)
1004 this.lastHotItem.OnUnsetCurrentItem();
1006 this.currentHotItem.OnSetCurrentItem();
1007 this.lastHotItem = this.currentHotItem;
1010 WidgetHotbar.dirtyCurrentItem =
false;
1011 this.MarkMapHighlights();
1012 EClass.core.actionsNextFrame.Add(delegate
1014 EClass.core.actionsNextFrame.Add(delegate
1018 layerInventory.invs[0].RefreshHighlight();
1022 EClass.pc.RecalculateFOV();
1026 public void ResetCurrentHotItem()
1028 EClass.pc.PickHeld(
false);
1029 EClass.player.SetCurrentHotItem(
null);
1034 public void SetCurrentHotItem(
HotItem item)
1036 EClass.pc.PickHeld(
false);
1037 if (this.currentHotItem != item)
1039 this.currentHotItem = item;
1041 if (hotItemHeld !=
null)
1043 EClass.pc.HoldCard(hotItemHeld.Thing, -1);
1046 this.RefreshCurrentHotItem();
1056 Thing thing2 = thing.things.Find((
Thing t) => ranged.IsAmmo(t),
true);
1062 return EClass.pc.things.Find((
Thing t) => ranged.IsAmmo(t),
true);
1066 public void TryEquipBait()
1068 if (this.eqBait !=
null && this.eqBait.GetRootCard() !=
EClass.pc)
1072 if (this.eqBait ==
null)
1077 thing.trait.OnUse(
EClass.pc);
1083 public bool HasValidRangedTarget()
1085 return this.target !=
null && this.target.IsAliveInCurrentZone && this.target.isSynced &&
EClass.pc.CanSee(this.target);
1089 public bool TargetRanged()
1094 Trait trait = thing.trait;
1096 int num = 999999999;
1099 List<Chara> list =
new List<Chara>();
1101 if (EInput.isShiftDown && pos.IsValid && pos.HasChara)
1105 if (chara2.isSynced && chara2.IsAliveInCurrentZone && !chara2.IsPC && chara2.pos.Equals(pos) &&
EClass.pc.CanSeeLos(chara2.pos, -1))
1112 chara = list.NextItem(
EClass.player.target);
1122 if (chara3.isSynced && chara3.IsAliveInCurrentZone && !chara3.IsPC &&
EClass.pc.CanSeeLos(chara3.pos, -1) &&
EClass.pc.CanSee(chara3) && !chara3.IsFriendOrAbove())
1124 if (chara3.IsNeutralOrAbove())
1128 num2 +=
EClass.pc.Dist(chara3);
1137 if (EInput.isShiftDown)
1139 chara = list.NextItem(
EClass.player.target);
1144 if (this.target !=
null)
1146 Msg.Say(
"noTargetFound");
1151 if (this.target != chara)
1153 Msg.Say(
"targetSet", chara,
null,
null,
null);
1155 this.target = chara;
1160 public void OnAdvanceHour()
1162 EClass.pc.faith.OnChangeHour();
1163 if (
EClass.pc.Evalue(289) > 0)
1165 foreach (
Thing t2
in EClass.pc.things.List((
Thing t) => t.c_IDTState == 5,
true))
1167 EClass.pc.TryIdentify(t2, 1,
true);
1180 public void OnAdvanceDay()
1182 this.nums.OnAdvanceDay();
1184 int c_daysWithGod = pc.c_daysWithGod;
1185 pc.c_daysWithGod = c_daysWithGod + 1;
1186 if (
EClass.pc.Evalue(85) > 0)
1188 EClass.pc.ModExp(85, 10);
1190 EClass.pc.RefreshFaithElement();
1191 this.prayed =
false;
1192 if (this.karma < 0 &&
EClass.rnd(4) == 0)
1199 public bool TryAbortAutoCombat()
1211 public void ClearMapHighlights()
1213 foreach (
Point point
in this.lastMarkedHighlights)
1215 point.cell.highlight = 0;
1217 this.lastMarkedHighlights.Clear();
1221 public void MarkMapHighlights()
1223 this.ClearMapHighlights();
1224 if (
EClass.game.config.highlightAct)
1226 this.currentHotItem.OnMarkMapHighlights();
1231 public bool CanAcceptInput()
1233 return EClass.pc.HasNoGoal && !
EClass.pc.WillConsumeTurn();
1237 public bool CanSee(
Chara c)
1239 if (
EClass.pc.hasTelepathy && c.race.visibleWithTelepathy)
1243 if (!c.IsPC && (
EClass.pc.fov ==
null ||
EClass.pc.isBlind))
1247 if (c.IsPCParty || c.isDead)
1253 bool canSee =
false;
1254 int dist =
EClass.pc.Dist(c);
1255 c.ForeachPoint(delegate(
Point p,
bool main)
1257 if (!canSee && (p.cell.light > 0 || dist < 2) && p.cell.pcSync)
1264 return (c.pos.cell.light > 0 ||
EClass.pc.Dist(c) < 2) && c.pos.cell.pcSync;
1268 public void AddExpKnowledge(
int a)
1270 this.expKnowledge += a;
1271 if (this.expKnowledge >= this.MaxExpKnowledge)
1273 for (
int i = 0; i < this.expKnowledge / this.MaxExpKnowledge; i++)
1275 Player.<AddExpKnowledge>g__LvUp|201_0();
1277 this.expKnowledge %= this.MaxExpKnowledge;
1282 public void AddExpInfluence(
int a)
1284 this.expInfluence += a;
1285 if (this.expInfluence >= this.MaxExpInfluence)
1287 for (
int i = 0; i < this.expInfluence / this.MaxExpInfluence; i++)
1289 Player.<AddExpInfluence>g__LvUp|202_0();
1291 this.expInfluence %= this.MaxExpInfluence;
1296 public void ModKarma(
int a)
1306 bool flag = this.karma < 0;
1308 Msg.Say((a > 0) ?
"karmaUp" :
"karmaDown", a.ToString() ??
"",
null,
null,
null);
1309 if (this.karma < 0 && !flag)
1311 Msg.Say(
"becomeCriminal");
1312 EClass.pc.pos.TryWitnessCrime(
EClass.pc,
null, 4,
null);
1313 EClass._zone.RefreshCriminal();
1314 Tutorial.Reserve(
"criminal",
null);
1316 if (this.karma >= 0 && flag)
1318 Msg.Say(
"becomeNonCriminal");
1319 EClass._zone.RefreshCriminal();
1321 EClass.game.quests.list.ForeachReverse(delegate(
Quest q)
1325 this.karma = Mathf.Clamp(this.karma, -100, 100);
1329 public Thing DropReward(
Thing t,
bool silent =
false)
1331 t.things.DestroyAll(
null);
1335 Msg.Say(
"dropReward");
1341 public bool TooHeavyToMove()
1343 if (!
EClass.debug.ignoreWeight &&
EClass.pc.burden.GetPhase() == 4)
1345 Msg.Say(
"tooHeavyToMove");
1346 EClass.pc.renderer.NextFrame();
1347 EInput.Consume(
true, 1);
1355 internal static Thing <CreateEquip>g__SetSpellbook|170_0(
Thing t,
int charge)
1357 t.AddEditorTag(EditorTag.NoReadFail);
1358 t.c_charges = charge;
1359 t.SetBlessedState(BlessedState.Normal);
1365 internal static void <AddExpKnowledge>g__LvUp|201_0()
1367 Msg.Say(
"DingKnowledge");
1372 internal static void <AddExpInfluence>g__LvUp|202_0()
1374 Msg.Say(
"DingInfluence");
1383 public int uidChara;
1387 public int uidSpawnZone;
1391 public int tutorialStep;
1403 public int expKnowledge;
1407 public int expInfluence;
1411 public int dateTravel;
1415 public int distanceTravel;
1419 public int uidLastTravelZone;
1423 public int uidLastZone;
1427 public int uidLastShippedZone;
1431 public int totalFeat;
1435 public int taxBills;
1439 public int unpaidBill;
1443 public int bankMoney;
1447 public int holyWell;
1451 public int safeTravel;
1455 public int hotbarPage;
1459 public int little_dead;
1463 public int little_saved;
1467 public int extraTax;
1471 public int lastFelmeraReward;
1475 public int uidLastTown;
1479 public int seedShrine;
1483 public int seedChest;
1495 public bool hasNewQuest;
1499 public bool dailyGacha;
1503 public bool useSubWidgetTheme;
1507 public bool wellWished;
1515 public bool questTracker;
1519 public bool showShippingResult;
1523 public bool isEditor;
1527 public string title;
1531 public string memo =
"";
1567 public Dictionary<string, int> dialogFlags =
new Dictionary<string, int>();
1571 public Dictionary<string, string> hangIcons =
new Dictionary<string, string>();
1575 public Dictionary<string, KnownSong> knownSongs =
new Dictionary<string, KnownSong>();
1579 public HashSet<string> trackedCategories =
new HashSet<string>();
1583 public HashSet<string> trackedCards =
new HashSet<string>();
1587 public HashSet<int> trackedElements =
new HashSet<int>();
1591 public HashSet<int> knownBGMs =
new HashSet<int>();
1595 public HashSet<int> favAbility =
new HashSet<int>();
1599 public HashSet<int> sketches =
new HashSet<int>();
1603 public HashSet<int> doneBackers =
new HashSet<int>();
1607 public HashSet<int> knownCraft =
new HashSet<int>();
1611 public List<int> domains =
new List<int>();
1623 public Chara _agent;
1643 public Point lastZonePos;
1647 public Thing eqBait;
1651 public Dictionary<string, Window.SaveData> dataWindow;
1663 public Dictionary<int, int> keyItems =
new Dictionary<int, int>();
1667 public List<int> uidPickOnLoad =
new List<int>();
1671 public List<ShippingResult> shippingResults =
new List<ShippingResult>();
1675 public Dictionary<string, HashSet<string>> noRestocks =
new Dictionary<string, HashSet<string>>();
1679 public Window.SaveData windowAllyInv;
1682 public static int seedHallucination;
1685 public static int realHour;
1691 public List<Point> lastMarkedHighlights =
new List<Point>();
1697 public HotItem hotItemToRestore;
1700 public bool forceTalk;
1703 public bool altHeldPos;
1706 public bool instaComplete =
true;
1709 public bool regionMoveWarned;
1712 public bool waitingInput;
1715 public bool willEndTurn;
1718 public bool wasDirtyWeight;
1721 public bool deathDialog;
1724 public bool preventDeathPenalty;
1727 public bool deathZoneMove;
1730 public bool haltMove;
1733 public bool invlunerable;
1736 public bool willAutoSave;
1739 public bool simulatingZone;
1742 public bool isAutoFarming;
1745 public bool enemySpotted;
1748 public string deathMsg;
1751 public int countNewline;
1754 public int lightRadius;
1757 public int lastTurn;
1760 public int lastEmptyAlly;
1763 public float lightPower;
1766 public float baseActTime;
1769 public float pickupDelay = 2f;
1775 public Chara focusedchara;
1787 public Vector2 nextMove;
1790 public Vector3 position;
1793 public Action onStartZone;
1799 public List<Chara> listSummon =
new List<Chara>();
1802 public int tempFame;
1805 public int autoCombatStartHP;
1808 public Zone nextZone;
1811 public Thing renderThing;
1817 public Chara target;
1832 public bool askDest;
1840 public string lastBuildCategory;
1844 public string lastBuildRecipe;
1847 public int lastIdTabAbility;
1850 public bool layerInventory;
1853 public bool layerAbility;
1856 public bool layerCraft;
1859 public bool sort_ascending;
1862 public bool sort_ascending_shop;
1865 public UIList.SortMode sortResources;
1868 public UIList.SortMode sortPeople;
1871 public UIList.SortMode sortResearch = UIList.SortMode.ByCategory;
1874 public UIList.SortMode sortInv = UIList.SortMode.ByCategory;
1877 public UIList.SortMode sortInvShop = UIList.SortMode.ByValue;
1880 public UIList.SortMode sortAbility = UIList.SortMode.ByID;
1883 public LayerPeople.ShowMode modePoeple;
1886 public UIInventory.InteractMode interactMode;
1893 public int GetShippingBonus(
int _a)
1895 Player.
Stats.<>c__DisplayClass21_0 CS$<>8__locals1;
1896 CS$<>8__locals1.<>4__this =
this;
1897 CS$<>8__locals1.p = 0;
1898 CS$<>8__locals1.a = _a;
1899 CS$<>8__locals1.first =
true;
1900 this.<GetShippingBonus>g__SetBonus|21_0(500000, 5000, ref CS$<>8__locals1);
1901 this.<GetShippingBonus>g__SetBonus|21_0(250000, 3000, ref CS$<>8__locals1);
1902 this.<GetShippingBonus>g__SetBonus|21_0(100000, 2000, ref CS$<>8__locals1);
1903 this.<GetShippingBonus>g__SetBonus|21_0(20000, 1000, ref CS$<>8__locals1);
1904 this.<GetShippingBonus>g__SetBonus|21_0(6000, 500, ref CS$<>8__locals1);
1905 this.<GetShippingBonus>g__SetBonus|21_0(2000, 200, ref CS$<>8__locals1);
1906 this.<GetShippingBonus>g__SetBonus|21_0(0, 100, ref CS$<>8__locals1);
1907 return CS$<>8__locals1.p;
1912 private void <GetShippingBonus>g__SetBonus|21_0(
int threshold,
int div, ref
Player.
Stats.<>c__DisplayClass21_0 A_3)
1914 if (A_3.a >= threshold)
1916 A_3.p += (A_3.a - threshold) / div;
1919 this.lastShippingExp = (A_3.a - threshold) % div;
1920 this.lastShippingExpMax = div;
1928 public double timeElapsed;
1952 public int taxBills;
1955 public int taxBillsPaid;
1964 public int shipMoney;
1973 public int allyDeath;
1979 public int gambleChest;
1982 public int gambleChestOpen;
1986 public int lastShippingExp;
1990 public int lastShippingExpMax;
1999 public bool gotClickReward
2003 return this.bits[1];
2007 this.bits[1] = value;
2018 return this.bits[2];
2022 this.bits[2] = value;
2029 public bool fiamaStoryBookGiven
2033 return this.bits[3];
2037 this.bits[3] = value;
2044 public bool fiamaFirstDream
2048 return this.bits[4];
2052 this.bits[4] = value;
2059 public bool helpHighlightDisabled
2063 return this.bits[5];
2067 this.bits[5] = value;
2074 public bool pickedMelilithTreasure
2078 return this.bits[6];
2082 this.bits[6] = value;
2089 public bool isShoesOff
2093 return this.bits[7];
2097 this.bits[7] = value;
2104 public bool backpackHighlightDisabled
2108 return this.bits[8];
2112 this.bits[8] = value;
2119 public bool abilityHighlightDisabled
2123 return this.bits[9];
2127 this.bits[9] = value;
2134 public bool elinGift
2138 return this.bits[10];
2142 this.bits[10] = value;
2149 public bool gotMelilithCurse
2153 return this.bits[11];
2157 this.bits[11] = value;
2164 public bool canComupWithFoodRecipe
2168 return this.bits[12];
2172 this.bits[12] = value;
2179 public bool KilledBossInVoid
2183 return this.bits[13];
2187 this.bits[13] = value;
2194 public bool statueShipped
2198 return this.bits[14];
2202 this.bits[14] = value;
2209 public bool little_saved
2213 return this.bits[15];
2217 this.bits[15] = value;
2224 public bool little_killed
2228 return this.bits[16];
2232 this.bits[16] = value;
2239 public bool gotEtherDisease
2243 return this.bits[17];
2247 this.bits[17] = value;
2254 public bool loytelEscaped
2258 return this.bits[18];
2262 this.bits[18] = value;
2269 public bool magicChestSent
2273 return this.bits[19];
2277 this.bits[19] = value;
2288 return this.ints[10];
2292 this.ints[10] = value;
2303 return this.ints[11];
2307 this.ints[11] = value;
2318 return this.ints[13];
2322 this.ints[13] = value;
2329 public int storyFiama
2333 return this.ints[14];
2337 this.ints[14] = value;
2348 return this.ints[15];
2352 this.ints[15] = value;
2359 public int daysAfterQuestExploration
2363 return this.ints[16];
2367 this.ints[16] = value;
2374 public int landDeedBought
2378 return this.ints[17];
2382 this.ints[17] = value;
2389 public int loytelMartLv
2393 return this.ints[18];
2397 this.ints[18] = value;
2403 private void _OnSerializing(StreamingContext context)
2405 this.ints[0] = (int)this.bits.Bits;
2410 private void _OnDeserialized(StreamingContext context)
2412 this.bits.Bits = (uint)this.ints[0];
2416 public void OnCreateGame()
2421 public void OnEnableDebug()
2426 public void OnBuild(
Recipe r)
2428 if (this.build == 0 && r.id ==
"workbench")
2435 public bool IsStoryPlayed(
int flag)
2437 return this.playedStories.Contains(flag);
2441 public int GetStoryRowID(
string idBook,
string idStep)
2443 foreach (Dictionary<string, string> dictionary
in this.GetStoryExcelData(idBook).sheets[
"index"].list)
2445 if (dictionary[
"step"] == idStep)
2447 return dictionary[
"id"].ToInt();
2454 public Dictionary<string, string> GetStoryRow(
string idBook,
int id)
2456 foreach (Dictionary<string, string> dictionary
in this.GetStoryExcelData(idBook).sheets[
"index"].list)
2458 if (dictionary[
"id"].ToInt() ==
id)
2467 public ExcelData GetStoryExcelData(
string idBook)
2469 ExcelData excelData = this.storyExcel.TryGetValue(idBook,
null);
2470 if (excelData ==
null)
2472 excelData =
new ExcelData();
2473 excelData.path = CorePath.DramaData + idBook +
".xlsx";
2474 excelData.BuildList(
"index");
2475 this.storyExcel.Add(idBook, excelData);
2481 public bool PlayStory(
string idBook,
int id,
bool fromBook =
false)
2483 if (!fromBook && this.playedStories.Contains(
id))
2487 Dictionary<string, string> storyRow = this.GetStoryRow(idBook,
id);
2488 SoundManager.ForceBGM();
2489 LayerDrama.Activate(idBook, storyRow[
"sheet"], storyRow[
"step"],
null,
null,
"");
2490 if (!fromBook && !this.playedStories.Contains(
id))
2492 this.playedStories.Add(
id);
2498 public bool PlayStory(
int id,
bool fromBook =
false)
2500 return this.PlayStory(
"_main",
id, fromBook);
2504 public void AddStory(
int id)
2506 if (!this.playedStories.Contains(
id) && !
this.availableStories.Contains(
id))
2508 this.availableStories.Add(
id);
2509 Msg.Say(
"story_added");
2515 public void OnEnterZone()
2517 if (
EClass._zone.id ==
"nymelle")
2519 if (
EClass._zone.lv == -1)
2523 if (
EClass._zone.lv == -2)
2527 if (
EClass._zone.lv == -3)
2534 this.PlayStory(50,
false);
2536 if ((
EClass._zone.IsPCFaction ||
EClass._zone.id ==
EClass.game.Prologue.idStartZone) &&
this.availableStories.Count > 0)
2538 this.PlayStory(this.availableStories[0],
false);
2539 this.availableStories.RemoveAt(0);
2544 public void OnLeaveZone()
2548 this.PlayStory(40,
false);
2553 public const int MonoDeparture = 100;
2557 public int[] ints =
new int[50];
2561 public List<int> playedStories =
new List<int>();
2565 public List<int> availableStories =
new List<int>();
2569 public HashSet<int> pleaseDontTouch =
new HashSet<int>();
2573 public List<string> reservedTutorial =
new List<string>();
2576 public BitArray32 bits;
2579 public Dictionary<string, ExcelData> storyExcel =
new Dictionary<string, ExcelData>();