Merge pull request #684 from Mazo/rexo-battlebus-driver

Allow rexo to mount battlebusses as the driver (fixes #519)
This commit is contained in:
Fate-JH 2021-02-08 10:36:01 -05:00 committed by GitHub
commit 29b56eb8a4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 9 deletions

View file

@ -6042,7 +6042,6 @@ object GlobalDefinitions {
apc_tr.RepairIfDestroyed = false
apc_tr.MaxShields = 1200
apc_tr.Seats += 0 -> new SeatDefinition()
apc_tr.Seats(0).ArmorRestriction = SeatArmorRestriction.NoReinforcedOrMax
apc_tr.Seats += 1 -> new SeatDefinition()
apc_tr.Seats(1).ControlledWeapon = 11
apc_tr.Seats += 2 -> new SeatDefinition()
@ -6106,7 +6105,6 @@ object GlobalDefinitions {
apc_nc.RepairIfDestroyed = false
apc_nc.MaxShields = 1200
apc_nc.Seats += 0 -> new SeatDefinition()
apc_nc.Seats(0).ArmorRestriction = SeatArmorRestriction.NoReinforcedOrMax
apc_nc.Seats += 1 -> new SeatDefinition()
apc_nc.Seats(1).ControlledWeapon = 11
apc_nc.Seats += 2 -> new SeatDefinition()
@ -6170,7 +6168,6 @@ object GlobalDefinitions {
apc_vs.RepairIfDestroyed = false
apc_vs.MaxShields = 1200
apc_vs.Seats += 0 -> new SeatDefinition()
apc_vs.Seats(0).ArmorRestriction = SeatArmorRestriction.NoReinforcedOrMax
apc_vs.Seats += 1 -> new SeatDefinition()
apc_vs.Seats(1).ControlledWeapon = 11
apc_vs.Seats += 2 -> new SeatDefinition()

View file

@ -276,6 +276,9 @@ class VehicleControl(vehicle: Vehicle)
PrepareForDeletion()
context.become(ReadyToDelete)
case VehicleControl.AssignOwnership(player) =>
vehicle.AssignOwnership(player)
case _ => ;
}
@ -860,6 +863,8 @@ object VehicleControl {
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.
* @param now the current time (in nanoseconds)

View file

@ -348,6 +348,11 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
vehicle.GUID = PlanetSideGUID(10)
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)
player1.ExoSuit = ExoSuitType.Reinforced
player1.GUID = PlanetSideGUID(1)
@ -359,9 +364,9 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
player3.GUID = PlanetSideGUID(3)
"Vehicle Control" should {
"block players from sitting if their exo-suit is not allowed by the seat" in {
//disallow
vehicle.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) //Reinforced in non-MAX seat
"block players from sitting if their exo-suit is not allowed by the seat - apc_tr" in {
// disallow
vehicle2.Actor.tell(Mountable.TryMount(player1, 0), probe.ref) // Reinforced in non-reinforced seat
checkCanNotMount()
vehicle.Actor.tell(Mountable.TryMount(player2, 0), probe.ref) //MAX in non-Reinforced seat
checkCanNotMount()
@ -373,11 +378,14 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
checkCanNotMount()
//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()
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()
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()
}
}