mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
[MKM] Implement No Witnesses
This commit is contained in:
parent
1a8dce83d0
commit
fe97d3d77b
4 changed files with 107 additions and 14 deletions
|
|
@ -10,6 +10,8 @@ import mage.game.events.GameEvent;
|
|||
import mage.game.permanent.token.ClueArtifactToken;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
|
@ -39,14 +41,21 @@ public class InvestigateEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
int value = this.amount.calculate(game, source, this);
|
||||
if (value < 1) {
|
||||
return false;
|
||||
if (value > 0) {
|
||||
doInvestigate(source.getControllerId(), value, game, source);
|
||||
return true;
|
||||
}
|
||||
new ClueArtifactToken().putOntoBattlefield(value, game, source, source.getControllerId());
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void doInvestigate(UUID playerId, int value, Game game, Ability source) {
|
||||
new ClueArtifactToken().putOntoBattlefield(value, game, source, playerId);
|
||||
for (int i = 0; i < value; i++) {
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.INVESTIGATED, source.getSourceId(), source, source.getControllerId()));
|
||||
game.fireEvent(GameEvent.getEvent(
|
||||
GameEvent.EventType.INVESTIGATED,
|
||||
source.getSourceId(), source, playerId
|
||||
));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ import mage.abilities.dynamicvalue.common.StaticValue;
|
|||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.ClueArtifactToken;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
|
|
@ -43,14 +41,11 @@ public class InvestigateTargetEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
int value = this.amount.calculate(game, source, this);
|
||||
if (value < 1) {
|
||||
return false;
|
||||
if (value > 0) {
|
||||
InvestigateEffect.doInvestigate(targetPlayer.getId(), value, game, source);
|
||||
return true;
|
||||
}
|
||||
new ClueArtifactToken().putOntoBattlefield(value, game, source, targetPlayer.getId());
|
||||
for (int i = 0; i < value; i++) {
|
||||
game.fireEvent(GameEvent.getEvent(GameEvent.EventType.INVESTIGATED, source.getSourceId(), source, targetPlayer.getId()));
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue