package net.psforever.objects.serverobject.painbox

import net.psforever.objects.definition.ObjectDefinition
import net.psforever.types.Vector3

class PainboxDefinition(objectId : Int) extends ObjectDefinition(objectId) {
  private var alwaysOn : Boolean = true
  private var radius : Float = 0f
  private var damage : Int = 10
  private var sphereOffset = Vector3(0f, 0f, -0.4f)
  private var hasNearestDoorDependency = false

  objectId match {
    case 622 =>
      Name = "painbox"
      alwaysOn = false
      radius = 10f // Guess - not in game_objects.adb.lst - probably not radius based but it will have to do for the moment
      damage = 0
    case 623 =>
      Name = "painbox_continuous"
      radius = 10f // Guess - not in game_objects.adb.lst - probably not radius based but it will have to do for the moment
    case 624 =>
      Name = "painbox_door_radius"
      alwaysOn = false
      radius = 10f * 0.6928f
      hasNearestDoorDependency = true
      damage = 0
    case 625 =>
      Name = "painbox_door_radius_continuous"
      radius = 10f * 0.6928f
      hasNearestDoorDependency = true
    case 626 =>
      Name = "painbox_radius"
      alwaysOn = false
      radius = 10f * 0.6928f
      damage = 0
    case 627 =>
      Name = "painbox_radius_continuous"
      radius = 8.55f
      sphereOffset = Vector3.Zero
    case _ =>
      throw new IllegalArgumentException(s"${objectId} is not a valid painbox object id")
  }

  def Radius : Float = radius
  def AlwaysOn : Boolean = alwaysOn
  def Damage : Int = damage
  def SphereOffset : Vector3 = sphereOffset
  def HasNearestDoorDependency : Boolean = hasNearestDoorDependency
}
