mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-20 02:54:46 +00:00
fixing Infiltration Suit issues as well as streamlining the process of exo-suit switching
This commit is contained in:
parent
cf3bf19d4d
commit
a3f50cc8a4
|
|
@ -130,7 +130,7 @@ object ExoSuitDefinition {
|
|||
Reinforced.Holster(3, EquipmentSize.Rifle)
|
||||
Reinforced.Holster(4, EquipmentSize.Melee)
|
||||
|
||||
final val Infiltration = ExoSuitDefinition(ExoSuitType.Standard)
|
||||
final val Infiltration = ExoSuitDefinition(ExoSuitType.Infiltration)
|
||||
Infiltration.permission = 1
|
||||
Infiltration.MaxArmor = 0
|
||||
Infiltration.InventoryScale = InventoryTile.Tile66
|
||||
|
|
|
|||
|
|
@ -48,7 +48,7 @@ class Player(private val core : Avatar) extends PlanetSideGameObject with Factio
|
|||
/** From PlanetsideAttributeMessage */
|
||||
var PlanetsideAttribute : Array[Long] = Array.ofDim(120)
|
||||
|
||||
Player.SuitSetup(this, ExoSuit)
|
||||
Player.SuitSetup(this, exosuit)
|
||||
|
||||
def Name : String = core.name
|
||||
|
||||
|
|
@ -265,7 +265,9 @@ class Player(private val core : Avatar) extends PlanetSideGameObject with Factio
|
|||
def ExoSuit : ExoSuitType.Value = exosuit.SuitType
|
||||
|
||||
def ExoSuit_=(suit : ExoSuitType.Value) : Unit = {
|
||||
exosuit = ExoSuitDefinition.Select(suit)
|
||||
val eSuit = ExoSuitDefinition.Select(suit)
|
||||
exosuit = eSuit
|
||||
Player.SuitSetup(this, eSuit)
|
||||
ChangeSpecialAbility()
|
||||
}
|
||||
|
||||
|
|
@ -496,16 +498,13 @@ object Player {
|
|||
new Player(core)
|
||||
}
|
||||
|
||||
def SuitSetup(player : Player, eSuit : ExoSuitType.Value) : Unit = {
|
||||
val esuitDef : ExoSuitDefinition = ExoSuitDefinition.Select(eSuit)
|
||||
//exosuit
|
||||
player.ExoSuit = eSuit
|
||||
private def SuitSetup(player : Player, eSuit : ExoSuitDefinition) : Unit = {
|
||||
//inventory
|
||||
player.Inventory.Clear()
|
||||
player.Inventory.Resize(esuitDef.InventoryScale.Width, esuitDef.InventoryScale.Height)
|
||||
player.Inventory.Offset = esuitDef.InventoryOffset
|
||||
player.Inventory.Resize(eSuit.InventoryScale.Width, eSuit.InventoryScale.Height)
|
||||
player.Inventory.Offset = eSuit.InventoryOffset
|
||||
//holsters
|
||||
(0 until 5).foreach(index => { player.Slot(index).Size = esuitDef.Holster(index) })
|
||||
(0 until 5).foreach(index => { player.Slot(index).Size = eSuit.Holster(index) })
|
||||
}
|
||||
|
||||
def Respawn(player : Player) : Player = {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ class LoadoutTest extends Specification {
|
|||
val player = CreatePlayer()
|
||||
val slot = player.Slot(0)
|
||||
slot.Equipment = None //only an unequipped slot can have its Equipment Size changed (Rifle -> Max)
|
||||
Player.SuitSetup(player, ExoSuitType.MAX)
|
||||
player.ExoSuit = ExoSuitType.MAX
|
||||
|
||||
val ldout1 = Loadout.Create(player, "weaponless").asInstanceOf[InfantryLoadout]
|
||||
slot.Equipment = None
|
||||
|
|
|
|||
|
|
@ -727,7 +727,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
val (dropHolsters, beforeHolsters) = clearHolsters(tplayer.Holsters().iterator).partition(dropPred)
|
||||
val (dropInventory, beforeInventory) = tplayer.Inventory.Clear().partition(dropPred)
|
||||
//change suit (clear inventory and change holster sizes; note: holsters must be empty before this point)
|
||||
Player.SuitSetup(tplayer, exosuit)
|
||||
tplayer.ExoSuit = exosuit
|
||||
tplayer.Armor = tplayer.MaxArmor
|
||||
//delete everything not dropped
|
||||
(beforeHolsters ++ beforeInventory).foreach({ elem =>
|
||||
|
|
@ -859,7 +859,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
val (_, afterInventory) = inventory.partition(dropPred) //dropped items are lost
|
||||
val beforeFreeHand = tplayer.FreeHand.Equipment
|
||||
//change suit (clear inventory and change holster sizes; note: holsters must be empty before this point)
|
||||
Player.SuitSetup(tplayer, exosuit)
|
||||
tplayer.ExoSuit = exosuit
|
||||
tplayer.Armor = tplayer.MaxArmor
|
||||
//delete everything (not dropped)
|
||||
beforeHolsters.foreach({ elem =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue