From 11cb11bd79341138a9741d27d03e9c8d84f4393c Mon Sep 17 00:00:00 2001 From: Fate-JH Date: Sat, 28 Sep 2024 02:07:48 -0400 Subject: [PATCH] when you change max exo-suit subtypes, or change into a max exo-suit, the capacitor level is set to zero --- .../actors/session/normal/AvatarHandlerLogic.scala | 4 +++- .../scala/net/psforever/objects/avatar/PlayerControl.scala | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/scala/net/psforever/actors/session/normal/AvatarHandlerLogic.scala b/src/main/scala/net/psforever/actors/session/normal/AvatarHandlerLogic.scala index bdda54dab..dd838723d 100644 --- a/src/main/scala/net/psforever/actors/session/normal/AvatarHandlerLogic.scala +++ b/src/main/scala/net/psforever/actors/session/normal/AvatarHandlerLogic.scala @@ -298,6 +298,7 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A delete.foreach { case (obj, _) => TaskWorkflow.execute(GUIDTask.unregisterEquipment(continent.GUID, obj)) } //redraw if (maxhand) { + sendResponse(PlanetsideAttributeMessage(target, attribute_type=7, player.Capacitor.toLong)) TaskWorkflow.execute(HoldNewEquipmentUp(player)( Tool(GlobalDefinitions.MAXArms(subtype, player.Faction)), 0 @@ -365,7 +366,7 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A drops ) if resolvedPlayerGuid == target => sendResponse(ArmorChangedMessage(target, exosuit, subtype)) - sendResponse(PlanetsideAttributeMessage(target, attribute_type = 4, armor)) + sendResponse(PlanetsideAttributeMessage(target, attribute_type=4, armor)) //happening to this player sendResponse(ObjectHeldMessage(target, Player.HandsDownSlot, unk1=true)) //cleanup @@ -377,6 +378,7 @@ class AvatarHandlerLogic(val ops: SessionAvatarHandlers, implicit val context: A drops.foreach(item => sendResponse(ObjectDeleteMessage(item.obj.GUID, unk1=0))) //redraw if (maxhand) { + sendResponse(PlanetsideAttributeMessage(target, attribute_type=7, player.Capacitor.toLong)) TaskWorkflow.execute(HoldNewEquipmentUp(player)( Tool(GlobalDefinitions.MAXArms(subtype, player.Faction)), slot = 0 diff --git a/src/main/scala/net/psforever/objects/avatar/PlayerControl.scala b/src/main/scala/net/psforever/objects/avatar/PlayerControl.scala index 1d0746b5d..4f1e956c0 100644 --- a/src/main/scala/net/psforever/objects/avatar/PlayerControl.scala +++ b/src/main/scala/net/psforever/objects/avatar/PlayerControl.scala @@ -635,7 +635,10 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm //was max val (delete, insert) = beforeHolsters.partition(elem => elem.obj.Size == EquipmentSize.Max) if (willBecomeMax) { - //changing to a different kind(?) of max + if (originalSubtype != subtype) { + //changing to a different kind of max + player.Capacitor = 0 + } (delete, Nil, insert, beforeInventory) } else { //changing to a vanilla exo-suit @@ -645,6 +648,7 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm } } else if (willBecomeMax) { //will be max, drop everything but melee slot + player.Capacitor = 0 val (melee, other) = beforeHolsters.partition(elem => elem.obj.Size == EquipmentSize.Melee) val (inventory, unplacedInventory) = GridInventory.recoverInventory(beforeInventory ++ other, player.Inventory) (Nil, unplacedInventory.map(InventoryItem(_, -1)), melee, inventory)