Elin Decompiled Documentation EA 23.282 Stable Patch 3
Loading...
Searching...
No Matches
Zone Class Reference
Inheritance diagram for Zone:
Spatial ICardParent IInspect EClass Region Zone_Arena Zone_CaveElona Zone_Civilized Zone_Dungeon Zone_Field Zone_Hospital Zone_LumiestRuin Zone_Shelter Zone_SnowGrave Zone_StartCave Zone_StartSite Zone_Tent Zone_TestMap Zone_TestRoom Zone_TruceGround Zone_Underground Zone_User Zone_Wilds Zone_WindRest

Classes

class  PortalReturnData
 

Public Member Functions

int Evalue (int ele)
 
int Evalue (string alias)
 
virtual string GetDungenID ()
 
virtual bool ShouldScaleImportedChara (Chara c)
 
virtual string GetNewZoneID (int level)
 
override string ToString ()
 
string TextLevel (int _lv)
 
override void OnCreate ()
 
override void OnAfterCreate ()
 
void Activate ()
 
void RefreshHat ()
 
void OnVisit ()
 
void RefreshDeathSentense ()
 
void Revive ()
 
virtual void OnRegenerate ()
 
virtual void OnActivate ()
 
virtual void OnBeforeDeactivate ()
 
virtual void OnDeactivate ()
 
virtual void OnBeforeSimulate ()
 
virtual void OnVisitNewMapOrRegenerate ()
 
virtual void OnAfterSimulate ()
 
virtual void OnAdvanceHour ()
 
void Simulate ()
 
Point GetSpawnPos (Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
 
Point GetRandomVisitPos (Chara c)
 
void AddGlobalCharasOnActivate ()
 
void Deactivate ()
 
void OnKillGame ()
 
void UnloadMap ()
 
void ClaimZone (bool debug=false, Point pos=null)
 
void AbandonZone ()
 
bool CanDestroy ()
 
override void _OnBeforeSave ()
 
override void OnLoad ()
 
override void Destroy ()
 
void ClearZones (Zone current=null)
 
void OnChildNumChange (Card c)
 
ICardParent GetRoot ()
 
Zone GetTopZone ()
 
Card AddCardSplinkle (Card t, Point center, int radius=4)
 
Chara AddChara (string id, int x, int z)
 
Chara AddChara (string id, Point p)
 
Card AddThing (string id, int x, int z)
 
Card AddThing (string id, Point p)
 
Card AddCard (Card t, Point point)
 
Card AddCard (Card t)
 
Card AddCard (Card t, int x, int z)
 
void RemoveCard (Card t)
 
GetRandomSpot< T > ()
 
bool TryAddThingInSpot< T > (Thing t, bool useContainer=true)
 
List< ThingTryListThingsInSpot< T > (Func< Thing, bool > func=null)
 
bool TryAddThingInSharedContainer (Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
 
bool TryAddThing (Thing target, Point p, bool destroyIfFail=false)
 
Thing TryGetThingFromSharedContainer (Func< Thing, bool > func)
 
Thing TryGetRestock< T > (string idCat)
 
ZoneProfile GetProfile ()
 
void CreateBP ()
 
virtual void OnCreateBP ()
 
void Generate ()
 
void TrySpawnFollower ()
 
void SpawnAltar ()
 
virtual void OnGenerateMap ()
 
void TryGenerateOre ()
 
Chara TryGenerateEvolved (bool force=false, Point p=null)
 
void TryGenerateBigDaddy ()
 
void TryGenerateShrine ()
 
void ResetHostility ()
 
virtual void OnGenerateRooms (BaseMapGen gen)
 
Point GetSpawnPos (SpawnPosition type, int tries=100)
 
Chara SpawnMob (string id, Point pos=null)
 
Chara SpawnMob (Point pos=null, SpawnSetting setting=null)
 
bool HasField (int idEle)
 
void SetFieldEffect (int idEle, int a)
 
void RefreshElectricity ()
 
int GetElectricity (bool cost=false)
 
void SetBGM (List< int > ids, bool refresh=true, float fadeDuration=0f)
 
void SetBGM (int id=-1, bool refresh=true, float fadeDuration=0f)
 
void RefreshPlaylist ()
 
void ResetPlaylist ()
 
void RefreshBGM ()
 
Playlist CreatePlaylist (ref List< int > list, Playlist mold=null)
 
Chara FindChara (string id)
 
Chara FindChara (int uid)
 
int GetDeepestLv ()
 
int GetDeepestLv (ref int max)
 
List< ElementListLandFeats ()
 
ZoneExportData Import (string path)
 
void Export (string path, PartialMap partial=null, bool usermap=false)
 
void ExportDialog (string dir=null)
 
void ImportDialog (string dir=null)
 
void Export ()
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, IInspect.NoteMode mode=IInspect.NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 
int GetSortVal ()
 
Chara AddRandomVisitor (bool guest=false)
 
void OnSimulateHour (VirtualDate date)
 
void OnSimulateDay (VirtualDate date)
 
void OnSimulateMonth (VirtualDate date)
 
void RainWater ()
 
void GrowPlants (VirtualDate date)
 
Zone GetZoneAt (int _x, int _y)
 
bool IsCrime (Chara c, Act act)
 
void RefreshCriminal ()
 
void RefreshListCitizen ()
 
virtual void SetAlarm (bool enable)
 
void ModInfluence (int a)
 
void ModDevelopment (int a)
 
void UpdateQuests (bool force=false)
 
List< CharaListMinions (Chara c)
 
int CountMinions (Chara c)
 
int GetSoilCost ()
 
void SpawnLostItems ()
 
void ApplyBackerPet (bool draw)
 
FortuneRollData GetOrCreateFortuneRollData (bool refresh=true)
 
- Public Member Functions inherited from Spatial
int GetInt (int id, int? defaultInt=null)
 
void AddInt (int id, int value)
 
void SetInt (int id, int value=0)
 
override string ToString ()
 
void Create (string _id, int _x, int _y, int _icon)
 
void Register ()
 
virtual void OnCreate ()
 
virtual void OnAfterCreate ()
 
virtual void SetMainFaction (Faction f)
 
Zone GetFirstZone ()
 
void OnBeforeSave ()
 
virtual void _OnBeforeSave ()
 
void _OnLoad ()
 
virtual void OnLoad ()
 
virtual void Destroy ()
 
void DeleteMapRecursive ()
 
virtual void AddChild (Spatial child)
 
void RemoveChild (Spatial child)
 
Zone FindDeepestZone ()
 
Zone FindZone (int lv)
 
Zone FindZone (string _id)
 
virtual bool CanKill ()
 
int Dist (Point p)
 
int Dist (Spatial s)
 
void MakeGameObject (GameObject parentGo)
 
ICardParent GetRoot ()
 
void RemoveCard (Card c)
 
void OnChildNumChange (Card c)
 
void WriteNote (UINote n, Action< UINote > onWriteNote=null, NoteMode mode=NoteMode.Default, Recipe recipe=null)
 
void OnInspect ()
 

Static Public Member Functions

static bool IsImportValid (string path)
 
- 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

FactionBranch branch
 
HashSet< int > completedQuests = new HashSet<int>()
 
ZoneEventManager events = new ZoneEventManager()
 
ElementContainerZone elements = new ElementContainerZone()
 
ElementContainerField fieldElements = new ElementContainerField()
 
MapBounds bounds
 
Dictionary< int, string > dictCitizen = new Dictionary<int, string>()
 
ZoneInstance instance
 
List< int > landFeats
 
Map map
 
MapSubset subset
 
ZoneBlueprint bp
 
int fileVariation
 
bool dirtyElectricity
 
bool isStarted
 
bool isSimulating
 
int tempDist
 
BiomeProfile _biome
 
- Public Attributes inherited from Spatial
Spatial parent
 
string id
 
string idUser
 
string name
 
string idMainFaction
 
string idProfile
 
string idCurrentSubset
 
string idHat
 
int[] _ints = new int[30]
 
List< Spatialchildren = new List<Spatial>()
 
List< Spatialconnections = new List<Spatial>()
 
Dictionary< int, int > mapInt = new Dictionary<int, int>()
 
bool destryoed
 
bool isImported
 
BitArray32 bits
 

Static Public Attributes

static bool forceRegenerate
 
static string forceSubset
 
static CardRow sourceHat
 
static int okaerinko = 0
 
static bool ignoreSpawnAnime
 
static List< ThingSuckers = new List<Thing>()
 
- Static Public Attributes inherited from EClass
static Core core
 

Properties

Chara Boss [get, set]
 
override int ContentLv [get]
 
override int DangerLv [get]
 
virtual bool DisableRooms [get]
 
int HourSinceLastActive [get]
 
int MinsSinceLastActive [get]
 
virtual string pathExport [get]
 
BiomeProfile biome [get]
 
virtual string IdBiome [get]
 
virtual int SightRadiusBonus [get]
 
virtual string IDGenerator [get]
 
virtual string TextWidgetDate [get]
 
MapGenerator Generator [get]
 
virtual string IdProfile [get]
 
virtual string IDPlayList [get]
 
virtual string IDPlaylistOverwrite [get]
 
virtual string IDHat [get]
 
virtual string IDBaseLandFeat [get]
 
virtual string idExport [get]
 
string pathTemp [get]
 
Region Region [get]
 
Zone ParentZone [get]
 
virtual ActionMode DefaultActionMode [get]
 
virtual bool BlockBorderExit [get]
 
virtual int ExpireDays [get]
 
virtual ZoneTransition.EnterState RegionEnterState [get]
 
virtual ZoneFeatureType FeatureType [get]
 
virtual string IDAmbience [get]
 
virtual string IDSceneTemplate [get]
 
virtual bool IsFestival [get]
 
virtual string IDSubset [get]
 
virtual bool IsTown [get]
 
virtual bool CanBeDeliverDestination [get]
 
virtual bool CountDeepestLevel [get]
 
virtual bool HasLaw [get]
 
virtual bool SetAlarmOnBreakLaw [get]
 
virtual bool MakeEnemiesNeutral [get]
 
virtual bool MakeTownProperties [get]
 
virtual bool AllowCriminal [get]
 
virtual bool AllowInvest [get]
 
virtual bool AllowNewZone [get]
 
virtual bool WillAutoSave [get]
 
virtual bool RegenerateOnEnter [get]
 
virtual bool IsSkyLevel [get]
 
virtual bool IsUnderwater [get]
 
virtual bool IsUserZone [get]
 
virtual bool CanDigUnderground [get]
 
virtual bool LockExit [get]
 
virtual bool CanUnlockExit [get]
 
virtual int MaxLv [get]
 
virtual int MinLv [get]
 
virtual bool AddPrefix [get]
 
virtual bool IsNefia [get]
 
virtual bool PetFollow [get]
 
virtual bool RestrictBuild [get]
 
virtual bool KeepAllyDistance [get]
 
virtual int MaxSpawn [get]
 
int MaxRespawn [get]
 
virtual float RuinChance [get]
 
virtual float OreChance [get]
 
virtual float BigDaddyChance [get]
 
virtual float EvolvedChance [get]
 
virtual float ShrineChance [get]
 
virtual float PrespawnRate [get]
 
virtual float RespawnRate [get]
 
bool ShowEnemyOnMinimap [get]
 
virtual int RespawnPerHour [get]
 
virtual float ChanceSpawnNeutral [get]
 
virtual bool GrowPlant [get]
 
virtual bool GrowWeed [get]
 
virtual bool IsExplorable [get]
 
virtual bool IsReturnLocation [get]
 
virtual bool ShouldMakeExit [get]
 
virtual bool ShouldRegenerate [get]
 
virtual bool ShouldAutoRevive [get]
 
virtual bool UseFog [get]
 
virtual bool RevealRoom [get]
 
virtual bool AlwaysLowblock [get]
 
virtual bool UseLight [get]
 
virtual int StartLV [get]
 
virtual ZoneScaleType ScaleType [get]
 
virtual bool HiddenInRegionMap [get]
 
virtual FlockController.SpawnType FlockType [get]
 
override string NameSuffix [get]
 
string NameWithLevel [get]
 
string TextDangerLv [get]
 
string TextDeepestLv [get]
 
bool CanEnterBuildMode [get]
 
bool CanEnterBuildModeAnywhere [get]
 
bool IsPCFaction [get]
 
bool IsPCFactionOrTent [get]
 
bool IsStartZone [get]
 
bool IsInstance [get]
 
bool IsLoaded [get]
 
virtual int BaseElectricity [get]
 
bool IsActiveZone [get]
 
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 
virtual int MaxSoil [get]
 
- Properties inherited from Spatial
int _bits [get, set]
 
int uid [get, set]
 
int icon [get, set]
 
int x [get, set]
 
int y [get, set]
 
int lastActive [get, set]
 
int idPrefix [get, set]
 
int lv [get, set]
 
int visitCount [get, set]
 
int dateExpire [get, set]
 
int dateRevive [get, set]
 
int _dangerLv [get, set]
 
int dateRegenerate [get, set]
 
int influence [get, set]
 
int investment [get, set]
 
int development [get, set]
 
int electricity [get, set]
 
int dateHat [get, set]
 
int uidBoss [get, set]
 
int dateQuest [get, set]
 
int version [get, set]
 
bool isGenerated [get, set]
 
bool isShore [get, set]
 
bool isRandomSite [get, set]
 
bool isKnown [get, set]
 
bool isMapSaved [get, set]
 
bool isExternalZone [get, set]
 
bool isConquered [get, set]
 
bool isBeach [get, set]
 
bool isPeace [get, set]
 
bool isDeathLocation [get, set]
 
bool isAlarmSet [get, set]
 
Faction mainFaction [get, set]
 
SourceZone.Row source [get]
 
bool IsPlayerFaction [get]
 
bool IsClosed [get]
 
int mapX [get]
 
int mapY [get]
 
virtual int ContentLv [get]
 
virtual int DangerLv [get]
 
virtual int DangerLvFix [get]
 
virtual int DangerLvBoost [get]
 
virtual float VolumeSea [get]
 
virtual bool ShowDangerLv [get]
 
virtual bool CanSpawnAdv [get]
 
string pathSave [get]
 
virtual string Name [get]
 
string NameWithDangerLevel [get]
 
virtual string NameSuffix [get]
 
virtual bool IsRegion [get]
 
virtual bool CanFastTravel [get]
 
EloMap.TileInfo Tile [get]
 
virtual bool IsSnowZone [get]
 
virtual bool IsSnowCovered [get]
 
virtual Point RegionPos [get]
 
virtual bool isClaimable [get]
 
int Seed [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]
 
- Properties inherited from IInspect
bool CanInspect [get]
 
string InspectName [get]
 
Point InspectPoint [get]
 
Vector3 InspectPosition [get]
 

Private Attributes

FortuneRollData fortuneRoll
 

Additional Inherited Members

- Public Types inherited from IInspect
enum  NoteMode { Default , Recipe , Product , Info }
 
- Protected Member Functions inherited from Spatial
Zone _FindZone (string _id)
 
- Protected Attributes inherited from Spatial
Point _regionPos = new Point()
 

Detailed Description

Definition at line 11 of file Zone.cs.

Member Function Documentation

◆ _OnBeforeSave()

override void Zone._OnBeforeSave ( )
inlinevirtual

Reimplemented from Spatial.

Definition at line 1864 of file Zone.cs.

1865 {
1866 if (CanDestroy())
1867 {
1868 Debug.Log("Deleting Zone:" + this);
1869 if (!destryoed)
1870 {
1871 Destroy();
1872 }
1873 }
1874 else if (map != null)
1875 {
1876 Debug.Log("Saving Zone:" + this);
1877 map.Save(base.pathSave);
1878 if (!base.isMapSaved)
1879 {
1880 base.isMapSaved = true;
1881 IO.DeleteDirectory(base.pathSave + "Texture Replace");
1882 IO.CopyDir(pathTemp + "Texture Replace", base.pathSave + "/Texture Replace");
1883 }
1884 if (!IsActiveZone)
1885 {
1886 UnloadMap();
1887 }
1888 }
1889 }
Definition: IO.cs:11
static void DeleteDirectory(string path)
Definition: IO.cs:353
static void CopyDir(string sourceDirectory, string targetDirectory, Func< string, bool > funcExclude=null)
Definition: IO.cs:245
void Save(string path, ZoneExportData export=null, PartialMap partial=null)
Definition: Map.cs:376
bool destryoed
Definition: Spatial.cs:45
bool CanDestroy()
Definition: Zone.cs:1799
override void Destroy()
Definition: Zone.cs:1900
bool IsActiveZone
Definition: Zone.cs:497
void UnloadMap()
Definition: Zone.cs:1715
string pathTemp
Definition: Zone.cs:163
Map map
Definition: Zone.cs:63

References Debug, and Map.Save().

◆ AbandonZone()

void Zone.AbandonZone ( )
inline

Definition at line 1783 of file Zone.cs.

1784 {
1785 FactionBranch destBranch = ((EClass.pc.homeBranch == branch) ? EClass.game.StartZone.branch : EClass.pc.homeBranch);
1786 branch.members.ForeachReverse(delegate(Chara m)
1787 {
1788 destBranch.AddMemeber(m);
1789 if (!m.IsPCParty)
1790 {
1791 m.MoveZone(destBranch.owner);
1792 }
1793 });
1795 SetMainFaction(null);
1796 base.dateExpire = EClass.world.date.GetRaw() + 10080;
1797 }
Definition: Chara.cs:10
override bool IsPCParty
Definition: Chara.cs:629
FactionBranch homeBranch
Definition: Chara.cs:1080
void MoveZone(string alias)
Definition: Chara.cs:3366
int GetRaw(int offsetHours=0)
Definition: Date.cs:328
Definition: EClass.cs:6
static Game game
Definition: EClass.cs:9
static World world
Definition: EClass.cs:41
static FactionBranch Branch
Definition: EClass.cs:23
static Chara pc
Definition: EClass.cs:15
void OnUnclaimZone()
List< Chara > members
void AddMemeber(Chara c)
Zone StartZone
Definition: Game.cs:278
virtual void SetMainFaction(Faction f)
Definition: Spatial.cs:646
GameDate date
Definition: World.cs:6
FactionBranch branch
Definition: Zone.cs:34

References FactionBranch.AddMemeber(), EClass.Branch, branch, World.date, EClass.game, Date.GetRaw(), Chara.homeBranch, Chara.IsPCParty, FactionBranch.members, Chara.MoveZone(), FactionBranch.OnUnclaimZone(), FactionBranch.owner, EClass.pc, Game.StartZone, and EClass.world.

◆ Activate()

void Zone.Activate ( )
inline

Definition at line 593 of file Zone.cs.

594 {
595 if (IsRegion)
596 {
598 }
599 isStarted = (isSimulating = false);
600 base.isKnown = true;
601 EClass.game.config.reverseSnow = false;
603 {
604 Msg.Say("regenerateZone", Name);
605 ClearZones();
606 if (EClass.pc.global.transition != null)
607 {
608 EClass.pc.global.transition.uidLastZone = 0;
609 }
610 }
612 if (EClass.game.activeZone != null)
613 {
615 }
616 EClass.game.activeZone = this;
617 ZoneExportData zoneExportData = null;
618 Debug.Log(NameWithLevel + "/" + id + "/" + base.uid + "/" + base.isGenerated + "/" + IsLoaded + "/" + File.Exists(base.pathSave + "map"));
619 if (base.isGenerated && !IsLoaded && !File.Exists(base.pathSave + "map"))
620 {
621 Debug.Log("(Bug) File does not exist:" + destryoed + "/" + base.pathSave);
622 base.isGenerated = false;
623 }
624 bool flag = false;
625 Debug.Log(idCurrentSubset + "/" + IDSubset);
626 bool flag2 = idCurrentSubset != IDSubset || forceSubset != null;
627 if (flag2 && map != null)
628 {
629 UnloadMap();
630 }
631 Debug.Log(idExport + "/" + File.Exists(pathExport) + "/" + pathExport);
632 if (!base.isGenerated && (idExport.IsEmpty() || !File.Exists(pathExport)))
633 {
634 Debug.Log("generating random map");
635 flag = true;
636 base.dateExpire = EClass.world.date.GetRaw() + 1440 * ExpireDays;
637 Generate();
639 if (instance != null)
640 {
642 }
643 if (!UseFog)
644 {
645 map.ForeachCell(delegate(Cell c)
646 {
647 c.isSeen = true;
648 });
649 }
650 if (!(bp is GameBlueprint))
651 {
653 }
654 }
655 else if (IsLoaded)
656 {
657 Debug.Log("zone is already loaded");
658 map.SetZone(this);
659 EClass.core.textures.ApplyLocalReplace(base.isMapSaved ? base.pathSave : pathTemp);
661 }
662 else
663 {
664 subset = null;
665 bool flag3 = (base.isGenerated && flag2) || (base.isGenerated && !IsInstance && !IsPCFaction && ShouldRegenerate && EClass.world.date.IsExpired(base.dateRegenerate)) || forceRegenerate;
666 if (pathExport.IsEmpty() || !File.Exists(pathExport) || EClass.game.isLoading || EClass.player.simulatingZone)
667 {
668 flag3 = false;
669 flag2 = false;
670 }
671 Debug.Log(base.isGenerated + "/" + flag3 + "/" + flag2 + "/" + IDSubset);
672 if (!base.isGenerated || flag3 || flag2)
673 {
674 Debug.Log("importing map:" + pathExport);
675 flag = true;
676 base.dateRegenerate = EClass.world.date.GetRaw() + 1440 * EClass.setting.balance.dateRegenerateZone;
677 if (!flag3)
678 {
679 IO.DeleteDirectory(pathTemp + "Texture Replace");
680 Debug.Log(pathTemp);
681 }
682 try
683 {
684 zoneExportData = Import(pathExport);
685 base.isGenerated = true;
686 isImported = true;
687 if (flag3)
688 {
689 zoneExportData.orgMap = GameIO.LoadFile<Map>(base.pathSave + "map");
690 }
691 }
692 catch (Exception message)
693 {
694 Debug.Log(message);
695 zoneExportData = Import(CorePath.ZoneSave + "fail.z");
696 base.isGenerated = true;
697 isImported = true;
698 }
699 }
701 Debug.Log("loading map: imported? " + isImported + " regenerate? " + flag3);
702 map = GameIO.LoadFile<Map>((isImported ? pathTemp : base.pathSave) + "map");
703 if (map == null)
704 {
705 EClass.ui.Say("System.IO.EndOfStreamException: Unexpected end of stream:" + Environment.NewLine + "File may be corrupted. Try replacing the following file if you have a backup:" + Environment.NewLine + (isImported ? pathTemp : base.pathSave) + "map");
706 return;
707 }
708 map.SetZone(this);
709 map.Load(isImported ? pathTemp : base.pathSave, isImported);
711 EClass.core.textures.ApplyLocalReplace(base.isMapSaved ? base.pathSave : pathTemp);
712 if (isImported)
713 {
714 map.deadCharas.Clear();
715 map.OnImport(zoneExportData);
716 if (UseFog && !flag3)
717 {
718 map.ForeachCell(delegate(Cell c)
719 {
720 c.isSeen = false;
721 });
722 }
723 if (zoneExportData.orgMap != null)
724 {
725 Map orgMap = zoneExportData.orgMap;
726 List<Chara> serializedCharas = map.serializedCharas;
727 map.charas = orgMap.charas;
728 map.serializedCharas = orgMap.serializedCharas;
729 map.deadCharas = orgMap.deadCharas;
730 byte[] array = orgMap.TryLoadFile(base.pathSave, "flags", EClass._map.Size * EClass._map.Size);
731 if (array != null && array.Length == EClass._map.Size * EClass._map.Size)
732 {
733 for (int i = 0; i < EClass._map.Size; i++)
734 {
735 for (int j = 0; j < EClass._map.Size; j++)
736 {
737 map.cells[i, j].isSeen = array[i * EClass._map.Size + j].GetBit(1);
738 }
739 }
740 }
741 foreach (Chara item in serializedCharas)
742 {
743 Debug.Log("Importing New Chara:" + item.id + "/" + item.Name + "/" + item.orgPos);
745 }
746 map.things.ForeachReverse(delegate(Thing t)
747 {
748 if (t.trait is TraitNewZone || t.trait is TraitPowerStatue)
749 {
750 foreach (Thing thing in orgMap.things)
751 {
752 if (t.id == thing.id && t.pos.Equals(thing.pos))
753 {
754 if (t.trait is TraitNewZone)
755 {
756 RemoveCard(t);
757 map.things.Insert(0, thing);
758 thing.stackOrder = 0;
759 }
760 else
761 {
762 t.ChangeMaterial(thing.material);
763 t.isOn = thing.isOn;
764 }
765 break;
766 }
767 }
768 return;
769 }
770 if (t.trait is TraitStairsLocked)
771 {
772 foreach (Thing thing2 in orgMap.things)
773 {
774 if (thing2.trait is TraitNewZone && t.pos.Equals(thing2.pos))
775 {
776 RemoveCard(t);
777 map.things.Add(thing2);
778 break;
779 }
780 }
781 return;
782 }
783 if (t.id == "medal" || t.id == "856")
784 {
785 foreach (Thing thing3 in orgMap.things)
786 {
787 if (t.id == thing3.id && t.pos.Equals(thing3.pos))
788 {
789 return;
790 }
791 }
792 RemoveCard(t);
793 }
794 });
795 foreach (KeyValuePair<int, int> item2 in EClass._map.backerObjs.ToList())
796 {
797 EClass._map.GetCell(item2.Key);
798 SourceBacker.Row row = EClass.sources.backers.map[item2.Value];
800 {
801 map.backerObjs.Remove(item2.Key);
802 }
803 }
804 foreach (Chara serializedChara in map.serializedCharas)
805 {
806 if (serializedChara.orgPos != null && serializedChara.orgPos.IsValid)
807 {
808 serializedChara.pos.Set(serializedChara.orgPos);
809 }
810 }
811 foreach (Thing thing4 in orgMap.things)
812 {
813 if (thing4.trait is TraitTent && !thing4.isNPCProperty)
814 {
815 thing4.AddEditorTag(EditorTag.NoNpcProperty);
816 thing4.isSubsetCard = false;
817 map.things.Add(thing4);
818 Debug.Log(thing4);
819 }
820 }
821 }
822 }
823 foreach (Thing thing5 in map.things)
824 {
825 map.AddCardOnActivate(thing5);
826 }
827 foreach (Chara c3 in map.serializedCharas)
828 {
829 if (c3.c_uidMaster == 0 || EClass.player.listCarryoverMap.Find((Chara c2) => c2.uid == c3.uid) == null)
830 {
831 map.charas.Add(c3);
833 }
834 }
835 map.serializedCharas.Clear();
836 if (isImported && IsTown)
837 {
839 }
842 map.OnLoad();
843 if (flag3)
844 {
845 foreach (Card item3 in map.Cards.ToList())
846 {
847 if (item3.isSubsetCard)
848 {
849 item3.Destroy();
850 }
851 }
852 }
853 if (isImported)
854 {
856 if (idCurrentSubset != null)
857 {
859 subset.Apply();
860 }
861 }
862 if (isImported)
863 {
865 {
866 foreach (Thing thing6 in map.things)
867 {
868 thing6.isNPCProperty = !thing6.isHidden && !thing6.HasEditorTag(EditorTag.NoNpcProperty);
869 }
870 }
871 else
872 {
873 foreach (Thing thing7 in map.things)
874 {
875 thing7.isNPCProperty = false;
876 }
877 }
879 if (instance != null)
880 {
882 }
883 }
884 if (isImported && !flag3 && !RevealRoom)
885 {
886 foreach (Room item4 in map.rooms.listRoom)
887 {
888 if (!item4.HasRoof || item4.data.atrium)
889 {
890 continue;
891 }
892 foreach (Point point2 in item4.points)
893 {
894 point2.cell.isSeen = false;
895 }
896 }
897 }
898 if (flag3)
899 {
900 OnRegenerate();
901 }
902 }
903 PathManager.Instance._pathfinder.PunishChangeDirection = false;
904 isImported = false;
905 if (this is Zone_Tent && IsUnderwater)
906 {
907 EClass._map.config.idSceneProfile = "indoor_water";
908 EClass.scene.profile = SceneProfile.Load(EClass._map.config.idSceneProfile);
909 }
910 if (flag && IsTown && base.lv == 0)
911 {
913 }
914 if (base.visitCount == 0)
915 {
916 base.dateRevive = EClass.world.date.GetRaw() + 1440 * EClass.setting.balance.dateRevive;
917 }
918 map.ForeachCell(delegate(Cell c)
919 {
920 if (c.HasFire)
921 {
922 map.effectManager.GetOrCreate(c.GetSharedPoint());
923 }
924 if (IsRegion)
925 {
926 c.decal = 0;
927 }
928 });
930 {
931 RainWater();
932 }
934 {
935 map.ForeachCell(delegate(Cell c)
936 {
937 c.isSeen = true;
938 });
939 }
940 isStarted = true;
941 Map.isDirtySunMap = true;
943 if (events.listPreEnter.Count > 0)
944 {
945 foreach (ZonePreEnterEvent item5 in events.listPreEnter)
946 {
947 item5.Execute();
948 }
949 events.listPreEnter.Clear();
950 }
951 foreach (Card card in map.Cards)
952 {
953 card.CalculateFOV();
954 if (card.isChara)
955 {
956 Chara chara = card.Chara;
957 chara.dirtySpeed = true;
958 if (!card.isDyed && card.HasTag(CTAG.random_color))
959 {
960 card.DyeRandom();
961 }
962 if (card.IsUnique && !card.IsPCFaction && !card.IsPCParty)
963 {
964 Point point = chara.orgPos ?? card.pos;
965 card.c_uniqueData = new UniqueData
966 {
967 x = point.x,
968 y = point.z,
969 uidZone = base.uid
970 };
971 }
972 int @int = card.GetInt(55);
973 if (@int != 0)
974 {
975 foreach (Chara chara2 in map.charas)
976 {
977 if (chara2.uid == @int)
978 {
979 if (chara.IsHostile(chara2))
980 {
981 chara.enemy = chara2;
982 chara.SetAI(new GoalCombat());
983 chara.calmCheckTurn = 20 + EClass.rnd(30);
984 }
985 break;
986 }
987 }
988 card.SetInt(55);
989 }
990 chara.SyncRide();
991 if (card.c_uidMaster != 0 && chara.master == null)
992 {
993 chara.FindMaster();
994 }
995 if (!EClass.game.isLoading)
996 {
997 chara.enemy = null;
998 if (chara.IsInCombat)
999 {
1000 chara.SetNoGoal();
1001 }
1002 }
1003 }
1004 else if (card.IsInstalled && card.trait is TraitDoor traitDoor && card.pos.HasChara && !traitDoor.IsOpen())
1005 {
1006 traitDoor.ToggleDoor(sound: false, refresh: false);
1007 }
1008 }
1009 RefreshHat();
1010 forceRegenerate = false;
1011 forceSubset = null;
1012 EClass.ui.OnActivateZone();
1014 EClass.Sound.LoadAmbience(IDAmbience);
1015 if (EClass.Branch != null)
1016 {
1018 }
1019 OnVisit();
1020 if (flag)
1021 {
1023 }
1025 if (IsPCFaction)
1026 {
1027 EClass.player.uidLastTown = 0;
1028 }
1029 else if (IsTown && base.lv == 0)
1030 {
1031 EClass.player.uidLastTown = base.uid;
1032 }
1033 RefreshBGM();
1034 Rand.InitBytes(map.seed + 1);
1036 okaerinko = 0;
1037 if (EClass.debug.enable)
1038 {
1039 ModInfluence(2000);
1040 }
1041 if (this is Zone_TinkerCamp)
1042 {
1043 Tutorial.Reserve("tinker");
1044 }
1045 else if (this is Zone_Town && !(this is Zone_SubTown))
1046 {
1047 Tutorial.Reserve("town");
1048 }
1049 }
CTAG
Definition: CTAG.cs:2
EditorTag
Definition: EditorTag.cs:2
if(item3.idFile==idFirstFile &&item3.id==idFirstTopic)
Definition: UIBook.cs:627
void Add(Act a, string s="")
Definition: ActPlan.cs:11
bool atrium
Definition: AreaData.cs:66
AreaData data
Definition: BaseArea.cs:29
PointList points
Definition: BaseArea.cs:26
Definition: Card.cs:11
string id
Definition: Card.cs:36
bool isNPCProperty
Definition: Card.cs:555
bool isSubsetCard
Definition: Card.cs:747
int c_uidMaster
Definition: Card.cs:1463
void AddEditorTag(EditorTag tag)
Definition: Card.cs:2633
Point pos
Definition: Card.cs:60
int uid
Definition: Card.cs:123
Trait trait
Definition: Card.cs:54
void Destroy()
Definition: Card.cs:5132
bool HasEditorTag(EditorTag tag)
Definition: Card.cs:2628
Definition: Cell.cs:7
bool isSeen
Definition: Cell.cs:282
bool HasFire
Definition: Cell.cs:676
AIAct SetNoGoal()
Definition: Chara.cs:9045
bool IsInCombat
Definition: Chara.cs:878
AIAct SetAI(AIAct g)
Definition: Chara.cs:9050
Point orgPos
Definition: Chara.cs:21
GlobalData global
Definition: Chara.cs:76
Chara master
Definition: Chara.cs:88
Chara FindMaster()
Definition: Chara.cs:2450
void SyncRide()
Definition: Chara.cs:3989
bool IsHostile()
Definition: Chara.cs:6646
bool ignoreBackerDestoryFlag
Definition: CoreConfig.cs:562
bool revealMap
Definition: CoreDebug.cs:154
bool enable
Definition: CoreDebug.cs:286
static string ZoneSave
Definition: CorePath.cs:200
TextureManager textures
Definition: Core.cs:45
CoreConfig config
Definition: Core.cs:70
bool IsExpired(int time)
Definition: Date.cs:338
static Scene scene
Definition: EClass.cs:31
static Core core
Definition: EClass.cs:7
static Map _map
Definition: EClass.cs:19
static int rnd(long a)
Definition: EClass.cs:59
static SourceManager sources
Definition: EClass.cs:43
static Player player
Definition: EClass.cs:13
static CoreDebug debug
Definition: EClass.cs:49
static SoundManager Sound
Definition: EClass.cs:47
static UI ui
Definition: EClass.cs:17
static GameSetting setting
Definition: EClass.cs:35
void Initialize(EloMap _elomap)
Definition: EloMapActor.cs:28
void OnActivateZone()
Definition: GameIO.cs:11
BalanceSetting balance
Definition: GameSetting.cs:309
bool isLoading
Definition: Game.cs:242
int countLoadedMaps
Definition: Game.cs:236
Zone activeZone
Definition: Game.cs:252
ZoneTransition transition
Definition: GlobalData.cs:6
Definition: Guild.cs:2
void RefreshDevelopment()
Definition: Guild.cs:95
static Guild GetCurrentGuild()
Definition: Guild.cs:74
int Size
Definition: MapBounds.cs:20
string idSceneProfile
Definition: MapConfig.cs:8
void Apply()
Definition: MapSubset.cs:60
static MapSubset Load(string id)
Definition: MapSubset.cs:33
Definition: Map.cs:13
new void ForeachCell(Action< Cell > action)
Definition: Map.cs:2346
Cell GetCell(int index)
Definition: Map.cs:887
IEnumerable< Card > Cards
Definition: Map.cs:135
void AddCardOnActivate(Card c)
Definition: Map.cs:783
void SetZone(Zone _zone)
Definition: Map.cs:181
List< Thing > things
Definition: Map.cs:49
byte[] TryLoadFile(string path, string s, int size)
Definition: Map.cs:535
Dictionary< int, int > backerObjs
Definition: Map.cs:67
List< Chara > deadCharas
Definition: Map.cs:46
int seed
Definition: Map.cs:19
RoomManager rooms
Definition: Map.cs:31
void SetReference()
Definition: Map.cs:195
void OnLoad()
Definition: Map.cs:708
void OnImport(ZoneExportData data)
Definition: Map.cs:714
List< Chara > serializedCharas
Definition: Map.cs:43
Cell[,] cells
Definition: Map.cs:85
MapConfig config
Definition: Map.cs:37
void Load(string path, bool import=false, PartialMap partial=null)
Definition: Map.cs:546
List< Chara > charas
Definition: Map.cs:81
void RefreshAllTiles()
Definition: Map.cs:2108
Definition: Msg.cs:5
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
Definition: Msg.cs:58
List< Chara > listCarryoverMap
Definition: Player.cs:1246
HashSet< int > doneBackers
Definition: Player.cs:1096
bool simulatingZone
Definition: Player.cs:1202
Definition: Point.cs:9
Point Set(int _x, int _z)
Definition: Point.cs:503
int x
Definition: Point.cs:36
int z
Definition: Point.cs:39
bool IsValid
Definition: Point.cs:88
Definition: Rand.cs:4
static void InitBytes(int a)
Definition: Rand.cs:11
Definition: Region.cs:7
EloMap elomap
Definition: Region.cs:8
List< Room > listRoom
Definition: RoomManager.cs:13
Definition: Room.cs:4
bool HasRoof
Definition: Room.cs:29
static SceneProfile Load(string id)
Definition: SceneProfile.cs:18
void RebuildActorEx()
Definition: Scene.cs:987
EloMapActor elomapActor
Definition: Scene.cs:101
SourceBacker backers
string idCurrentSubset
Definition: Spatial.cs:28
virtual bool IsRegion
Definition: Spatial.cs:515
virtual string Name
Definition: Spatial.cs:509
bool isImported
Definition: Spatial.cs:47
int y
Definition: Spatial.cs:106
int x
Definition: Spatial.cs:94
void ApplyLocalReplace(string path)
Definition: Thing.cs:8
static void Reserve(string idStep, Action onBeforePlay=null)
Definition: Tutorial.cs:55
bool IsRaining
Definition: Weather.cs:117
Weather weather
Definition: World.cs:12
List< ZonePreEnterEvent > listPreEnter
virtual void OnGenerateMap()
Definition: ZoneInstance.cs:32
virtual void Execute()
bool isSimulating
Definition: Zone.cs:75
void RefreshElectricity()
Definition: Zone.cs:2933
ZoneExportData Import(string path)
Definition: Zone.cs:3208
void Generate()
Definition: Zone.cs:2375
ZoneEventManager events
Definition: Zone.cs:40
static string forceSubset
Definition: Zone.cs:27
virtual bool RegenerateOnEnter
Definition: Zone.cs:267
static int okaerinko
Definition: Zone.cs:31
virtual string idExport
Definition: Zone.cs:152
virtual bool MakeTownProperties
Definition: Zone.cs:247
virtual void OnRegenerate()
Definition: Zone.cs:1160
bool isStarted
Definition: Zone.cs:73
virtual string pathExport
Definition: Zone.cs:127
MapSubset subset
Definition: Zone.cs:65
Zone GetTopZone()
Definition: Zone.cs:1950
virtual string IDSubset
Definition: Zone.cs:214
ZoneBlueprint bp
Definition: Zone.cs:67
void RefreshBGM()
Definition: Zone.cs:3061
void Deactivate()
Definition: Zone.cs:1636
void SpawnLostItems()
Definition: Zone.cs:3800
void AddGlobalCharasOnActivate()
Definition: Zone.cs:1555
bool IsInstance
Definition: Zone.cs:491
void ClearZones(Zone current=null)
Definition: Zone.cs:1919
void OnVisit()
Definition: Zone.cs:1061
virtual bool IsTown
Definition: Zone.cs:225
void RainWater()
Definition: Zone.cs:3446
virtual bool UseFog
Definition: Zone.cs:393
virtual string IDAmbience
Definition: Zone.cs:180
void RemoveCard(Card t)
Definition: Zone.cs:2034
void RefreshHat()
Definition: Zone.cs:1051
void ModInfluence(int a)
Definition: Zone.cs:3658
virtual void OnGenerateMap()
Definition: Zone.cs:2586
static bool forceRegenerate
Definition: Zone.cs:25
bool IsPCFaction
Definition: Zone.cs:475
virtual bool IsUnderwater
Definition: Zone.cs:271
virtual bool ShouldRegenerate
Definition: Zone.cs:379
string NameWithLevel
Definition: Zone.cs:431
ZoneInstance instance
Definition: Zone.cs:55
virtual bool RevealRoom
Definition: Zone.cs:395
bool IsLoaded
Definition: Zone.cs:493
void RefreshListCitizen()
Definition: Zone.cs:3616
virtual int ExpireDays
Definition: Zone.cs:173
virtual void OnVisitNewMapOrRegenerate()
Definition: Zone.cs:1180

References EClass._map, Game.activeZone, ActPlan.List.Add(), Card.AddEditorTag(), AddGlobalCharasOnActivate(), TextureManager.ApplyLocalReplace(), Map.backerObjs, SourceManager.backers, GameSetting.balance, bp, Map.cells, Map.charas, ClearZones(), Core.config, EClass.core, Game.countLoadedMaps, World.date, GameSetting.BalanceSetting.dateRegenerateZone, Deactivate(), Map.deadCharas, Debug, Spatial.destryoed, Player.doneBackers, Region.elomap, Scene.elomapActor, ExpireDays, forceRegenerate, forceSubset, Map.ForeachCell(), EClass.game, Generate(), Map.GetCell(), Date.GetRaw(), GetTopZone(), Chara.global, SourceBacker.Row.id, Spatial.idCurrentSubset, idExport, IDSubset, CoreConfig.Test.ignoreBackerDestoryFlag, Import(), EloMapActor.Initialize(), instance, Date.IsExpired(), Spatial.isImported, IsInstance, IsLoaded, Card.isNPCProperty, IsPCFaction, Spatial.IsRegion, Cell.isSeen, isSimulating, isStarted, Point.IsValid, item, Map.Load(), map, Spatial.Name, NameWithLevel, OnGenerateMap(), ZoneInstance.OnGenerateMap(), Map.OnImport(), ZoneExportData.orgMap, Chara.orgPos, pathExport, pathTemp, EClass.pc, EClass.player, Card.pos, RegenerateOnEnter, RemoveCard(), Msg.Say(), EClass.scene, Map.serializedCharas, Point.Set(), Map.SetReference(), EClass.setting, Map.SetZone(), ShouldRegenerate, Player.simulatingZone, MapBounds.Size, EClass.sources, subset, CoreConfig.test, Core.textures, Card.things, Map.things, Card.trait, GlobalData.transition, Map.TryLoadFile(), EClass.ui, UnloadMap(), UseFog, EClass.world, and CorePath.ZoneSave.

Referenced by Scene.Init(), and HotItemContext.Show().

◆ AddCard() [1/3]

Card Zone.AddCard ( Card  t)
inline

Definition at line 1999 of file Zone.cs.

2000 {
2001 return AddCard(t, 0, 0);
2002 }
Card AddCard(Card t, Point point)
Definition: Zone.cs:1994

◆ AddCard() [2/3]

Card Zone.AddCard ( Card  t,
int  x,
int  z 
)
inline

Definition at line 2004 of file Zone.cs.

2005 {
2006 if (t.parent != null)
2007 {
2008 t.parent.RemoveCard(t);
2009 }
2010 t.parent = this;
2011 Chara chara = t.Chara;
2012 if (chara != null)
2013 {
2014 chara.currentZone = this;
2015 chara.SetAI(new NoGoal());
2016 }
2017 if (IsActiveZone)
2018 {
2019 map.OnCardAddedToZone(t, x, z);
2020 if (isStarted && t.isThing && t.placeState == PlaceState.roaming && !ignoreSpawnAnime)
2021 {
2022 t.PlayAnimeLoot();
2023 }
2024 ignoreSpawnAnime = false;
2025 }
2026 if (chara != null && EClass.player != null && !chara.hasSpawned)
2027 {
2028 EClass.player.codex.AddSpawn(chara.id);
2029 chara.hasSpawned = true;
2030 }
2031 return t;
2032 }
PlaceState
Definition: PlaceState.cs:2
virtual bool isThing
Definition: Card.cs:2107
virtual Chara Chara
Definition: Card.cs:2096
ICardParent parent
Definition: Card.cs:56
bool hasSpawned
Definition: Card.cs:903
PlaceState placeState
Definition: Card.cs:84
void PlayAnimeLoot()
Definition: Card.cs:6372
void AddSpawn(string id)
Definition: CodexManager.cs:65
void OnCardAddedToZone(Card t, int x, int z)
Definition: Map.cs:806
Definition: NoGoal.cs:4
CodexManager codex
Definition: Player.cs:1138
static bool ignoreSpawnAnime
Definition: Zone.cs:81
void RemoveCard(Card c)

References CodexManager.AddSpawn(), Card.Chara, Player.codex, Card.hasSpawned, Card.id, Card.isThing, Map.OnCardAddedToZone(), Card.parent, Card.placeState, Card.PlayAnimeLoot(), EClass.player, ICardParent.RemoveCard(), and Chara.SetAI().

◆ AddCard() [3/3]

Card Zone.AddCard ( Card  t,
Point  point 
)
inline

Definition at line 1994 of file Zone.cs.

1995 {
1996 return AddCard(t, point.x, point.z);
1997 }

References Point.x, and Point.z.

Referenced by InvOwnerChaosOffering._OnProcess(), TraitShrine._OnUse(), Game.AddAdventurers(), ZoneUtil.AddMerchant(), Quest.AddResident(), Chara.ApplyDeathPenalty(), RecipeCard.Build(), Map.Burn(), AI_Shopping.Buy(), ClaimZone(), TraitCrafter.Craft(), Card.Die(), Chara.Die(), Chara.DropHeld(), Player.DropReward(), Chara.DropThing(), ZonePreEnterBout.Execute(), ZonePreEnterDigStairs.Execute(), ZonePreEnterEncounter.Execute(), DramaOutcome.fiama_pet(), CoreDebug.Fix_LostCore(), Generate(), Zone_SnowGrave.GenerateGrave(), FortuneRollData.GetPrize(), GrowSystem.Grow(), TraitFoodEggFertilized.Incubate(), Chara.MakeGrave(), SurvivalManager.MeteorThing(), Map.MineBlock(), Chara.MoveHome(), Chara.MoveZone(), Zone_Void.OnActivate(), Region.OnAdvanceHour(), Zone_WindRest.OnAfterSimulate(), Zone_Nymelle.OnBeforeSimulate(), TaskHarvest.OnCreateProgress(), TaskBuild.OnDestroy(), SurvivalManager.OnExpandFloor(), Zone_DungeonFairy.OnGenerateMap(), Zone_DungeonMino.OnGenerateMap(), Zone_DungeonPuppy.OnGenerateMap(), Zone_TestRoom.OnGenerateMap(), MapGenDungen.OnGenerateTerrain(), GrowSystemTree.OnHitFail(), ZoneEventSiege.OnKill(), SurvivalManager.OnMineWreck(), AI_Fish.ProgressFish.OnProgressComplete(), QuestCraft.OnProgressComplete(), TaskMoveInstalled.OnProgressComplete(), TraitDiary.OnRead(), QuestEscort.OnStart(), TraitFarmChest.OnUse(), TraitGiftNewYear.OnUse(), TraitStairsLocked.OnUse(), ZoneEventDefenseGame.OnVisit(), DramaManager.ParseLine(), ActRestrain.Perform(), HotItemActionSleep.Perform(), GrowSystem.Perish(), Chara.Pick(), Chara.PickOrDrop(), Zone_Dungeon.PlaceRail(), GenRoom.Populate(), ActEffect.Proc(), ActEffect.ProcAt(), FactionBranch.PutInMailBox(), DramaOutcome.PutOutFire(), TaskCraft.PutOutResources(), DramaOutcome.QuestExploration_AfterCrystal(), CoreDebug.QuickStart(), TraitBaseSpellbook.ReadFailEffect(), FactionBranch.Recruit(), Religion.Reforge(), Map.ReloadRoom(), SerializedCards.Restore(), Revive(), Chara.Revive(), AI_Craft_Snowman.Run(), AI_Idle.Run(), AI_Slaughter.Run(), AI_UseCrafter.Run(), Meeting.SetChara(), Chara.SetGlobal(), ZoneEventMusic.Spawn(), CoreDebug.Spawn(), SpawnAltar(), Card.SpawnLoot(), SpawnLostItems(), SurvivalManager.StartRaid(), ActThrow.Throw(), TryAddThing(), BiomeProfile.ClusterThing.TryCreate(), Chara.TryDropBossLoot(), TryGenerateBigDaddy(), TryGenerateShrine(), Religion.TryGetGift(), Chara.TryHoldCard(), Chara.TryPutShared(), AI_Shopping.TryRestock(), Map.TryShatter(), Map.TrySmoothPick(), TrySpawnFollower(), DramaOutcome.Tutorial1(), TraitFoodEgg.Update(), TraitSpotBiome.Update(), CoreDebug.UpdateInput(), Chara.Vomit(), and ActEffect.Wish().

◆ AddCardSplinkle()

Card Zone.AddCardSplinkle ( Card  t,
Point  center,
int  radius = 4 
)
inline

Definition at line 1959 of file Zone.cs.

1960 {
1961 Point point = new Point(center);
1962 for (int i = 0; i < 1000; i++)
1963 {
1964 point.x = center.x + EClass.rnd(radius) - EClass.rnd(radius);
1965 point.z = center.z + EClass.rnd(radius) - EClass.rnd(radius);
1966 if (point.IsValid && !point.IsBlocked && !point.HasChara)
1967 {
1968 return AddCard(t, point);
1969 }
1970 }
1971 return AddCard(t, center);
1972 }
bool IsBlocked
Definition: Point.cs:363
bool HasChara
Definition: Point.cs:238

References Point.HasChara, Point.IsBlocked, Point.IsValid, and EClass.rnd().

Referenced by ZoneUtil.AddBandits().

◆ AddChara() [1/2]

Chara Zone.AddChara ( string  id,
int  x,
int  z 
)
inline

Definition at line 1974 of file Zone.cs.

1975 {
1976 return AddCard(CharaGen.Create(id), x, z) as Chara;
1977 }
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17

References CharaGen.Create().

Referenced by DramaOutcome.event_az(), DramaOutcome.event_swordkeeper(), Zone_Specwing.OnActivate(), Zone_Nymelle.OnBeforeSimulate(), DramaOutcome.QuestDefense_0(), and DramaOutcome.QuestDefense_1().

◆ AddChara() [2/2]

Chara Zone.AddChara ( string  id,
Point  p 
)
inline

Definition at line 1979 of file Zone.cs.

1980 {
1981 return AddChara(id, p.x, p.z);
1982 }
Chara AddChara(string id, int x, int z)
Definition: Zone.cs:1974

References Point.x, and Point.z.

◆ AddGlobalCharasOnActivate()

void Zone.AddGlobalCharasOnActivate ( )
inline

Definition at line 1555 of file Zone.cs.

1556 {
1557 Point spawnPosPC = null;
1558 if (EClass.pc.currentZone == this)
1559 {
1560 spawnPosPC = GetSpawnPos(EClass.pc);
1561 }
1562 if (spawnPosPC == null)
1563 {
1564 spawnPosPC = map.GetCenterPos();
1565 }
1566 if (spawnPosPC.IsValid && EClass.pc.global.transition != null && spawnPosPC.HasBlock)
1567 {
1568 spawnPosPC = spawnPosPC.GetNearestPoint();
1569 }
1570 spawnPosPC = spawnPosPC.Clamp(useBounds: true).GetNearestPoint();
1571 foreach (Chara c in EClass.game.cards.globalCharas.Values)
1572 {
1573 if (c.currentZone != this)
1574 {
1575 continue;
1576 }
1577 if (c.parent is Chara)
1578 {
1579 Chara chara = c.parent as Chara;
1580 c.currentZone = chara.currentZone;
1581 }
1582 else
1583 {
1584 if (c.isDead)
1585 {
1586 continue;
1587 }
1588 if (c.isRestrained && c.currentZone == EClass.pc.currentZone && (!c.pos.IsValid || c.pos.FindThing<TraitShackle>() == null))
1589 {
1590 c.isRestrained = false;
1591 }
1592 if (c.global.transition != null)
1593 {
1594 Point pos = (c.IsPC ? spawnPosPC : (c.IsPCParty ? spawnPosPC.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true) : GetSpawnPos(c)));
1595 if (c.IsPCParty && !c.IsPC)
1596 {
1597 if (c.host == EClass.pc)
1598 {
1599 pos.Set(spawnPosPC);
1600 }
1601 else if (pos.Equals(spawnPosPC) || !PathManager.Instance.IsPathClear(spawnPosPC, pos, c, 5))
1602 {
1603 c.pos.Set(spawnPosPC);
1604 if (!spawnPosPC.ForeachNearestPoint(delegate(Point p)
1605 {
1606 if (PathManager.Instance.IsPathClear(spawnPosPC, p, c, 10) && !p.Equals(spawnPosPC))
1607 {
1608 pos.Set(p);
1609 return true;
1610 }
1611 return false;
1612 }, allowBlock: false, EClass.pc.party.members.Count >= 12, allowInstalled: true, ignoreCenter: true, EClass._zone.IsRegion ? 2 : 6))
1613 {
1614 pos.Set(spawnPosPC);
1615 }
1616 }
1617 }
1618 c.pos.Set(pos);
1619 c.global.transition = null;
1620 }
1621 map.charas.Add(c);
1623 }
1624 }
1626 {
1627 Point nearestPoint = spawnPosPC.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: true, ignoreCenter: true);
1628 item.enemy = null;
1629 item.pos.Set(nearestPoint);
1630 map.charas.Add(item);
1632 }
1634 }
GlobalCharaList globalCharas
Definition: CardManager.cs:46
bool isRestrained
Definition: Card.cs:567
override bool IsPC
Definition: Chara.cs:626
Chara host
Definition: Chara.cs:33
Zone currentZone
Definition: Chara.cs:257
bool isDead
Definition: Chara.cs:391
CardManager cards
Definition: Game.cs:156
Point GetCenterPos()
Definition: MapBounds.cs:52
static PathManager Instance
Definition: PathManager.cs:16
bool IsPathClear(Point origin, Point dest, IPathfindWalker walker, int radius)
Definition: PathManager.cs:47
Point GetNearestPoint(bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int minRadius=0)
Definition: Point.cs:619
bool Equals(int _x, int _z)
Definition: Point.cs:960
bool ForeachNearestPoint(Func< Point, bool > endFunc, bool allowBlock=false, bool allowChara=true, bool allowInstalled=true, bool ignoreCenter=false, int maxRange=30)
Definition: Point.cs:691
Point Clamp(bool useBounds=false)
Definition: Point.cs:1008
bool HasBlock
Definition: Point.cs:141
Thing FindThing(Func< Thing, bool > func)
Definition: Point.cs:1140
Point GetSpawnPos(Chara c, ZoneTransition.EnterState destState=ZoneTransition.EnterState.Auto)
Definition: Zone.cs:1352

References Map.AddCardOnActivate(), Game.cards, Map.charas, Point.Clamp(), Chara.currentZone, Point.Equals(), Point.FindThing(), EClass.game, MapBounds.GetCenterPos(), Point.GetNearestPoint(), Chara.global, CardManager.globalCharas, Point.HasBlock, Chara.host, PathManager.Instance, Chara.isDead, PathManager.IsPathClear(), Chara.IsPC, Chara.IsPCParty, Card.isRestrained, Point.IsValid, item, Player.listCarryoverMap, Card.parent, EClass.pc, EClass.player, Card.pos, Point.Set(), and GlobalData.transition.

Referenced by Activate().

◆ AddRandomVisitor()

Chara Zone.AddRandomVisitor ( bool  guest = false)
inline

Definition at line 3342 of file Zone.cs.

3343 {
3344 Trait random = map.Installed.traits.GetTraitSet<TraitSpotExit>().GetRandom();
3345 if (random == null)
3346 {
3347 return null;
3348 }
3349 Point point = random.GetPoint();
3350 Chara chara = null;
3351 if (guest)
3352 {
3353 Zone z = EClass.world.FindZone("wilds");
3354 chara = EClass.game.cards.ListGlobalChara(z).RandomItem();
3355 if (chara != null)
3356 {
3357 AddCard(chara, point);
3358 Msg.Say("guestArrive", chara);
3359 chara.visitorState = VisitorState.Arrived;
3360 }
3361 }
3362 else
3363 {
3364 chara = CharaGen.CreateFromFilter("c_wilds");
3365 AddCard(chara, point);
3366 chara.goalListType = GoalListType.Enemy;
3367 }
3368 return chara;
3369 }
GoalListType
Definition: GoalListType.cs:2
VisitorState
Definition: VisitorState.cs:2
List< Chara > ListGlobalChara(Zone z)
Definition: CardManager.cs:103
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
Definition: CharaGen.cs:22
PropsInstalled Installed
Definition: Map.cs:123
TraitManager traits
Definition: Props.cs:18
Zone FindZone(int lv)
Definition: Spatial.cs:728
TraitSet GetTraitSet(Type t)
Definition: TraitManager.cs:94
Definition: Trait.cs:7
Point GetPoint()
Definition: Trait.cs:756
Definition: Zone.cs:12

