Package com.starpoints.game.item
Class ItemBlasterGenerator
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.ItemPermanent
-
- com.starpoints.game.item.ItemBlasterGenerator
-
- All Implemented Interfaces:
FieldListener,java.io.Serializable,java.lang.Cloneable
public class ItemBlasterGenerator extends ItemPermanent implements FieldListener
Item, that generates blasters after a number of rounds.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intblasterEnergyInitial blaster (and fireball) energy.protected intfireFrequencyFire frequency in rounds.-
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, DEBUG, 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 ItemBlasterGenerator()Creates a new ItemRocketGenerator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStateProperties(ThingState state, AnimationInfo animation)Adds properties necessary for blaster generator painting.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.voidperformPermanentEffect(Figure owner, AnimationInfo animation)If this is the first rocket generator, and the owners item is null, the internal round counter is increased.-
Methods inherited from class com.starpoints.game.ItemPermanent
beforePickup, calculateDuration, createState, die, displayInSlot, doSpecialUpdate, getDuration, getSlotImageName, 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, 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, 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, rocketStarted
-
-
-
-
Method Detail
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for blaster generator painting.- Overrides:
addStatePropertiesin classThing- Parameters:
state- The state to add properties to.animation- The current AnimationInfo.
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRatingin classItem- Returns:
- energy * 10.
-
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.
-
-