mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-25 07:09:11 +00:00
Turret Automation (#1166)
* zone interaction for turret discovery, players only so far; minor field value change for small turret data; automated turret target recognition; grammatical and linter fixes * initial AIDamage packet and tests; wrote handling code for the AIDamage packet that transforms it into actionable projectile damage * thoroughly reorganized code in behavior; added code for turret-specific interactions for deployable construction, deployable destruction, jamming, and for weaponfire retribution; killing is currently disable for testing turnaround * introduced definition properties to configure auto fire; interspersed properties into relevant files; non-squared velocity check for isMoving * separated overworld facility turrets from cavern facility turrets, called vanu sentry turrets; tightened functionality inheritance between turret deployables and facility turrets; corrected issue where recharging vehicle weapons didn't work * adjust mounting code to betterhandle automation with the facility turrets; basic operation of automation has also been changed, adding a variety of ranges to test against, and cylindrical distance checks * attempted cleanup of previous test fire condition; division of turret callbacks between generic targets and vehicle targets; facility turret stops automatic fire when being mounted and resumes automatic mode when being dismounted * self-reported firing mode for targets that go stationary and then use a 'clever trick' to avoid taking damage while in full exposure to the automated turret; documentation on the automated turret operations (it needs it!) * making specific target validation conditions for different auto turrets, also target blanking, and clarification of how the self-reporting mode cleansup after itself; wrote function documentation to make it all make sense (it doesn't) * secondary queue that keeps track of the previous test shot subjects when none have been tested, allowing for a packet to be skipped during subsequent test shots * reactivating turret deployable destruction; clarifying the validation and clearing conditions for different kinds of auto turrets; extending self-reporting auto turret behavior to other auto-turrets * overhaul of the auto turret target selection process; conditions for MAX detection; rewired self-reporting to address the its issue a bit more specifically; ATDispatch is no longer useless as differences between facility turrets and deployable turrets have been identified, shifting the method to implementing and overriding in subclass control agencies * turret detection methods accounting for specific targets and considerations such as silent running; various turret interactions with other turrets and radiation clouds; proper management of retaliation and jamming; facility turrets have play in the lifecycle in the power structure and capture mechanics of the facility * uniqueness can be generated without having to having to go through source entries; made certain turret upgrading cooperates with turret automation; other targets for turret misaimed aggression; turrets sychronize better on zone load; target validation and blankinghas changed again * starting the target validation timer when dealing with retaliation if it should come from beyond the maximum detection range * stop assuming mountable turrets have places to mount; AMS and AEGIS blocking detection of vehicles; deployable sensors and small robotics turrets are allergic to vehicles * AEGIS and AMS cloak bubbles more proactive
This commit is contained in:
parent
d049146b4f
commit
ea77d4728f
56 changed files with 2880 additions and 435 deletions
32
src/test/scala/game/AIDamageTest.scala
Normal file
32
src/test/scala/game/AIDamageTest.scala
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
// Copyright (c) 2023 PSForever
|
||||
package game
|
||||
|
||||
import org.specs2.mutable._
|
||||
import net.psforever.packet._
|
||||
import net.psforever.packet.game._
|
||||
import net.psforever.types.PlanetSideGUID
|
||||
import scodec.bits._
|
||||
|
||||
class AIDamageTest extends Specification {
|
||||
val string1 = hex"5c de10 89e8 38030000 00000000 04020000"
|
||||
|
||||
"decode" in {
|
||||
PacketCoding.decodePacket(string1).require match {
|
||||
case AIDamage(target_guid, attacker_guid, projectile_type, unk1, unk2) =>
|
||||
target_guid mustEqual PlanetSideGUID(4318)
|
||||
attacker_guid mustEqual PlanetSideGUID(59529)
|
||||
projectile_type mustEqual 824L
|
||||
unk1 mustEqual 0L
|
||||
unk2 mustEqual 516L
|
||||
case _ =>
|
||||
ko
|
||||
}
|
||||
}
|
||||
|
||||
"encode" in {
|
||||
val msg = AIDamage(PlanetSideGUID(4318), PlanetSideGUID(59529), 824L, 0L, 516L)
|
||||
val pkt = PacketCoding.encodePacket(msg).require.toByteVector
|
||||
|
||||
pkt mustEqual string1
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue