importing controlled implementation changes from original exp-for-kda branch; assist kill experience rewarded

importing controlled implementation changes from original exp-for-kda branch; code for contributions from prior activity, but will be adjusting to new contribution methods

kill contributions should work; even if they don't, need to put this away for now

extensivwe changes to the way OwnableByPlayer manages owner user information due to uniqueness, that changes a lot of vehicle and deployable code; fleshing out experience calculation procedure for future testing

events for mounting and dismounting of both passenger and cargo; id'ing the installation of an amenity (vehicle or facility); separation of kill/assist experience and support experience calculations; retention of kill record which allows for the calculation of menace

support experience accumulates and is given to the user in gradual provisions

rewarding facility capture through cep; not fully tested yet; math sucks

sort of cep to bep consditions for squad facility capture; bep deposit for ntu silo activity

early reivision for v010; recording ongoing shots fired and landed

restored bep from ntu deposits into resource silos; updating statistics in the database regarding kills and related stats including weapons; updated history management; basic experience calculation changes

all rewarded support events are accounted for

command experience calculations upon facility capture or resecure

corrected database migrations

most of the code for the play or progress system

statistics window updates for exosuits to report kills; killing an llu runner gives cep; moving play or progress functionality to a bang command rather than piggybacking setbr; bep is no longer too high by error
This commit is contained in:
Fate-JH 2023-03-25 23:29:03 -04:00
parent b866aa8a30
commit e9dbd5f259
112 changed files with 5849 additions and 1361 deletions

View file

@ -30,7 +30,7 @@ class AvatarStatisticsMessageTest extends Specification {
PacketCoding.decodePacket(string_complex).require match {
case AvatarStatisticsMessage(stat) =>
stat match {
case InitStatistic(a, b, c) =>
case CampaignStatistic(a, b, c) =>
a mustEqual StatisticalCategory.Destroyed
b mustEqual StatisticalElement.Mosquito
c mustEqual List(1, 6, 0, 1, 1, 2, 0, 0)
@ -51,7 +51,7 @@ class AvatarStatisticsMessageTest extends Specification {
"encode (complex)" in {
val msg = AvatarStatisticsMessage(
InitStatistic(StatisticalCategory.Destroyed, StatisticalElement.Mosquito, List[Long](1, 6, 0, 1, 1, 2, 0, 0))
CampaignStatistic(StatisticalCategory.Destroyed, StatisticalElement.Mosquito, List[Long](1, 6, 0, 1, 1, 2, 0, 0))
)
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
@ -60,7 +60,7 @@ class AvatarStatisticsMessageTest extends Specification {
"encode (failure; complex; wrong number of list entries)" in {
val msg = AvatarStatisticsMessage(
InitStatistic(StatisticalCategory.Destroyed, StatisticalElement.Mosquito, List[Long](1, 6, 0, 1))
CampaignStatistic(StatisticalCategory.Destroyed, StatisticalElement.Mosquito, List[Long](1, 6, 0, 1))
)
PacketCoding.encodePacket(msg).isFailure mustEqual true
}

View file

@ -564,7 +564,7 @@ class ConverterTest extends Specification {
obj.Faction = PlanetSideEmpire.TR
obj.GUID = PlanetSideGUID(90)
obj.Router = PlanetSideGUID(1001)
obj.Owner = PlanetSideGUID(5001)
obj.OwnerGuid = PlanetSideGUID(5001)
obj.Health = 1
obj.Definition.Packet.ConstructorData(obj) match {
case Success(pkt) =>
@ -596,7 +596,7 @@ class ConverterTest extends Specification {
obj.Faction = PlanetSideEmpire.TR
obj.GUID = PlanetSideGUID(90)
obj.Router = PlanetSideGUID(1001)
obj.Owner = PlanetSideGUID(5001)
obj.OwnerGuid = PlanetSideGUID(5001)
obj.Health = 0
obj.Definition.Packet.ConstructorData(obj) match {
case Success(pkt) =>
@ -628,7 +628,7 @@ class ConverterTest extends Specification {
obj.Faction = PlanetSideEmpire.TR
obj.GUID = PlanetSideGUID(90)
//obj.Router = PlanetSideGUID(1001)
obj.Owner = PlanetSideGUID(5001)
obj.OwnerGuid = PlanetSideGUID(5001)
obj.Health = 1
obj.Definition.Packet.ConstructorData(obj).isFailure mustEqual true
@ -641,7 +641,7 @@ class ConverterTest extends Specification {
obj.Faction = PlanetSideEmpire.TR
obj.GUID = PlanetSideGUID(90)
obj.Router = PlanetSideGUID(1001)
obj.Owner = PlanetSideGUID(5001)
obj.OwnerGuid = PlanetSideGUID(5001)
obj.Health = 1
obj.Definition.Packet.DetailedConstructorData(obj).isFailure mustEqual true
}

View file

@ -34,16 +34,17 @@ class DeployableTest extends Specification {
"Deployable" should {
"know its owner by GUID" in {
val obj = new ExplosiveDeployable(GlobalDefinitions.he_mine)
obj.Owner.isEmpty mustEqual true
obj.Owner = PlanetSideGUID(10)
obj.Owner.contains(PlanetSideGUID(10)) mustEqual true
obj.OwnerGuid.isEmpty mustEqual true
obj.OwnerGuid = PlanetSideGUID(10)
obj.OwnerGuid.contains(PlanetSideGUID(10)) mustEqual true
}
"know its owner by GUID" in {
val obj = new ExplosiveDeployable(GlobalDefinitions.he_mine)
obj.OwnerName.isEmpty mustEqual true
obj.OwnerName = "TestCharacter"
obj.OwnerName.contains("TestCharacter") mustEqual true
// val obj = new ExplosiveDeployable(GlobalDefinitions.he_mine)
// obj.OwnerName.isEmpty mustEqual true
// obj.OwnerName = "TestCharacter"
// obj.OwnerName.contains("TestCharacter") mustEqual true
ko
}
"know its faction allegiance" in {
@ -339,8 +340,8 @@ class ExplosiveDeployableJammerTest extends ActorTest {
guid.register(player2, 4)
guid.register(weapon, 5)
j_mine.Zone = zone
j_mine.Owner = player2
j_mine.OwnerName = player2.Name
j_mine.OwnerGuid = player2
//j_mine.OwnerName = player2.Name
j_mine.Faction = PlanetSideEmpire.NC
j_mine.Actor = system.actorOf(Props(classOf[MineDeployableControl], j_mine), "j-mine-control")
@ -422,8 +423,8 @@ class ExplosiveDeployableJammerExplodeTest extends ActorTest {
guid.register(player2, 4)
guid.register(weapon, 5)
h_mine.Zone = zone
h_mine.Owner = player2
h_mine.OwnerName = player2.Name
h_mine.OwnerGuid = player2
//h_mine.OwnerName = player2.Name
h_mine.Faction = PlanetSideEmpire.NC
h_mine.Actor = system.actorOf(Props(classOf[MineDeployableControl], h_mine), "h-mine-control")
zone.blockMap.addTo(player1)
@ -528,8 +529,8 @@ class ExplosiveDeployableDestructionTest extends ActorTest {
guid.register(player2, 4)
guid.register(weapon, 5)
h_mine.Zone = zone
h_mine.Owner = player2
h_mine.OwnerName = player2.Name
h_mine.OwnerGuid = player2
//h_mine.OwnerName = player2.Name
h_mine.Faction = PlanetSideEmpire.NC
h_mine.Actor = system.actorOf(Props(classOf[MineDeployableControl], h_mine), "h-mine-control")

View file

@ -624,7 +624,7 @@ class PlayerControlDeathStandingTest extends ActorTest {
// override def AvatarEvents = avatarProbe.ref
// override def Activity = activityProbe.ref
// }
// zone.actor = system.spawn(ZoneActor(zone), s"test-zone-${System.nanoTime()}")
// zone.actor = system.spawn(ZoneActor(zone), s"test-zone-${System.currentTimeMillis()}")
//
// player1.Zone = zone
// player1.Spawn()

View file

@ -310,7 +310,7 @@ class VehicleControlMountingBlockedExosuitTest extends ActorTest {
// Reset to allow further driver mount mounting tests
vehicle.Actor.tell(Mountable.TryDismount(player1, 0), probe.ref)
probe.receiveOne(500 milliseconds) //discard
vehicle.Owner = None //ensure
vehicle.OwnerGuid = None //ensure
vehicle.OwnerName = None //ensure
vehicle.Actor.tell(Mountable.TryMount(player3, 1), probe.ref) // Agile in driver mount allowing all except MAX
VehicleControlTest.checkCanMount(probe, "Agile in driver mount allowing all except MAX")
@ -369,7 +369,7 @@ class VehicleControlMountingDriverSeatTest extends ActorTest {
"allow players to sit in the driver mount, even if it is locked, if the vehicle is unowned" in {
assert(vehicle.PermissionGroup(0).contains(VehicleLockState.Locked)) //driver group -> locked
assert(vehicle.Seats(0).occupant.isEmpty)
assert(vehicle.Owner.isEmpty)
assert(vehicle.OwnerGuid.isEmpty)
vehicle.Actor.tell(Mountable.TryMount(player1, 1), probe.ref)
VehicleControlTest.checkCanMount(probe, "")
assert(vehicle.Seats(0).occupant.nonEmpty)
@ -397,7 +397,7 @@ class VehicleControlMountingOwnedLockedDriverSeatTest extends ActorTest {
"block players that are not the current owner from sitting in the driver mount (locked)" in {
assert(vehicle.PermissionGroup(0).contains(VehicleLockState.Locked)) //driver group -> locked
assert(vehicle.Seats(0).occupant.isEmpty)
vehicle.Owner = player1.GUID
vehicle.OwnerGuid = player1.GUID
vehicle.Actor.tell(Mountable.TryMount(player1, 1), probe.ref)
VehicleControlTest.checkCanMount(probe, "")
@ -434,7 +434,7 @@ class VehicleControlMountingOwnedUnlockedDriverSeatTest extends ActorTest {
vehicle.PermissionGroup(0, 3) //passenger group -> empire
assert(vehicle.PermissionGroup(0).contains(VehicleLockState.Empire)) //driver group -> empire
assert(vehicle.Seats(0).occupant.isEmpty)
vehicle.Owner = player1.GUID //owner set
vehicle.OwnerGuid = player1.GUID //owner set
vehicle.Actor.tell(Mountable.TryMount(player1, 1), probe.ref)
VehicleControlTest.checkCanMount(probe, "")

View file

@ -121,7 +121,7 @@ class VehicleTest extends Specification {
"construct (detailed)" in {
val fury_vehicle = Vehicle(GlobalDefinitions.fury)
fury_vehicle.Owner.isEmpty mustEqual true
fury_vehicle.OwnerGuid.isEmpty mustEqual true
fury_vehicle.Seats.size mustEqual 1
fury_vehicle.Seats(0).definition.restriction mustEqual NoMax
fury_vehicle.Seats(0).isOccupied mustEqual false
@ -148,30 +148,30 @@ class VehicleTest extends Specification {
"can be owned by a player" in {
val fury_vehicle = Vehicle(GlobalDefinitions.fury)
fury_vehicle.Owner.isDefined mustEqual false
fury_vehicle.OwnerGuid.isDefined mustEqual false
val player1 = Player(avatar1)
player1.GUID = PlanetSideGUID(1)
fury_vehicle.Owner = player1
fury_vehicle.Owner.isDefined mustEqual true
fury_vehicle.Owner.contains(PlanetSideGUID(1)) mustEqual true
fury_vehicle.OwnerGuid = player1
fury_vehicle.OwnerGuid.isDefined mustEqual true
fury_vehicle.OwnerGuid.contains(PlanetSideGUID(1)) mustEqual true
}
"ownership depends on who last was granted it" in {
val fury_vehicle = Vehicle(GlobalDefinitions.fury)
fury_vehicle.Owner.isDefined mustEqual false
fury_vehicle.OwnerGuid.isDefined mustEqual false
val player1 = Player(avatar1)
player1.GUID = PlanetSideGUID(1)
fury_vehicle.Owner = player1
fury_vehicle.Owner.isDefined mustEqual true
fury_vehicle.Owner.contains(PlanetSideGUID(1)) mustEqual true
fury_vehicle.OwnerGuid = player1
fury_vehicle.OwnerGuid.isDefined mustEqual true
fury_vehicle.OwnerGuid.contains(PlanetSideGUID(1)) mustEqual true
val player2 = Player(avatar2)
player2.GUID = PlanetSideGUID(2)
fury_vehicle.Owner = player2
fury_vehicle.Owner.isDefined mustEqual true
fury_vehicle.Owner.contains(PlanetSideGUID(2)) mustEqual true
fury_vehicle.OwnerGuid = player2
fury_vehicle.OwnerGuid.isDefined mustEqual true
fury_vehicle.OwnerGuid.contains(PlanetSideGUID(2)) mustEqual true
}
"can use mount point to get mount number" in {

View file

@ -40,10 +40,10 @@ class VitalityTest extends Specification {
player.LogActivity(result) //DamageResult, straight-up
player.LogActivity(DamageFromProjectile(result))
player.LogActivity(HealFromKit(GlobalDefinitions.medkit, 10))
player.LogActivity(HealFromTerm(term, 10))
player.LogActivity(HealFromTerminal(term, 10))
player.LogActivity(HealFromImplant(ImplantType.AdvancedRegen, 10))
player.LogActivity(RepairFromExoSuitChange(ExoSuitType.Standard, 10))
player.LogActivity(RepairFromTerm(term, 10))
player.LogActivity(RepairFromTerminal(term, 10))
player.LogActivity(ShieldCharge(10, Some(vSource)))
player.LogActivity(PlayerSuicide(PlayerSource(player)))
ok
@ -55,10 +55,10 @@ class VitalityTest extends Specification {
val term = AmenitySource(new Terminal(GlobalDefinitions.order_terminal) { GUID = PlanetSideGUID(1) })
player.LogActivity(HealFromKit(GlobalDefinitions.medkit, 10))
player.LogActivity(HealFromTerm(term, 10))
player.LogActivity(HealFromTerminal(term, 10))
player.LogActivity(HealFromImplant(ImplantType.AdvancedRegen, 10))
player.LogActivity(RepairFromExoSuitChange(ExoSuitType.Standard, 10))
player.LogActivity(RepairFromTerm(term, 10))
player.LogActivity(RepairFromTerminal(term, 10))
player.LogActivity(ShieldCharge(10, Some(vSource)))
player.LogActivity(PlayerSuicide(PlayerSource(player)))
player.History.size mustEqual 7
@ -67,10 +67,10 @@ class VitalityTest extends Specification {
player.History.size mustEqual 0
list.head.isInstanceOf[PlayerSuicide] mustEqual true
list(1).isInstanceOf[ShieldCharge] mustEqual true
list(2).isInstanceOf[RepairFromTerm] mustEqual true
list(2).isInstanceOf[RepairFromTerminal] mustEqual true
list(3).isInstanceOf[RepairFromExoSuitChange] mustEqual true
list(4).isInstanceOf[HealFromImplant] mustEqual true
list(5).isInstanceOf[HealFromTerm] mustEqual true
list(5).isInstanceOf[HealFromTerminal] mustEqual true
list(6).isInstanceOf[HealFromKit] mustEqual true
}
@ -92,10 +92,10 @@ class VitalityTest extends Specification {
player.LogActivity(DamageFromProjectile(result))
player.LogActivity(HealFromKit(GlobalDefinitions.medkit, 10))
player.LogActivity(HealFromTerm(term, 10))
player.LogActivity(HealFromTerminal(term, 10))
player.LogActivity(HealFromImplant(ImplantType.AdvancedRegen, 10))
player.LogActivity(RepairFromExoSuitChange(ExoSuitType.Standard, 10))
player.LogActivity(RepairFromTerm(term, 10))
player.LogActivity(RepairFromTerminal(term, 10))
player.LogActivity(ShieldCharge(10, Some(vSource)))
player.LogActivity(PlayerSuicide(PlayerSource(player)))