pub struct AbilityManaPart { /* private fields */ }Expand description
Mana-producing component of a spell ability.
Mirrors Java’s AbilityManaPart — stores the produced mana string,
restrictions on how it can be spent, and associated effects.
Implementations§
Source§impl AbilityManaPart
impl AbilityManaPart
Sourcepub fn new(produced: &str, restrictions: &str) -> Self
pub fn new(produced: &str, restrictions: &str) -> Self
Create a new mana part with the given production and restrictions.
Mirrors Java’s AbilityManaPart(SpellAbility, String, String).
Sourcepub fn can_produce(&self, color: &str) -> bool
pub fn can_produce(&self, color: &str) -> bool
Check if this ability can produce the given color of mana.
Mirrors Java’s AbilityManaPart.canProduce(String).
Returns true if the color string is found within orig_produced,
or if orig_produced is “Any”.
Sourcepub fn get_orig_produced(&self) -> &str
pub fn get_orig_produced(&self) -> &str
Get the original mana production string.
Mirrors Java’s AbilityManaPart.getOrigProduced().
Sourcepub fn can_this_produce(&self) -> bool
pub fn can_this_produce(&self) -> bool
Whether this ability can produce any mana at all.
Mirrors Java’s AbilityManaPart.canThisProduce().
Sourcepub fn amount_of_mana_generated(&self) -> i32
pub fn amount_of_mana_generated(&self) -> i32
Count the number of individual mana generated.
Mirrors Java’s AbilityManaPart.amountOfManaGenerated(SpellAbility).
Each space-separated token in orig_produced counts as one mana.
Sourcepub fn total_amount_of_mana_generated(&self) -> i32
pub fn total_amount_of_mana_generated(&self) -> i32
Total amount of mana generated, counting “All” and “Any” as 1 each.
Mirrors Java’s AbilityManaPart.totalAmountOfManaGenerated(SpellAbility).
Sourcepub fn mana_restrictions(&self) -> &str
pub fn mana_restrictions(&self) -> &str
Get the mana restrictions string.
Sourcepub fn set_adds_keywords(&mut self, keywords: Option<String>)
pub fn set_adds_keywords(&mut self, keywords: Option<String>)
Set keywords to add to spells cast with this mana.
Sourcepub fn adds_keywords(&self) -> Option<&str>
pub fn adds_keywords(&self) -> Option<&str>
Get keywords added by this mana.
Sourcepub fn set_triggers_when_spent(&mut self, trigger: Option<String>)
pub fn set_triggers_when_spent(&mut self, trigger: Option<String>)
Set the trigger that fires when this mana is spent.
Sourcepub fn triggers_when_spent(&self) -> Option<&str>
pub fn triggers_when_spent(&self) -> Option<&str>
Get the trigger that fires when this mana is spent.
Sourcepub fn is_persistent_mana(&self) -> bool
pub fn is_persistent_mana(&self) -> bool
Whether this mana persists between phases.
Sourcepub fn set_persistent_mana(&mut self, val: bool)
pub fn set_persistent_mana(&mut self, val: bool)
Set whether this mana persists between phases.
Sourcepub fn is_combat_mana(&self) -> bool
pub fn is_combat_mana(&self) -> bool
Whether this mana can only be spent during combat.
Sourcepub fn set_combat_mana(&mut self, val: bool)
pub fn set_combat_mana(&mut self, val: bool)
Set whether this mana can only be spent during combat.
Sourcepub fn last_express_choice(&self) -> &str
pub fn last_express_choice(&self) -> &str
Get last express choice for mana generation.
Sourcepub fn set_last_express_choice(&mut self, choice: String)
pub fn set_last_express_choice(&mut self, choice: String)
Set last express choice for mana generation.
Sourcepub fn clear_express_choice(&mut self)
pub fn clear_express_choice(&mut self)
Clear express choice for mana generation.
Mirrors Java’s AbilityManaPart.clearExpressChoice().
Sourcepub fn produce_mana(&self) -> &str
pub fn produce_mana(&self) -> &str
Produce mana into the mana pool.
Mirrors Java’s AbilityManaPart.produceMana(String, Player, SpellAbility).
Returns the produced mana string for the pool to consume.
Sourcepub fn taps_for_mana(&self) -> bool
pub fn taps_for_mana(&self) -> bool
Whether this ability taps the source for mana.
Mirrors Java’s AbilityManaPart.tapsForMana().
Sourcepub fn cannot_counter_paid_with(&self) -> bool
pub fn cannot_counter_paid_with(&self) -> bool
Whether the mana produced cannot be countered when paid with.
Mirrors Java’s AbilityManaPart.cannotCounterPaidWith().
Sourcepub fn add_no_counter_effect(&mut self)
pub fn add_no_counter_effect(&mut self)
Add a no-counter effect to the mana restrictions.
Mirrors Java’s AbilityManaPart.addNoCounterEffect().
Sourcepub fn add_keywords(&mut self, keywords: &str)
pub fn add_keywords(&mut self, keywords: &str)
Add keywords to spells cast with this mana.
Mirrors Java’s AbilityManaPart.addKeywords().
Sourcepub fn adds_counters(&self) -> bool
pub fn adds_counters(&self) -> bool
Whether this mana adds counters to the spell.
Mirrors Java’s AbilityManaPart.addsCounters().
Sourcepub fn create_etb_counters(&self) -> bool
pub fn create_etb_counters(&self) -> bool
Create ETB counters for the spell cast with this mana.
Mirrors Java’s AbilityManaPart.createETBCounters().
Sourcepub fn add_triggers_when_spent(&mut self, trigger: &str)
pub fn add_triggers_when_spent(&mut self, trigger: &str)
Add a trigger that fires when this mana is spent.
Mirrors Java’s AbilityManaPart.addTriggersWhenSpent().
Sourcepub fn meets_mana_restrictions(&self, restriction: &str) -> bool
pub fn meets_mana_restrictions(&self, restriction: &str) -> bool
Check if this mana meets the given mana restrictions.
Mirrors Java’s AbilityManaPart.meetsManaRestrictions(SpellAbility).
Sourcepub fn meets_mana_shard_restrictions(&self) -> bool
pub fn meets_mana_shard_restrictions(&self) -> bool
Check if this mana meets mana shard restrictions.
Mirrors Java’s AbilityManaPart.meetsManaShardRestrictions().
Sourcepub fn meets_spell_and_shard_restrictions(&self) -> bool
pub fn meets_spell_and_shard_restrictions(&self) -> bool
Check if this mana meets both spell and shard restrictions.
Mirrors Java’s AbilityManaPart.meetsSpellAndShardRestrictions(SpellAbility).
Trait Implementations§
Source§impl Clone for AbilityManaPart
impl Clone for AbilityManaPart
Source§fn clone(&self) -> AbilityManaPart
fn clone(&self) -> AbilityManaPart
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more