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;
386 public List<Data>
cards =
new List<Data>();
410 fx = (
int)(c.fx * 1000f),
411 fy = (
int)(c.fy * 1000f),
420 isEmpty = (c.things.Count == 0)
425 if (row !=
null && row.
isStatic != 0)
434 data.idDyeMat = (c.isDyed ? c.c_dyeMat : (-1));
452 if (
item.uidEditor >= num)
454 num = item.uidEditor + 1;
457 c.Chara.uidEditor = num;
466 void TryAddStr(
int key)
468 string str = c.
GetStr(key);
471 if (data.
cstr ==
null)
473 data.cstr =
new Dictionary<int, string>();
475 data.
cstr[key] = str;
482 List<Thing> things = map.
things;
485 Dictionary<int, int> dictionary =
new Dictionary<int, int>();
486 Dictionary<int, int> dictionary2 =
new Dictionary<int, int>();
492 int index = point.
index;
495 if (partial.result.ruined.Contains(point.
index))
500 int num2 = point.x - partial.offsetX;
501 int num3 = point.z - partial.offsetZ;
523 point.x = num2 + partial.destX;
524 point.z = num3 + partial.destZ;
525 if (!partial.validPoints.Contains(point.
index) || !point.
IsValid)
529 if (!partial.editMode)
532 string id = card4.
id;
533 if (!(
id ==
"sign_spawnThing"))
535 if (
id ==
"sign_spawnChara")
548 if (
card.trait.IsDoor)
557 string text = card4.
id;
560 text = card4.
idV.ToString() ??
"";
562 if (addToZone && partial !=
null && !partial.editMode)
564 string id = card4.
id;
565 if (!(
id ==
"editor_torch"))
567 if (
id ==
"editor_torch_wall")
592 if (value2.
id == text)
601 foreach (
Chara item in orgMap.charas.Concat(orgMap.serializedCharas).Concat(orgMap.deadCharas))
608 if (
item.id == text &&
item.orgPos !=
null &&
item.orgPos.Equals(point))
620 if (isUserZone &&
ClassExtension.TryGetValue<
int,
int>((IDictionary<int, int>)dictionary, index, 0) >= 3)
625 if (card4.
ints.Length > 20)
633 card2.Chara.orgPos = point.
Copy();
637 card2.Chara.isDead =
true;
642 serializedCharas.Add(card2.
Chara);
646 dictionary[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary, index, 0) + 1;
652 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"))
667 card2.placeState = placeState;
671 dictionary2[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary2, index, 0) + 1;
682 card2.isPlayerCreation =
true;
683 card2.autoRefuel =
true;
684 card2.c_editorTraitVal = card4.
traitVals;
686 card2.isImported =
true;
687 card2.refVal = card4.
refVal;
688 card2.idSkin = card4.
idSkin;
689 card2.c_idDeity = card4.
idDeity;
699 card2.mapObj = card4.
obj;
700 if (card2.
mapObj?.TryGetValue(2) !=
null)
704 if (card4.
cstr !=
null)
706 foreach (KeyValuePair<int, string> item2
in card4.
cstr)
708 card2.
SetStr(item2.Key, item2.Value);
713 card2.fx = (float)card4.
fx * 0.001f;
714 card2.
fy = (
float)card4.fy * 0.001f;
722 card2.c_idTrait = card4.
idTrait;
726 if (!card4.
tags.IsEmpty())
728 card2.c_editorTags = card4.
tags;
731 string[] array = card4.
tags.Split(
',');
732 foreach (
string value
in array)
739 Debug.LogWarning(
"Could not convert editor tag:" + card2.
Name +
"/" + card4.
tags);
747 bool isHidden = (card2.isMasked =
false);
748 card3.isHidden = isHidden;
774 partial.result.hasLight =
true;
787 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 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)
Card AddCard(Card t, Point point)