mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-03-17 02:50:36 +00:00
ObjectCreateMessage Alterations, Class Object Adjustments (#243)
* power outage failure resulting in the destruction of the original ocm-fixes branch; the git branch refs were corrupted during commit, but the up-to-date changed files remained intact * eliminating the need for CommonFieldData2 and CommonFieldData2WithPlacement * in the middle of integrating CommonFieldData into DetailedLockerContainerData (but not standard LockerContainerData); added field for final boolean in WeaponData * adding faction affinity to Equipment (to match functionality; not becuase I know what ends ...) * in the middle of integrating CommonFieldData into DetailedCommandDetonaterData * applying faction affinity to objects at time of terminal production (but to what ends?); required BoomerTrigger and AmmoBox to always report as NEUTRAL internally * completed the transition from using the old class-based order terminal system to the page-based order terminal system; unused terminal classes have been eliminated * more closely aligned TelepadDeployableData and InternalTelepadDeployableData * modifying TelepadDeployableData make it generic and eliminate the need for InternalTelepadDeployableData after fixing a packet converter to utilize DroppedItemData * modified Terminal operation to branch further outwards from Terminal.Request to the TerminalDefinition's Request method; modified tests to reflect update * loosening up matrix terminal definition limitations * modified ProximityTerminal to support a custom defintition class * rendered the message passing system for Terminals general (Any) in the full scale so it can be specific in instance cases * refactored and moved both EquipmentSlot and ExoSuitDefinition * (re)load Favorites each time player (re)spawns
This commit is contained in:
parent
5fc9e191fe
commit
337cfbe5d2
174 changed files with 6281 additions and 5477 deletions
|
|
@ -1,48 +0,0 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, TransactionType}
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class AirVehicleTerminalTest extends Specification {
|
||||
"Air_Vehicle_Terminal" should {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val terminal = Terminal(GlobalDefinitions.air_vehicle_terminal)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
val terminal = Terminal(GlobalDefinitions.air_vehicle_terminal)
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can buy a reaver ('lightgunship')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "lightgunship", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyVehicle] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyVehicle]
|
||||
reply2.vehicle.Definition mustEqual GlobalDefinitions.lightgunship
|
||||
reply2.weapons mustEqual Nil
|
||||
reply2.inventory.length mustEqual 6
|
||||
reply2.inventory.head.obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(1).obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(2).obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(3).obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(4).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(5).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
}
|
||||
|
||||
"player can not buy a fake vehicle ('reaver')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "reaver", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types._
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class CertTerminalTest extends Specification {
|
||||
"Cert_Terminal" should {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val terminal = Terminal(GlobalDefinitions.cert_terminal)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
val terminal = Terminal(GlobalDefinitions.cert_terminal)
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can learn a certification ('medium_assault')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Learn, 0, "medium_assault", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) mustEqual Terminal.LearnCertification(CertificationType.MediumAssault)
|
||||
}
|
||||
|
||||
"player can not learn a fake certification ('juggling')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Learn, 0, "juggling", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
|
||||
"player can forget a certification ('medium_assault')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "medium_assault", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.SellCertification(CertificationType.MediumAssault)
|
||||
}
|
||||
|
||||
"player can not forget a fake certification ('juggling')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "juggling", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,54 +0,0 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, TransactionType}
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class DropshipVehicleTerminalTest extends Specification {
|
||||
"Dropship_Vehicle_Terminal" should {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val terminal = Terminal(GlobalDefinitions.dropship_vehicle_terminal)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
val terminal = Terminal(GlobalDefinitions.dropship_vehicle_terminal)
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can buy a galaxy ('dropship')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "dropship", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyVehicle] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyVehicle]
|
||||
reply2.vehicle.Definition mustEqual GlobalDefinitions.dropship
|
||||
reply2.weapons mustEqual Nil
|
||||
reply2.inventory.length mustEqual 12
|
||||
reply2.inventory.head.obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(1).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(2).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(3).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(4).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(5).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(6).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(7).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(8).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(9).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(10).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(11).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
}
|
||||
|
||||
"player can not buy a fake vehicle ('galaxy')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "galaxy", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,48 +0,0 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, TransactionType}
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class GroundVehicleTerminalTest extends Specification {
|
||||
"Ground_Vehicle_Terminal" should {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val terminal = Terminal(GlobalDefinitions.ground_vehicle_terminal)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
val terminal = Terminal(GlobalDefinitions.ground_vehicle_terminal)
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can buy a harasser ('two_man_assault_buggy')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "two_man_assault_buggy", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyVehicle] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyVehicle]
|
||||
reply2.vehicle.Definition mustEqual GlobalDefinitions.two_man_assault_buggy
|
||||
reply2.weapons mustEqual Nil
|
||||
reply2.inventory.length mustEqual 6
|
||||
reply2.inventory.head.obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(1).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(2).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(3).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(4).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(5).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
}
|
||||
|
||||
"player can not buy a fake vehicle ('harasser')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "harasser", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,56 +0,0 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, TransactionType}
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class ImplantTerminalInterfaceTest extends Specification {
|
||||
"Implant_Terminal_Interface" should {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val terminal = Terminal(GlobalDefinitions.implant_terminal_interface)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
val terminal = Terminal(GlobalDefinitions.implant_terminal_interface)
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can learn an implant ('darklight_vision')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "darklight_vision", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.LearnImplant] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.LearnImplant]
|
||||
reply2.implant mustEqual GlobalDefinitions.darklight_vision
|
||||
}
|
||||
|
||||
"player can not learn a fake implant ('aimbot')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "aimbot", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
|
||||
"player can surrender an implant ('darklight_vision')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "darklight_vision", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.SellImplant] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.SellImplant]
|
||||
reply2.implant mustEqual GlobalDefinitions.darklight_vision
|
||||
}
|
||||
|
||||
"player can not surrender a fake implant ('aimbot')" in {
|
||||
val terminal = Terminal(GlobalDefinitions.implant_terminal_interface)
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "aimbot", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -28,7 +28,7 @@ class ImplantTerminalMechTest extends Specification {
|
|||
}
|
||||
}
|
||||
|
||||
"VehicleSpawnPad" should {
|
||||
"Implant_Terminal_Mech" should {
|
||||
"construct" in {
|
||||
val obj = ImplantTerminalMech(GlobalDefinitions.implant_terminal_mech)
|
||||
obj.Actor mustEqual ActorRef.noSender
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.terminals.{MatrixTerminalDefinition, Terminal}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player, Vehicle}
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
|
|
@ -10,59 +9,22 @@ import org.specs2.mutable.Specification
|
|||
|
||||
class MatrixTerminalTest extends Specification {
|
||||
"MatrixTerminal" should {
|
||||
"define (a)" in {
|
||||
"define" in {
|
||||
val a = new MatrixTerminalDefinition(517)
|
||||
a.ObjectId mustEqual 517
|
||||
a.Name mustEqual "matrix_terminala"
|
||||
}
|
||||
|
||||
"define (b)" in {
|
||||
val b = new MatrixTerminalDefinition(518)
|
||||
b.ObjectId mustEqual 518
|
||||
b.Name mustEqual "matrix_terminalb"
|
||||
"creation" in {
|
||||
Terminal(new MatrixTerminalDefinition(518))
|
||||
ok
|
||||
}
|
||||
|
||||
"define (c)" in {
|
||||
val b = new MatrixTerminalDefinition(519)
|
||||
b.ObjectId mustEqual 519
|
||||
b.Name mustEqual "matrix_terminalc"
|
||||
}
|
||||
|
||||
"define (d)" in {
|
||||
val b = new MatrixTerminalDefinition(812)
|
||||
b.ObjectId mustEqual 812
|
||||
b.Name mustEqual "spawn_terminal"
|
||||
}
|
||||
|
||||
"define (invalid)" in {
|
||||
var id : Int = (math.random * Int.MaxValue).toInt
|
||||
if(id == 517) {
|
||||
id += 3
|
||||
}
|
||||
else if(id == 518) {
|
||||
id += 2
|
||||
}
|
||||
else if(id == 519 | id == 812) {
|
||||
id += 1
|
||||
}
|
||||
|
||||
new MatrixTerminalDefinition(id) must throwA[IllegalArgumentException]
|
||||
}
|
||||
}
|
||||
|
||||
"Matrix_Terminal" should {
|
||||
val terminal = Terminal(GlobalDefinitions.matrix_terminalc)
|
||||
terminal.Owner = Vehicle(GlobalDefinitions.quadstealth)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can not buy (anything)" in {
|
||||
"invalid message" in {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "lite_armor", 0, PlanetSideGUID(0))
|
||||
|
||||
val terminal = Terminal(new MatrixTerminalDefinition(519))
|
||||
terminal.Owner = Vehicle(GlobalDefinitions.quadstealth)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,78 +0,0 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.serverobject.terminals.{OrderTerminalABDefinition, Terminal}
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types._
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class OrderTerminalABTest extends Specification {
|
||||
"OrderTerminalAB" should {
|
||||
"define (a)" in {
|
||||
val a = new OrderTerminalABDefinition(613)
|
||||
a.ObjectId mustEqual 613
|
||||
a.Name mustEqual "order_terminala"
|
||||
}
|
||||
|
||||
"define (b)" in {
|
||||
val b = new OrderTerminalABDefinition(614)
|
||||
b.ObjectId mustEqual 614
|
||||
b.Name mustEqual "order_terminalb"
|
||||
}
|
||||
|
||||
"define (invalid)" in {
|
||||
var id : Int = (math.random * Int.MaxValue).toInt
|
||||
if(id == 613) {
|
||||
id += 2
|
||||
}
|
||||
else if(id == 614) {
|
||||
id += 1
|
||||
}
|
||||
|
||||
new OrderTerminalABDefinition(id) must throwA[IllegalArgumentException]
|
||||
}
|
||||
}
|
||||
|
||||
"Order_Terminal" should {
|
||||
val terminal = Terminal(GlobalDefinitions.order_terminala)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can buy different armor ('lite_armor')" in {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "lite_armor", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.BuyExosuit(ExoSuitType.Agile)
|
||||
}
|
||||
|
||||
"player can buy max armor ('trhev_antiaircraft')" in {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "trhev_antiaircraft", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
//TODO loudout tests
|
||||
|
||||
"player can not load max loadout" in {
|
||||
val avatar = Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)
|
||||
val player = Player(avatar)
|
||||
avatar.SaveLoadout(player, "test1", 0)
|
||||
player.ExoSuit = ExoSuitType.MAX
|
||||
avatar.SaveLoadout(player, "test2", 1)
|
||||
|
||||
val msg1 = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Loadout, 4, "", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg1) mustEqual Terminal.InfantryLoadout(ExoSuitType.Standard, 0, Nil, Nil)
|
||||
|
||||
val msg2 = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Loadout, 4, "", 1, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg2) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,92 +1,95 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.objects.{AmmoBox, Avatar, GlobalDefinitions, Player, Tool}
|
||||
import net.psforever.objects._
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types._
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class OrderTerminalTest extends Specification {
|
||||
"Order_Terminal" should {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val terminal = Terminal(GlobalDefinitions.order_terminal)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
val avatar = Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)
|
||||
val player = Player(avatar)
|
||||
|
||||
"construct" in {
|
||||
val terminal = Terminal(GlobalDefinitions.order_terminal)
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
val building = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
building.Faction = PlanetSideEmpire.TR
|
||||
val infantryTerminal = Terminal(GlobalDefinitions.order_terminal)
|
||||
infantryTerminal.Owner = building
|
||||
|
||||
"General terminal behavior" should {
|
||||
"player can not buy equipment from the wrong page ('9mmbullet_AP', page 10)" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "9mmbullet_AP", 0, PlanetSideGUID(0))
|
||||
|
||||
infantryTerminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
|
||||
"Infantry Order Terminal" should {
|
||||
"player can buy a box of ammunition ('9mmbullet_AP')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "9mmbullet_AP", 0, PlanetSideGUID(0))
|
||||
val reply = terminal.Request(player, msg)
|
||||
val reply = infantryTerminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyEquipment] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyEquipment]
|
||||
reply2.item.isInstanceOf[AmmoBox] mustEqual true
|
||||
reply2.item.asInstanceOf[AmmoBox].Definition mustEqual GlobalDefinitions.bullet_9mm_AP
|
||||
reply2.item.asInstanceOf[AmmoBox].Capacity mustEqual 50
|
||||
}
|
||||
|
||||
"player can buy a weapon ('suppressor')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "suppressor", 0, PlanetSideGUID(0))
|
||||
val reply = terminal.Request(player, msg)
|
||||
val reply = infantryTerminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyEquipment] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyEquipment]
|
||||
reply2.item.isInstanceOf[Tool] mustEqual true
|
||||
reply2.item.asInstanceOf[Tool].Definition mustEqual GlobalDefinitions.suppressor
|
||||
}
|
||||
|
||||
"player can buy a box of vehicle ammunition ('105mmbullet')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 3, "105mmbullet", 0, PlanetSideGUID(0))
|
||||
val reply = terminal.Request(player, msg)
|
||||
"player can buy different armor ('lite_armor')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "lite_armor", 0, PlanetSideGUID(0))
|
||||
|
||||
infantryTerminal.Request(player, msg) mustEqual Terminal.BuyExosuit(ExoSuitType.Agile)
|
||||
}
|
||||
|
||||
"player can buy a box of ammunition belonging to a special armor type ('dualcycler_ammo')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "dualcycler_ammo", 0, PlanetSideGUID(0))
|
||||
val reply = infantryTerminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyEquipment] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyEquipment]
|
||||
reply2.item.isInstanceOf[AmmoBox] mustEqual true
|
||||
reply2.item.asInstanceOf[AmmoBox].Definition mustEqual GlobalDefinitions.bullet_105mm
|
||||
reply2.item.asInstanceOf[AmmoBox].Capacity mustEqual 100
|
||||
reply2.item.asInstanceOf[AmmoBox].Definition mustEqual GlobalDefinitions.dualcycler_ammo
|
||||
}
|
||||
|
||||
"player can buy a support tool ('bank')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 2, "bank", 0, PlanetSideGUID(0))
|
||||
val reply = terminal.Request(player, msg)
|
||||
val reply = infantryTerminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyEquipment] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyEquipment]
|
||||
reply2.item.isInstanceOf[Tool] mustEqual true
|
||||
reply2.item.asInstanceOf[Tool].Definition mustEqual GlobalDefinitions.bank
|
||||
}
|
||||
|
||||
"player can buy different armor ('lite_armor')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "lite_armor", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.BuyExosuit(ExoSuitType.Agile)
|
||||
"player can buy a box of vehicle ammunition ('105mmbullet')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 3, "105mmbullet", 0, PlanetSideGUID(0))
|
||||
val reply = infantryTerminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyEquipment] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyEquipment]
|
||||
reply2.item.isInstanceOf[AmmoBox] mustEqual true
|
||||
reply2.item.asInstanceOf[AmmoBox].Definition mustEqual GlobalDefinitions.bullet_105mm
|
||||
}
|
||||
|
||||
"player can not buy fake equipment ('sabot')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "sabot", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
|
||||
"player can not buy equipment from the wrong page ('9mmbullet_AP', page 1)" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 1, "9mmbullet_AP", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
infantryTerminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
|
||||
"player can retrieve an infantry loadout" in {
|
||||
val avatar = Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)
|
||||
val player2 = Player(avatar)
|
||||
player2.ExoSuit = ExoSuitType.Agile
|
||||
player2.Slot(0).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
player2.Slot(6).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
avatar.SaveLoadout(player2, "test", 0)
|
||||
player.ExoSuit = ExoSuitType.Agile
|
||||
player.Slot(0).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
player.Slot(6).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
avatar.SaveLoadout(player, "test", 0)
|
||||
|
||||
val msg = terminal.Request(player2, ItemTransactionMessage(PlanetSideGUID(10), TransactionType.Loadout, 4, "", 0, PlanetSideGUID(0)))
|
||||
val msg = infantryTerminal.Request(player, ItemTransactionMessage(PlanetSideGUID(10), TransactionType.Loadout, 4, "", 0, PlanetSideGUID(0)))
|
||||
msg.isInstanceOf[Terminal.InfantryLoadout] mustEqual true
|
||||
val loadout = msg.asInstanceOf[Terminal.InfantryLoadout]
|
||||
loadout.exosuit mustEqual ExoSuitType.Agile
|
||||
|
|
@ -98,28 +101,120 @@ class OrderTerminalTest extends Specification {
|
|||
loadout.inventory.head.start mustEqual 6
|
||||
}
|
||||
|
||||
"player can not retrieve an infantry loadout from the wrong page" in {
|
||||
val avatar = Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)
|
||||
val player2 = Player(avatar)
|
||||
player2.ExoSuit = ExoSuitType.Agile
|
||||
player2.Slot(0).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
player2.Slot(6).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
avatar.SaveLoadout(player2, "test", 0)
|
||||
|
||||
val msg = terminal.Request(player2, ItemTransactionMessage(PlanetSideGUID(10), TransactionType.Loadout, 3, "", 0, PlanetSideGUID(0))) //page 3
|
||||
msg.isInstanceOf[Terminal.NoDeal] mustEqual true
|
||||
}
|
||||
|
||||
"player can not retrieve an infantry loadout from the wrong line" in {
|
||||
val avatar = Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute)
|
||||
val player2 = Player(avatar)
|
||||
player2.ExoSuit = ExoSuitType.Agile
|
||||
player2.Slot(0).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
player2.Slot(6).Equipment = Tool(GlobalDefinitions.beamer)
|
||||
avatar.SaveLoadout(player2, "test", 0)
|
||||
|
||||
val msg = terminal.Request(player2, ItemTransactionMessage(PlanetSideGUID(10), TransactionType.Loadout, 4, "", 1, PlanetSideGUID(0)))
|
||||
val msg = infantryTerminal.Request(player, ItemTransactionMessage(PlanetSideGUID(10), TransactionType.Loadout, 4, "", 1, PlanetSideGUID(0)))
|
||||
msg.isInstanceOf[Terminal.NoDeal] mustEqual true
|
||||
}
|
||||
}
|
||||
|
||||
"Vehicle Terminal" should {
|
||||
val terminal = Terminal(GlobalDefinitions.ground_vehicle_terminal)
|
||||
terminal.Owner = building
|
||||
|
||||
"player can spawn a vehicle and its default trunk contents" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 46769, "quadassault", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) match {
|
||||
case Terminal.BuyVehicle(vehicle, weapons, trunk) =>
|
||||
vehicle.Definition mustEqual GlobalDefinitions.quadassault
|
||||
|
||||
weapons.size mustEqual 0 //note: vehicles never have custom weapons using the default loadout
|
||||
|
||||
trunk.size mustEqual 4
|
||||
trunk.head.obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
trunk(1).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
trunk(2).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
trunk(3).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"player can not spawn a fake vehicle ('harasser')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 46769, "harasser", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
|
||||
"player can retrieve a vehicle loadout" in {
|
||||
val fury = Vehicle(GlobalDefinitions.fury)
|
||||
fury.Slot(30).Equipment = AmmoBox(GlobalDefinitions.hellfire_ammo)
|
||||
avatar.SaveLoadout(fury, "test", 10)
|
||||
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Loadout, 4, "test", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) match {
|
||||
case Terminal.VehicleLoadout(definition, weapons, trunk) =>
|
||||
definition mustEqual GlobalDefinitions.fury
|
||||
|
||||
weapons.size mustEqual 1
|
||||
weapons.head.obj.Definition mustEqual GlobalDefinitions.fury_weapon_systema
|
||||
|
||||
trunk.size mustEqual 1
|
||||
trunk.head.obj.Definition mustEqual GlobalDefinitions.hellfire_ammo
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
|
||||
ok
|
||||
}
|
||||
}
|
||||
|
||||
"Certification Terminal" should {
|
||||
val terminal = Terminal(GlobalDefinitions.cert_terminal)
|
||||
terminal.Owner = building
|
||||
|
||||
"player can learn a certification ('medium_assault')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Learn, 0, "medium_assault", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) mustEqual Terminal.LearnCertification(CertificationType.MediumAssault)
|
||||
}
|
||||
|
||||
"player can not learn a fake certification ('juggling')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Learn, 0, "juggling", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
|
||||
"player can forget a certification ('medium_assault')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "medium_assault", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) mustEqual Terminal.SellCertification(CertificationType.MediumAssault)
|
||||
}
|
||||
|
||||
"player can not forget a fake certification ('juggling')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "juggling", 0, PlanetSideGUID(0))
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
|
||||
"Implant_Terminal_Interface" should {
|
||||
val terminal = Terminal(GlobalDefinitions.implant_terminal_interface)
|
||||
terminal.Owner = building
|
||||
|
||||
"player can learn an implant ('darklight_vision')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "darklight_vision", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.LearnImplant] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.LearnImplant]
|
||||
reply2.implant mustEqual GlobalDefinitions.darklight_vision
|
||||
}
|
||||
|
||||
"player can not learn a fake implant ('aimbot')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "aimbot", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
|
||||
"player can un-learn an implant ('darklight_vision')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "darklight_vision", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.SellImplant] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.SellImplant]
|
||||
reply2.implant mustEqual GlobalDefinitions.darklight_vision
|
||||
}
|
||||
|
||||
"player can not un-learn a fake implant ('aimbot')" in {
|
||||
val terminal = Terminal(GlobalDefinitions.implant_terminal_interface)
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Sell, 0, "aimbot", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ class CertTerminalControl3Test extends ActorTest {
|
|||
class VehicleTerminalControl1Test extends ActorTest {
|
||||
"TerminalControl can be used to buy a vehicle ('two_man_assault_buggy')" in {
|
||||
val (player, terminal) = TerminalControlTest.SetUpAgents(GlobalDefinitions.ground_vehicle_terminal, PlanetSideEmpire.TR)
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "two_man_assault_buggy", 0, PlanetSideGUID(0))
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 46769, "two_man_assault_buggy", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Actor ! Terminal.Request(player, msg)
|
||||
val reply = receiveOne(Duration.create(500, "ms"))
|
||||
|
|
|
|||
|
|
@ -1,65 +0,0 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package objects.terminal
|
||||
|
||||
import akka.actor.ActorRef
|
||||
import net.psforever.objects.serverobject.structures.{Building, StructureType}
|
||||
import net.psforever.objects.{Avatar, GlobalDefinitions, Player}
|
||||
import net.psforever.objects.serverobject.terminals.Terminal
|
||||
import net.psforever.objects.zones.Zone
|
||||
import net.psforever.packet.game.{ItemTransactionMessage, PlanetSideGUID}
|
||||
import net.psforever.types.{CharacterGender, CharacterVoice, PlanetSideEmpire, TransactionType}
|
||||
import org.specs2.mutable.Specification
|
||||
|
||||
class VehicleTerminalCombinedTest extends Specification {
|
||||
"Ground_Vehicle_Terminal" should {
|
||||
val player = Player(Avatar("test", PlanetSideEmpire.TR, CharacterGender.Male, 0, CharacterVoice.Mute))
|
||||
val terminal = Terminal(GlobalDefinitions.vehicle_terminal_combined)
|
||||
terminal.Owner = new Building(0, Zone.Nowhere, StructureType.Building)
|
||||
terminal.Owner.Faction = PlanetSideEmpire.TR
|
||||
|
||||
"construct" in {
|
||||
val terminal = Terminal(GlobalDefinitions.vehicle_terminal_combined)
|
||||
terminal.Actor mustEqual ActorRef.noSender
|
||||
}
|
||||
|
||||
"player can buy a ground vehicle, the harasser ('two_man_assault_buggy')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "two_man_assault_buggy", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyVehicle] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyVehicle]
|
||||
reply2.vehicle.Definition mustEqual GlobalDefinitions.two_man_assault_buggy
|
||||
reply2.weapons mustEqual Nil
|
||||
reply2.inventory.length mustEqual 6
|
||||
reply2.inventory.head.obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(1).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(2).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(3).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(4).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
reply2.inventory(5).obj.Definition mustEqual GlobalDefinitions.bullet_12mm
|
||||
}
|
||||
|
||||
"player can buy a flying vehicle, the reaver ('lightgunship')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "lightgunship", 0, PlanetSideGUID(0))
|
||||
|
||||
val reply = terminal.Request(player, msg)
|
||||
reply.isInstanceOf[Terminal.BuyVehicle] mustEqual true
|
||||
val reply2 = reply.asInstanceOf[Terminal.BuyVehicle]
|
||||
reply2.vehicle.Definition mustEqual GlobalDefinitions.lightgunship
|
||||
reply2.weapons mustEqual Nil
|
||||
reply2.inventory.length mustEqual 6
|
||||
reply2.inventory.head.obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(1).obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(2).obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(3).obj.Definition mustEqual GlobalDefinitions.reaver_rocket
|
||||
reply2.inventory(4).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
reply2.inventory(5).obj.Definition mustEqual GlobalDefinitions.bullet_20mm
|
||||
}
|
||||
|
||||
"player can not buy a fake vehicle ('harasser')" in {
|
||||
val msg = ItemTransactionMessage(PlanetSideGUID(1), TransactionType.Buy, 0, "harasser", 0, PlanetSideGUID(0))
|
||||
|
||||
terminal.Request(player, msg) mustEqual Terminal.NoDeal()
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue