mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-01-19 18:44:45 +00:00
restored experience awarded from mine kills; removed situations where mine damage no longer works (#1197)
This commit is contained in:
parent
a3eb3a8a95
commit
2dd44142d2
|
|
@ -3048,12 +3048,12 @@ class ZoningOperations(
|
||||||
//killed during spawn setup or possibly a relog into a corpse (by accident?)
|
//killed during spawn setup or possibly a relog into a corpse (by accident?)
|
||||||
tplayer.Actor ! Player.Die()
|
tplayer.Actor ! Player.Die()
|
||||||
} else {
|
} else {
|
||||||
|
//properly logged in
|
||||||
AvatarActor.savePlayerData(tplayer)
|
AvatarActor.savePlayerData(tplayer)
|
||||||
sessionLogic.general.displayCharSavedMsgThenRenewTimer(
|
sessionLogic.general.displayCharSavedMsgThenRenewTimer(
|
||||||
Config.app.game.savedMsg.short.fixed,
|
Config.app.game.savedMsg.short.fixed,
|
||||||
Config.app.game.savedMsg.short.variable
|
Config.app.game.savedMsg.short.variable
|
||||||
)
|
)
|
||||||
//player
|
|
||||||
val effortBy = nextSpawnPoint
|
val effortBy = nextSpawnPoint
|
||||||
.collect { case sp: SpawnTube => (sp, continent.GUID(sp.Owner.GUID)) }
|
.collect { case sp: SpawnTube => (sp, continent.GUID(sp.Owner.GUID)) }
|
||||||
.collect {
|
.collect {
|
||||||
|
|
@ -3078,6 +3078,7 @@ class ZoningOperations(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
upstreamMessageCount = 0
|
upstreamMessageCount = 0
|
||||||
|
player.allowInteraction = true
|
||||||
setAvatar = true
|
setAvatar = true
|
||||||
if (
|
if (
|
||||||
!account.gm && /* gm's are excluded */
|
!account.gm && /* gm's are excluded */
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ package net.psforever.objects
|
||||||
|
|
||||||
import akka.actor.{Actor, ActorContext, ActorRef, Props}
|
import akka.actor.{Actor, ActorContext, ActorRef, Props}
|
||||||
import net.psforever.objects.ce._
|
import net.psforever.objects.ce._
|
||||||
import net.psforever.objects.definition.{DeployableDefinition, ExoSuitDefinition}
|
import net.psforever.objects.definition.DeployableDefinition
|
||||||
import net.psforever.objects.definition.converter.SmallDeployableConverter
|
import net.psforever.objects.definition.converter.SmallDeployableConverter
|
||||||
import net.psforever.objects.equipment.JammableUnit
|
import net.psforever.objects.equipment.JammableUnit
|
||||||
import net.psforever.objects.geometry.d3.VolumetricGeometry
|
import net.psforever.objects.geometry.d3.VolumetricGeometry
|
||||||
|
|
@ -11,14 +11,14 @@ import net.psforever.objects.serverobject.affinity.FactionAffinity
|
||||||
import net.psforever.objects.serverobject.PlanetSideServerObject
|
import net.psforever.objects.serverobject.PlanetSideServerObject
|
||||||
import net.psforever.objects.serverobject.damage.{Damageable, DamageableEntity}
|
import net.psforever.objects.serverobject.damage.{Damageable, DamageableEntity}
|
||||||
import net.psforever.objects.serverobject.damage.Damageable.Target
|
import net.psforever.objects.serverobject.damage.Damageable.Target
|
||||||
import net.psforever.objects.sourcing.{DeployableSource, PlayerSource, SourceEntry, UniquePlayer}
|
import net.psforever.objects.sourcing.{DeployableSource, PlayerSource, SourceEntry}
|
||||||
import net.psforever.objects.vital.etc.TrippedMineReason
|
import net.psforever.objects.vital.etc.TrippedMineReason
|
||||||
import net.psforever.objects.vital.resolution.ResolutionCalculations.Output
|
import net.psforever.objects.vital.resolution.ResolutionCalculations.Output
|
||||||
import net.psforever.objects.vital.{SimpleResolutions, Vitality}
|
import net.psforever.objects.vital.{SimpleResolutions, Vitality}
|
||||||
import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
|
import net.psforever.objects.vital.interaction.{DamageInteraction, DamageResult}
|
||||||
import net.psforever.objects.vital.projectile.ProjectileReason
|
import net.psforever.objects.vital.projectile.ProjectileReason
|
||||||
import net.psforever.objects.zones.Zone
|
import net.psforever.objects.zones.Zone
|
||||||
import net.psforever.types.{CharacterSex, ExoSuitType, Vector3}
|
import net.psforever.types.Vector3
|
||||||
import net.psforever.services.Service
|
import net.psforever.services.Service
|
||||||
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
import net.psforever.services.avatar.{AvatarAction, AvatarServiceMessage}
|
||||||
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
import net.psforever.services.local.{LocalAction, LocalServiceMessage}
|
||||||
|
|
@ -321,40 +321,40 @@ object MineDeployableControl {
|
||||||
private case class Triggered()
|
private case class Triggered()
|
||||||
|
|
||||||
def trippedMineReason(mine: ExplosiveDeployable): TrippedMineReason = {
|
def trippedMineReason(mine: ExplosiveDeployable): TrippedMineReason = {
|
||||||
val deployableSource = DeployableSource(mine)
|
lazy val deployableSource = DeployableSource(mine)
|
||||||
val blame = mine.OwnerName match {
|
val zone = mine.Zone
|
||||||
case Some(name) =>
|
val ownerName = mine.OwnerName
|
||||||
val(charId, exosuit, seatedIn): (Long, ExoSuitType.Value, Option[(SourceEntry, Int)]) = mine.Zone
|
val blame = zone
|
||||||
.LivePlayers
|
.Players
|
||||||
.find { _.Name.equals(name) } match {
|
.find(a => ownerName.contains(a.name))
|
||||||
case Some(player) =>
|
.collect { a =>
|
||||||
//if the owner is alive in the same zone as the mine, use data from their body to create the source
|
val name = a.name
|
||||||
(player.CharId, player.ExoSuit, PlayerSource.mountableAndSeat(player))
|
assignBlameToFrom(name, zone.LivePlayers)
|
||||||
case None =>
|
.orElse(assignBlameToFrom(name, zone.Corpses))
|
||||||
//if the owner is as dead as a corpse or is not in the same zone as the mine, use defaults
|
.getOrElse {
|
||||||
(0L, ExoSuitType.Standard, None)
|
val player = PlayerSource(name, mine.Faction, mine.Position) //might report minor inconsistencies, e.g., exo-suit type
|
||||||
}
|
player.copy(unique = player.unique.copy(charId = a.id), progress = a.scorecard.CurrentLife)
|
||||||
val faction = mine.Faction
|
}
|
||||||
PlayerSource(
|
}
|
||||||
GlobalDefinitions.avatar,
|
.getOrElse(deployableSource)
|
||||||
exosuit,
|
|
||||||
seatedIn,
|
|
||||||
health = 100,
|
|
||||||
armor = 0,
|
|
||||||
mine.Position,
|
|
||||||
Vector3.Zero,
|
|
||||||
None,
|
|
||||||
crouching = false,
|
|
||||||
jumping = false,
|
|
||||||
ExoSuitDefinition.Select(exosuit, faction),
|
|
||||||
bep = 0,
|
|
||||||
progress = PlayerSource.Nobody.progress,
|
|
||||||
UniquePlayer(charId, name, CharacterSex.Male, mine.Faction)
|
|
||||||
)
|
|
||||||
case None =>
|
|
||||||
//credit where credit is due
|
|
||||||
deployableSource
|
|
||||||
}
|
|
||||||
TrippedMineReason(deployableSource, blame)
|
TrippedMineReason(deployableSource, blame)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find a player with a given name from this list of possible players.
|
||||||
|
* If the player is seated, attach a shallow copy of the mounting information.
|
||||||
|
* @param name player name
|
||||||
|
* @param blameList possible players in which to find the player name
|
||||||
|
* @return discovered player as a reference, or `None` if not found
|
||||||
|
*/
|
||||||
|
private def assignBlameToFrom(name: String, blameList: List[Player]): Option[SourceEntry] = {
|
||||||
|
blameList
|
||||||
|
.find(_.Name.equals(name))
|
||||||
|
.map { player =>
|
||||||
|
PlayerSource
|
||||||
|
.mountableAndSeat(player)
|
||||||
|
.map { case (mount, seat) => PlayerSource.inSeat(player, mount, seat) }
|
||||||
|
.getOrElse { PlayerSource(player) }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -141,7 +141,7 @@ object PlayerSource {
|
||||||
player.Jumping,
|
player.Jumping,
|
||||||
ExoSuitDefinition.Select(exosuit, player.Faction),
|
ExoSuitDefinition.Select(exosuit, player.Faction),
|
||||||
avatar.bep,
|
avatar.bep,
|
||||||
progress = tokenLife,
|
progress = avatar.scorecard.CurrentLife,
|
||||||
UniquePlayer(player)
|
UniquePlayer(player)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue