Elin Decompiled Documentation EA 23.229 Stable 1st Anniversary Patch 2
Loading...
Searching...
No Matches
TraitDrinkMilkMother.cs
Go to the documentation of this file.
1using System.Collections.Generic;
2using UnityEngine;
3
5{
6 public override bool HoldAsDefaultInteraction => true;
7
8 public override Emo2 GetHeldEmo(Chara c)
9 {
10 if (c.Evalue(1232) > 0)
11 {
12 return Emo2.baby;
13 }
14 return Emo2.none;
15 }
16
17 public override void OnDrink(Chara c)
18 {
19 if (c.Evalue(1232) > 0)
20 {
21 c.isScaled = true;
22 c.SetFeat(1232, c.Evalue(1232) - 1);
23 int uidNext = EClass.game.cards.uidNext;
24 EClass.game.cards.uidNext = 1;
25 Rand.SetSeed(1);
27 chara.SetLv(Mathf.Clamp(5 + owner.encLV * 5, 1, 20 + EClass.pc.Evalue(237)));
28 Rand.SetSeed();
29 EClass.game.cards.uidNext = uidNext;
30 Debug.Log(chara.id + "/" + chara.LV);
31 List<Element> list = chara.elements.ListBestAttributes();
32 List<Element> list2 = chara.elements.ListBestSkills();
33 int num = 100;
34 int num2 = 0;
35 foreach (Element item in list)
36 {
37 Element element = c.elements.GetElement(item.id);
38 int num3 = item.ValueWithoutLink * (element.Potential - element.vTempPotential) / num / 2;
39 if (num3 > 0)
40 {
41 num2 += num3;
42 Debug.Log(item.source.alias + "/" + num3 + " org:" + item.ValueWithoutLink);
43 c.elements.ModBase(item.id, num3);
44 }
45 num += 50;
46 }
47 num = 100;
48 foreach (Element item2 in list2)
49 {
50 Element element2 = c.elements.GetElement(item2.id);
51 if (element2 != null && element2.ValueWithoutLink != 0)
52 {
53 int num4 = item2.ValueWithoutLink * (element2.Potential - element2.vTempPotential) / num / 2;
54 if (num4 > 0)
55 {
56 Debug.Log(item2.source.alias + "/" + num4 + " org:" + item2.ValueWithoutLink);
57 c.elements.ModBase(item2.id, num4);
58 }
59 num += 50;
60 }
61 }
62 c.feat += owner.encLV;
63 if (c.Evalue(1232) == 0)
64 {
65 c.Say("grow_adult", c);
66 c.PlaySound("mutation");
67 c.PlayEffect("mutation");
68 switch (c.id)
69 {
70 case "putty_snow":
71 if (c.idSkin >= 4)
72 {
73 c.idSkin = (c.idSkin - 4) / 2;
74 }
75 break;
76 case "putty_snow_gold":
77 if (c.idSkin >= 1)
78 {
79 c.idSkin = 0;
80 }
81 break;
82 case "chicken":
83 case "duck":
84 case "shamo":
85 case "penguin":
86 case "penguin_emperor":
87 c.idSkin = 0;
88 break;
89 }
90 }
91 else
92 {
93 c.Say("grow_baby", c);
94 c.PlaySound("ding_potential");
95 }
96 c.PlayEffect("buff");
97 EClass.pc.ModExp(237, 100);
98 }
99 else
100 {
101 base.OnDrink(c);
102 }
103 }
104}
Emo2
Definition: Emo2.cs:2
ElementContainerCard elements
Definition: Card.cs:41
string id
Definition: Card.cs:35
SoundSource PlaySound(string id, float v=1f, bool spatial=true)
Definition: Card.cs:6038
Card SetLv(int a)
Definition: Card.cs:2885
Effect PlayEffect(string id, bool useRenderPos=true, float range=0f, Vector3 fix=default(Vector3))
Definition: Card.cs:6072
int encLV
Definition: Card.cs:326
int Evalue(int ele)
Definition: Card.cs:2559
int idSkin
Definition: Card.cs:362
void ModExp(string alias, int a)
Definition: Card.cs:2636
int LV
Definition: Card.cs:386
void Say(string lang, string ref1=null, string ref2=null)
Definition: Card.cs:6690
string c_idRefCard
Definition: Card.cs:1737
static Chara Create(string id, int lv=-1)
Definition: CharaGen.cs:17
Definition: Chara.cs:10
void SetFeat(int id, int value=1, bool msg=false)
Definition: Chara.cs:9657
Definition: EClass.cs:5
static Game game
Definition: EClass.cs:8
static Chara pc
Definition: EClass.cs:14
Element ModBase(int ele, int v)
List< Element > ListBestSkills()
List< Element > ListBestAttributes()
Element GetElement(string alias)
int ValueWithoutLink
Definition: ELEMENT.cs:294
int id
Definition: ELEMENT.cs:250
SourceElement.Row source
Definition: ELEMENT.cs:273
int vTempPotential
Definition: ELEMENT.cs:258
CardManager cards
Definition: Game.cs:155
Definition: Rand.cs:4
static void SetSeed(int a=-1)
Definition: Rand.cs:37
override void OnDrink(Chara c)
override Emo2 GetHeldEmo(Chara c)
override bool HoldAsDefaultInteraction
Card owner
Definition: Trait.cs:27