2using System.Collections.Generic;
9 public class Row : BaseRow
87 public static string[]
IDPick =
new string[5] {
"rock",
"ore",
"gem",
"crystal",
"bone" };
89 public static string[]
IDAxe =
new string[1] {
"wood" };
110 base.OnImportData(data);
117 HashSet<string> hashSet =
new HashSet<string>(
tag) {
alias };
118 if (matColors ==
null)
121 foreach (
string item in hashSet)
123 if (
item.StartsWith(
"addColorMain") ||
item.StartsWith(
"addCol_Main"))
125 matColors.main =
item.ExtractInBetween(
'(',
')').ToColor();
127 else if (
item.StartsWith(
"addColorAlt") ||
item.StartsWith(
"addCol_Alt"))
129 matColors.alt =
item.ExtractInBetween(
'(',
')').ToColor();
133 Debug.Log(
$"#mod-content adding new material '{alias}'/{id}, main '{matColors.main}', alt '{matColors.alt}'");
137 tag = hashSet.ToArray();
168 for (
int i = 0; i < a; i++)
190 return soundImpact +
"_" + suffx;
209 return "build_progress";
216 if (c !=
null && !c.idSound.IsEmpty())
218 return "Material/" + c.idSound;
273 string[] array =
goods;
274 foreach (
string text
in array)
283 container.AddThing(thing2);
295 for (
int i = 0; i < 8; i++)
306 public List<Row>
list =
new List<Row>();
320 return list.RandomItem();
324 public static readonly IReadOnlyDictionary<string, int>
RowMapping =
new Dictionary<string, int>
362 public static readonly IReadOnlyDictionary<string, string>
TypeMapping =
new Dictionary<string, string>
365 [
"alias"] =
"string",
366 [
"name_JP"] =
"string",
368 [
"category"] =
"string",
369 [
"tag"] =
"string[]",
370 [
"thing"] =
"string",
371 [
"goods"] =
"string[]",
372 [
"minerals"] =
"string[]",
376 [
"defFloor"] =
"int",
377 [
"defBlock"] =
"int",
380 [
"idSound"] =
"string",
381 [
"soundFoot"] =
"string",
382 [
"hardness"] =
"int",
383 [
"groups"] =
"string[]",
394 [
"bits"] =
"string[]",
395 [
"elements"] =
"elements",
396 [
"altName"] =
"string[]",
397 [
"altName_JP"] =
"string[]"
400 public static Dictionary<string, TierList>
tierMap =
new Dictionary<string, TierList>();
507 foreach (
Row row
in rows)
511 if (!row.
groups.IsEmpty())
513 string[] groups = row.
groups;
514 foreach (
string key
in groups)
517 if (tierList ==
null)
528 if (!(category ==
"gem"))
530 if (category ==
"ore")
553 List<int> list =
new List<int>(r.
elements);
554 for (
int i = 0; i < r.
elements.Length; i += 2)
559 r.elements = list.ToArray();
560 void Add(
int ele,
int a)
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Thing AddThing(string id, int lv=-1)
void ModNum(int a, bool notify=true)
UD_String_MatData matColors
static int[] ParseElements(string str)
static SoundManager Sound
static Effect Get(Effect original)
void Play(float delay, Point from, float fixY=0f, Point to=null, Sprite sprite=null)
static Dictionary< int, int > GetElementMap(int[] list)
static SourceMaterial.Row sourceSnow
void AddDecal(int x, int z, int id, int amount=1, bool refresh=true)
static string[] GetStringArray(int id)
static string GetString(int id)
static int GetInt(int id)
static string GetStr(int id, bool useDefault=false)
string TryGetSound(string suffx, RenderRow c=null)
void CreateByProduct(Thing container, int num)
string GetSoundImpact(RenderRow c=null)
string GetSoundCraft(RenderRow c=null)
void AddBlood(Point p, int a=1)
override void OnImportData(SourceData data)
string GetSoundDead(RenderRow c=null)
string GetSoundDrop(RenderRow c=null)
Dictionary< int, int > elementMap
void PlayHitEffect(Point p, int emit=2)
override Row CreateRowByMapping(IReadOnlyDictionary< string, int > mapping)
static Dictionary< string, TierList > tierMap
static readonly IReadOnlyDictionary< string, int > RowMapping
override void SetRow(Row r)
override IReadOnlyDictionary< string, string > GetTypeMapping()
static readonly IReadOnlyDictionary< string, string > TypeMapping
override void OnAfterImportData()
override string[] ImportFields
override IReadOnlyDictionary< string, int > GetRowMapping()
static Thing CreateRawMaterial(SourceMaterial.Row m)
static Thing Create(string id, int idMat=-1, int lv=-1)
bool TryGetValue(TKey key, out TValue value)