mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-21 21:10:41 +00:00
Destroy and repair (#346)
* bog-standard order_terminal amenities now take damage up to the point of destruction and can be repaired from destruction to functional to the point of being fully repaired; this is mostly proof fo concept * restored proper destruction to FacilityTurrets; extended proper rrepairs to FacilityTurrets; co-opted terminal hacking into TerminalControl; started to expand on hacking protocol, but chose restraint * changes made thus that a clear Definition hierarchy is established; all of this is in line with making future changes to repair/destroy variables, and making generic the repair code * all meaningful facility amenities take damage and can be repaired; spawn tubes can be destroyed and the base will properly lose spawns (and show it on the map); some hack logic has been redistributed into the appropriate control objects, following in the wake of repair/damage logic * deployables are repairable; the TRAP has been converted into a ComplexDeployable; changed the nature of the Repairable traits * player bank repair and medapp heal has been moved out from WSA into PlayerControl * overhaul of Progress callback system and the inclusion of player revival as a Progress activity * begun relocating functionality for hacking outside of WSA; set up behavoir mixin for cargo operations, in order to move vehicle hack function, but did not yet integrate * integration of the actor behavior mixin for vehicle cargo operations to support the integration of vehicle hacking finalization * establishing inheritance/override potential of Damageable activity; Generator and SpawnTube map behavior behavior (currently inactive) * ImplantTerminalMech objects now have a 'with-coordinates' constructor and a deprecated 'no-coordinates' constructor; implants mechs and interfaces are now damageable and repairable, and their damage state can also block mounting * generators are destroyed and repaired properly, and even explode, killing a radius-worth of players * destroy and repair pass on deployables, except for explosive types * Damageable pass; client synchronization pass * helpful comments * some tests for damageable and repairable; refined output and repaired existing tests * enabled friendly fire check and recovery * handled friendly fire against allied mines; moved jammer code to common damageable behavior * tweaks to damageability, infantry heal and repair, and sensor and explosive animations * animations; framework for future vitals events; closing database connections * adding some deployable tests; fixing a bunch of other tests; History is back * testing for basic Damageable functions; removing a log message * finicky animation stuff * event messages to the Generator to represent health changes * damage against BFR's is now only used against mythical creatures * test fix
This commit is contained in:
parent
840006dca8
commit
c2f6baf551
124 changed files with 8530 additions and 2503 deletions
|
|
@ -2,12 +2,23 @@
|
|||
package objects
|
||||
|
||||
import akka.actor.{Actor, ActorRef, Props}
|
||||
import akka.testkit.TestProbe
|
||||
import base.ActorTest
|
||||
import net.psforever.objects.ballistics._
|
||||
import net.psforever.objects.ce.DeployedItem
|
||||
import net.psforever.objects.guid.NumberPoolHub
|
||||
import net.psforever.objects.guid.source.LimitedNumberSource
|
||||
import net.psforever.objects.serverobject.mount.Mountable
|
||||
import net.psforever.objects.vital.Vitality
|
||||
import net.psforever.objects.zones.{Zone, ZoneMap}
|
||||
import net.psforever.objects.{TurretDeployable, _}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, PlanetSideGUID}
|
||||
import net.psforever.packet.game.{DeployableIcon, DeployableInfo, DeploymentAction}
|
||||
import net.psforever.types._
|
||||
import org.specs2.mutable.Specification
|
||||
import services.{RemoverActor, Service}
|
||||
import services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
import services.local.{LocalAction, LocalServiceMessage}
|
||||
import services.support.SupportActor
|
||||
|
||||
import scala.concurrent.duration._
|
||||
|
||||
|
|
@ -49,14 +60,14 @@ class ExplosiveDeployableTest extends Specification {
|
|||
"ExplosiveDeployable" should {
|
||||
"construct" in {
|
||||
val obj = new ExplosiveDeployable(GlobalDefinitions.he_mine)
|
||||
obj.Exploded mustEqual false
|
||||
obj.Destroyed mustEqual false
|
||||
}
|
||||
|
||||
"explode" in {
|
||||
val obj = new ExplosiveDeployable(GlobalDefinitions.he_mine)
|
||||
obj.Exploded mustEqual false
|
||||
obj.Exploded = true
|
||||
obj.Exploded mustEqual true
|
||||
obj.Destroyed mustEqual false
|
||||
obj.Destroyed = true
|
||||
obj.Destroyed mustEqual true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -65,15 +76,15 @@ class BoomerDeployableTest extends Specification {
|
|||
"BoomerDeployable" should {
|
||||
"construct" in {
|
||||
val obj = new BoomerDeployable(GlobalDefinitions.boomer)
|
||||
obj.Exploded mustEqual false
|
||||
obj.Destroyed mustEqual false
|
||||
obj.Trigger.isEmpty mustEqual true
|
||||
}
|
||||
|
||||
"explode" in {
|
||||
val obj = new BoomerDeployable(GlobalDefinitions.boomer)
|
||||
obj.Exploded mustEqual false
|
||||
obj.Exploded = true
|
||||
obj.Exploded mustEqual true
|
||||
obj.Destroyed mustEqual false
|
||||
obj.Destroyed = true
|
||||
obj.Destroyed mustEqual true
|
||||
}
|
||||
|
||||
"manage its trigger" in {
|
||||
|
|
@ -142,6 +153,130 @@ class TurretDeployableTest extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
class DeployableMake extends Specification {
|
||||
"Deployables.Make" should {
|
||||
"construct a boomer" in {
|
||||
val func = Deployables.Make(DeployedItem.boomer)
|
||||
func() match {
|
||||
case _ : BoomerDeployable => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct an he mine" in {
|
||||
val func = Deployables.Make(DeployedItem.he_mine)
|
||||
func() match {
|
||||
case obj : ExplosiveDeployable if obj.Definition == GlobalDefinitions.he_mine => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a disruptor mine" in {
|
||||
val func = Deployables.Make(DeployedItem.jammer_mine)
|
||||
func() match {
|
||||
case obj : ExplosiveDeployable if obj.Definition == GlobalDefinitions.jammer_mine => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a spitfire turret" in {
|
||||
val func = Deployables.Make(DeployedItem.spitfire_turret)
|
||||
func() match {
|
||||
case obj : TurretDeployable if obj.Definition == GlobalDefinitions.spitfire_turret => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a shadow turret" in {
|
||||
val func = Deployables.Make(DeployedItem.spitfire_cloaked)
|
||||
func() match {
|
||||
case obj : TurretDeployable if obj.Definition == GlobalDefinitions.spitfire_cloaked => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a cerebus turret" in {
|
||||
val func = Deployables.Make(DeployedItem.spitfire_aa)
|
||||
func() match {
|
||||
case obj : TurretDeployable if obj.Definition == GlobalDefinitions.spitfire_aa => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a motion sensor" in {
|
||||
val func = Deployables.Make(DeployedItem.motionalarmsensor)
|
||||
func() match {
|
||||
case obj : SensorDeployable if obj.Definition == GlobalDefinitions.motionalarmsensor => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a sensor disruptor" in {
|
||||
val func = Deployables.Make(DeployedItem.sensor_shield)
|
||||
func() match {
|
||||
case obj : SensorDeployable if obj.Definition == GlobalDefinitions.sensor_shield => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct three metal i-beams so huge that a driver must be blind to drive into them but does anyway" in {
|
||||
val func = Deployables.Make(DeployedItem.tank_traps)
|
||||
func() match {
|
||||
case obj : TrapDeployable if obj.Definition == GlobalDefinitions.tank_traps => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a generic field turret" in {
|
||||
val func = Deployables.Make(DeployedItem.portable_manned_turret)
|
||||
func() match {
|
||||
case obj : TurretDeployable if obj.Definition == GlobalDefinitions.portable_manned_turret => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct an avenger turret" in {
|
||||
val func = Deployables.Make(DeployedItem.portable_manned_turret_tr)
|
||||
func() match {
|
||||
case obj : TurretDeployable if obj.Definition == GlobalDefinitions.portable_manned_turret_tr => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct an aegis shield generator" in {
|
||||
val func = Deployables.Make(DeployedItem.deployable_shield_generator)
|
||||
func() match {
|
||||
case obj : ShieldGeneratorDeployable if obj.Definition == GlobalDefinitions.deployable_shield_generator => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct a telepad" in {
|
||||
val func = Deployables.Make(DeployedItem.router_telepad_deployable)
|
||||
func() match {
|
||||
case obj : TelepadDeployable if obj.Definition == GlobalDefinitions.router_telepad_deployable => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct an osprey turret" in {
|
||||
val func = Deployables.Make(DeployedItem.portable_manned_turret_nc)
|
||||
func() match {
|
||||
case obj : TurretDeployable if obj.Definition == GlobalDefinitions.portable_manned_turret_nc => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
|
||||
"construct an orion turret" in {
|
||||
val func = Deployables.Make(DeployedItem.portable_manned_turret_vs)
|
||||
func() match {
|
||||
case obj : TurretDeployable if obj.Definition == GlobalDefinitions.portable_manned_turret_vs => ok
|
||||
case _ => ko
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ShieldGeneratorDeployableTest extends Specification {
|
||||
"ShieldGeneratorDeployable" should {
|
||||
"construct" in {
|
||||
|
|
@ -158,6 +293,291 @@ class ShieldGeneratorDeployableTest extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
class ExplosiveDeployableJammerTest extends ActorTest {
|
||||
val guid = new NumberPoolHub(new LimitedNumberSource(10))
|
||||
val zone = new Zone("test", new ZoneMap("test"), 0) {
|
||||
override def SetupNumberPools() = {}
|
||||
GUID(guid)
|
||||
}
|
||||
val activityProbe = TestProbe()
|
||||
val avatarProbe = TestProbe()
|
||||
val localProbe = TestProbe()
|
||||
zone.Activity = activityProbe.ref
|
||||
zone.AvatarEvents = avatarProbe.ref
|
||||
zone.LocalEvents = localProbe.ref
|
||||
|
||||
val j_mine = Deployables.Make(DeployedItem.jammer_mine)().asInstanceOf[ExplosiveDeployable] //guid=1
|
||||
val player1 = Player(Avatar("TestCharacter1", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=3
|
||||
player1.Spawn
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.NC, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=4
|
||||
player2.Spawn
|
||||
val weapon = Tool(GlobalDefinitions.jammer_grenade) //guid=5
|
||||
guid.register(j_mine, 1)
|
||||
guid.register(player1, 3)
|
||||
guid.register(player2, 4)
|
||||
guid.register(weapon, 5)
|
||||
j_mine.Zone = zone
|
||||
j_mine.Owner = player2
|
||||
j_mine.OwnerName = player2.Name
|
||||
j_mine.Faction = PlanetSideEmpire.NC
|
||||
j_mine.Actor = system.actorOf(Props(classOf[ExplosiveDeployableControl], j_mine), "j-mine-control")
|
||||
|
||||
val jMineSource = SourceEntry(j_mine)
|
||||
val pSource = PlayerSource(player1)
|
||||
val projectile = weapon.Projectile
|
||||
val resolved = ResolvedProjectile(
|
||||
ProjectileResolution.Splash,
|
||||
Projectile(projectile, weapon.Definition, weapon.FireMode, pSource, 0, Vector3.Zero, Vector3.Zero),
|
||||
jMineSource,
|
||||
j_mine.DamageModel,
|
||||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageToJ = resolved.damage_model.Calculate(resolved)
|
||||
|
||||
"ExplosiveDeployable" should {
|
||||
"handle being jammered appropriately (no detonation)" in {
|
||||
assert(!j_mine.Destroyed)
|
||||
|
||||
j_mine.Actor ! Vitality.Damage(applyDamageToJ)
|
||||
val msg_local = localProbe.receiveN(4, 200 milliseconds)
|
||||
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
||||
activityProbe.expectNoMsg(200 milliseconds)
|
||||
assert(
|
||||
msg_local.head match {
|
||||
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq j_mine
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(1) match {
|
||||
case LocalServiceMessage("NC", LocalAction.DeployableMapIcon(
|
||||
PlanetSideGUID(0),
|
||||
DeploymentAction.Dismiss,
|
||||
DeployableInfo(PlanetSideGUID(1), DeployableIcon.DisruptorMine, _, PlanetSideGUID(0))
|
||||
)) => true
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(2) match {
|
||||
case LocalServiceMessage.Deployables(SupportActor.ClearSpecific(List(target), _zone)) => (target eq j_mine) && (_zone eq zone)
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(3) match {
|
||||
case LocalServiceMessage.Deployables(RemoverActor.AddTask(target, _zone, _)) => (target eq j_mine) && (_zone eq zone)
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_avatar match {
|
||||
case AvatarServiceMessage("test", AvatarAction.Destroy(PlanetSideGUID(1), _, Service.defaultPlayerGUID, _)) => true
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(j_mine.Destroyed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ExplosiveDeployableJammerExplodeTest extends ActorTest {
|
||||
val guid = new NumberPoolHub(new LimitedNumberSource(10))
|
||||
val zone = new Zone("test", new ZoneMap("test"), 0) {
|
||||
override def SetupNumberPools() = {}
|
||||
GUID(guid)
|
||||
}
|
||||
val activityProbe = TestProbe()
|
||||
val avatarProbe = TestProbe()
|
||||
val localProbe = TestProbe()
|
||||
zone.Activity = activityProbe.ref
|
||||
zone.AvatarEvents = avatarProbe.ref
|
||||
zone.LocalEvents = localProbe.ref
|
||||
|
||||
val h_mine = Deployables.Make(DeployedItem.he_mine)().asInstanceOf[ExplosiveDeployable] //guid=2
|
||||
val player1 = Player(Avatar("TestCharacter1", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=3
|
||||
player1.Spawn
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.NC, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=4
|
||||
player2.Spawn
|
||||
val weapon = Tool(GlobalDefinitions.jammer_grenade) //guid=5
|
||||
guid.register(h_mine, 2)
|
||||
guid.register(player1, 3)
|
||||
guid.register(player2, 4)
|
||||
guid.register(weapon, 5)
|
||||
h_mine.Zone = zone
|
||||
h_mine.Owner = player2
|
||||
h_mine.OwnerName = player2.Name
|
||||
h_mine.Faction = PlanetSideEmpire.NC
|
||||
h_mine.Actor = system.actorOf(Props(classOf[ExplosiveDeployableControl], h_mine), "h-mine-control")
|
||||
|
||||
val hMineSource = SourceEntry(h_mine)
|
||||
val pSource = PlayerSource(player1)
|
||||
val projectile = weapon.Projectile
|
||||
val resolved = ResolvedProjectile(
|
||||
ProjectileResolution.Splash,
|
||||
Projectile(projectile, weapon.Definition, weapon.FireMode, pSource, 0, Vector3.Zero, Vector3.Zero),
|
||||
hMineSource,
|
||||
h_mine.DamageModel,
|
||||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageToH = resolved.damage_model.Calculate(resolved)
|
||||
|
||||
"ExplosiveDeployable" should {
|
||||
"handle being jammered appropriately (detonation)" in {
|
||||
assert(!h_mine.Destroyed)
|
||||
|
||||
h_mine.Actor ! Vitality.Damage(applyDamageToH)
|
||||
val msg_local = localProbe.receiveN(5, 200 milliseconds)
|
||||
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
||||
val msg_activity = activityProbe.receiveOne(200 milliseconds)
|
||||
assert(
|
||||
msg_local.head match {
|
||||
case LocalServiceMessage("test", LocalAction.Detonate(PlanetSideGUID(2), target)) => target eq h_mine
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(1) match {
|
||||
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq h_mine
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(2) match {
|
||||
case LocalServiceMessage("NC", LocalAction.DeployableMapIcon(
|
||||
PlanetSideGUID(0),
|
||||
DeploymentAction.Dismiss,
|
||||
DeployableInfo(PlanetSideGUID(2), DeployableIcon.HEMine, _, PlanetSideGUID(0))
|
||||
)) => true
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(3) match {
|
||||
case LocalServiceMessage.Deployables(SupportActor.ClearSpecific(List(target), _zone)) => (target eq h_mine) && (_zone eq zone)
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(4) match {
|
||||
case LocalServiceMessage.Deployables(RemoverActor.AddTask(target, _zone, _)) => (target eq h_mine) && (_zone eq zone)
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_avatar match {
|
||||
case AvatarServiceMessage("test", AvatarAction.Destroy(PlanetSideGUID(2), _, Service.defaultPlayerGUID, _)) => true
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_activity match {
|
||||
case Zone.HotSpot.Activity(target, attacker, _) => (target eq hMineSource) && (attacker eq pSource)
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(h_mine.Destroyed)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class ExplosiveDeployableDestructionTest extends ActorTest {
|
||||
val guid = new NumberPoolHub(new LimitedNumberSource(10))
|
||||
val zone = new Zone("test", new ZoneMap("test"), 0) {
|
||||
override def SetupNumberPools() = {}
|
||||
GUID(guid)
|
||||
}
|
||||
val activityProbe = TestProbe()
|
||||
val avatarProbe = TestProbe()
|
||||
val localProbe = TestProbe()
|
||||
zone.Activity = activityProbe.ref
|
||||
zone.AvatarEvents = avatarProbe.ref
|
||||
zone.LocalEvents = localProbe.ref
|
||||
|
||||
val h_mine = Deployables.Make(DeployedItem.he_mine)().asInstanceOf[ExplosiveDeployable] //guid=2
|
||||
val player1 = Player(Avatar("TestCharacter1", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=3
|
||||
player1.Spawn
|
||||
val player2 = Player(Avatar("TestCharacter2", PlanetSideEmpire.NC, CharacterGender.Male, 0, CharacterVoice.Mute)) //guid=4
|
||||
player2.Spawn
|
||||
val weapon = Tool(GlobalDefinitions.suppressor) //guid=5
|
||||
guid.register(h_mine, 2)
|
||||
guid.register(player1, 3)
|
||||
guid.register(player2, 4)
|
||||
guid.register(weapon, 5)
|
||||
h_mine.Zone = zone
|
||||
h_mine.Owner = player2
|
||||
h_mine.OwnerName = player2.Name
|
||||
h_mine.Faction = PlanetSideEmpire.NC
|
||||
h_mine.Actor = system.actorOf(Props(classOf[ExplosiveDeployableControl], h_mine), "h-mine-control")
|
||||
|
||||
val hMineSource = SourceEntry(h_mine)
|
||||
val pSource = PlayerSource(player1)
|
||||
val projectile = weapon.Projectile
|
||||
val resolved = ResolvedProjectile(
|
||||
ProjectileResolution.Splash,
|
||||
Projectile(projectile, weapon.Definition, weapon.FireMode, pSource, 0, Vector3.Zero, Vector3.Zero),
|
||||
hMineSource,
|
||||
h_mine.DamageModel,
|
||||
Vector3(1, 0, 0)
|
||||
)
|
||||
val applyDamageTo = resolved.damage_model.Calculate(resolved)
|
||||
|
||||
"ExplosiveDeployable" should {
|
||||
"handle being destroyed" in {
|
||||
h_mine.Health = h_mine.Definition.DamageDestroysAt + 1
|
||||
assert(h_mine.Health > h_mine.Definition.DamageDestroysAt)
|
||||
assert(!h_mine.Destroyed)
|
||||
|
||||
h_mine.Actor ! Vitality.Damage(applyDamageTo)
|
||||
val msg_local = localProbe.receiveN(5, 200 milliseconds)
|
||||
val msg_avatar = avatarProbe.receiveOne(200 milliseconds)
|
||||
activityProbe.expectNoMsg(200 milliseconds)
|
||||
assert(
|
||||
msg_local.head match {
|
||||
case LocalServiceMessage("TestCharacter2", LocalAction.AlertDestroyDeployable(PlanetSideGUID(0), target)) => target eq h_mine
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(1) match {
|
||||
case LocalServiceMessage("NC", LocalAction.DeployableMapIcon(
|
||||
PlanetSideGUID(0),
|
||||
DeploymentAction.Dismiss,
|
||||
DeployableInfo(PlanetSideGUID(2), DeployableIcon.HEMine, _, PlanetSideGUID(0))
|
||||
)) => true
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(2) match {
|
||||
case LocalServiceMessage.Deployables(SupportActor.ClearSpecific(List(target), _zone)) => (target eq h_mine) && (_zone eq zone)
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(3) match {
|
||||
case LocalServiceMessage.Deployables(RemoverActor.AddTask(target, _zone, _)) => (target eq h_mine) && (_zone eq zone)
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_local(4) match {
|
||||
case LocalServiceMessage("test", LocalAction.TriggerEffect(_, "detonate_damaged_mine", PlanetSideGUID(2))) => true
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(
|
||||
msg_avatar match {
|
||||
case AvatarServiceMessage("test", AvatarAction.Destroy(PlanetSideGUID(2), _, Service.defaultPlayerGUID, _)) => true
|
||||
case _ => false
|
||||
}
|
||||
)
|
||||
assert(h_mine.Health <= h_mine.Definition.DamageDestroysAt)
|
||||
assert(h_mine.Destroyed)
|
||||
}
|
||||
}
|
||||
}
|
||||
class TurretControlConstructTest extends ActorTest {
|
||||
"TurretControl" should {
|
||||
"construct" in {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue