mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Merge pull request #15 from magefree/master
Merge https://github.com/magefree/mage
This commit is contained in:
commit
07f1b605d9
7 changed files with 280 additions and 0 deletions
55
Mage.Server.Plugins/Mage.Game.MomirGame/pom.xml
Normal file
55
Mage.Server.Plugins/Mage.Game.MomirGame/pom.xml
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-4.0.0.xsd">
|
||||||
|
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.mage</groupId>
|
||||||
|
<artifactId>mage-server-plugins</artifactId>
|
||||||
|
<version>1.4.26</version>
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<artifactId>mage-game-momirfreeforall</artifactId>
|
||||||
|
<packaging>jar</packaging>
|
||||||
|
<name>Mage Game Momir Basic Free for All</name>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>mage</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>mage-game-freeforall</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<sourceDirectory>src</sourceDirectory>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>1.7</source>
|
||||||
|
<target>1.7</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<encoding>UTF-8</encoding>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
|
||||||
|
</plugins>
|
||||||
|
|
||||||
|
<finalName>mage-game-momir</finalName>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<properties/>
|
||||||
|
|
||||||
|
</project>
|
|
@ -0,0 +1,55 @@
|
||||||
|
/*
|
||||||
|
* 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.game;
|
||||||
|
|
||||||
|
import mage.game.match.MatchImpl;
|
||||||
|
import mage.game.match.MatchOptions;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author nigelzor
|
||||||
|
*/
|
||||||
|
public class MomirFreeForAllMatch extends MatchImpl {
|
||||||
|
|
||||||
|
public MomirFreeForAllMatch(MatchOptions options) {
|
||||||
|
super(options);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void startGame() throws GameException {
|
||||||
|
// Momir Vig, Simic Visionary gives +4 starting life
|
||||||
|
int startLife = 24;
|
||||||
|
|
||||||
|
MomirGame game = new MomirGame(options.getAttackOption(), options.getRange(), options.getFreeMulligans(), startLife);
|
||||||
|
game.setStartMessage(this.createGameStartMessage());
|
||||||
|
|
||||||
|
this.initGame(game);
|
||||||
|
games.add(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,57 @@
|
||||||
|
/*
|
||||||
|
* 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.game;
|
||||||
|
|
||||||
|
import mage.game.match.MatchType;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author nigelzor
|
||||||
|
*/
|
||||||
|
public class MomirFreeForAllType extends MatchType {
|
||||||
|
|
||||||
|
public MomirFreeForAllType() {
|
||||||
|
this.name = "Momir Basic Free For All";
|
||||||
|
this.maxPlayers = 10;
|
||||||
|
this.minPlayers = 2;
|
||||||
|
this.numTeams = 0;
|
||||||
|
this.useAttackOption = true;
|
||||||
|
this.useRange = true;
|
||||||
|
this.sideboardingAllowed = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected MomirFreeForAllType(final MomirFreeForAllType matchType){
|
||||||
|
super(matchType);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MomirFreeForAllType copy() {
|
||||||
|
return new MomirFreeForAllType(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,105 @@
|
||||||
|
/*
|
||||||
|
* 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.game;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.effects.common.InfoEffect;
|
||||||
|
import mage.cards.repository.CardInfo;
|
||||||
|
import mage.cards.repository.CardRepository;
|
||||||
|
import mage.constants.MultiplayerAttackOption;
|
||||||
|
import mage.constants.PhaseStep;
|
||||||
|
import mage.constants.RangeOfInfluence;
|
||||||
|
import mage.constants.Zone;
|
||||||
|
import mage.game.command.emblems.MomirEmblem;
|
||||||
|
import mage.game.match.MatchType;
|
||||||
|
import mage.game.turn.TurnMod;
|
||||||
|
import mage.players.Player;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author nigelzor
|
||||||
|
*/
|
||||||
|
public class MomirGame extends FreeForAll {
|
||||||
|
|
||||||
|
private int numPlayers;
|
||||||
|
|
||||||
|
public MomirGame(MultiplayerAttackOption attackOption, RangeOfInfluence range, int freeMulligans, int startLife) {
|
||||||
|
super(attackOption, range, freeMulligans, startLife);
|
||||||
|
}
|
||||||
|
|
||||||
|
public MomirGame(final MomirGame game) {
|
||||||
|
super(game);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MatchType getGameType() {
|
||||||
|
return new MomirFreeForAllType();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getNumPlayers() {
|
||||||
|
return numPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void init(UUID choosingPlayerId) {
|
||||||
|
Ability ability = new SimpleStaticAbility(Zone.COMMAND, new InfoEffect("Vanguard effects"));
|
||||||
|
for (UUID playerId : state.getPlayerList(startingPlayerId)) {
|
||||||
|
Player player = getPlayer(playerId);
|
||||||
|
if (player != null) {
|
||||||
|
CardInfo cardInfo = CardRepository.instance.findCard("Momir Vig, Simic Visionary");
|
||||||
|
addEmblem(new MomirEmblem(), cardInfo.getCard(), playerId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
getState().addAbility(ability, null);
|
||||||
|
super.init(choosingPlayerId);
|
||||||
|
state.getTurnMods().add(new TurnMod(startingPlayerId, PhaseStep.DRAW));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Set<UUID> getOpponents(UUID playerId) {
|
||||||
|
Set<UUID> opponents = new HashSet<>();
|
||||||
|
for (UUID opponentId : this.getPlayer(playerId).getInRange()) {
|
||||||
|
if (!opponentId.equals(playerId)) {
|
||||||
|
opponents.add(opponentId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return opponents;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MomirGame copy() {
|
||||||
|
return new MomirGame(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -21,6 +21,7 @@
|
||||||
<module>Mage.Game.CommanderFreeForAll</module>
|
<module>Mage.Game.CommanderFreeForAll</module>
|
||||||
<module>Mage.Game.FreeForAll</module>
|
<module>Mage.Game.FreeForAll</module>
|
||||||
<module>Mage.Game.MomirDuel</module>
|
<module>Mage.Game.MomirDuel</module>
|
||||||
|
<module>Mage.Game.MomirGame</module>
|
||||||
<module>Mage.Game.TinyLeadersDuel</module>
|
<module>Mage.Game.TinyLeadersDuel</module>
|
||||||
<module>Mage.Game.CanadianHighlanderDuel</module>
|
<module>Mage.Game.CanadianHighlanderDuel</module>
|
||||||
<module>Mage.Game.PennyDreadfulCommanderFreeForAll</module>
|
<module>Mage.Game.PennyDreadfulCommanderFreeForAll</module>
|
||||||
|
|
|
@ -77,6 +77,7 @@
|
||||||
<gameType name="Canadian Highlander Two Player Duel" jar="mage-game-canadianhighlanderduel.jar" className="mage.game.CanadianHighlanderDuelMatch" typeName="mage.game.CanadianHighlanderDuelType"/>
|
<gameType name="Canadian Highlander Two Player Duel" jar="mage-game-canadianhighlanderduel.jar" className="mage.game.CanadianHighlanderDuelMatch" typeName="mage.game.CanadianHighlanderDuelType"/>
|
||||||
<gameType name="Penny Dreadful Commander Free For All" jar="mage-game-pennydreadfulcommanderfreeforall.jar" className="mage.game.PennyDreadfulCommanderFreeForAllMatch" typeName="mage.game.PennyDreadfulCommanderFreeForAllType"/>
|
<gameType name="Penny Dreadful Commander Free For All" jar="mage-game-pennydreadfulcommanderfreeforall.jar" className="mage.game.PennyDreadfulCommanderFreeForAllMatch" typeName="mage.game.PennyDreadfulCommanderFreeForAllType"/>
|
||||||
<gameType name="Momir Basic Two Player Duel" jar="mage-game-momirduel.jar" className="mage.game.MomirDuelMatch" typeName="mage.game.MomirDuelType"/>
|
<gameType name="Momir Basic Two Player Duel" jar="mage-game-momirduel.jar" className="mage.game.MomirDuelMatch" typeName="mage.game.MomirDuelType"/>
|
||||||
|
<gameType name="Momir Basic Free For All" jar="mage-game-momir.jar" className="mage.game.MomirFreeForAllMatch" typeName="mage.game.MomirFreeForAllType"/>
|
||||||
</gameTypes>
|
</gameTypes>
|
||||||
<tournamentTypes>
|
<tournamentTypes>
|
||||||
<tournamentType name="Constructed Elimination" jar="mage-tournament-constructed.jar" className="mage.tournament.ConstructedEliminationTournament" typeName="mage.tournament.ConstructedEliminationTournamentType"/>
|
<tournamentType name="Constructed Elimination" jar="mage-tournament-constructed.jar" className="mage.tournament.ConstructedEliminationTournament" typeName="mage.tournament.ConstructedEliminationTournamentType"/>
|
||||||
|
|
|
@ -160,6 +160,12 @@
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>${project.groupId}</groupId>
|
||||||
|
<artifactId>mage-game-momirfreeforall</artifactId>
|
||||||
|
<version>${project.version}</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.shiro</groupId>
|
<groupId>org.apache.shiro</groupId>
|
||||||
<artifactId>shiro-core</artifactId>
|
<artifactId>shiro-core</artifactId>
|
||||||
|
|
Loading…
Reference in a new issue