mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
TriggerType: rename Unequip to Unattach
This commit is contained in:
@@ -85,7 +85,7 @@ public enum TriggerType {
|
|||||||
Transformed(TriggerTransformed.class),
|
Transformed(TriggerTransformed.class),
|
||||||
TurnBegin(TriggerTurnBegin.class),
|
TurnBegin(TriggerTurnBegin.class),
|
||||||
TurnFaceUp(TriggerTurnFaceUp.class),
|
TurnFaceUp(TriggerTurnFaceUp.class),
|
||||||
Unequip(TriggerUnequip.class),
|
Unattach(TriggerUnattach.class),
|
||||||
Untaps(TriggerUntaps.class),
|
Untaps(TriggerUntaps.class),
|
||||||
Vote(TriggerVote.class);
|
Vote(TriggerVote.class);
|
||||||
|
|
||||||
|
|||||||
@@ -17,18 +17,18 @@
|
|||||||
*/
|
*/
|
||||||
package forge.game.trigger;
|
package forge.game.trigger;
|
||||||
|
|
||||||
|
import forge.game.GameEntity;
|
||||||
import forge.game.card.Card;
|
import forge.game.card.Card;
|
||||||
import forge.game.spellability.SpellAbility;
|
import forge.game.spellability.SpellAbility;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* Trigger_Unequip class.
|
* Trigger_Unattach class.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Forge
|
* @author Forge
|
||||||
* @version $Id$
|
|
||||||
*/
|
*/
|
||||||
public class TriggerUnequip extends Trigger {
|
public class TriggerUnattach extends Trigger {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
@@ -42,26 +42,26 @@ public class TriggerUnequip extends Trigger {
|
|||||||
* @param intrinsic
|
* @param intrinsic
|
||||||
* the intrinsic
|
* the intrinsic
|
||||||
*/
|
*/
|
||||||
public TriggerUnequip(final java.util.Map<String, String> params, final Card host, final boolean intrinsic) {
|
public TriggerUnattach(final java.util.Map<String, String> params, final Card host, final boolean intrinsic) {
|
||||||
super(params, host, intrinsic);
|
super(params, host, intrinsic);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
public final boolean performTest(final java.util.Map<String, Object> runParams2) {
|
||||||
final Card equipped = (Card) runParams2.get("Card");
|
final GameEntity object = (GameEntity) runParams2.get("Object");
|
||||||
final Card equipment = (Card) runParams2.get("Equipment");
|
final Card attach = (Card) runParams2.get("Attach");
|
||||||
|
|
||||||
if (this.mapParams.containsKey("ValidCard")) {
|
if (hasParam("ValidObject")) {
|
||||||
if (!equipped.isValid(this.mapParams.get("ValidCard").split(","), this.getHostCard().getController(),
|
if (!object.isValid(getParam("ValidObject").split(","), getHostCard().getController(),
|
||||||
this.getHostCard(), null)) {
|
getHostCard(), null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.mapParams.containsKey("ValidEquipment")) {
|
if (hasParam("ValidAttachment")) {
|
||||||
if (!equipment.isValid(this.mapParams.get("ValidEquipment").split(","), this.getHostCard()
|
if (!attach.isValid(getParam("ValidAttachment").split(","), getHostCard()
|
||||||
.getController(), this.getHostCard(), null)) {
|
.getController(), getHostCard(), null)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,15 +72,15 @@ public class TriggerUnequip extends Trigger {
|
|||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
@Override
|
@Override
|
||||||
public final void setTriggeringObjects(final SpellAbility sa) {
|
public final void setTriggeringObjects(final SpellAbility sa) {
|
||||||
sa.setTriggeringObject("Card", this.getRunParams().get("Card"));
|
sa.setTriggeringObject("Object", getRunParams().get("Object"));
|
||||||
sa.setTriggeringObject("Equipment", this.getRunParams().get("Equipment"));
|
sa.setTriggeringObject("Attach", getRunParams().get("Attach"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getImportantStackObjects(SpellAbility sa) {
|
public String getImportantStackObjects(SpellAbility sa) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Equippee: ").append(sa.getTriggeringObject("Card")).append(", ");
|
sb.append("Object: ").append(sa.getTriggeringObject("Object")).append(", ");
|
||||||
sb.append("Equipment: ").append(sa.getTriggeringObject("Equipment"));
|
sb.append("Attachment: ").append(sa.getTriggeringObject("Attach"));
|
||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user