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]))
200 if (!c.category.GetRoot().tag.Contains(
"dye") && !c.category.tag.Contains(
"dye"))
205 if (!c.IsUnique && !c.IsImportant && !c.trait.CanOnlyCarry)
210 if (c.id == text || c.sourceCard._origin == text)
226 string[] ing = r.ing1;
227 for (
int i = 0; i < ing.Length; i++)
257 for (
int i = 0; i <
numIng; i++)
286 if ((uint)(
id - 47) <= 1u)
312 string thing3 = source.
thing;
314 int num = source.
num.Calc();
316 string[] array = thing3.
Split(
'%');
335 if (source.
tag.Contains(
"rust"))
338 ai.
ings[1].ModEncLv(1);
339 ai.
ings[0].ModNum(-1);
341 if (source.
tag.Contains(
"mod_eject"))
343 ai.
ings[1].EjectSockets();
344 ai.
ings[0].ModNum(-1);
354 t.c_idRefCard = cardRow.
id;
379 item.vLink = item.vBase +
item.vSource;
381 item.vBase = runeEnc.
value;
396 thing8.refVal = a.
id;
397 thing8.encLV = a.vBase + a.
vSource;
403 string lang = a.vBase + a.vSource + ((a.vLink != 0) ? (
" (" + a.
vLink +
")") :
"");
408 b.button1.interactable =
false;
409 b.
button1.
mainText.gameObject.AddComponent<CanvasGroup>().alpha = 0.5f;
415 .SetTitles(
"wRuneMold");
421 string id = thing.
id;
422 if (
id ==
"mercury" ||
id ==
"blood_angel")
424 int num7 = thing2.
encLV;
425 if (thing.
id ==
"mercury")
447 int num3 = thing5.c_charges * source2.charge * (100 + num2 * 50) / 500 + 1;
450 thing6.refVal = source2.
id;
451 thing6.encLV = num4 * (100 + num2 * 10) / 100;
452 thing.ammoData = thing6;
460 Prize(20,
"medal",
"save", cat:
false);
461 Prize(10,
"plat",
"save", cat:
false);
462 Prize(10,
"furniture",
"nice", cat:
true);
463 Prize(4,
"plamo_box",
"nice", cat:
false);
464 Prize(4,
"food",
"", cat:
false);
465 Prize(1,
"casino_coin",
"", cat:
false);
474 for (
int num6 = 3; num6 > 0; num6--)
485 owner.
PlaySound((num5 == 3) ?
"fortuneroll_winBig" :
"fortuneroll_win");
503 if (thing3 ==
"gene")
505 if (ai.
ings[0].c_DNA !=
null)
508 t.c_DNA = ai.
ings[0].c_DNA;
537 string text = a.
Name;
538 string encSlot = a.
source.encSlot;
539 if ((encSlot ==
null || encSlot.Length != 0) && !(encSlot ==
"global") && !(encSlot ==
"all"))
542 string[] array2 = a.
source.encSlot.Split(
',');
543 foreach (
string text2
in array2)
545 text += ((text2 ==
"weapon") ?
"weapon_enc".lang() :
EClass.
sources.
elements.alias[text2].GetName().ToTitleCase());
548 text = text.TrimEnd(
", ".ToCharArray()) +
"]";
552 void Prize(
int chance,
string s,
string col,
bool cat)
579 EClass.ui.AddLayer<LayerCraft>().SetFactory(_t);
583 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)