Package com.starpoints.game.item
Class ItemRocketGenerator
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.ItemPermanent
-
- com.starpoints.game.item.ItemRocketGenerator
-
- All Implemented Interfaces:
FieldListener,java.io.Serializable,java.lang.Cloneable
public class ItemRocketGenerator extends ItemPermanent implements FieldListener
Item, that spawns the user a rocket after a number of rounds.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static intDROPROCKETConstant for ItemDropRocket.protected static intFASTROCKETConstant for ItemFastRocket.protected intfireFrequencyFire frequency in rounds.protected static intGRAYROCKETConstant for ItemGrayRocket.protected intorigRocketTypeOriginal item nr, if changed by any boost.protected static intROCKETConstant for ItemRocket.protected introcketEnergyInitial rocket energy.protected introcketTypeConstant for item class to produce.protected static intSWIRLROCKETConstant for ItemSwirlRocket.-
Fields inherited from class com.starpoints.game.ItemPermanent
displayInSlot, drawDuration, duration, energyFactor, isPermanentlyActive, unique, usesUp, useText
-
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 ItemRocketGenerator()Creates a new ItemRocketGenerator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetDrawText()Returns a display string for UI.java.lang.StringgetFigureOverlayImageName(AnimationInfo animation)Gets an image name for painting on the figure.intgetItemRating()Returns an item value for ComputerFigures rating in the items category.intgetRocketEnergy()Gets the rocket energy.intgetRocketType()Gets the rocket type.java.lang.StringgetSlotImageName()Returns an image name for slot display.voidperformPermanentEffect(Figure owner, AnimationInfo animation)If this is the first rocket generator, and the owners item is null, the internal round counter is increased.voidresetRocketType()Resets the rocket type.voidrocketStarted(ItemRocket r, AnimationInfo animation)Method that is called when a rocket is started on the field.voidsetRocketEnergy(int rocketEnergy)Sets the rocket energy.voidsetRocketType(int itemNr)Sets the rocket type.-
Methods inherited from class com.starpoints.game.ItemPermanent
beforePickup, calculateDuration, createState, die, displayInSlot, doSpecialUpdate, getDuration, getUseText, isAddingEnergy, isDrawingDuration, isPermanentlyActive, isUnique, isUsingUp, onAddedAsPermanentItem, onBeLost, onBePickedUp, onBeUsed, onDropPermanent, onReinitForNewLevel, setDrawDuration, setDuration, setIsUsingUp, useUp
-
Methods inherited from class com.starpoints.game.Item
affectsBlue, bePickedUp, beUsed, bombPlaced, entersColor, explodes, gainsEnergy, gainsPermanentItem, gainsSlots, getCategory, getDieReason, getItemRating, getMoveAnimationLength, getName, getPainterClassname, getPickUpClip, getPickupText, getPointBonus, getRamPower, getUseClip, getUser, heatChanges, is3DItem, isAffectedByColor, isAvailableInEditor, isBomb, isRammed, isRocketTarget, isStunned, isWeapon, killedEnemy, losesEnergy, losesItem, losesPermanentItem, lostPermanentItem, onBeforeDie, onBeHitByItem, onDrop, onEnemyKilled, onHitItem, onLevelFinished, performFieldEffect, pickesUpBomb, pickesUpExplosive, pickesUpItem, pointsChange, pointSumChanges, removeAfterLevel, retrieveState, setUser, startsHovering, staysOnColor, toString, updateExplodingStatus, updateThing, usesItem, visibilityChanges
-
Methods inherited from class com.starpoints.game.Thing
addEnergy, addShielding, addStateProperties, 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, removeEnergy, retrieveState, setEnergy, setEnergyMaxCount, setGame, setMaxEnergy, setPoint, setStatus, staysOnColor, stepText, updateEnergy
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.starpoints.game.listener.FieldListener
bombPlaced
-
-
-
-
Field Detail
-
fireFrequency
protected int fireFrequency
Fire frequency in rounds.
-
ROCKET
protected static final int ROCKET
Constant for ItemRocket.- See Also:
- Constant Field Values
-
GRAYROCKET
protected static final int GRAYROCKET
Constant for ItemGrayRocket.- See Also:
- Constant Field Values
-
SWIRLROCKET
protected static final int SWIRLROCKET
Constant for ItemSwirlRocket.- See Also:
- Constant Field Values
-
DROPROCKET
protected static final int DROPROCKET
Constant for ItemDropRocket.- See Also:
- Constant Field Values
-
FASTROCKET
protected static final int FASTROCKET
Constant for ItemFastRocket.- See Also:
- Constant Field Values
-
rocketType
protected int rocketType
Constant for item class to produce. Default is ROCKET.
-
origRocketType
protected int origRocketType
Original item nr, if changed by any boost.
-
rocketEnergy
protected int rocketEnergy
Initial rocket energy. Default is 100.
-
-
Method Detail
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRatingin classItem- Returns:
- energy * 300.
-
getSlotImageName
public java.lang.String getSlotImageName()
Returns an image name for slot display.- Overrides:
getSlotImageNamein classItemPermanent- Returns:
- getImageName()+"_slot"
-
getDrawText
public java.lang.String getDrawText()
Returns a display string for UI.- Overrides:
getDrawTextin classItem- Returns:
- DURATIONx.
-
getFigureOverlayImageName
public java.lang.String getFigureOverlayImageName(AnimationInfo animation)
Gets an image name for painting on the figure.- Overrides:
getFigureOverlayImageNamein classItemPermanent- Parameters:
animation- The AnimationInfo.- Returns:
- "item_rocketgenerator_sm".
-
performPermanentEffect
public void performPermanentEffect(Figure owner, AnimationInfo animation)
If this is the first rocket generator, and the owners item is null, the internal round counter is increased. If the fireFrequency value is reached, a new item is produced and given to the owner.- Overrides:
performPermanentEffectin classItemPermanent- Parameters:
owner- The owner of the rocket generator.animation- The AnimationInfo.
-
rocketStarted
public void rocketStarted(ItemRocket r, AnimationInfo animation)
Method that is called when a rocket is started on the field.- Specified by:
rocketStartedin interfaceFieldListener- Overrides:
rocketStartedin classItem- Parameters:
r- The starting rocket.animation- The AnimationInfo.
-
getRocketType
public int getRocketType()
Gets the rocket type.- Returns:
- Rocket type.
-
setRocketType
public void setRocketType(int itemNr)
Sets the rocket type.- Parameters:
itemNr- Rocket type.
-
resetRocketType
public void resetRocketType()
Resets the rocket type.
-
getRocketEnergy
public int getRocketEnergy()
Gets the rocket energy.- Returns:
- The rocket energy.
-
setRocketEnergy
public void setRocketEnergy(int rocketEnergy)
Sets the rocket energy.- Parameters:
rocketEnergy- energy.
-
-