mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-04-29 16:25:30 +00:00
Weapon-based MAX cooldowns
This commit is contained in:
parent
8ea2ffad0f
commit
51d71ed732
6 changed files with 46 additions and 57 deletions
|
|
@ -735,30 +735,24 @@ class AvatarActor(
|
||||||
case (name, purchaseTime) =>
|
case (name, purchaseTime) =>
|
||||||
val secondsSincePurchase = new Period(purchaseTime, LocalDateTime.now()).toStandardSeconds.getSeconds
|
val secondsSincePurchase = new Period(purchaseTime, LocalDateTime.now()).toStandardSeconds.getSeconds
|
||||||
Avatar.purchaseCooldowns.find(_._1.Name == name) match {
|
Avatar.purchaseCooldowns.find(_._1.Name == name) match {
|
||||||
case Some((GlobalDefinitions.NCMAX | GlobalDefinitions.TRMAX | GlobalDefinitions.VSMAX, cooldown))
|
|
||||||
if cooldown.toSeconds - secondsSincePurchase > 0 =>
|
|
||||||
val faction: String = avatar.faction.toString.toLowerCase
|
|
||||||
Seq(
|
|
||||||
//s"${faction}hev",
|
|
||||||
s"${faction}hev_antipersonnel",
|
|
||||||
s"${faction}hev_antivehicular",
|
|
||||||
s"${faction}hev_antiaircraft"
|
|
||||||
).foreach { name =>
|
|
||||||
sessionActor ! SessionActor.SendResponse(
|
|
||||||
AvatarVehicleTimerMessage(
|
|
||||||
session.get.player.GUID,
|
|
||||||
name,
|
|
||||||
cooldown.toSeconds - secondsSincePurchase,
|
|
||||||
unk1 = true
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
case Some((obj, cooldown)) if cooldown.toSeconds - secondsSincePurchase > 0 =>
|
case Some((obj, cooldown)) if cooldown.toSeconds - secondsSincePurchase > 0 =>
|
||||||
|
val faction: String = avatar.faction.toString.toLowerCase
|
||||||
|
val name = obj match {
|
||||||
|
case GlobalDefinitions.trhev_dualcycler | GlobalDefinitions.nchev_scattercannon |
|
||||||
|
GlobalDefinitions.vshev_quasar =>
|
||||||
|
s"${faction}hev_antipersonnel"
|
||||||
|
case GlobalDefinitions.trhev_pounder | GlobalDefinitions.nchev_falcon |
|
||||||
|
GlobalDefinitions.vshev_comet =>
|
||||||
|
s"${faction}hev_antivehicular"
|
||||||
|
case GlobalDefinitions.trhev_burster | GlobalDefinitions.nchev_sparrow |
|
||||||
|
GlobalDefinitions.vshev_starfire =>
|
||||||
|
s"${faction}hev_antiaircraft"
|
||||||
|
case _ => obj.Name
|
||||||
|
}
|
||||||
sessionActor ! SessionActor.SendResponse(
|
sessionActor ! SessionActor.SendResponse(
|
||||||
AvatarVehicleTimerMessage(
|
AvatarVehicleTimerMessage(
|
||||||
session.get.player.GUID,
|
session.get.player.GUID,
|
||||||
obj.Name,
|
name,
|
||||||
cooldown.toSeconds - secondsSincePurchase,
|
cooldown.toSeconds - secondsSincePurchase,
|
||||||
unk1 = true
|
unk1 = true
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -769,6 +769,7 @@ class ChatActor(
|
||||||
case CMT_HIDE_HELMET => Cosmetic.NoHelmet
|
case CMT_HIDE_HELMET => Cosmetic.NoHelmet
|
||||||
case CMT_TOGGLE_SHADES => Cosmetic.Sunglasses
|
case CMT_TOGGLE_SHADES => Cosmetic.Sunglasses
|
||||||
case CMT_TOGGLE_EARPIECE => Cosmetic.Earpiece
|
case CMT_TOGGLE_EARPIECE => Cosmetic.Earpiece
|
||||||
|
case _ => null
|
||||||
}
|
}
|
||||||
|
|
||||||
val on = contents match {
|
val on = contents match {
|
||||||
|
|
|
||||||
|
|
@ -5721,8 +5721,8 @@ class SessionActor extends Actor with MDCContextAware {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
sendResponse(TargetingInfoMessage(targetInfo))
|
sendResponse(TargetingInfoMessage(targetInfo))
|
||||||
|
|
||||||
case msg @ ActionCancelMessage(u1, u2, u3) =>
|
case msg @ ActionCancelMessage(u1, u2, u3) =>
|
||||||
log.info("Cancelled: " + msg)
|
log.info("Cancelled: " + msg)
|
||||||
progressBarUpdate.cancel()
|
progressBarUpdate.cancel()
|
||||||
|
|
|
||||||
|
|
@ -667,10 +667,14 @@ object GlobalDefinitions {
|
||||||
val dynomite = ToolDefinition(ObjectClass.dynomite)
|
val dynomite = ToolDefinition(ObjectClass.dynomite)
|
||||||
|
|
||||||
val trhev_dualcycler = new ToolDefinition(ObjectClass.trhev_dualcycler) {
|
val trhev_dualcycler = new ToolDefinition(ObjectClass.trhev_dualcycler) {
|
||||||
|
Name = "trhev_dualcycler"
|
||||||
|
|
||||||
override def NextFireModeIndex(index: Int): Int = index
|
override def NextFireModeIndex(index: Int): Int = index
|
||||||
}
|
}
|
||||||
|
|
||||||
val trhev_pounder = new ToolDefinition(ObjectClass.trhev_pounder) {
|
val trhev_pounder = new ToolDefinition(ObjectClass.trhev_pounder) {
|
||||||
|
Name = "trhev_pounder"
|
||||||
|
|
||||||
override def NextFireModeIndex(index: Int): Int = {
|
override def NextFireModeIndex(index: Int): Int = {
|
||||||
//TODO other modes
|
//TODO other modes
|
||||||
if (index == 0 || index == 3) {
|
if (index == 0 || index == 3) {
|
||||||
|
|
@ -692,20 +696,22 @@ object GlobalDefinitions {
|
||||||
}
|
}
|
||||||
|
|
||||||
val trhev_burster = new ToolDefinition(ObjectClass.trhev_burster) {
|
val trhev_burster = new ToolDefinition(ObjectClass.trhev_burster) {
|
||||||
|
Name = "trhev_burster"
|
||||||
|
|
||||||
override def NextFireModeIndex(index: Int): Int = index
|
override def NextFireModeIndex(index: Int): Int = index
|
||||||
}
|
}
|
||||||
|
|
||||||
val nchev_scattercannon = ToolDefinition(ObjectClass.nchev_scattercannon)
|
val nchev_scattercannon = new ToolDefinition(ObjectClass.nchev_scattercannon) { Name = "nchev_scattercannon" }
|
||||||
|
|
||||||
val nchev_falcon = ToolDefinition(ObjectClass.nchev_falcon)
|
val nchev_falcon = new ToolDefinition(ObjectClass.nchev_falcon) { Name = "nchev_falcon" }
|
||||||
|
|
||||||
val nchev_sparrow = ToolDefinition(ObjectClass.nchev_sparrow)
|
val nchev_sparrow = new ToolDefinition(ObjectClass.nchev_sparrow) { Name = "nchev_sparrow" }
|
||||||
|
|
||||||
val vshev_quasar = ToolDefinition(ObjectClass.vshev_quasar)
|
val vshev_quasar = new ToolDefinition(ObjectClass.vshev_quasar) { Name = "vshev_quasar" }
|
||||||
|
|
||||||
val vshev_comet = ToolDefinition(ObjectClass.vshev_comet)
|
val vshev_comet = new ToolDefinition(ObjectClass.vshev_comet) { Name = "vshev_comet" }
|
||||||
|
|
||||||
val vshev_starfire = ToolDefinition(ObjectClass.vshev_starfire)
|
val vshev_starfire = new ToolDefinition(ObjectClass.vshev_starfire) { Name = "vshev_starfire" }
|
||||||
|
|
||||||
val medicalapplicator = ToolDefinition(ObjectClass.medicalapplicator)
|
val medicalapplicator = ToolDefinition(ObjectClass.medicalapplicator)
|
||||||
|
|
||||||
|
|
@ -1367,7 +1373,7 @@ object GlobalDefinitions {
|
||||||
} else if (subtype == 3) {
|
} else if (subtype == 3) {
|
||||||
AA_MAX(faction)
|
AA_MAX(faction)
|
||||||
} else {
|
} else {
|
||||||
suppressor //there are no common pool MAX arms
|
suppressor // there are no common pool MAX arms
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -45,19 +45,15 @@ object Avatar {
|
||||||
GlobalDefinitions.vulture -> 5.minutes,
|
GlobalDefinitions.vulture -> 5.minutes,
|
||||||
GlobalDefinitions.wasp -> 5.minutes,
|
GlobalDefinitions.wasp -> 5.minutes,
|
||||||
GlobalDefinitions.flamethrower -> 3.minutes,
|
GlobalDefinitions.flamethrower -> 3.minutes,
|
||||||
GlobalDefinitions.VSMAX -> 5.minutes,
|
GlobalDefinitions.nchev_sparrow -> 5.minutes,
|
||||||
GlobalDefinitions.NCMAX -> 5.minutes,
|
GlobalDefinitions.nchev_falcon -> 5.minutes,
|
||||||
GlobalDefinitions.TRMAX -> 5.minutes,
|
GlobalDefinitions.nchev_scattercannon -> 5.minutes,
|
||||||
// TODO weapon based cooldown
|
GlobalDefinitions.vshev_comet -> 5.minutes,
|
||||||
GlobalDefinitions.nchev_sparrow -> 5.minutes,
|
GlobalDefinitions.vshev_quasar -> 5.minutes,
|
||||||
GlobalDefinitions.nchev_falcon -> 5.minutes,
|
GlobalDefinitions.vshev_starfire -> 5.minutes,
|
||||||
GlobalDefinitions.nchev_scattercannon -> 5.minutes,
|
GlobalDefinitions.trhev_burster -> 5.minutes,
|
||||||
GlobalDefinitions.vshev_comet -> 5.minutes,
|
GlobalDefinitions.trhev_dualcycler -> 5.minutes,
|
||||||
GlobalDefinitions.vshev_quasar -> 5.minutes,
|
GlobalDefinitions.trhev_pounder -> 5.minutes
|
||||||
GlobalDefinitions.vshev_starfire -> 5.minutes,
|
|
||||||
GlobalDefinitions.trhev_burster -> 5.minutes,
|
|
||||||
GlobalDefinitions.trhev_dualcycler -> 5.minutes,
|
|
||||||
GlobalDefinitions.trhev_pounder -> 5.minutes
|
|
||||||
)
|
)
|
||||||
|
|
||||||
val useCooldowns: Map[BasicDefinition, FiniteDuration] = Map(
|
val useCooldowns: Map[BasicDefinition, FiniteDuration] = Map(
|
||||||
|
|
|
||||||
|
|
@ -190,16 +190,12 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
|
||||||
val requestToChangeArmor = originalSuit != exosuit || originalSubtype != subtype
|
val requestToChangeArmor = originalSuit != exosuit || originalSubtype != subtype
|
||||||
val allowedToChangeArmor = Players.CertificationToUseExoSuit(player, exosuit, subtype) &&
|
val allowedToChangeArmor = Players.CertificationToUseExoSuit(player, exosuit, subtype) &&
|
||||||
(if (exosuit == ExoSuitType.MAX) {
|
(if (exosuit == ExoSuitType.MAX) {
|
||||||
val definition = player.avatar.faction match {
|
val weapon = GlobalDefinitions.MAXArms(subtype, player.Faction)
|
||||||
case PlanetSideEmpire.NC => GlobalDefinitions.NCMAX
|
player.avatar.purchaseCooldown(weapon) match {
|
||||||
case PlanetSideEmpire.TR => GlobalDefinitions.TRMAX
|
|
||||||
case PlanetSideEmpire.VS => GlobalDefinitions.VSMAX
|
|
||||||
}
|
|
||||||
player.avatar.purchaseCooldown(definition) match {
|
|
||||||
case Some(_) =>
|
case Some(_) =>
|
||||||
false
|
false
|
||||||
case None =>
|
case None =>
|
||||||
avatarActor ! AvatarActor.UpdatePurchaseTime(definition)
|
avatarActor ! AvatarActor.UpdatePurchaseTime(weapon)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -326,15 +322,11 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
|
||||||
if (
|
if (
|
||||||
Players.CertificationToUseExoSuit(player, exosuit, subtype) &&
|
Players.CertificationToUseExoSuit(player, exosuit, subtype) &&
|
||||||
(if (exosuit == ExoSuitType.MAX) {
|
(if (exosuit == ExoSuitType.MAX) {
|
||||||
val definition = player.avatar.faction match {
|
val weapon = GlobalDefinitions.MAXArms(subtype, player.Faction)
|
||||||
case PlanetSideEmpire.NC => GlobalDefinitions.NCMAX
|
player.avatar.purchaseCooldown(weapon) match {
|
||||||
case PlanetSideEmpire.TR => GlobalDefinitions.TRMAX
|
|
||||||
case PlanetSideEmpire.VS => GlobalDefinitions.VSMAX
|
|
||||||
}
|
|
||||||
player.avatar.purchaseCooldown(definition) match {
|
|
||||||
case Some(_) => false
|
case Some(_) => false
|
||||||
case None =>
|
case None =>
|
||||||
avatarActor ! AvatarActor.UpdatePurchaseTime(definition)
|
avatarActor ! AvatarActor.UpdatePurchaseTime(weapon)
|
||||||
true
|
true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -863,8 +855,8 @@ class PlayerControl(player: Player, avatarActor: typed.ActorRef[AvatarActor.Comm
|
||||||
}
|
}
|
||||||
|
|
||||||
def SwapItemCallback(item: Equipment, fromSlot: Int): Unit = {
|
def SwapItemCallback(item: Equipment, fromSlot: Int): Unit = {
|
||||||
val obj = ContainerObject
|
val obj = ContainerObject
|
||||||
val zone = obj.Zone
|
val zone = obj.Zone
|
||||||
val toChannel = if (obj.VisibleSlots.contains(fromSlot)) zone.id else player.Name
|
val toChannel = if (obj.VisibleSlots.contains(fromSlot)) zone.id else player.Name
|
||||||
zone.AvatarEvents ! AvatarServiceMessage(
|
zone.AvatarEvents ! AvatarServiceMessage(
|
||||||
toChannel,
|
toChannel,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue