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:
Fate-JH 2020-04-14 15:17:32 -04:00 committed by GitHub
parent 840006dca8
commit c2f6baf551
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
124 changed files with 8530 additions and 2503 deletions

View file

@ -5,8 +5,10 @@ import akka.actor.{Actor, ActorRef, Props}
import base.ActorTest
import net.psforever.objects._
import net.psforever.objects.serverobject.terminals.Terminal
import net.psforever.objects.serverobject.tube.SpawnTube
import net.psforever.objects.vehicles._
import net.psforever.types.PlanetSideGUID
import net.psforever.packet.game.ItemTransactionMessage
import net.psforever.types._
import org.specs2.mutable._
import scala.concurrent.duration.Duration
@ -38,7 +40,6 @@ class UtilityTest extends Specification {
}
"create an ams_respawn_tube object" in {
import net.psforever.objects.serverobject.tube.SpawnTube
val obj = Utility(UtilityType.ams_respawn_tube, UtilityTest.vehicle)
obj.UtilType mustEqual UtilityType.ams_respawn_tube
obj().isInstanceOf[SpawnTube] mustEqual true
@ -54,17 +55,18 @@ class UtilityTest extends Specification {
obj().asInstanceOf[Terminal].Actor mustEqual ActorRef.noSender
}
"teleportpad_terminal produces a telepad object (router_telepad)" in {
import net.psforever.packet.game.ItemTransactionMessage
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, TransactionType}
"produce a telepad object through the teleportpad_terminal" in {
val veh = Vehicle(GlobalDefinitions.quadstealth)
veh.Faction = PlanetSideEmpire.TR
val obj = Utility(UtilityType.teleportpad_terminal, UtilityTest.vehicle)
val player = Player(Avatar("TestCharacter", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
veh.GUID = PlanetSideGUID(101)
obj().Owner = veh //hack
obj().GUID = PlanetSideGUID(1)
player.GUID = PlanetSideGUID(2)
val msg = obj().asInstanceOf[Terminal].Request(
Player(Avatar("TestCharacter", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)),
player,
ItemTransactionMessage(PlanetSideGUID(853), TransactionType.Buy, 0, "router_telepad", 0, PlanetSideGUID(0))
)
msg.isInstanceOf[Terminal.BuyEquipment] mustEqual true
@ -83,13 +85,13 @@ class UtilityTest extends Specification {
val obj = Utility(UtilityType.internal_router_telepad_deployable, UtilityTest.vehicle)
val inpad = obj().asInstanceOf[Utility.InternalTelepad]
inpad.Telepad mustEqual None
inpad.Telepad.isEmpty mustEqual true
inpad.Telepad = PlanetSideGUID(5)
inpad.Telepad mustEqual Some(PlanetSideGUID(5))
inpad.Telepad.contains(PlanetSideGUID(5)) mustEqual true
inpad.Telepad = PlanetSideGUID(6)
inpad.Telepad mustEqual Some(PlanetSideGUID(6))
inpad.Telepad.contains(PlanetSideGUID(6)) mustEqual true
inpad.Telepad = None
inpad.Telepad mustEqual None
inpad.Telepad.isEmpty mustEqual true
}
"be located with their owner (terminal)" in {
@ -98,7 +100,6 @@ class UtilityTest extends Specification {
obj().Position mustEqual veh.Position
obj().Orientation mustEqual veh.Orientation
import net.psforever.types.Vector3
veh.Position = Vector3(1, 2, 3)
veh.Orientation = Vector3(4, 5, 6)
obj().Position mustEqual veh.Position
@ -111,7 +112,6 @@ class UtilityTest extends Specification {
obj().Position mustEqual veh.Position
obj().Orientation mustEqual veh.Orientation
import net.psforever.types.Vector3
veh.Position = Vector3(1, 2, 3)
veh.Orientation = Vector3(4, 5, 6)
obj().Position mustEqual veh.Position
@ -124,13 +124,12 @@ class UtilityTest extends Specification {
obj().Position mustEqual veh.Position
obj().Orientation mustEqual veh.Orientation
import net.psforever.types.Vector3
veh.Position = Vector3(1, 2, 3)
veh.Orientation = Vector3(4, 5, 6)
veh.GUID = PlanetSideGUID(101)
obj().Position mustEqual veh.Position
obj().Orientation mustEqual veh.Orientation
obj().asInstanceOf[Utility.InternalTelepad].Router mustEqual Some(veh.GUID)
obj().asInstanceOf[Utility.InternalTelepad].Router.contains(veh.GUID) mustEqual true
}
}
}