Class Quest
java.lang.Object
net.demilich.metastone.game.logic.CustomCloneable
net.demilich.metastone.game.entities.Entity
net.demilich.metastone.game.spells.trigger.Enchantment
net.demilich.metastone.game.spells.trigger.secrets.Quest
- All Implemented Interfaces:
Serializable
,Cloneable
,Comparable<Entity>
,HasCard
,Trigger
A quest is an enchantment and entity that goes into the
Spellsource.ZonesMessage.Zones.QUEST
zone. The player typically triggers the quest EnchantmentDesc.countUntilCast
times, when its EnchantmentDesc.spell
is cast.
For example, to implement the quest, "Quest: Gain 10 armor. Reward: The Coin":
{ "eventTrigger": { "class": "ArmorChangedTrigger", "condition": { "class": "ComparisonCondition", "value1": { "class": "EventValueProvider" }, "value2": 0, "operation": "GREATER" } }, "spell": { "class": "ReceiveCardSpell", "card": "spell_the_coin" }, "countUntilCast": 10, "countByValue": true }This is a complex quest. Observe that the quest can count up using an event's value by setting
EnchantmentDesc.countByValue
to true (in this case, the amount of armor gained, computed by listening to armor
change events that have an event value greater than zero). EnchantmentDesc.countUntilCast
is equal to the
amount of armor needed to be gained to fulfill the quest, in this case.-
Field Summary
Fields inherited from class net.demilich.metastone.game.spells.trigger.Enchantment
activated, activationTriggers, added, copyToActor, countByValue, countUntilCast, expirationTriggers, expired, firesThisSequence, hostReference, keepAfterTransform, maxFiresPerSequence, oneTurn, persistentOwner, spell, triggers, usesSpellTrigger, zones
Fields inherited from class net.demilich.metastone.game.entities.Entity
attributes, effectSource, entityLocation, name, NO_OWNER, sourceCard
-
Constructor Summary
ConstructorsConstructorDescriptionQuest
(EnchantmentDesc desc, Card source) Quest
(EnchantmentDesc desc, EventTrigger trigger, SpellDesc spell, Card source, int countUntilCast, boolean countByValue) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
clone()
Clone an entity, including its ID and location.com.hiddenswitch.spellsource.rpc.Spellsource.EntityTypeMessage.EntityType
Gets the type of entity this is.com.hiddenswitch.spellsource.rpc.Spellsource.ZonesMessage.Zones[]
getZones()
boolean
isPact()
Pacts are a kind of quest that can be triggered by either player.protected boolean
Casts the effects of this enchantment.void
setPact
(boolean pact) Set totrue
by theAddPactSpell
.Methods inherited from class net.demilich.metastone.game.spells.trigger.Enchantment
activate, endOfSequence, expire, fires, getActivationTriggers, getCopy, getCountUntilCast, getDefaultBattlefieldZones, getDefaultBattlefieldZonesSet, getDefaultDeckZones, getDefaultGameZones, getDefaultPassiveZones, getDefaultTriggers, getDefaultZones, getEntrySet, getExpirationTriggers, getFires, getHostReference, getMaxFires, getMaxFiresPerSequence, getOneTurn, getSourceCard, getSpell, getTriggers, getUsesSpellTrigger, innerQueues, interestedIn, isActivated, isCopyToActor, isCountByValue, isExpired, isKeptAfterTransform, isPersistentOwner, onAdd, oneTurnOnly, onGameEvent, queues, setActivated, setActivationTriggers, setCopyToActor, setCountByValue, setCountUntilCast, setExpirationTriggers, setFires, setHostReference, setKeepAfterTransform, setMaxFires, setMaxFiresPerSequence, setOneTurn, setPersistentOwner, setSpell, setTriggers, setUsesSpellTrigger, setZones, shouldNotifyEnchantmentFired, toString
Methods inherited from class net.demilich.metastone.game.entities.Entity
compareTo, diedOnBattlefield, evaluateDescriptions, getAttribute, getAttributes, getAttributeValue, getAttributeValue, getCardInventoryId, getCopySource, getDescription, getDescription, getDynamicDescription, getEffectSource, getEntityLocation, getGameTriggers, getId, getIndex, getMaxNumberOfAttacks, getName, getOwner, getRace, getReference, getUserId, getZone, hasAttribute, hasPersistentEffects, isDestroyed, isInPlay, isRemovedPeacefully, modifyAttribute, modifyHpBonus, moveOrAddTo, moveOrAddTo, resetEntityLocations, setAttribute, setAttribute, setAttribute, setDescription, setEffectSource, setEntityLocation, setId, setName, setOwner, setSourceCard, setUserId, transformResolved, transformResolved
-
Constructor Details
-
Quest
public Quest(EnchantmentDesc desc, EventTrigger trigger, SpellDesc spell, Card source, int countUntilCast, boolean countByValue) -
Quest
-
-
Method Details
-
setPact
public void setPact(boolean pact) Set totrue
by theAddPactSpell
.- Parameters:
pact
-
-
isPact
public boolean isPact()Pacts are a kind of quest that can be triggered by either player.- Returns:
true
if this quest should behave like a pact.- See Also:
-
process
Description copied from class:Enchantment
Casts the effects of this enchantment.- Overrides:
process
in classEnchantment
- Returns:
true
if processing succeeded.
-
cast
- Overrides:
cast
in classEnchantment
-
getZones
public com.hiddenswitch.spellsource.rpc.Spellsource.ZonesMessage.Zones[] getZones()- Overrides:
getZones
in classEnchantment
-
getEntityType
public com.hiddenswitch.spellsource.rpc.Spellsource.EntityTypeMessage.EntityType getEntityType()Description copied from class:Entity
Gets the type of entity this is. These will very nearly match up with the classes, but are primarily used for filters that e.g. draw a Spell or destroy all Secrets.- Overrides:
getEntityType
in classEnchantment
- Returns:
- An
Spellsource.EntityTypeMessage.EntityType
-
clone
Description copied from class:Entity
Clone an entity, including its ID and location.Use this method for emulating an "immutable" view on an entity. This kind of cloning is not suitable for most gameplay situations, because using the clone will cause two entities with identical IDs and locations to exist. Instead, a subclass will provide a
getCopy()
method that is more helpful for gameplay.- Specified by:
clone
in interfaceTrigger
- Overrides:
clone
in classEnchantment
- Returns:
- An exact clone.
-