mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
simplify room constructor/generation
This commit is contained in:
parent
7d2e95cddd
commit
83ab56c8a4
15 changed files with 58 additions and 71 deletions
|
|
@ -22,19 +22,17 @@ import java.util.UUID;
|
|||
public abstract class RoomCard extends SplitCard {
|
||||
private SpellAbilityType lastCastHalf = null;
|
||||
|
||||
protected RoomCard(UUID ownerId, CardSetInfo setInfo, CardType[] types, String costsLeft, String costsRight) {
|
||||
super(ownerId, setInfo, costsLeft, costsRight, SpellAbilityType.SPLIT, types);
|
||||
protected RoomCard(UUID ownerId, CardSetInfo setInfo, String costsLeft, String costsRight) {
|
||||
super(ownerId, setInfo, costsLeft, costsRight, SpellAbilityType.SPLIT, new CardType[]{CardType.ENCHANTMENT});
|
||||
|
||||
String[] names = setInfo.getName().split(" // ");
|
||||
|
||||
leftHalfCard = new RoomCardHalfImpl(
|
||||
this.getOwnerId(), new CardSetInfo(names[0], setInfo.getExpansionSetCode(), setInfo.getCardNumber(),
|
||||
setInfo.getRarity(), setInfo.getGraphicInfo()),
|
||||
types, costsLeft, this, SpellAbilityType.SPLIT_LEFT);
|
||||
new CardSetInfo(names[0], setInfo), costsLeft, this, SpellAbilityType.SPLIT_LEFT
|
||||
);
|
||||
rightHalfCard = new RoomCardHalfImpl(
|
||||
this.getOwnerId(), new CardSetInfo(names[1], setInfo.getExpansionSetCode(), setInfo.getCardNumber(),
|
||||
setInfo.getRarity(), setInfo.getGraphicInfo()),
|
||||
types, costsRight, this, SpellAbilityType.SPLIT_RIGHT);
|
||||
new CardSetInfo(names[1], setInfo), costsRight, this, SpellAbilityType.SPLIT_RIGHT
|
||||
);
|
||||
|
||||
// Add the one-shot effect to unlock a door on cast -> ETB
|
||||
Ability entersAbility = new EntersBattlefieldAbility(new RoomEnterUnlockEffect());
|
||||
|
|
|
|||
|
|
@ -14,9 +14,8 @@ import java.util.UUID;
|
|||
*/
|
||||
public class RoomCardHalfImpl extends SplitCardHalfImpl implements RoomCardHalf {
|
||||
|
||||
public RoomCardHalfImpl(UUID ownerId, CardSetInfo setInfo, CardType[] cardTypes, String costs,
|
||||
RoomCard splitCardParent, SpellAbilityType spellAbilityType) {
|
||||
super(ownerId, setInfo, cardTypes, costs, splitCardParent, spellAbilityType);
|
||||
public RoomCardHalfImpl(CardSetInfo setInfo, String costs, RoomCard splitCardParent, SpellAbilityType spellAbilityType) {
|
||||
super(splitCardParent.ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, costs, splitCardParent, spellAbilityType);
|
||||
this.addSubType(SubType.ROOM);
|
||||
}
|
||||
|
||||
|
|
@ -65,4 +64,4 @@ public class RoomCardHalfImpl extends SplitCardHalfImpl implements RoomCardHalf
|
|||
}
|
||||
super.setZone(zone, game);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue