1using System.Collections.Generic;
11 public int[]
ints =
new int[30];
14 public string[]
strs =
new string[10];
17 public Dictionary<int, object>
obj;
20 public Dictionary<int, string>
cstr;
398 public List<Data>
cards =
new List<Data>();
422 fx = (
int)(c.fx * 1000f),
423 fy = (
int)(c.fy * 1000f),
432 isEmpty = (c.things.Count == 0 && c.c_lockLv == 0),
438 if (row !=
null && row.
isStatic != 0)
447 data.idDyeMat = (c.isDyed ? c.c_dyeMat : (-1));
465 if (
item.uidEditor >= num)
467 num = item.uidEditor + 1;
470 c.Chara.uidEditor = num;
479 void TryAddStr(
int key)
481 string str = c.
GetStr(key);
484 if (data.
cstr ==
null)
486 data.cstr =
new Dictionary<int, string>();
488 data.
cstr[key] = str;
495 List<Thing> things = map.
things;
498 Dictionary<int, int> dictionary =
new Dictionary<int, int>();
499 Dictionary<int, int> dictionary2 =
new Dictionary<int, int>();
505 int index = point.
index;
508 if (partial.result.ruined.Contains(point.
index))
513 int num2 = point.x - partial.offsetX;
514 int num3 = point.z - partial.offsetZ;
536 point.x = num2 + partial.destX;
537 point.z = num3 + partial.destZ;
538 if (!partial.validPoints.Contains(point.
index) || !point.
IsValid)
542 if (!partial.editMode)
545 string id = card4.
id;
546 if (!(
id ==
"sign_spawnThing"))
548 if (
id ==
"sign_spawnChara")
561 if (
card.trait.IsDoor)
570 string text = card4.
id;
573 text = card4.
idV.ToString() ??
"";
575 if (addToZone && partial !=
null && !partial.editMode)
577 string id = card4.
id;
578 if (!(
id ==
"editor_torch"))
580 if (
id ==
"editor_torch_wall")
605 if (value2.
id == text)
614 foreach (
Chara item in orgMap.charas.Concat(orgMap.serializedCharas).Concat(orgMap.deadCharas))
621 if (
item.id == text &&
item.orgPos !=
null &&
item.orgPos.Equals(point))
633 if (isUserZone &&
ClassExtension.TryGetValue<
int,
int>((IDictionary<int, int>)dictionary, index, 0) >= 3)
638 if (card4.
ints.Length > 20)
646 card2.Chara.orgPos = point.
Copy();
650 card2.Chara.isDead =
true;
655 serializedCharas.Add(card2.
Chara);
659 dictionary[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary, index, 0) + 1;
665 if (isUserZone && ((
ClassExtension.TryGetValue<
int,
int>((IDictionary<int, int>)dictionary2, index, 0) >= 20 && text !=
"waystone" && text !=
"core_zone") || (placeState !=
PlaceState.installed && !card4.
bits1.IsOn(13)) || text ==
"medal"))
680 card2.placeState = placeState;
684 dictionary2[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary2, index, 0) + 1;
695 card2.isPlayerCreation =
true;
696 card2.autoRefuel =
true;
697 card2.c_editorTraitVal = card4.
traitVals;
699 card2.isImported =
true;
700 card2.refVal = card4.
refVal;
701 card2.idSkin = card4.
idSkin;
702 card2.c_idDeity = card4.
idDeity;
712 card2.mapObj = card4.
obj;
713 if (card2.
mapObj?.TryGetValue(2) !=
null)
717 if (card4.
cstr !=
null)
719 foreach (KeyValuePair<int, string> item2
in card4.
cstr)
721 card2.
SetStr(item2.Key, item2.Value);
726 card2.fx = (float)card4.
fx * 0.001f;
727 card2.
fy = (
float)card4.fy * 0.001f;
735 card2.c_idTrait = card4.
idTrait;
739 if (!card4.
tags.IsEmpty())
741 card2.c_editorTags = card4.
tags;
744 string[] array = card4.
tags.Split(
',');
745 foreach (
string value
in array)
752 Debug.LogWarning(
"Could not convert editor tag:" + card2.
Name +
"/" + card4.
tags);
760 bool isHidden = (card2.isMasked =
false);
761 card3.isHidden = isHidden;
775 if (card4.
encLv != 0)
807 partial.result.hasLight =
true;
820 importedCard.c_uidRefCard = importedCard2.
uid;
void SetStr(int id, string value=null)
void SetObj(int id, object o)
string GetStr(int id, string defaultStr=null)
Dictionary< int, object > mapObj
string GetRandomThingId()
string GetRandomCharaId()
string GetIdLight(bool wall)
GlobalCharaList globalCharas
override string idRenderData
SourceMaterial.Row material
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
virtual SourceMaterial.Row DefaultMaterial
virtual CardRenderer _CreateRenderer()
virtual void ApplyEditorTags(EditorTag tag)
void ApplyBacker(int bid)
virtual CardRow sourceCard
Thing Add(string id, int num=1, int lv=1)
static Chara CreateFromFilter(string id, int lv=-1, int levelRange=-1)
static Chara Create(string id, int lv=-1)
void SetMainElement(string id, int v=0, bool elemental=false)
static SourceManager sources
List< Chara > serializedCharas
void OnSetBlockOrDoor(int x, int z)
bool Equals(int _x, int _z)
Dictionary< int, object > obj
Dictionary< int, string > cstr
List< Card > importedCards
void Restore(Map map, Map orgMap, bool addToZone, PartialMap partial=null)
Dictionary< string, CardRow > map
static SpawnList Get(string id, Func< SourceThing.Row, bool > func)
void DestroyAll(Func< Thing, bool > funcExclude=null)
static Thing CreateFromFilter(string id, int lv=-1)
static Thing Create(string id, int idMat=-1, int lv=-1)
virtual void OnImportMap()
virtual void OnCreate(int lv)
virtual bool ShouldScaleImportedChara(Chara c)
Card AddCard(Card t, Point point)