Package com.starpoints.game.item
Class ItemAsteroid
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.item.ItemAsteroid
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class ItemAsteroid extends Item
Asteroid that moves 1 point left each round. If a figure destroys an Asteroid, it gains 50.000 points and 100 money.- See Also:
- Serialized Form
-
-
Field Summary
-
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 ItemAsteroid()Creates a new Rocketeer figure on the field.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddStateProperties(ThingState state, AnimationInfo animation)Adds properties necessary for asteroid painting.java.lang.StringgetImageName(AnimationInfo animation)Returns image name.intgetItemRating()Returns an item value for ComputerFigures rating in the items category.intgetMoveAnimationLength()Method that can be overwritten by moving item subclasses, in case move animation should not last for default of 3 update cycles.java.lang.StringgetPainterClassname()Gets the fully qualified classname of the Painter to use for this item (in 2D game).booleanisAvailableInEditor()Checks, if this item is available in level editor.booleanisRocketTarget()Checks, if this item is a rocket target.protected voidonBeforeDie(Thing source, DieReason reason, AnimationInfo animation)Called, before the item dies.booleanonBePickedUp(Figure picker, AnimationInfo animation)Teleports away.booleanonHitItem(Item rammedItem, AnimationInfo animation)Method called if this item moves and hits another item.protected voidperformFieldEffect(AnimationInfo animation)This method is called at the end of the regular updateThing()-method.-
Methods inherited from class com.starpoints.game.Item
affectsBlue, bePickedUp, beUsed, bombPlaced, createState, die, doSpecialUpdate, entersColor, explodes, gainsEnergy, gainsPermanentItem, gainsSlots, getCategory, getDieReason, getDrawText, getItemRating, getName, getPickUpClip, getPickupText, getPointBonus, getRamPower, getUseClip, getUser, heatChanges, is3DItem, isAffectedByColor, isBomb, isRammed, isStunned, isWeapon, killedEnemy, losesEnergy, losesItem, losesPermanentItem, lostPermanentItem, onBeHitByItem, onBeUsed, onDrop, onEnemyKilled, 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, 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
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for asteroid painting.- Overrides:
addStatePropertiesin classThing- Parameters:
state- The state to add properties to.animation- The current AnimationInfo.
-
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.PainterItemAsteroid"
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRatingin classItem- Returns:
- energy * -100.
-
isAvailableInEditor
public boolean isAvailableInEditor()
Checks, if this item is available in level editor.- Overrides:
isAvailableInEditorin classItem- Returns:
- false.
-
performFieldEffect
protected void performFieldEffect(AnimationInfo animation)
This method is called at the end of the regular updateThing()-method. If the number of rounds equal to the fire frequency has passed, since the last item rocket was used, the ItemRocketeer gains a new rocket of the type depending on this ItemRocketeers item nr setting and fires it.- Overrides:
performFieldEffectin classItem- Parameters:
animation- The AnimationInfo.
-
onBeforeDie
protected void onBeforeDie(Thing source, DieReason reason, AnimationInfo animation)
Called, before the item dies. Gives the source 50000 points and 100 money.- Overrides:
onBeforeDiein classItem- Parameters:
source- The death source. Might be null if dying e.g. because of energy losses by gray points.reason- The death reason.animation- The AnimationInfo.
-
onBePickedUp
public boolean onBePickedUp(Figure picker, AnimationInfo animation)
Teleports away.- Overrides:
onBePickedUpin classItem- Parameters:
picker- The pickeranimation- The AnimationInfo.- Returns:
- false
-
onHitItem
public boolean onHitItem(Item rammedItem, AnimationInfo animation)
Method called if this item moves and hits another item.
-
getImageName
public java.lang.String getImageName(AnimationInfo animation)
Returns image name.- Overrides:
getImageNamein classThing- Parameters:
animation- The AnimationInfo.- Returns:
- "item_mystery"+imageCount
-
getMoveAnimationLength
public int getMoveAnimationLength()
Method that can be overwritten by moving item subclasses, in case move animation should not last for default of 3 update cycles.- Overrides:
getMoveAnimationLengthin classItem- Returns:
- 3 by default.
-
isRocketTarget
public boolean isRocketTarget()
Checks, if this item is a rocket target.- Overrides:
isRocketTargetin classItem- Returns:
- false as default.
-
-