mirror of
https://github.com/2revoemag/PSF-BotServer.git
synced 2026-01-19 18:14:44 +00:00
implant adjustments; case for Infiltration Suit which has 0 armor
This commit is contained in:
parent
1931ae3a7b
commit
36d4ee0895
|
|
@ -64,10 +64,10 @@ class ImplantSlot {
|
|||
case Some(_) =>
|
||||
implant = anImplant
|
||||
case None =>
|
||||
Active = false
|
||||
Initialized = false
|
||||
implant = None
|
||||
}
|
||||
Active = false
|
||||
Initialized = false
|
||||
}
|
||||
Implant
|
||||
}
|
||||
|
|
|
|||
|
|
@ -368,9 +368,9 @@ class Player(private val name : String,
|
|||
implants.find({p => p.Installed.contains(implant)}) match { //try to find the installed implant
|
||||
case None =>
|
||||
recursiveFindImplantInSlot(implants.iterator, ImplantType.None) match { //install in a free slot
|
||||
case out @ Some(slot) =>
|
||||
case Some(slot) =>
|
||||
implants(slot).Implant = implant
|
||||
out
|
||||
Some(slot)
|
||||
case None =>
|
||||
None
|
||||
}
|
||||
|
|
@ -394,9 +394,9 @@ class Player(private val name : String,
|
|||
*/
|
||||
def UninstallImplant(implantType : ImplantType.Value) : Option[Int] = {
|
||||
recursiveFindImplantInSlot(implants.iterator, implantType) match {
|
||||
case out @ Some(slot) =>
|
||||
case Some(slot) =>
|
||||
implants(slot).Implant = None
|
||||
out
|
||||
Some(slot)
|
||||
case None =>
|
||||
None
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,11 +11,12 @@ import scala.util.{Success, Try}
|
|||
|
||||
class AvatarConverter extends ObjectCreateConverter[Player]() {
|
||||
override def ConstructorData(obj : Player) : Try[CharacterData] = {
|
||||
val MaxArmor = obj.MaxArmor
|
||||
Success(
|
||||
CharacterData(
|
||||
MakeAppearanceData(obj),
|
||||
obj.Health / obj.MaxHealth * 255, //TODO not precise
|
||||
obj.Armor / obj.MaxArmor * 255, //TODO not precise
|
||||
if(MaxArmor == 0) { 0 } else { obj.Armor / MaxArmor * 255 }, //TODO not precise
|
||||
DressBattleRank(obj),
|
||||
DressCommandRank(obj),
|
||||
recursiveMakeImplantEffects(obj.Implants.iterator),
|
||||
|
|
@ -163,15 +164,14 @@ class AvatarConverter extends ObjectCreateConverter[Player]() {
|
|||
else {
|
||||
val slot = iter.next
|
||||
if(slot.Active) {
|
||||
import GlobalDefinitions._
|
||||
slot.Installed match {
|
||||
case Some(`advanced_regen`) =>
|
||||
case Some(GlobalDefinitions.advanced_regen) =>
|
||||
Some(ImplantEffects.RegenEffects)
|
||||
case Some(`darklight_vision`) =>
|
||||
case Some(GlobalDefinitions.darklight_vision) =>
|
||||
Some(ImplantEffects.DarklightEffects)
|
||||
case Some(`personal_shield`) =>
|
||||
case Some(GlobalDefinitions.personal_shield) =>
|
||||
Some(ImplantEffects.PersonalShieldEffects)
|
||||
case Some(`surge`) =>
|
||||
case Some(GlobalDefinitions.surge) =>
|
||||
Some(ImplantEffects.SurgeEffects)
|
||||
case _ =>
|
||||
recursiveMakeImplantEffects(iter)
|
||||
|
|
|
|||
|
|
@ -181,12 +181,7 @@ class WorldSessionActor extends Actor with MDCContextAware {
|
|||
|
||||
case AvatarResponse.LoadPlayer(pdata) =>
|
||||
if(player.GUID != guid) {
|
||||
sendResponse(
|
||||
PacketCoding.CreateGamePacket(
|
||||
0,
|
||||
ObjectCreateMessage(ObjectClass.avatar, guid, pdata)
|
||||
)
|
||||
)
|
||||
sendResponse(PacketCoding.CreateGamePacket(0, ObjectCreateMessage(ObjectClass.avatar, guid, pdata)))
|
||||
}
|
||||
|
||||
case AvatarResponse.ObjectDelete(item_guid, unk) =>
|
||||
|
|
|
|||
Loading…
Reference in a new issue