mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-14 09:30:34 +00:00
Amend mounting tests
This commit is contained in:
parent
3f1003c51e
commit
b4fb0cf855
2 changed files with 19 additions and 6 deletions
|
|
@ -276,6 +276,9 @@ class VehicleControl(vehicle: Vehicle)
|
||||||
PrepareForDeletion()
|
PrepareForDeletion()
|
||||||
context.become(ReadyToDelete)
|
context.become(ReadyToDelete)
|
||||||
|
|
||||||
|
case VehicleControl.AssignOwnership(player) =>
|
||||||
|
vehicle.AssignOwnership(player)
|
||||||
|
|
||||||
case _ => ;
|
case _ => ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -860,6 +863,8 @@ object VehicleControl {
|
||||||
|
|
||||||
private case class Deletion()
|
private case class Deletion()
|
||||||
|
|
||||||
|
final case class AssignOwnership(player: Option[Player])
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Determine if a given activity entry would invalidate the act of charging vehicle shields this tick.
|
* Determine if a given activity entry would invalidate the act of charging vehicle shields this tick.
|
||||||
* @param now the current time (in nanoseconds)
|
* @param now the current time (in nanoseconds)
|
||||||
|
|
|
||||||
|
|
@ -348,6 +348,11 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
|
||||||
vehicle.GUID = PlanetSideGUID(10)
|
vehicle.GUID = PlanetSideGUID(10)
|
||||||
vehicle.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle), "vehicle-test")
|
vehicle.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle), "vehicle-test")
|
||||||
|
|
||||||
|
val vehicle2 = Vehicle(GlobalDefinitions.lightning)
|
||||||
|
vehicle2.Faction = PlanetSideEmpire.TR
|
||||||
|
vehicle2.GUID = PlanetSideGUID(11)
|
||||||
|
vehicle2.Actor = system.actorOf(Props(classOf[VehicleControl], vehicle2), "vehicle2-test")
|
||||||
|
|
||||||
val player1 = Player(VehicleTest.avatar1)
|
val player1 = Player(VehicleTest.avatar1)
|
||||||
player1.ExoSuit = ExoSuitType.Reinforced
|
player1.ExoSuit = ExoSuitType.Reinforced
|
||||||
player1.GUID = PlanetSideGUID(1)
|
player1.GUID = PlanetSideGUID(1)
|
||||||
|
|
@ -359,9 +364,9 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
|
||||||
player3.GUID = PlanetSideGUID(3)
|
player3.GUID = PlanetSideGUID(3)
|
||||||
|
|
||||||
"Vehicle Control" should {
|
"Vehicle Control" should {
|
||||||
"block players from sitting if their exo-suit is not allowed by the seat" in {
|
"block players from sitting if their exo-suit is not allowed by the seat - apc_tr" in {
|
||||||
//disallow
|
// disallow
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) //Reinforced in non-MAX seat
|
vehicle2.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) // Reinforced in non-reinforced seat
|
||||||
checkCanNotMount()
|
checkCanNotMount()
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player2, 0), probe.ref) //MAX in non-Reinforced seat
|
vehicle.Actor.tell(Mountable.TryMount(player2, 0), probe.ref) //MAX in non-Reinforced seat
|
||||||
checkCanNotMount()
|
checkCanNotMount()
|
||||||
|
|
@ -373,11 +378,14 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
|
||||||
checkCanNotMount()
|
checkCanNotMount()
|
||||||
|
|
||||||
//allow
|
//allow
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player1, 1), probe.ref)
|
vehicle.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) // Reinforced in driver seat allowing all except MAX
|
||||||
checkCanMount()
|
checkCanMount()
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player2, 9), probe.ref)
|
vehicle.Actor.tell(VehicleControl.AssignOwnership(None), probe.ref) // Reset ownership to allow further driver seat mounting tests
|
||||||
|
vehicle.Actor.tell(Mountable.TryMount(player1, 1), probe.ref) // Reinforced in passenger seat allowing all except MAX
|
||||||
checkCanMount()
|
checkCanMount()
|
||||||
vehicle.Actor.tell(Mountable.TryMount(player3, 0), probe.ref)
|
vehicle.Actor.tell(Mountable.TryMount(player2, 9), probe.ref) // MAX in MAX-only seat
|
||||||
|
checkCanMount()
|
||||||
|
vehicle.Actor.tell(Mountable.TryMount(player3, 0), probe.ref) // Agile in driver seat allowing all except MAX
|
||||||
checkCanMount()
|
checkCanMount()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue