Jump to content

Elin:Code Analysis/Fishing: Difference between revisions

Updated fish code with new content lv before fixing mistakes
m (Hachimitsu moved page Elin:Spoiler/Fishing to Elin:Code Analysis/Fishing without leaving a redirect)
(Updated fish code with new content lv before fixing mistakes)
Line 89: Line 89:
|}
|}


====Code (EA 23.41)====
====Code (EA 23.67 fix 6)====


<syntaxhighlight lang="c#" line="1">
<syntaxhighlight lang="c#" line="1">
int num3 = EClass.rnd(num * 2) + 1;
int num3 = EClass.rnd(num * 2) + 1;
thing = ThingGen.Create("fish", -1, num3);
thing = ThingGen.Create("fish", -1, num3);
lv = lv + 2 + EClass.rnd(EClass.rnd(EClass.rnd(EClass.rnd(Mathf.Min(lv * 2, 20)) + 1) + 1) + 1);
</syntaxhighlight>
</syntaxhighlight>


Line 240: Line 238:
'''Note''': Values for 4+ fish follow the same progression pattern (incrementing by the same interval as earlier columns).
'''Note''': Values for 4+ fish follow the same progression pattern (incrementing by the same interval as earlier columns).


==== Code (EA 23.40) ====
==== Code (EA 23.67 fix 6) ====


<syntaxhighlight lang="c#" line="1">
<syntaxhighlight lang="c#" line="1">
Line 247: Line 245:
if (EClass.Branch != null)
if (EClass.Branch != null)
{
{
    num4 += EClass.Branch.Evalue(3604) * 20 + EClass.Branch.Evalue(3605) * 20 + EClass.Branch.Evalue(3706) * 25;
num4 += EClass.Branch.Evalue(3604) * 20 + EClass.Branch.Evalue(3605) * 20 + EClass.Branch.Evalue(3706) * 25;
}
}
if (num4 >= EClass.rnd(100))
if (num4 >= EClass.rnd(100))
{
{
    num2++;
num2++;
}
}
}
if (thing != null)
if (thing != null)
{
{
    thing.SetNum(num2);
thing.SetNum(num2);
    thing.SetBlessedState(BlessedState.Normal);
thing.SetBlessedState(BlessedState.Normal);
}
}
</syntaxhighlight>
</syntaxhighlight>
Line 387: Line 386:
|}
|}


====Code (EA 23.37)====
====Code (EA 23.67 fix 6)====


<syntaxhighlight lang="c#" line="1">
<syntaxhighlight lang="c#" line="1">
Line 853: Line 852:
<syntaxhighlight lang="c#" line="1">
<syntaxhighlight lang="c#" line="1">
public static Thing Makefish(Chara c)
public static Thing Makefish(Chara c)
{
int num = c.Evalue(245);
if (EClass.rnd(3 + num) == 0)
{
return null;
}
int[] source = new int[]
{
233,
235,
236,
236,
236,
1170,
1143,
1144,
727,
728,
237,
869,
1178,
1179,
1180
};
int num2 = 1;
string text = "";
if (c.IsPC || EClass.rnd(20) == 0)
{
{
int num = c.Evalue(245);
if (EClass.rnd(30) == 0)
if (EClass.rnd(3 + num) == 0)
{
{
return null;
text = "book_ancient";
}
}
int[] source = new int[]
if (EClass.rnd(35) == 0 || EClass.debug.enable)
{
{
233,
text = "plat";
235,
if (EClass.rnd(2) == 0)
236,
{
236,
text = "scratchcard";
236,
}
1170,
if (EClass.rnd(3) == 0)
1143,
1144,
727,
728,
237,
869,
1178,
1179,
1180
};
int num2 = 1;
string text = "";
if (c.IsPC || EClass.rnd(20) == 0)
{
if (EClass.rnd(30) == 0)
{
{
text = "book_ancient";
text = "casino_coin";
}
}
if (EClass.rnd(35) == 0 || EClass.debug.enable)
if (EClass.rnd(3) == 0)
{
{
text = "plat";
text = "gacha_coin";
if (EClass.rnd(2) == 0)
{
text = "scratchcard";
}
if (EClass.rnd(3) == 0)
{
text = "casino_coin";
}
if (EClass.rnd(3) == 0)
{
text = "gacha_coin";
}
if (EClass.rnd(50) == 0 || EClass.debug.enable)
{
text = new string[]
{
"659",
"758",
"759",
"806",
"828",
"1190",
"1191"
}.RandomItem<string>();
}
}
}
if (EClass.rnd(40) == 0 && EClass.rnd(40) < num / 3 + 10)
if (EClass.rnd(50) == 0 || EClass.debug.enable)
{
{
text = "medal";
text = new string[]
{
"659",
"758",
"759",
"806",
"828",
"1190",
"1191"
}.RandomItem<string>();
}
}
}
}
Thing thing;
if (EClass.rnd(40) == 0 && EClass.rnd(40) < num / 3 + 10)
if (text != "")
{
{
thing = ThingGen.Create(text, -1, -1);
text = "medal";
}
}
else if (EClass.rnd(5 + num / 3) == 0)
}
{
Thing thing;
thing = ThingGen.Create(source.RandomItem<int>().ToString() ?? "", -1, -1);
if (text != "")
}
{
else
thing = ThingGen.Create(text, -1, EClass._zone.ContentLv);
}
else if (EClass.rnd(5 + num / 3) == 0)
{
thing = ThingGen.Create(source.RandomItem<int>().ToString() ?? "", -1, -1);
}
else
{
int num3 = EClass.rnd(num * 2) + 1;
thing = ThingGen.Create("fish", -1, num3);
num2 = EClass.rnd(num / (num3 + 10)) + 1;
int num4 = 5;
if (EClass.Branch != null)
{
{
int num3 = EClass.rnd(num * 2) + 1;
num4 += EClass.Branch.Evalue(3604) * 20 + EClass.Branch.Evalue(3605) * 20 + EClass.Branch.Evalue(3706) * 25;
thing = ThingGen.Create("fish", -1, num3);
num2 = EClass.rnd(num / (num3 + 10)) + 1;
int num4 = 5;
if (EClass.Branch != null)
{
num4 += EClass.Branch.Evalue(3604) * 20 + EClass.Branch.Evalue(3605) * 20 + EClass.Branch.Evalue(3706) * 25;
}
if (num4 >= EClass.rnd(100))
{
num2++;
}
}
}
if (thing != null)
if (num4 >= EClass.rnd(100))
{
{
thing.SetNum(num2);
num2++;
thing.SetBlessedState(BlessedState.Normal);
}
}
return thing;
}
}
if (thing != null)
{
thing.SetNum(num2);
thing.SetBlessedState(BlessedState.Normal);
}
return thing;
}
</syntaxhighlight>
</syntaxhighlight>


[[Category:Elin Spoiler]]
[[Category:Elin Spoiler]]
[[Category:EN]]
[[Category:EN]]
138

edits