11 public override bool IsAvailable
20 public void UpdateRank()
22 int rank =
EClass.game.spatials.ranks.GetRank(this.branch.owner);
23 if (this.bestRank == 0)
27 if (rank < this.bestRank)
30 EClass.Sound.Play((rank <= 50) ?
"clap3" : ((rank <= 100) ?
"clap2" :
"clap1"));
31 Msg.Say(
"homerank_up",
EClass.game.spatials.ranks.GetRankText(
this.branch.owner),
null,
null,
null);
36 public override void Refresh()
43 public int GetPrice(
Thing t,
bool top =
false)
45 int num = t.GetPrice(CurrencyType.Money,
false, PriceType.Default,
null);
50 if (top && this.branch.policies.IsActive(2821, -1))
52 num = num * (150 + (int)Mathf.Sqrt((
float)this.branch.Evalue(2821)) * 5) / 100;
58 public override int GetDestValue()
60 List<Thing> list = this.ListHeirloom();
62 foreach (
Thing thing
in list)
64 num += this.GetPrice(thing, list[0] == thing);
70 public List<Thing> ListHeirloom()
72 List<Thing> list =
new List<Thing>();
73 List<Thing> list2 =
new List<Thing>();
74 HashSet<string> hashSet =
new HashSet<string>();
75 int[] array =
new int[
EClass._map.SizeXZ];
77 int num2 = this.branch.Evalue(2814);
78 int num3 = this.branch.Evalue(2823);
81 if (thing.IsInstalled)
83 if (thing.HasTag(CTAG.tourism))
88 if (array[thing.pos.index] != 0)
92 array[thing.pos.index]++;
98 item =
"figure_" + thing.c_idRefCard;
103 item = thing.id +
"_" + thing.idSkin.ToString();
105 if (!hashSet.Contains(item))
107 int num5 = this.GetPrice(thing,
false) * num4;
110 num5 = num5 * (110 + (int)Mathf.Sqrt((
float)num3) * 4) / 100;
117 int num6 = this.GetPrice(thing,
false) * num4 / Mathf.Max(20, 30 - (
int)Mathf.Sqrt((
float)num2));
130 int num7 = this.branch.Evalue(3780) + this.branch.Evalue(3781) + this.branch.Evalue(3782) + this.branch.Evalue(3783) + this.branch.Evalue(3784);
131 this.branch.tourism = (100 + num) * (100 + num7 * 15) / 100;
132 list2.Sort((
Thing a,
Thing b) => this.GetPrice(b,
false) - this.GetPrice(a,
false));
134 while (num8 < this.branch.NumHeirloom && num8 < list2.Count)
136 list.Add(list2[num8]);
143 public override void WriteNote(UINote n)
146 n.AddHeader(base.Name,
null);
147 n.AddTopic(
"TopicLeft",
"vCurrent".lang(), this.value.ToFormat() ??
"");
148 n.AddTopic(
"TopicLeft",
"tourism_value".lang(), this.branch.tourism.ToFormat() ??
"");
150 n.AddHeader(
"HeaderTopic",
"heirloom_list".lang(this.branch.NumHeirloom.ToString() ??
"",
null,
null,
null,
null),
null);
152 List<Thing> list = this.ListHeirloom();
153 for (
int i = 0; i < list.Count; i++)
155 Thing thing = list[i];
156 string str = (i + 1).ToString();
158 string name = thing.Name;
159 object obj = EClass.debug.showExtra ? this.GetPrice(thing, i == 0) :
"";
160 n.AddText(str + str2 + name + ((obj !=
null) ? obj.ToString() :
null), FontColor.DontChange);