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;
422 public List<Data>
cards =
new List<Data>();
446 fx = (
int)(c.fx * 1000f),
447 fy = (
int)(c.fy * 1000f),
456 isEmpty = (c.things.Count == 0 && c.c_lockLv == 0),
464 if (row !=
null && row.
isStatic != 0)
473 data.idDyeMat = (c.isDyed ? c.c_dyeMat : (-1));
491 if (
item.uidEditor >= num)
493 num = item.uidEditor + 1;
496 c.Chara.uidEditor = num;
505 void TryAddStr(
int key)
507 string str = c.
GetStr(key);
510 if (data.
cstr ==
null)
512 data.cstr =
new Dictionary<int, string>();
514 data.
cstr[key] = str;
521 List<Thing> things = map.
things;
524 Dictionary<int, int> dictionary =
new Dictionary<int, int>();
525 Dictionary<int, int> dictionary2 =
new Dictionary<int, int>();
531 int index = point.
index;
534 if (partial.result.ruined.Contains(point.
index))
539 int num2 = point.x - partial.offsetX;
540 int num3 = point.z - partial.offsetZ;
562 point.x = num2 + partial.destX;
563 point.z = num3 + partial.destZ;
564 if (!partial.validPoints.Contains(point.
index) || !point.
IsValid)
568 if (!partial.editMode)
571 string id = card4.
id;
572 if (!(
id ==
"sign_spawnThing"))
574 if (
id ==
"sign_spawnChara")
587 if (
card.trait.IsDoor)
596 string text = card4.
id;
599 text = card4.
idV.ToString() ??
"";
601 if (addToZone && partial !=
null && !partial.editMode)
603 string id = card4.
id;
604 if (!(
id ==
"editor_torch"))
606 if (
id ==
"editor_torch_wall")
631 if (value2.
id == text)
640 foreach (
Chara item in orgMap.charas.Concat(orgMap.serializedCharas).Concat(orgMap.deadCharas))
647 if (
item.id == text &&
item.orgPos !=
null &&
item.orgPos.Equals(point))
659 if (isUserZone &&
ClassExtension.TryGetValue<
int,
int>((IDictionary<int, int>)dictionary, index, 0) >= 3)
664 if (card4.
ints.Length > 20)
675 card2.Chara.orgPos = point.
Copy();
679 card2.Chara.isDead =
true;
684 serializedCharas.Add(card2.
Chara);
688 dictionary[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary, index, 0) + 1;
694 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"))
709 card2.placeState = placeState;
713 dictionary2[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary2, index, 0) + 1;
724 card2.isPlayerCreation =
true;
725 card2.autoRefuel =
true;
726 card2.c_editorTraitVal = card4.
traitVals;
728 card2.isImported =
true;
729 card2.refVal = card4.
refVal;
730 card2.idSkin = card4.
idSkin;
731 card2.c_idDeity = card4.
idDeity;
732 card2.c_refText = card4.
cText;
733 card2.c_note = card4.
cNote;
743 card2.mapObj = card4.
obj;
744 if (card2.
mapObj?.TryGetValue(2) !=
null)
748 if (card4.
cstr !=
null)
750 foreach (KeyValuePair<int, string> item2
in card4.
cstr)
752 card2.
SetStr(item2.Key, item2.Value);
757 card2.fx = (float)card4.
fx * 0.001f;
758 card2.
fy = (
float)card4.fy * 0.001f;
766 card2.c_idTrait = card4.
idTrait;
770 if (!card4.
tags.IsEmpty())
772 card2.c_editorTags = card4.
tags;
775 string[] array = card4.
tags.Split(
',');
776 foreach (
string value
in array)
783 Debug.LogWarning(
"Could not convert editor tag:" + card2.
Name +
"/" + card4.
tags);
791 bool isHidden = (card2.isMasked =
false);
792 card3.isHidden = isHidden;
806 if (card4.
ints.Length > 20 && card4.
encLv != 0)
838 partial.result.hasLight =
true;
851 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)