megamek.common
Class PlanetaryConditions

java.lang.Object
  extended by megamek.common.PlanetaryConditions
All Implemented Interfaces:
java.io.Serializable

public class PlanetaryConditions
extends java.lang.Object
implements java.io.Serializable

This class will hold all the information on planetary conditions and a variety of helper functions for those conditions

See Also:
Serialized Form

Field Summary
static int ATMO_HIGH
           
static int ATMO_SIZE
           
static int ATMO_STANDARD
           
static int ATMO_THIN
           
static int ATMO_TRACE
           
static int ATMO_VACUUM
           
static int ATMO_VHIGH
           
static java.lang.String[] atmoNames
           
static int DIR_SIZE
           
static int FOG_HEAVY
           
static int FOG_LIGHT
           
static int FOG_NONE
           
static int FOG_SIZE
           
static int L_DAY
           
static int L_DUSK
           
static int L_FULL_MOON
           
static int L_MOONLESS
           
static int L_PITCH_BLACK
           
static int L_SIZE
           
static int WE_DOWNPOUR
           
static int WE_HEAVY_HAIL
           
static int WE_HEAVY_RAIN
           
static int WE_HEAVY_SNOW
           
static int WE_ICE_STORM
           
static int WE_LIGHT_HAIL
           
static int WE_LIGHT_RAIN
           
static int WE_LIGHT_SNOW
           
static int WE_MOD_RAIN
           
static int WE_MOD_SNOW
           
static int WE_NONE
           
static int WE_SIZE
           
static int WE_SLEET
           
static int WI_LIGHT_GALE
           
static int WI_MOD_GALE
           
static int WI_NONE
           
static int WI_SIZE
           
static int WI_STORM
           
static int WI_STRONG_GALE
           
static int WI_TORNADO_F13
           
static int WI_TORNADO_F4
           
 
Constructor Summary
PlanetaryConditions()
          Constructor
PlanetaryConditions(PlanetaryConditions other)
          Creates new PlanetaryConditions that is a duplicate of another
 
Method Summary
 java.lang.String cannotStartFire()
           
 java.lang.Object clone()
          clone!
 void determineWind()
           
 int getAtmosphere()
           
 java.lang.String getAtmosphereCurrentName()
           
static java.lang.String getAtmosphereDisplayableName(int type)
           
 int getDropRate()
           
 int getFog()
           
 java.lang.String getFogCurrentName()
           
static java.lang.String getFogDisplayableName(int type)
           
 float getGravity()
           
 int getGravityPilotPenalty()
          gravity penalties to PSRs According to email from TPTB, you apply a penalty for every 0.5 gravities above or below 1 (rounding up)
 int getIgniteModifiers()
          modifiers for fire ignition
 int getLight()
           
 java.lang.String getLightCurrentName()
           
static java.lang.String getLightDisplayableName(int type)
           
 int getLightHeatBonus(int heat)
          heat bonus to hit for being overheated in darkness
 int getLightHitPenalty(boolean isWeapon)
          to-hit penalty for light
 int getLightPilotPenalty()
          piloting penalty for running/flanking/etc for light
 int getMaxWindStrength()
           
 int getMinWindStrength()
           
 int getMovementMods(Entity en)
          Planetary conditions on movement, except for gravity
 int getTemperature()
           
 int getTemperatureDifference(int high, int low)
          Returns how much higher or lower than a given range, divided by ten, rounded up, the temperature is
 int getVisualRange(Entity en, boolean targetSpotlight)
          visual range based on conditions
 int getWeather()
           
 java.lang.String getWeatherCurrentName()
           
static java.lang.String getWeatherDisplayableName(int type)
           
 int getWeatherHitPenalty(Entity en)
          to-hit penalty for weather
 int getWeatherPilotPenalty()
          piloting penalty for weather
 java.lang.String getWindCurrentName()
           
 int getWindDirection()
           
 java.lang.String getWindDirName()
           
static java.lang.String getWindDisplayableName(int type)
           
 int getWindPilotPenalty(Entity en)
          piloting penalty for wind
 int getWindStrength()
           
 boolean hasEMI()
           
 boolean isRecklessConditions()
           
 boolean isSandBlowing()
           
 boolean isTerrainAffected()
           
 boolean isVacuum()
           
 boolean putOutFire()
          Do a roll for these weather conditions putting out fire return boolean
 void setAtmosphere(int a)
           
 void setBlowingSand(boolean b)
           
 void setEMI(boolean b)
           
 void setFog(int fog)
           
 void setGravity(float f)
           
 void setLight(int type)
           
 void setMaxWindStrength(int strength)
           
 void setMinWindStrength(int strength)
           
 void setShiftingWindDirection(boolean b)
           
 void setShiftingWindStrength(boolean b)
           
 void setTemperature(int tem)
           
 void setTerrainAffected(boolean b)
           
 void setWeather(int type)
           
 void setWindDirection(int type)
           
 void setWindStrength(int type)
           
 boolean shiftingWindDirection()
           
 boolean shiftingWindStrength()
           
 java.lang.String whyDoomed(Entity en)
          is the given entity type doomed in these conditions?
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

L_DAY

public static final int L_DAY
See Also:
Constant Field Values

L_DUSK

public static final int L_DUSK
See Also:
Constant Field Values

L_FULL_MOON

public static final int L_FULL_MOON
See Also:
Constant Field Values

L_MOONLESS

public static final int L_MOONLESS
See Also:
Constant Field Values

L_PITCH_BLACK

public static final int L_PITCH_BLACK
See Also:
Constant Field Values

L_SIZE

public static final int L_SIZE

WE_NONE

public static final int WE_NONE
See Also:
Constant Field Values

WE_LIGHT_RAIN

public static final int WE_LIGHT_RAIN
See Also:
Constant Field Values

WE_MOD_RAIN

public static final int WE_MOD_RAIN
See Also:
Constant Field Values

WE_HEAVY_RAIN

public static final int WE_HEAVY_RAIN
See Also:
Constant Field Values

WE_DOWNPOUR

public static final int WE_DOWNPOUR
See Also:
Constant Field Values

WE_LIGHT_SNOW

public static final int WE_LIGHT_SNOW
See Also:
Constant Field Values

WE_MOD_SNOW

public static final int WE_MOD_SNOW
See Also:
Constant Field Values

WE_HEAVY_SNOW

public static final int WE_HEAVY_SNOW
See Also:
Constant Field Values

WE_SLEET

public static final int WE_SLEET
See Also:
Constant Field Values

WE_ICE_STORM

public static final int WE_ICE_STORM
See Also:
Constant Field Values

WE_LIGHT_HAIL

public static final int WE_LIGHT_HAIL
See Also:
Constant Field Values

WE_HEAVY_HAIL

public static final int WE_HEAVY_HAIL
See Also:
Constant Field Values

WE_SIZE

public static final int WE_SIZE

WI_NONE

public static final int WI_NONE
See Also:
Constant Field Values

WI_LIGHT_GALE

public static final int WI_LIGHT_GALE
See Also:
Constant Field Values

WI_MOD_GALE

public static final int WI_MOD_GALE
See Also:
Constant Field Values

WI_STRONG_GALE

public static final int WI_STRONG_GALE
See Also:
Constant Field Values

WI_STORM

public static final int WI_STORM
See Also:
Constant Field Values

WI_TORNADO_F13

public static final int WI_TORNADO_F13
See Also:
Constant Field Values

WI_TORNADO_F4

public static final int WI_TORNADO_F4
See Also:
Constant Field Values

WI_SIZE

public static final int WI_SIZE

DIR_SIZE

public static final int DIR_SIZE

ATMO_VACUUM

public static final int ATMO_VACUUM
See Also:
Constant Field Values

ATMO_TRACE

public static final int ATMO_TRACE
See Also:
Constant Field Values

ATMO_THIN

public static final int ATMO_THIN
See Also:
Constant Field Values

ATMO_STANDARD

public static final int ATMO_STANDARD
See Also:
Constant Field Values

ATMO_HIGH

public static final int ATMO_HIGH
See Also:
Constant Field Values

ATMO_VHIGH

public static final int ATMO_VHIGH
See Also:
Constant Field Values

atmoNames

public static java.lang.String[] atmoNames

ATMO_SIZE

public static final int ATMO_SIZE

FOG_NONE

public static final int FOG_NONE
See Also:
Constant Field Values

FOG_LIGHT

public static final int FOG_LIGHT
See Also:
Constant Field Values

FOG_HEAVY

public static final int FOG_HEAVY
See Also:
Constant Field Values

FOG_SIZE

public static final int FOG_SIZE
Constructor Detail

PlanetaryConditions

public PlanetaryConditions()
Constructor


PlanetaryConditions

public PlanetaryConditions(PlanetaryConditions other)
Creates new PlanetaryConditions that is a duplicate of another

Method Detail

clone

public java.lang.Object clone()
clone!

Overrides:
clone in class java.lang.Object

getLightDisplayableName

public static java.lang.String getLightDisplayableName(int type)

getWeatherDisplayableName

public static java.lang.String getWeatherDisplayableName(int type)

getWindDisplayableName

public static java.lang.String getWindDisplayableName(int type)

getAtmosphereDisplayableName

public static java.lang.String getAtmosphereDisplayableName(int type)

getFogDisplayableName

public static java.lang.String getFogDisplayableName(int type)

getWindDirName

public java.lang.String getWindDirName()

getLightCurrentName

public java.lang.String getLightCurrentName()

getWeatherCurrentName

public java.lang.String getWeatherCurrentName()

getWindCurrentName

public java.lang.String getWindCurrentName()

getAtmosphereCurrentName

public java.lang.String getAtmosphereCurrentName()

getFogCurrentName

public java.lang.String getFogCurrentName()

getLightHitPenalty

public int getLightHitPenalty(boolean isWeapon)
to-hit penalty for light


getLightHeatBonus

public int getLightHeatBonus(int heat)
heat bonus to hit for being overheated in darkness


getLightPilotPenalty

public int getLightPilotPenalty()
piloting penalty for running/flanking/etc for light


getWeatherHitPenalty

public int getWeatherHitPenalty(Entity en)
to-hit penalty for weather


getWeatherPilotPenalty

public int getWeatherPilotPenalty()
piloting penalty for weather


getGravityPilotPenalty

public int getGravityPilotPenalty()
gravity penalties to PSRs According to email from TPTB, you apply a penalty for every 0.5 gravities above or below 1 (rounding up)


getWindPilotPenalty

public int getWindPilotPenalty(Entity en)
piloting penalty for wind


determineWind

public void determineWind()

getIgniteModifiers

public int getIgniteModifiers()
modifiers for fire ignition


putOutFire

public boolean putOutFire()
Do a roll for these weather conditions putting out fire return boolean


getTemperatureDifference

public int getTemperatureDifference(int high,
                                    int low)
Returns how much higher or lower than a given range, divided by ten, rounded up, the temperature is


cannotStartFire

public java.lang.String cannotStartFire()
Returns:
a String with the reason why you cannot start a fire here

getMovementMods

public int getMovementMods(Entity en)
Planetary conditions on movement, except for gravity

Parameters:
entity - - the entity in question
Returns:
an int with the modifier to movement

whyDoomed

public java.lang.String whyDoomed(Entity en)
is the given entity type doomed in these conditions?

Returns:
a string given the reason for being doomed, null if not doomed

getVisualRange

public int getVisualRange(Entity en,
                          boolean targetSpotlight)
visual range based on conditions


getDropRate

public int getDropRate()

setLight

public void setLight(int type)

getLight

public int getLight()

setWeather

public void setWeather(int type)

getWeather

public int getWeather()

setWindStrength

public void setWindStrength(int type)

getWindStrength

public int getWindStrength()

setWindDirection

public void setWindDirection(int type)

getWindDirection

public int getWindDirection()

setShiftingWindDirection

public void setShiftingWindDirection(boolean b)

shiftingWindDirection

public boolean shiftingWindDirection()

setShiftingWindStrength

public void setShiftingWindStrength(boolean b)

shiftingWindStrength

public boolean shiftingWindStrength()

setAtmosphere

public void setAtmosphere(int a)

getAtmosphere

public int getAtmosphere()

setTemperature

public void setTemperature(int tem)

getTemperature

public int getTemperature()

isVacuum

public boolean isVacuum()

setGravity

public void setGravity(float f)

getGravity

public float getGravity()

setEMI

public void setEMI(boolean b)

hasEMI

public boolean hasEMI()

getFog

public int getFog()

setFog

public void setFog(int fog)

setTerrainAffected

public void setTerrainAffected(boolean b)

isTerrainAffected

public boolean isTerrainAffected()

isRecklessConditions

public boolean isRecklessConditions()

getMaxWindStrength

public int getMaxWindStrength()

setMaxWindStrength

public void setMaxWindStrength(int strength)

getMinWindStrength

public int getMinWindStrength()

setMinWindStrength

public void setMinWindStrength(int strength)

isSandBlowing

public boolean isSandBlowing()

setBlowingSand

public void setBlowingSand(boolean b)