mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-20 02:24:45 +00:00
misc animations and turret range
This commit is contained in:
parent
53ba130ec7
commit
2b1d01c4ba
|
|
@ -33,6 +33,7 @@ import net.psforever.packet.PlanetSideGamePacket
|
|||
import net.psforever.packet.game.{ActionCancelMessage, AvatarFirstTimeEventMessage, AvatarImplantMessage, AvatarJumpMessage, BattleplanMessage, BindPlayerMessage, BugReportMessage, ChangeFireModeMessage, ChangeShortcutBankMessage, CharacterCreateRequestMessage, CharacterRequestMessage, ChatMsg, CollisionIs, ConnectToWorldRequestMessage, CreateShortcutMessage, DeadState, DeployObjectMessage, DisplayedAwardMessage, DropItemMessage, EmoteMsg, FacilityBenefitShieldChargeRequestMessage, FriendsRequest, GenericAction, GenericActionMessage, GenericCollisionMsg, GenericObjectActionAtPositionMessage, GenericObjectActionMessage, GenericObjectStateMsg, HitHint, InvalidTerrainMessage, LootItemMessage, MoveItemMessage, ObjectDetectedMessage, ObjectHeldMessage, PickupItemMessage, PlanetsideAttributeMessage, PlayerStateMessageUpstream, RequestDestroyMessage, TargetingImplantRequest, TerrainCondition, TradeMessage, UnuseItemMessage, UseItemMessage, VoiceHostInfo, VoiceHostRequest, ZipLineMessage}
|
||||
import net.psforever.services.RemoverActor
|
||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
||||
import net.psforever.types.{CapacitorStateType, ChatMessageType, Cosmetic, ExoSuitType, PlanetSideEmpire, PlanetSideGUID, Vector3}
|
||||
|
||||
import scala.util.Success
|
||||
|
|
@ -181,7 +182,11 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
|
|||
|
||||
def handleEmote(pkt: EmoteMsg): Unit = {
|
||||
val EmoteMsg(avatarGuid, emote) = pkt
|
||||
val pZone = player.Zone
|
||||
sendResponse(EmoteMsg(avatarGuid, emote))
|
||||
pZone.blockMap.sector(player).livePlayerList.collect { case t if t.GUID != player.GUID =>
|
||||
pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendResponse(EmoteMsg(avatarGuid, emote)))
|
||||
}
|
||||
}
|
||||
|
||||
def handleDropItem(pkt: DropItemMessage): Unit = {
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ import net.psforever.packet.PlanetSideGamePacket
|
|||
import net.psforever.packet.game.{ActionCancelMessage, ActionResultMessage, AvatarFirstTimeEventMessage, AvatarImplantMessage, AvatarJumpMessage, BattleplanMessage, BindPlayerMessage, BugReportMessage, ChangeFireModeMessage, ChangeShortcutBankMessage, CharacterCreateRequestMessage, CharacterRequestAction, CharacterRequestMessage, ChatMsg, CollisionIs, ConnectToWorldRequestMessage, CreateShortcutMessage, DeadState, DeployObjectMessage, DisplayedAwardMessage, DropItemMessage, EmoteMsg, FacilityBenefitShieldChargeRequestMessage, FriendsRequest, GenericAction, GenericActionMessage, GenericCollisionMsg, GenericObjectActionAtPositionMessage, GenericObjectActionMessage, GenericObjectStateMsg, HitHint, InvalidTerrainMessage, LootItemMessage, MoveItemMessage, ObjectDetectedMessage, ObjectHeldMessage, PickupItemMessage, PlanetsideAttributeMessage, PlayerStateMessageUpstream, RequestDestroyMessage, TargetingImplantRequest, TerrainCondition, TradeMessage, UnuseItemMessage, UseItemMessage, VoiceHostInfo, VoiceHostRequest, ZipLineMessage}
|
||||
import net.psforever.services.account.{AccountPersistenceService, RetrieveAccountData}
|
||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
||||
import net.psforever.services.local.support.CaptureFlagManager
|
||||
import net.psforever.types.{CapacitorStateType, ChatMessageType, Cosmetic, ExoSuitType, ImplantType, PlanetSideEmpire, PlanetSideGUID, Vector3}
|
||||
import net.psforever.util.Config
|
||||
|
|
@ -199,7 +200,11 @@ class GeneralLogic(val ops: GeneralOperations, implicit val context: ActorContex
|
|||
|
||||
def handleEmote(pkt: EmoteMsg): Unit = {
|
||||
val EmoteMsg(avatarGuid, emote) = pkt
|
||||
val pZone = player.Zone
|
||||
sendResponse(EmoteMsg(avatarGuid, emote))
|
||||
pZone.blockMap.sector(player).livePlayerList.collect { case t if t.GUID != player.GUID =>
|
||||
pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendResponse(EmoteMsg(avatarGuid, emote)))
|
||||
}
|
||||
}
|
||||
|
||||
def handleDropItem(pkt: DropItemMessage): Unit = {
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
|
|||
sendResponse(ObjectCreateDetailedMessage(itemType, itemGuid, ObjectCreateMessageParent(vehicleGuid, slot), itemData))
|
||||
|
||||
case VehicleResponse.UnloadVehicle(_, vehicleGuid) =>
|
||||
sendResponse(ObjectDeleteMessage(vehicleGuid, unk1=0))
|
||||
sendResponse(ObjectDeleteMessage(vehicleGuid, unk1=1))
|
||||
if (sessionLogic.zoning.spawn.prevSpawnPoint.map(_.Owner).exists {
|
||||
case ams: Vehicle =>
|
||||
ams.GUID == vehicleGuid &&
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ class VehicleHandlerLogic(val ops: SessionVehicleHandlers, implicit val context:
|
|||
sendResponse(PlanetsideAttributeMessage(vehicleGuid, seatGroup, permission))
|
||||
|
||||
case VehicleResponse.UnloadVehicle(_, vehicleGuid) =>
|
||||
sendResponse(ObjectDeleteMessage(vehicleGuid, unk1=0))
|
||||
sendResponse(ObjectDeleteMessage(vehicleGuid, unk1=1))
|
||||
|
||||
case VehicleResponse.UnstowEquipment(itemGuid) if isNotSameTarget =>
|
||||
//TODO prefer ObjectDetachMessage, but how to force ammo pools to update properly?
|
||||
|
|
|
|||
|
|
@ -18,7 +18,8 @@ import net.psforever.objects.serverobject.turret.auto.AutomatedTurret
|
|||
import net.psforever.objects.sourcing.{PlayerSource, SourceEntry, VehicleSource}
|
||||
import net.psforever.objects.vital.{InGameHistory, IncarnationActivity, ReconstructionActivity, SpawningActivity}
|
||||
import net.psforever.objects.zones.blockmap.BlockMapEntity
|
||||
import net.psforever.packet.game.{CampaignStatistic, ChangeFireStateMessage_Start, HackState7, MailMessage, ObjectDetectedMessage, SessionStatistic, TriggeredSound, WeatherMessage, CloudInfo, StormInfo}
|
||||
import net.psforever.packet.game.GenericAction.FirstPersonViewWithEffect
|
||||
import net.psforever.packet.game.{CampaignStatistic, ChangeFireStateMessage_Start, CloudInfo, GenericActionMessage, GenericObjectActionEnum, HackState7, MailMessage, ObjectDetectedMessage, SessionStatistic, StormInfo, TriggeredSound, WeatherMessage}
|
||||
import net.psforever.services.chat.DefaultChannel
|
||||
|
||||
import scala.collection.mutable
|
||||
|
|
@ -2972,10 +2973,10 @@ class ZoningOperations(
|
|||
|
||||
case _ if player.HasGUID => // player is deconstructing self or instant action
|
||||
val player_guid = player.GUID
|
||||
sendResponse(ObjectDeleteMessage(player_guid, 4))
|
||||
sendResponse(ObjectDeleteMessage(player_guid, unk1=1))
|
||||
continent.AvatarEvents ! AvatarServiceMessage(
|
||||
continent.id,
|
||||
AvatarAction.ObjectDelete(player_guid, player_guid, 4)
|
||||
AvatarAction.ObjectDelete(player_guid, player_guid, unk=1)
|
||||
)
|
||||
InGameHistory.SpawnReconstructionActivity(player, toZoneNumber, betterSpawnPoint)
|
||||
LoadZoneAsPlayerUsing(player, pos, ori, toSide, zoneId)
|
||||
|
|
@ -3776,6 +3777,11 @@ class ZoningOperations(
|
|||
player.death_by = 1
|
||||
}
|
||||
GoToDeploymentMap()
|
||||
val pZone = player.Zone
|
||||
sendResponse(GenericActionMessage(FirstPersonViewWithEffect))
|
||||
pZone.blockMap.sector(player).livePlayerList.collect { case t if t.GUID != player.GUID =>
|
||||
pZone.LocalEvents ! LocalServiceMessage(t.Name, LocalAction.SendGenericObjectActionMessage(t.GUID, player.GUID, GenericObjectActionEnum.PlayerDeconstructs))
|
||||
}
|
||||
}
|
||||
|
||||
def stopDeconstructing(): Unit = {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
package net.psforever.objects.serverobject.damage
|
||||
|
||||
import net.psforever.objects.equipment.JammableUnit
|
||||
import net.psforever.objects.serverobject.tube.SpawnTube
|
||||
import net.psforever.objects.vital.interaction.DamageResult
|
||||
import net.psforever.objects.vital.resolution.ResolutionCalculations
|
||||
import net.psforever.objects.zones.Zone
|
||||
|
|
@ -199,9 +200,12 @@ object DamageableEntity {
|
|||
val tguid = target.GUID
|
||||
val attribution = attributionTo(cause, target.Zone)
|
||||
zone.AvatarEvents ! AvatarServiceMessage(zoneId, AvatarAction.PlanetsideAttributeToAll(tguid, 0, target.Health))
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zoneId,
|
||||
AvatarAction.Destroy(tguid, attribution, Service.defaultPlayerGUID, target.Position)
|
||||
)
|
||||
if (target.isInstanceOf[SpawnTube]) {}//do nothing to prevent issue #1057
|
||||
else {
|
||||
zone.AvatarEvents ! AvatarServiceMessage(
|
||||
zoneId,
|
||||
AvatarAction.Destroy(tguid, attribution, Service.defaultPlayerGUID, target.Position)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -205,7 +205,8 @@ trait AutomatedTurretBehavior {
|
|||
val now = System.currentTimeMillis()
|
||||
if (
|
||||
currentTargetToken.isEmpty &&
|
||||
target.Faction != AutomatedTurretObject.Faction
|
||||
target.Faction != AutomatedTurretObject.Faction &&
|
||||
now >= currentTargetLastShotTime
|
||||
) {
|
||||
currentTargetLastShotTime = now
|
||||
currentTargetLocation = Some(target.Position)
|
||||
|
|
@ -215,11 +216,19 @@ trait AutomatedTurretBehavior {
|
|||
true
|
||||
} else if (
|
||||
currentTargetToken.contains(SourceUniqueness(target)) &&
|
||||
now - currentTargetLastShotTime < autoStats.map(_.cooldowns.missedShot).getOrElse(0L)) {
|
||||
currentTargetLastShotTime = now
|
||||
currentTargetLocation = Some(target.Position)
|
||||
cancelSelfReportedAutoFire()
|
||||
true
|
||||
now - currentTargetLastShotTime < autoStats.map(_.cooldowns.missedShot).getOrElse(0L)
|
||||
) {
|
||||
val escapeRange = autoStats.map(_.ranges.escape).getOrElse(400f)
|
||||
val distSq = Vector3.DistanceSquared(target.Position, AutomatedTurretObject.Position)
|
||||
val escapeSq = escapeRange * escapeRange
|
||||
if (distSq <= escapeSq) {
|
||||
currentTargetLastShotTime = now
|
||||
currentTargetLocation = Some(target.Position)
|
||||
cancelSelfReportedAutoFire()
|
||||
true
|
||||
} else {
|
||||
false
|
||||
}
|
||||
} else {
|
||||
false
|
||||
}
|
||||
|
|
|
|||
|
|
@ -91,4 +91,5 @@ object GenericObjectActionEnum extends Enumeration {
|
|||
* <b>Target</b>: CaptureTerminal
|
||||
*/
|
||||
val FlagSpawned = Value(14)
|
||||
val PlayerDeconstructs = Value(6)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class CorpseRemovalActor extends RemoverActor() {
|
|||
entry.zone.Population ! Zone.Corpse.Remove(entry.obj.asInstanceOf[Player])
|
||||
context.parent ! AvatarServiceMessage(
|
||||
entry.zone.id,
|
||||
AvatarAction.ObjectDelete(Service.defaultPlayerGUID, entry.obj.GUID)
|
||||
AvatarAction.ObjectDelete(Service.defaultPlayerGUID, entry.obj.GUID, unk=1)
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue