Merge pull request #1240 from Fate-JH/max-switch-to-zero

Min Capacitor
This commit is contained in:
Fate-JH 2024-10-01 16:02:31 -04:00 committed by GitHub
commit 623a60d28c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 2 deletions

View file

@ -310,6 +310,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
@ -393,6 +394,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

View file

@ -642,7 +642,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
@ -653,6 +656,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)
val (dropFromUnplaced, deleteFromUnplaced) = unplacedInventory.map(InventoryItem(_, -1)).partition(dropPred)