proper jammering behavior for boomers

This commit is contained in:
FateJH 2019-12-25 00:31:35 -05:00
parent fee001596f
commit 036f00f119
4 changed files with 43 additions and 11 deletions

View file

@ -7,6 +7,7 @@ import net.psforever.objects.serverobject.structures.{Amenity, Building}
import net.psforever.objects.serverobject.terminals.{CaptureTerminal, Terminal}
import net.psforever.objects.zones.Zone
import net.psforever.objects._
import net.psforever.objects.equipment.JammableUnit
import net.psforever.packet.game.{PlanetSideGUID, TriggeredEffect, TriggeredEffectLocation}
import net.psforever.objects.vital.Vitality
import net.psforever.types.Vector3
@ -64,6 +65,10 @@ class LocalService(zone : Zone) extends Actor {
LocalEvents.publish(
LocalServiceResponse(s"/$forChannel/Local", player_guid, LocalResponse.DeployableMapIcon(behavior, deployInfo))
)
case LocalAction.Detonate(guid, obj) =>
LocalEvents.publish(
LocalServiceResponse(s"/$forChannel/Local", Service.defaultPlayerGUID, LocalResponse.Detonate(guid, obj))
)
case LocalAction.DoorOpens(player_guid, _, door) =>
doorCloser ! DoorCloseActor.DoorIsOpen(door, zone)
LocalEvents.publish(
@ -282,8 +287,21 @@ class LocalService(zone : Zone) extends Actor {
}
//synchronized damage calculations
case Vitality.DamageOn(target : Deployable, func) =>
val cause = func(target)
case Vitality.DamageOn(target : Deployable with JammableUnit, damage_func) =>
if(target.Health > 0) {
val cause = damage_func(target)
target.Jammed = if(cause.projectile.profile.JammerProjectile) {
val radius = cause.projectile.profile.DamageRadius
Vector3.DistanceSquared(cause.hit_pos, cause.target.Position) < radius * radius
}
else {
false
}
sender ! Vitality.DamageResolution(target, cause)
}
case Vitality.DamageOn(target : Deployable, damage_func) =>
val cause = damage_func(target)
sender ! Vitality.DamageResolution(target, cause)
case msg =>

View file

@ -25,6 +25,7 @@ object LocalAction {
final case class AlertDestroyDeployable(player_guid : PlanetSideGUID, obj : PlanetSideGameObject with Deployable) extends Action
final case class DeployableMapIcon(player_guid : PlanetSideGUID, behavior : DeploymentAction.Value, deployInfo : DeployableInfo) extends Action
final case class Detonate(guid : PlanetSideGUID, obj : PlanetSideGameObject) extends Action
final case class DoorOpens(player_guid : PlanetSideGUID, continent : Zone, door : Door) extends Action
final case class DoorCloses(player_guid : PlanetSideGUID, door_guid : PlanetSideGUID) extends Action
final case class HackClear(player_guid : PlanetSideGUID, target : PlanetSideServerObject, unk1 : Long, unk2 : Long = 8L) extends Action

View file

@ -19,6 +19,7 @@ object LocalResponse {
final case class AlertDestroyDeployable(obj : PlanetSideGameObject with Deployable) extends Response
final case class DeployableMapIcon(action : DeploymentAction.Value, deployInfo : DeployableInfo) extends Response
final case class Detonate(guid : PlanetSideGUID, obj : PlanetSideGameObject) extends Response
final case class DoorOpens(door_guid : PlanetSideGUID) extends Response
final case class DoorCloses(door_guid : PlanetSideGUID) extends Response
final case class EliminateDeployable(obj : PlanetSideGameObject with Deployable, object_guid : PlanetSideGUID, pos : Vector3) extends Response