mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
* Tribute to Hunger - Fixed that the sacrifice was wrongly handled targeted.
This commit is contained in:
parent
f3154fab54
commit
e3dc5399c9
2 changed files with 63 additions and 66 deletions
|
|
@ -1,31 +1,30 @@
|
|||
/*
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
|
||||
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without modification, are
|
||||
* permitted provided that the following conditions are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||
* conditions and the following disclaimer.
|
||||
*
|
||||
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||
* provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
* The views and conclusions contained in the software and documentation are those of the
|
||||
* authors and should not be interpreted as representing official policies, either expressed
|
||||
* or implied, of BetaSteward_at_googlemail.com.
|
||||
*/
|
||||
package mage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
|
@ -89,19 +88,19 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
|
||||
@Override
|
||||
public UUID getId() {
|
||||
return objectId;
|
||||
return objectId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getIdName() {
|
||||
return getName() + " ["+getId().toString().substring(0,3) +"]";
|
||||
return getName() + " [" + getId().toString().substring(0, 3) + "]";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getLogName() {
|
||||
return GameLog.getColoredObjectIdName(this);
|
||||
|
|
@ -123,17 +122,17 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSubtype(){
|
||||
public List<String> getSubtype() {
|
||||
return subtype;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> getSupertype(){
|
||||
public List<String> getSupertype() {
|
||||
return supertype;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Abilities<Ability> getAbilities(){
|
||||
public Abilities<Ability> getAbilities() {
|
||||
return abilities;
|
||||
}
|
||||
|
||||
|
|
@ -143,7 +142,7 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
return true;
|
||||
}
|
||||
Abilities<Ability> otherAbilities = game.getState().getAllOtherAbilities(getId());
|
||||
return otherAbilities != null && otherAbilities.containsKey(abilityId);
|
||||
return otherAbilities != null && otherAbilities.containsKey(abilityId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -167,13 +166,16 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
}
|
||||
|
||||
@Override
|
||||
public void adjustChoices(Ability ability, Game game) {}
|
||||
|
||||
@Override
|
||||
public void adjustCosts(Ability ability, Game game) {}
|
||||
public void adjustChoices(Ability ability, Game game) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {}
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean hasSubtype(String value) {
|
||||
|
|
@ -182,14 +184,15 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
}
|
||||
if (this.subtype.contains(value)) {
|
||||
return true;
|
||||
} else { // checking for Changeling
|
||||
// first make sure input parameter is a creature type
|
||||
// if so, then ChangelingAbility doesn't matter
|
||||
} else {
|
||||
// checking for Changeling
|
||||
// first make sure input parameter is a creature subtype
|
||||
// if not, then ChangelingAbility doesn't matter
|
||||
if (CardUtil.isNonCreatureSubtype(value)) {
|
||||
return false;
|
||||
}
|
||||
// as it is creature subtype, then check the existence of Changeling
|
||||
return abilities.contains(ChangelingAbility.getInstance()) || this.subtype.contains(ChangelingAbility.ALL_CREATURE_TYPE);
|
||||
return abilities.contains(ChangelingAbility.getInstance()) || this.subtype.contains(ChangelingAbility.ALL_CREATURE_TYPE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +205,7 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
public boolean isCopy() {
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getZoneChangeCounter(Game game) {
|
||||
return game.getState().getZoneChangeCounter(objectId);
|
||||
|
|
@ -217,5 +220,5 @@ public abstract class MageObjectImpl implements MageObject {
|
|||
public void setZoneChangeCounter(int value, Game game) {
|
||||
game.getState().setZoneChangeCounter(objectId, value);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue