armor value updated (#533)

This commit is contained in:
Fate-JH 2020-08-25 21:28:04 -04:00 committed by GitHub
parent d46110874e
commit 89a30ae6f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 5 deletions

View file

@ -2086,6 +2086,7 @@ class SessionActor extends Actor with MDCContextAware {
case AvatarResponse.ChangeExosuit(
target,
armor,
exosuit,
subtype,
slot,
@ -2099,7 +2100,7 @@ class SessionActor extends Actor with MDCContextAware {
) =>
StartBundlingPackets()
sendResponse(ArmorChangedMessage(target, exosuit, subtype))
sendResponse(PlanetsideAttributeMessage(target, 4, player.Armor))
sendResponse(PlanetsideAttributeMessage(target, 4, armor))
if (tplayer_guid == target) {
//happening to this player
//cleanup
@ -2167,6 +2168,7 @@ class SessionActor extends Actor with MDCContextAware {
case AvatarResponse.ChangeLoadout(
target,
armor,
exosuit,
subtype,
slot,
@ -2179,7 +2181,7 @@ class SessionActor extends Actor with MDCContextAware {
) =>
StartBundlingPackets()
sendResponse(ArmorChangedMessage(target, exosuit, subtype))
sendResponse(PlanetsideAttributeMessage(target, 4, player.Armor))
sendResponse(PlanetsideAttributeMessage(target, 4, armor))
if (tplayer_guid == target) {
//happening to this player
sendResponse(ObjectHeldMessage(target, Player.HandsDownSlot, false))

View file

@ -213,7 +213,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
val originalArmor = player.Armor
player.ExoSuit = exosuit //changes the value of MaxArmor to reflect the new exo-suit
val toMaxArmor = player.MaxArmor
if (originalSuit != exosuit || originalSubtype != subtype || originalArmor > toMaxArmor) {
val toArmor = if (originalSuit != exosuit || originalSubtype != subtype || originalArmor > toMaxArmor) {
player.History(HealFromExoSuitChange(PlayerSource(player), exosuit))
player.Armor = toMaxArmor
} else {
@ -274,6 +274,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
player.Zone.id,
AvatarAction.ChangeExosuit(
player.GUID,
toArmor,
exosuit,
subtype,
player.LastDrawnSlot,
@ -365,7 +366,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
val originalArmor = player.Armor
player.ExoSuit = nextSuit
val toMaxArmor = player.MaxArmor
if (originalSuit != nextSuit || originalSubtype != nextSubtype || originalArmor > toMaxArmor) {
val toArmor = if (originalSuit != nextSuit || originalSubtype != nextSubtype || originalArmor > toMaxArmor) {
player.History(HealFromExoSuitChange(PlayerSource(player), nextSuit))
player.Armor = toMaxArmor
} else {
@ -411,6 +412,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
player.Zone.id,
AvatarAction.ChangeLoadout(
player.GUID,
toArmor,
nextSuit,
nextSubtype,
player.LastDrawnSlot,
@ -430,7 +432,6 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
}
case Zone.Ground.ItemOnGround(item, _, _) =>
;
val name = player.Name
val zone = player.Zone
val avatarEvents = zone.AvatarEvents

View file

@ -346,6 +346,7 @@ class AvatarService(zone: Zone) extends Actor {
)
case AvatarAction.ChangeExosuit(
target,
armor,
exosuit,
subtype,
slot,
@ -363,6 +364,7 @@ class AvatarService(zone: Zone) extends Actor {
Service.defaultPlayerGUID,
AvatarResponse.ChangeExosuit(
target,
armor,
exosuit,
subtype,
slot,
@ -378,6 +380,7 @@ class AvatarService(zone: Zone) extends Actor {
)
case AvatarAction.ChangeLoadout(
target,
armor,
exosuit,
subtype,
slot,
@ -394,6 +397,7 @@ class AvatarService(zone: Zone) extends Actor {
Service.defaultPlayerGUID,
AvatarResponse.ChangeLoadout(
target,
armor,
exosuit,
subtype,
slot,

View file

@ -122,6 +122,7 @@ object AvatarAction {
extends Action
final case class ChangeExosuit(
target_guid: PlanetSideGUID,
armor: Int,
exosuit: ExoSuitType.Value,
subtype: Int,
last_drawn_slot: Int,
@ -135,6 +136,7 @@ object AvatarAction {
) extends Action
final case class ChangeLoadout(
target_guid: PlanetSideGUID,
armor: Int,
exosuit: ExoSuitType.Value,
subtype: Int,
last_drawn_slot: Int,

View file

@ -90,6 +90,7 @@ object AvatarResponse {
extends Response
final case class ChangeExosuit(
target_guid: PlanetSideGUID,
armor: Int,
exosuit: ExoSuitType.Value,
subtype: Int,
last_drawn_slot: Int,
@ -103,6 +104,7 @@ object AvatarResponse {
) extends Response
final case class ChangeLoadout(
target_guid: PlanetSideGUID,
armor: Int,
exosuit: ExoSuitType.Value,
subtype: Int,
last_drawn_slot: Int,