Package com.starpoints.game.item
Class ItemChrystalStone
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.item.ItemChrystalStone
-
- All Implemented Interfaces:
ItemRammable,FigureMoveListener,java.io.Serializable,java.lang.Cloneable
public class ItemChrystalStone extends Item implements FigureMoveListener, ItemRammable
ChrystalStone for the last InnerChrystalZone. Gets created by the ChrystalMonster. If rammed, the game end sequence is started, if the rammer has all 4 ChrystalStones. In multiplayer mode, all carriers of chrystal stones must ram the stone to start the sequence.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]classesprotected int[]countersprotected static java.lang.String[]image_sfxstatic intMAX_ANIMATIONprotected intsequenceCounterprotected booleansequenceStartedprotected booleansequenceStopped-
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 ItemChrystalStone()Creates a new ItemChrystalStone.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStateProperties(ThingState state, AnimationInfo animation)Adds properties necessary for chrystal stone painting.booleanbeforeMove(Figure f, Point p, Point newP, AnimationInfo animation)Called, before the figure moves to a new point.booleanbeRammed(Figure rammer, AnimationInfo animation)Called, if the item is rammed by a figure.intgetAnimationCounter()intgetAnimationIndex()ItemAbstractChrystalgetChrystal()java.lang.StringgetImageName()Returns image name relative to path /pics, without suffix.intgetItemRating()Returns an item value for ComputerFigures rating in the items category.java.lang.StringgetPainterClassname()Gets the fully qualified classname of the Painter to use for this item (in 2D game).intgetRamPower()Gets this items ram power.booleanisAvailableInEditor()Checks, if this item is available in level editor.protected voidperformFieldEffect(AnimationInfo animation)Called each round if the item lies on the field.voidremoveEnergy(int min, Thing source, DieReason reason, AnimationInfo animation)Does nothing.-
Methods inherited from class com.starpoints.game.Item
affectsBlue, bePickedUp, beUsed, bombPlaced, createState, die, doSpecialUpdate, entersColor, explodes, gainsEnergy, gainsPermanentItem, gainsSlots, getCategory, getDieReason, getDrawText, getItemRating, getMoveAnimationLength, getName, getPickUpClip, getPickupText, getPointBonus, getRamPower, getUseClip, getUser, heatChanges, is3DItem, isAffectedByColor, isBomb, isRammed, isRocketTarget, isStunned, isWeapon, killedEnemy, losesEnergy, losesItem, losesPermanentItem, lostPermanentItem, onBeforeDie, onBeHitByItem, onBePickedUp, onBeUsed, onDrop, onEnemyKilled, onHitItem, onLevelFinished, 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, 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.FigureMoveListener
removeAfterLevel
-
-
-
-
Field Detail
-
MAX_ANIMATION
public static final int MAX_ANIMATION
- See Also:
- Constant Field Values
-
counters
protected int[] counters
-
classes
protected java.lang.String[] classes
-
image_sfx
protected static java.lang.String[] image_sfx
-
sequenceStarted
protected boolean sequenceStarted
-
sequenceStopped
protected boolean sequenceStopped
-
sequenceCounter
protected int sequenceCounter
-
-
Method Detail
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for chrystal stone painting.- Overrides:
addStatePropertiesin classThing- Parameters:
state- The state to add properties to.animation- The current AnimationInfo.
-
isAvailableInEditor
public boolean isAvailableInEditor()
Checks, if this item is available in level editor.- Overrides:
isAvailableInEditorin classItem- Returns:
- false.
-
getPainterClassname
public java.lang.String getPainterClassname()
Gets the fully qualified classname of the Painter to use for this item (in 2D game).- Overrides:
getPainterClassnamein classItem- Returns:
- "com.starpoints.painter.arena2D.PainterItemChrystalStone"
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRatingin classItem- Returns:
- -10000000.
-
getImageName
public java.lang.String getImageName()
Returns image name relative to path /pics, without suffix. image (item paints as small oval in inner and outer color).- Returns:
- null as default.
-
removeEnergy
public void removeEnergy(int min, Thing source, DieReason reason, AnimationInfo animation)Does nothing. Chrystal Stone never loses energy.- Overrides:
removeEnergyin classThing- Parameters:
min- The energy to remove.source- The source for the energy loss.reason- The reason for the energy loss.animation- The AnimationInfo.
-
performFieldEffect
protected void performFieldEffect(AnimationInfo animation)
Called each round if the item lies on the field. Performs the final sequence after rammed Does nothing by default.- Overrides:
performFieldEffectin classItem- Parameters:
animation- The AnimationInfo.
-
getRamPower
public int getRamPower()
Description copied from interface:ItemRammableGets this items ram power.- Specified by:
getRamPowerin interfaceItemRammable- Returns:
- The Ram power.
-
beRammed
public boolean beRammed(Figure rammer, AnimationInfo animation)
Description copied from interface:ItemRammableCalled, if the item is rammed by a figure. Return true, if the figure is allowed to enter the items point after ramming.- Specified by:
beRammedin interfaceItemRammable- Parameters:
rammer- The rammeranimation- the AnimationInfo.- Returns:
- true, if the figure can enter the items point.
-
getAnimationCounter
public int getAnimationCounter()
-
getAnimationIndex
public int getAnimationIndex()
-
getChrystal
public ItemAbstractChrystal getChrystal()
-
beforeMove
public boolean beforeMove(Figure f, Point p, Point newP, AnimationInfo animation)
Description copied from interface:FigureMoveListenerCalled, before the figure moves to a new point.- Specified by:
beforeMovein interfaceFigureMoveListener- Parameters:
f- The figure.p- The figures current point.newP- The point the figures wants to move to.animation- The AnimationInfo- Returns:
- true, if figure can move.
-
-