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 int
DROPROCKET
Constant for drop rocket.protected static int
GRAYROCKET
Constant for gray rocket.protected int
itemNr
The rocket type index.protected int
ramPower
The items ram power.protected ItemRocket
rocket
The rocket item.protected static int
ROCKET
Constant for normal rocket.protected static int
SWIRLROCKET
Constant 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 void
addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for energy loss painting.boolean
beRammed(Figure rammer, AnimationInfo animation)
Called, if this item is "picked up" by a figure.protected void
fireRocket(AnimationInfo animation)
Fires the rocket.int
getItemRating()
Returns an item value for ComputerFigures rating in the items category.java.lang.String
getPainterClassname()
Gets the fully qualified classname of the Painter to use for this item (in 2D game).ItemRocket
getPaintRocket()
Gets a rocket for painting effects.int
getRamPower()
Gets this items ram power.protected void
performFieldEffect(AnimationInfo animation)
This method is called at the end of the regular updateThing()-method.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).protected boolean
wantsToFire(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:
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 classItem
- Returns:
- "com.starpoints.painter.arena2D.PainterItemRocketeer"
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRating
in 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:
performFieldEffect
in 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:
removeEnergy
in 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:
beRammed
in 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:
getRamPower
in interfaceItemRammable
- Returns:
- The ram power.
-
getPaintRocket
public ItemRocket getPaintRocket()
Gets a rocket for painting effects.- Returns:
- A rocket.
-
-