References Game.cards, CharaGen.CreateFromFilter(), Spatial.FindZone(), EClass.game, Trait.GetPoint(), TraitManager.GetTraitSet(), guest, Map.Installed, CardManager.ListGlobalChara(), Msg.Say(), Props.traits, and EClass.world.

◆ AddThing() [1/2]

Card Zone.AddThing ( string  id,
int  x,
int  z 
)
inline

◆ AddThing() [2/2]

Card Zone.AddThing ( string  id,
Point  p 
)
inline

Definition at line 1989 of file Zone.cs.

1990 {
1991 return AddThing(id, p.x, p.z);
1992 }
Card AddThing(string id, int x, int z)
Definition: Zone.cs:1984

References Point.x, and Point.z.

◆ ApplyBackerPet()

void Zone.ApplyBackerPet ( bool  draw)
inline

Definition at line 3845 of file Zone.cs.

3846 {
3847 bool flag = this is Zone_Yowyn && base.lv == -1;
3848 IList<SourceBacker.Row> list = EClass.sources.backers.listPet.Copy();
3849 list.Shuffle();
3851 {
3852 list.ForeachReverse(delegate(SourceBacker.Row a)
3853 {
3854 if (EClass.player.doneBackers.Contains(a.id))
3855 {
3856 list.Remove(a);
3857 }
3858 });
3859 }
3860 foreach (Chara chara in EClass._map.charas)
3861 {
3862 if (chara.IsGlobal || chara.IsMinion)
3863 {
3864 continue;
3865 }
3866 if (chara.isBackerContent)
3867 {
3868 if (chara.sourceBacker.isStatic != 0)
3869 {
3870 continue;
3871 }
3872 if (chara.id != "follower")
3873 {
3874 chara.RemoveBacker();
3875 }
3876 }
3877 if ((flag && chara.race.id != "cat") || (!EClass.debug.enable && EClass.rnd((!flag) ? (draw ? 3 : 10) : (draw ? 1 : 2)) != 0))
3878 {
3879 continue;
3880 }
3881 foreach (SourceBacker.Row item in list)
3882 {
3883 if (item.chara == chara.id)
3884 {
3885 chara.ApplyBacker(item.id);
3886 list.Remove(item);
3887 break;
3888 }
3889 }
3890 }
3891 }
SourceBacker.Row sourceBacker
Definition: Card.cs:929
void RemoveBacker()
Definition: Card.cs:7232
void ApplyBacker(int bid)
Definition: Card.cs:7196
bool isBackerContent
Definition: Card.cs:926
override bool IsGlobal
Definition: Chara.cs:624
override bool IsMinion
Definition: Chara.cs:641
SourceRace.Row race
Definition: Chara.cs:466
List< Row > listPet
Definition: SourceBacker.cs:76

References SourceManager.backers, Core.config, EClass.core, CoreConfig.Test.ignoreBackerDestoryFlag, SourceBacker.listPet, EClass.sources, and CoreConfig.test.

Referenced by Zone_Field.OnGenerateMap(), and Zone_Yowyn.OnVisitNewMapOrRegenerate().

◆ CanDestroy()

bool Zone.CanDestroy ( )
inline

Definition at line 1799 of file Zone.cs.

1800 {
1802 {
1803 return false;
1804 }
1805 if (IsInstance)
1806 {
1807 return true;
1808 }
1809 bool flag = false;
1810 switch (id)
1811 {
1812 case "cave_dragon":
1813 if (!(this is Zone_DungeonDragon))
1814 {
1815 flag = true;
1816 }
1817 break;
1818 case "cave_yeek":
1819 if (!(this is Zone_DungeonYeek))
1820 {
1821 flag = true;
1822 }
1823 break;
1824 case "cave_mino":
1825 if (!(this is Zone_DungeonMino))
1826 {
1827 flag = true;
1828 }
1829 break;
1830 case "cave_dead":
1831 if (!(this is Zone_DungeonDead))
1832 {
1833 flag = true;
1834 }
1835 break;
1836 }
1837 Zone topZone = GetTopZone();
1838 if (!flag)
1839 {
1840 if (base.dateExpire == 0 || !EClass.world.date.IsExpired(base.dateExpire))
1841 {
1842 return false;
1843 }
1844 if (!base.isRandomSite && !(this is Zone_Field) && (topZone == null || topZone == this || topZone.FindDeepestZone() == this))
1845 {
1846 return false;
1847 }
1848 }
1849 if (EClass.pc.currentZone == null || EClass.pc.currentZone is Zone_Tent || topZone == EClass.pc.currentZone.GetTopZone() || (EClass.player.nextZone != null && topZone == EClass.player.nextZone.GetTopZone()))
1850 {
1851 return false;
1852 }
1854 {
1856 if (zone != null && zone.GetTopZone() == this)
1857 {
1858 return false;
1859 }
1860 }
1861 return true;
1862 }
SpatialManager spatials
Definition: Game.cs:153
Zone nextZone
Definition: Player.cs:1250
Zone Find(string id)
Zone FindDeepestZone()
Definition: Spatial.cs:715

References Chara.currentZone, World.date, SpatialManager.Find(), Spatial.FindDeepestZone(), EClass.game, GetTopZone(), instance, Date.IsExpired(), IsInstance, Player.nextZone, EClass.pc, EClass.player, Player.simulatingZone, Game.spatials, ZoneInstance.uidZone, and EClass.world.

Referenced by Region.OnActivate().

◆ ClaimZone()

void Zone.ClaimZone ( bool  debug = false,
Point  pos = null 
)
inline

Definition at line 1729 of file Zone.cs.

1730 {
1733 branch = new FactionBranch();
1734 branch.OnCreate(this);
1735 if (base.icon == 0)
1736 {
1737 base.icon = 332;
1738 }
1739 instance = null;
1740 base.dateExpire = 0;
1742 Register();
1743 foreach (Thing thing in map.things)
1744 {
1745 thing.isNPCProperty = false;
1746 }
1749 if (debug)
1750 {
1751 for (int i = 0; i < 7; i++)
1752 {
1753 Chara chara = CharaGen.CreateFromFilter("c_neutral");
1754 EClass._zone.AddCard(chara, EClass._map.bounds.GetRandomPoint().GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: false));
1755 branch.AddMemeber(chara);
1756 }
1757 }
1758 else
1759 {
1760 Msg.Say("claimedZone");
1761 EClass.Branch.Log("claimedZone");
1762 EClass.Sound.Play("jingle_embark");
1763 EClass.pc.PlaySound("build");
1764 if (pos == null)
1765 {
1766 pos = EClass.pc.pos.GetNearestPoint(allowBlock: false, allowChara: true, allowInstalled: false);
1767 }
1768 Effect.Get("aura_heaven").Play(pos);
1769 EClass._zone.AddCard(ThingGen.Create("core_zone"), pos).SetPlaceState(PlaceState.installed);
1770 }
1771 base.idPrefix = 0;
1773 {
1774 EClass.player.spawnZone = EClass._zone;
1775 }
1777 {
1778 EClass._zone.SetBGM(new List<int> { 41, 90, 44, 43 });
1780 }
1781 }
void SetPlaceState(PlaceState newState, bool byPlayer=false)
Definition: Card.cs:3801
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6343
Faction faction
Definition: Chara.cs:429
static Zone _zone
Definition: EClass.cs:21
Definition: Effect.cs:7
static Effect Get(Effect original)
Definition: Effect.cs:85
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
Definition: Effect.cs:100
void SetZone(int gx, int gy, Zone z, bool updateMesh=false)
Definition: EloMap.cs:234
void OnCreate(Zone zone)
string Log(string idLang, string ref1=null, string ref2=null, string ref3=null, string ref4=null)
Point GetRandomPoint()
Definition: MapBounds.cs:97
void RevealAll(bool reveal=true)
Definition: Map.cs:905
MapBounds bounds
Definition: Map.cs:52
EloMap elomap
Definition: Scene.cs:149
void SetInt(int id, int value=0)
Definition: Spatial.cs:580
void Register()
Definition: Spatial.cs:630
void RefreshPlaylist()
Definition: Zone.cs:3045
void SetBGM(List< int > ids, bool refresh=true, float fadeDuration=0f)
Definition: Zone.cs:3003

References EClass._map, EClass._zone, AddCard(), FactionBranch.AddMemeber(), Map.bounds, EClass.Branch, ThingGen.Create(), CharaGen.CreateFromFilter(), World.date, Scene.elomap, Chara.faction, EClass.game, Effect.Get(), Point.GetNearestPoint(), MapBounds.GetRandomPoint(), Date.GetRaw(), FactionBranch.Log(), FactionBranch.OnClaimZone(), FactionBranch.OnCreate(), EClass.pc, Effect.Play(), Card.PlaySound(), Card.pos, RefreshPlaylist(), Map.RevealAll(), Msg.Say(), EClass.scene, SetBGM(), Card.SetPlaceState(), EloMap.SetZone(), EClass.Sound, Game.StartZone, Map.things, EClass.world, Spatial.x, and Spatial.y.

Referenced by SurvivalManager.OnExpandFloor(), TraitDeed.OnRead(), DramaOutcome.QuestExploration_MeetFarris2(), and CoreDebug.QuickStart().

◆ ClearZones()

void Zone.ClearZones ( Zone  current = null)
inline

Definition at line 1919 of file Zone.cs.

1920 {
1921 if (map != null)
1922 {
1923 UnloadMap();
1924 }
1925 base.isGenerated = false;
1926 Zone topZone = GetTopZone();
1927 if (topZone != this)
1928 {
1929 topZone.ClearZones(this);
1930 return;
1931 }
1932 children.ForeachReverse(delegate(Spatial c)
1933 {
1934 if (c != current)
1935 {
1936 c.Destroy();
1937 }
1938 });
1939 }
virtual void Destroy()
Definition: Spatial.cs:690
List< Spatial > children
Definition: Spatial.cs:37

References ClearZones(), and Spatial.Destroy().

Referenced by Activate(), and ClearZones().

◆ CountMinions()

int Zone.CountMinions ( Chara  c)
inline

Definition at line 3777 of file Zone.cs.

3778 {
3779 int num = 0;
3780 foreach (Chara chara in EClass._map.charas)
3781 {
3782 if (chara.c_uidMaster == c.uid && chara.c_minionType == MinionType.Default)
3783 {
3784 num++;
3785 }
3786 }
3787 return num;
3788 }
MinionType
Definition: MinionType.cs:2
MinionType c_minionType
Definition: Card.cs:989

References EClass._map, Card.c_minionType, Card.c_uidMaster, and Map.charas.

Referenced by WidgetStatsBar.Build(), Chara.CanBeTempAlly(), ActEffect.ProcAt(), and GoalCombat.TryUseAbility().

◆ CreateBP()

void Zone.CreateBP ( )
inline

Definition at line 2363 of file Zone.cs.

2364 {
2365 bp = new ZoneBlueprint();
2366 bp.Create();
2367 bp.genSetting.seed = base.Seed;
2368 OnCreateBP();
2369 }
virtual void OnCreateBP()
Definition: Zone.cs:2371

References ZoneBlueprint.Create().

◆ CreatePlaylist()

Playlist Zone.CreatePlaylist ( ref List< int >  list,
Playlist  mold = null 
)
inline

Definition at line 3101 of file Zone.cs.

3102 {
3103 Playlist playlist = EClass.Sound.plBlank.Instantiate();
3104 if (list.Count == 0 && (bool)mold)
3105 {
3106 list = mold.ToInts();
3107 playlist.shuffle = mold.shuffle;
3108 playlist.minSwitchTime = mold.minSwitchTime;
3109 playlist.nextBGMOnSwitch = mold.nextBGMOnSwitch;
3110 playlist.ignoreLoop = mold.ignoreLoop;
3111 playlist.keepBGMifSamePlaylist = mold.keepBGMifSamePlaylist;
3112 playlist.name = mold.name;
3113 }
3114 foreach (int item in list)
3115 {
3116 playlist.list.Add(new Playlist.Item
3117 {
3118 data = EClass.core.refs.dictBGM.TryGetValue(item, 1)
3119 });
3120 }
3121 return playlist;
3122 }

References item, and EClass.Sound.

◆ Deactivate()

void Zone.Deactivate ( )
inline

Definition at line 1636 of file Zone.cs.

1637 {
1638 if (!IsUserZone && !IsPCFaction && map != null)
1639 {
1640 List<Thing> list = new List<Thing>();
1641 foreach (Thing thing in map.things)
1642 {
1643 if (thing.rarity >= Rarity.Artifact && thing.HasTag(CTAG.godArtifact))
1644 {
1645 list.Add(thing);
1646 }
1647 }
1648 if (this is Zone_Tent)
1649 {
1650 foreach (Thing item in map.props.stocked.Things.Concat(map.props.roaming.Things))
1651 {
1652 if (item.IsContainer)
1653 {
1654 foreach (Thing thing2 in item.things)
1655 {
1656 if (thing2.trait is TraitTent)
1657 {
1658 list.Add(thing2);
1659 }
1660 }
1661 }
1662 if (item.trait is TraitTent)
1663 {
1664 list.Add(item);
1665 }
1666 }
1667 }
1668 if (list.Count > 0)
1669 {
1670 Msg.Say("pick_valuable");
1671 foreach (Thing item2 in list)
1672 {
1673 Msg.Say("pick_valuable2", item2);
1674 EClass.pc.AddCard(item2);
1675 }
1676 }
1677 }
1678 base.isPeace = false;
1680 if (IsPCFaction)
1681 {
1682 foreach (Chara member in branch.members)
1683 {
1684 member.ValidateWorks();
1685 }
1686 }
1687 EClass.game.lastActiveZone = EClass.game.activeZone;
1688 base.lastActive = EClass.world.date.GetRaw();
1689 map.OnDeactivate();
1690 EClass.scene.Clear();
1691 EClass.game.activeZone = null;
1692 if (IsInstance)
1693 {
1694 UnloadMap();
1695 base.isGenerated = false;
1696 }
1697 if (forceRegenerate)
1698 {
1699 UnloadMap();
1700 }
1701 OnDeactivate();
1702 }
Rarity
Definition: Rarity.cs:2
Card AddCard(Card c)
Definition: Card.cs:3138
Rarity rarity
Definition: Card.cs:315
bool HasTag(CTAG tag)
Definition: Card.cs:2623
void ValidateWorks()
Definition: Chara.cs:9391
void OnDeactivate()
Definition: Map.cs:205
PropsManager props
Definition: Map.cs:91
PropsRoaming roaming
Definition: PropsManager.cs:10
PropsStocked stocked
Definition: PropsManager.cs:6
List< Thing > Things
Definition: Props.cs:37
void Clear()
Definition: Scene.cs:353
virtual void OnBeforeDeactivate()
Definition: Zone.cs:1168
virtual bool IsUserZone
Definition: Zone.cs:273
virtual void OnDeactivate()
Definition: Zone.cs:1172

References Game.activeZone, Card.AddCard(), Scene.Clear(), World.date, EClass.game, Date.GetRaw(), Card.HasTag(), item, FactionBranch.members, Map.OnDeactivate(), EClass.pc, Map.props, Card.rarity, PropsManager.roaming, Msg.Say(), EClass.scene, PropsManager.stocked, Map.things, Props.Things, Card.trait, Chara.ValidateWorks(), and EClass.world.

Referenced by Activate().

◆ Destroy()

override void Zone.Destroy ( )
inlinevirtual

Reimplemented from Spatial.

Definition at line 1900 of file Zone.cs.

1901 {
1902 children.ForeachReverse(delegate(Spatial z)
1903 {
1904 z.Destroy();
1905 });
1906 if (map != null)
1907 {
1908 UnloadMap();
1909 }
1910 if (parent != null && parent.IsRegion && instance == null)
1911 {
1912 EClass.scene.elomap.SetZone(base.x, base.y, null, updateMesh: true);
1913 }
1914 EClass.game.spatials.Remove(this);
1915 destryoed = true;
1916 base.isGenerated = false;
1917 }
void Remove(Spatial s)
Spatial parent
Definition: Spatial.cs:10

References Spatial.Destroy(), Scene.elomap, EClass.game, SpatialManager.Remove(), EClass.scene, EloMap.SetZone(), and Game.spatials.

◆ Evalue() [1/2]

int Zone.Evalue ( int  ele)
inline

Definition at line 529 of file Zone.cs.

530 {
531 return elements.Value(ele);
532 }
int Value(int ele)
ElementContainerZone elements
Definition: Zone.cs:43

References elements, and ElementContainer.Value().

Referenced by TraitWrench.IsValidTarget().

◆ Evalue() [2/2]

int Zone.Evalue ( string  alias)
inline

Definition at line 534 of file Zone.cs.

535 {
536 return elements.Value(EClass.sources.elements.alias[alias].id);
537 }
SourceElement elements

References SourceManager.elements, elements, EClass.sources, and ElementContainer.Value().

◆ Export() [1/2]

void Zone.Export ( )
inline

Definition at line 3300 of file Zone.cs.

3301 {
3303 string text = pathExport;
3304 IO.Copy(text, CorePath.ZoneSave + "Backup/");
3305 Export(text);
3306 Msg.Say("Exported Map:" + text);
3307 }
static void Copy(string fromPath, string toPath)
Definition: IO.cs:278
void ResetEditorPos()
Definition: Map.cs:357
void Export()
Definition: Zone.cs:3300

References EClass._map, Map.ResetEditorPos(), Msg.Say(), and CorePath.ZoneSave.

◆ Export() [2/2]

void Zone.Export ( string  path,
PartialMap  partial = null,
bool  usermap = false 
)
inline

Definition at line 3217 of file Zone.cs.

3218 {
3219 if (subset != null)
3220 {
3221 SE.Beep();
3222 return;
3223 }
3224 try
3225 {
3226 ZoneExportData zoneExportData = new ZoneExportData
3227 {
3228 name = name,
3229 usermap = usermap
3230 };
3232 if (!map.config.retainDecal)
3233 {
3235 }
3236 map.Save(IO.TempPath + "/", zoneExportData, partial);
3237 map.ExportMetaData(IO.TempPath + "/", Path.GetFileNameWithoutExtension(path), partial);
3238 if (partial == null)
3239 {
3240 IO.CopyDir(base.pathSave + "Texture Replace", IO.TempPath + "/Texture Replace");
3241 }
3242 IO.SaveFile(IO.TempPath + "/export", zoneExportData, compress: true);
3243 using (ZipFile zipFile = new ZipFile())
3244 {
3245 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
3246 zipFile.AddDirectory(IO.TempPath);
3247 zipFile.Save(path);
3248 zipFile.Dispose();
3249 }
3251 }
3252 catch (Exception ex)
3253 {
3254 EClass.ui.Say(ex.Message + ":" + path);
3255 }
3256 }
static void CreateTempDirectory(string path=null)
Definition: IO.cs:379
static string TempPath
Definition: IO.cs:64
static void SaveFile(string path, object obj, bool compress=false, JsonSerializerSettings setting=null)
Definition: IO.cs:89
static void DeleteTempDirectory(string path=null)
Definition: IO.cs:384
bool retainDecal
Definition: MapConfig.cs:44
void ExportMetaData(string _path, string id, PartialMap partial=null)
Definition: Map.cs:720
void ClearRainAndDecal()
Definition: Map.cs:1526
string name
Definition: Spatial.cs:19

References Map.ClearRainAndDecal(), Map.config, Map.ExportMetaData(), MapConfig.retainDecal, Map.Save(), and EClass.ui.

Referenced by ZoneInspector.Export(), LayerUploader.ExportMap(), CoreDebug.InitDebugCommands(), and PartialMap.Save().

◆ ExportDialog()

void Zone.ExportDialog ( string  dir = null)
inline

Definition at line 3258 of file Zone.cs.

3259 {
3261 {
3262 string text = StandaloneFileBrowser.SaveFilePanel("Export Zone", dir ?? CorePath.ZoneSave, "new zone", "z");
3263 if (!string.IsNullOrEmpty(text))
3264 {
3265 Export(text);
3266 Msg.SayRaw("Exported Zone");
3267 }
3268 });
3269 }
void WaitForEndOfFrame(Action action)
Definition: BaseCore.cs:61
static string SayRaw(string text)
Definition: Msg.cs:118
static string SaveFilePanel(string title, string directory, string defaultName, string extension)

References EClass.core, if(), SFB.StandaloneFileBrowser.SaveFilePanel(), Msg.SayRaw(), BaseCore.WaitForEndOfFrame(), and CorePath.ZoneSave.

Referenced by CoreDebug.InitDebugCommands().

◆ FindChara() [1/2]

Chara Zone.FindChara ( int  uid)
inline

Definition at line 3129 of file Zone.cs.

3130 {
3131 return map.charas.Find((Chara c) => c.uid == uid);
3132 }
int uid
Definition: Spatial.cs:70

References Map.charas, and Card.uid.

◆ FindChara() [2/2]

Chara Zone.FindChara ( string  id)
inline

Definition at line 3124 of file Zone.cs.

3125 {
3126 return map.charas.Find((Chara c) => c.id == id);
3127 }

References Map.charas, and Card.id.

Referenced by DramaCustomSequence.Build(), and Zone_CurryRuinDungeon.OnGenerateMap().

◆ Generate()

void Zone.Generate ( )
inline

Definition at line 2375 of file Zone.cs.

2376 {
2377 base.isGenerated = true;
2378 if (bp == null)
2379 {
2380 CreateBP();
2381 }
2382 if (bp.map == null)
2383 {
2384 bp.GenerateMap(this);
2385 }
2386 map.SetZone(this);
2387 Zone_Field zone_Field = this as Zone_Field;
2388 bool flag = IdBiome == "Sand" || IdBiome == "Water" || IsUnderwater;
2389 if (flag)
2390 {
2391 int num = 1 + EClass.rnd((IdBiome == "Water") ? 3 : 2);
2392 for (int i = 0; i < num; i++)
2393 {
2394 Point randomSurface = EClass._map.bounds.GetRandomSurface(centered: false, walkable: true, allowWater: true);
2395 if (!randomSurface.HasObj && !randomSurface.HasThing)
2396 {
2397 Thing t = ThingGen.Create("pearl_oyster", new string[3] { "wood_birch", "poplar", "coralwood" }.RandomItem(), ContentLv);
2398 EClass._zone.AddCard(t, randomSurface).Install();
2399 }
2400 }
2401 num = 4 + EClass.rnd(5);
2402 for (int j = 0; j < num; j++)
2403 {
2404 Point randomSurface2 = EClass._map.bounds.GetRandomSurface(centered: false, walkable: true, allowWater: true);
2405 if (!randomSurface2.HasObj && !randomSurface2.HasThing && (IsUnderwater || randomSurface2.cell.IsTopWaterAndNoSnow || EClass.rnd(6) == 0))
2406 {
2407 EClass._zone.AddCard(ThingGen.Create("70", -1, ContentLv), randomSurface2);
2408 }
2409 }
2410 for (int k = 0; k < EClass.rnd(EClass.rnd(base.isBeach ? 5 : 3) + 1); k++)
2411 {
2412 Point randomSurface3 = EClass._map.bounds.GetRandomSurface(centered: false, walkable: true, allowWater: true);
2413 if (!randomSurface3.HasObj)
2414 {
2415 EClass._zone.AddCard(ThingGen.Create("bottle_message"), randomSurface3);
2416 }
2417 }
2418 }
2419 if (IsUnderwater)
2420 {
2421 for (int l = 0; l < 30 + EClass.rnd(30); l++)
2422 {
2423 SpawnMob(null, SpawnSetting.Fish());
2424 }
2425 Crawler crawler = Crawler.Create("pasture");
2426 int num2 = (EClass.debug.enable ? 3 : EClass.rnd(EClass.rnd(EClass.rnd(EClass.rnd(5) + 1) + 1) + 1));
2427 bool flag2 = this is Zone_Field;
2428 Thing seed = null;
2429 if (IsNefia)
2430 {
2431 int num3 = Mathf.Min(EClass._zone.DangerLv, EClass.pc.Evalue(286) * 2 / 3);
2432 if (num3 > 0)
2433 {
2435 Rand.SetSeed(EClass._zone.uid * 10 + num3);
2436 TraitSeed.LevelSeed(seed, (seed.trait as TraitSeed).row, num3);
2437 Rand.SetSeed();
2438 seed.elements.SetBase(2, EClass.curve(seed.encLV, 50, 10, 80));
2439 }
2440 }
2441 crawler.CrawlUntil(EClass._map, () => EClass._map.GetRandomPoint(), num2 + (flag2 ? 4 : 0), delegate(Crawler.Result r)
2442 {
2443 int num6 = 137;
2444 foreach (Point point in r.points)
2445 {
2446 if (!point.cell.isModified && !point.HasThing && !point.HasBlock && !point.HasObj)
2447 {
2448 map.SetObj(point.x, point.z, num6);
2449 int idx = 3 + ((EClass.rnd(3) == 0) ? 1 : 0) + ((EClass.rnd(3) == 0) ? (-1) : 0) + ((EClass.rnd(3) == 0) ? (-1) : 0);
2450 point.growth.SetStage(idx);
2451 if (seed != null)
2452 {
2453 EClass._map.AddPlant(point, seed);
2454 }
2455 }
2456 }
2457 return false;
2458 });
2459 crawler.CrawlUntil(tries: EClass.rnd(EClass.rnd(5) + 1) + 1 + (flag2 ? 20 : 0), map: EClass._map, onStart: () => EClass._map.GetRandomPoint(), canComplete: delegate(Crawler.Result r)
2460 {
2461 int num5 = 136;
2462 foreach (Point point2 in r.points)
2463 {
2464 if (!point2.cell.isModified && !point2.HasThing && !point2.HasBlock && !point2.HasObj)
2465 {
2466 map.SetObj(point2.x, point2.z, num5, 1, EClass.rnd(4));
2467 }
2468 }
2469 return false;
2470 });
2471 crawler.CrawlUntil(tries: EClass.rnd(EClass.rnd(10) + 1) + 3 + (flag2 ? 40 : 0), map: EClass._map, onStart: () => EClass._map.GetRandomPoint(), canComplete: delegate(Crawler.Result r)
2472 {
2473 int idFloor = 121;
2474 foreach (Point point3 in r.points)
2475 {
2476 map.SetFloor(point3.x, point3.z, 97, idFloor, Mathf.Clamp(4 - r.startPos.Distance(point3) + EClass.rnd(3) - EClass.rnd(3), 0, 3));
2477 }
2478 return false;
2479 });
2480 }
2481 if (zone_Field != null)
2482 {
2483 if (EClass.rnd(3) == 0)
2484 {
2485 int num4 = EClass.rnd(2);
2486 for (int m = 0; m < num4; m++)
2487 {
2488 Point randomSurface4 = EClass._map.bounds.GetRandomSurface();
2489 if (!randomSurface4.HasObj && !randomSurface4.HasThing)
2490 {
2492 EClass._zone.AddCard(t2, randomSurface4).Install();
2493 }
2494 }
2495 }
2496 if (EClass.rnd(8) == 0)
2497 {
2498 SpawnAltar();
2499 }
2501 if (!flag && EClass.rnd(EClass.debug.enable ? 1 : 10) == 0)
2502 {
2503 Point randomSurface5 = EClass._map.bounds.GetRandomSurface();
2504 if (randomSurface5.IsValid)
2505 {
2506 EClass._zone.AddCard(CharaGen.Create("priest"), randomSurface5);
2507 }
2508 }
2509 }
2510 map.plDay = CreatePlaylist(ref map._plDay, EClass.Sound.GetPlaylist(IDPlayList) ?? EClass.Sound.GetPlaylist("Day"));
2511 }
@ seed
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Definition: Card.cs:3089
int Evalue(int ele)
Definition: Card.cs:2599
Card Install()
Definition: Card.cs:3795
bool IsTopWaterAndNoSnow
Definition: Cell.cs:712
bool isModified
Definition: Cell.cs:438
static Crawler Create(string id)
Definition: Crawler.cs:193
bool CrawlUntil(Map map, Func< Point > onStart, int tries, Func< Result, bool > canComplete, Action onFail=null)
Definition: Crawler.cs:59
static int curve(long _a, int start, int step, int rate=75)
Definition: EClass.cs:69
void SetStage(int idx, bool renewHarvest=false)
Definition: GrowSystem.cs:437
Point GetRandomSurface(int x, int z, int radius, bool walkable=true, bool allowWater=false)
Definition: MapBounds.cs:182
Point GetRandomPoint(Point center, int radius, int tries=100, bool mustBeWalkable=true, bool requireLos=true)
Definition: Map.cs:2215
List< int > _plDay
Definition: Map.cs:55
void SetFloor(int x, int z, int idMat=0, int idFloor=0)
Definition: Map.cs:957
PlantData AddPlant(Point pos, Thing seed)
Definition: Map.cs:1952
void SetObj(int x, int z, int id=0, int value=1, int dir=0)
Definition: Map.cs:1535
bool HasThing
Definition: Point.cs:251
bool HasObj
Definition: Point.cs:137
Cell cell
Definition: Point.cs:51
GrowSystem growth
Definition: Point.cs:77
static void SetSeed(int a=-1)
Definition: Rand.cs:37
SourceObj objs
static SpawnSetting Fish()
static void LevelSeed(Thing t, SourceObj.Row obj, int num)
Definition: TraitSeed.cs:145
static Thing MakeSeed(string id, PlantData plant=null)
Definition: TraitSeed.cs:88
void GenerateMap(Zone zone)
virtual string IDPlayList
Definition: Zone.cs:143
override int ContentLv
Definition: Zone.cs:98
void SpawnAltar()
Definition: Zone.cs:2547
Playlist CreatePlaylist(ref List< int > list, Playlist mold=null)
Definition: Zone.cs:3101
virtual bool IsNefia
Definition: Zone.cs:287
BiomeProfile biome
Definition: Zone.cs:129
Chara SpawnMob(string id, Point pos=null)
Definition: Zone.cs:2775
virtual string IdBiome
Definition: Zone.cs:131
override int DangerLv
Definition: Zone.cs:110
void TrySpawnFollower()
Definition: Zone.cs:2513
void CreateBP()
Definition: Zone.cs:2363

References EClass._map, Map._plDay, EClass._zone, AddCard(), Map.AddPlant(), Map.bounds, Point.cell, Card.ChangeMaterial(), Crawler.CrawlUntil(), Crawler.Create(), ThingGen.Create(), CharaGen.Create(), EClass.curve(), DangerLv, EClass.debug, CoreDebug.enable, Card.Evalue(), SpawnSetting.Fish(), ZoneBlueprint.GenerateMap(), Map.GetRandomPoint(), MapBounds.GetRandomSurface(), Point.growth, Point.HasBlock, Point.HasObj, Point.HasThing, Card.Install(), Cell.isModified, Cell.IsTopWaterAndNoSnow, Point.IsValid, TraitSeed.LevelSeed(), TraitSeed.MakeSeed(), ZoneBlueprint.map, BiomeProfile.Style.matDoor, SourceManager.objs, EClass.pc, EClass.rnd(), seed, Map.SetFloor(), Map.SetObj(), Rand.SetSeed(), GrowSystem.SetStage(), Map.SetZone(), EClass.Sound, EClass.sources, BiomeProfile.style, Spatial.uid, Point.x, and Point.z.

Referenced by Activate().

◆ GetDeepestLv() [1/2]

int Zone.GetDeepestLv ( )
inline

Definition at line 3134 of file Zone.cs.

3135 {
3136 int max = base.lv;
3137 return GetDeepestLv(ref max);
3138 }
int GetDeepestLv()
Definition: Zone.cs:3134

◆ GetDeepestLv() [2/2]

int Zone.GetDeepestLv ( ref int  max)
inline

Definition at line 3140 of file Zone.cs.

3141 {
3142 if (Mathf.Abs(base.lv) > Mathf.Abs(max))
3143 {
3144 max = base.lv;
3145 }
3146 foreach (Spatial child in children)
3147 {
3148 (child as Zone).GetDeepestLv(ref max);
3149 }
3150 return max;
3151 }

◆ GetDungenID()

virtual string Zone.GetDungenID ( )
inlinevirtual

◆ GetElectricity()

int Zone.GetElectricity ( bool  cost = false)
inline

Definition at line 2964 of file Zone.cs.

2965 {
2966 bool flag = GetSoilCost() > MaxSoil;
2967 int sum = 0;
2968 foreach (Thing thing in EClass._map.things)
2969 {
2970 if (!thing.IsInstalled || thing.trait.Electricity == 0)
2971 {
2972 continue;
2973 }
2974 if (cost)
2975 {
2976 if (thing.trait.Electricity < 0)
2977 {
2978 sum += -thing.trait.Electricity;
2979 }
2980 }
2981 else if (thing.trait.Electricity > 0)
2982 {
2983 sum += thing.trait.Electricity;
2984 }
2985 }
2986 if (!cost)
2987 {
2988 sum += elements.Value(2201) * 10 + BaseElectricity;
2989 if (!flag)
2990 {
2991 EClass._map.bounds.ForeachCell(delegate(Cell c)
2992 {
2993 if (c.sourceObj.id == 118 && c.growth.IsMature)
2994 {
2995 sum += 20;
2996 }
2997 });
2998 }
2999 }
3000 return sum;
3001 }
bool IsInstalled
Definition: Card.cs:2409
GrowSystem growth
Definition: Cell.cs:225
SourceObj.Row sourceObj
Definition: Cell.cs:1072
virtual bool IsMature
Definition: GrowSystem.cs:103
void ForeachCell(Action< Cell > action)
Definition: MapBounds.cs:279
virtual int Electricity
Definition: Trait.cs:119
virtual int BaseElectricity
Definition: Zone.cs:495
virtual int MaxSoil
Definition: Zone.cs:518
int GetSoilCost()
Definition: Zone.cs:3790

References EClass._map, Map.bounds, Trait.Electricity, MapBounds.ForeachCell(), Cell.growth, Card.IsInstalled, GrowSystem.IsMature, Cell.sourceObj, Map.things, Card.trait, and ElementContainer.Value().

Referenced by UIHomeInfo.RefreshInfo().

◆ GetNewZoneID()

virtual string Zone.GetNewZoneID ( int  level)
inlinevirtual

Reimplemented in Zone_CurryRuin, Zone_CursedManor, Zone_Nymelle, and Zone_Vernis.

Definition at line 549 of file Zone.cs.

550 {
551 return base.source.id;
552 }

Referenced by TraitNewZone.CreateZone(), and ActEffect.Proc().

◆ GetOrCreateFortuneRollData()

FortuneRollData Zone.GetOrCreateFortuneRollData ( bool  refresh = true)
inline

Definition at line 3893 of file Zone.cs.

3894 {
3895 if (fortuneRoll == null)
3896 {
3898 fortuneRoll.seed = EClass._zone.uid * 100 + EClass.game.seed;
3899 }
3900 if (refresh || fortuneRoll.count == 0)
3901 {
3903 }
3904 return fortuneRoll;
3905 }
int seed
Definition: Game.cs:201
FortuneRollData fortuneRoll
Definition: Zone.cs:61

References FortuneRollData.count, EClass.game, FortuneRollData.Refresh(), and Game.seed.

Referenced by TraitCrafter.Craft(), and UIDragGridInfo.Init().

◆ GetProfile()

ZoneProfile Zone.GetProfile ( )
inline

Definition at line 2323 of file Zone.cs.

2324 {
2325 string text = IdProfile;
2326 if (text.IsEmpty())
2327 {
2328 Region region = parent as Region;
2329 if (base.lv != 0)
2330 {
2331 text = ((base.lv < 0) ? "Underground" : "Sky");
2332 }
2333 else if (region != null)
2334 {
2336 text = EClass.scene.elomapActor.elomap.GetTileInfo(base.x, base.y).idZoneProfile;
2337 if (bp != null)
2338 {
2339 name = Lang.GetList("zone_" + text.Split('/')[1]).RandomItem();
2340 bp.surrounding = new EloMap.TileInfo[3, 3];
2341 for (int i = 0; i < 3; i++)
2342 {
2343 for (int j = 0; j < 3; j++)
2344 {
2345 bp.surrounding[j, i] = EClass.scene.elomapActor.elomap.GetTileInfo(base.x - 1 + j, base.y - 1 + i);
2346 }
2347 }
2348 if (text == "Random/R_Shore")
2349 {
2350 base.isBeach = true;
2351 }
2352 }
2353 }
2354 else
2355 {
2356 text = "Random";
2357 }
2358 idProfile = text;
2359 }
2360 return ZoneProfile.Load(text);
2361 }
EloMap elomap
Definition: EloMapActor.cs:7
string idZoneProfile
Definition: EloMap.cs:68
Definition: EloMap.cs:8
TileInfo GetTileInfo(int gx, int gy)
Definition: EloMap.cs:286
Definition: Lang.cs:6
static string[] GetList(string id)
Definition: Lang.cs:114
string idProfile
Definition: Spatial.cs:25
EloMap.TileInfo[,] surrounding
static ZoneProfile Load(string id)
Definition: ZoneProfile.cs:73
virtual string IdProfile
Definition: Zone.cs:141
Region Region
Definition: Zone.cs:165

References EloMapActor.elomap, Region.elomap, Scene.elomapActor, Lang.GetList(), EloMap.GetTileInfo(), EloMap.TileInfo.idZoneProfile, EloMapActor.Initialize(), ZoneProfile.Load(), EClass.scene, and ZoneBlueprint.surrounding.

Referenced by ZoneBlueprint.GenerateMap().

◆ GetRandomSpot< T >()

T Zone.GetRandomSpot< T > ( )
inline
Type Constraints
T :Trait 

Definition at line 2055 of file Zone.cs.

2055 : Trait
2056 {
2057 return EClass._map.props.installed.traits.GetRandomThing<T>() as T;
2058 }
PropsInstalled installed
Definition: PropsManager.cs:8

References EClass._map, PropsManager.installed, Map.props, and Props.traits.

◆ GetRandomVisitPos()

Point Zone.GetRandomVisitPos ( Chara  c)
inline

Definition at line 1533 of file Zone.cs.

1534 {
1535 Point point = null;
1536 if (EClass.rnd(3) == 0 && map.rooms.listRoom.Count > 0)
1537 {
1538 point = map.rooms.listRoom.RandomItem().points.RandomItem();
1539 }
1540 if (point == null && EClass.rnd(4) != 0)
1541 {
1542 IEnumerable<Chara> ie = map.charas.Where((Chara t) => t.trait.ShopType != 0 && t.pos != null && t.pos.IsValid);
1543 if (ie.Count() > 0)
1544 {
1545 point = ie.RandomItem().pos.GetRandomPoint(3);
1546 }
1547 }
1548 if (point == null)
1549 {
1550 point = map.bounds.GetRandomSurface(centered: false, walkable: true, !IsPCFaction && !(this is Zone_Civilized)) ?? map.bounds.GetRandomPoint();
1551 }
1552 return point.GetNearestPoint(allowBlock: false, allowChara: false, allowInstalled: false) ?? EClass._map.GetCenterPos().GetNearestPoint();
1553 }
new TraitChara trait
Definition: Chara.cs:505
Point GetRandomPoint(int radius, bool requireLos=true, bool allowChara=true, bool allowBlocked=false, int tries=100)
Definition: Point.cs:769
virtual ShopType ShopType
Definition: Trait.cs:531

References EClass._map, Map.bounds, Map.charas, MapBounds.GetCenterPos(), Point.GetNearestPoint(), MapBounds.GetRandomPoint(), Point.GetRandomPoint(), MapBounds.GetRandomSurface(), Point.IsValid, RoomManager.listRoom, Card.pos, EClass.rnd(), Map.rooms, Trait.ShopType, and Chara.trait.

◆ GetRoot()

ICardParent Zone.GetRoot ( )
inline

Implements ICardParent.

Definition at line 1945 of file Zone.cs.

1946 {
1947 return this;
1948 }

◆ GetSoilCost()

int Zone.GetSoilCost ( )
inline

Definition at line 3790 of file Zone.cs.

3791 {
3792 int i = 0;
3793 EClass._map.bounds.ForeachCell(delegate(Cell c)
3794 {
3795 i += c.sourceObj.costSoil;
3796 });
3797 return i / 10;
3798 }

References EClass._map, Map.bounds, MapBounds.ForeachCell(), and Cell.sourceObj.

Referenced by WidgetStatsBar.Build(), FactionBranch.DailyOutcome(), Map.MineObj(), GrowSystem.PopHarvest(), UIHomeInfo.RefreshInfo(), and GrowSystem.TryPopSeed().

◆ GetSortVal()

int Zone.GetSortVal ( )
inline

Definition at line 3317 of file Zone.cs.

3318 {
3319 if (IsPCFaction)
3320 {
3321 return -10000000 + base.uid;
3322 }
3323 if (this is Zone_SubTown)
3324 {
3325 return -8000000 + base.uid;
3326 }
3327 if (this is Zone_Town)
3328 {
3329 return -9000000 + base.uid;
3330 }
3331 if (this is Zone_Civilized)
3332 {
3333 return -7000000 + base.uid;
3334 }
3335 if (this is Zone_RandomDungeon)
3336 {
3337 return 1000000 + base.uid;
3338 }
3339 return base.uid;
3340 }

Referenced by SpatialManager.ListReturnLocations().

◆ GetSpawnPos() [1/2]

Point Zone.GetSpawnPos ( Chara  c,
ZoneTransition::EnterState  destState = ZoneTransition::EnterState::Auto 
)
inline

Definition at line 1352 of file Zone.cs.

1353 {
1354 ZoneTransition zoneTransition = c.global?.transition;
1355 Zone zone = zoneTransition?.lastZone;
1356 ZoneTransition.EnterState enterState = zoneTransition?.state ?? destState;
1357 bool flag = zone == null || zone.lv > base.lv;
1358 if (IsRegion)
1359 {
1360 if (zone != null && !EClass.player.simulatingZone)
1361 {
1362 Zone topZone = zone.GetTopZone();
1363 if (GetZoneAt(topZone.x, topZone.y) != null)
1364 {
1365 return new Point(topZone.mapX, topZone.mapY);
1366 }
1367 }
1368 }
1369 else if (c.IsPC && EClass.player.lastZonePos != null && zone != null && zone.IsRegion && (enterState == ZoneTransition.EnterState.Left || enterState == ZoneTransition.EnterState.Right || enterState == ZoneTransition.EnterState.Top || enterState == ZoneTransition.EnterState.Bottom))
1370 {
1371 return EClass.player.lastZonePos;
1372 }
1373 if (enterState == ZoneTransition.EnterState.Region)
1374 {
1375 enterState = RegionEnterState;
1376 }
1377 if (this is Zone_Kapul && enterState == ZoneTransition.EnterState.Left)
1378 {
1379 enterState = ZoneTransition.EnterState.Right;
1380 }
1381 float rate = zoneTransition?.ratePos ?? (-1f);
1382 if (IsPCFaction)
1383 {
1384 if ((uint)(enterState - 3) <= 4u || enterState == ZoneTransition.EnterState.Return)
1385 {
1387 if (spot != null)
1388 {
1389 Point nearestPoint = (spot.trait as TraitSpotGuidePC).GetRandomPoint((Point p) => !p.IsBlocked && !p.Equals(spot.pos)).GetNearestPoint();
1390 if (nearestPoint != null && nearestPoint.IsValid)
1391 {
1392 return nearestPoint;
1393 }
1394 }
1395 }
1396 }
1397 while (true)
1398 {
1399 switch (enterState)
1400 {
1401 case ZoneTransition.EnterState.UndergroundOrSky:
1402 return new Point(zoneTransition.x, zoneTransition.z);
1403 case ZoneTransition.EnterState.Teleport:
1404 {
1405 foreach (Thing thing2 in map.things)
1406 {
1407 if (thing2.IsInstalled)
1408 {
1409 TraitTeleporter traitTeleporter = thing2.trait as TraitTeleporter;
1410 if (traitTeleporter != null)
1411 {
1412 Debug.Log(zoneTransition.idTele + "/" + traitTeleporter.id.IsEmpty(traitTeleporter.GetParam(3)) + "/" + traitTeleporter.GetParam(3));
1413 }
1414 if (traitTeleporter != null && !zoneTransition.idTele.IsEmpty() && zoneTransition.idTele == traitTeleporter.id.IsEmpty(traitTeleporter.GetParam(3)))
1415 {
1416 return thing2.pos.GetNearestPoint();
1417 }
1418 }
1419 }
1420 foreach (Thing thing3 in map.things)
1421 {
1422 if (thing3.IsInstalled && thing3.trait is TraitTeleporter traitTeleporter2 && traitTeleporter2.IsFor(zoneTransition.lastZone))
1423 {
1424 return thing3.pos.GetNearestPoint();
1425 }
1426 }
1427 Thing randomThing2 = EClass._map.props.installed.traits.GetRandomThing<TraitTeleporter>();
1428 if (randomThing2 != null)
1429 {
1430 return randomThing2.pos.GetNearestPoint();
1431 }
1432 goto case ZoneTransition.EnterState.Return;
1433 }
1434 case ZoneTransition.EnterState.Return:
1435 case ZoneTransition.EnterState.Elevator:
1436 case ZoneTransition.EnterState.Moongate:
1437 {
1438 if (enterState == ZoneTransition.EnterState.Elevator)
1439 {
1440 foreach (Thing thing4 in map.things)
1441 {
1442 if (thing4.IsInstalled && thing4.trait is TraitElevator traitElevator && traitElevator.IsFor(zoneTransition.lastZone))
1443 {
1444 return thing4.pos.GetNearestPoint();
1445 }
1446 }
1447 Thing randomThing = EClass._map.props.installed.traits.GetRandomThing<TraitElevator>();
1448 if (randomThing != null)
1449 {
1450 return randomThing.pos.GetNearestPoint();
1451 }
1452 }
1453 Thing thing = null;
1454 thing = map.props.installed.traits.GetRandomThing<TraitWaystone>();
1455 if (thing != null)
1456 {
1457 return thing.pos.GetNearestPoint();
1458 }
1459 thing = map.props.installed.traits.GetRandomThing<TraitCoreZone>();
1460 if (thing != null)
1461 {
1462 return thing.pos.GetNearestPoint();
1463 }
1464 if (base.lv == 0)
1465 {
1466 goto IL_04a1;
1467 }
1468 flag = base.lv <= 0;
1469 break;
1470 }
1471 case ZoneTransition.EnterState.Center:
1472 case ZoneTransition.EnterState.Encounter:
1473 if (map.config.embarkX != 0)
1474 {
1475 return new Point(map.config.embarkX, map.config.embarkY);
1476 }
1477 return map.GetCenterPos().GetNearestPoint(allowBlock: false, allowChara: false);
1478 case ZoneTransition.EnterState.Top:
1479 return map.bounds.GetTopPos(rate).GetNearestPoint(allowBlock: false, allowChara: false);
1480 case ZoneTransition.EnterState.Right:
1481 return map.bounds.GetRightPos(rate).GetNearestPoint(allowBlock: false, allowChara: false);
1482 case ZoneTransition.EnterState.Bottom:
1483 return map.bounds.GetBottomPos(rate).GetNearestPoint(allowBlock: false, allowChara: false);
1484 case ZoneTransition.EnterState.Left:
1485 return map.bounds.GetLeftPos(rate).GetNearestPoint(allowBlock: false, allowChara: false);
1486 case ZoneTransition.EnterState.Dead:
1487 case ZoneTransition.EnterState.Exact:
1488 case ZoneTransition.EnterState.PortalReturn:
1489 case ZoneTransition.EnterState.Fall:
1490 if (zoneTransition.x == 0 && EClass._map.bounds.x != 0)
1491 {
1492 return new Point(map.config.embarkX, map.config.embarkY);
1493 }
1494 return new Point(zoneTransition.x, zoneTransition.z);
1495 case ZoneTransition.EnterState.RandomVisit:
1496 return GetRandomVisitPos(c);
1497 case ZoneTransition.EnterState.Down:
1498 flag = true;
1499 break;
1500 case ZoneTransition.EnterState.Up:
1501 flag = false;
1502 break;
1503 }
1504 break;
1505 IL_04a1:
1506 enterState = ZoneTransition.EnterState.Center;
1507 }
1508 foreach (Thing thing5 in map.things)
1509 {
1510 if (thing5.trait is TraitNewZone { zone: not null } traitNewZone && zone != null && traitNewZone.zone.uid == zone.uid)
1511 {
1512 if (c != null && enterState != 0)
1513 {
1514 c.SetDir(traitNewZone.owner.dir);
1515 }
1516 return traitNewZone.GetExitPos();
1517 }
1518 }
1519 foreach (Thing thing6 in map.things)
1520 {
1521 if (thing6.trait is TraitNewZone traitNewZone2 && ((flag && traitNewZone2.IsUpstairs) || (!flag && traitNewZone2.IsDownstairs)))
1522 {
1523 if (c != null && enterState != 0)
1524 {
1525 c.SetDir(traitNewZone2.owner.dir);
1526 }
1527 return traitNewZone2.GetExitPos();
1528 }
1529 }
1530 return GetRandomVisitPos(c);
1531 }
override void SetDir(int d)
Definition: Chara.cs:3564
Point GetLeftPos(float rate=-1f)
Definition: MapBounds.cs:92
Point GetBottomPos(float rate=-1f)
Definition: MapBounds.cs:87
int x
Definition: MapBounds.cs:8
Point GetTopPos(float rate=-1f)
Definition: MapBounds.cs:77
Point GetRightPos(float rate=-1f)
Definition: MapBounds.cs:82
int embarkY
Definition: MapConfig.cs:86
int embarkX
Definition: MapConfig.cs:83
Point lastZonePos
Definition: Player.cs:1126
Thing Find(int uid)
Definition: Props.cs:389
int mapX
Definition: Spatial.cs:460
int lv
Definition: Spatial.cs:142
int mapY
Definition: Spatial.cs:472
virtual bool IsFor(Zone z)
string GetParam(int i, string def=null)
Definition: Trait.cs:577
EnterState state
virtual ZoneTransition.EnterState RegionEnterState
Definition: Zone.cs:175
Point GetRandomVisitPos(Chara c)
Definition: Zone.cs:1533
Zone GetZoneAt(int _x, int _y)
Definition: Zone.cs:3568

References EClass._map, Map.bounds, Map.config, Debug, MapConfig.embarkX, MapConfig.embarkY, Point.Equals(), Props.Find(), MapBounds.GetBottomPos(), MapBounds.GetCenterPos(), MapBounds.GetLeftPos(), Point.GetNearestPoint(), Trait.GetParam(), MapBounds.GetRightPos(), MapBounds.GetTopPos(), GetTopZone(), Chara.global, TraitTeleporter.id, ZoneTransition.idTele, PropsManager.installed, TraitNewZone.IsFor(), Card.IsInstalled, Chara.IsPC, Spatial.IsRegion, Point.IsValid, ZoneTransition.lastZone, Player.lastZonePos, Spatial.lv, Spatial.mapX, Spatial.mapY, EClass.player, Card.pos, Map.props, ZoneTransition.ratePos, Player.simulatingZone, ZoneTransition.state, Map.things, Card.trait, Props.traits, GlobalData.transition, Spatial.uid, MapBounds.x, Spatial.x, ZoneTransition.x, Spatial.y, ZoneTransition.z, and TraitNewZone.zone.

Referenced by Chara.MoveZone().

◆ GetSpawnPos() [2/2]

Point Zone.GetSpawnPos ( SpawnPosition  type,
int  tries = 100 
)
inline

Definition at line 2742 of file Zone.cs.

2743 {
2744 Point point = new Point();
2745 for (int i = 0; i < tries; i++)
2746 {
2747 point = EClass._map.bounds.GetRandomSurface(centered: false, walkable: true, allowWater: true);
2748 if (!point.IsValid || point.cell.hasDoor || point.IsSync)
2749 {
2750 continue;
2751 }
2752 switch (type)
2753 {
2754 case SpawnPosition.Guest:
2755 {
2756 Room room = point.cell.room;
2757 if (room != null && room.data.accessType != 0)
2758 {
2759 continue;
2760 }
2761 break;
2762 }
2763 case SpawnPosition.Outside:
2764 if (point.cell.HasRoof || point.cell.light > 0)
2765 {
2766 continue;
2767 }
2768 break;
2769 }
2770 return point;
2771 }
2772 return null;
2773 }
SpawnPosition
Definition: SpawnPosition.cs:2
BaseArea.AccessType accessType
Definition: AreaData.cs:42
Room room
Definition: Cell.cs:102
byte light
Definition: Cell.cs:60
bool HasRoof
Definition: Cell.cs:648
bool hasDoor
Definition: Cell.cs:258
bool IsSync
Definition: Point.cs:344

References EClass._map, AreaData.accessType, Map.bounds, Point.cell, BaseArea.data, MapBounds.GetRandomSurface(), Cell.hasDoor, Cell.HasRoof, Point.IsSync, Point.IsValid, Cell.light, and Cell.room.

◆ GetTopZone()

◆ GetZoneAt()

Zone Zone.GetZoneAt ( int  _x,
int  _y 
)
inline

Definition at line 3568 of file Zone.cs.

3569 {
3570 if (IsRegion)
3571 {
3572 foreach (Spatial child in children)
3573 {
3574 if (!(child is Zone_Field) && _x == child.x && _y == child.y)
3575 {
3576 return child as Zone;
3577 }
3578 }
3579 }
3580 foreach (Spatial child2 in children)
3581 {
3582 if (_x == child2.x && _y == child2.y)
3583 {
3584 return child2 as Zone;
3585 }
3586 }
3587 return null;
3588 }

References Spatial.x, and Spatial.y.

Referenced by Player.EnterLocalZone(), and RegionPoint.SetRegionPoint().

◆ GrowPlants()

void Zone.GrowPlants ( VirtualDate  date)
inline

Definition at line 3461 of file Zone.cs.

3462 {
3463 bool num = (EClass.player.isAutoFarming = IsPCFaction && EClass.Branch.policies.IsActive(2707));
3464 int weedChance = 1;
3466 {
3467 weedChance += (EClass.debug.enable ? 100000 : 20) + EClass.Branch.Evalue(2703) * 10;
3468 }
3469 if (date.sunMap == null)
3470 {
3471 date.BuildSunMap();
3472 }
3473 if (num)
3474 {
3475 HashSet<int> hashSet = new HashSet<int>();
3476 foreach (Thing thing in EClass._map.things)
3477 {
3478 if (!thing.IsInstalled || !(thing.trait is TraitSpotFarm traitSpotFarm))
3479 {
3480 continue;
3481 }
3482 foreach (Point item in traitSpotFarm.ListPoints(null, onlyPassable: false))
3483 {
3484 hashSet.Add(item.index);
3485 }
3486 }
3487 Perform(hashSet);
3488 EClass.player.isAutoFarming = false;
3489 Perform(hashSet);
3490 }
3491 else
3492 {
3493 Perform(null);
3494 }
3495 void Perform(HashSet<int> farmMap)
3496 {
3497 bool isWinter = date.IsWinter;
3498 EClass._map.bounds.ForeachCell(delegate(Cell c)
3499 {
3500 if (farmMap != null)
3501 {
3503 {
3504 if (!farmMap.Contains(c.index))
3505 {
3506 return;
3507 }
3508 }
3509 else if (farmMap.Contains(c.index))
3510 {
3511 return;
3512 }
3513 }
3514 if (c.decal != 0 && EClass.rnd(3) == 0)
3515 {
3516 c.decal = 0;
3517 }
3518 if (GrowPlant)
3519 {
3520 if (c.growth != null)
3521 {
3522 bool flag = false;
3523 if (!EClass.player.isAutoFarming && c.growth.HaltGrowth() && (c.IsFarmField || c.IsTopWater) && (!isWinter || !date.IsRealTime))
3524 {
3525 flag = true;
3526 }
3527 PlantData plantData = map.TryGetPlant(c);
3528 if (!flag && (plantData == null || plantData.fert >= 0))
3529 {
3530 c.TryGrow(date);
3531 }
3532 if (isWinter && plantData != null && c.growth != null && c.growth.NeedSunlight && plantData.fert >= 0 && (EClass.rnd(4) == 0 || c.growth.stage.idx == 0))
3533 {
3534 if (date.sunMap == null)
3535 {
3536 date.BuildSunMap();
3537 }
3538 if (!date.sunMap.Contains(c.index) && !c.growth.CanGrow(date))
3539 {
3540 c.growth.Perish();
3541 }
3542 }
3543 }
3544 else if (c.detail != null)
3545 {
3546 c.Things.ForeachReverse(delegate(Thing t)
3547 {
3548 if (t.IsInstalled && t.trait is TraitSeed && !t.isSale)
3549 {
3550 (t.trait as TraitSeed).TrySprout(force: false, sucker: false, date);
3551 }
3552 });
3553 }
3554 else if (EClass.rnd(20) == 0 && GrowWeed && c.CanGrowWeed && EClass.rnd(weedChance) == 0)
3555 {
3556 biome.Populate(c.GetPoint());
3557 if (c.growth != null)
3558 {
3559 c.growth.SetStage(0);
3560 }
3561 }
3562 }
3563 c.isWatered = false;
3564 });
3565 }
3566 }
void Populate(Point point, bool interior=false, float mtpDensity=1f)
byte decal
Definition: Cell.cs:44
CellDetail detail
Definition: Cell.cs:92
Point GetPoint()
Definition: Cell.cs:1101
bool CanGrowWeed
Definition: Cell.cs:742
int index
Definition: Cell.cs:114
bool IsWinter
Definition: Date.cs:192
int Evalue(int ele)
PolicyManager policies
Stage stage
Definition: GrowSystem.cs:101
virtual bool NeedSunlight
Definition: GrowSystem.cs:93
bool CanGrow(VirtualDate date)
Definition: GrowSystem.cs:273
PlantData TryGetPlant(Point p)
Definition: Map.cs:1942
bool isAutoFarming
Definition: Player.cs:1204
bool IsActive(int id, int days=-1)
void BuildSunMap()
Definition: VirtualDate.cs:54
HashSet< int > sunMap
Definition: VirtualDate.cs:9
virtual bool GrowWeed
Definition: Zone.cs:351
virtual bool GrowPlant
Definition: Zone.cs:349

References EClass._map, Map.bounds, EClass.Branch, VirtualDate.BuildSunMap(), GrowSystem.CanGrow(), Cell.decal, Cell.detail, FactionBranch.Evalue(), MapBounds.ForeachCell(), Cell.growth, GrowSystem.Stage.idx, if(), Cell.index, PolicyManager.IsActive(), Player.isAutoFarming, Card.IsInstalled, Date.IsWinter, item, GrowSystem.NeedSunlight, EClass.player, FactionBranch.policies, EClass.rnd(), GrowSystem.stage, VirtualDate.sunMap, Map.things, Card.trait, and Map.TryGetPlant().

◆ HasField()

bool Zone.HasField ( int  idEle)
inline

Definition at line 2923 of file Zone.cs.

2924 {
2925 return fieldElements.Has(idEle);
2926 }
bool Has(int ele)
ElementContainerField fieldElements
Definition: Zone.cs:46

References ElementContainer.Has().

Referenced by ActPlan._Update(), FoodEffect.Proc(), ActEffect.ProcAt(), AI_Eat.Run(), Card.SpawnLoot(), and GoalCombat.TryUseAbility().

◆ Import()

ZoneExportData Zone.Import ( string  path)
inline

Definition at line 3208 of file Zone.cs.

3209 {
3210 ZipFile zipFile = ZipFile.Read(path);
3211 zipFile.ExtractExistingFile = ExtractExistingFileAction.OverwriteSilently;
3212 zipFile.ExtractAll(pathTemp);
3213 zipFile.Dispose();
3214 return IO.LoadFile<ZoneExportData>(pathTemp + "export") ?? new ZoneExportData();
3215 }

Referenced by Activate(), and PartialMap.Load().

◆ ImportDialog()

void Zone.ImportDialog ( string  dir = null)
inline

Definition at line 3271 of file Zone.cs.

3272 {
3274 {
3275 string[] array = StandaloneFileBrowser.OpenFilePanel("Import Zone", dir ?? CorePath.ZoneSave, "z", multiselect: false);
3276 if (array.Length != 0)
3277 {
3278 Zone_User zone_User = SpatialGen.Create("user", EClass.world.region, register: true) as Zone_User;
3279 zone_User.path = array[0];
3280 Thing thing = ThingGen.Create("teleporter");
3281 thing.c_uidZone = zone_User.uid;
3282 EClass._zone.AddCard(thing, EClass.pc.pos);
3283 }
3284 });
3285 }
static string[] OpenFilePanel(string title, string directory, string extension, bool multiselect)

References EClass.core, if(), SFB.StandaloneFileBrowser.OpenFilePanel(), BaseCore.WaitForEndOfFrame(), and CorePath.ZoneSave.

Referenced by CoreDebug.InitDebugCommands().

◆ IsCrime()

bool Zone.IsCrime ( Chara  c,
Act  act 
)
inline

Definition at line 3590 of file Zone.cs.

3591 {
3592 if (act.IsHostileAct && HasLaw && !IsPCFaction && c.IsPC)
3593 {
3594 return true;
3595 }
3596 return false;
3597 }
virtual bool IsHostileAct
Definition: ACT.cs:129
virtual bool HasLaw
Definition: Zone.cs:231

References Act.IsHostileAct, and Chara.IsPC.

Referenced by Act.GetActPlanColor(), TaskDig.OnCreateProgress(), TaskHarvest.OnCreateProgress(), TaskMine.OnCreateProgress(), TaskDig.OnProgressComplete(), TaskMine.OnProgressComplete(), ActTelekinesis.Perform(), and ActPlan.Item.Perform().

◆ IsImportValid()

static bool Zone.IsImportValid ( string  path)
inlinestatic

Definition at line 3287 of file Zone.cs.

3288 {
3289 try
3290 {
3291 return Map.GetMetaData(path)?.IsValidVersion() ?? false;
3292 }
3293 catch (Exception ex)
3294 {
3295 EClass.ui.Say(ex.Message);
3296 return false;
3297 }
3298 }
bool IsValidVersion()
Definition: MapMetaData.cs:31
static MapMetaData GetMetaData(string pathZip)
Definition: Map.cs:738

References Map.GetMetaData(), MapMetaData.IsValidVersion(), and EClass.ui.

Referenced by TraitMoongate.UseMoongate().

◆ ListLandFeats()

List< Element > Zone.ListLandFeats ( )
inline

Definition at line 3153 of file Zone.cs.

3154 {
3155 if (landFeats == null)
3156 {
3157 landFeats = new List<int>();
3159 string[] listBase = IDBaseLandFeat.Split(',');
3160 string[] array = listBase;
3161 foreach (string text in array)
3162 {
3163 if (!text.IsEmpty())
3164 {
3165 landFeats.Add(EClass.sources.elements.alias[text].id);
3166 }
3167 }
3168 if (listBase.Length == 1)
3169 {
3170 List<SourceElement.Row> list = EClass.sources.elements.rows.Where(delegate(SourceElement.Row e)
3171 {
3172 if (e.category != "landfeat" || e.chance == 0)
3173 {
3174 return false;
3175 }
3176 bool flag = true;
3177 string[] tag = e.tag;
3178 foreach (string text2 in tag)
3179 {
3180 if (text2.StartsWith("bf"))
3181 {
3182 flag = false;
3183 if (listBase[0] == text2)
3184 {
3185 flag = true;
3186 break;
3187 }
3188 }
3189 }
3190 return flag ? true : false;
3191 }).ToList();
3192 SourceElement.Row row = list.RandomItemWeighted((SourceElement.Row e) => e.chance);
3193 landFeats.Add(row.id);
3194 list.Remove(row);
3195 row = list.RandomItemWeighted((SourceElement.Row e) => e.chance);
3196 landFeats.Add(row.id);
3197 }
3198 Rand.SetSeed();
3199 }
3200 List<Element> list2 = new List<Element>();
3201 foreach (int landFeat in landFeats)
3202 {
3203 list2.Add(Element.Create(landFeat, 1));
3204 }
3205 return list2;
3206 }
static Element Create(int id, int v=0)
Definition: ELEMENT.cs:1111
virtual string IDBaseLandFeat
Definition: Zone.cs:149
List< int > landFeats
Definition: Zone.cs:58

References EClass._zone, SourceManager.elements, SourceElement.Row.id, Rand.SetSeed(), EClass.sources, and Spatial.uid.

Referenced by WidgetDate._Refresh(), FactionBranch.OnClaimZone(), FactionBranch.OnUnclaimZone(), UIFactionInfo.SetZone(), and FactionBranch.Upgrade().

◆ ListMinions()

List< Chara > Zone.ListMinions ( Chara  c)
inline

Definition at line 3764 of file Zone.cs.

3765 {
3766 List<Chara> list = new List<Chara>();
3767 foreach (Chara chara in EClass._map.charas)
3768 {
3769 if (chara.c_uidMaster == c.uid && chara.c_minionType == MinionType.Default)
3770 {
3771 list.Add(chara);
3772 }
3773 }
3774 return list;
3775 }

References EClass._map, Card.c_minionType, Card.c_uidMaster, and Map.charas.

◆ ModDevelopment()

void Zone.ModDevelopment ( int  a)
inline

Definition at line 3668 of file Zone.cs.

3669 {
3670 base.development += a;
3671 if (a > 0)
3672 {
3673 Msg.Say("gainDevelopment", Name, a.ToString() ?? "");
3674 }
3675 }

References Msg.Say().

◆ ModInfluence()

void Zone.ModInfluence ( int  a)
inline

Definition at line 3658 of file Zone.cs.

3659 {
3660 base.influence += a;
3661 if (a > 0)
3662 {
3663 Msg.Say("gainInfluence", Name, a.ToString() ?? "");
3664 }
3665 Tutorial.Reserve("influence");
3666 }

References Tutorial.Reserve(), and Msg.Say().

Referenced by Card.ModCurrency(), QuestRandom.OnDropReward(), ActEffect.Proc(), and ActThrow.Throw().

◆ OnActivate()

virtual void Zone.OnActivate ( )
inlinevirtual

◆ OnAdvanceHour()

virtual void Zone.OnAdvanceHour ( )
inlinevirtual

Reimplemented in Region.

Definition at line 1188 of file Zone.cs.

1189 {
1190 }

Referenced by GameDate.AdvanceHour().

◆ OnAfterCreate()

override void Zone.OnAfterCreate ( )
inlinevirtual

Reimplemented from Spatial.

Definition at line 578 of file Zone.cs.

579 {
580 if (AddPrefix)
581 {
582 if (GetTopZone() == this)
583 {
584 base.idPrefix = EClass.sources.zoneAffixes.rows.RandomItem().id;
585 }
586 else
587 {
588 base.idPrefix = GetTopZone().idPrefix;
589 }
590 }
591 }
SourceZoneAffix zoneAffixes
int idPrefix
Definition: Spatial.cs:130
virtual bool AddPrefix
Definition: Zone.cs:285

References AddPrefix, GetTopZone(), Spatial.idPrefix, EClass.sources, and SourceManager.zoneAffixes.

◆ OnAfterSimulate()

virtual void Zone.OnAfterSimulate ( )
inlinevirtual

Reimplemented in Zone_WindRest.

Definition at line 1184 of file Zone.cs.

1185 {
1186 }

◆ OnBeforeDeactivate()

virtual void Zone.OnBeforeDeactivate ( )
inlinevirtual

Reimplemented in Zone_Tent.

Definition at line 1168 of file Zone.cs.

1169 {
1170 }

◆ OnBeforeSimulate()

virtual void Zone.OnBeforeSimulate ( )
inlinevirtual

Reimplemented in Zone_DungeonPuppy, and Zone_Nymelle.

Definition at line 1176 of file Zone.cs.

1177 {
1178 }

◆ OnChildNumChange()

void Zone.OnChildNumChange ( Card  c)
inline

Implements ICardParent.

Definition at line 1941 of file Zone.cs.

1942 {
1943 }

◆ OnCreate()

override void Zone.OnCreate ( )
inlinevirtual

Reimplemented from Spatial.

Definition at line 572 of file Zone.cs.

573 {
574 events.zone = this;
575 base.lv = StartLV;
576 }
virtual int StartLV
Definition: Zone.cs:411

References StartLV.

◆ OnCreateBP()

virtual void Zone.OnCreateBP ( )
inlinevirtual

Reimplemented in Zone_Arena2, and Zone_Harvest.

Definition at line 2371 of file Zone.cs.

2372 {
2373 }

◆ OnDeactivate()

virtual void Zone.OnDeactivate ( )
inlinevirtual

Definition at line 1172 of file Zone.cs.

1173 {
1174 }

◆ OnGenerateMap()

virtual void Zone.OnGenerateMap ( )
inlinevirtual

Reimplemented in Zone_Arena2, Zone_CurryRuinDungeon, Zone_CursedManor, Zone_CursedManorDungeon, Zone_Dungeon, Zone_DungeonDead, Zone_DungeonFairy, Zone_DungeonMino, Zone_DungeonPuppy, Zone_Field, Zone_Harvest, Zone_RandomDungeon, Zone_RandomDungeonFactory, Zone_SnowGrave, Zone_StartSite, Zone_TestRoom, Zone_UnderseaTemple, Zone_VernisMine, Zone_Void, and Zone_WindRest.

Definition at line 2586 of file Zone.cs.

2587 {
2589 {
2590 foreach (Chara chara in EClass._map.charas)
2591 {
2592 if (!chara.IsGlobal && chara.hostility < Hostility.Neutral && chara.OriginalHostility < Hostility.Friend)
2593 {
2594 Hostility hostility2 = (chara.c_originalHostility = Hostility.Neutral);
2595 chara.hostility = hostility2;
2596 }
2597 }
2598 }
2599 if (PrespawnRate != 0f && !IsSkyLevel)
2600 {
2601 for (int i = 0; i < (int)((float)MaxSpawn * PrespawnRate); i++)
2602 {
2603 SpawnMob();
2604 }
2605 }
2610 }
Hostility
Definition: Hostility.cs:2
Hostility OriginalHostility
Definition: Chara.cs:473
Hostility hostility
Definition: Chara.cs:293
virtual float PrespawnRate
Definition: Zone.cs:329
virtual int MaxSpawn
Definition: Zone.cs:315
virtual bool IsSkyLevel
Definition: Zone.cs:269
Chara TryGenerateEvolved(bool force=false, Point p=null)
Definition: Zone.cs:2639
void TryGenerateShrine()
Definition: Zone.cs:2685
void TryGenerateOre()
Definition: Zone.cs:2612
virtual bool MakeEnemiesNeutral
Definition: Zone.cs:236
void TryGenerateBigDaddy()
Definition: Zone.cs:2659

References EClass._map, Map.charas, Chara.hostility, Chara.IsGlobal, and Chara.OriginalHostility.

Referenced by Activate().

◆ OnGenerateRooms()

virtual void Zone.OnGenerateRooms ( BaseMapGen  gen)
inlinevirtual

Reimplemented in Zone_CaveMonster, and Zone_SubTown.

Definition at line 2738 of file Zone.cs.

2739 {
2740 }

Referenced by MapGenDungen.OnGenerateTerrain().

◆ OnInspect()

void Zone.OnInspect ( )
inline

Implements IInspect.

Definition at line 3313 of file Zone.cs.

3314 {
3315 }

◆ OnKillGame()

void Zone.OnKillGame ( )
inline

Definition at line 1704 of file Zone.cs.

1705 {
1706 foreach (Thing thing in map.things)
1707 {
1708 if (thing.renderer.hasActor)
1709 {
1710 thing.renderer.KillActor();
1711 }
1712 }
1713 }
void KillActor()
CardRenderer renderer
Definition: Card.cs:62

References CardRenderer.hasActor, CardRenderer.KillActor(), Card.renderer, and Map.things.

Referenced by Game.Kill().

◆ OnLoad()

override void Zone.OnLoad ( )
inlinevirtual

Reimplemented from Spatial.

Definition at line 1891 of file Zone.cs.

1892 {
1893 if (branch != null)
1894 {
1895 branch.SetOwner(this);
1896 }
1897 events.OnLoad(this);
1898 }
void SetOwner(Zone zone)
void OnLoad(Zone _zone)

References ZoneEventManager.OnLoad(), and FactionBranch.SetOwner().

◆ OnRegenerate()

virtual void Zone.OnRegenerate ( )
inlinevirtual

Reimplemented in Zone_LittleGarden.

Definition at line 1160 of file Zone.cs.

1161 {
1162 }

◆ OnSimulateDay()

void Zone.OnSimulateDay ( VirtualDate  date)
inline

Definition at line 3426 of file Zone.cs.

3427 {
3428 if (base.IsPlayerFaction)
3429 {
3430 branch.OnSimulateDay(date);
3431 }
3432 }
void OnSimulateDay(VirtualDate date)

References FactionBranch.OnSimulateDay().

Referenced by VirtualDate.SimulateDay().

◆ OnSimulateHour()

void Zone.OnSimulateHour ( VirtualDate  date)
inline

Definition at line 3371 of file Zone.cs.

3372 {
3373 if (base.IsPlayerFaction)
3374 {
3375 branch.OnSimulateHour(date);
3376 }
3378 if (date.IsRealTime)
3379 {
3380 foreach (Thing thing in EClass._map.things)
3381 {
3382 if (thing.IsInstalled)
3383 {
3384 thing.trait.TryToggle();
3385 }
3386 }
3388 }
3389 EClass._map.things.ForeachReverse(delegate(Thing t)
3390 {
3391 t.OnSimulateHour(date);
3392 });
3393 foreach (Thing sucker in Suckers)
3394 {
3395 sucker.Destroy();
3396 }
3397 Suckers.Clear();
3398 if (RespawnRate != 0f)
3399 {
3400 int num = 0;
3401 foreach (Chara chara in map.charas)
3402 {
3403 if (!chara.IsGlobal)
3404 {
3405 num++;
3406 }
3407 }
3408 if (num < MaxRespawn)
3409 {
3410 for (int i = 0; i < RespawnPerHour; i++)
3411 {
3412 SpawnMob();
3413 }
3414 }
3415 }
3416 if (!date.IsRealTime && EClass.rnd(24) == 0)
3417 {
3418 RainWater();
3419 }
3420 if (date.hour == 6)
3421 {
3422 GrowPlants(date);
3423 }
3424 }
virtual void OnSimulateHour(VirtualDate date)
Definition: Card.cs:6774
void DecayNatural(int hour=1)
Definition: Card.cs:6783
int hour
Definition: Date.cs:74
void OnSimulateHour(VirtualDate date)
virtual void TryToggle()
Definition: Trait.cs:1160
bool IsRealTime
Definition: VirtualDate.cs:7
virtual int RespawnPerHour
Definition: Zone.cs:345
virtual float RespawnRate
Definition: Zone.cs:331
static List< Thing > Suckers
Definition: Zone.cs:83
void GrowPlants(VirtualDate date)
Definition: Zone.cs:3461
int MaxRespawn
Definition: Zone.cs:317

References EClass._map, Map.charas, Card.DecayNatural(), Card.Destroy(), Chara.IsGlobal, Card.IsInstalled, VirtualDate.IsRealTime, ZoneEventManager.OnSimulateHour(), Card.OnSimulateHour(), FactionBranch.OnSimulateHour(), EClass.pc, EClass.rnd(), Map.things, Card.trait, and Trait.TryToggle().

Referenced by VirtualDate.SimulateHour().

◆ OnSimulateMonth()

void Zone.OnSimulateMonth ( VirtualDate  date)
inline

Definition at line 3434 of file Zone.cs.

3435 {
3436 if (base.IsPlayerFaction)
3437 {
3438 branch.OnSimulateMonth(date);
3439 }
3440 if (date.IsRealTime)
3441 {
3443 }
3444 }
void OnSimulateMonth(VirtualDate date)

References EClass._map, VirtualDate.IsRealTime, FactionBranch.OnSimulateMonth(), and Map.RefreshAllTiles().

Referenced by VirtualDate.SimulateMonth().

◆ OnVisit()

void Zone.OnVisit ( )
inline

Definition at line 1061 of file Zone.cs.

1062 {
1063 if (EClass.world.date.IsExpired(base.dateRevive))
1064 {
1066 Revive();
1067 List<Chara> list = new List<Chara>();
1068 foreach (Chara chara in EClass._map.charas)
1069 {
1070 chara.TryRestock(onCreate: false);
1071 if (!chara.IsPCFaction)
1072 {
1073 chara.c_fur = 0;
1074 }
1075 if (chara.IsMinion && chara.master != null && !chara.master.IsPCParty)
1076 {
1077 list.Add(chara);
1078 }
1079 }
1080 foreach (Chara item in list)
1081 {
1082 item.Destroy();
1083 }
1084 }
1085 if (!EClass.game.isLoading)
1086 {
1088 }
1091 events.OnVisit();
1092 OnActivate();
1093 UpdateQuests();
1095 isSimulating = true;
1096 Simulate();
1097 isSimulating = false;
1099 if (EClass.Branch != null)
1100 {
1102 }
1103 base.lastActive = EClass.world.date.GetRaw();
1104 if (!EClass.game.isLoading)
1105 {
1106 base.visitCount++;
1107 }
1108 base.version = EClass.core.version.GetInt();
1109 if (fieldElements.dict.Count() > 0)
1110 {
1111 Tutorial.Reserve("field");
1112 }
1113 }
Version version
Definition: BaseCore.cs:17
override bool IsPCFaction
Definition: Chara.cs:685
void TryRestock(bool onCreate)
Definition: Chara.cs:4747
Dictionary< int, Element > dict
void OnAfterSimulate()
void AssignCharas()
Definition: RoomManager.cs:39
void Revive()
Definition: Zone.cs:1126
void RefreshDeathSentense()
Definition: Zone.cs:1115
void Simulate()
Definition: Zone.cs:1192
virtual void OnAfterSimulate()
Definition: Zone.cs:1184
void RefreshCriminal()
Definition: Zone.cs:3599
virtual void OnBeforeSimulate()
Definition: Zone.cs:1176
virtual void OnActivate()
Definition: Zone.cs:1164
void ResetHostility()
Definition: Zone.cs:2722
void UpdateQuests(bool force=false)
Definition: Zone.cs:3677
int GetInt()
Definition: Version.cs:21

References EClass._map, RoomManager.AssignCharas(), EClass.Branch, Map.charas, EClass.core, World.date, ElementContainer.dict, EClass.game, Version.GetInt(), Date.GetRaw(), Date.IsExpired(), Game.isLoading, Chara.IsMinion, Chara.IsPCFaction, Chara.IsPCParty, item, Chara.master, FactionBranch.OnAfterSimulate(), ZoneEventManager.OnVisit(), Tutorial.Reserve(), Revive, Map.rooms, Chara.TryRestock(), BaseCore.version, and EClass.world.

◆ OnVisitNewMapOrRegenerate()

virtual void Zone.OnVisitNewMapOrRegenerate ( )
inlinevirtual

Reimplemented in Zone_Yowyn.

Definition at line 1180 of file Zone.cs.

1181 {
1182 }

◆ RainWater()

void Zone.RainWater ( )
inline

Definition at line 3446 of file Zone.cs.

3447 {
3449 {
3450 return;
3451 }
3452 EClass._map.bounds.ForeachCell(delegate(Cell c)
3453 {
3454 if (c.IsFarmField && !c.HasRoof)
3455 {
3456 c.isWatered = true;
3457 }
3458 });
3459 }
bool IsFarmField
Definition: Cell.cs:730
bool IsIndoor
Definition: Map.cs:131

References EClass._map, Map.bounds, MapBounds.ForeachCell(), Cell.HasRoof, Cell.IsFarmField, and Map.IsIndoor.

Referenced by Weather.SetCondition().

◆ RefreshBGM()

void Zone.RefreshBGM ( )
inline

Definition at line 3061 of file Zone.cs.

3062 {
3064 {
3065 return;
3066 }
3068 Playlist playlist = map.plDay;
3069 foreach (ZoneEvent item in events.list)
3070 {
3071 if (item.playlist != null)
3072 {
3073 playlist = item.playlist;
3074 }
3075 }
3076 if (IDPlaylistOverwrite != null)
3077 {
3078 playlist = EClass.Sound.GetPlaylist(IDPlaylistOverwrite);
3079 }
3081 {
3082 Room room = EClass.pc.pos.cell.room;
3083 if (room != null && room.lot != null && room.lot.idBGM != 0)
3084 {
3085 playlist = EClass.Sound.plLot;
3086 if (playlist.list[0].data?.id != room.lot.idBGM)
3087 {
3088 playlist.list[0].data = EClass.core.refs.dictBGM.TryGetValue(room.lot.idBGM);
3089 playlist.Reset();
3090 if (!LayerDrama.keepBGM)
3091 {
3092 EClass.Sound.StopBGM(1f);
3093 }
3094 }
3095 }
3096 }
3098 EClass.Sound.SwitchPlaylist(playlist, !LayerDrama.keepBGM);
3099 }
bool IsInActiveZone
Definition: Chara.cs:852
void SetBGMInterval()
Definition: CoreConfig.cs:1010
Dictionary< int, BGMData > dictBGM
Definition: CoreRef.cs:385
CoreRef refs
Definition: Core.cs:51
static bool keepBGM
Definition: LayerDrama.cs:10
int idBGM
Definition: Lot.cs:16
Playlist plDay
Definition: Map.cs:77
Lot lot
Definition: Room.cs:21
List< ZoneEvent > list
virtual string IDPlaylistOverwrite
Definition: Zone.cs:145

References Point.cell, Core.config, EClass.core, CoreRef.dictBGM, Lot.idBGM, Chara.IsInActiveZone, item, LayerDrama.keepBGM, ZoneEventManager.list, Room.lot, EClass.pc, EClass.player, Map.plDay, Card.pos, Core.refs, Cell.room, CoreConfig.SetBGMInterval(), Player.simulatingZone, and EClass.Sound.

Referenced by BuildMenu.Deactivate(), BaseTileMap.Draw(), TileMapElona.Draw(), LayerNewZone.Embark(), ELayer.Kill(), ZoneEventSiege.OnInit(), LayerEditPlaylist.OnKill(), ZoneEventSiege.OnKill(), and ZoneEventSiege.OnVisit().

◆ RefreshCriminal()

void Zone.RefreshCriminal ( )
inline

Definition at line 3599 of file Zone.cs.

3600 {
3601 bool flag = EClass.player.IsCriminal && HasLaw && !AllowCriminal && !IsPCFaction;
3602 Hostility hostility = (flag ? Hostility.Neutral : Hostility.Friend);
3603 foreach (Chara chara in EClass._map.charas)
3604 {
3605 if (chara.trait is TraitGuard)
3606 {
3607 chara.hostility = hostility;
3608 if (!flag && chara.enemy != null && chara.enemy.IsPCParty)
3609 {
3610 chara.SetEnemy();
3611 }
3612 }
3613 }
3614 }
Chara enemy
Definition: Chara.cs:86
Chara SetEnemy(Chara c=null)
Definition: Chara.cs:6416
virtual bool AllowCriminal
Definition: Zone.cs:249

References EClass._map, Map.charas, Chara.enemy, Chara.IsPCParty, Chara.SetEnemy(), and Chara.trait.

Referenced by Player.ModKarma(), ConIncognito.OnRemoved(), and ConIncognito.OnStart().

◆ RefreshDeathSentense()

void Zone.RefreshDeathSentense ( )
inline

Definition at line 1115 of file Zone.cs.

1116 {
1117 foreach (Chara chara in EClass._map.charas)
1118 {
1119 if (chara.HasCondition<ConDeathSentense>())
1120 {
1121 chara.GetCondition<ConDeathSentense>().TryRemove();
1122 }
1123 }
1124 }
bool HasCondition(string alias)
Definition: Chara.cs:9581

References EClass._map, Map.charas, and Chara.HasCondition().

Referenced by Chara.Die().

◆ RefreshElectricity()

void Zone.RefreshElectricity ( )
inline

Definition at line 2933 of file Zone.cs.

2934 {
2935 dirtyElectricity = false;
2936 bool flag = GetSoilCost() > MaxSoil;
2937 base.electricity = elements.Value(2201) * 10 + BaseElectricity;
2938 foreach (Thing thing in EClass._map.things)
2939 {
2940 if (thing.IsInstalled && thing.trait.Electricity != 0 && (thing.isOn || thing.trait.Electricity > 0))
2941 {
2942 base.electricity += thing.trait.Electricity;
2943 }
2944 }
2945 if (!flag)
2946 {
2947 EClass._map.bounds.ForeachCell(delegate(Cell c)
2948 {
2949 if (c.sourceObj.id == 118 && c.growth.IsMature)
2950 {
2951 base.electricity += 20;
2952 }
2953 });
2954 }
2955 foreach (Thing thing2 in EClass._map.things)
2956 {
2957 if (thing2.IsInstalled)
2958 {
2959 thing2.trait.TryToggle();
2960 }
2961 }
2962 }
bool isOn
Definition: Card.cs:543
bool dirtyElectricity
Definition: Zone.cs:71

