implant adjustments; case for Infiltration Suit which has 0 armor

This commit is contained in:
FateJH 2017-12-11 20:01:18 -05:00
parent 1931ae3a7b
commit 36d4ee0895
4 changed files with 13 additions and 18 deletions

View file

@ -64,10 +64,10 @@ class ImplantSlot {
case Some(_) =>
implant = anImplant
case None =>
Active = false
Initialized = false
implant = None
}
Active = false
Initialized = false
}
Implant
}

View file

@ -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
}

View file

@ -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)

View file

@ -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) =>