AbilityContainer
, Affectable
, Behavable
, CMObject
, Combatant
, Contingent
, DBIdentifiable
, Economics
, Environmental
, Expireable
, FactionMember
, Followable<MOB>
, ItemCollection
, ItemPossessor
, Modifiable
, MsgListener
, MUDCmdProcessor
, Physical
, PhysicalAgent
, Rider
, ShopKeeper
, StatsAffecting
, Tattooable
, Tickable
, MOB
, java.lang.Cloneable
, java.lang.Comparable<CMObject>
GenShopkeeper
, StdBanker
, StdLibrarian
, StdPostman
public class StdShopKeeper extends StdMOB implements ShopKeeper
ItemPossessor.Expire, ItemPossessor.Find, ItemPossessor.Move
MOB.Attrib
ShopKeeper.ShopPrice, ShopKeeper.ViewType
StdMOB.ApplyAffectCharState<T extends StatsAffecting>, StdMOB.ApplyAffectCharStats<T extends StatsAffecting>, StdMOB.ApplyRecAffectPhyStats<T extends StatsAffecting>
Modifier and Type | Field | Description |
---|---|---|
protected Pair<java.lang.Long,TimeClock.TimePeriod> |
budget |
|
protected long |
budgetMax |
|
protected long |
budgetRemaining |
|
protected int |
budgetTickDown |
|
protected java.lang.String |
currency |
|
protected double[] |
devalueRate |
|
protected int |
invResetRate |
|
protected int |
invResetTickDown |
|
protected java.lang.String |
itemZapperMask |
|
protected java.lang.String[] |
pricingAdjustments |
|
protected CoffeeShop |
shop |
|
protected java.util.Set<ShopKeeper.ViewType> |
viewTypes |
|
protected long |
whatIsSoldMask |
idConverter
AGE_MILLIS_THRESHOLD, END_SHEATH_TIME, START_SHEATH_TIME
METAFLAG_AS, METAFLAG_ASMESSAGE, METAFLAG_FORCED, METAFLAG_INORDER, METAFLAG_MPFORCED, METAFLAG_ORDER, METAFLAG_POSSESSED, METAFLAG_QUIETLY, METAFLAG_REVERSED, METAFLAG_SNOOPED
DEAL_ALCHEMIST, DEAL_ANYTECHNOLOGY, DEAL_ANYTHING, DEAL_ARMOR, DEAL_AUCTIONEER, DEAL_BANKER, DEAL_BOOKS, DEAL_BUTCHER, DEAL_CASTER, DEAL_CLANBANKER, DEAL_CLANDSELLER, DEAL_CLANPOSTMAN, DEAL_CLOTHSPINNER, DEAL_CONFLICTS, DEAL_CSHIPSELLER, DEAL_DESCS, DEAL_FOODSELLER, DEAL_GENERAL, DEAL_GROWER, DEAL_HIDESELLER, DEAL_INNKEEPER, DEAL_INSTRUMENTS, DEAL_INVENTORYONLY, DEAL_JEWELLER, DEAL_LANDSELLER, DEAL_LEATHER, DEAL_LUMBERER, DEAL_MAGIC, DEAL_METALSMITH, DEAL_PETS, DEAL_POSTMAN, DEAL_READABLES, DEAL_SHIPSELLER, DEAL_SLAVES, DEAL_STONEYARDER, DEAL_TRAINER, DEAL_WEAPONS
_name, abilitys, abilityUseCache, abilityUseTrig, affectCharState, affectCharStats, affectPhyStats, affects, ageMinutes, amDead, amDestroyed, amFollowing, atRange, attributesBitmap, baseCharStats, basePhyStats, baseState, behaviors, cachedImageName, charStats, clanAffects, clans, CODES, commandQue, curState, databaseID, description, displayText, experience, expertises, factions, followers, inventory, kickFlag, lastLocation, liegeID, location, maxState, me, miscText, money, moneyVariation, mySession, peaceTime, phyStats, playerStats, possHeldItem, possStartRoom, possWieldedItem, practices, questPoint, racialAffects, rawImageName, recoverAffectP, recoverTickCter, removeFromGame, riding, scripts, soulMate, speedAdj, tattoos, tickAgeCounter, tickStatus, trains, triggerer, validChkCounter, victim, wimpHitPoint, xtraValues
STATUS_AFFECT, STATUS_ALIVE, STATUS_BEHAVIOR, STATUS_CLASS, STATUS_DEAD, STATUS_END, STATUS_FIGHT, STATUS_MISC, STATUS_MISC2, STATUS_MISC3, STATUS_MISC4, STATUS_MISC5, STATUS_MISC6, STATUS_MISC7, STATUS_NOT, STATUS_OTHER, STATUS_RACE, STATUS_REBIRTH, STATUS_SCRIPT, STATUS_START, STATUS_WEATHER, TICKID_AREA, TICKID_BALLISTICK, TICKID_CLAN, TICKID_CLANITEM, TICKID_DEADBODY_DECAY, TICKID_ELECTRONICS, TICKID_EMAIL, TICKID_EVENT, TICKID_EXIT_BEHAVIOR, TICKID_EXIT_REOPEN, TICKID_ITEM_BEHAVIOR, TICKID_ITEM_BOUNCEBACK, TICKID_LIGHT_FLICKERS, TICKID_LIVEAUCTION, TICKID_LONGERMASK, TICKID_MISCELLANEOUS, TICKID_MOB, TICKID_PROPERTY_SPECIAL, TICKID_QUEST, TICKID_READYTOSTOP, TICKID_ROOM_BEHAVIOR, TICKID_ROOM_ITEM_REJUV, TICKID_SHORTERMASK, TICKID_SOLITARYMASK, TICKID_SPECIALCOMBAT, TICKID_SPECIALMANEUVER, TICKID_SPELL_AFFECT, TICKID_SUPPORT, TICKID_TIMEAUCTION, TICKID_TRAP_DESTRUCTION, TICKID_TRAP_RESET
Constructor | Description |
---|---|
StdShopKeeper() |
Modifier and Type | Method | Description |
---|---|---|
void |
addSoldType(int mask) |
Adds the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper
to the existing shopkeeper mask.
|
protected void |
cloneFix(MOB E) |
|
void |
destroy() |
Utterly and permanently destroy this object, not only removing it from the map, but
causing this object to be collected as garbage by Java.
|
protected void |
doBudgetReset() |
|
protected void |
doInventoryReset() |
|
boolean |
doISellThis(Environmental thisThang) |
Returns whether this ShopKeeper deals in the type of item passed in.
|
void |
executeMsg(Environmental myHost,
CMMsg msg) |
The general message event handler for the object.
|
Pair<java.lang.Long,TimeClock.TimePeriod> |
getFinalBudget() |
Returns a description of the buying budget of the shopkeeper.
|
java.lang.String |
getFinalCurrency() |
Gets the derived currency for this object, which will be referenced by
shopkeepers, bankers, and other mobs.
|
double[] |
getFinalDevalueRate() |
Returns a double array describing the percentage in the drop of the price at
which this ShopKeeper will buy back items based on the number already
in his inventory.
|
java.lang.String |
getFinalIgnoreMask() |
Returns the mask used to determine if a customer is ignored by the ShopKeeper.
|
int |
getFinalInvResetRate() |
Returns the number of ticks between totally resetting this ShopKeepers
inventory back to what it was.
|
java.lang.String[] |
getFinalItemPricingAdjustments() |
A string set describing how pricing for this ShopKeeper will differ based on item masks
The format for each string is a floating point number followers by a space and a zapper mask
|
java.lang.String |
getFinalPrejudiceFactors() |
A string describing how pricing for this ShopKeeper will differ based on customer attributes
such as race.
|
java.lang.String |
getRawBbudget() |
Returns a description of the buying budget of the shopkeeper.
|
java.lang.String |
getRawCurrency() |
Gets the default currency for this object, which will be referenced by
shopkeepers, bankers, and other mobs.
|
java.lang.String |
getRawDevalueRate() |
Returns a string describing the percentage in the drop of the price at
which this ShopKeeper will buy back items based on the number already
in his inventory.
|
java.lang.String |
getRawIgnoreMask() |
Returns the mask used to determine if a customer is ignored by the ShopKeeper.
|
int |
getRawInvResetRate() |
Returns the number of ticks between totally resetting this ShopKeepers
inventory back to what it was.
|
java.lang.String[] |
getRawItemPricingAdjustments() |
A string set describing how pricing for this ShopKeeper will differ based on item masks
The format for each string is a floating point number followers by a space and a zapper mask
|
java.lang.String |
getRawPrejudiceFactors() |
A string describing how pricing for this ShopKeeper will differ based on customer attributes
such as race.
|
CoffeeShop |
getShop() |
the CoffeeShop method to access the shopkeepers store of goods
|
protected Area |
getStartArea() |
|
long |
getWhatIsSoldMask() |
Returns the ShopKeeper DEAL_* mask describing what is sold or bought by this ShopKeeper
|
java.lang.String |
getWhatIsSoldZappermask() |
Returns the zapper mask which applies to items to determine whether they are bought and sold
by this shopkeeper.
|
java.lang.String |
ID() |
The CoffeeMud Java Class ID shared by all instances of
this object.
|
boolean |
isSold(int mask) |
Returns whether the given type of good is sold by this shopkeeper.
|
boolean |
okMessage(Environmental myHost,
CMMsg msg) |
The general message event previewer for the object.
|
void |
setBudget(java.lang.String factors) |
Sets a description of the buying budget of the shopkeeper.
|
void |
setCurrency(java.lang.String newCurrency) |
Returns the default currency for this object, which will be referenced by
shopkeepers, bankers, and other mobs.
|
void |
setDevalueRate(java.lang.String factors) |
Sets a string describing the percentage in the drop of the price at
which this ShopKeeper will buy back items based on the number already
in his inventory.
|
void |
setIgnoreMask(java.lang.String factors) |
Sets the mask used to determine if a customer is ignored by the ShopKeeper.
|
void |
setInvResetRate(int ticks) |
Sets the number of ticks between totally resetting this ShopKeepers
inventory back to what it was.
|
void |
setItemPricingAdjustments(java.lang.String[] factors) |
Sets the string set describing how pricing for this ShopKeeper will differ based on item masks
The format for each string is a floating point number followers by a space and a zapper mask
|
void |
setPrejudiceFactors(java.lang.String factors) |
Sets the string describing how pricing for this ShopKeeper will differ based on customer attributes
such as race.
|
void |
setWhatIsSoldMask(long newSellCode) |
Sets the encoded ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeper
|
void |
setWhatIsSoldZappermask(java.lang.String newSellMask) |
Sets the zapper mask which applies to items to determine whether they are bought and sold
by this shopkeeper.
|
protected boolean |
stdokMessage(Environmental myHost,
CMMsg msg) |
For bankers and stuff that override stdshopkeeper, but can't call
its okmess.
|
java.lang.String |
storeKeeperString() |
Based on the value of this ShopKeepers whatIsSold() method, this will return a displayable string
describing that type.
|
boolean |
tick(Tickable ticking,
int tickID) |
this is the method which is called periodically by the threading engine.
|
java.util.Set<ShopKeeper.ViewType> |
viewFlags() |
The ShopKeeper item view flags for determining what a player sees
from items in this shopkeepers inventory.
|
copyOf, initializeClass, newInstance
amDestroyed, isSavable, setSavable
description, displayText, image, isGeneric, L, maxRange, minRange, miscTextFormat, Name, rawImage, sameAs, setDescription, setDisplayText, setImage, setMiscText, setName, text
expirationDate, setExpirationDate
getSaveStatIndex, getStat, getStatCodes, isStat, setStat
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
affectCharState, affectCharStats, affectPhyStats
abilities, actions, addAbility, addBehavior, addEffect, addExpertise, addFaction, addFollower, addItem, addItem, addNonUninvokableEffect, addPriorityEffect, addScript, addTattoo, addTattoo, addTattoo, adjustFaction, affectCharState, affectCharStats, affectPhyStats, allAbilities, amActive, amDead, amDestroyed, amFollowing, amUltimatelyFollowing, baseCharStats, basePhyStats, baseState, baseWeight, behaviors, bringToLife, bringToLife, calculateActionCost, canSaveDatabaseID, charStats, checkCommandCancel, clanEffects, clans, clearCommandQueue, commandQueSize, compareTo, confirmLocation, copyFactions, copyOf, counItemsWornAt, curState, databaseID, delAbility, delAllAbilities, delAllBehaviors, delAllEffects, delAllExpertises, delAllItems, delAllScripts, delBehavior, delEffect, delExpertise, delFollower, delItem, delScript, delTattoo, delTattoo, dequeCommand, description, description, displayText, displayText, dispossess, doCommand, doCommand, eachBehavior, eachEffect, eachItem, eachScript, effects, enqueCommand, enqueCommands, expertises, expirationDate, factions, fetchAbility, fetchAbility, fetchBehavior, fetchBehavior, fetchEffect, fetchEffect, fetchExpertise, fetchFaction, fetchFactionData, fetchFactionRanges, fetchFirstWornItem, fetchFollower, fetchFollower, fetchFollowerOrder, fetchFromInventory, fetchHeldItem, fetchItem, fetchRandomAbility, fetchScript, fetchWieldedItem, fetchWornItems, findAbility, findItem, findItem, findItems, findItems, findTattoo, findTattooStartsWith, fixChannelColors, flagVariableEq, followers, freeWearPositions, genericName, getAbilityUsageCache, getAgeMinutes, getAttributesBitmap, getClanRole, getCodeNum, getCombatant, getContextName, getDirectionToTarget, getExperience, getExpNeededDelevel, getExpNeededLevel, getExpNextLevel, getExpPrevLevel, getFactionListing, getGroupMembers, getGroupMembersAndRideables, getItem, getLiegeID, getMoney, getMoneyVariation, getNaturalWeapon, getPeaceTime, getPractices, getQuestPoint, getRandomItem, getRideBuddies, getSaveStatIndex, getStartRoom, getStat, getStatCodes, getTickStatus, getTopCommand, getTrains, getVictim, getWearPositions, getWimpHitPoint, hasFaction, hasOnlyGoldInInventory, healthText, image, initializeClass, isAttributeSet, isContent, isEitherOfUsDead, isFollowedBy, isGeneric, isInCombat, isMarriedToLiege, isMine, isMonster, isPermissableToFight, isPlayer, isPossessing, isRacialAbility, isSavable, isStat, items, killMeDead, L, lastTickedDateTime, location, makePeace, maxCarry, maxFollowers, maxItems, maxRange, maxState, mayIFight, mayPhysicallyAttack, minRange, miscTextFormat, moveItemTo, moveItemTo, name, name, Name, newInstance, numAbilities, numAllAbilities, numAllEffects, numBehaviors, numEffects, numFollowers, numItems, numScripts, personalEffects, phyStats, playerStats, prequeCommand, prequeCommands, racialEffects, rangeToTarget, rawImage, recoverCharStats, recoverMaxState, recoverPhyStats, removeFaction, removeFromGame, resetToMaxState, riding, sameAs, scripts, session, setActions, setAgeMinutes, setAttribute, setAttributesBitmap, setBaseCharStats, setBasePhyStats, setBaseState, setClan, setCombatant, setDatabaseID, setDescription, setDestroyed, setDisplayText, setExperience, setExpirationDate, setFollowing, setImage, setLiegeID, setLocation, setMiscText, setMoney, setMoneyVariation, setName, setPlayerStats, setPractices, setQuestPoint, setRangeToTarget, setRiding, setSavable, setSession, setSoulMate, setStartRoom, setStat, setTrains, setTriggerer, setVictim, setWimpHitPoint, soulMate, tattoos, tell, tell, text, titledName, titledName, totalFollowers, triggerer, willFollowOrdersOf
getTickStatus, name
protected CoffeeShop shop
protected long whatIsSoldMask
protected int invResetRate
protected int invResetTickDown
protected long budgetRemaining
protected long budgetMax
protected int budgetTickDown
protected double[] devalueRate
protected java.lang.String currency
protected java.lang.String[] pricingAdjustments
protected java.lang.String itemZapperMask
protected java.util.Set<ShopKeeper.ViewType> viewTypes
protected Pair<java.lang.Long,TimeClock.TimePeriod> budget
public java.lang.String ID()
CMObject
public boolean isSold(int mask)
ShopKeeper
isSold
in interface ShopKeeper
mask
- the ShopKeeper DEAL_* constant describing what is sold or bought by this ShopKeeperShopKeeper.DEAL_DESCS
,
ShopKeeper.getWhatIsSoldMask()
public void addSoldType(int mask)
ShopKeeper
addSoldType
in interface ShopKeeper
mask
- the ShopKeeper DEAL_* constants describing what is sold or bought by this ShopKeeperShopKeeper.DEAL_DESCS
,
ShopKeeper.isSold(int)
public long getWhatIsSoldMask()
ShopKeeper
getWhatIsSoldMask
in interface ShopKeeper
ShopKeeper.DEAL_DESCS
,
ShopKeeper.setWhatIsSoldMask(long)
public void setWhatIsSoldMask(long newSellCode)
ShopKeeper
setWhatIsSoldMask
in interface ShopKeeper
newSellCode
- the dealer type constants to the 2nd power, shifted 8 bits leftShopKeeper.DEAL_DESCS
,
ShopKeeper.addSoldType(int)
public java.util.Set<ShopKeeper.ViewType> viewFlags()
ShopKeeper
viewFlags
in interface ShopKeeper
public CoffeeShop getShop()
ShopKeeper
getShop
in interface ShopKeeper
CoffeeShop
public void destroy()
Contingent
destroy
in interface Contingent
destroy
in class StdMOB
public java.lang.String storeKeeperString()
ShopKeeper
storeKeeperString
in interface ShopKeeper
ShopKeeper.isSold(int)
public boolean doISellThis(Environmental thisThang)
ShopKeeper
doISellThis
in interface ShopKeeper
thisThang
- the item to determine if the shopkeeper deals inShopKeeper.isSold(int)
protected Area getStartArea()
protected void doInventoryReset()
protected void doBudgetReset()
public boolean tick(Tickable ticking, int tickID)
Tickable
tick
in interface Tickable
tick
in class StdMOB
ticking
- a reference to this Tickable objecttickID
- the TICKID_ constant describing this periodic call, as defined in TickableTickable
,
ServiceEngine
,
TickableGroup
protected boolean stdokMessage(Environmental myHost, CMMsg msg)
myHost
- the hostmsg
- the messagepublic boolean okMessage(Environmental myHost, CMMsg msg)
MsgListener
okMessage
in interface MsgListener
okMessage
in class StdMOB
myHost
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that wants to be executedCMMsg
,
CMMsg.source()
public void executeMsg(Environmental myHost, CMMsg msg)
MsgListener
executeMsg
in interface MsgListener
executeMsg
in class StdMOB
myHost
- either the initiator of the event, or the host of this objectmsg
- the CMMsg that needs to be executedCMMsg
public java.lang.String getFinalPrejudiceFactors()
Economics
getFinalPrejudiceFactors
in interface Economics
public java.lang.String getRawPrejudiceFactors()
Economics
getRawPrejudiceFactors
in interface Economics
public void setPrejudiceFactors(java.lang.String factors)
Economics
setPrejudiceFactors
in interface Economics
factors
- the string describing price prejudicingpublic java.lang.String getFinalIgnoreMask()
Economics
getFinalIgnoreMask
in interface Economics
MaskingLibrary
public java.lang.String getRawIgnoreMask()
Economics
getRawIgnoreMask
in interface Economics
MaskingLibrary
public void setIgnoreMask(java.lang.String factors)
Economics
setIgnoreMask
in interface Economics
factors
- the mask to useMaskingLibrary
public java.lang.String[] getFinalItemPricingAdjustments()
Economics
getFinalItemPricingAdjustments
in interface Economics
public java.lang.String[] getRawItemPricingAdjustments()
Economics
getRawItemPricingAdjustments
in interface Economics
public void setItemPricingAdjustments(java.lang.String[] factors)
Economics
setItemPricingAdjustments
in interface Economics
factors
- the string describing price prejudicingpublic Pair<java.lang.Long,TimeClock.TimePeriod> getFinalBudget()
Economics
getFinalBudget
in interface Economics
public java.lang.String getRawBbudget()
Economics
getRawBbudget
in interface Economics
public void setBudget(java.lang.String factors)
Economics
public double[] getFinalDevalueRate()
Economics
getFinalDevalueRate
in interface Economics
public java.lang.String getRawDevalueRate()
Economics
getRawDevalueRate
in interface Economics
public void setDevalueRate(java.lang.String factors)
Economics
setDevalueRate
in interface Economics
factors
- the price dropping percentage rule for this shopkeeperpublic int getFinalInvResetRate()
Economics
getFinalInvResetRate
in interface Economics
public int getRawInvResetRate()
Economics
getRawInvResetRate
in interface Economics
public void setInvResetRate(int ticks)
Economics
setInvResetRate
in interface Economics
ticks
- the number of ticks between total resets of inventorypublic void setWhatIsSoldZappermask(java.lang.String newSellMask)
ShopKeeper
setWhatIsSoldZappermask
in interface ShopKeeper
newSellMask
- the item zappermaskShopKeeper.isSold(int)
,
ShopKeeper.getWhatIsSoldZappermask()
,
MaskingLibrary
public java.lang.String getWhatIsSoldZappermask()
ShopKeeper
getWhatIsSoldZappermask
in interface ShopKeeper
ShopKeeper.isSold(int)
,
ShopKeeper.setWhatIsSoldZappermask(String)
,
MaskingLibrary
public java.lang.String getFinalCurrency()
Economics
getFinalCurrency
in interface Economics
public java.lang.String getRawCurrency()
Economics
getRawCurrency
in interface Economics
public void setCurrency(java.lang.String newCurrency)
Economics
setCurrency
in interface Economics
newCurrency
- a currency name/definition