10 private new void Awake()
12 Rand.SetSeed(
ELayer.game.seed +
ELayer.player.stats.days);
13 int num =
ELayer.rnd(this.spriteBG.Length);
14 if (num == 1 &&
ELayer.game.cards.globalCharas.Find(
"corgon") ==
null)
18 if (num == 2 &&
ELayer.game.cards.globalCharas.Find(
"loytel") ==
null)
22 this.imageBG.sprite = this.spriteBG[num];
31 SE.Play(
"money_shipping");
32 base.InvokeRepeating(
"UpdateRepeating", 0f, this.duration / (
float)this.maxUpdate);
36 public void UpdateRepeating()
54 if (this.update != this.maxUpdate)
56 foreach (DOTweenAnimation dotweenAnimation
in base.GetComponentsInChildren<DOTweenAnimation>())
58 if (dotweenAnimation.tween !=
null)
60 dotweenAnimation.tween.Kill(
true);
64 this.update = this.maxUpdate;
67 float num = (float)this.update / (
float)this.maxUpdate;
68 int num2 = this.result.GetIncome();
69 num2 = (int)((
float)num2 * num);
70 int a = this.result.total + num2;
71 this.textIncome.text = Lang._currency(num2,
true, 14);
72 this.textIncomeTotal.text = Lang._currency(a,
true, 14);
73 int shippingBonus =
ELayer.player.stats.GetShippingBonus(this.result.total);
74 int shippingBonus2 =
ELayer.player.stats.GetShippingBonus(a);
75 int lastShippingExp =
ELayer.player.stats.lastShippingExp;
76 int lastShippingExpMax =
ELayer.player.stats.lastShippingExpMax;
77 int hearthLv = this.result.hearthLv;
78 int num3 = (int)((
float)this.result.hearthExpGained * num);
79 int nextExp = branch.GetNextExp(hearthLv);
80 int num4 = this.result.hearthExp + num3;
81 this.gaugeGold.rectTransform.sizeDelta =
new Vector2((
float)Mathf.Min(300, 300 * lastShippingExp / lastShippingExpMax), 50f);
82 this.gaugeHearth.rectTransform.sizeDelta =
new Vector2((
float)Mathf.Min(300, 300 * num4 / nextExp), 50f);
83 this.gaugeDebt.rectTransform.sizeDelta =
new Vector2(Mathf.Min(300f, 300f * ((
float)
this.result.debt / 20000000f)), 50f);
84 this.textGold.text =
"shipping_nextGold".lang(lastShippingExp.ToFormat(), lastShippingExpMax.ToFormat(),
null,
null,
null);
85 int num5 = shippingBonus2 - shippingBonus;
86 this.textGold2.text = ((num5 == 0) ?
"" : (
"+" + num5.ToString()));
87 this.textHearth.text =
"shipping_hearth".lang(hearthLv.ToString() ??
"", (100f * (
float)num4 / (
float)nextExp).ToString(
"F1"),
null,
null,
null);
88 float num6 = 100f * (float)num3 / (
float)nextExp;
89 this.textHearth2.text = ((num6 == 0f) ?
"" : (
"+" + num6.ToString(
"F1") +
"%"));
90 this.textDebt.text = (
ELayer.game.quests.IsStarted<
QuestDebt>() ? (Lang._currency(this.result.debt,
true, 14) ??
"") :
"???");
92 if (shippingBonus2 - shippingBonus != this.lastBonus)
94 this.lastBonus = shippingBonus2 - shippingBonus;
101 if (this.showEffect && this.update > this.maxUpdate)
104 this.showEffect =
false;
111 this.result = _result;
112 Zone zone =
ELayer.game.spatials.Find(this.result.uidZone) ??
ELayer.pc.homeZone;
114 BaseList baseList = this.list;
118 b.text1.SetText(a.text);
119 b.text2.SetText(a.income.ToFormat());
121 baseList.callbacks = callback;
127 this.list.Refresh(
false);
128 Date date =
Date.ToDate(this.result.rawDate);
129 this.textTitle.text =
string.Concat(
new string[]
131 date.month.ToString(),
137 this.textHome.text =
"shipping_home".lang(zone.Name,
null,
null,
null,
null);
139 int count =
ELayer.player.shippingResults.Count;
140 int index =
ELayer.player.shippingResults.IndexOf(this.result);
141 this.buttonNext.SetActive(index != -1 && count > index + 1);
142 this.buttonPrev.SetActive(index > 0);
143 this.buttonNext.SetOnClick(delegate
145 this.showEffect =
false;
146 this.Show(
ELayer.player.shippingResults[index + 1]);
148 this.buttonPrev.SetOnClick(delegate
150 this.showEffect =
false;
151 this.Show(
ELayer.player.shippingResults[index - 1]);
153 this.RebuildLayout(
true);
160 public UIButton buttonNext;
163 public UIButton buttonPrev;
166 public Image gaugeGold;
169 public Image gaugeHearth;
172 public Image gaugeDebt;
175 public Image imageBG;
178 public UIText textGold;
181 public UIText textGold2;
184 public UIText textHearth;
187 public UIText textHearth2;
190 public UIText textHome;
193 public UIText textIncome;
196 public UIText textIncomeTotal;
199 public UIText textTitle;
202 public UIText textDebt;
205 public bool showEffect =
true;
208 public float duration;
214 public int maxUpdate;
220 public Sprite[] spriteBG;
223 private int lastBonus;