mirror of
https://github.com/psforever/PSF-LoginServer.git
synced 2026-03-24 22:59:09 +00:00
Scorpion Death Message (#1044)
* correction to scorpion sub-projectile death message * redirected the definition fields * output method of demise to chat; chat will answer us the mystery * finally attributes the scorpion as the method of demise
This commit is contained in:
parent
36c7a1e520
commit
ae66f86f63
4 changed files with 102 additions and 21 deletions
|
|
@ -1,11 +1,12 @@
|
|||
// Copyright (c) 2022 PSForever
|
||||
package net.psforever.objects
|
||||
|
||||
import net.psforever.objects.ballistics.Projectile
|
||||
import net.psforever.objects.definition.{ObjectDefinition, ProjectileDefinition}
|
||||
import net.psforever.objects.serverobject.affinity.FactionAffinity
|
||||
import net.psforever.objects.vital.resolution.{DamageAndResistance, DamageResistanceModel}
|
||||
import net.psforever.objects.vital.{Vitality, VitalityDefinition}
|
||||
import net.psforever.types.{PlanetSideEmpire, Vector3}
|
||||
import net.psforever.types.{PlanetSideEmpire, PlanetSideGUID, Vector3}
|
||||
|
||||
class DummyExplodingEntity(
|
||||
private val obj: PlanetSideGameObject,
|
||||
|
|
@ -14,7 +15,7 @@ class DummyExplodingEntity(
|
|||
extends PlanetSideGameObject
|
||||
with FactionAffinity
|
||||
with Vitality {
|
||||
override def GUID = obj.GUID
|
||||
override def GUID: PlanetSideGUID = obj.GUID
|
||||
|
||||
override def Position: Vector3 = {
|
||||
if (super.Position == Vector3.Zero) {
|
||||
|
|
@ -41,20 +42,29 @@ class DummyExplodingEntity(
|
|||
def DamageModel: DamageAndResistance = DummyExplodingEntity.DefaultDamageResistanceModel
|
||||
|
||||
def Definition: ObjectDefinition with VitalityDefinition = {
|
||||
new DefinitionWrappedInVitality(obj.Definition)
|
||||
new DefinitionWrappedInVitality(obj)
|
||||
}
|
||||
}
|
||||
|
||||
private class DefinitionWrappedInVitality(definition: ObjectDefinition)
|
||||
extends ObjectDefinition(definition.ObjectId)
|
||||
private class DefinitionWrappedInVitality(private val entity: PlanetSideGameObject)
|
||||
extends ObjectDefinition(entity.Definition.ObjectId)
|
||||
with VitalityDefinition {
|
||||
innateDamage = definition match {
|
||||
private val internalDefinition = entity.Definition
|
||||
|
||||
innateDamage = internalDefinition match {
|
||||
case v: VitalityDefinition if v.innateDamage.nonEmpty => v.innateDamage.get
|
||||
case p: ProjectileDefinition => p
|
||||
case _ => GlobalDefinitions.no_projectile
|
||||
}
|
||||
Name = { definition.Name }
|
||||
|
||||
Name = internalDefinition.Name
|
||||
|
||||
DefaultHealth = 1 //just cuz
|
||||
|
||||
override def ObjectId: Int = entity match {
|
||||
case p: Projectile => p.tool_def.ObjectId //projectiles point back to the weapon of origin
|
||||
case _ => internalDefinition.ObjectId //what are we?
|
||||
}
|
||||
}
|
||||
|
||||
object DummyExplodingEntity {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue