9 public virtual bool Waterproof
19 public override bool IsOn
23 return !this.owner.isBroken && !
EClass._map.isBreakerDown;
29 public override int Electricity
35 return base.Electricity;
43 public override bool UseAltTiles
47 return this.Electricity > 0;
52 public override void OnSimulateHour(
VirtualDate date)
54 if (!date.IsRealTime || !
this.owner.IsInstalled)
58 if (!this.Waterproof && (this.owner.Cell.IsTopWater || (!
this.owner.Cell.HasRoof && !
EClass._map.IsIndoor &&
EClass.world.weather.IsHazard)))
66 int num = this.Electricity * 5 / 10;
67 if (!this.owner.isBroken &&
EClass._zone.electricity < num && (num -
EClass._zone.electricity) * 100 / num >=
EClass.rnd(150))
74 public void ModHP(
int a)
76 this.owner.hp = Mathf.Clamp(this.owner.hp + a, 1, 100);
77 if (!this.owner.isBroken &&
this.owner.hp < 50)
82 if (this.owner.isBroken &&
this.owner.hp >= 50)
92 this.owner.isBroken =
false;
93 this.owner.PlaySound(
"electricity_on", 1f,
true);
94 this.owner.Say(
"electricity_recover", this.owner,
null,
null);
95 EClass._zone.RefreshElectricity();
99 public void ShortOut()
101 this.owner.hp -= 20 +
EClass.rnd(30);
102 this.owner.isBroken =
true;
103 this.owner.PlaySound(
"electricity_off", 1f,
true);
104 this.owner.Say(
"electricity_short", this.owner,
null,
null);
105 EClass._zone.RefreshElectricity();