9 public override bool CanRead(
Chara c)
20 return this.owner.refVal;
30 return EClass.sources.elements.map[this.idEle];
35 public override int GetActDuration(
Chara c)
42 public virtual bool IsPlan
51 public override void OnCreate(
int lv)
59 if (a.tag.Contains(
"hidden") || a.tag.Contains(
"unused"))
65 if (a.category !=
"policy" && a.category !=
"tech")
69 if (a.cost.Length == 0 || (a.category ==
"tech" && a.cost[0] == 0))
74 else if (a.category !=
"skill")
84 public override void SetName(ref
string s)
90 s =
"_of".lang(this.source.GetName().Bracket(1), s,
null,
null,
null);
91 if (this.IsPlan &&
EClass.pc.homeBranch !=
null &&
EClass.pc.homeBranch.elements.HasBase(
this.idEle))
93 s +=
"alreadyLearned".lang();
98 public override void OnRead(
Chara c)
100 if (this.IsPlan && !c.IsPC)
104 if (this.IsPlan && !
EClass._zone.IsPCFaction)
106 this.owner.Say(
"skillbook_invalidZone",
null,
null);
109 if (this.IsPlan &&
EClass.Branch.elements.HasBase(
this.idEle))
111 this.owner.Say(
"skillbook_knownSkill", c, this.source.GetName(),
null);
114 this.owner.Say(this.IsPlan ?
"skillbook_learnPlan" :
"skillbook_learn", c, this.source.GetName(),
null);
117 EClass.Branch.elements.Learn(this.idEle, 1);
118 if (this.source.category ==
"policy" && !
EClass.Branch.policies.HasPolicy(
this.idEle))
120 EClass.Branch.policies.AddPolicy(this.idEle,
true);
122 using (List<FactionBranch>.Enumerator enumerator =
EClass.pc.faction.GetChildren().GetEnumerator())
124 while (enumerator.MoveNext())
127 factionBranch.ValidateUpgradePolicies();
132 if (!c.elements.HasBase(
this.idEle))
134 c.elements.Learn(this.idEle, 1);
138 c.elements.ModExp(this.idEle, this.owner.IsBlessed ? 1500 : (
this.owner.IsCursed ? 500 : 1000),
false);
141 c.Say(
"spellbookCrumble", this.owner.Duplicate(1),
null,
null);
142 this.owner.ModNum(-1,
true);
146 public override int GetValue()
148 return this.owner.sourceCard.value;
152 public override void WriteNote(UINote n,
bool identified)
154 base.WriteNote(n, identified);
160 bool flag = chara.elements.HasBase(this.idEle);
161 n.AddText(
"_bullet".lang() + chara.Name + (flag ?
"alreadyLearned" :
"notLearned").lang(), flag ? FontColor.Good : FontColor.Warning);