Package com.starpoints.game.item
Class ItemRamPower
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.ItemPermanent
-
- com.starpoints.game.item.ItemRamPower
-
- All Implemented Interfaces:
FigureRamListener,java.io.Serializable,java.lang.Cloneable
public class ItemRamPower extends ItemPermanent implements FigureRamListener
Permanent item, that increases the ram power of the user.- See Also:
- Serialized Form
-
-
Field Summary
-
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 ItemRamPower()Creates a new ItemRamPower.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcalculateGain()Calculates the ram power gain.java.lang.StringgetDrawText()Returns a display string for UI.intgetItemRating()Returns an item value for ComputerFigures rating in the items category.intgetRamPower(Figure f, Figure rammer, int initialRamPower)Returns the initial ram power increased by the gain.java.lang.StringgetUseClip()Returns a sound clip depending on the gain,intisRammed(Figure f, Figure rammer, int ramPower, AnimationInfo animation)Removes one ram power.-
Methods inherited from class com.starpoints.game.ItemPermanent
beforePickup, calculateDuration, createState, die, displayInSlot, doSpecialUpdate, getDuration, getFigureOverlayImageName, getSlotImageName, getUseText, isAddingEnergy, isDrawingDuration, isPermanentlyActive, isUnique, isUsingUp, onAddedAsPermanentItem, onBeLost, onBePickedUp, onBeUsed, onDropPermanent, onReinitForNewLevel, performPermanentEffect, 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, getUser, heatChanges, is3DItem, isAffectedByColor, isAvailableInEditor, isBomb, 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, 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
-
-
-
-
Method Detail
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRatingin classItem- Returns:
- energy * 100.
-
getUseClip
public java.lang.String getUseClip()
Returns a sound clip depending on the gain,- Overrides:
getUseClipin classItem- Returns:
- "item_rampower"+x.
-
calculateGain
public int calculateGain()
Calculates the ram power gain.- Returns:
- The ram power gain.
-
getDrawText
public java.lang.String getDrawText()
Returns a display string for UI.- Overrides:
getDrawTextin classItem- Returns:
- null as default.
-
isRammed
public int isRammed(Figure f, Figure rammer, int ramPower, AnimationInfo animation)
Removes one ram power.- Specified by:
isRammedin interfaceFigureRamListener- Overrides:
isRammedin classItem- Parameters:
f- The figure.rammer- The rammer.ramPower- The original ram power.animation- The AnimationInfo.- Returns:
- The initial ram power increased by the gain.
-
getRamPower
public int getRamPower(Figure f, Figure rammer, int initialRamPower)
Returns the initial ram power increased by the gain.- Specified by:
getRamPowerin interfaceFigureRamListener- Overrides:
getRamPowerin classItem- Parameters:
f- The figure.rammer- The rammer.initialRamPower- The original ram power.- Returns:
- The initial ram power increased by the gain.
-
-