Package com.starpoints.game.figure
Class LaserTower
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Figure
-
- com.starpoints.game.ComputerFigure
-
- com.starpoints.game.figure.LaserTower
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
SuperLaserTower
public class LaserTower extends ComputerFigure
Enemy that fires lasers but does not move.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intcounterFire counter for laser beam.protected intFIRE_DELAYLaser fire delay between aiming and firing.protected intFIRE_FREQUENCYLaser fire frequency.protected booleanisFiringFlag for laser beam.-
Fields inherited from class com.starpoints.game.ComputerFigure
pointList, speedCount, wantsToEnterBlue
-
Fields inherited from class com.starpoints.game.Figure
ABSMAXENERGY, affectsBlue, alreadyKilled, colorlistener, DEFAULT_FIGURE_PAINTERCLASS, dieListener, dieReason, DOWN, energylistener, heatLevel, heatlistener, hoverCount, hoverHeight, hoverlistener, imageName, initialEnergy, INITIALRAMPOWER, isRocketTarget, item, itemlistener, killer, LEFT, lives, MAXHOVERHEIGHT, maxRadius, MAXSLOTS, money, moved, movelistener, name, NONE, number, oldItem, oldRocketXP, oldRocketYP, PANIC, penalty, permItems, pointBonus, pointlistener, points, ramlistener, ramPower, RIGHT, side, sinker, slots, STEPLEFT, STEPRIGHT, stunCount, stunlistener, sumPoints, UP, USE_ITEM, viewDir, visibilitylistener, visibleCount, wantsToUseItem, winCounter
-
Fields inherited from class com.starpoints.game.Thing
energy, energyFx, energyMaxSoundPlayed, energyModifications, explosionCounter, game, innerColor, invulnCount, isAffectedByBlack, isAffectedByGray, level, MAX_TEXTPAINT, maxEnergy, nextID, outerColor, p, shieldCount, status, text
-
-
Constructor Summary
Constructors Constructor Description LaserTower(Game game, FigureInfo figureInfo)Creates a new LaserTower.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStateProperties(ThingState state, AnimationInfo animation)Adds properties necessary for LaserTower painting.protected booleancheckEnemy(Figure f)Checks, if a figure is relevant for the closest enemy determination.protected voiddoSpecialUpdate(AnimationInfo animation)This method is called at the end of the regular updateThing()-method.protected java.lang.StringgetBeamSound()Gets the sound to play when aiming.protected java.lang.StringgetFireSound()Gets the sound to play when firing laser.java.lang.StringgetPainterClassname()Gets the fully qualified classname of the Painter to use for this item (in 2D game).PointgetTarget()Gets the current target (or null, if not aiming).booleanisFiring()Checks, if the laser tower is currently firing.protected voidperformLaserEffect(Thing target, AnimationInfo animation)Performs the laser hit effect.protected voidreInit(Field f)Reinitializes the figure after each level.protected booleanwantsToMove()Checks, if this figure wants to move.-
Methods inherited from class com.starpoints.game.ComputerFigure
calculateItemRating, calculateNextPoint, calculatePointRating, doCalculateNextPoint, entersExplosion, findClosestEnemy, getDistance, getDistance, getIq, isApplyingLevelInfoIQ, isDummy, isForbiddenItem, isRamTarget, isUnwantedItem, isVisible, modifyByColor
-
Methods inherited from class com.starpoints.game.Figure
addEnergy, addFigureColorListener, addFigureEnergyListener, addFigureHeatListener, addFigureHoverListener, addFigureItemListener, addFigureKillListener, addFigureMoveListener, addFigurePointListener, addFigureRamListener, addFigureStunListener, addFigureVisibilityListener, addHeat, addInitialEnergy, addLife, addMaxEnergy, addMoney, addPenalty, addPermanentItem, addPoints, addSlots, affectsBlue, beforeMove, beRammed, createState, determineIQ, determineIQ, die, drawState, entersColor, fireColorEnterEvent, fireColorStayEvent, fireDieEvent, fireEnergyChangeEvent, fireEnergyLossEvent, fireGainPermanentItemEvent, fireHeatChangeEvent, fireHoverEvent, fireKillsEnemy, fireLoseItemEvent, fireLosePermanentItemEvent, fireLostPermanentItemEvent, fireMoveEvent, firePickesUpBombEvent, firePickesUpExplosiveEvent, firePickesUpItemEvent, firePointsChangeEvent, firePointSumChangeEvent, fireRamEvent, fireRamPowerEvent, fireSlotsChangeEvent, fireStunEvent, fireUseItemEvent, fireVisibilityChangesEvent, getDieReason, getDyingClip, getExplosionClip, getFreeSlots, getHeatLevel, getHoverHeight, getHoverRounds, getImageName, getInitialEnergy, getInvisibilityRounds, getItem, getKillBonus, getLifes, getMaxSlots, getMoney, getName, getNumber, getPermanentItems, getPoints, getPointSum, getRamPower, getSlots, getSpeed, getStunCount, getWinCount, hasMoved, hasPermanentItem, hasPermanentItem, hover, increasePointSum, invulnerable, isAffectedByBlack, isAffectedByGray, isApplyingLevelInfoSpeed, isAvailableInEditor, isDrawingNumber, isHovering, isRocketTarget, isSinking, isStunned, isVisible, loseItem, losePermanentItem, losePermanentItem, losePermanentItemInternal, onAddHeat, onAfterDeath, onBeforeDie, onBeforeRemoveEnergy, onEnemyKilled, onExplode, onRoundBegin, playDyingSound, removeEnergy, removeFigureColorListener, removeFigureEnergyListener, removeFigureHeatListener, removeFigureHoverListener, removeFigureItemListener, removeFigureKillListener, removeFigureMoveListener, removeFigurePointListener, removeFigureRamListener, removeFigureStunListener, removeFigureVisibilityListener, removeMoney, removePoints, retrieveNextPoint, sellPermanentItem, setHoverCount, setHoverHeight, setInitialEnergy, setInvisible, setIq, setIsRocketTarget, setItem, setMaxEnergy, setMoney, setName, setNumber, setPoint, setSlots, setSpeed, setVisible, sink, staysOnColor, stopHover, stopSink, stun, takeItem, toString, updateExplodingStatus, updatePoints, updateThing, useItem, wantsToUseItem, win
-
Methods inherited from class com.starpoints.game.Thing
addShielding, clearTexts, displayText, displayText, equals, getColor, getEnergy, getEnergyMaxCount, getExplosionCounter, getField, getGame, getID, getInnerColor, getInvulnerableRounds, getLevel, getMaxEnergy, getNextID, getOuterColor, getPoint, getShadowColor, getShield, getStateObject, getStatus, getText, getTextColor, getTextPaintCount, getX, getY, hashCode, isDestroyed, isExploding, isInvulnerable, isOK, isShowingEnergyFx, retrieveState, setEnergy, setEnergyMaxCount, setGame, setStatus, stepText, updateEnergy
-
-
-
-
Constructor Detail
-
LaserTower
public LaserTower(Game game, FigureInfo figureInfo)
Creates a new LaserTower.- Parameters:
game- The game.figureInfo- The figure info.
-
-
Method Detail
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for LaserTower painting.- Overrides:
addStatePropertiesin classThing- Parameters:
state- The state to add properties to.animation- The current AnimationInfo.
-
getPainterClassname
public java.lang.String getPainterClassname()
Gets the fully qualified classname of the Painter to use for this item (in 2D game).- Overrides:
getPainterClassnamein classFigure- Returns:
- "com.starpoints.painter.arena2D.PainterLaserTower"
-
doSpecialUpdate
protected void doSpecialUpdate(AnimationInfo animation)
This method is called at the end of the regular updateThing()-method. If the number of rounds equal to the fire frequency has passed, since the last laser was fired, the figure aims its laser.- Overrides:
doSpecialUpdatein classComputerFigure- Parameters:
animation- The AnimationInfo.
-
getBeamSound
protected java.lang.String getBeamSound()
Gets the sound to play when aiming.- Returns:
- "laseraim"
-
checkEnemy
protected boolean checkEnemy(Figure f)
Checks, if a figure is relevant for the closest enemy determination.- Overrides:
checkEnemyin classComputerFigure- Parameters:
f- The figure.- Returns:
- true, if figure is not another ChaosDuck AND super.checkEnemy().
-
performLaserEffect
protected void performLaserEffect(Thing target, AnimationInfo animation)
Performs the laser hit effect.- Parameters:
target- The target. Never null.animation- The AnimationInfo.
-
getFireSound
protected java.lang.String getFireSound()
Gets the sound to play when firing laser.- Returns:
- "laserbeam"
-
getTarget
public Point getTarget()
Gets the current target (or null, if not aiming).- Returns:
- The target.
-
isFiring
public boolean isFiring()
Checks, if the laser tower is currently firing.- Returns:
- true, if Tower is firing its laser.
-
wantsToMove
protected boolean wantsToMove()
Checks, if this figure wants to move.- Overrides:
wantsToMovein classComputerFigure- Returns:
- false.
-
-