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 voidaddStateProperties(ThingState state, AnimationInfo animation)Adds properties necessary for SwampGhost painting.protected voiddoSpecialUpdate(AnimationInfo animation)This method is called at the end of the regular updateThing()-method.static intgetAnimationImageIndex(Game g, int max, int step)Gets an animation index between 0 and max depending on the games round cound and AnimationInfo-index.intgetFireCounter()Gets the fire coutner value.java.lang.StringgetImageName(AnimationInfo animation)Returns image name dependent on current game animation index for animation.intgetIq()Gets the IQ of this figure (at least 120).java.lang.StringgetPainterClassname()Gets the fully qualified classname of the Painter to use for this item (in 2D game).protected booleanisDangerous(Figure f)Checks, if the figure is dangerous.protected booleanisForbiddenItem(Item i)Checks, if the item is not allowed to be picked up by this figure.protected booleanisRamTarget(Figure f)Checks, if the figure is a good ram target (because it is weaker than this figure).protected voidreInit(Field f)Reinitializes the figure after each level.voidsink(Thing source, AnimationInfo animation)Does nothing - Swamp ghost does not sink.protected booleanwantsToMove()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:
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.PainterSwampGhost"
-
getImageName
public java.lang.String getImageName(AnimationInfo animation)
Returns image name dependent on current game animation index for animation.- Overrides:
getImageNamein classFigure- Parameters:
animation- AnimationInfo.- Returns:
- "enemy11_"+index.
-
getIq
public int getIq()
Gets the IQ of this figure (at least 120).- Overrides:
getIqin 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:
isRamTargetin 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:
isDangerousin 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:
isForbiddenItemin 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:
doSpecialUpdatein classCleverComputerFigure- Parameters:
animation- The AnimationInfo.
-
wantsToMove
protected boolean wantsToMove()
Checks, if this figure wants to move.- Overrides:
wantsToMovein 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:
reInitin classCleverComputerFigure- Parameters:
f- The new field
-
-