|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.variant.Hazards
net.sf.colossus.variant.HazardTerrain
public class HazardTerrain
This is a typesafe enumeration of all hazard terrains, i.e. the terrains used in the battle maps.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class net.sf.colossus.variant.Hazards |
---|
Hazards.CombatEffect |
Nested classes/interfaces inherited from interface net.sf.colossus.variant.HazardConstants |
---|
HazardConstants.EffectOnMovement, HazardConstants.EffectOnStrike, HazardConstants.RangeStrikeSpecialEffect, HazardConstants.ScopeOfEffectOnStrike, HazardConstants.SpecialEffect |
Field Summary | |
---|---|
(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
|
static HazardTerrain |
STONE
Stone native gains 1 skill when defending against non-native ; Stone cannot be entered by non-native. |
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
|
Fields inherited from class net.sf.colossus.variant.Hazards |
---|
attackEffect, defenseEffect, effectOnFlyerMovement, effectOnGroundMovement, rangedAttackEffect, rangedDefenseEffect, rangeStrikeSpecial, terrainSpecial |
Constructor Summary | |
---|---|
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)
|
Method Summary | |
---|---|
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 |
isNativeBonusTerrain()
|
boolean |
isNonNativePenaltyTerrain()
|
boolean |
isPlains()
USE ONLY FOR BATTLELANDBUILDER! |
boolean |
isSand()
USE ONLY FOR BATTLELANDBUILDER! |
boolean |
slows(boolean isNative,
boolean isFlyer)
|
boolean |
slowsFlyer(boolean isNative)
|
boolean |
slowsGround(boolean isNative)
|
java.lang.String |
toString()
|
Methods inherited from class net.sf.colossus.variant.Hazards |
---|
getCode, getName |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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)
Method Detail |
---|
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 effect
public int getSkillBonusStrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public 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 HazardTerrain
public int getSkillPenaltyStruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerBonusStrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerPenaltyStrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerBonusStruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerPenaltyStruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getSkillBonusRangestrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public 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 HazardTerrain
public int getSkillPenaltyRangestruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerBonusRangestrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerPenaltyRangestrikeFrom(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerBonusRangestruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public int getPowerPenaltyRangestruckIn(boolean attackerIsNative, boolean defenderIsNative)
attackerIsNative
- Whether the attacker is native from this HazardTerraindefenderIsNative
- Whether the defender is native from this HazardTerrain
public boolean blocksLineOfSight()
public boolean isDamagingToNonNative()
public boolean isDamagingToWaterDweller()
public int getSkillBonusRangestrikeThrough(boolean rangestrikerIsNative)
public int getSkillPenaltyRangestrikeThrough(boolean rangestrikerIsNative)
public boolean isSand()
public boolean isPlains()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |