mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-04-25 22:05:22 +00:00
The Flail (#896)
* corrected flail deploy animation timing; added a working laze pointer terminal utility to the flail * initial LongRangeProjectileInfoMessage packet and tests * flail damages targets over a distance and damage dealt will increase with distance traveled * flail laze pointer broadcasts a special waypoint to squad members and blanks position marker after a short time * recharge terminal will remotely restore ammunition to ancient vehicle weaponry (like the flail) as weaponfire expends it * laze waypoints do not double and are visible to all squad members; excessive squads do not form and stick around by accident
This commit is contained in:
parent
09e0ae3498
commit
912d9a6599
21 changed files with 742 additions and 248 deletions
33
src/test/scala/game/LongRangeProjectileInfoMessageTest.scala
Normal file
33
src/test/scala/game/LongRangeProjectileInfoMessageTest.scala
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
// Copyright (c) 2017 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types.{PlanetSideGUID, Vector3}
|
||||
import scodec.bits._
|
||||
|
||||
class LongRangeProjectileInfoMessageTest extends Specification {
|
||||
val string = hex"c7 d214 006c485fd9c307ed30790f84a0"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.decodePacket(string).require match {
|
||||
case LongRangeProjectileInfoMessage(guid, pos, vel) =>
|
||||
guid mustEqual PlanetSideGUID(5330)
|
||||
pos mustEqual Vector3(2264, 5115.039f, 31.046875f)
|
||||
vel.contains(Vector3(-57.1875f, 9.875f, 47.5f)) mustEqual true
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = LongRangeProjectileInfoMessage(
|
||||
PlanetSideGUID(5330),
|
||||
Vector3(2264, 5115.039f, 31.046875f),
|
||||
Vector3(-57.1875f, 9.875f, 47.5f)
|
||||
)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
pkt mustEqual string
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ package game
|
|||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game.{SquadWaypointEvent, WaypointEvent, WaypointEventAction}
|
||||
import net.psforever.types.{SquadWaypoints, Vector3}
|
||||
import net.psforever.types.{SquadWaypoint, Vector3}
|
||||
import scodec.bits._
|
||||
|
||||
class SquadWaypointEventTest extends Specification {
|
||||
|
|
@ -19,7 +19,7 @@ class SquadWaypointEventTest extends Specification {
|
|||
unk1 mustEqual WaypointEventAction.Remove
|
||||
unk2 mustEqual 11
|
||||
unk3 mustEqual 31155863L
|
||||
unk4 mustEqual SquadWaypoints.One
|
||||
unk4 mustEqual SquadWaypoint.One
|
||||
unk5.isEmpty mustEqual true
|
||||
unk6.isEmpty mustEqual true
|
||||
case _ =>
|
||||
|
|
@ -33,7 +33,7 @@ class SquadWaypointEventTest extends Specification {
|
|||
unk1 mustEqual WaypointEventAction.Remove
|
||||
unk2 mustEqual 10
|
||||
unk3 mustEqual 0L
|
||||
unk4 mustEqual SquadWaypoints.ExperienceRally
|
||||
unk4 mustEqual SquadWaypoint.ExperienceRally
|
||||
unk5.isEmpty mustEqual true
|
||||
unk6.isEmpty mustEqual true
|
||||
case _ =>
|
||||
|
|
@ -47,7 +47,7 @@ class SquadWaypointEventTest extends Specification {
|
|||
unk1 mustEqual WaypointEventAction.Add
|
||||
unk2 mustEqual 3
|
||||
unk3 mustEqual 41581052L
|
||||
unk4 mustEqual SquadWaypoints.Two
|
||||
unk4 mustEqual SquadWaypoint.Two
|
||||
unk5.isEmpty mustEqual true
|
||||
unk6.contains(WaypointEvent(10, Vector3(3457.9688f, 5514.4688f, 0.0f), 1)) mustEqual true
|
||||
case _ =>
|
||||
|
|
@ -61,7 +61,7 @@ class SquadWaypointEventTest extends Specification {
|
|||
unk1 mustEqual WaypointEventAction.Unknown1
|
||||
unk2 mustEqual 3
|
||||
unk3 mustEqual 41581052L
|
||||
unk4 mustEqual SquadWaypoints.Two
|
||||
unk4 mustEqual SquadWaypoint.Two
|
||||
unk5.contains(4L) mustEqual true
|
||||
unk6.isEmpty mustEqual true
|
||||
case _ =>
|
||||
|
|
@ -70,14 +70,14 @@ class SquadWaypointEventTest extends Specification {
|
|||
}
|
||||
|
||||
"encode (1)" in {
|
||||
val msg = SquadWaypointEvent.Remove(11, 31155863L, SquadWaypoints.One)
|
||||
val msg = SquadWaypointEvent.Remove(11, 31155863L, SquadWaypoint.One)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_1
|
||||
}
|
||||
|
||||
"encode (2)" in {
|
||||
val msg = SquadWaypointEvent.Remove(10, 0L, SquadWaypoints.ExperienceRally)
|
||||
val msg = SquadWaypointEvent.Remove(10, 0L, SquadWaypoint.ExperienceRally)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_2
|
||||
|
|
@ -87,7 +87,7 @@ class SquadWaypointEventTest extends Specification {
|
|||
val msg = SquadWaypointEvent.Add(
|
||||
3,
|
||||
41581052L,
|
||||
SquadWaypoints.Two,
|
||||
SquadWaypoint.Two,
|
||||
WaypointEvent(10, Vector3(3457.9688f, 5514.4688f, 0.0f), 1)
|
||||
)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
|
@ -96,7 +96,7 @@ class SquadWaypointEventTest extends Specification {
|
|||
}
|
||||
|
||||
"encode (4)" in {
|
||||
val msg = SquadWaypointEvent.Unknown1(3, 41581052L, SquadWaypoints.Two, 4L)
|
||||
val msg = SquadWaypointEvent.Unknown1(3, 41581052L, SquadWaypoint.Two, 4L)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string_4
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue