com.springrts.ai.oo
Class WeaponDef

java.lang.Object
  extended by com.springrts.ai.oo.WeaponDef
All Implemented Interfaces:
Comparable<WeaponDef>

public class WeaponDef
extends Object
implements Comparable<WeaponDef>


Method Summary
 int compareTo(WeaponDef other)
           
 boolean equals(Object otherObject)
           
 float getAccuracy()
          Inaccuracy of whole burst
 float getAreaOfEffect()
           
 float getBeamTime()
           
 float getBounceRebound()
           
 float getBounceSlip()
           
 float getCameraShake()
           
 String getCegTag()
           
 int getCollisionFlags()
           
 float getCollisionSize()
           
 float getCoreThickness()
           
 float getCost(Resource c_resourceId)
           
 float getCoverageRange()
          Range of interceptors.
 Map<String,String> getCustomParams()
           
 float getCylinderTargetting()
          If greater than 0, the range will be checked in a cylinder (height=range*cylinderTargetting) instead of a sphere.
 Damage getDamage()
           
 float getDance()
          How much the missile will dance.
 String getDescription()
           
 float getDuration()
           
 float getDynDamageExp()
           
 float getDynDamageMin()
           
 float getDynDamageRange()
           
 float getEdgeEffectiveness()
           
 float getExplosionSpeed()
           
 float getFalloffRate()
           
 String getFileName()
           
 float getFireStarter()
           
 int getFlightTime()
           
 int getGraphicsType()
           
 float getHeightBoostFactor()
          Controls cannon range height boost.
 float getHeightMod()
           
 int getHighTrajectory()
          Per weapon high trajectory setting.
 float getIntensity()
           
 int getInterceptedByShieldType()
          The type of shields that can intercept this weapon (bitfield).
 int getInterceptor()
          Can intercept targetable weapons shots.
 float getLaserFlareSize()
           
 float getLeadBonus()
          Factor for increasing the leadLimit with experience
 float getLeadLimit()
          Maximum distance the weapon will lead the target
 int getLodDistance()
           
 float getMaxAngle()
           
 float getMaxVelocity()
           
 float getMinIntensity()
          For beam-lasers only - always hit with some minimum intensity (a damage coeffcient normally dependent on distance).
 float getMovingAccuracy()
          Inaccuracy while owner moving
 float getMyGravity()
           
 String getName()
           
 int getNumBounce()
           
 int getOnlyTargetCategory()
           
 float getPredictBoost()
          Replaces hardcoded behaviour for burnblow cannons
 float getProjectileSpeed()
           
 int getProjectilesPerShot()
           
 float getProximityPriority()
          Multiplier for the distance to the target for priority calculations.
 float getRange()
           
 float getReload()
           
 float getRestTime()
           
 float getSalvoDelay()
           
 int getSalvoSize()
           
 Shield getShield()
           
 float getSize()
           
 float getSizeGrowth()
           
 float getSprayAngle()
          Inaccuracy of individual shots inside burst
 float getStartVelocity()
           
 float getStockpileTime()
          Build time of a missile
 float getSupplyCost()
           
 int getTargetable()
          Shoots interceptable projectiles.
 float getTargetBorder()
          If nonzero, targetting units will TryTarget at the edge of collision sphere (radius*tag value, [-1;1]) instead of its centre.
 float getTargetMoveError()
          Fraction of targets move speed that is used as error offset
 float getThickness()
           
 float getTrajectoryHeight()
          How high trajectory missiles will try to fly in.
 float getTurnRate()
           
 String getType()
           
 float getUpTime()
           
 int getVisibleShieldHitFrames()
          The number of frames to draw the shield after it has been hit.
 float getWeaponAcceleration()
           
 int getWeaponDefId()
           
 float getWobble()
          How much the missile will wobble around its course.
 int hashCode()
           
 boolean isAbleToAttackGround()
           
 boolean isAvoidFeature()
          Tries to avoid features while aiming?
 boolean isAvoidFriendly()
          Tries to avoid friendly units while aiming?
 boolean isAvoidNeutral()
          Tries to avoid neutral units while aiming?
 boolean isBeamBurst()
           
 boolean isDropped()
           
 boolean isDynDamageInverted()
           
 boolean isExteriorShield()
          If the shield only affects stuff coming from outside shield radius.
 boolean isFireSubmersed()
           
 boolean isFixedLauncher()
           
 boolean isGravityAffected()
           
 boolean isGroundBounce()
           
 boolean isImpactOnly()
          The weapon damages by impacting, not by exploding.
 boolean isLargeBeamLaser()
           
 boolean isManualFire()
          Has to be fired manually (by the player or an AI, example: D-Gun)
 boolean isNoAutoTarget()
          Can not target anything (for example: anti-nuke, D-Gun)
 boolean isNoExplode()
           
 boolean isNoSelfDamage()
           
 boolean isOnlyForward()
           
 boolean isParalyzer()
          The weapon will only paralyze, not do real damage.
 boolean isSelfExplode()
           
 boolean isShield()
          If the weapon is a shield rather than a weapon.
 boolean isShieldRepulser()
          If the weapon should be repulsed or absorbed.
 boolean isSmartShield()
          If the shield only affects enemy projectiles.
 boolean isSoundTrigger()
           
 boolean isStockpileable()
           
 boolean isSubMissile()
          Lets a torpedo travel above water like it does below water
 boolean isSweepFire()
           
 boolean isTracks()
           
 boolean isTurret()
           
 boolean isVisibleShield()
          If the shield should be graphically shown.
 boolean isVisibleShieldRepulse()
          If a small graphic should be shown at each repulse.
 boolean isWaterBounce()
           
 boolean isWaterWeapon()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

getWeaponDefId

public int getWeaponDefId()

compareTo

public int compareTo(WeaponDef other)
Specified by:
compareTo in interface Comparable<WeaponDef>

equals

public boolean equals(Object otherObject)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object

getName

public String getName()

getType

public String getType()

getDescription

public String getDescription()

getFileName

public String getFileName()

getCegTag

public String getCegTag()

getRange

public float getRange()

getHeightMod

public float getHeightMod()

getAccuracy

public float getAccuracy()
Inaccuracy of whole burst


getSprayAngle

public float getSprayAngle()
Inaccuracy of individual shots inside burst


getMovingAccuracy

public float getMovingAccuracy()
Inaccuracy while owner moving


getTargetMoveError

public float getTargetMoveError()
Fraction of targets move speed that is used as error offset


getLeadLimit

public float getLeadLimit()
Maximum distance the weapon will lead the target


getLeadBonus

public float getLeadBonus()
Factor for increasing the leadLimit with experience


getPredictBoost

public float getPredictBoost()
Replaces hardcoded behaviour for burnblow cannons


getAreaOfEffect

public float getAreaOfEffect()

isNoSelfDamage

public boolean isNoSelfDamage()

getFireStarter

public float getFireStarter()

getEdgeEffectiveness

public float getEdgeEffectiveness()

getSize

public float getSize()

getSizeGrowth

public float getSizeGrowth()

getCollisionSize

public float getCollisionSize()

getSalvoSize

public int getSalvoSize()

getSalvoDelay

public float getSalvoDelay()

getReload

public float getReload()

getBeamTime

public float getBeamTime()

isBeamBurst

public boolean isBeamBurst()

isWaterBounce

public boolean isWaterBounce()

isGroundBounce

public boolean isGroundBounce()

getBounceRebound

public float getBounceRebound()

getBounceSlip

public float getBounceSlip()

getNumBounce

public int getNumBounce()

getMaxAngle

public float getMaxAngle()

getRestTime

public float getRestTime()

getUpTime

public float getUpTime()

getFlightTime

public int getFlightTime()

getCost

public float getCost(Resource c_resourceId)

getSupplyCost

public float getSupplyCost()

getProjectilesPerShot

public int getProjectilesPerShot()

isTurret

public boolean isTurret()

isOnlyForward

public boolean isOnlyForward()

isFixedLauncher

public boolean isFixedLauncher()

isWaterWeapon

public boolean isWaterWeapon()

isFireSubmersed

public boolean isFireSubmersed()

isSubMissile

public boolean isSubMissile()
Lets a torpedo travel above water like it does below water


isTracks

public boolean isTracks()

isDropped

public boolean isDropped()

isParalyzer

public boolean isParalyzer()
The weapon will only paralyze, not do real damage.


isImpactOnly

public boolean isImpactOnly()
The weapon damages by impacting, not by exploding.


isNoAutoTarget

public boolean isNoAutoTarget()
Can not target anything (for example: anti-nuke, D-Gun)


isManualFire

public boolean isManualFire()
Has to be fired manually (by the player or an AI, example: D-Gun)


getInterceptor

public int getInterceptor()
Can intercept targetable weapons shots. example: anti-nuke

See Also:
getTargetable()

getTargetable

public int getTargetable()
Shoots interceptable projectiles. Shots can be intercepted by interceptors. example: nuke

See Also:
getInterceptor()

isStockpileable

public boolean isStockpileable()

getCoverageRange

public float getCoverageRange()
Range of interceptors. example: anti-nuke

See Also:
getInterceptor()

getStockpileTime

public float getStockpileTime()
Build time of a missile


getIntensity

public float getIntensity()

getThickness

public float getThickness()

getLaserFlareSize

public float getLaserFlareSize()

getCoreThickness

public float getCoreThickness()

getDuration

public float getDuration()

getLodDistance

public int getLodDistance()

getFalloffRate

public float getFalloffRate()

getGraphicsType

public int getGraphicsType()

isSoundTrigger

public boolean isSoundTrigger()

isSelfExplode

public boolean isSelfExplode()

isGravityAffected

public boolean isGravityAffected()

getHighTrajectory

public int getHighTrajectory()
Per weapon high trajectory setting. UnitDef also has this property.

Returns:
0: low 1: high 2: unit

getMyGravity

public float getMyGravity()

isNoExplode

public boolean isNoExplode()

getStartVelocity

public float getStartVelocity()

getWeaponAcceleration

public float getWeaponAcceleration()

getTurnRate

public float getTurnRate()

getMaxVelocity

public float getMaxVelocity()

getProjectileSpeed

public float getProjectileSpeed()

getExplosionSpeed

public float getExplosionSpeed()

getOnlyTargetCategory

public int getOnlyTargetCategory()

getWobble

public float getWobble()
How much the missile will wobble around its course.


getDance

public float getDance()
How much the missile will dance.


getTrajectoryHeight

public float getTrajectoryHeight()
How high trajectory missiles will try to fly in.


isLargeBeamLaser

public boolean isLargeBeamLaser()

isShield

public boolean isShield()
If the weapon is a shield rather than a weapon.


isShieldRepulser

public boolean isShieldRepulser()
If the weapon should be repulsed or absorbed.


isSmartShield

public boolean isSmartShield()
If the shield only affects enemy projectiles.


isExteriorShield

public boolean isExteriorShield()
If the shield only affects stuff coming from outside shield radius.


isVisibleShield

public boolean isVisibleShield()
If the shield should be graphically shown.


isVisibleShieldRepulse

public boolean isVisibleShieldRepulse()
If a small graphic should be shown at each repulse.


getVisibleShieldHitFrames

public int getVisibleShieldHitFrames()
The number of frames to draw the shield after it has been hit.


getInterceptedByShieldType

public int getInterceptedByShieldType()
The type of shields that can intercept this weapon (bitfield). The weapon can be affected by shields if: (shield.getInterceptType() & weapon.getInterceptedByShieldType()) != 0

See Also:
getInterceptType()

isAvoidFriendly

public boolean isAvoidFriendly()
Tries to avoid friendly units while aiming?


isAvoidFeature

public boolean isAvoidFeature()
Tries to avoid features while aiming?


isAvoidNeutral

public boolean isAvoidNeutral()
Tries to avoid neutral units while aiming?


getTargetBorder

public float getTargetBorder()
If nonzero, targetting units will TryTarget at the edge of collision sphere (radius*tag value, [-1;1]) instead of its centre.


getCylinderTargetting

public float getCylinderTargetting()
If greater than 0, the range will be checked in a cylinder (height=range*cylinderTargetting) instead of a sphere.


getMinIntensity

public float getMinIntensity()
For beam-lasers only - always hit with some minimum intensity (a damage coeffcient normally dependent on distance). Do not confuse this with the intensity tag, it i completely unrelated.


getHeightBoostFactor

public float getHeightBoostFactor()
Controls cannon range height boost. default: -1: automatically calculate a more or less sane value


getProximityPriority

public float getProximityPriority()
Multiplier for the distance to the target for priority calculations.


getCollisionFlags

public int getCollisionFlags()

isSweepFire

public boolean isSweepFire()

isAbleToAttackGround

public boolean isAbleToAttackGround()

getCameraShake

public float getCameraShake()

getDynDamageExp

public float getDynDamageExp()

getDynDamageMin

public float getDynDamageMin()

getDynDamageRange

public float getDynDamageRange()

isDynDamageInverted

public boolean isDynDamageInverted()

getCustomParams

public Map<String,String> getCustomParams()

getDamage

public Damage getDamage()

getShield

public Shield getShield()