Package com.starpoints.game.item
Class ItemRocketeer
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.item.ItemRocketeer
-
- All Implemented Interfaces:
ItemRammable,java.io.Serializable,java.lang.Cloneable
public class ItemRocketeer extends Item implements ItemRammable
Rocket tower that fires a rocket every 12 rounds.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDROPROCKETConstant for drop rocket.protected static intGRAYROCKETConstant for gray rocket.protected intitemNrThe rocket type index.protected intramPowerThe items ram power.protected ItemRocketrocketThe rocket item.protected static intROCKETConstant for normal rocket.protected static intSWIRLROCKETConstant for swirl rocket.-
Fields inherited from class com.starpoints.game.Item
affectsBlue, category, DEFAULT_ITEM_PAINTERCLASS, dieReason, isBomb, isWeapon, pickupClip, pickupText, pointBonus, useClip, user
-
Fields inherited from class com.starpoints.game.Thing
energy, energyFx, energyMaxSoundPlayed, energyModifications, explosionCounter, game, imageName, innerColor, invulnCount, isAffectedByBlack, isAffectedByGray, level, MAX_TEXTPAINT, maxEnergy, nextID, outerColor, p, shieldCount, status, text
-
-
Constructor Summary
Constructors Constructor Description ItemRocketeer()Creates a new Rocketeer figure on the field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStateProperties(ThingState state, AnimationInfo animation)Adds properties necessary for energy loss painting.booleanbeRammed(Figure rammer, AnimationInfo animation)Called, if this item is "picked up" by a figure.protected voidfireRocket(AnimationInfo animation)Fires the rocket.intgetItemRating()Returns an item value for ComputerFigures rating in the items category.java.lang.StringgetPainterClassname()Gets the fully qualified classname of the Painter to use for this item (in 2D game).ItemRocketgetPaintRocket()Gets a rocket for painting effects.intgetRamPower()Gets this items ram power.protected voidperformFieldEffect(AnimationInfo animation)This method is called at the end of the regular updateThing()-method.voidremoveEnergy(int min, Thing source, DieReason reason, AnimationInfo animation)Removes the given amount from this things energy level (if it is not originated by the own rocket).protected booleanwantsToFire(ItemRocket rocket)Checks, if the rocketeer wants to fire a rocket.-
Methods inherited from class com.starpoints.game.Item
affectsBlue, bePickedUp, beUsed, bombPlaced, createState, die, doSpecialUpdate, entersColor, explodes, gainsEnergy, gainsPermanentItem, gainsSlots, getCategory, getDieReason, getDrawText, getItemRating, getMoveAnimationLength, getName, getPickUpClip, getPickupText, getPointBonus, getRamPower, getUseClip, getUser, heatChanges, is3DItem, isAffectedByColor, isAvailableInEditor, isBomb, isRammed, isRocketTarget, isStunned, isWeapon, killedEnemy, losesEnergy, losesItem, losesPermanentItem, lostPermanentItem, onBeforeDie, onBeHitByItem, onBePickedUp, onBeUsed, onDrop, onEnemyKilled, onHitItem, onLevelFinished, pickesUpBomb, pickesUpExplosive, pickesUpItem, pointsChange, pointSumChanges, removeAfterLevel, retrieveState, rocketStarted, setUser, startsHovering, staysOnColor, toString, updateExplodingStatus, updateThing, usesItem, visibilityChanges
-
Methods inherited from class com.starpoints.game.Thing
addEnergy, addShielding, clearTexts, displayText, displayText, entersColor, equals, getColor, getEnergy, getEnergyMaxCount, getExplosionCounter, getField, getGame, getID, getImageName, getInnerColor, getInvulnerableRounds, getLevel, getMaxEnergy, getNextID, getOuterColor, getPoint, getShadowColor, getShield, getStateObject, getStatus, getText, getTextColor, getTextPaintCount, getX, getY, hashCode, invulnerable, isAffectedByBlack, isAffectedByGray, isDestroyed, isExploding, isInvulnerable, isOK, isShowingEnergyFx, onExplode, retrieveState, setEnergy, setEnergyMaxCount, setGame, setMaxEnergy, setPoint, setStatus, staysOnColor, stepText, updateEnergy
-
-
-
-
Field Detail
-
ROCKET
protected static final int ROCKET
Constant for normal rocket.- See Also:
- Constant Field Values
-
GRAYROCKET
protected static final int GRAYROCKET
Constant for gray rocket.- See Also:
- Constant Field Values
-
SWIRLROCKET
protected static final int SWIRLROCKET
Constant for swirl rocket.- See Also:
- Constant Field Values
-
DROPROCKET
protected static final int DROPROCKET
Constant for drop rocket.- See Also:
- Constant Field Values
-
itemNr
protected int itemNr
The rocket type index. Has the ROCKET value per default.
-
rocket
protected ItemRocket rocket
The rocket item.
-
ramPower
protected int ramPower
The items ram power. Default is 50.
-
-
Method Detail
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for energy loss 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 classItem- Returns:
- "com.starpoints.painter.arena2D.PainterItemRocketeer"
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRatingin classItem- Returns:
- energy * -10.
-
performFieldEffect
protected void performFieldEffect(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 rocket was used, the ItemRocketeer gains a new rocket of the type depending on this ItemRocketeers item nr setting and fires it.- Overrides:
performFieldEffectin classItem- Parameters:
animation- The AnimationInfo.
-
wantsToFire
protected boolean wantsToFire(ItemRocket rocket)
Checks, if the rocketeer wants to fire a rocket.- Parameters:
rocket- Teh rocket.- Returns:
- true.
-
removeEnergy
public void removeEnergy(int min, Thing source, DieReason reason, AnimationInfo animation)Removes the given amount from this things energy level (if it is not originated by the own rocket).- Overrides:
removeEnergyin classThing- Parameters:
min- The energy to removesource- The source for the energy removalanimation- The AnimationInfo.reason- The reason for the energy loss.
-
fireRocket
protected void fireRocket(AnimationInfo animation)
Fires the rocket.- Parameters:
animation- The AnimationInfo.
-
beRammed
public boolean beRammed(Figure rammer, AnimationInfo animation)
Called, if this item is "picked up" by a figure. Removes the rammers ram power from this items energy.- Specified by:
beRammedin interfaceItemRammable- Parameters:
rammer- The figure that rams this item.animation- The AnimationInfo.- Returns:
- true, if the figure can occupy the point after ramming, false otherwise; returns always false as default.
-
getRamPower
public int getRamPower()
Gets this items ram power.- Specified by:
getRamPowerin interfaceItemRammable- Returns:
- The ram power.
-
getPaintRocket
public ItemRocket getPaintRocket()
Gets a rocket for painting effects.- Returns:
- A rocket.
-
-