1using System.Collections.Generic;
101 if (r.factory !=
IdSource || c ==
null)
117 string[] array = ((idx == 0) ? r.ing1 : r.ing2);
118 switch (r.type.ToEnum<
MixType>())
126 if (r.tag.Contains(
"rust") && c.encLV >= 0)
130 if (!r.tag.Contains(
"mod_eject"))
139 foreach (
int socket
in c.
sockets)
153 if (idx == 1 && c.
id ==
"seed" && c.
encLV == 0)
159 string[] array2 = array;
160 foreach (
string text
in array2)
162 if (r.tag.Contains(
"noCarbone") && c.material.alias ==
"carbone")
166 if (text.StartsWith(
'#'))
168 string text2 = text.Replace(
"#",
"");
169 if (c.category.IsChildOf(text2) &&
IsIngredient(text2, c))
175 string[] array3 = text.Split(
'@');
176 if (array3.Length > 1)
178 if (c.id != array3[0] && c.sourceCard._origin != array3[0])
186 if (c.material.tag.Contains(array3[1]))
194 if (
this is
TraitDyeMaker && !c.category.GetRoot().tag.
Contains(
"dye") && !c.category.tag.Contains(
"dye"))
198 if (!c.IsUnique && !c.IsImportant && !c.trait.CanOnlyCarry)
203 if (c.id == text || c.sourceCard._origin == text)
219 string[] ing = r.ing1;
220 for (
int i = 0; i < ing.Length; i++)
250 for (
int i = 0; i <
numIng; i++)
279 if ((uint)(
id - 47) <= 1u)
305 string thing3 = source.
thing;
307 int num = source.
num.Calc();
309 string[] array = thing3.
Split(
'%');
328 if (source.
tag.Contains(
"rust"))
331 ai.
ings[1].ModEncLv(1);
332 ai.
ings[0].ModNum(-1);
334 if (source.
tag.Contains(
"mod_eject"))
336 ai.
ings[1].EjectSockets();
337 ai.
ings[0].ModNum(-1);
347 t.c_idRefCard = cardRow.
id;
372 item.vLink = item.vBase +
item.vSource;
374 item.vBase = runeEnc.
value;
389 thing8.refVal = a.
id;
390 thing8.encLV = a.vBase + a.
vSource;
396 string lang = a.vBase + a.vSource + ((a.vLink != 0) ? (
" (" + a.
vLink +
")") :
"");
401 b.button1.interactable =
false;
402 b.
button1.
mainText.gameObject.AddComponent<CanvasGroup>().alpha = 0.5f;
408 .SetTitles(
"wRuneMold");
414 string id = thing.
id;
415 if (
id ==
"mercury" ||
id ==
"blood_angel")
417 int num7 = thing2.
encLV;
418 if (thing.
id ==
"mercury")
440 int num3 = thing5.c_charges * source2.charge * (100 + num2 * 50) / 500 + 1;
443 thing6.refVal = source2.
id;
444 thing6.encLV = num4 * (100 + num2 * 10) / 100;
445 thing.ammoData = thing6;
453 Prize(20,
"medal",
"save", cat:
false);
454 Prize(10,
"plat",
"save", cat:
false);
455 Prize(10,
"furniture",
"nice", cat:
true);
456 Prize(4,
"plamo_box",
"nice", cat:
false);
457 Prize(4,
"food",
"", cat:
false);
458 Prize(1,
"casino_coin",
"", cat:
false);
467 for (
int num6 = 3; num6 > 0; num6--)
478 owner.
PlaySound((num5 == 3) ?
"fortuneroll_winBig" :
"fortuneroll_win");
496 if (thing3 ==
"gene")
498 if (ai.
ings[0].c_DNA !=
null)
501 t.c_DNA = ai.
ings[0].c_DNA;
530 string text = a.
Name;
531 string encSlot = a.
source.encSlot;
532 if ((encSlot ==
null || encSlot.Length != 0) && !(encSlot ==
"global") && !(encSlot ==
"all"))
535 string[] array2 = a.
source.encSlot.Split(
',');
536 foreach (
string text2
in array2)
538 text += ((text2 ==
"weapon") ?
"weapon_enc".lang() :
EClass.
sources.
elements.alias[text2].GetName().ToTitleCase());
541 text = text.TrimEnd(
", ".ToCharArray()) +
"]";
545 void Prize(
int chance,
string s,
string col,
bool cat)
572 EClass.ui.AddLayer<LayerCraft>().SetFactory(_t);
576 Msg.Say(
"noRecipes");
bool TrySetAct(string lang, Func< bool > onPerform, Card tc, CursorInfo cursor=null, int dist=1, bool isHostileAct=false, bool localAct=true, bool canRepeat=false)
ElementContainerCard elements
SourceMaterial.Row material
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Card ChangeMaterial(int idNew, bool ignoreFixedMaterial=false)
Card MakeRefFrom(string id)
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
void ModNum(int a, bool notify=true)
bool HasElement(int ele, bool includeNagative=false)
void Say(string lang, string ref1=null, string ref2=null)
Thing Pick(Thing t, bool msg=true, bool tryStack=true)
List< CardRow > ListKills()
static Thing MixIngredients(string idProduct, List< Thing > ings, MixType type, int idMat=0, Chara crafter=null)
void GenerateWithGene(Type _type, Card gene, Chara model=null)
static int curve(long _a, int start, int step, int rate=75)
static SourceManager sources
List< Element > ListRune()
Element SetBase(string alias, int v, int potential=0)
void GetPrize(int grade, int seed)
UIButton SetSubText(string lang, int x, FontColor c=FontColor.Default, TextAnchor align=TextAnchor.MiddleLeft)
List< ButtonGrid > buttons
static LayerDragGrid Instance
static LayerDragGrid CreateCraft(TraitCrafter crafter)
Layer SetOnKill(Action action)
static string SayCannotUseHere()
static string SayNothingHappen()
static string Say(string idLang, string ref1, string ref2=null, string ref3=null, string ref4=null)
HashSet< int > knownCraft
static void SetSeed(int a=-1)
List< RecipeSource > ListSources(Thing factory, List< RecipeSource > newRecipes=null)
Dictionary< string, CardRow > map
static SpawnList Get(string id, Func< SourceThing.Row, bool > func)
static Thing CreateFromCategory(string idCat, int lv=-1)
static Thing Create(string id, int idMat=-1, int lv=-1)
virtual bool IsConsumeIng
virtual string IDReqEle(RecipeSource r)
virtual bool StopSoundProgress
virtual int WitchDoubleCraftChance(Thing t)
virtual bool CloseOnComplete
virtual string idSoundProgress
virtual string CrafterTitle
virtual bool IsIngredient(string cat, Card c)
virtual bool ShouldConsumeIng(SourceRecipe.Row item, int index)
SourceRecipe.Row GetSource(AI_UseCrafter ai)
virtual AnimeType animeType
override bool OnUse(Chara c)
override bool CanUse(Chara c)
override bool ShowFuelWindow
bool IsIngredient(int idx, SourceRecipe.Row r, Card c)
virtual void OnEndAI(AI_UseCrafter ai)
int GetSortVal(SourceRecipe.Row r)
override void TrySetAct(ActPlan p)
virtual bool CanUseFromInventory
virtual int GetCostSp(AI_UseCrafter ai)
virtual AnimeID IdAnimeProgress
virtual bool IsCraftIngredient(Card c, int idx)
virtual int GetDuration(AI_UseCrafter ai, int costSp)
virtual string idSoundComplete
override bool IsNightOnlyLight
virtual Thing Craft(AI_UseCrafter ai)
override bool HoldAsDefaultInteraction
virtual bool CanTriggerFire
static Chara Incubate(Thing egg, Point pos, Card incubator=null)
static Thing MakeSeed(string idSource)
static void LevelSeed(Thing t, SourceObj.Row obj, int num)
virtual bool Contains(RecipeSource r)
string GetParam(int i, string def=null)
FortuneRollData GetOrCreateFortuneRollData(bool refresh=true)
Card AddCard(Card t, Point point)