Elin Modding Docs Doc
Loading...
Searching...
No Matches
TraitDrinkMilkMother.cs
1using System;
2using System.Collections.Generic;
3using UnityEngine;
4
5// Token: 0x0200033A RID: 826
7{
8 // Token: 0x1700079D RID: 1949
9 // (get) Token: 0x06001A24 RID: 6692 RVA: 0x000A43EB File Offset: 0x000A25EB
10 public override bool HoldAsDefaultInteraction
11 {
12 get
13 {
14 return true;
15 }
16 }
17
18 // Token: 0x06001A25 RID: 6693 RVA: 0x000A43EE File Offset: 0x000A25EE
19 public override Emo2 GetHeldEmo(Chara c)
20 {
21 if (c.Evalue(1232) > 0)
22 {
23 return Emo2.baby;
24 }
25 return Emo2.none;
26 }
27
28 // Token: 0x06001A26 RID: 6694 RVA: 0x000A4404 File Offset: 0x000A2604
29 public override void OnDrink(Chara c)
30 {
31 if (c.Evalue(1232) > 0)
32 {
33 c.SetFeat(1232, c.Evalue(1232) - 1, false);
34 Chara chara = CharaGen.Create(this.owner.c_idRefCard, -1);
35 chara.SetLv(Mathf.Clamp(5 + this.owner.encLV * 10, 1, 50 + EClass.pc.Evalue(237)));
36 Debug.Log(chara.id + "/" + chara.LV.ToString());
37 List<Element> list = chara.elements.ListBestAttributes();
38 List<Element> list2 = chara.elements.ListBestSkills();
39 int num = 100;
40 foreach (Element element in list)
41 {
42 Element element2 = c.elements.GetElement(element.id);
43 int num2 = element.ValueWithoutLink * (element2.Potential - element2.vTempPotential) / num / 2;
44 if (num2 > 0)
45 {
46 Debug.Log(string.Concat(new string[]
47 {
48 element.source.alias,
49 "/",
50 num2.ToString(),
51 " org:",
52 element.ValueWithoutLink.ToString()
53 }));
54 c.elements.ModBase(element.id, num2);
55 }
56 num += 50;
57 }
58 num = 100;
59 foreach (Element element3 in list2)
60 {
61 if (c.HasElement(element3.id, 1))
62 {
63 Element element4 = c.elements.GetElement(element3.id);
64 int num3 = element3.ValueWithoutLink * (element4.Potential - element4.vTempPotential) / num / 2;
65 if (num3 > 0)
66 {
67 Debug.Log(string.Concat(new string[]
68 {
69 element3.source.alias,
70 "/",
71 num3.ToString(),
72 " org:",
73 element3.ValueWithoutLink.ToString()
74 }));
75 c.elements.ModBase(element3.id, num3);
76 }
77 num += 50;
78 }
79 }
80 if (c.Evalue(1232) == 0)
81 {
82 c.Say("grow_adult", c, null, null);
83 c.PlaySound("mutation", 1f, true);
84 c.PlayEffect("mutation", true, 0f, default(Vector3));
85 }
86 else
87 {
88 c.Say("grow_baby", c, null, null);
89 c.PlaySound("ding_potential", 1f, true);
90 }
91 c.PlayEffect("buff", true, 0f, default(Vector3));
92 EClass.pc.ModExp(237, 100);
93 return;
94 }
95 base.OnDrink(c);
96 }
97}
Definition Chara.cs:12