mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
- define user/program/cache directories in NewConstants - use directories where applicable - merge lang and properties into constants - create separate image lists for sealed products - update howto document - allow alternate file extensions for images - a whole bunch of code cleanup
103 lines
2.9 KiB
Java
103 lines
2.9 KiB
Java
/*
|
|
* Forge: Play Magic: the Gathering.
|
|
* Copyright (C) 2011 Forge Team
|
|
*
|
|
* This program is free software: you can redistribute it and/or modify
|
|
* it under the terms of the GNU General Public License as published by
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
* (at your option) any later version.
|
|
*
|
|
* This program is distributed in the hope that it will be useful,
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* GNU General Public License for more details.
|
|
*
|
|
* You should have received a copy of the GNU General Public License
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
package forge.card.trigger;
|
|
|
|
import java.util.Map;
|
|
|
|
import forge.Card;
|
|
import forge.card.spellability.SpellAbility;
|
|
|
|
/**
|
|
* <p>
|
|
* Trigger_LandPlayed class.
|
|
* </p>
|
|
*
|
|
* @author Forge
|
|
* @version $Id$
|
|
*/
|
|
public class TriggerLandPlayed extends Trigger {
|
|
|
|
/**
|
|
* <p>
|
|
* Constructor for Trigger_LandPlayed.
|
|
* </p>
|
|
*
|
|
* @param n
|
|
* a {@link java.lang.String} object.
|
|
* @param params
|
|
* a {@link java.util.HashMap} object.
|
|
* @param host
|
|
* a {@link forge.Card} object.
|
|
* @param intrinsic
|
|
* the intrinsic
|
|
*/
|
|
public TriggerLandPlayed(final String n, final java.util.Map<String, String> params, final Card host,
|
|
final boolean intrinsic) {
|
|
super(n, params, host, intrinsic);
|
|
}
|
|
|
|
/**
|
|
* <p>
|
|
* Constructor for Trigger_LandPlayed.
|
|
* </p>
|
|
*
|
|
* @param params
|
|
* a {@link java.util.HashMap} object.
|
|
* @param host
|
|
* a {@link forge.Card} object.
|
|
* @param intrinsic
|
|
* the intrinsic
|
|
*/
|
|
public TriggerLandPlayed(final Map<String, String> params, final Card host, final boolean intrinsic) {
|
|
super(params, host, intrinsic);
|
|
}
|
|
|
|
/** {@inheritDoc} */
|
|
@Override
|
|
public final Trigger getCopy() {
|
|
final Trigger copy = new TriggerLandPlayed(this.getName(), this.getMapParams(), this.getHostCard(),
|
|
this.isIntrinsic());
|
|
|
|
if (this.getOverridingAbility() != null) {
|
|
copy.setOverridingAbility(this.getOverridingAbility());
|
|
}
|
|
|
|
copyFieldsTo(copy);
|
|
return copy;
|
|
}
|
|
|
|
/** {@inheritDoc} */
|
|
@Override
|
|
public final void setTriggeringObjects(final SpellAbility sa) {
|
|
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
|
|
}
|
|
|
|
/** {@inheritDoc} */
|
|
@Override
|
|
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
|
if (this.getMapParams().containsKey("ValidCard")) {
|
|
if (!matchesValid(runParams2.get("Card"), this.getMapParams().get("ValidCard").split(","),
|
|
this.getHostCard())) {
|
|
return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
|
|
}
|