mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
medical terminals should auto repair properly (#1320)
This commit is contained in:
parent
feffecb601
commit
09e648e953
|
|
@ -2,7 +2,9 @@
|
||||||
package net.psforever.objects.serverobject.terminals
|
package net.psforever.objects.serverobject.terminals
|
||||||
|
|
||||||
import akka.actor.{ActorRef, Cancellable}
|
import akka.actor.{ActorRef, Cancellable}
|
||||||
|
import net.psforever.objects.serverobject.damage.Damageable
|
||||||
import net.psforever.objects.sourcing.AmenitySource
|
import net.psforever.objects.sourcing.AmenitySource
|
||||||
|
import net.psforever.objects.vital.interaction.DamageResult
|
||||||
import net.psforever.packet.game.HackState1
|
import net.psforever.packet.game.HackState1
|
||||||
import org.log4s.Logger
|
import org.log4s.Logger
|
||||||
|
|
||||||
|
|
@ -136,6 +138,20 @@ class ProximityTerminalControl(term: Terminal with ProximityUnit)
|
||||||
case _ => ;
|
case _ => ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override protected def DamageAwareness(target: Target, cause: DamageResult, amount: Any) : Unit = {
|
||||||
|
tryAutoRepair()
|
||||||
|
super.DamageAwareness(target, cause, amount)
|
||||||
|
}
|
||||||
|
|
||||||
|
override protected def DestructionAwareness(target: Damageable.Target, cause: DamageResult) : Unit = {
|
||||||
|
tryAutoRepair()
|
||||||
|
if (term.HackedBy.nonEmpty) {
|
||||||
|
val zone = term.Zone
|
||||||
|
zone.LocalEvents ! LocalServiceMessage(zone.id, LocalAction.ClearTemporaryHack(Service.defaultPlayerGUID, term))
|
||||||
|
}
|
||||||
|
super.DestructionAwareness(target, cause)
|
||||||
|
}
|
||||||
|
|
||||||
override def PerformRepairs(target : Target, amount : Int) : Int = {
|
override def PerformRepairs(target : Target, amount : Int) : Int = {
|
||||||
val newHealth = super.PerformRepairs(target, amount)
|
val newHealth = super.PerformRepairs(target, amount)
|
||||||
if(newHealth == target.Definition.MaxHealth) {
|
if(newHealth == target.Definition.MaxHealth) {
|
||||||
|
|
@ -355,7 +371,7 @@ object ProximityTerminalControl {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* When standing in a friendly SOI whose facility is under the influence of an Ancient Weapon Module benefit,
|
* When standing in a friendly SOI whose facility is under the influence of an Ancient Weapon Module benefit,
|
||||||
* and the player is in possession of Ancient weaponnry whose magazine is not full,
|
* and the player is in possession of Ancient weaponry whose magazine is not full,
|
||||||
* restore some ammunition to its magazine.
|
* restore some ammunition to its magazine.
|
||||||
* If no valid weapons are discovered or the discovered valid weapons have full magazines, stop using the terminal.
|
* If no valid weapons are discovered or the discovered valid weapons have full magazines, stop using the terminal.
|
||||||
* @param unit the terminal
|
* @param unit the terminal
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue