18 public override bool IsBlendBase
28 public override bool HasCharges
38 public override bool ShowCharges
52 return this.owner.GetInt(26,
null);
65 return this.owner.c_charges;
67 return EClass.player.holyWell;
73 EClass.player.holyWell = value;
76 this.owner.c_charges = value;
86 return this.pollution >= 10;
91 public override bool CanBlend(
Thing t)
93 return t.category.IsChildOf(
"drink");
99 bool polluted = this.polluted;
104 if ((t.id ==
"water" || t.id ==
"bucket") && t.IsBlessed)
112 Msg.Say(
"unpolluted", this.owner,
null,
null,
null);
115 this.owner.SetInt(26, 0);
119 string name = this.owner.Name;
120 this.owner.SetInt(26, this.pollution +
EClass.rnd(3) + ((t.blessedState <= BlessedState.Cursed) ? 10 : 0) + (
this.IsHoly ? 10 : 0));
121 if (!polluted && this.polluted)
123 Msg.Say(
"polluted", name,
null,
null,
null);
130 public override void OnCreate(
int lv)
134 this.owner.c_charges =
EClass.rnd(6) + 2;
139 public override void TrySetAct(
ActPlan p)
141 p.TrySetAct(
"actDrink", delegate()
143 if (this.Charges <= 0)
145 EClass.pc.Say(
"drinkWell_empty",
EClass.pc,
this.owner,
null,
null);
148 EClass.pc.Say(
"drinkWell",
EClass.pc,
this.owner,
null,
null);
149 EClass.pc.PlaySound(
"drink", 1f,
true);
150 EClass.pc.PlayAnime(AnimeID.Shiver,
false);
151 if (this.IsHoly ||
EClass.rnd(5) == 0)
153 ActEffect.Proc(EffectId.ModPotential,
EClass.pc,
null, (!
this.polluted && (
this.IsHoly ||
EClass.rnd(2) == 0)) ? 100 : -100,
default(
ActRef));
155 else if (
EClass.rnd(5) == 0)
159 else if (
EClass.rnd(4) == 0)
163 else if (
EClass.rnd(
EClass.debug.enable ? 2 : 10) == 0 && !
this.polluted && !
EClass.player.wellWished)
165 if (
EClass.player.CountKeyItem(
"well_wish") > 0)
167 EClass.player.ModKeyItem(
"well_wish", -1,
true);
169 EClass.player.wellWished =
true;
173 Msg.SayNothingHappen();
176 else if (this.polluted)
178 EClass.pc.Say(
"drinkWater_dirty",
null,
null);
183 EClass.pc.Say(
"drinkWater_clear",
null,
null);
187 }, this.owner,
null, 1,
false,
true,
false);
191 public void ModCharges(
int a)
194 if (this.Charges <= 0)
196 EClass.pc.Say(
"drinkWell_dry",
EClass.pc,
this.owner,
null,
null);
201 public static void BadEffect(
Chara c)
230 public override void SetName(ref
string s)
234 s =
"_polluted".lang(s,
null,
null,
null,
null);