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