Package com.starpoints.game.item
Class ItemMoney
- java.lang.Object
-
- com.starpoints.game.Thing
-
- com.starpoints.game.Item
-
- com.starpoints.game.item.ItemMoney
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class ItemMoney extends Item
Money depending on this items energy (50/100/200/500).- 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 ItemMoney()
Creates a new ItemMoney with random energy
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for rocket painting.protected void
doSpecialUpdate(AnimationInfo animation)
Performs the update in each round in overridden classes.java.lang.String
getImageName(AnimationInfo animation)
Returns image name.int
getItemRating()
Returns an item value for ComputerFigures rating in the items category.int
getPointBonus()
Returns the point bonus.boolean
onBePickedUp(Figure picker, AnimationInfo animation)
Adds this items money value to the picker's money.protected void
resetMoney()
void
setEnergy(int newEnergy)
Sets this things energy level.-
Methods inherited from class com.starpoints.game.Item
affectsBlue, bePickedUp, beUsed, bombPlaced, createState, die, entersColor, explodes, gainsEnergy, gainsPermanentItem, gainsSlots, getCategory, getDieReason, getDrawText, getItemRating, getMoveAnimationLength, getName, getPainterClassname, getPickUpClip, getPickupText, getRamPower, getUseClip, getUser, heatChanges, is3DItem, isAffectedByColor, isAvailableInEditor, isBomb, isRammed, isRocketTarget, isStunned, isWeapon, killedEnemy, losesEnergy, losesItem, losesPermanentItem, lostPermanentItem, onBeforeDie, onBeHitByItem, onBeUsed, 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, 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, setEnergyMaxCount, setGame, setMaxEnergy, setPoint, setStatus, staysOnColor, stepText, updateEnergy
-
-
-
-
Method Detail
-
addStateProperties
protected void addStateProperties(ThingState state, AnimationInfo animation)
Adds properties necessary for rocket painting.- Overrides:
addStateProperties
in classThing
- Parameters:
state
- The state to add properties to.animation
- The current AnimationInfo.
-
getItemRating
public int getItemRating()
Returns an item value for ComputerFigures rating in the items category.- Overrides:
getItemRating
in classItem
- Returns:
- 0.
-
doSpecialUpdate
protected void doSpecialUpdate(AnimationInfo animation)
Performs the update in each round in overridden classes. Resets the money value depending on the energy- Overrides:
doSpecialUpdate
in classItem
- Parameters:
animation
- The AnimationInfo
-
resetMoney
protected void resetMoney()
-
getImageName
public java.lang.String getImageName(AnimationInfo animation)
Returns image name.- Overrides:
getImageName
in classThing
- Parameters:
animation
- The AnimationInfo.- Returns:
- "item_coin"+money+"_"+0-3.
-
onBePickedUp
public boolean onBePickedUp(Figure picker, AnimationInfo animation)
Adds this items money value to the picker's money. If point gain is 500 , an additional sound is played ("item_points25000").- Overrides:
onBePickedUp
in classItem
- Parameters:
picker
- The picker.animation
- The AnimationInfo.- Returns:
- false.
-
getPointBonus
public int getPointBonus()
Returns the point bonus.- Overrides:
getPointBonus
in classItem
- Returns:
- The point bonus.
-
-