15 return (
"member" + this.type.ToString()).lang();
20 public void SetOwner(
FactionBranch _branch, FactionMemberType _type)
22 this.branch = _branch;
27 public void OnAdvanceDay()
29 this.lastValue = this.value;
30 this.value = (int)Mathf.Lerp((
float)
this.value, (
float)
this.GetTargetValue(), 0.1f);
34 public void OnRefreshEffect()
40 public int GetTargetValue()
43 if (this.branch.resources.food.value < 0)
47 num += (this.branch.resources.fun.value - 50) / 4;
48 num += (this.branch.resources.culture.value - 50) / 4;
49 num += (this.branch.resources.medicine.value - 50) / 4;
50 num += (this.branch.resources.safety.value - 50) / 4;
51 foreach (
Chara chara
in this.branch.members)
57 foreach (
Policy policy
in this.branch.policies.list)
60 num += this.modPolicy;
65 public string GetText()
67 if (this.CountMembers() == 0)
69 return " - %".TagColor(FontColor.Passive,
null);
71 string text = this.value.ToString() +
"%";
72 int num = this.value - this.lastValue;
78 text = text.TagColor(FontColor.Bad,
null);
80 else if (this.value >= 70)
82 text = text.TagColor(FontColor.Good,
null);
87 str =
"↑".TagColor(FontColor.Good,
null);
91 str =
"↓".TagColor(FontColor.Bad,
null);
93 return text +
" " + str;
97 public int CountMembers()
100 using (List<Chara>.Enumerator enumerator = this.branch.members.GetEnumerator())
102 while (enumerator.MoveNext())
104 if (enumerator.Current.memberType ==
this.type)
114 public void WriteNote(UINote n)
117 n.AddHeader(this.Name,
null);
119 n.AddText(
"vTarget".lang() + this.GetTargetValue().ToString(), FontColor.DontChange);
120 n.AddText(
"vCurrent".lang() + this.value.ToString(), FontColor.DontChange);
121 n.AddText(
"vLast".lang() + this.lastValue.ToString(), FontColor.DontChange);
123 n.AddText(
"policyHappiness".lang(this.modPolicy.ToString() ??
"",
null,
null,
null,
null), FontColor.DontChange);
133 public int lastValue;
136 public int modPolicy;
142 public FactionMemberType type;