public class HazardTerrain extends Hazards
Hazards.CombatEffect
HazardConstants.EffectOnMovement, HazardConstants.EffectOnStrike, HazardConstants.RangeStrikeSpecialEffect, HazardConstants.ScopeOfEffectOnStrike, HazardConstants.SpecialEffect
Modifier and Type | Field and Description |
---|---|
(package private) static HazardTerrain |
BOG |
static HazardTerrain |
BRAMBLES |
(package private) static HazardTerrain |
DRIFT |
(package private) static HazardTerrain |
LAKE
Only waterdweller can enter a lake, but anybody can fly over it.
|
private static java.util.logging.Logger |
LOGGER |
(package private) static HazardTerrain |
PLAINS |
(package private) static HazardTerrain |
SAND |
(package private) static HazardTerrain |
SPRING |
static HazardTerrain |
STONE
Stone native gains 1 skill when defending against non-native ;
Stone cannot be entered by non-native.
|
(package private) static HazardTerrain |
TARPIT |
private static java.util.Map<java.lang.String,HazardTerrain> |
TERRAIN_MAP
A map from the serialization string of a terrain to the instances.
|
(package private) static HazardTerrain |
TOWER |
(package private) static HazardTerrain |
TREE
Tree is a genuine Titan hazard, but the effect on anybody inside is
custom, as noone can enter a tree in Titan.
|
static HazardTerrain |
VOLCANO |
attackEffect, defenseEffect, effectOnFlyerMovement, effectOnGroundMovement, rangedAttackEffect, rangedDefenseEffect, rangeStrikeSpecial, terrainSpecial
Constructor and Description |
---|
HazardTerrain(java.lang.String name,
char code,
HazardConstants.EffectOnMovement effectOnGroundMovement,
HazardConstants.EffectOnMovement effectOnFlyerMovement,
Hazards.CombatEffect defenseEffect,
Hazards.CombatEffect attackEffect,
Hazards.CombatEffect rangedDefenseEffect,
Hazards.CombatEffect rangedAttackEffect,
HazardConstants.RangeStrikeSpecialEffect RangeStrikeSpecial,
HazardConstants.SpecialEffect terrainSpecial) |
Modifier and Type | Method and Description |
---|---|
boolean |
blocksFlyers() |
boolean |
blocksGround() |
boolean |
blocksLineOfSight()
Whether this terrain blocks rangestrike.
|
private int |
computeSkillOrPowerBonus(boolean firstIsNative,
boolean secondIsNative,
Hazards.CombatEffect effect,
HazardConstants.EffectOnStrike whichIsBonus,
HazardConstants.EffectOnStrike whichIsPenalty)
Do the real computation of the bonus (negative if penalty).
|
static java.util.Collection<HazardTerrain> |
getAllHazardTerrains()
Returns all available hazard terrains.
|
static HazardTerrain |
getDefaultTerrain() |
int |
getPowerBonusRangestrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature
rangestriking out from that terrain on a unspecified creature.
|
int |
getPowerBonusRangestruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature Rangestruck
in this terrain by a unspecified creature.
|
int |
getPowerBonusStrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature
striking out from that terrain on a unspecified creature.
|
int |
getPowerBonusStruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature struck
in this terrain by a unspecified creature.
|
int |
getPowerPenaltyRangestrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Power Factor of a creature
rangestriking out from that terrain on a unspecified creature.
|
int |
getPowerPenaltyRangestruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Strike Factor of a creature Rangestruck
in this terrain by a unspecified creature.
|
int |
getPowerPenaltyStrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Power Factor of a creature
striking out from that terrain on a unspecified creature.
|
int |
getPowerPenaltyStruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Strike Factor of a creature struck
in this terrain by a unspecified creature.
|
int |
getSkillBonusRangestrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature
rangestriking out from that terrain.
|
int |
getSkillBonusRangestrikeThrough(boolean rangestrikerIsNative)
Return the bonus to apply to the Strike Factor of a Creature whose
line-of-fire cross this hex.
|
int |
getSkillBonusRangestruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature Rangestruck
in this terrain.
|
int |
getSkillBonusStrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature
striking out from that terrain.
|
int |
getSkillBonusStruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the bonus to apply to the Strike Factor of a creature struck
in this terrain.
|
int |
getSkillPenaltyRangestrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Strike Factor of a creature
rangestriking out from that terrain.
|
int |
getSkillPenaltyRangestrikeThrough(boolean rangestrikerIsNative)
Return the penalty to apply to the Strike Factor of a Creature whose
line-of-fire cross this hex.
|
int |
getSkillPenaltyRangestruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Strike Factor of a creature Rangestruck
in this terrain.
|
int |
getSkillPenaltyStrikeFrom(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Strike Factor of a creature
striking out from that terrain.
|
int |
getSkillPenaltyStruckIn(boolean attackerIsNative,
boolean defenderIsNative)
Return the penalty to apply to the Strike Factor of a creature struck
in this terrain.
|
static HazardTerrain |
getTerrainByName(java.lang.String name)
Get the HazardTerrain by its name.
|
boolean |
isDamagingToNonNative()
Whether this terrain is damaging to non-native.
|
boolean |
isDamagingToWaterDweller()
Whether this terrain is damaging to water dweller.
|
boolean |
isFlyersNativeOnly() |
boolean |
isGroundNativeOnly() |
boolean |
isHealing()
Whether this terrain is healing
|
boolean |
isNativeBonusTerrain() |
boolean |
isNonNativePenaltyTerrain() |
boolean |
isPlains()
USE ONLY FOR BATTLELANDBUILDER!
|
boolean |
isSand()
USE ONLY FOR BATTLELANDBUILDER!
|
boolean |
isSlowingToNonNative()
Whether this terrain slows for the duration of the battle
|
boolean |
slows(boolean isNative,
boolean isFlyer) |
boolean |
slowsFlyer(boolean isNative) |
boolean |
slowsGround(boolean isNative) |
java.lang.String |
toString() |
private static final java.util.logging.Logger LOGGER
private static final java.util.Map<java.lang.String,HazardTerrain> TERRAIN_MAP
static final HazardTerrain PLAINS
static final HazardTerrain TREE
public static final HazardTerrain BRAMBLES
static final HazardTerrain DRIFT
public static final HazardTerrain VOLCANO
static final HazardTerrain BOG
static final HazardTerrain SAND
static final HazardTerrain TOWER
static final HazardTerrain LAKE
public static final HazardTerrain STONE
static final HazardTerrain SPRING
static final HazardTerrain TARPIT
public HazardTerrain(java.lang.String name, char code, HazardConstants.EffectOnMovement effectOnGroundMovement, HazardConstants.EffectOnMovement effectOnFlyerMovement, Hazards.CombatEffect defenseEffect, Hazards.CombatEffect attackEffect, Hazards.CombatEffect rangedDefenseEffect, Hazards.CombatEffect rangedAttackEffect, HazardConstants.RangeStrikeSpecialEffect RangeStrikeSpecial, HazardConstants.SpecialEffect terrainSpecial)
public boolean isNativeBonusTerrain()
public boolean isNonNativePenaltyTerrain()
public static HazardTerrain getTerrainByName(java.lang.String name)
name
- The name of the terrain to access.public static HazardTerrain getDefaultTerrain()
public static final java.util.Collection<HazardTerrain> getAllHazardTerrains()
public java.lang.String toString()
toString
in interface HazardConstants
toString
in class Hazards
public boolean blocksFlyers()
public boolean blocksGround()
public boolean isFlyersNativeOnly()
public boolean isGroundNativeOnly()
public boolean slowsGround(boolean isNative)
public boolean slowsFlyer(boolean isNative)
public boolean slows(boolean isNative, boolean isFlyer)
private int computeSkillOrPowerBonus(boolean firstIsNative, boolean secondIsNative, Hazards.CombatEffect effect, HazardConstants.EffectOnStrike whichIsBonus, HazardConstants.EffectOnStrike whichIsPenalty)
firstIsNative
- Whether the first creature (attacker for attack skill/power, defender for defense skill/power) is native heresecondIsNative
- Whether the second creature is native hereeffect
- The effect to usescope
- The scope to usewhichIsBonus
- Which effect is a bonus (power || skill)whichIsPenalty
- Which effect is a penalty (power || skill)ovalue
- The original adjustment of the effectpublic int getSkillBonusStrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getSkillPenaltyStrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain#getPowerBonusStrikeFrom(boolean, boolean)
#getPowerPenaltyStrikeFrom(boolean, boolean)
public int getSkillBonusStruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getSkillPenaltyStruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerBonusStrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerPenaltyStrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerBonusStruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerPenaltyStruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getSkillBonusRangestrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getSkillPenaltyRangestrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain#getPowerBonusRangestrikeFrom(boolean, boolean)
#getPowerPenaltyRangestrikeFrom(boolean, boolean)
public int getSkillBonusRangestruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getSkillPenaltyRangestruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerBonusRangestrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerPenaltyRangestrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerBonusRangestruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic int getPowerPenaltyRangestruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrainpublic boolean blocksLineOfSight()
public boolean isHealing()
public boolean isSlowingToNonNative()
public boolean isDamagingToNonNative()
public boolean isDamagingToWaterDweller()
public int getSkillBonusRangestrikeThrough(boolean rangestrikerIsNative)
public int getSkillPenaltyRangestrikeThrough(boolean rangestrikerIsNative)
public boolean isSand()
public boolean isPlains()