Package com.starpoints.game.figure
Class ChaosDuck
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Figure
-
- com.starpoints.game.ComputerFigure
-
- com.starpoints.game.figure.CleverComputerFigure
-
- com.starpoints.game.figure.ChaosDuck
-
- All Implemented Interfaces:
FieldListener,java.io.Serializable,java.lang.Cloneable
public class ChaosDuck extends CleverComputerFigure
Flame throwing enemy (whenever any enemy is in shoot distance). (C) Ole- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static intDOWNConstant for flame thrower animation.static intDOWNLEFTConstant for flame thrower animation.static intLEFTConstant for flame thrower animation.static intLEFTUPConstant for flame thrower animation.static intRIGHTConstant for flame thrower animation.static intRIGHTDOWNConstant for flame thrower animation.static intUPConstant for flame thrower animation.static intUPRIGHTConstant for flame thrower animation.-
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, energylistener, heatLevel, heatlistener, hoverCount, hoverHeight, hoverlistener, imageName, initialEnergy, INITIALRAMPOWER, isRocketTarget, item, itemlistener, killer, lives, MAXHOVERHEIGHT, maxRadius, MAXSLOTS, money, moved, movelistener, name, NONE, number, oldItem, oldRocketXP, oldRocketYP, PANIC, penalty, permItems, pointBonus, pointlistener, points, ramlistener, ramPower, side, sinker, slots, STEPLEFT, STEPRIGHT, stunCount, stunlistener, sumPoints, 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 ChaosDuck(Game game, FigureInfo figureInfo)Creates a new ChaosDuck.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPenalty(int penalty, AnimationInfo animation)Does nothing - ChaosDuck does not get penalties (for killing JungleTrees especially).protected voidaddStateProperties(ThingState state, AnimationInfo animation)Adds properties necessary for ChaosDuck painting.protected booleancheckEnemy(Figure f)Checks, if a figure is relevant for the closest enemy determination.protected voiddoSpecialUpdate(AnimationInfo animation)Special updates.intgetIq()Gets the IQ of this figure.java.lang.StringgetPainterClassname()Gets the fully qualified classname of the Painter to use for this item (in 2D game).intgetShootDirection()Gets the current shoot direction.protected voidshoot(int xdif, int ydif)Performs the flame thrower effect.-
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, isDangerous, isHeatSource, isHurryingReason, isInLead, isInTargetDirX, isInTargetDirY, isRocketFirePoint, isVisible, modifyBaseRatingByHeatEffect, modifyBaseRatingByTargetDirection, modifyByBlueColor, modifyByColor, modifyByItem, modifyByRatingModifiers, modifyByUnignorableColors, moveFast, rateOtherItem, ratePermanentItem, rateWeapon, reInit, rocketStarted, selectNewTargetPoint, selectPanicTarget, selectSafeTargetAfterBigMinePlacement, selectTarget, setTarget, stay, stopHurry, updateRatingModifiers, wantsToMove
-
Methods inherited from class com.starpoints.game.ComputerFigure
calculateItemRating, calculateNextPoint, doCalculateNextPoint, entersExplosion, findClosestEnemy, getDistance, getDistance, isDummy, isForbiddenItem, isRamTarget, 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, 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
-
-
-
-
Field Detail
-
UP
public static final int UP
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
UPRIGHT
public static final int UPRIGHT
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
RIGHT
public static final int RIGHT
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
RIGHTDOWN
public static final int RIGHTDOWN
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
DOWN
public static final int DOWN
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
DOWNLEFT
public static final int DOWNLEFT
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
LEFT
public static final int LEFT
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
LEFTUP
public static final int LEFTUP
Constant for flame thrower animation.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ChaosDuck
public ChaosDuck(Game game, FigureInfo figureInfo)
Creates a new ChaosDuck.- Parameters:
game- The game.figureInfo- The FigureInfo.
-
-
Method Detail
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for ChaosDuck 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.PainterChaosDuck"
-
getIq
public int getIq()
Gets the IQ of this figure. If the background is flickering, the figures iq is reduced by 20.- Overrides:
getIqin classCleverComputerFigure- Returns:
- The IQ.
-
getShootDirection
public int getShootDirection()
Gets the current shoot direction.- Returns:
- The shoot direction.
-
doSpecialUpdate
protected void doSpecialUpdate(AnimationInfo animation)
Special updates. Updates the shoot direction. Any rocket is dropped, since flamer does not use rockets.- Overrides:
doSpecialUpdatein classCleverComputerFigure- Parameters:
animation- The AnimationInfo.
-
addPenalty
public void addPenalty(int penalty, AnimationInfo animation)Does nothing - ChaosDuck does not get penalties (for killing JungleTrees especially).- Overrides:
addPenaltyin classFigure- Parameters:
penalty- The penalty.animation- The AnimationInfo.
-
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().
-
shoot
protected void shoot(int xdif, int ydif)Performs the flame thrower effect.- Parameters:
xdif- X addition depending on shoot direction.ydif- y addition depending on shoot direction.
-
-