Package com.starpoints.game.item
Class ItemAntiKill
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.ItemPermanent
-
- com.starpoints.game.item.ItemAntiKill
-
- All Implemented Interfaces:
FigureKillListener
,java.io.Serializable
,java.lang.Cloneable
public class ItemAntiKill extends ItemPermanent implements FigureKillListener
Item to prevent explosion of owner. Used in tutorial.- 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, 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 ItemAntiKill()
Creates new ItemAntiKill.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected int
calculateDuration()
Calculates the duration.boolean
explodes(Figure f, Thing source, DieReason reason, AnimationInfo animation)
FigureListener method that prevents explosion.int
getItemRating()
Returns an item value for ComputerFigures rating in the items category.boolean
isAvailableInEditor()
Checks, if this item is available in level editor.void
registerUser(Figure figure)
Registers this item as listener for figures die events.-
Methods inherited from class com.starpoints.game.ItemPermanent
beforePickup, 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, gainsEnergy, gainsPermanentItem, gainsSlots, getCategory, getDieReason, getDrawText, getItemRating, getMoveAnimationLength, getName, getPainterClassname, getPickUpClip, getPickupText, getPointBonus, getRamPower, getUseClip, getUser, heatChanges, is3DItem, isAffectedByColor, 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
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.starpoints.game.listener.FigureKillListener
killedEnemy
-
-
-
-
Method Detail
-
calculateDuration
protected int calculateDuration()
Calculates the duration. Returns 0.- Overrides:
calculateDuration
in classItemPermanent
- Returns:
- 0.
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRating
in classItem
- Returns:
- 100000.
-
isAvailableInEditor
public boolean isAvailableInEditor()
Checks, if this item is available in level editor.- Overrides:
isAvailableInEditor
in classItem
- Returns:
- false.
-
explodes
public boolean explodes(Figure f, Thing source, DieReason reason, AnimationInfo animation)
FigureListener method that prevents explosion.- Specified by:
explodes
in interfaceFigureKillListener
- Overrides:
explodes
in classItem
- Parameters:
f
- The figuresource
- The explosion sourceanimation
- The AnimationInfo.reason
- The reason for the explosion.- Returns:
- false (to prevent explosion of owner).
-
registerUser
public void registerUser(Figure figure)
Registers this item as listener for figures die events. Does not add the item to the inventory.- Parameters:
figure
- the figure.
-
-