mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 13:19:18 -08:00
[DSK] Implement Zimone, All-Questioning
This commit is contained in:
parent
f3624e9ca3
commit
64774b457f
4 changed files with 165 additions and 0 deletions
|
|
@ -0,0 +1,31 @@
|
|||
package mage.game.permanent.token;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class PrimoTheIndivisibleToken extends TokenImpl {
|
||||
|
||||
public PrimoTheIndivisibleToken() {
|
||||
super("Primo, the Indivisible", "Primo, the Indivisible, a legendary 0/0 green and blue Fractal creature token");
|
||||
supertype.add(SuperType.LEGENDARY);
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add(SubType.FRACTAL);
|
||||
color.setGreen(true);
|
||||
color.setBlue(true);
|
||||
power = new MageInt(0);
|
||||
toughness = new MageInt(0);
|
||||
}
|
||||
|
||||
private PrimoTheIndivisibleToken(final PrimoTheIndivisibleToken token) {
|
||||
super(token);
|
||||
}
|
||||
|
||||
public PrimoTheIndivisibleToken copy() {
|
||||
return new PrimoTheIndivisibleToken(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -716,6 +716,30 @@ public final class CardUtil {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if a given integer is prime
|
||||
*
|
||||
* @param number
|
||||
* @return
|
||||
*/
|
||||
public static boolean isPrime(int number) {
|
||||
// if it's 1 or less it's not prime
|
||||
if (number < 2) {
|
||||
return false;
|
||||
}
|
||||
// easy to check 2 and 3 first
|
||||
if (number == 2 || number == 3) {
|
||||
return true;
|
||||
}
|
||||
// sieve of eratosthenes, only need to check up to sqrt(x) to find a divisor
|
||||
for (int i = 2; i * i <= number; i++) {
|
||||
if (number % i == 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public static String createObjectRealtedWindowTitle(Ability source, Game game, String textSuffix) {
|
||||
String title;
|
||||
if (source != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue