Package com.starpoints.game.figure
Class SwampGhost
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Figure
-
- com.starpoints.game.ComputerFigure
-
- com.starpoints.game.figure.CleverComputerFigure
-
- com.starpoints.game.figure.SwampGhost
-
- All Implemented Interfaces:
FieldListener
,java.io.Serializable
,java.lang.Cloneable
public class SwampGhost extends CleverComputerFigure
Computer figure, that fires mudballs frequently (while being stuck for some rounds). Collects BigMines without using them.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class com.starpoints.game.figure.CleverComputerFigure
aggressiveness, bigMine, BIGMINE_PLACED, danger, ENEMY_NEARBY, hurryingReason, hurrySpeed, INVULNERABLE, nearestEnemy, purposefulness, ratingModifier, rocket, ROCKET_ACTIVE, target, targetCountDown, targetRadius, targetRating, targets
-
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 SwampGhost(Game game, FigureInfo figureInfo)
Creates a new SwampGhost.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for SwampGhost painting.protected void
doSpecialUpdate(AnimationInfo animation)
This method is called at the end of the regular updateThing()-method.static int
getAnimationImageIndex(Game g, int max, int step)
Gets an animation index between 0 and max depending on the games round cound and AnimationInfo-index.int
getFireCounter()
Gets the fire coutner value.java.lang.String
getImageName(AnimationInfo animation)
Returns image name dependent on current game animation index for animation.int
getIq()
Gets the IQ of this figure (at least 120).java.lang.String
getPainterClassname()
Gets the fully qualified classname of the Painter to use for this item (in 2D game).protected boolean
isDangerous(Figure f)
Checks, if the figure is dangerous.protected boolean
isForbiddenItem(Item i)
Checks, if the item is not allowed to be picked up by this figure.protected boolean
isRamTarget(Figure f)
Checks, if the figure is a good ram target (because it is weaker than this figure).protected void
reInit(Field f)
Reinitializes the figure after each level.void
sink(Thing source, AnimationInfo animation)
Does nothing - Swamp ghost does not sink.protected boolean
wantsToMove()
Checks, if this figure wants to move.-
Methods inherited from class com.starpoints.game.figure.CleverComputerFigure
bombPlaced, calculatePointRating, checkBigMineUsage, checkHurryingBecauseOfEnemyNearby, checkHurryingBecauseOfPointColor, checkIfNewTargetShouldBeSelected, checkRamPowerForUsage, checkRocketUsage, checkShieldingForUsage, determineItemUsage, entersExplosion, findPanicTargetPoint, getBigMineRadius, getFogRating, getHurryReasonString, getPointRatingInternal, getTargetRating, handleBigMineDetection, handleRocketDetection, hasBombKit, hasCoolGenerator, hasFireExtinguisher, hurry, hurry, isAffectedByBlackInternal, isAffectedByGrayInternal, isApplyingLevelInfoIQ, isHeatSource, isHurryingReason, isInLead, isInTargetDirX, isInTargetDirY, isRocketFirePoint, isVisible, modifyBaseRatingByHeatEffect, modifyBaseRatingByTargetDirection, modifyByBlueColor, modifyByColor, modifyByItem, modifyByRatingModifiers, modifyByUnignorableColors, moveFast, rateOtherItem, ratePermanentItem, rateWeapon, rocketStarted, selectNewTargetPoint, selectPanicTarget, selectSafeTargetAfterBigMinePlacement, selectTarget, setTarget, stay, stopHurry, updateRatingModifiers
-
Methods inherited from class com.starpoints.game.ComputerFigure
calculateItemRating, calculateNextPoint, checkEnemy, doCalculateNextPoint, entersExplosion, findClosestEnemy, getDistance, getDistance, isDummy, isUnwantedItem
-
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, 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, 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
-
SwampGhost
public SwampGhost(Game game, FigureInfo figureInfo)
Creates a new SwampGhost.- Parameters:
game
- The game.figureInfo
- The FigureInfo.
-
-
Method Detail
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for SwampGhost painting.- Overrides:
addStateProperties
in 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:
getPainterClassname
in classFigure
- Returns:
- "com.starpoints.painter.arena2D.PainterSwampGhost"
-
getImageName
public java.lang.String getImageName(AnimationInfo animation)
Returns image name dependent on current game animation index for animation.- Overrides:
getImageName
in classFigure
- Parameters:
animation
- AnimationInfo.- Returns:
- "enemy11_"+index.
-
getIq
public int getIq()
Gets the IQ of this figure (at least 120).- Overrides:
getIq
in classCleverComputerFigure
- Returns:
- The IQ.
-
getAnimationImageIndex
public static int getAnimationImageIndex(Game g, int max, int step)
Gets an animation index between 0 and max depending on the games round cound and AnimationInfo-index.- Parameters:
g
- The game.max
- The maximum index.step
- Number of animations for next index.- Returns:
- The index.
-
isRamTarget
protected boolean isRamTarget(Figure f)
Checks, if the figure is a good ram target (because it is weaker than this figure).- Overrides:
isRamTarget
in classComputerFigure
- Parameters:
f
- The figure to check.- Returns:
- true, if the figure is a good ram target and no SwampGhost.
-
isDangerous
protected boolean isDangerous(Figure f)
Checks, if the figure is dangerous.- Overrides:
isDangerous
in classCleverComputerFigure
- Parameters:
f
- The figure- Returns:
- true, if figure is another SwampGhost or dangerous.
-
isForbiddenItem
protected boolean isForbiddenItem(Item i)
Checks, if the item is not allowed to be picked up by this figure.- Overrides:
isForbiddenItem
in classComputerFigure
- Parameters:
i
- The item.- Returns:
- true for ItemHover and other forbidden items.
-
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 item was used, the figure gains a new rocket of the type depending on this rocketeers item nr setting.- Overrides:
doSpecialUpdate
in classCleverComputerFigure
- Parameters:
animation
- The AnimationInfo.
-
wantsToMove
protected boolean wantsToMove()
Checks, if this figure wants to move.- Overrides:
wantsToMove
in classCleverComputerFigure
- Returns:
- false, if just fired mud.
-
sink
public void sink(Thing source, AnimationInfo animation)
Does nothing - Swamp ghost does not sink.
-
getFireCounter
public int getFireCounter()
Gets the fire coutner value.- Returns:
- The fire counter. 0-this.fireFrequency-1.
-
reInit
protected void reInit(Field f)
Reinitializes the figure after each level.- Overrides:
reInit
in classCleverComputerFigure
- Parameters:
f
- The new field
-
-