References EClass._map, Map.bounds, Trait.Electricity, MapBounds.ForeachCell(), Cell.growth, Card.IsInstalled, GrowSystem.IsMature, Card.isOn, Cell.sourceObj, Map.things, Card.trait, Trait.TryToggle(), and ElementContainer.Value().

Referenced by TraitLeverBreaker.OnToggle(), Scene.OnUpdate(), TraitGenerator.Recover(), UIHomeInfo.Refresh(), and TraitGenerator.ShortOut().

◆ RefreshHat()

void Zone.RefreshHat ( )
inline

Definition at line 1051 of file Zone.cs.

1052 {
1053 if (idHat != null && EClass.world.date.IsExpired(base.dateHat))
1054 {
1055 idHat = null;
1056 base.dateHat = 0;
1057 }
1058 sourceHat = ((idHat != null) ? EClass.sources.cards.map[idHat] : ((IDHat != null) ? EClass.sources.cards.map[IDHat] : null));
1059 }
Dictionary< string, CardRow > map
Definition: SourceCard.cs:8
SourceCard cards
string idHat
Definition: Spatial.cs:31
virtual string IDHat
Definition: Zone.cs:147
static CardRow sourceHat
Definition: Zone.cs:29

References SourceManager.cards, World.date, Date.IsExpired(), SourceCard.map, EClass.sources, and EClass.world.

Referenced by TraitHat.OnUse().

◆ RefreshListCitizen()

void Zone.RefreshListCitizen ( )
inline

Definition at line 3616 of file Zone.cs.

3617 {
3618 if (base.lv != 0)
3619 {
3620 return;
3621 }
3622 dictCitizen.Clear();
3623 foreach (Chara item in map.charas.Concat(map.deadCharas))
3624 {
3625 if (item.trait.IsCitizen && !item.IsGlobal && !item.isSubsetCard)
3626 {
3627 dictCitizen[item.uid] = item.Name;
3628 }
3629 }
3630 }
Dictionary< int, string > dictCitizen
Definition: Zone.cs:52

References Map.charas, Map.deadCharas, and item.

Referenced by Chara.MakeAlly().

◆ RefreshPlaylist()

void Zone.RefreshPlaylist ( )
inline

Definition at line 3045 of file Zone.cs.

3046 {
3047 if (map.plDay == null)
3048 {
3049 map.plDay = CreatePlaylist(ref map._plDay, EClass.Sound.GetPlaylist(IDPlayList));
3050 }
3051 }

References Map._plDay, Map.plDay, and EClass.Sound.

Referenced by ClaimZone(), and LayerEditPlaylist.OnKill().

◆ RemoveCard()

void Zone.RemoveCard ( Card  t)
inline

Implements ICardParent.

Definition at line 2034 of file Zone.cs.

2035 {
2036 if (IsActiveZone)
2037 {
2039 }
2040 t.parent = null;
2041 if (t.isChara)
2042 {
2043 t.Chara.currentZone = null;
2044 }
2045 if (t.isThing && !t.trait.IDActorEx.IsEmpty())
2046 {
2048 }
2049 if (t.renderer.hasActor)
2050 {
2052 }
2053 }
override void OnLeaveScreen()
virtual bool isChara
Definition: Card.cs:2109
void OnCardRemovedFromZone(Card t)
Definition: Map.cs:825
void RemoveActorEx(Card c)
Definition: Scene.cs:1028
virtual string IDActorEx
Definition: Trait.cs:187

References CardRenderer.hasActor, Trait.IDActorEx, Card.isChara, Card.isThing, Map.OnCardRemovedFromZone(), CardRenderer.OnLeaveScreen(), Scene.RemoveActorEx(), Card.renderer, EClass.scene, and Card.trait.

Referenced by Activate(), Faction.AddReserve(), Chara.MoveZone(), Map.OnDeactivate(), TaskMoveInstalled.OnProgressComplete(), Map.ReloadRoom(), Simulate(), ActThrow.Throw(), Chara.Tick(), and CoreDebug.UpdateInput().

◆ ResetHostility()

void Zone.ResetHostility ( )
inline

Definition at line 2722 of file Zone.cs.

2723 {
2724 foreach (Chara chara in EClass._map.charas)
2725 {
2726 if (!chara.source.hostility.IsEmpty() && chara.source.hostility.ToEnum<Hostility>() >= Hostility.Friend && !chara.IsPCFactionOrMinion)
2727 {
2728 chara.c_originalHostility = (Hostility)0;
2729 }
2730 chara.hostility = chara.OriginalHostility;
2731 if (chara.enemy != null && (chara.enemy.IsPCFaction || chara.IsPCFaction))
2732 {
2733 chara.SetEnemy();
2734 }
2735 }
2736 }
bool IsPCFactionOrMinion
Definition: Card.cs:2300
SourceChara.Row source
Definition: Chara.cs:160

References EClass._map, Map.charas, Chara.enemy, Chara.IsPCFaction, Card.IsPCFactionOrMinion, Chara.OriginalHostility, Chara.SetEnemy(), and Chara.source.

Referenced by Chara.Die(), and ConIncognito.OnStart().

◆ ResetPlaylist()

void Zone.ResetPlaylist ( )
inline

Definition at line 3053 of file Zone.cs.

3054 {
3055 map._plDay.Clear();
3056 UnityEngine.Object.DestroyImmediate(map.plDay);
3057 map.plDay = null;
3059 }

References Map._plDay, and Map.plDay.

◆ Revive()

void Zone.Revive ( )
inline

Definition at line 1126 of file Zone.cs.

1127 {
1128 base.dateRevive = EClass.world.date.GetRaw() + 1440 * EClass.setting.balance.dateRevive;
1129 if (ShouldAutoRevive)
1130 {
1131 foreach (Chara deadChara in map.deadCharas)
1132 {
1133 if (deadChara.trait.CanAutoRevive && deadChara.CanRevive())
1134 {
1135 deadChara.Revive();
1137 {
1138 deadChara.RemoveBacker();
1139 }
1140 EClass._zone.AddCard(deadChara, (deadChara.orgPos != null && deadChara.orgPos.IsInBounds) ? deadChara.orgPos : deadChara.pos);
1141 }
1142 }
1143 }
1144 foreach (Chara value in EClass.game.cards.globalCharas.Values)
1145 {
1146 if (value.isDead && value.CanRevive() && value.homeZone == this)
1147 {
1148 value.Revive();
1149 Point point = GetSpawnPos(value);
1150 if (value.orgPos != null && value.orgPos.IsInBounds)
1151 {
1152 point = value.orgPos.GetNearestPoint() ?? point;
1153 }
1154 EClass._zone.AddCard(value, point);
1155 }
1156 }
1157 map.deadCharas.Clear();
1158 }
int c_idBacker
Definition: Card.cs:1451
bool CanRevive()
Definition: Chara.cs:5197
void Revive(Point p=null, bool msg=false)
Definition: Chara.cs:5223
Zone homeZone
Definition: Chara.cs:269
bool IsInBounds
Definition: Point.cs:104
virtual bool CanAutoRevive
Definition: TraitChara.cs:20
virtual bool ShouldAutoRevive
Definition: Zone.cs:382

References EClass._zone, AddCard(), GameSetting.balance, Card.c_idBacker, TraitChara.CanAutoRevive, Chara.CanRevive(), Game.cards, Core.config, EClass.core, World.date, GameSetting.BalanceSetting.dateRevive, Map.deadCharas, Player.doneBackers, EClass.game, Point.GetNearestPoint(), Date.GetRaw(), CardManager.globalCharas, Chara.homeZone, CoreConfig.Test.ignoreBackerDestoryFlag, Card.isBackerContent, Chara.isDead, Point.IsInBounds, Chara.orgPos, EClass.player, Card.pos, Card.RemoveBacker(), Chara.Revive(), EClass.setting, CoreConfig.test, Chara.trait, and EClass.world.

Referenced by Map.ResetEditorPos().

◆ SetAlarm()

virtual void Zone.SetAlarm ( bool  enable)
inlinevirtual

Reimplemented in Zone_CurryRuinDungeon.

Definition at line 3632 of file Zone.cs.

3633 {
3634 base.isAlarmSet = enable;
3635 if (enable)
3636 {
3637 foreach (Chara chara in EClass._map.charas)
3638 {
3639 if (!chara.IsPCFactionOrMinion)
3640 {
3641 chara.SetHostility(Hostility.Enemy);
3642 }
3643 }
3644 Msg.Say("alarm");
3645 Msg.Say("alarm2");
3646 SE.Play("alarm");
3647 return;
3648 }
3649 foreach (Chara chara2 in EClass._map.charas)
3650 {
3651 if (!chara2.IsPCFactionOrMinion)
3652 {
3653 chara2.SetHostility(Hostility.Neutral);
3654 }
3655 }
3656 }
Chara SetHostility(Hostility h)
Definition: Chara.cs:1468

References EClass._map, Map.charas, Card.IsPCFactionOrMinion, Msg.Say(), and Chara.SetHostility().

Referenced by Point.CallGuard(), and GoalCombat.Run().

◆ SetBGM() [1/2]

void Zone.SetBGM ( int  id = -1,
bool  refresh = true,
float  fadeDuration = 0f 
)
inline

Definition at line 3040 of file Zone.cs.

3041 {
3042 SetBGM(new List<int> { id }, refresh, fadeDuration);
3043 }

◆ SetBGM() [2/2]

void Zone.SetBGM ( List< int >  ids,
bool  refresh = true,
float  fadeDuration = 0f 
)
inline

Definition at line 3003 of file Zone.cs.

3004 {
3005 map._plDay.Clear();
3006 if (ids.Count > 0)
3007 {
3008 foreach (int id in ids)
3009 {
3010 if (id != -1)
3011 {
3012 map._plDay.Add(id);
3013 }
3014 }
3015 }
3016 UnityEngine.Object.DestroyImmediate(map.plDay);
3017 map.plDay = null;
3019 if (!refresh)
3020 {
3021 return;
3022 }
3023 if (fadeDuration > 0f)
3024 {
3025 EClass.Sound.StopBGM(fadeDuration, playLastBGM: false, delegate
3026 {
3028 {
3029 RefreshBGM();
3030 }
3031 });
3032 }
3033 else
3034 {
3035 EClass.Sound.StopBGM();
3036 RefreshBGM();
3037 }
3038 }
bool IsGameStarted
Definition: Core.cs:84

References Map._plDay, Game.activeZone, EClass.core, EClass.game, Core.IsGameStarted, Map.plDay, and EClass.Sound.

Referenced by ZoneEventSubdue.CheckClear(), ClaimZone(), ZonePreEnterBout.Execute(), Zone_DungeonDead.OnActivate(), Zone_EternalGarden.OnActivate(), Zone_Nefu.OnActivate(), ZoneEventDefenseGame.OnVisit(), ZoneEventHarvest.OnVisit(), ZoneEventSubdue.OnVisit(), DramaManager.ParseLine(), GoalCombat.Run(), Zone_CurryRuinDungeon.SetAlarm(), CardRenderer.ShowBossText(), ActThrow.Throw(), and Chara.TryDropBossLoot().

◆ SetFieldEffect()

void Zone.SetFieldEffect ( int  idEle,
int  a 
)
inline

Definition at line 2928 of file Zone.cs.

2929 {
2930 fieldElements.SetBase(idEle, a);
2931 }
Element SetBase(string alias, int v, int potential=0)

References ElementContainer.SetBase().

Referenced by Zone_DungeonDead.OnActivate(), and ZoneEventWedding.OnVisit().

◆ ShouldScaleImportedChara()

virtual bool Zone.ShouldScaleImportedChara ( Chara  c)
inlinevirtual

Reimplemented in Zone_QuestDungeon.

Definition at line 544 of file Zone.cs.

545 {
546 return false;
547 }

Referenced by SerializedCards.Restore().

◆ Simulate()

void Zone.Simulate ( )
inline

Definition at line 1192 of file Zone.cs.

1193 {
1194 if (!EClass.game.isLoading && base.visitCount > 0)
1195 {
1196 if (Boss != null && IsNefia)
1197 {
1198 Msg.Say("bossLeave", Boss.Name.ToTitleCase(), EClass._zone.Name);
1201 }
1202 int num = Mathf.Clamp(MinsSinceLastActive, 1, 10000);
1203 foreach (Chara chara2 in EClass._map.charas)
1204 {
1205 if (chara2.hp < 0)
1206 {
1207 chara2.hp = 0;
1208 }
1209 if (!chara2.IsPCParty)
1210 {
1211 if (chara2.mana.value < 0)
1212 {
1213 chara2.mana.value = 0;
1214 }
1215 if (chara2.stamina.value < 0)
1216 {
1217 chara2.stamina.value = 0;
1218 }
1219 }
1220 if (num > 60)
1221 {
1222 chara2.resistCon = null;
1223 }
1224 if (chara2.rarity >= Rarity.Legendary && !chara2.IsPCFaction && num > 0)
1225 {
1226 Msg.ignoreAll = true;
1227 chara2.Cure(CureType.Boss, 20 + num * 10);
1228 chara2.HealHP((int)((long)Mathf.Max(1, chara2.MaxHP) * (long)Mathf.Min(num, 20) / 20));
1229 chara2.mana.Mod(Mathf.Max(1, chara2.mana.max) * Mathf.Min(num, 20) / 20);
1230 chara2.stamina.Mod(Mathf.Max(1, chara2.stamina.max) * Mathf.Min(num, 20) / 20);
1231 Msg.ignoreAll = false;
1232 }
1233 }
1234 }
1235 Debug.Log("Last Active:" + base.lastActive);
1236 if (base.lastActive == 0 || HourSinceLastActive <= 1 || IsRegion)
1237 {
1238 return;
1239 }
1240 Debug.Log(Name + " Simulate:" + HourSinceLastActive + " hours");
1241 VirtualDate virtualDate = new VirtualDate(HourSinceLastActive);
1242 List<Chara> list = EClass._map.charas.ToList();
1243 int num2 = HourSinceLastActive / 24;
1244 int num3 = 0;
1245 if (num2 > 0)
1246 {
1247 foreach (Chara item in list)
1248 {
1249 if (!item.IsPCParty)
1250 {
1251 item.OnSleep(200, num2);
1252 if (item.conSleep != null)
1253 {
1254 item.conSleep.Kill();
1255 }
1256 if (EClass.rnd(EClass.world.date.IsNight ? 20 : 200) == 0 && !item.IsPCFaction)
1257 {
1258 item.AddCondition<ConSleep>(1000 + EClass.rnd(1000), force: true);
1259 }
1260 if (item.things.Count > 20)
1261 {
1262 item.ClearInventory(ClearInventoryType.Purge);
1263 }
1264 }
1265 }
1266 }
1267 VirtualDate.current = virtualDate;
1268 for (int i = 0; i < HourSinceLastActive; i++)
1269 {
1270 virtualDate.SimulateHour();
1271 if (!virtualDate.IsWinter)
1272 {
1273 num3++;
1274 }
1275 }
1276 EClass._map.things.ForeachReverse(delegate(Thing t)
1277 {
1279 });
1280 VirtualDate.current = null;
1281 if (!IsPCFaction)
1282 {
1283 return;
1284 }
1285 int num4 = 0;
1286 foreach (Chara item2 in list)
1287 {
1288 if (item2.IsPCParty)
1289 {
1290 continue;
1291 }
1292 if (!item2.IsHomeMember())
1293 {
1294 if (item2.id == "bee")
1295 {
1296 num4++;
1297 }
1298 if (num2 > 0 && item2.IsGuest())
1299 {
1300 item2.ChooseNewGoal();
1301 item2.ai.SimulateZone(num2);
1302 }
1303 continue;
1304 }
1305 if (num2 > 0)
1306 {
1307 Goal goalWork = item2.GetGoalWork();
1308 item2.SetAI(goalWork);
1309 if (goalWork is GoalWork)
1310 {
1311 (goalWork as GoalWork).FindWork(item2);
1312 }
1313 item2.ai.SimulateZone(num2);
1314 goalWork = item2.GetGoalHobby();
1315 item2.SetAI(goalWork);
1316 if (goalWork is GoalWork)
1317 {
1318 (goalWork as GoalWork).FindWork(item2);
1319 }
1320 item2.ai.SimulateZone(num2);
1321 }
1322 item2.ChooseNewGoal();
1323 if (item2.conSuspend == null)
1324 {
1325 item2.ai.OnSimulatePosition();
1326 }
1327 }
1328 List<Thing> list2 = new List<Thing>();
1329 foreach (Thing thing in map.things)
1330 {
1331 if (thing.IsInstalled && thing.trait is TraitBeekeep)
1332 {
1333 list2.Add(thing);
1334 }
1335 }
1336 if (num4 >= list2.Count)
1337 {
1338 return;
1339 }
1340 for (int j = num4; j < list2.Count; j++)
1341 {
1342 if (EClass.rnd(200) <= HourSinceLastActive)
1343 {
1344 Chara chara = CharaGen.Create("bee");
1345 AddCard(chara, list2.RandomItem().pos);
1346 Hostility c_originalHostility = (chara.hostility = Hostility.Neutral);
1347 chara.c_originalHostility = c_originalHostility;
1348 }
1349 }
1350 }
ClearInventoryType
CureType
Definition: CureType.cs:2
virtual void OnSimulatePosition()
Definition: AIAct.cs:604
void SimulateZone(int days)
Definition: AIAct.cs:592
virtual void HealHP(int a, HealSource origin=HealSource.None)
Definition: Card.cs:4057
int hp
Definition: Card.cs:243
string Name
Definition: Card.cs:2165
AIAct ai
Definition: Chara.cs:204
ConSuspend conSuspend
Definition: Chara.cs:104
Goal GetGoalWork()
Definition: Chara.cs:8985
override int MaxHP
Definition: Chara.cs:722
Goal GetGoalHobby()
Definition: Chara.cs:8998
Stats mana
Definition: Chara.cs:1180
Stats stamina
Definition: Chara.cs:1172
bool IsHomeMember()
Definition: Chara.cs:6712
bool IsGuest()
Definition: Chara.cs:6737
void ChooseNewGoal()
Definition: Chara.cs:8921
void Cure(CureType type, int p=100, BlessedState state=BlessedState.Normal)
Definition: Chara.cs:9673
bool IsNight
Definition: Date.cs:112
Definition: Goal.cs:4
bool isConquered
Definition: Spatial.cs:382
virtual void Mod(int a)
Definition: Stats.cs:135
virtual int value
Definition: Stats.cs:56
virtual int max
Definition: Stats.cs:68
void SimulateHour()
Definition: VirtualDate.cs:66
int MinsSinceLastActive
Definition: Zone.cs:125
Chara Boss
Definition: Zone.cs:86
int HourSinceLastActive
Definition: Zone.cs:123

References EClass._map, EClass._zone, Chara.ai, Boss, Map.charas, Chara.ChooseNewGoal(), Chara.conSuspend, CharaGen.Create(), Chara.Cure(), World.date, Debug, Card.DecayNatural(), EClass.game, Chara.GetGoalHobby(), Chara.GetGoalWork(), GetTopZone(), Card.HealHP(), Card.hp, Card.id, Spatial.isConquered, Chara.IsGuest(), Chara.IsHomeMember(), Card.IsInstalled, Game.isLoading, Date.IsNight, Chara.IsPCFaction, Chara.IsPCParty, Date.IsWinter, item, Chara.mana, Stats.max, Chara.MaxHP, Stats.Mod(), Spatial.Name, AIAct.OnSimulatePosition(), Card.pos, Card.rarity, RemoveCard(), EClass.rnd(), Msg.Say(), Chara.SetAI(), VirtualDate.SimulateHour(), AIAct.SimulateZone(), Chara.stamina, Map.things, Card.trait, Stats.value, and EClass.world.

◆ SpawnAltar()

void Zone.SpawnAltar ( )
inline

Definition at line 2547 of file Zone.cs.

2548 {
2550 {
2551 if (r.points.Count <= 4)
2552 {
2553 return false;
2554 }
2555 map.poiMap.OccyupyPOI(r.points[0]);
2556 List<Point> points = r.points;
2557 Religion randomReligion = EClass.game.religions.GetRandomReligion();
2558 "altarPoint".lang(randomReligion.NameDomain.lang());
2559 Thing thing = ThingGen.Create("altar");
2560 (thing.trait as TraitAltar).SetDeity(randomReligion.id);
2561 Chara t = CharaGen.Create("twintail");
2562 EClass._zone.AddCard(t, points.RandomItem());
2563 for (int i = 0; i < 2 + EClass.rnd(2); i++)
2564 {
2565 Chara t2 = CharaGen.Create("twintail");
2566 EClass._zone.AddCard(t2, points.RandomItem());
2567 }
2568 if (points[0].Installed == null)
2569 {
2570 EClass._zone.AddCard(thing, points[0]).Install();
2571 }
2572 foreach (Point item in points)
2573 {
2574 if (item.x % 3 == 0 && item.z % 2 == 0 && item != points[0] && !item.Equals(points[0].Front) && item.Installed == null)
2575 {
2576 thing = ThingGen.Create("pillar1");
2577 EClass._zone.AddCard(thing, item).Install();
2578 }
2579 item.SetObj();
2580 item.SetFloor(3, 6);
2581 }
2582 return true;
2583 });
2584 }
Crawler start
Definition: CoreRef.cs:214
Crawlers crawlers
Definition: CoreRef.cs:343
ReligionManager religions
Definition: Game.cs:159
POIMap poiMap
Definition: Map.cs:97
Point GetCenter()
Definition: POIMap.cs:13
Cell GetCenterCell(int radius=1)
Definition: POIMap.cs:65
void OccyupyPOI(Point p, int radius=0)
Definition: POIMap.cs:99
Religion GetRandomReligion(bool onlyJoinable=true, bool includeMinor=false)

References EClass._zone, AddCard(), EClass.core, CoreRef.crawlers, Crawler.CrawlUntil(), ThingGen.Create(), CharaGen.Create(), EClass.game, POIMap.Cell.GetCenter(), POIMap.GetCenterCell(), ReligionManager.GetRandomReligion(), item, POIMap.OccyupyPOI(), Map.poiMap, Core.refs, Game.religions, EClass.rnd(), CoreRef.Crawlers.start, and Card.trait.

◆ SpawnLostItems()

void Zone.SpawnLostItems ( )
inline

Definition at line 3800 of file Zone.cs.

3801 {
3802 for (int i = 0; i < 2 + EClass.rnd(4); i++)
3803 {
3804 Point point = GetPos();
3805 if (point == null)
3806 {
3807 continue;
3808 }
3809 if (EClass.rnd(30) == 0)
3810 {
3811 Thing thing = ThingGen.Create("purse");
3812 thing.isLostProperty = true;
3813 thing.things.DestroyAll();
3814 int num2 = (thing.c_lockLv = EClass.rndHalf(Mathf.Min(base.development / 10 + 10, 50)));
3815 thing.Add("money", EClass.rndHalf(num2 * 60 + 1000));
3816 if (EClass.rnd(2) == 0)
3817 {
3818 thing.Add("plat", EClass.rnd(4));
3819 }
3820 else
3821 {
3822 thing.Add("medal", EClass.rnd(2));
3823 }
3824 EClass._zone.AddCard(thing, point);
3825 }
3826 else
3827 {
3829 }
3830 }
3831 static Point GetPos()
3832 {
3833 for (int j = 0; j < 10; j++)
3834 {
3835 Point randomPoint = EClass._zone.bounds.GetRandomPoint();
3836 if (!randomPoint.IsBlocked && !randomPoint.HasThing && !randomPoint.HasObj && !randomPoint.HasBlock)
3837 {
3838 return randomPoint;
3839 }
3840 }
3841 return null;
3842 }
3843 }
ThingContainer things
Definition: Card.cs:39
Thing Add(string id, int num=1, int lv=1)
Definition: Card.cs:3129
static int rndHalf(int a)
Definition: EClass.cs:97
void DestroyAll(Func< Thing, bool > funcExclude=null)
static Thing CreateFromCategory(string idCat, int lv=-1)
Definition: ThingGen.cs:75
MapBounds bounds
Definition: Zone.cs:49

References EClass._zone, Card.Add(), AddCard(), bounds, ThingGen.Create(), ThingGen.CreateFromCategory(), ThingContainer.DestroyAll(), MapBounds.GetRandomPoint(), Point.HasBlock, Point.HasObj, Point.HasThing, Point.IsBlocked, EClass.rnd(), EClass.rndHalf(), and Card.things.

◆ SpawnMob() [1/2]

Chara Zone.SpawnMob ( Point  pos = null,
SpawnSetting  setting = null 
)
inline

Definition at line 2783 of file Zone.cs.

2784 {
2785 if (setting == null)
2786 {
2788 }
2789 if (pos == null)
2790 {
2791 pos = GetSpawnPos(setting.position, setting.tries);
2792 if (pos == null)
2793 {
2794 pos = GetSpawnPos(SpawnPosition.Random, setting.tries);
2795 if (pos == null)
2796 {
2797 return null;
2798 }
2799 }
2800 }
2802 if (IsUnderwater && EClass.rnd(15) != 0)
2803 {
2805 }
2806 SpawnList spawnList = null;
2807 spawnList = ((setting.idSpawnList != null) ? SpawnList.Get(setting.idSpawnList) : ((EClass._zone is Zone_DungeonYeek && EClass.rnd(5) != 0) ? SpawnListChara.Get("dungeon_yeek", (SourceChara.Row r) => r.race == "yeek" && r.quality == 0) : ((EClass._zone is Zone_DungeonDragon && EClass.rnd(5) != 0) ? SpawnListChara.Get("dungeon_dragon", (SourceChara.Row r) => (r.race == "dragon" || r.race == "drake" || r.race == "wyvern" || r.race == "lizardman" || r.race == "dinosaur") && r.quality == 0) : ((EClass._zone is Zone_DungeonMino && EClass.rnd(5) != 0) ? SpawnListChara.Get("dungeon_mino", (SourceChara.Row r) => r.race == "minotaur" && r.quality == 0) : ((setting.hostility == SpawnHostility.Neutral || (setting.hostility != SpawnHostility.Enemy && Rand.Range(0f, 1f) < ChanceSpawnNeutral)) ? SpawnList.Get("c_neutral") : ((biome.spawn.chara.Count <= 0) ? SpawnList.Get(biome.name, "chara", new CharaFilter
2808 {
2809 ShouldPass = delegate(SourceChara.Row s)
2810 {
2811 if (s.hostility != "")
2812 {
2813 return false;
2814 }
2815 return s.biome == biome.name || s.biome.IsEmpty();
2816 }
2818 int num = ((setting.dangerLv == -1) ? DangerLv : setting.dangerLv);
2819 CardBlueprint cardBlueprint = new CardBlueprint
2820 {
2821 rarity = Rarity.Normal,
2822 idEle = setting.idEle
2823 };
2824 int num2 = ((setting.filterLv == -1) ? num : setting.filterLv);
2825 if (ScaleType == ZoneScaleType.Void)
2826 {
2827 num2 = ((num - 1) % 50 + 5) * 150 / 100;
2828 if (num2 >= 20 && EClass.rnd(100) < num2)
2829 {
2830 num2 = num;
2831 }
2832 }
2833 CardRow cardRow = (setting.id.IsEmpty() ? spawnList.Select(num2, setting.levelRange) : EClass.sources.cards.map[setting.id]);
2834 if (EClass.world.date.month == 12 && setting.rarity == Rarity.Random && EClass._zone.IsNefia && EClass._zone.isRandomSite && EClass.world.date.day >= 24 && EClass.world.date.day <= 26 && EClass.rnd(50 * (1 + EClass.player.flags.santa) * (1 + EClass.player.flags.santa)) == 0)
2835 {
2836 cardRow = EClass.sources.cards.map["santa"];
2838 }
2839 long num3 = ((setting.fixedLv == -1) ? cardRow.LV : setting.fixedLv);
2840 bool flag = setting.fixedLv != -1 || DangerLvBoost > 0;
2841 if (ScaleType == ZoneScaleType.Void)
2842 {
2843 num3 = (50L + (long)cardRow.LV) * Mathf.Max(1, (num - 1) / 50);
2844 flag = true;
2845 }
2846 num3 += DangerLvBoost;
2847 if (setting.rarity == Rarity.Random && cardRow.quality == 0)
2848 {
2849 if (EClass.rnd(EClass.pc.HasElement(1271) ? 80 : 100) == 0)
2850 {
2851 cardBlueprint.rarity = Rarity.Legendary;
2852 num3 = num3 * 125 / 100;
2853 }
2854 }
2855 else
2856 {
2857 cardBlueprint.rarity = setting.rarity;
2858 }
2859 if (setting.isBoss)
2860 {
2861 num3 = num3 * 150 / 100;
2862 }
2863 if (setting.isEvolved)
2864 {
2865 num3 = num3 * 2 + 20;
2866 }
2867 if (num3 != cardRow.LV)
2868 {
2869 cardBlueprint.lv = (int)Mathf.Min(num3, 100000000f);
2870 }
2871 CardBlueprint.Set(cardBlueprint);
2872 Chara chara = CharaGen.Create(cardRow.id, num2);
2873 if (!flag)
2874 {
2875 chara.isScaled = false;
2876 }
2877 AddCard(chara, pos);
2878 if (setting.forcedHostility.HasValue)
2879 {
2880 Hostility c_originalHostility = (chara.hostility = setting.forcedHostility.Value);
2881 chara.c_originalHostility = c_originalHostility;
2882 }
2883 else
2884 {
2885 switch (chara.id)
2886 {
2887 case "unicorn":
2888 if (EClass.pc.HasElement(1216) && EClass.pc.Evalue(418) < 1)
2889 {
2890 chara.SetHostility(Hostility.Enemy);
2891 }
2892 break;
2893 case "santa":
2894 case "silverwolf":
2895 case "twintail":
2896 case "test17":
2897 if (EClass.pc.HasElement(1270))
2898 {
2899 chara.SetHostility(Hostility.Friend);
2900 }
2901 else if (EClass.pc.HasElement(1271))
2902 {
2903 chara.SetHostility(Hostility.Enemy);
2904 }
2905 break;
2906 }
2907 }
2908 if (setting.isBoss)
2909 {
2910 chara.c_bossType = BossType.Boss;
2911 }
2912 if (setting.isEvolved)
2913 {
2914 chara.c_bossType = BossType.Evolved;
2915 }
2916 if (DangerLv >= 20 && !IsPCFaction && !IsTown && EClass.rnd(200) == 0)
2917 {
2919 }
2920 return chara;
2921 }
BossType
Definition: BossType.cs:2
SpawnHostility
ZoneScaleType
Definition: ZoneScaleType.cs:2
string GetRandomCharaId()
static void Set(CardBlueprint _bp=null)
int quality
Definition: CardRow.cs:19
string id
Definition: CardRow.cs:7
bool HasElement(int ele, bool includeNagative=false)
Definition: Card.cs:6090
BiomeProfile biome
Definition: Cell.cs:1075
Condition AddCondition(string id, int p=100, bool force=false)
Definition: Chara.cs:9420
BiomeProfile Water
Definition: CoreRef.cs:152
BiomeProfile Sand
Definition: CoreRef.cs:150
Biomes biomes
Definition: CoreRef.cs:341
int month
Definition: Date.cs:50
int day
Definition: Date.cs:62
int santa
Definition: Player.cs:586
Flags flags
Definition: Player.cs:1117
static int Range(int min, int max)
Definition: Rand.cs:42
int LV
Definition: RenderRow.cs:22
bool isRandomSite
Definition: Spatial.cs:334
virtual int DangerLvBoost
Definition: Spatial.cs:489
static SpawnList Get(string id, Func< SourceChara.Row, bool > func)
static SpawnList Get(string id, string parent=null, CardFilter filter=null)
Definition: SpawnList.cs:18
CardRow Select(int lv=-1, int levelRange=-1)
Definition: SpawnList.cs:139
static SpawnSetting Default
Definition: SpawnSetting.cs:31
virtual ZoneScaleType ScaleType
Definition: Zone.cs:413
virtual float ChanceSpawnNeutral
Definition: Zone.cs:347

References EClass._zone, CoreRef.biomes, EClass.core, SpawnSetting.Default, SpawnListChara.Get(), SpawnList.Get(), Rand.Range(), Core.refs, EClass.rnd(), CoreRef.Biomes.Sand, and CoreRef.Biomes.Water.

◆ SpawnMob() [2/2]

◆ TextLevel()

string Zone.TextLevel ( int  _lv)
inline

Definition at line 559 of file Zone.cs.

560 {
561 if (_lv != 0)
562 {
563 if (base.lv <= 0)
564 {
565 return " " + "zoneLevelB".lang((_lv * -1).ToString() ?? "");
566 }
567 return " " + "zoneLevel".lang((_lv + 1).ToString() ?? "");
568 }
569 return "";
570 }
override string ToString()
Definition: Zone.cs:554

References ToString().

◆ ToString()

override string Zone.ToString ( )
inline

Definition at line 554 of file Zone.cs.

555 {
556 return Name + "(" + base.uid + ")(" + _regionPos?.ToString() + ") instance?" + IsInstance + "/" + EClass.world.date.GetRemainingHours(base.dateExpire) + "h";
557 }
int GetRemainingHours(int rawDeadLine)
Definition: Date.cs:343
override string ToString()
Definition: Point.cs:524
Point _regionPos
Definition: Spatial.cs:55

References Spatial._regionPos, World.date, Date.GetRemainingHours(), IsInstance, Spatial.Name, Point.ToString(), and EClass.world.

Referenced by Game.OnLoad(), and TextLevel().

◆ TryAddThing()

bool Zone.TryAddThing ( Thing  target,
Point  p,
bool  destroyIfFail = false 
)
inline

Definition at line 2234 of file Zone.cs.

2235 {
2236 int num = 0;
2237 if (p.cell.detail != null)
2238 {
2239 foreach (Thing thing in p.cell.detail.things)
2240 {
2241 if (thing.placeState == PlaceState.roaming)
2242 {
2243 if (target.TryStackTo(thing))
2244 {
2245 return true;
2246 }
2247 num++;
2248 }
2249 }
2250 }
2251 if (num == 0 || !destroyIfFail)
2252 {
2253 EClass._zone.AddCard(target, p);
2254 return true;
2255 }
2256 target.Destroy();
2257 return false;
2258 }
bool TryStackTo(Thing to)
Definition: Card.cs:3451
List< Thing > things
Definition: CellDetail.cs:11

References EClass._zone, AddCard(), Point.cell, Card.Destroy(), Cell.detail, Card.placeState, CellDetail.things, and Card.TryStackTo().

Referenced by FactionBranch.GenerateGarbage(), and Card.GiveBirth().

◆ TryAddThingInSharedContainer()

bool Zone.TryAddThingInSharedContainer ( Thing  t,
List< Thing containers = null,
bool  add = true,
bool  msg = false,
Chara  chara = null,
bool  sharedOnly = true 
)
inline

Definition at line 2137 of file Zone.cs.

2138 {
2139 Thing dest = null;
2140 int priority = -1;
2141 ContainerFlag flag = t.category.GetRoot().id.ToEnum<ContainerFlag>();
2142 if (flag == ContainerFlag.none)
2143 {
2144 flag = ContainerFlag.other;
2145 }
2146 if (containers == null)
2147 {
2148 containers = EClass._map.props.installed.containers;
2149 }
2150 if (SearchDest() != null)
2151 {
2152 return true;
2153 }
2154 if (dest == null)
2155 {
2156 return false;
2157 }
2158 if (add)
2159 {
2160 if (msg)
2161 {
2162 chara.Say("putSharedItem", chara, t, dest.GetName(NameStyle.Full));
2163 }
2164 dest.AddThing(t);
2165 }
2166 return true;
2167 Thing SearchDest()
2168 {
2169 foreach (Thing container in containers)
2170 {
2171 Thing thing = container;
2172 if (thing.trait is TraitShippingChest)
2173 {
2175 }
2176 if ((!sharedOnly || thing.IsSharedContainer) && thing.c_lockLv <= 0 && (thing.things.Count < thing.things.MaxCapacity || thing.things.CanStack(t) != t))
2177 {
2178 Window.SaveData windowSaveData = thing.GetWindowSaveData();
2179 if (windowSaveData != null)
2180 {
2181 if (windowSaveData.priority <= priority || (windowSaveData.noRotten && t.IsDecayed) || (windowSaveData.onlyRottable && t.trait.Decay == 0))
2182 {
2183 continue;
2184 }
2186 if (windowSaveData.userFilter)
2187 {
2188 filterResult = windowSaveData.IsFilterPass(t.GetName(NameStyle.Full, 1));
2189 if (filterResult == Window.SaveData.FilterResult.Block)
2190 {
2191 continue;
2192 }
2193 }
2194 if (filterResult != Window.SaveData.FilterResult.PassWithoutFurtherTest)
2195 {
2196 if (windowSaveData.advDistribution)
2197 {
2198 bool flag2 = false;
2199 foreach (int cat in windowSaveData.cats)
2200 {
2201 if (t.category.uid == cat)
2202 {
2203 flag2 = true;
2204 break;
2205 }
2206 }
2207 if (!flag2)
2208 {
2209 continue;
2210 }
2211 }
2212 else if (windowSaveData.flag.HasFlag(flag))
2213 {
2214 continue;
2215 }
2216 }
2217 priority = windowSaveData.priority;
2218 }
2219 else
2220 {
2221 if (priority != -1)
2222 {
2223 continue;
2224 }
2225 priority = 0;
2226 }
2227 dest = thing;
2228 }
2229 }
2230 return null;
2231 }
2232 }
ContainerFlag
Definition: ContainerFlag.cs:5
NameStyle
Definition: NameStyle.cs:2
Thing container_shipping
Definition: CardManager.cs:52
bool IsDecayed
Definition: Card.cs:2315
int c_lockLv
Definition: Card.cs:965
Thing AddThing(string id, int lv=-1)
Definition: Card.cs:3152
Window.SaveData GetWindowSaveData()
Definition: Card.cs:2544
SourceCategory.Row category
Definition: Card.cs:2075
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:7020
List< Thing > containers
Definition: Props.cs:22
Thing CanStack(Thing target, int destInvX=-1, int destInvY=-1)
override string GetName(NameStyle style, int _num=-1)
Definition: Thing.cs:535
bool IsSharedContainer
Definition: Thing.cs:113
virtual int Decay
Definition: Trait.cs:123
FilterResult IsFilterPass(string text)
Definition: Window.cs:498
ContainerFlag flag
Definition: Window.cs:267
HashSet< int > cats
Definition: Window.cs:119
bool userFilter
Definition: Window.cs:132
bool noRotten
Definition: Window.cs:439
bool onlyRottable
Definition: Window.cs:451
bool advDistribution
Definition: Window.cs:427
Definition: Window.cs:13

References EClass._map, Card.AddThing(), Window.SaveData.advDistribution, Card.c_lockLv, ThingContainer.CanStack(), Game.cards, Card.category, Window.SaveData.cats, CardManager.container_shipping, Props.containers, Trait.Decay, Window.SaveData.flag, EClass.game, Thing.GetName(), Card.GetWindowSaveData(), PropsManager.installed, Card.IsDecayed, Window.SaveData.IsFilterPass(), Thing.IsSharedContainer, ThingContainer.MaxCapacity, Window.SaveData.noRotten, Window.SaveData.onlyRottable, Window.SaveData.priority, Map.props, Card.Say(), Card.things, Card.trait, and Window.SaveData.userFilter.

Referenced by FactionBranch.AutoClean(), AI_Haul.GetThingToClean(), AI_Haul.Run(), GrowSystem.TryPick(), Chara.TryPutShared(), and Chara.TryPutSharedItems().

◆ TryAddThingInSpot< T >()

bool Zone.TryAddThingInSpot< T > ( Thing  t,
bool  useContainer = true 
)
inline
Type Constraints
T :Trait 

Definition at line 2060 of file Zone.cs.

2060 : Trait
2061 {
2062 Thing randomThing = EClass._map.props.installed.traits.GetRandomThing<T>();
2063 if (randomThing == null)
2064 {
2066 return false;
2067 }
2068 if (useContainer && (!t.IsContainer || t.things.Count == 0))
2069 {
2070 List<Thing> list = new List<Thing>();
2071 foreach (Point item in randomThing.trait.ListPoints(null, onlyPassable: false))
2072 {
2073 foreach (Card item2 in item.ListCards())
2074 {
2075 if (item2.IsContainer && !(item2.trait is TraitDeliveryChest))
2076 {
2077 list.Add(item2.Thing);
2078 }
2079 }
2080 }
2081 if (TryAddThingInSharedContainer(t, list, add: true, msg: false, null, sharedOnly: false))
2082 {
2083 return true;
2084 }
2085 }
2086 AddCard(t, randomThing.trait.GetRandomPoint());
2087 return true;
2088 }
virtual Thing Thing
Definition: Card.cs:2084
bool IsContainer
Definition: Card.cs:2115
virtual List< Point > ListPoints(Point center=null, bool onlyPassable=true)
Definition: Trait.cs:779
Point GetRandomPoint(Func< Point, bool > func=null, Chara accessChara=null)
Definition: Trait.cs:761
bool TryAddThingInSharedContainer(Thing t, List< Thing > containers=null, bool add=true, bool msg=false, Chara chara=null, bool sharedOnly=true)
Definition: Zone.cs:2137

References EClass._map, Map.bounds, Trait.GetRandomPoint(), MapBounds.GetRandomSurface(), PropsManager.installed, Card.IsContainer, item, Trait.ListPoints(), Map.props, Card.Thing, Card.things, Card.trait, and Props.traits.

◆ TryGenerateBigDaddy()

void Zone.TryGenerateBigDaddy ( )
inline

Definition at line 2659 of file Zone.cs.

2660 {
2661 if (!(BigDaddyChance * (EClass.pc.HasElement(1270) ? 1.1f : 1f) <= EClass.rndf(1f)))
2662 {
2663 int num = (int)((long)DangerLv * 125L / 100);
2664 if (num >= 30)
2665 {
2667 {
2668 lv = num
2669 });
2670 }
2671 Chara chara = CharaGen.Create("big_daddy");
2672 if (EClass.pc.HasElement(1270))
2673 {
2674 chara.SetHostility(Hostility.Friend);
2675 }
2676 else if (EClass.pc.HasElement(1271))
2677 {
2678 chara.SetHostility(Hostility.Enemy);
2679 }
2680 EClass._zone.AddCard(chara, GetSpawnPos(SpawnPosition.Random, 10000));
2681 Msg.Say("sign_bigdaddy");
2682 }
2683 }
static float rndf(float a)
Definition: EClass.cs:102
virtual float BigDaddyChance
Definition: Zone.cs:323

References EClass._zone, AddCard(), CharaGen.Create(), Card.HasElement(), EClass.pc, EClass.rndf(), Msg.Say(), CardBlueprint.Set(), and Chara.SetHostility().

Referenced by Zone_Dungeon.OnGenerateMap().

◆ TryGenerateEvolved()

Chara Zone.TryGenerateEvolved ( bool  force = false,
Point  p = null 
)
inline

Definition at line 2639 of file Zone.cs.

2640 {
2641 float num = EvolvedChance * (EClass.pc.HasElement(1270) ? 1.1f : 1f);
2642 if (!force && num <= EClass.rndf(1f))
2643 {
2644 return null;
2645 }
2646 Chara chara = SpawnMob(p, SpawnSetting.Evolved());
2647 for (int i = 0; i < 2 + EClass.rnd(2); i++)
2648 {
2649 chara.ability.AddRandom();
2650 }
2651 chara.AddThing(chara.MakeGene(DNA.Type.Default));
2652 if (EClass.rnd(2) == 0)
2653 {
2654 chara.AddThing(chara.MakeGene(DNA.Type.Superior));
2655 }
2656 return chara;
2657 }
void AddRandom()
Thing MakeGene(DNA.Type? type=null)
Definition: Chara.cs:8325
CharaAbility ability
Definition: Chara.cs:426
Definition: DNA.cs:8
Type
Definition: DNA.cs:10
static SpawnSetting Evolved(int fixedLv=-1)
Definition: SpawnSetting.cs:35
virtual float EvolvedChance
Definition: Zone.cs:325

References Chara.ability, CharaAbility.AddRandom(), Card.AddThing(), SpawnSetting.Evolved(), Card.HasElement(), Chara.MakeGene(), EClass.pc, EClass.rnd(), and EClass.rndf().

Referenced by ZoneEventSiege.CreateChara(), Zone_Dungeon.OnGenerateMap(), and ZoneEventQuest.SpawnBoss().

◆ TryGenerateOre()

void Zone.TryGenerateOre ( )
inline

Definition at line 2612 of file Zone.cs.

2613 {
2614 if (OreChance <= 0f)
2615 {
2616 return;
2617 }
2618 Crawler.Create("ore").CrawlUntil(tries: EClass.rnd((int)((float)(map.bounds.Width * map.bounds.Height / 200 + 1) * OreChance + 2f)), map: EClass._map, onStart: () => EClass._map.bounds.GetRandomPoint(), canComplete: delegate(Crawler.Result r)
2619 {
2620 byte b = 18;
2621 string group = "ore";
2622 if (EClass.rnd(5) == 0)
2623 {
2624 b++;
2625 group = "gem";
2626 }
2627 SourceMaterial.Row randomMaterial = MATERIAL.GetRandomMaterial(DangerLv, group);
2628 foreach (Point point in r.points)
2629 {
2630 if (point.sourceBlock.ContainsTag("ore"))
2631 {
2632 map.SetObj(point.x, point.z, randomMaterial.id, b, 1, 0);
2633 }
2634 }
2635 return false;
2636 });
2637 }
static SourceMaterial.Row GetRandomMaterial(int lv, string group=null, bool tryLevelMatTier=false)
Definition: MATERIAL.cs:56
int Width
Definition: MapBounds.cs:26
int Height
Definition: MapBounds.cs:28
virtual float OreChance
Definition: Zone.cs:321

References EClass._map, Map.bounds, Crawler.CrawlUntil(), Crawler.Create(), MATERIAL.GetRandomMaterial(), MapBounds.GetRandomPoint(), MapBounds.Height, EClass.rnd(), and MapBounds.Width.

Referenced by Zone_Dungeon.OnGenerateMap().

◆ TryGenerateShrine()

void Zone.TryGenerateShrine ( )
inline

Definition at line 2685 of file Zone.cs.

2686 {
2687 float num = ShrineChance * (EClass.pc.HasElement(1270) ? 1.1f : 1f);
2688 for (int i = 0; i < 3; i++)
2689 {
2690 Rand.SetSeed(base.uid + i);
2691 if (num <= EClass.rndf(1f))
2692 {
2693 continue;
2694 }
2695 Point randomSpace = EClass._map.GetRandomSpace(3, 3);
2696 if (randomSpace == null)
2697 {
2698 continue;
2699 }
2700 randomSpace.x++;
2701 randomSpace.z++;
2702 if (randomSpace.HasThing || randomSpace.HasChara)
2703 {
2704 continue;
2705 }
2706 randomSpace.SetObj();
2709 if (EClass.rnd(EClass.debug.test ? 2 : 15) == 0)
2710 {
2711 EClass._zone.AddCard(ThingGen.Create("pedestal_power"), randomSpace).Install();
2712 EClass._zone.AddCard(ThingGen.Create(EClass.gamedata.godStatues.RandomItemWeighted((GodStatueData a) => a.chance).idThing, -1, DangerLv), randomSpace).Install();
2713 }
2714 else
2715 {
2716 EClass._zone.AddCard(ThingGen.Create("statue_power", -1, DangerLv), randomSpace).Install().SetRandomDir();
2717 }
2718 }
2719 Rand.SetSeed();
2720 }
void SetRandomDir()
Definition: Card.cs:6405
bool test
Definition: CoreDebug.cs:170
static GameData gamedata
Definition: EClass.cs:37
List< GodStatueData > godStatues
Definition: GameData.cs:9
Point GetRandomSpace(int width, int height, int tries=100)
Definition: MapBounds.cs:246
int seedShrine
Definition: Player.cs:964
void SetObj(int id=0, int value=1, int dir=0)
Definition: Point.cs:928
virtual float ShrineChance
Definition: Zone.cs:327

References EClass._map, EClass._zone, AddCard(), GodStatueData.chance, ThingGen.Create(), EClass.debug, EClass.gamedata, MapBounds.GetRandomSpace(), GameData.godStatues, Point.HasChara, Card.HasElement(), Point.HasThing, EClass.pc, EClass.player, EClass.rnd(), EClass.rndf(), Player.seedShrine, Point.SetObj(), Card.SetRandomDir(), Rand.SetSeed(), CoreDebug.test, Point.x, and Point.z.

Referenced by Zone_Dungeon.OnGenerateMap().

◆ TryGetRestock< T >()

Thing Zone.TryGetRestock< T > ( string  idCat)
inline
Type Constraints
T :TraitSpot 

Definition at line 2276 of file Zone.cs.

2276 : TraitSpot
2277 {
2278 List<T> list = new List<T>();
2279 foreach (Thing thing2 in EClass._map.things)
2280 {
2281 if (thing2.IsInstalled && thing2.trait is T)
2282 {
2283 list.Add(thing2.trait as T);
2284 }
2285 }
2286 foreach (T item in list)
2287 {
2288 foreach (Point item2 in item.ListPoints(null, onlyPassable: false))
2289 {
2290 foreach (Thing thing3 in item2.Things)
2291 {
2292 if (!thing3.IsInstalled || thing3.isSale)
2293 {
2294 continue;
2295 }
2296 if (thing3.things.Count == 0)
2297 {
2298 if (IsValid(thing3, insideContainer: false))
2299 {
2300 return thing3;
2301 }
2302 continue;
2303 }
2304 Thing thing = thing3.things.Find((Thing _t) => IsValid(_t, insideContainer: true));
2305 if (thing != null)
2306 {
2307 return thing;
2308 }
2309 }
2310 }
2311 }
2312 return null;
2313 bool IsValid(Thing t, bool insideContainer)
2314 {
2315 if (t.category.id != idCat || !TraitSalesTag.CanTagSale(t, insideContainer))
2316 {
2317 return false;
2318 }
2319 return true;
2320 }
2321 }
bool isSale
Definition: Card.cs:867
List< Thing > Things
Definition: Point.cs:338
Thing Find(int uid)
static bool CanTagSale(Card t, bool insideContainer=false)
Definition: TraitSalesTag.cs:9

References EClass._map, TraitSalesTag.CanTagSale(), Card.category, ThingContainer.Find(), Card.IsInstalled, Card.isSale, item, Card.things, Map.things, Point.Things, and Card.trait.

◆ TryGetThingFromSharedContainer()

Thing Zone.TryGetThingFromSharedContainer ( Func< Thing, bool >  func)
inline

Definition at line 2260 of file Zone.cs.

2261 {
2262 foreach (Thing container in EClass._map.props.installed.containers)
2263 {
2264 if (container.IsSharedContainer)
2265 {
2266 Thing thing = container.things.Find(func);
2267 if (thing != null)
2268 {
2269 return thing;
2270 }
2271 }
2272 }
2273 return null;
2274 }

References EClass._map, Props.containers, ThingContainer.Find(), PropsManager.installed, Thing.IsSharedContainer, Map.props, and Card.things.

Referenced by FactionBranch.DailyOutcome(), and FactionBranch.GetMeal().

◆ TryListThingsInSpot< T >()

List< Thing > Zone.TryListThingsInSpot< T > ( Func< Thing, bool >  func = null)
inline
Type Constraints
T :TraitSpot 

Definition at line 2090 of file Zone.cs.

2090 : TraitSpot
2091 {
2092 List<T> list = new List<T>();
2093 List<Thing> list2 = new List<Thing>();
2094 foreach (Thing thing in EClass._map.things)
2095 {
2096 if (thing.IsInstalled && thing.trait is T)
2097 {
2098 list.Add(thing.trait as T);
2099 }
2100 }
2101 foreach (T item in list)
2102 {
2103 foreach (Point item2 in item.ListPoints(null, onlyPassable: false))
2104 {
2105 foreach (Thing thing2 in item2.Things)
2106 {
2107 if (!thing2.IsInstalled)
2108 {
2109 continue;
2110 }
2111 if (thing2.things.Count == 0)
2112 {
2113 if (IsValid(thing2))
2114 {
2115 list2.Add(thing2);
2116 }
2117 continue;
2118 }
2119 foreach (Thing item3 in thing2.things.List((Thing _t) => IsValid(_t)))
2120 {
2121 list2.Add(item3);
2122 }
2123 }
2124 }
2125 }
2126 return list2;
2127 bool IsValid(Thing t)
2128 {
2129 if (func != null && !func(t))
2130 {
2131 return false;
2132 }
2133 return true;
2134 }
2135 }
List< Thing > List(Func< Thing, bool > func, bool onlyAccessible=false)

References EClass._map, Card.IsInstalled, item, ThingContainer.List(), Card.things, Map.things, Point.Things, and Card.trait.

◆ TrySpawnFollower()

void Zone.TrySpawnFollower ( )
inline

Definition at line 2513 of file Zone.cs.

2514 {
2515 bool flag = EClass.pc.HasCondition<ConDrawBacker>();
2516 if (!EClass.debug.enable && EClass.rnd(flag ? 3 : 20) != 0)
2517 {
2518 return;
2519 }
2520 Point randomSurface = EClass._map.bounds.GetRandomSurface();
2521 if (!randomSurface.IsValid)
2522 {
2523 return;
2524 }
2525 Chara c = CharaGen.Create("follower");
2526 EClass._zone.AddCard(c, randomSurface);
2527 (EClass._zone.AddThing("gallows", randomSurface).Install().trait as TraitShackle).Restrain(c);
2528 c.c_rescueState = RescueState.WaitingForRescue;
2529 if (EClass.rnd(flag ? 1 : 2) == 0 || EClass.debug.enable)
2530 {
2532 if (row != null)
2533 {
2534 c.ApplyBacker(row.id);
2535 }
2536 }
2537 Religion faith = EClass.game.religions.dictAll.Values.Where((Religion a) => a != c.faith).RandomItem();
2538 for (int i = 0; i < 3 + EClass.rnd(4); i++)
2539 {
2540 Chara chara = CharaGen.Create("fanatic");
2541 chara.SetFaith(faith);
2542 Point point = randomSurface.GetRandomPoint(4) ?? randomSurface.GetNearestPoint();
2543 EClass._zone.AddCard(chara, point);
2544 }
2545 }
RescueState
Definition: RescueState.cs:2
static int indexFollower
Religion faith
Definition: Chara.cs:441
void SetFaith(string id)
Definition: Chara.cs:1739
Dictionary< string, Religion > dictAll
List< Row > listFollower
Definition: SourceBacker.cs:82

References EClass._map, EClass._zone, AddCard(), AddThing(), Card.ApplyBacker(), SourceManager.backers, Map.bounds, CharaGen.Create(), EClass.debug, ReligionManager.dictAll, CoreDebug.enable, Chara.faith, faith, EClass.game, Point.GetNearestPoint(), Point.GetRandomPoint(), MapBounds.GetRandomSurface(), Chara.HasCondition(), SourceBacker.Row.id, BackerContent.indexFollower, Card.Install(), Point.IsValid, SourceBacker.listFollower, EClass.pc, Game.religions, EClass.rnd(), Chara.SetFaith(), EClass.sources, and Card.trait.

◆ UnloadMap()

void Zone.UnloadMap ( )
inline

Definition at line 1715 of file Zone.cs.

1716 {
1717 map = null;
1718 if (bp != null)
1719 {
1720 bp.map = null;
1721 }
1722 if (branch != null)
1723 {
1725 }
1726 Debug.Log("Unloaded Map:" + this);
1727 }
void OnUnloadMap()

References Debug, and FactionBranch.OnUnloadMap().

Referenced by Activate().

◆ UpdateQuests()

void Zone.UpdateQuests ( bool  force = false)
inline

Definition at line 3677 of file Zone.cs.

3678 {
3679 if (!IsPCFaction && (!(this is Zone_Town) || base.lv != 0))
3680 {
3681 return;
3682 }
3683 Debug.Log("Updating Quest:" + force);
3684 List<SourceQuest.Row> list = EClass.sources.quests.rows.Where((SourceQuest.Row a) => a.group == "random").ToList();
3685 int num = 0;
3686 foreach (Chara item in map.charas.Concat(map.deadCharas))
3687 {
3688 if (item.quest != null && !EClass.game.quests.list.Contains(item.quest))
3689 {
3690 if (item.quest.IsExpired || completedQuests.Contains(item.quest.uid) || force)
3691 {
3692 item.quest = null;
3693 }
3694 else
3695 {
3696 num++;
3697 }
3698 }
3699 }
3700 if (EClass._zone.dateQuest > EClass.world.date.GetRaw() && !force)
3701 {
3702 return;
3703 }
3704 EClass._zone.dateQuest = EClass.world.date.GetRaw() + 1440;
3705 int maxQuest = 3;
3706 Rand.UseSeed(base.uid + EClass.player.stats.days / 7 % 100, delegate
3707 {
3708 maxQuest = 4 + EClass.rnd(4);
3709 });
3710 completedQuests.Clear();
3711 List<Zone> list2 = Quest.ListDeliver();
3712 List<Tuple<string, int>> listTag = new List<Tuple<string, int>>();
3713 string[] array = EClass._zone.source.questTag;
3715 {
3716 array = new string[9] { "supply/8", "deliver/7", "food/8", "escort/4", "deliver/4", "monster/0", "war/0", "farm/0", "music/0" };
3717 }
3718 string[] array2 = array;
3719 for (int i = 0; i < array2.Length; i++)
3720 {
3721 string[] array3 = array2[i].Split('/');
3722 listTag.Add(new Tuple<string, int>(array3[0], array3[1].ToInt()));
3723 }
3724 for (int j = 0; j < map.charas.Count * 2; j++)
3725 {
3726 if (num > maxQuest)
3727 {
3728 break;
3729 }
3730 if (num > 15)
3731 {
3732 break;
3733 }
3734 Chara chara = map.charas.RandomItem();
3735 if (!chara.trait.CanGiveRandomQuest || chara.isSubsetCard || chara.homeZone != EClass._zone || chara.IsGuest() || chara.memberType == FactionMemberType.Livestock || (chara.quest != null && !force))
3736 {
3737 continue;
3738 }
3739 SourceQuest.Row row = list.RandomItemWeighted(delegate(SourceQuest.Row a)
3740 {
3741 int num2 = 1;
3742 foreach (Tuple<string, int> item2 in listTag)
3743 {
3744 if (a.tags.Contains(item2.Item1))
3745 {
3746 num2 = item2.Item2;
3747 break;
3748 }
3749 }
3750 if (!EClass._zone.IsPCFaction && a.tags.Contains("bulk"))
3751 {
3752 num2 = 0;
3753 }
3754 return a.chance * num2;
3755 });
3756 if ((!row.tags.Contains("needDestZone") || list2.Count >= 2) && (row.minFame <= 0 || row.minFame < EClass.player.fame || EClass.debug.enable))
3757 {
3758 Quest.Create(row.id, null, chara);
3759 num++;
3760 }
3761 }
3762 }
QuestManager quests
Definition: Game.cs:183
int days
Definition: Player.cs:75
Stats stats
Definition: Player.cs:1039
int fame
Definition: Player.cs:904
List< Quest > list
Definition: QuestManager.cs:11
Definition: Quest.cs:7
static List< Zone > ListDeliver()
Definition: Quest.cs:259
static Quest Create(string _id, string _idPerson=null, Chara c=null, bool assignQuest=true)
Definition: Quest.cs:241
static void UseSeed(int seed, Action action)
Definition: Rand.cs:22
SourceQuest quests
string[] tags
Definition: SourceQuest.cs:22
int dateQuest
Definition: Spatial.cs:286
SourceZone.Row source
Definition: Spatial.cs:453
virtual bool CanGiveRandomQuest
Definition: TraitChara.cs:116
HashSet< int > completedQuests
Definition: Zone.cs:37

References EClass._zone, TraitChara.CanGiveRandomQuest, Map.charas, Quest.Create(), World.date, Spatial.dateQuest, Player.Stats.days, Map.deadCharas, EClass.debug, Debug, CoreDebug.enable, Player.fame, EClass.game, Date.GetRaw(), Chara.homeZone, SourceQuest.Row.id, Chara.IsGuest(), IsPCFaction, Card.isSubsetCard, item, QuestManager.list, Quest.ListDeliver(), SourceQuest.Row.minFame, EClass.player, Game.quests, SourceManager.quests, Spatial.source, EClass.sources, Player.stats, SourceQuest.Row.tags, Chara.trait, Rand.UseSeed(), and EClass.world.

Referenced by LayerQuestBoard.OnSwitchContent(), and LayerQuestBoard.RefreshQuest().

◆ WriteNote()

void Zone.WriteNote ( UINote  n,
Action< UINote onWriteNote = null,
IInspect::NoteMode  mode = IInspect::NoteMode::Default,
Recipe  recipe = null 
)
inline

Implements IInspect.

Definition at line 3309 of file Zone.cs.

3310 {
3311 }

Member Data Documentation

◆ _biome

BiomeProfile Zone._biome

Definition at line 79 of file Zone.cs.

◆ bounds

◆ bp

ZoneBlueprint Zone.bp

Definition at line 67 of file Zone.cs.

Referenced by Activate().

◆ branch

◆ completedQuests

HashSet<int> Zone.completedQuests = new HashSet<int>()

Definition at line 37 of file Zone.cs.

Referenced by Quest.Complete(), and Quest.Fail().

◆ dictCitizen

Dictionary<int, string> Zone.dictCitizen = new Dictionary<int, string>()

Definition at line 52 of file Zone.cs.

Referenced by DramaCustomSequence.Build(), Quest.Create(), and Quest.ListDeliver().

◆ dirtyElectricity

bool Zone.dirtyElectricity

Definition at line 71 of file Zone.cs.

Referenced by Scene.OnUpdate().

◆ elements

◆ events

◆ fieldElements

ElementContainerField Zone.fieldElements = new ElementContainerField()

Definition at line 46 of file Zone.cs.

Referenced by WidgetDate._Refresh().

◆ fileVariation

int Zone.fileVariation

Definition at line 69 of file Zone.cs.

◆ forceRegenerate

bool Zone.forceRegenerate
static

Definition at line 25 of file Zone.cs.

Referenced by Activate().

◆ forceSubset

string Zone.forceSubset
static

Definition at line 27 of file Zone.cs.

Referenced by Activate().

◆ fortuneRoll

FortuneRollData Zone.fortuneRoll
private

Definition at line 61 of file Zone.cs.

◆ ignoreSpawnAnime

bool Zone.ignoreSpawnAnime
static

Definition at line 81 of file Zone.cs.

◆ instance

◆ isSimulating

bool Zone.isSimulating

Definition at line 75 of file Zone.cs.

Referenced by Activate(), and Chara.GetGoalFromTimeTable().

◆ isStarted

◆ landFeats

List<int> Zone.landFeats

Definition at line 58 of file Zone.cs.

◆ map

◆ okaerinko

int Zone.okaerinko = 0
static

Definition at line 31 of file Zone.cs.

Referenced by AI_Idle.Run().

◆ sourceHat

CardRow Zone.sourceHat
static

Definition at line 29 of file Zone.cs.

Referenced by CharaRenderer.Draw().

◆ subset

MapSubset Zone.subset

Definition at line 65 of file Zone.cs.

Referenced by Activate(), and MapSubset.Save().

◆ Suckers

List<Thing> Zone.Suckers = new List<Thing>()
static

Definition at line 83 of file Zone.cs.

Referenced by TraitSeed.TrySprout().

◆ tempDist

int Zone.tempDist

Definition at line 77 of file Zone.cs.

Referenced by LayerTravel.GetTravelFood(), and LayerTravel.Refresh().

Property Documentation

◆ AddPrefix

virtual bool Zone.AddPrefix
get

Definition at line 285 of file Zone.cs.

Referenced by OnAfterCreate().

◆ AllowCriminal

virtual bool Zone.AllowCriminal
get

Definition at line 249 of file Zone.cs.

◆ AllowInvest

virtual bool Zone.AllowInvest
get

Definition at line 251 of file Zone.cs.

252 {
253 get
254 {
255 if (!IsTown && !IsPCFaction)
256 {
257 return Guild.GetCurrentGuild() != null;
258 }
259 return true;
260 }
261 }

Referenced by DramaCustomSequence.Build().

◆ AllowNewZone

virtual bool Zone.AllowNewZone
get

Definition at line 263 of file Zone.cs.

Referenced by TraitNewZone.CanAutoEnter(), and TraitNewZone.TrySetAct().

◆ AlwaysLowblock

virtual bool Zone.AlwaysLowblock
get

Definition at line 397 of file Zone.cs.

Referenced by BaseTileMap.Draw().

◆ BaseElectricity

virtual int Zone.BaseElectricity
get

Definition at line 495 of file Zone.cs.

◆ BigDaddyChance

virtual float Zone.BigDaddyChance
get

Definition at line 323 of file Zone.cs.

◆ biome

◆ BlockBorderExit

virtual bool Zone.BlockBorderExit
get

Definition at line 171 of file Zone.cs.

Referenced by Player.CanExitBorder().

◆ Boss

Chara Zone.Boss
getset

Definition at line 85 of file Zone.cs.

86 {
87 get
88 {
89 return EClass._map.FindChara(base.uidBoss);
90 }
91 set
92 {
93 base.uidBoss = value?.uid ?? 0;
94 }
95 }
Chara FindChara(string id)
Definition: Map.cs:2568

Referenced by Scene.Init(), TraitNewZone.MoveZone(), ActEffect.Proc(), AI_Idle.Run(), ActThrow.Throw(), and Chara.TryDropBossLoot().

◆ CanBeDeliverDestination

virtual bool Zone.CanBeDeliverDestination
get

Definition at line 227 of file Zone.cs.

Referenced by Quest.ListDeliver().

◆ CanDigUnderground

virtual bool Zone.CanDigUnderground
get

Definition at line 275 of file Zone.cs.

Referenced by TaskMine.GetHitResult().

◆ CanEnterBuildMode

bool Zone.CanEnterBuildMode
get

Definition at line 447 of file Zone.cs.

448 {
449 get
450 {
452 {
453 return base.mainFaction == EClass.pc.faction;
454 }
455 return true;
456 }
457 }
bool godBuild
Definition: CoreDebug.cs:304
bool ignoreBuildRule
Definition: CoreDebug.cs:185

◆ CanEnterBuildModeAnywhere

bool Zone.CanEnterBuildModeAnywhere
get

Definition at line 459 of file Zone.cs.

460 {
461 get
462 {
464 {
465 if (base.mainFaction == EClass.pc.faction)
466 {
467 return EClass.Branch.elements.Has(4003);
468 }
469 return false;
470 }
471 return true;
472 }
473 }
ElementContainerZone elements

Referenced by WidgetMenuPanel._OnChangeMode(), ActionMode.DoFunc(), and HotbarManager.ResetHotbar().

◆ CanInspect

bool Zone.CanInspect
get

Implements IInspect.

Definition at line 499 of file Zone.cs.

500 {
501 get
502 {
503 if (!IsInstance)
504 {
505 return !HiddenInRegionMap;
506 }
507 return false;
508 }
509 }
virtual bool HiddenInRegionMap
Definition: Zone.cs:415

◆ CanUnlockExit

virtual bool Zone.CanUnlockExit
get

Definition at line 279 of file Zone.cs.

Referenced by TraitStairsLocked.OnUse(), and CoreDebug.UpdateInput().

◆ ChanceSpawnNeutral

virtual float Zone.ChanceSpawnNeutral
get

Definition at line 347 of file Zone.cs.

◆ ContentLv

override int Zone.ContentLv
get

Definition at line 97 of file Zone.cs.

98 {
99 get
100 {
101 if (branch == null)
102 {
103 return DangerLv;
104 }
105 return branch.ContentLV;
106 }
107 }

Referenced by DNA.GenerateRandomGene(), AI_Fish.Makefish(), and ConTransmuteMimic.OnBeforeStart().

◆ CountDeepestLevel

virtual bool Zone.CountDeepestLevel
get

Definition at line 229 of file Zone.cs.

◆ DangerLv

◆ DefaultActionMode

virtual ActionMode Zone.DefaultActionMode
get

Definition at line 169 of file Zone.cs.

◆ DisableRooms

virtual bool Zone.DisableRooms
get

Definition at line 121 of file Zone.cs.

Referenced by Map.TryAddRoom().

◆ EvolvedChance

virtual float Zone.EvolvedChance
get

Definition at line 325 of file Zone.cs.

◆ ExpireDays

virtual int Zone.ExpireDays
get

Definition at line 173 of file Zone.cs.

Referenced by Activate().

◆ FeatureType

virtual ZoneFeatureType Zone.FeatureType
get

Definition at line 177 of file Zone.cs.

◆ FlockType

virtual FlockController.SpawnType Zone.FlockType
get

Definition at line 417 of file Zone.cs.

Referenced by Scene.Init().

◆ Generator

MapGenerator Zone.Generator
get

Definition at line 139 of file Zone.cs.

Referenced by MapGenDungen.OnGenerateTerrain().

◆ GrowPlant

virtual bool Zone.GrowPlant
get

Definition at line 349 of file Zone.cs.

◆ GrowWeed

virtual bool Zone.GrowWeed
get

Definition at line 351 of file Zone.cs.

◆ HasLaw

virtual bool Zone.HasLaw
get

◆ HiddenInRegionMap

virtual bool Zone.HiddenInRegionMap
get

Definition at line 415 of file Zone.cs.

Referenced by Chara._Move().

◆ HourSinceLastActive

int Zone.HourSinceLastActive
get

Definition at line 123 of file Zone.cs.

◆ IDAmbience

virtual string Zone.IDAmbience
get

Definition at line 179 of file Zone.cs.

180 {
181 get
182 {
183 if (!IsRegion && !map.IsIndoor)
184 {
185 if (!IsTown)
186 {
187 return "forest";
188 }
189 return "town";
190 }
191 return null;
192 }
193 }

◆ IDBaseLandFeat

virtual string Zone.IDBaseLandFeat
get

Definition at line 149 of file Zone.cs.

◆ IdBiome

virtual string Zone.IdBiome
get

Definition at line 131 of file Zone.cs.

◆ idExport

virtual string Zone.idExport
get

Definition at line 151 of file Zone.cs.

152 {
153 get
154 {
155 if (base.source.idFile.Length != 0)
156 {
157 return base.source.idFile[fileVariation] + ((base.lv == 0) ? "" : ("_F" + base.lv));
158 }
159 return "";
160 }
161 }
int fileVariation
Definition: Zone.cs:69

Referenced by Activate(), MapSubset.Exist(), Zone_Dungeon.OnGenerateMap(), and MapSubset.Save().

◆ IDGenerator

virtual string Zone.IDGenerator
get

Definition at line 135 of file Zone.cs.

Referenced by ZoneBlueprint.GenerateMap(), and TraitNewZone.MoveZone().

◆ IDHat

virtual string Zone.IDHat
get

Definition at line 147 of file Zone.cs.

◆ IDPlayList

virtual string Zone.IDPlayList
get

Definition at line 143 of file Zone.cs.

◆ IDPlaylistOverwrite

virtual string Zone.IDPlaylistOverwrite
get

Definition at line 145 of file Zone.cs.

◆ IdProfile

virtual string Zone.IdProfile
get

Definition at line 141 of file Zone.cs.

◆ IDSceneTemplate

virtual string Zone.IDSceneTemplate
get

Definition at line 195 of file Zone.cs.

196 {
197 get
198 {
199 if (!EClass._map.IsIndoor)
200 {
201 if (!IsSnowZone)
202 {
203 return "Default";
204 }
205 return "Snow";
206 }
207 return "Indoor";
208 }
209 }
virtual bool IsSnowZone
Definition: Spatial.cs:542

Referenced by BaseGameScreen.RefreshGrading().

◆ IDSubset

virtual string Zone.IDSubset
get

Definition at line 213 of file Zone.cs.

214 {
215 get
216 {
217 if (!IsFestival)
218 {
219 return null;
220 }
221 return "festival";
222 }
223 }
virtual bool IsFestival
Definition: Zone.cs:211

Referenced by Activate().

◆ InspectName

string Zone.InspectName
get

Implements IInspect.

Definition at line 511 of file Zone.cs.

◆ InspectPoint

Point Zone.InspectPoint
get

Implements IInspect.

Definition at line 513 of file Zone.cs.

◆ InspectPosition

Vector3 Zone.InspectPosition
get

Implements IInspect.

Definition at line 515 of file Zone.cs.

◆ IsActiveZone

◆ IsExplorable

virtual bool Zone.IsExplorable
get

Definition at line 353 of file Zone.cs.

◆ IsFestival

virtual bool Zone.IsFestival
get

◆ IsInstance

◆ IsLoaded

bool Zone.IsLoaded
get

Definition at line 493 of file Zone.cs.

Referenced by Activate().

◆ IsNefia

virtual bool Zone.IsNefia
get

Definition at line 287 of file Zone.cs.

Referenced by TraitNewZone.MoveZone(), AI_Idle.Run(), and Chara.TryDropBossLoot().

◆ IsPCFaction

bool Zone.IsPCFaction
get

Definition at line 475 of file Zone.cs.

Referenced by Chara._Move(), WidgetDate._Refresh(), Map._ValidateInstalled(), Activate(), LayerSleep.Advance(), WidgetStatsBar.Build(), DramaCustomSequence.Build(), Chara.CanDestroyPath(), ActRestrain.CanPerform(), QuestIntoDarkness.CanUpdateOnTalk(), QuestVernis.CanUpdateOnTalk(), TraitGeneratorWheel.CanUse(), TraitLoytelMart.CanUse(), TraitMannequin.CanUse(), TraitShackle.CanUse(), GameLang.ConvertDrama(), Faction.CountWealth(), Card.Create(), ActEffect.DamageEle(), Chara.DoHostileAction(), CoreDebug.Fix_LostCore(), RankedZone.GetFactionName(), TaskBuild.GetHitResult(), TaskDig.GetHitResult(), Card.GetPrice(), Chara.GetRevived(), Chara.HasAccess(), QuestManager.HasFarAwayEscort(), TraitFoodEggFertilized.Incubate(), Quest.IsVisibleOnQuestBoard(), Quest.ListDeliver(), QuestDeliver.ListDestThing(), Props.ListThingStack(), Chara.MoveZone(), Region.OnActivate(), TraitHitchingPost.OnActivateTrap(), QuestRandom.OnDropReward(), Player.Flags.OnEnterZone(), LayerQuestBoard.OnInit(), ElementContainerZone.OnLevelUp(), TraitBlueprint.OnRead(), TraitBookSkill.OnRead(), TraitDeedRelocate.OnRead(), AM_Adv.OnRenderTile(), GoalSleep.OnSimulatePosition(), TraitFloorSwitch.OnStepped(), TraitBookResident.OnUse(), TraitFarmChest.OnUse(), TraitPolicyBoard.OnUse(), ZoneEventWedding.OnVisit(), ActRestrain.Perform(), ActEffect.Proc(), Map.PutAway(), TraitBaseSpellbook.ReadFailEffect(), ContentHomeRanking.Refresh(), TCOrbitChara.RefreshAll(), UIInventory.RefreshMenu(), ContentFaction.RefreshZones(), AI_Eat.Run(), AI_Idle.Run(), WidgetSearch.Search(), Card.SetPlaceState(), UIFactionInfo.SetZone(), TraitTicketFurniture.SetZone(), TraitGeneratorWheel.ShouldWork(), Card.SpawnLoot(), Chara.Tick(), TaskDump.TryPerform(), TraitBed.TrySetAct(), TraitBuildBoard.TrySetAct(), TraitCoreZone.TrySetAct(), TraitCrafter.TrySetAct(), TraitFactionBoard.TrySetAct(), TraitHomeBoard.TrySetAct(), TraitMapBoard.TrySetAct(), TraitPaintBoard.TrySetAct(), TraitResearchBoard.TrySetAct(), TraitResidentBoard.TrySetAct(), TraitSwitch.TrySetAct(), TraitWaystone.TrySetAct(), TraitSalesTag.TrySetHeldAct(), Trait.TrySetToggleAct(), Map.TryShatter(), AI_Shopping.TryShop(), TraitTeleporter.TryTeleport(), Card.TryUnrestrain(), GoalCombat.TryUseAbility(), TraitGeneratorWheel.Update(), GameUpdater.Update100ms(), UpdateQuests(), and Chara.Vomit().

◆ IsPCFactionOrTent

bool Zone.IsPCFactionOrTent
get

◆ IsReturnLocation

virtual bool Zone.IsReturnLocation
get

Definition at line 355 of file Zone.cs.

356 {
357 get
358 {
359 if (EClass.pc.homeZone != this)
360 {
361 return base.source.tag.Contains("return");
362 }
363 return true;
364 }
365 }

◆ IsSkyLevel

◆ IsStartZone

bool Zone.IsStartZone
get

Definition at line 489 of file Zone.cs.

◆ IsTown

◆ IsUnderwater

◆ IsUserZone

◆ KeepAllyDistance

virtual bool Zone.KeepAllyDistance
get

Definition at line 303 of file Zone.cs.

304 {
305 get
306 {
307 if (!HasLaw)
308 {
309 return IsPCFaction;
310 }
311 return true;
312 }
313 }

Referenced by Chara._Move(), and ConfigTactics.AllyDistance().

◆ LockExit

virtual bool Zone.LockExit
get

Definition at line 277 of file Zone.cs.

Referenced by MapGenDungen.OnGenerateTerrain().

◆ MakeEnemiesNeutral

virtual bool Zone.MakeEnemiesNeutral
get

Definition at line 235 of file Zone.cs.

236 {
237 get
238 {
239 if (!IsTown)
240 {
241 return HasLaw;
242 }
243 return true;
244 }
245 }

◆ MakeTownProperties

virtual bool Zone.MakeTownProperties
get

Definition at line 247 of file Zone.cs.

◆ MaxLv

virtual int Zone.MaxLv
get

Definition at line 281 of file Zone.cs.

◆ MaxRespawn

int Zone.MaxRespawn
get

Definition at line 317 of file Zone.cs.

◆ MaxSoil

virtual int Zone.MaxSoil
get

Definition at line 517 of file Zone.cs.

518 {
519 get
520 {
521 if (branch == null)
522 {
523 return 99999;
524 }
525 return branch.MaxSoil;
526 }
527 }

Referenced by WidgetStatsBar.Build(), Map.MineObj(), GrowSystem.PopHarvest(), and GrowSystem.TryPopSeed().

◆ MaxSpawn

virtual int Zone.MaxSpawn
get

Definition at line 315 of file Zone.cs.

◆ MinLv

virtual int Zone.MinLv
get

Definition at line 283 of file Zone.cs.

Referenced by Zone_Void.OnActivate(), and ActEffect.Proc().

◆ MinsSinceLastActive

int Zone.MinsSinceLastActive
get

Definition at line 125 of file Zone.cs.

◆ NameSuffix

override string Zone.NameSuffix
get

Definition at line 419 of file Zone.cs.

420 {
421 get
422 {
423 if (!IsNefia || !GetTopZone().isConquered)
424 {
425 return "";
426 }
427 return "conquered".lang();
428 }
429 }

◆ NameWithLevel

string Zone.NameWithLevel
get

◆ OreChance

virtual float Zone.OreChance
get

Definition at line 321 of file Zone.cs.

◆ ParentZone

◆ pathExport

virtual string Zone.pathExport
get

Definition at line 127 of file Zone.cs.

Referenced by Activate().

◆ pathTemp

string Zone.pathTemp
get

Definition at line 163 of file Zone.cs.

Referenced by PartialMap._Load(), and Activate().

◆ PetFollow

virtual bool Zone.PetFollow
get

Definition at line 289 of file Zone.cs.

Referenced by Chara._Move(), and AI_Idle.Run().

◆ PrespawnRate

virtual float Zone.PrespawnRate
get

Definition at line 329 of file Zone.cs.

◆ RegenerateOnEnter

virtual bool Zone.RegenerateOnEnter
get

Definition at line 267 of file Zone.cs.

Referenced by Activate(), and TraitNewZone.TrySetAct().

◆ Region

◆ RegionEnterState

virtual ZoneTransition.EnterState Zone.RegionEnterState
get

Definition at line 175 of file Zone.cs.

Referenced by Player.EnterLocalZone(), and LayerTravel.Refresh().

◆ RespawnPerHour

virtual int Zone.RespawnPerHour
get

Definition at line 345 of file Zone.cs.

◆ RespawnRate

virtual float Zone.RespawnRate
get

Definition at line 331 of file Zone.cs.

◆ RestrictBuild

virtual bool Zone.RestrictBuild
get

Definition at line 291 of file Zone.cs.

292 {
293 get
294 {
295 if (this is Zone_Civilized)
296 {
297 return !IsPCFaction;
298 }
299 return false;
300 }
301 }

Referenced by HotItemHeld.CanRotate(), TaskBuild.CanRotateBlock(), and TaskBuild.GetHitResult().

◆ RevealRoom

virtual bool Zone.RevealRoom
get

Definition at line 395 of file Zone.cs.

◆ RuinChance

virtual float Zone.RuinChance
get

Definition at line 319 of file Zone.cs.

Referenced by GenBounds.TryAddMapPiece().

◆ ScaleType

virtual ZoneScaleType Zone.ScaleType
get

Definition at line 413 of file Zone.cs.

◆ SetAlarmOnBreakLaw

virtual bool Zone.SetAlarmOnBreakLaw
get

Definition at line 233 of file Zone.cs.

Referenced by Point.CallGuard(), and GoalCombat.Run().

◆ ShouldAutoRevive

virtual bool Zone.ShouldAutoRevive
get

Definition at line 381 of file Zone.cs.

382 {
383 get
384 {
385 if (!ShouldRegenerate)
386 {
387 return IsPCFaction;
388 }
389 return true;
390 }
391 }

◆ ShouldMakeExit

virtual bool Zone.ShouldMakeExit
get

Definition at line 367 of file Zone.cs.

368 {
369 get
370 {
371 if (base.lv > MinLv)
372 {
373 return base.lv < MaxLv;
374 }
375 return false;
376 }
377 }
virtual int MaxLv
Definition: Zone.cs:281
virtual int MinLv
Definition: Zone.cs:283

Referenced by MapGenDungen.OnGenerateTerrain().

◆ ShouldRegenerate

virtual bool Zone.ShouldRegenerate
get

Definition at line 379 of file Zone.cs.

Referenced by Activate().

◆ ShowEnemyOnMinimap

bool Zone.ShowEnemyOnMinimap
get

Definition at line 333 of file Zone.cs.

334 {
335 get
336 {
337 if (instance != null)
338 {
340 }
341 return false;
342 }
343 }
virtual bool ShowEnemyOnMinimap
Definition: ZoneInstance.cs:30

Referenced by WidgetMinimap.RefreshMarkers().

◆ ShrineChance

virtual float Zone.ShrineChance
get

Definition at line 327 of file Zone.cs.

◆ SightRadiusBonus

virtual int Zone.SightRadiusBonus
get

Definition at line 133 of file Zone.cs.

Referenced by Card.CalculateFOV(), and Card.GetSightRadius().

◆ StartLV

virtual int Zone.StartLV
get

Definition at line 411 of file Zone.cs.

Referenced by OnCreate().

◆ TextDangerLv

string Zone.TextDangerLv
get

Definition at line 433 of file Zone.cs.

Referenced by WidgetDate._Refresh().

◆ TextDeepestLv

string Zone.TextDeepestLv
get

Definition at line 435 of file Zone.cs.

436 {
437 get
438 {
439 if (GetDeepestLv() != 0)
440 {
441 return "zoneLevelMax".lang(TextLevel(GetDeepestLv()));
442 }
443 return "";
444 }
445 }
string TextLevel(int _lv)
Definition: Zone.cs:559

Referenced by AM_Adv._OnUpdateInput().

◆ TextWidgetDate

virtual string Zone.TextWidgetDate
get

Definition at line 137 of file Zone.cs.

Referenced by WidgetDate._Refresh().

◆ UseFog

virtual bool Zone.UseFog
get

Definition at line 393 of file Zone.cs.

Referenced by Activate(), BaseTileMap.DrawTile(), and Fov.Perform().

◆ UseLight

virtual bool Zone.UseLight
get

Definition at line 399 of file Zone.cs.

400 {
401 get
402 {
403 if (base.mainFaction != EClass.pc.faction)
404 {
405 return base.source.tag.Contains("light");
406 }
407 return true;
408 }
409 }

Referenced by EloMap.Init(), and EloMap.SetZone().

◆ WillAutoSave

virtual bool Zone.WillAutoSave
get

Definition at line 265 of file Zone.cs.

Referenced by Chara.MoveZone().


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