Package com.starpoints.game.item
Class ItemEnergyPlusSuper
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.ItemPermanent
-
- com.starpoints.game.item.ItemEnergyPlusSuper
-
- All Implemented Interfaces:
RegenerationItem
,java.io.Serializable
,java.lang.Cloneable
public class ItemEnergyPlusSuper extends ItemPermanent implements RegenerationItem
Item, that makes the user regenerate energy depending on this items energy every round.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int
energyGain
The energy gain per round for the owner.-
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 ItemEnergyPlusSuper()
Creates a new ItemEnergyPlusSuper.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected boolean
checkRegeneration(Figure owner)
Checks, if the item gives energy to the user.int
getEnergyGain()
Gets this items energy gain.java.lang.String
getImageName(AnimationInfo animation)
Returns image name.int
getItemRating()
Returns an item value for ComputerFigures rating in the items category.protected java.lang.String
getUseClip()
Gets the name of the .wav file.void
onAddedAsPermanentItem(Figure user, AnimationInfo animation)
Adds this item as permanent.void
performPermanentEffect(Figure owner, AnimationInfo animation)
Adds 2 energy to the owner's.-
Methods inherited from class com.starpoints.game.ItemPermanent
beforePickup, calculateDuration, createState, die, displayInSlot, doSpecialUpdate, getDuration, getFigureOverlayImageName, getSlotImageName, getUseText, isAddingEnergy, isDrawingDuration, isPermanentlyActive, isUnique, isUsingUp, 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, getDrawText, getItemRating, getMoveAnimationLength, getName, getPainterClassname, getPickUpClip, getPickupText, getPointBonus, getRamPower, 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, addStateProperties, clearTexts, displayText, displayText, entersColor, equals, getColor, getEnergy, getEnergyMaxCount, getExplosionCounter, getField, getGame, getID, 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:
getItemRating
in classItem
- Returns:
- energy * 1000.
-
getImageName
public java.lang.String getImageName(AnimationInfo animation)
Returns image name.- Overrides:
getImageName
in classThing
- Parameters:
animation
- The AnimationInfo.- Returns:
- "item_energy0", "item_energy1" or "item_energy2", depending on energy level
-
onAddedAsPermanentItem
public void onAddedAsPermanentItem(Figure user, AnimationInfo animation)
Adds this item as permanent. Duration is this items energy * 20, energy gain is energy/10 (max. 10)- Overrides:
onAddedAsPermanentItem
in classItemPermanent
- Parameters:
user
- The figure using the item.animation
- AnimationInfo.
-
performPermanentEffect
public void performPermanentEffect(Figure owner, AnimationInfo animation)
Adds 2 energy to the owner's. Duration is decreased by 2 (if the owner still gains energy).- Overrides:
performPermanentEffect
in classItemPermanent
- Parameters:
owner
- The owner.animation
- The AnimationInfo.
-
checkRegeneration
protected boolean checkRegeneration(Figure owner)
Checks, if the item gives energy to the user.- Parameters:
owner
- The owner.- Returns:
- true, if this item is ok, the owner is ok, adn either hasn't max energy or an item which hasn't reached its max energy and an EnergyTransformer (which is a bit dirty!).
-
getUseClip
protected java.lang.String getUseClip()
Gets the name of the .wav file.- Overrides:
getUseClip
in classItem
- Returns:
- "item_energyplus" or "item_energyplussuper" depending on energy.
-
getEnergyGain
public int getEnergyGain()
Gets this items energy gain.- Specified by:
getEnergyGain
in interfaceRegenerationItem
- Returns:
- The calculated energy gain.
-
-