Package com.starpoints.game.item
Class ItemShielding
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.ItemPermanent
-
- com.starpoints.game.item.ItemShielding
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
ItemGoldenShield,ItemHeatShielding,ItemRamShield,ItemRocketShielding,ItemShieldExplosion
public abstract class ItemShielding extends ItemPermanent
Superclass for permanent item, that increaeses the users shielding against explosions, ramming or rockets or heat.- 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 ItemShielding()Creates a new ItemShielding.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected intcalculateDuration()Calculates the duration.protected voiddoSpecialUpdate(AnimationInfo animation)Performs the update in each round in overridden classes.intgetItemRating()Returns an item value for ComputerFigures rating in the items category.intgetShieldPower()Returns the shields power (which is same as duration).-
Methods inherited from class com.starpoints.game.ItemPermanent
beforePickup, createState, die, displayInSlot, 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, getDrawText, 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, 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 * 10.
-
getShieldPower
public int getShieldPower()
Returns the shields power (which is same as duration). Per default, ItemShielding calculates the Shield power by energy/energyFactor, so subclasses might adjust the energyfactor for linear energy - shield power behaviour, or override getShieldPower.- Returns:
- The gain.
-
calculateDuration
protected int calculateDuration()
Calculates the duration.- Overrides:
calculateDurationin classItemPermanent- Returns:
- The duration.
-
doSpecialUpdate
protected void doSpecialUpdate(AnimationInfo animation)
Performs the update in each round in overridden classes. Recalculates duration.- Overrides:
doSpecialUpdatein classItemPermanent- Parameters:
animation- The AnimationInfo
-
-