mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
Merge
This commit is contained in:
commit
9c4297c74a
4 changed files with 180 additions and 5 deletions
|
@ -181,7 +181,7 @@
|
||||||
<txtFileVersion>MAGE Client</txtFileVersion>
|
<txtFileVersion>MAGE Client</txtFileVersion>
|
||||||
<fileDescription>Mage Client</fileDescription>
|
<fileDescription>Mage Client</fileDescription>
|
||||||
<copyright>(C) Mage Development Team</copyright>
|
<copyright>(C) Mage Development Team</copyright>
|
||||||
<productVersion>0.7.3.0</productVersion>
|
<productVersion>${project.version}.0</productVersion>
|
||||||
<txtProductVersion>MAGE Client</txtProductVersion>
|
<txtProductVersion>MAGE Client</txtProductVersion>
|
||||||
<productName>MAGE</productName>
|
<productName>MAGE</productName>
|
||||||
<internalName>Mage-Client</internalName>
|
<internalName>Mage-Client</internalName>
|
||||||
|
|
|
@ -201,15 +201,15 @@
|
||||||
</opts>
|
</opts>
|
||||||
</jre>
|
</jre>
|
||||||
<versionInfo>
|
<versionInfo>
|
||||||
<fileVersion>0.7.2.0</fileVersion>
|
<fileVersion>${project.version}.0</fileVersion>
|
||||||
<txtFileVersion>MAGE Server</txtFileVersion>
|
<txtFileVersion>MAGE Server</txtFileVersion>
|
||||||
<fileDescription>Mage Server</fileDescription>
|
<fileDescription>Mage Server</fileDescription>
|
||||||
<copyright>(C) Mage Development Team</copyright>
|
<copyright>(C) Mage Development Team</copyright>
|
||||||
<productVersion>0.7.2.0</productVersion>
|
<productVersion>${project.version}.0</productVersion>
|
||||||
<txtProductVersion>MAGE Server</txtProductVersion>
|
<txtProductVersion>MAGE Server</txtProductVersion>
|
||||||
<productName>MAGE</productName>
|
<productName>MAGE</productName>
|
||||||
<internalName>Mage-Server</internalName>
|
<internalName>Mage-Server</internalName>
|
||||||
<originalFilename>original.exe</originalFilename>
|
<originalFilename>mage-server.exe</originalFilename>
|
||||||
</versionInfo>
|
</versionInfo>
|
||||||
</configuration>
|
</configuration>
|
||||||
</execution>
|
</execution>
|
||||||
|
|
|
@ -43,6 +43,7 @@ import mage.target.common.TargetCardInLibrary;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.filter.Filter.ComparisonType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Loki
|
* @author Loki
|
||||||
|
@ -84,7 +85,9 @@ class GreenSunsZenithSearchEffect extends OneShotEffect<GreenSunsZenithSearchEff
|
||||||
filter.getColor().setGreen(true);
|
filter.getColor().setGreen(true);
|
||||||
filter.setUseColor(true);
|
filter.setUseColor(true);
|
||||||
filter.getCardType().add(CardType.CREATURE);
|
filter.getCardType().add(CardType.CREATURE);
|
||||||
filter.setConvertedManaCost(source.getManaCostsToPay().getVariableCosts().get(0).getAmount());
|
//Set the mana cost one higher to 'emulate' a less than or equal to comparison.
|
||||||
|
filter.setConvertedManaCost(source.getManaCostsToPay().getVariableCosts().get(0).getAmount() + 1);
|
||||||
|
filter.setConvertedManaCostComparison(ComparisonType.LessThan);
|
||||||
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
TargetCardInLibrary target = new TargetCardInLibrary(filter);
|
||||||
if (player.searchLibrary(target, game)) {
|
if (player.searchLibrary(target, game)) {
|
||||||
if (target.getTargets().size() > 0) {
|
if (target.getTargets().size() > 0) {
|
||||||
|
|
|
@ -37,26 +37,198 @@ import mage.abilities.keyword.ProtectionAbility;
|
||||||
import mage.abilities.mana.ManaAbility;
|
import mage.abilities.mana.ManaAbility;
|
||||||
import mage.filter.FilterAbility;
|
import mage.filter.FilterAbility;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Represents a collection of {@link Ability Abilities}. This is the top most
|
||||||
|
* interface for this.
|
||||||
|
*
|
||||||
|
* @param <T> The ability type this collection will hold.
|
||||||
|
*
|
||||||
|
* @see mage.abilities.AbilitiesImpl
|
||||||
|
* @see mage.abilities.DelayedTriggeredAbilities
|
||||||
|
* @see mage.abilities.SpecialActions
|
||||||
|
* @see mage.abilities.TriggeredAbilities
|
||||||
|
*/
|
||||||
public interface Abilities<T extends Ability> extends List<T>, Serializable {
|
public interface Abilities<T extends Ability> extends List<T>, Serializable {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves a {@link List}<{@link String}> of ability texts for the
|
||||||
|
* given source.
|
||||||
|
*
|
||||||
|
* @param source The source to retrieve ability texts.
|
||||||
|
* @return the {@link List}<{@link String}> of ability texts.
|
||||||
|
*
|
||||||
|
* @see mage.cards.CardImpl#getRules()
|
||||||
|
* @see mage.abilities.keyword.LevelAbility#getRule()
|
||||||
|
*/
|
||||||
public List<String> getRules(String source);
|
public List<String> getRules(String source);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all activated abilities for the given {@link Zone}.
|
||||||
|
*
|
||||||
|
* @param zone The {@link Zone} for which abilities should be retrieved.
|
||||||
|
* @return All abilities for the given {@link Zone}
|
||||||
|
*
|
||||||
|
* @see mage.cards.CardImpl#getSpellAbility()
|
||||||
|
*/
|
||||||
public Abilities<ActivatedAbility> getActivatedAbilities(Zone zone);
|
public Abilities<ActivatedAbility> getActivatedAbilities(Zone zone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all activated abilities for the given {@link Zone} that match
|
||||||
|
* the given {@link FilterAbility}.
|
||||||
|
*
|
||||||
|
* @param zone The {@link Zone} for which abilities should be retrieved.
|
||||||
|
* @param filter The {@link FilterAbility} to apply to the result.
|
||||||
|
* @return The {@link ActivatedAbility activated abilities} matching the {@link Zone} and {@link FilterAbility}.
|
||||||
|
*
|
||||||
|
* @see mage.players.PlayerImpl#getPlayable(mage.game.Game, mage.filter.FilterAbility, mage.abilities.mana.ManaOptions, boolean)
|
||||||
|
*/
|
||||||
public Abilities<ActivatedAbility> getActivatedAbilities(Zone zone, FilterAbility filter);
|
public Abilities<ActivatedAbility> getActivatedAbilities(Zone zone, FilterAbility filter);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all {@link ManaAbility mana abilities} in the given {@link Zone}.
|
||||||
|
*
|
||||||
|
* @param zone The {@link Zone} to search for {@link ManaAbility mana abilities}.
|
||||||
|
* @return All {@link ManaAbility mana abilities} for the given {@link Zone}.
|
||||||
|
*
|
||||||
|
* @see mage.cards.CardImpl#getMana()
|
||||||
|
* @see mage.players.PlayerImpl#getManaAvailable(mage.game.Game)
|
||||||
|
* @see mage.players.PlayerImpl#getAvailableManaProducers(mage.game.Game)
|
||||||
|
*/
|
||||||
public Abilities<ManaAbility> getManaAbilities(Zone zone);
|
public Abilities<ManaAbility> getManaAbilities(Zone zone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all {@link StaticAbility static abilities} in the given {@link Zone}.
|
||||||
|
*
|
||||||
|
* @param zone The {@link Zone} to search for {@link StaticAbility}
|
||||||
|
* @return All {@link StaticAbility static abilities} in the given {@link Zone}
|
||||||
|
*
|
||||||
|
* @see mage.abilities.effects.ContinuousEffects#getLayeredEffects(mage.game.Game)
|
||||||
|
* @see mage.abilities.effects.ContinuousEffects#getApplicableRequirementEffects(mage.game.permanent.Permanent, mage.game.Game)
|
||||||
|
* @see mage.abilities.effects.ContinuousEffects#getApplicableRestrictionEffects(mage.game.permanent.Permanent, mage.game.Game)
|
||||||
|
* @see mage.abilities.effects.ContinuousEffects#getApplicableReplacementEffects(mage.game.events.GameEvent, mage.game.Game)
|
||||||
|
* @see mage.abilities.effects.ContinuousEffects#asThough(java.util.UUID, mage.Constants.AsThoughEffectType, mage.game.Game)
|
||||||
|
* @see mage.abilities.effects.ContinuousEffects#costModification(mage.abilities.Ability, mage.game.Game)
|
||||||
|
*/
|
||||||
public Abilities<StaticAbility> getStaticAbilities(Zone zone);
|
public Abilities<StaticAbility> getStaticAbilities(Zone zone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all {@link EvasionAbility evasion abilities}.
|
||||||
|
*
|
||||||
|
* @return The {@link EvasionAbility evasion abilities}.
|
||||||
|
*/
|
||||||
public Abilities<EvasionAbility> getEvasionAbilities();
|
public Abilities<EvasionAbility> getEvasionAbilities();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all {@link TriggeredAbility triggered abilities} for the given
|
||||||
|
* {@link Zone}.
|
||||||
|
*
|
||||||
|
* @param zone The {@link Zone} to search for {@link TriggeredAbility triggered abilities}
|
||||||
|
* @return All found {@link TriggeredAbility triggered abilities}.
|
||||||
|
*
|
||||||
|
* @see mage.cards.CardImpl#checkTriggers(mage.Constants.Zone, mage.game.events.GameEvent, mage.game.Game)
|
||||||
|
* @see mage.game.permanent.PermanentImpl#checkTriggers(mage.game.events.GameEvent, mage.game.Game)
|
||||||
|
* @see mage.game.permanent.PermanentCard#checkPermanentOnlyTriggers(mage.game.events.ZoneChangeEvent, mage.game.Game)
|
||||||
|
*/
|
||||||
public Abilities<TriggeredAbility> getTriggeredAbilities(Zone zone);
|
public Abilities<TriggeredAbility> getTriggeredAbilities(Zone zone);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all {@link ProtectionAbility protection abilities}.
|
||||||
|
*
|
||||||
|
* @return All found {@link ProtectionAbility protection abilities}.
|
||||||
|
*
|
||||||
|
* @see mage.game.permanent.PermanentImpl#hasProtectionFrom(mage.MageObject)
|
||||||
|
* @see mage.players.PlayerImpl#hasProtectionFrom(mage.MageObject)
|
||||||
|
* @see mage.players.PlayerImpl#canDamage(mage.MageObject)
|
||||||
|
*/
|
||||||
public Abilities<ProtectionAbility> getProtectionAbilities();
|
public Abilities<ProtectionAbility> getProtectionAbilities();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Retrieves all {@link KickerAbility kicker abilities}.
|
||||||
|
*
|
||||||
|
* @return All found {@link KickerAbility kicker abilities}.
|
||||||
|
*
|
||||||
|
* @see mage.players.PlayerImpl#cast(mage.abilities.SpellAbility, mage.game.Game, boolean)
|
||||||
|
* @see mage.game.stack.Spell#resolveKicker(mage.game.Game)
|
||||||
|
*/
|
||||||
public Abilities<KickerAbility> getKickerAbilities();
|
public Abilities<KickerAbility> getKickerAbilities();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO Method is unused, keep it around?
|
||||||
|
*
|
||||||
|
* The only implementation seems to want to use this for totally a set of
|
||||||
|
* abilities by some arbitrary numeral value. Possibly a good method to be
|
||||||
|
* used by the AI's?
|
||||||
|
*
|
||||||
|
* @return A numeral value representing the 'strength' or effectiveness of the abilities?
|
||||||
|
*/
|
||||||
public int getOutcomeTotal();
|
public int getOutcomeTotal();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the controller of this set of abilities.
|
||||||
|
*
|
||||||
|
* @param controllerId
|
||||||
|
*
|
||||||
|
* @see mage.cards.CardImpl#setControllerId(java.util.UUID)
|
||||||
|
* @see mage.cards.CardImpl#setOwnerId(java.util.UUID)
|
||||||
|
* @see mage.game.permanent.PermanentImpl#changeControllerId(java.util.UUID, mage.game.Game)
|
||||||
|
* @see mage.game.permanent.PermanentCard#copyFromCard(mage.cards.Card)
|
||||||
|
*/
|
||||||
public void setControllerId(UUID controllerId);
|
public void setControllerId(UUID controllerId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the source of this set of abilities.
|
||||||
|
*
|
||||||
|
* @param sourceId
|
||||||
|
*
|
||||||
|
* @see mage.cards.CardImpl#assignNewId()
|
||||||
|
*/
|
||||||
public void setSourceId(UUID sourceId);
|
public void setSourceId(UUID sourceId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Searches this set of abilities to see if the ability represented by the abilityId
|
||||||
|
* is contained within. Can be used to find usages of singleton abilities.
|
||||||
|
*
|
||||||
|
* @param abilityId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public boolean containsKey(UUID abilityId);
|
public boolean containsKey(UUID abilityId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO Method is unused, keep it around?
|
||||||
|
*
|
||||||
|
* Gets the ability represented by the given abilityId.
|
||||||
|
*
|
||||||
|
* @param abilityId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public T get(UUID abilityId);
|
public T get(UUID abilityId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO The usage of this method seems redundant to that of {@link #containsKey(java.util.UUID)}
|
||||||
|
* minus the fact that it searches for exact instances instead of id's of
|
||||||
|
* singleton Abilities.
|
||||||
|
*
|
||||||
|
* Searches for the exact instance of the passed in ability.
|
||||||
|
*
|
||||||
|
* @param ability
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public boolean contains(T ability);
|
public boolean contains(T ability);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Searches this set of abilities for the existence of each of the passed in
|
||||||
|
* set of abilities.
|
||||||
|
*
|
||||||
|
* @param abilities
|
||||||
|
* @return True if the passed in set of abilities is also in this set of abilities.
|
||||||
|
*/
|
||||||
public boolean containsAll(Abilities<T> abilities);
|
public boolean containsAll(Abilities<T> abilities);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Copies this set of abilities. This copy should be new instances of all
|
||||||
|
* the contained abilities.
|
||||||
|
*
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
public Abilities<T> copy();
|
public Abilities<T> copy();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue