11 public override bool ShowFuelWindow
21 public virtual Emo Icon
31 public virtual int numIng
41 public virtual string IdSource
51 public virtual TraitCrafter.AnimeType animeType
61 public virtual AnimeID IdAnimeProgress
65 return AnimeID.HitObj;
71 public virtual string idSoundProgress
81 public virtual string idSoundComplete
91 public virtual bool StopSoundProgress
101 public override bool IsNightOnlyLight
111 public virtual bool CanUseFromInventory
121 public virtual string idSoundBG
131 public virtual string CrafterTitle
141 public virtual bool AutoTurnOff
151 public virtual bool IsConsumeIng
161 public virtual bool CloseOnComplete
171 public virtual int CostSP
182 return base.GetParam(1,
null) ??
"handicraft";
186 public virtual bool IsCraftIngredient(
Card c,
int idx)
193 if (!this.IsIngredient(0, r, card) || (card == c && card.Num < 2))
198 if (this.IsIngredient(idx, r, c))
209 if (r.factory !=
this.IdSource || c ==
null)
213 if (c.c_isImportant &&
this.ShouldConsumeIng(r, idx))
217 string[] array = (idx == 0) ? r.ing1 : r.ing2;
218 if (r.type.ToEnum(
true) ==
TraitCrafter.MixType.Grind && idx == 1)
220 if (r.tag.Contains(
"rust") && c.encLV >= 0)
224 if (r.tag.Contains(
"mod_eject"))
226 if (c.sockets ==
null)
231 using (List<int>.Enumerator enumerator = c.sockets.GetEnumerator())
233 while (enumerator.MoveNext())
235 if (enumerator.Current != 0)
247 foreach (
string text
in array)
249 if (r.tag.Contains(
"noCarbone") && c.material.alias ==
"carbone")
253 if (text.StartsWith(
'#'))
255 string text2 = text.Replace(
"#",
"");
256 if (c.category.IsChildOf(text2) &&
this.IsIngredient(text2, c))
263 string[] array3 = text.Split(
'@', StringSplitOptions.None);
264 if (array3.Length > 1)
266 if (c.id != array3[0] && c.sourceCard._origin != array3[0])
271 if (row !=
null && row.race_row.tag.Contains(array3[1]))
275 if (c.material.tag.Contains(array3[1]))
282 if (text ==
"any" && !c.IsUnique && !c.IsImportant && !c.trait.CanOnlyCarry)
286 if (c.id == text || c.sourceCard._origin == text)
297 public virtual bool IsIngredient(
string cat,
Card c)
306 string[] ing = r.ing1;
307 for (
int i = 0; i < ing.Length; i++)
309 if (ing[i].Contains(
'@'))
321 int num = this.GetSource(ai).time * 100;
324 Recipe recipe = ai.recipe;
325 return Mathf.Max(a, num / (num2 + pc.Evalue(
this.IDReqEle((recipe !=
null) ? recipe.source :
null)) * 5));
331 return this.GetSource(ai).sp;
340 if (row.factory ==
this.IdSource)
345 for (
int i = 0; i < this.numIng; i++)
349 if (i >= ai.ings.Count || !
this.IsIngredient(i, row2, ai.ings[i]))
375 return id - 47 > 1 || index == 0;
381 Thing thing = ai.ings[0];
382 Thing thing2 = (this.numIng > 1) ? ai.ings[1] :
null;
388 if (!
EClass.player.knownCraft.Contains(source.id))
391 Msg.Say(
"newKnownCraft");
392 EClass.player.knownCraft.Add(source.id);
398 string text = source.thing;
399 TraitCrafter.MixType mixType = source.type.ToEnum(
true);
400 int num = source.num.Calc(0, 0, 0);
402 CS$<>8__locals1.t =
null;
406 CS$<>8__locals1.t =
CraftUtil.MixIngredients(text, ai.ings,
CraftUtil.MixType.General, 0);
410 string[] array = text.Split(
'%', StringSplitOptions.None);
411 CS$<>8__locals1.t =
CraftUtil.MixIngredients(
ThingGen.Create(array[0], (array.Length > 1) ?
EClass.sources.materials.alias[array[1]].id : thing.material.id, -1), ai.ings,
CraftUtil.MixType.General, 999).Thing;
415 CS$<>8__locals1.t =
ThingGen.Create(text, thing2.material.id, -1);
419 CS$<>8__locals1.t =
ThingGen.Create(text, -1, -1);
422 if (source.tag.Contains(
"rust"))
424 EClass.pc.Say(
"polish",
EClass.pc, ai.ings[1],
null,
null);
425 ai.ings[1].ModEncLv(1);
426 ai.ings[0].ModNum(-1,
true);
428 if (source.tag.Contains(
"mod_eject"))
430 ai.ings[1].EjectSockets();
431 ai.ings[0].ModNum(-1,
true);
436 CS$<>8__locals1.t =
ThingGen.Create(text, -1, -1);
437 List<CardRow> list =
EClass.player.codex.ListKills();
438 list.Add(
EClass.sources.cards.map[
"putty"]);
439 list.Add(
EClass.sources.cards.map[
"snail"]);
440 CardRow cardRow = list.RandomItemWeighted((
CardRow a) => (
float)Mathf.Max(50 - a.LV, 1));
441 CS$<>8__locals1.t.c_idRefCard = cardRow.id;
442 CS$<>8__locals1.t.ChangeMaterial(thing.material);
443 CS$<>8__locals1.t.SetEncLv(Mathf.Min(
EClass.rnd(
EClass.rnd(Mathf.Max(5 +
EClass.pc.Evalue(258) - cardRow.LV, 1))), 12));
444 CS$<>8__locals1.t =
CraftUtil.MixIngredients(CS$<>8__locals1.t, ai.ings,
CraftUtil.MixType.General, 999).Thing;
449 int num2 =
EClass.pc.Evalue(1418);
450 Thing thing3 = ai.ings[1];
452 int num3 = thing3.c_charges * source2.charge * (100 + num2 * 50) / 500 + 1;
454 Thing thing4 =
ThingGen.Create(
"talisman", -1, -1).SetNum(num3);
455 thing4.refVal = source2.id;
456 thing4.encLV = num4 * (100 + num2 * 10) / 100;
457 thing.ammoData = thing4;
459 EClass.pc.Say(
"talisman", thing, thing4,
null,
null);
466 CS$<>8__locals2.claimed =
false;
467 TraitCrafter.<Craft>g__Prize|45_2(20,
"medal",
"save",
false, ref CS$<>8__locals1, ref CS$<>8__locals2);
468 TraitCrafter.<Craft>g__Prize|45_2(10,
"plat",
"save",
false, ref CS$<>8__locals1, ref CS$<>8__locals2);
469 TraitCrafter.<Craft>g__Prize|45_2(10,
"furniture",
"nice",
true, ref CS$<>8__locals1, ref CS$<>8__locals2);
470 TraitCrafter.<Craft>g__Prize|45_2(4,
"plamo_box",
"nice",
false, ref CS$<>8__locals1, ref CS$<>8__locals2);
471 TraitCrafter.<Craft>g__Prize|45_2(4,
"food",
"",
false, ref CS$<>8__locals1, ref CS$<>8__locals2);
472 TraitCrafter.<Craft>g__Prize|45_2(1,
"casino_coin",
"",
false, ref CS$<>8__locals1, ref CS$<>8__locals2);
479 CS$<>8__locals1.t =
ThingGen.Create(text, -1, -1);
482 if (ai.ings[0].c_DNA !=
null)
484 CS$<>8__locals1.t.MakeRefFrom(ai.ings[0].c_idRefCard);
485 CS$<>8__locals1.t.c_DNA = ai.ings[0].c_DNA;
486 CS$<>8__locals1.t.c_DNA.GenerateWithGene(
DNA.Type.Inferior, CS$<>8__locals1.t,
null);
491 CS$<>8__locals1.t =
CraftUtil.MixIngredients(CS$<>8__locals1.t, ai.ings,
CraftUtil.MixType.General, 999).Thing;
495 if (CS$<>8__locals1.t !=
null)
497 if (CS$<>8__locals1.t.HasElement(1229, 1))
501 if (CS$<>8__locals1.t.HasElement(704, 1))
505 if (CS$<>8__locals1.t.HasElement(703, 1))
509 CS$<>8__locals1.t.SetNum(num);
511 return CS$<>8__locals1.t;
515 public override void TrySetAct(
ActPlan p)
525 p.TrySetAct(this.CrafterTitle, delegate()
529 }, this.owner,
null, 1,
false,
true,
false);
533 public override bool CanUse(
Chara c)
535 return this.CanUseFromInventory;
539 public override bool OnUse(
Chara c)
547 internal static void <Craft>g__Prize|45_2(
int chance,
string s,
string col,
bool cat, ref
TraitCrafter.<>c__DisplayClass45_0 A_4, ref
TraitCrafter.<>c__DisplayClass45_1 A_5)
549 if (A_5.claimed ||
EClass.rnd(chance) != 0)
587 public enum AnimeType