PSF-BotServer/src/test/scala/game/LongRangeProjectileInfoMessageTest.scala
Fate-JH 912d9a6599
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
2021-07-29 09:06:29 -04:00

33 lines
955 B
Scala

// 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
}
}