1using System.Collections.Generic;
11 public int[]
ints =
new int[30];
14 public string[]
strs =
new string[20];
17 public Dictionary<int, object>
obj;
20 public Dictionary<int, string>
cstr;
458 public List<Data>
cards =
new List<Data>();
482 fx = (
int)(c.fx * 1000f),
483 fy = (
int)(c.fy * 1000f),
492 isEmpty = (c.things.Count == 0 && c.c_lockLv == 0),
503 if (row !=
null && row.
isStatic != 0)
512 data.idDyeMat = (c.isDyed ? c.c_dyeMat : (-1));
530 if (
item.uidEditor >= num)
532 num = item.uidEditor + 1;
535 c.Chara.uidEditor = num;
544 void TryAddStr(
int key)
546 string str = c.
GetStr(key);
549 if (data.
cstr ==
null)
551 data.cstr =
new Dictionary<int, string>();
553 data.
cstr[key] = str;
560 List<Thing> things = map.
things;
563 Dictionary<int, int> dictionary =
new Dictionary<int, int>();
564 Dictionary<int, int> dictionary2 =
new Dictionary<int, int>();
570 int index = point.
index;
573 if (partial.result.ruined.Contains(point.
index))
578 int num2 = point.x - partial.offsetX;
579 int num3 = point.z - partial.offsetZ;
601 point.x = num2 + partial.destX;
602 point.z = num3 + partial.destZ;
603 if (!partial.validPoints.Contains(point.
index) || !point.
IsValid)
607 if (!partial.editMode)
610 string id = card4.
id;
611 if (!(
id ==
"sign_spawnThing"))
613 if (
id ==
"sign_spawnChara")
626 if (
card.trait.IsDoor)
635 string text = card4.
id;
638 text = card4.
idV.ToString() ??
"";
640 if (addToZone && partial !=
null && !partial.editMode)
642 string id = card4.
id;
643 if (!(
id ==
"editor_torch"))
645 if (
id ==
"editor_torch_wall")
670 if (value2.
id == text)
679 foreach (
Chara item in orgMap.charas.Concat(orgMap.serializedCharas).Concat(orgMap.deadCharas))
686 if (
item.id == text &&
item.orgPos !=
null &&
item.orgPos.Equals(point))
698 if (isUserZone &&
ClassExtension.TryGetValue<
int,
int>((IDictionary<int, int>)dictionary, index, 0) >= 3)
703 if (card4.
ints.Length > 20)
714 card2.Chara.orgPos = point.
Copy();
718 card2.Chara.isDead =
true;
723 serializedCharas.Add(card2.
Chara);
727 dictionary[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary, index, 0) + 1;
733 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"))
748 card2.placeState = placeState;
752 dictionary2[index] =
ClassExtension.TryGetValue<int,
int>((IDictionary<int, int>)dictionary2, index, 0) + 1;
763 card2.isPlayerCreation =
true;
764 card2.autoRefuel =
true;
765 card2.c_editorTraitVal = card4.
traitVals;
767 card2.isImported =
true;
768 card2.refVal = card4.
refVal;
769 card2.idSkin = card4.
idSkin;
770 card2.c_idDeity = card4.
idDeity;
771 card2.c_refText = card4.
cText;
772 card2.c_note = card4.
cNote;
782 card2.mapObj = card4.
obj;
783 if (card2.
mapObj?.TryGetValue(2) !=
null)
787 if (card4.
cstr !=
null)
789 foreach (KeyValuePair<int, string> item2
in card4.
cstr)
791 card2.
SetStr(item2.Key, item2.Value);
796 card2.fx = (float)card4.
fx * 0.001f;
797 card2.
fy = (
float)card4.fy * 0.001f;
805 card2.c_idTrait = card4.
idTrait;
809 if (!card4.
tags.IsEmpty())
811 card2.c_editorTags = card4.
tags;
814 string[] array = card4.
tags.Split(
',');
815 foreach (
string value
in array)
822 Debug.LogWarning(
"Could not convert editor tag:" + card2.
Name +
"/" + card4.
tags);
830 bool isHidden = (card2.isMasked =
false);
831 card3.isHidden = isHidden;
845 if (card4.
ints.Length > 20 && card4.
encLv != 0)
849 if (card4.
strs.Length > 10)
889 partial.result.hasLight =
true;
902 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)