Erwan
- fix issue 22 (Graveyard display messed up) - fix issue 38 (graveyard and library unusable) - fix issue 59 (can't cancel a spell with a target)
This commit is contained in:
@@ -35,17 +35,6 @@ text=Choose a color. White creatures you control gain protection from the chosen
|
|||||||
rarity=U
|
rarity=U
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
id=185697
|
|
||||||
name=Caravan Hurda
|
|
||||||
mana={4}{W}
|
|
||||||
type=Creature
|
|
||||||
subtype=Giant
|
|
||||||
power=1
|
|
||||||
toughness=5
|
|
||||||
text=Lifelink (Damage dealt by this creature also causes you to gain that much life.)
|
|
||||||
rarity=C
|
|
||||||
[/card]
|
|
||||||
[card]
|
|
||||||
id=198524
|
id=198524
|
||||||
name=Celestial Mantle
|
name=Celestial Mantle
|
||||||
mana={3}{W}{W}{W}
|
mana={3}{W}{W}{W}
|
||||||
@@ -100,7 +89,7 @@ type=Creature
|
|||||||
subtype=Angel
|
subtype=Angel
|
||||||
power=3
|
power=3
|
||||||
toughness=3
|
toughness=3
|
||||||
text=Flying Landfall — Whenever a land enters the battlefield under your control, you may put a 1/1 white Bird creature token with flying onto the battlefield.
|
text=Flying Landfall EWhenever a land enters the battlefield under your control, you may put a 1/1 white Bird creature token with flying onto the battlefield.
|
||||||
rarity=R
|
rarity=R
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -352,7 +341,7 @@ type=Creature
|
|||||||
subtype=Cat
|
subtype=Cat
|
||||||
power=0
|
power=0
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, Steppe Lynx gets +2/+2 until end of turn.
|
text=Landfall EWhenever a land enters the battlefield under your control, Steppe Lynx gets +2/+2 until end of turn.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -360,7 +349,7 @@ id=177551
|
|||||||
name=Sunspring Expedition
|
name=Sunspring Expedition
|
||||||
mana={W}
|
mana={W}
|
||||||
type=Enchantment
|
type=Enchantment
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Sunspring Expedition. Remove three quest counters from Sunspring Expedition and sacrifice it: You gain 8 life.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may put a quest counter on Sunspring Expedition. Remove three quest counters from Sunspring Expedition and sacrifice it: You gain 8 life.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -384,13 +373,13 @@ rarity=R
|
|||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
id=170993
|
id=170993
|
||||||
name=Æther Figment
|
name=ÁEher Figment
|
||||||
mana={1}{U}
|
mana={1}{U}
|
||||||
type=Creature
|
type=Creature
|
||||||
subtype=Illusion
|
subtype=Illusion
|
||||||
power=1
|
power=1
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Kicker {3} (You may pay an additional {3} as you cast this spell.) Æther Figment is unblockable. If Æther Figment was kicked, it enters the battlefield with two +1/+1 counters on it.
|
text=Kicker {3} (You may pay an additional {3} as you cast this spell.) ÁEher Figment is unblockable. If ÁEher Figment was kicked, it enters the battlefield with two +1/+1 counters on it.
|
||||||
rarity=U
|
rarity=U
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -459,7 +448,7 @@ type=Creature
|
|||||||
subtype=Crab
|
subtype=Crab
|
||||||
power=0
|
power=0
|
||||||
toughness=2
|
toughness=2
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, target player puts the top three cards of his or her library into his or her graveyard.
|
text=Landfall EWhenever a land enters the battlefield under your control, target player puts the top three cards of his or her library into his or her graveyard.
|
||||||
rarity=U
|
rarity=U
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -475,7 +464,7 @@ id=185711
|
|||||||
name=Ior Ruin Expedition
|
name=Ior Ruin Expedition
|
||||||
mana={1}{U}
|
mana={1}{U}
|
||||||
type=Enchantment
|
type=Enchantment
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Ior Ruin Expedition. Remove three quest counters from Ior Ruin Expedition and sacrifice it: Draw two cards.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may put a quest counter on Ior Ruin Expedition. Remove three quest counters from Ior Ruin Expedition and sacrifice it: Draw two cards.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -605,7 +594,7 @@ type=Creature
|
|||||||
subtype=Elemental
|
subtype=Elemental
|
||||||
power=3
|
power=3
|
||||||
toughness=2
|
toughness=2
|
||||||
text=Flying Landfall — Whenever a land enters the battlefield under your control, you may gain control of target creature for as long as you control Roil Elemental.
|
text=Flying Landfall EWhenever a land enters the battlefield under your control, you may gain control of target creature for as long as you control Roil Elemental.
|
||||||
rarity=R
|
rarity=R
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -638,7 +627,7 @@ type=Creature
|
|||||||
subtype=Serpent
|
subtype=Serpent
|
||||||
power=5
|
power=5
|
||||||
toughness=5
|
toughness=5
|
||||||
text=Defender Landfall — Whenever a land enters the battlefield under your control, Shoal Serpent loses defender until end of turn.
|
text=Defender Landfall EWhenever a land enters the battlefield under your control, Shoal Serpent loses defender until end of turn.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -765,7 +754,7 @@ type=Creature
|
|||||||
subtype=Fish
|
subtype=Fish
|
||||||
power=2
|
power=2
|
||||||
toughness=2
|
toughness=2
|
||||||
text=Flying Landfall — Whenever a land enters the battlefield under your control, Windrider Eel gets +2/+2 until end of turn.
|
text=Flying Landfall EWhenever a land enters the battlefield under your control, Windrider Eel gets +2/+2 until end of turn.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -814,7 +803,7 @@ type=Creature
|
|||||||
subtype=Vampire Spirit
|
subtype=Vampire Spirit
|
||||||
power=2
|
power=2
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Bloodghast can't block. Bloodghast has haste as long as an opponent has 10 or less life. Landfall — Whenever a land enters the battlefield under your control, you may return Bloodghast from your graveyard to the battlefield.
|
text=Bloodghast can't block. Bloodghast has haste as long as an opponent has 10 or less life. Landfall EWhenever a land enters the battlefield under your control, you may return Bloodghast from your graveyard to the battlefield.
|
||||||
rarity=R
|
rarity=R
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -890,7 +879,7 @@ id=180127
|
|||||||
name=Grim Discovery
|
name=Grim Discovery
|
||||||
mana={1}{B}
|
mana={1}{B}
|
||||||
type=Sorcery
|
type=Sorcery
|
||||||
text=Choose one or both — Return target creature card from your graveyard to your hand; and/or return target land card from your graveyard to your hand.
|
text=Choose one or both EReturn target creature card from your graveyard to your hand; and/or return target land card from your graveyard to your hand.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -923,7 +912,7 @@ type=Creature
|
|||||||
subtype=Crocodile
|
subtype=Crocodile
|
||||||
power=3
|
power=3
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Hagra Crocodile can't block. Landfall — Whenever a land enters the battlefield under your control, Hagra Crocodile gets +2/+2 until end of turn.
|
text=Hagra Crocodile can't block. Landfall EWhenever a land enters the battlefield under your control, Hagra Crocodile gets +2/+2 until end of turn.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1053,7 +1042,7 @@ type=Legendary Creature
|
|||||||
subtype=Demon
|
subtype=Demon
|
||||||
power=3
|
power=3
|
||||||
toughness=3
|
toughness=3
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may have target player lose 3 life. If you do, put three +1/+1 counters on Ob Nixilis, the Fallen.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may have target player lose 3 life. If you do, put three +1/+1 counters on Ob Nixilis, the Fallen.
|
||||||
rarity=M
|
rarity=M
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1095,7 +1084,7 @@ id=177586
|
|||||||
name=Soul Stair Expedition
|
name=Soul Stair Expedition
|
||||||
mana={B}
|
mana={B}
|
||||||
type=Enchantment
|
type=Enchantment
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Soul Stair Expedition. Remove three quest counters from Soul Stair Expedition and sacrifice it: Return up to two target creature cards from your graveyard to your hand.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may put a quest counter on Soul Stair Expedition. Remove three quest counters from Soul Stair Expedition and sacrifice it: Return up to two target creature cards from your graveyard to your hand.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1106,7 +1095,7 @@ type=Creature
|
|||||||
subtype=Surrakar
|
subtype=Surrakar
|
||||||
power=2
|
power=2
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, Surrakar Marauder gains intimidate until end of turn. (It can't be blocked except by artifact creatures and/or creatures that share a color with it.)
|
text=Landfall EWhenever a land enters the battlefield under your control, Surrakar Marauder gains intimidate until end of turn. (It can't be blocked except by artifact creatures and/or creatures that share a color with it.)
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1210,7 +1199,7 @@ type=Creature
|
|||||||
subtype=Elemental Beast
|
subtype=Elemental Beast
|
||||||
power=4
|
power=4
|
||||||
toughness=4
|
toughness=4
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, Geyser Glider gains flying until end of turn.
|
text=Landfall EWhenever a land enters the battlefield under your control, Geyser Glider gains flying until end of turn.
|
||||||
rarity=U
|
rarity=U
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1385,7 +1374,7 @@ type=Creature
|
|||||||
subtype=Insect
|
subtype=Insect
|
||||||
power=1
|
power=1
|
||||||
toughness=1
|
toughness=1
|
||||||
text=First strike Landfall — Whenever a land enters the battlefield under your control, Plated Geopede gets +2/+2 until end of turn.
|
text=First strike Landfall EWhenever a land enters the battlefield under your control, Plated Geopede gets +2/+2 until end of turn.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1512,7 +1501,7 @@ id=183403
|
|||||||
name=Zektar Shrine Expedition
|
name=Zektar Shrine Expedition
|
||||||
mana={1}{R}
|
mana={1}{R}
|
||||||
type=Enchantment
|
type=Enchantment
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Zektar Shrine Expedition. Remove three quest counters from Zektar Shrine Expedition and sacrifice it: Put a 7/1 red Elemental creature token with trample and haste onto the battlefield. Exile it at the beginning of the next end step.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may put a quest counter on Zektar Shrine Expedition. Remove three quest counters from Zektar Shrine Expedition and sacrifice it: Put a 7/1 red Elemental creature token with trample and haste onto the battlefield. Exile it at the beginning of the next end step.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1532,7 +1521,7 @@ type=Creature
|
|||||||
subtype=Beast
|
subtype=Beast
|
||||||
power=4
|
power=4
|
||||||
toughness=4
|
toughness=4
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, Baloth Woodcrasher gets +4/+4 and gains trample until end of turn.
|
text=Landfall EWhenever a land enters the battlefield under your control, Baloth Woodcrasher gets +4/+4 and gains trample until end of turn.
|
||||||
rarity=U
|
rarity=U
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1588,7 +1577,7 @@ type=Creature
|
|||||||
subtype=Antelope
|
subtype=Antelope
|
||||||
power=2
|
power=2
|
||||||
toughness=2
|
toughness=2
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may gain 2 life.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may gain 2 life.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1626,7 +1615,7 @@ id=186320
|
|||||||
name=Khalni Heart Expedition
|
name=Khalni Heart Expedition
|
||||||
mana={1}{G}
|
mana={1}{G}
|
||||||
type=Enchantment
|
type=Enchantment
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may put a quest counter on Khalni Heart Expedition. Remove three quest counters from Khalni Heart Expedition and sacrifice it: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may put a quest counter on Khalni Heart Expedition. Remove three quest counters from Khalni Heart Expedition and sacrifice it: Search your library for up to two basic land cards, put them onto the battlefield tapped, then shuffle your library.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1637,7 +1626,7 @@ type=Creature
|
|||||||
subtype=Snake
|
subtype=Snake
|
||||||
power=2
|
power=2
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, you may add one mana of any color to your mana pool.
|
text=Landfall EWhenever a land enters the battlefield under your control, you may add one mana of any color to your mana pool.
|
||||||
rarity=M
|
rarity=M
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1737,7 +1726,7 @@ type=Creature
|
|||||||
subtype=Beast
|
subtype=Beast
|
||||||
power=6
|
power=6
|
||||||
toughness=6
|
toughness=6
|
||||||
text=Trample Landfall — Whenever a land enters the battlefield under your control, you may put a 4/4 green Beast creature token onto the battlefield.
|
text=Trample Landfall EWhenever a land enters the battlefield under your control, you may put a 4/4 green Beast creature token onto the battlefield.
|
||||||
rarity=M
|
rarity=M
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1837,7 +1826,7 @@ type=Creature
|
|||||||
subtype=Beast
|
subtype=Beast
|
||||||
power=4
|
power=4
|
||||||
toughness=4
|
toughness=4
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, Territorial Baloth gets +2/+2 until end of turn.
|
text=Landfall EWhenever a land enters the battlefield under your control, Territorial Baloth gets +2/+2 until end of turn.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1859,7 +1848,7 @@ type=Creature
|
|||||||
subtype=Basilisk
|
subtype=Basilisk
|
||||||
power=2
|
power=2
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Deathtouch (Creatures dealt damage by this creature are destroyed. You can divide this creature's combat damage among any of the creatures blocking or blocked by it.) Landfall — Whenever a land enters the battlefield under your control, you may have target creature block Turntimber Basilisk this turn if able.
|
text=Deathtouch (Creatures dealt damage by this creature are destroyed. You can divide this creature's combat damage among any of the creatures blocking or blocked by it.) Landfall EWhenever a land enters the battlefield under your control, you may have target creature block Turntimber Basilisk this turn if able.
|
||||||
rarity=U
|
rarity=U
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1908,7 +1897,7 @@ name=Adventuring Gear
|
|||||||
mana={1}
|
mana={1}
|
||||||
type=Artifact
|
type=Artifact
|
||||||
subtype=Equipment
|
subtype=Equipment
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, equipped creature gets +2/+2 until end of turn. Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
text=Landfall EWhenever a land enters the battlefield under your control, equipped creature gets +2/+2 until end of turn. Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1950,7 +1939,7 @@ id=189006
|
|||||||
name=Eternity Vessel
|
name=Eternity Vessel
|
||||||
mana={6}
|
mana={6}
|
||||||
type=Artifact
|
type=Artifact
|
||||||
text=Eternity Vessel enters the battlefield with X charge counters on it, where X is your life total. Landfall — Whenever a land enters the battlefield under your control, you may have your life total become the number of charge counters on Eternity Vessel.
|
text=Eternity Vessel enters the battlefield with X charge counters on it, where X is your life total. Landfall EWhenever a land enters the battlefield under your control, you may have your life total become the number of charge counters on Eternity Vessel.
|
||||||
rarity=M
|
rarity=M
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
@@ -1987,7 +1976,7 @@ type=Artifact Creature
|
|||||||
subtype=Construct
|
subtype=Construct
|
||||||
power=1
|
power=1
|
||||||
toughness=1
|
toughness=1
|
||||||
text=Landfall — Whenever a land enters the battlefield under your control, Hedron Scrabbler gets +1/+1 until end of turn.
|
text=Landfall EWhenever a land enters the battlefield under your control, Hedron Scrabbler gets +1/+1 until end of turn.
|
||||||
rarity=C
|
rarity=C
|
||||||
[/card]
|
[/card]
|
||||||
[card]
|
[card]
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#Bug:graveyard access
|
||||||
|
[INIT]
|
||||||
|
FIRSTMAIN
|
||||||
|
[PLAYER1]
|
||||||
|
library:plains,mountain,grizzly bears,swamp,island,forest,raging goblin,royal assassin,fireball
|
||||||
|
hand:demonic tutor,diabolic tutor
|
||||||
|
manapool:{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}{B}
|
||||||
|
[PLAYER2]
|
||||||
|
[DO]
|
||||||
|
human
|
||||||
|
human
|
||||||
|
[ASSERT]
|
||||||
|
COMBATEND
|
||||||
|
[PLAYER1]
|
||||||
|
inplay:Wildslayer Elves,Armadillo Cloak
|
||||||
|
life:25
|
||||||
|
[PLAYER2]
|
||||||
|
graveyard:grizzly bears
|
||||||
|
life:17
|
||||||
|
[END]
|
||||||
@@ -12,6 +12,7 @@ class CardDisplay:public PlayGuiObjectController{
|
|||||||
GameObserver* game;
|
GameObserver* game;
|
||||||
public:
|
public:
|
||||||
int x, y , start_item, nb_displayed_items;
|
int x, y , start_item, nb_displayed_items;
|
||||||
|
MTGGameZone * zone;
|
||||||
TargetChooser * tc;
|
TargetChooser * tc;
|
||||||
JGuiListener * listener;
|
JGuiListener * listener;
|
||||||
CardDisplay();
|
CardDisplay();
|
||||||
@@ -20,6 +21,7 @@ class CardDisplay:public PlayGuiObjectController{
|
|||||||
void rotateLeft();
|
void rotateLeft();
|
||||||
void rotateRight();
|
void rotateRight();
|
||||||
bool CheckUserInput(u32 key);
|
bool CheckUserInput(u32 key);
|
||||||
|
virtual void Update(float dt);
|
||||||
void Render();
|
void Render();
|
||||||
void init(MTGGameZone * zone);
|
void init(MTGGameZone * zone);
|
||||||
virtual ostream& toString(ostream& out) const;
|
virtual ostream& toString(ostream& out) const;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ class DamageResolverLayer;
|
|||||||
class GuiHandSelf;
|
class GuiHandSelf;
|
||||||
class GuiHandOpponent;
|
class GuiHandOpponent;
|
||||||
class GuiCombat;
|
class GuiCombat;
|
||||||
|
class GuiAvatars;
|
||||||
struct Pos;
|
struct Pos;
|
||||||
|
|
||||||
class DuelLayers {
|
class DuelLayers {
|
||||||
@@ -23,6 +24,7 @@ class DuelLayers {
|
|||||||
ActionLayer* action;
|
ActionLayer* action;
|
||||||
ActionStack* stack;
|
ActionStack* stack;
|
||||||
GuiHandSelf *hand;
|
GuiHandSelf *hand;
|
||||||
|
GuiAvatars * avatars;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DuelLayers();
|
DuelLayers();
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ class GuiAvatars : public GuiLayer
|
|||||||
void Deactivate(PlayGuiObject* c);
|
void Deactivate(PlayGuiObject* c);
|
||||||
int receiveEventPlus(WEvent*);
|
int receiveEventPlus(WEvent*);
|
||||||
int receiveEventMinus(WEvent*);
|
int receiveEventMinus(WEvent*);
|
||||||
|
bool CheckUserInput(u32 key);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // _GUIAVATARS_H_
|
#endif // _GUIAVATARS_H_
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ struct GuiGameZone : public GuiStatic{
|
|||||||
CardDisplay * cd;
|
CardDisplay * cd;
|
||||||
int showCards;
|
int showCards;
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
|
virtual bool CheckUserInput(u32 key);
|
||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
GuiGameZone(float x, float y, bool hasFocus, MTGGameZone * zone, GuiAvatars* parent);
|
GuiGameZone(float x, float y, bool hasFocus, MTGGameZone * zone, GuiAvatars* parent);
|
||||||
~GuiGameZone();
|
~GuiGameZone();
|
||||||
|
|||||||
@@ -24,8 +24,9 @@ class PlayGuiObject: public JGuiObject, public JGuiListener, public Pos{
|
|||||||
float defaultHeight;
|
float defaultHeight;
|
||||||
bool mHasFocus;
|
bool mHasFocus;
|
||||||
int type;
|
int type;
|
||||||
virtual void Entering(){mHasFocus = true;};
|
virtual void Entering(){mHasFocus = true; zoom = 1.4;};
|
||||||
virtual bool Leaving(u32 key){mHasFocus = false;return true;};
|
virtual bool Leaving(u32 key){mHasFocus = false; zoom = 1.0; return true;};
|
||||||
|
virtual bool CheckUserInput(u32 key) {return false;};
|
||||||
virtual bool ButtonPressed(){return true;};
|
virtual bool ButtonPressed(){return true;};
|
||||||
virtual void Render();
|
virtual void Render();
|
||||||
virtual void Update(float dt);
|
virtual void Update(float dt);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ CardDisplay::CardDisplay() : mId(0), game(GameObserver::GetInstance()) {
|
|||||||
start_item = 0;
|
start_item = 0;
|
||||||
x= 0;
|
x= 0;
|
||||||
y= 0;
|
y= 0;
|
||||||
|
zone = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
CardDisplay::CardDisplay(int id, GameObserver* game, int _x, int _y, JGuiListener * _listener, TargetChooser * _tc, int _nb_displayed_items ) : mId(id), game(game), x(_x), y(_y) {
|
CardDisplay::CardDisplay(int id, GameObserver* game, int _x, int _y, JGuiListener * _listener, TargetChooser * _tc, int _nb_displayed_items ) : mId(id), game(game), x(_x), y(_y) {
|
||||||
@@ -18,21 +19,26 @@ CardDisplay::CardDisplay(int id, GameObserver* game, int _x, int _y, JGuiListene
|
|||||||
listener = _listener;
|
listener = _listener;
|
||||||
nb_displayed_items = _nb_displayed_items;
|
nb_displayed_items = _nb_displayed_items;
|
||||||
start_item = 0;
|
start_item = 0;
|
||||||
|
if (x + nb_displayed_items * 30 + 25 > SCREEN_WIDTH) x = SCREEN_WIDTH - (nb_displayed_items * 30 + 25);
|
||||||
|
if (y + 55 > SCREEN_HEIGHT) y = SCREEN_HEIGHT - 55;
|
||||||
|
zone = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CardDisplay::AddCard(MTGCardInstance * _card){
|
void CardDisplay::AddCard(MTGCardInstance * _card){
|
||||||
CardGui * card = NEW CardView(CardSelector::nullZone, _card, x + 5 + (mCount - start_item) * 30, y + 5);
|
CardGui * card = NEW CardView(CardSelector::nullZone, _card, x + 20 + (mCount - start_item) * 30, y + 25);
|
||||||
Add(card);
|
Add(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void CardDisplay::init(MTGGameZone * zone){
|
void CardDisplay::init(MTGGameZone * zone){
|
||||||
resetObjects();
|
resetObjects();
|
||||||
|
if (!zone) return;
|
||||||
start_item = 0;
|
start_item = 0;
|
||||||
for (int i= 0; i< zone->nb_cards; i++){
|
for (int i= 0; i< zone->nb_cards; i++){
|
||||||
AddCard(zone->cards[i]);
|
AddCard(zone->cards[i]);
|
||||||
}
|
}
|
||||||
|
if (mObjects[0]) mObjects[0]->Entering();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CardDisplay::rotateLeft(){
|
void CardDisplay::rotateLeft(){
|
||||||
@@ -54,6 +60,22 @@ void CardDisplay::rotateRight(){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void CardDisplay::Update(float dt){
|
||||||
|
bool update = false;
|
||||||
|
|
||||||
|
if (zone){
|
||||||
|
size_t size = zone->cards.size();
|
||||||
|
for (int i = start_item; i< start_item + nb_displayed_items && i < mCount; i++){
|
||||||
|
if (i > size - 1) {update = true; break;}
|
||||||
|
CardGui * cardg = (CardGui *)mObjects[i];
|
||||||
|
if (cardg->card != zone->cards[i]) update = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PlayGuiObjectController::Update(dt);
|
||||||
|
if (update) init(zone);
|
||||||
|
}
|
||||||
|
|
||||||
bool CardDisplay::CheckUserInput(u32 key){
|
bool CardDisplay::CheckUserInput(u32 key){
|
||||||
if (PSP_CTRL_CROSS == key)
|
if (PSP_CTRL_CROSS == key)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,8 +99,8 @@ void CardSelector::Pop()
|
|||||||
}
|
}
|
||||||
if (active != oldactive)
|
if (active != oldactive)
|
||||||
{
|
{
|
||||||
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; }
|
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; } //Is this needed, I think it is one in Leaving(0) ?
|
||||||
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; }
|
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; } //Is this needed, I think it is one in Entering() ?
|
||||||
if (oldactive) oldactive->Leaving(0);
|
if (oldactive) oldactive->Leaving(0);
|
||||||
if (active) active->Entering();
|
if (active) active->Entering();
|
||||||
}
|
}
|
||||||
@@ -123,6 +123,9 @@ bool CardSelector::CheckUserInput(u32 key)
|
|||||||
Target* oldactive = active;
|
Target* oldactive = active;
|
||||||
switch (key)
|
switch (key)
|
||||||
{
|
{
|
||||||
|
case PSP_CTRL_CROSS:
|
||||||
|
GameObserver::GetInstance()->cancelCurrentAction();
|
||||||
|
return true;
|
||||||
case PSP_CTRL_CIRCLE:
|
case PSP_CTRL_CIRCLE:
|
||||||
GameObserver::GetInstance()->ButtonPressed(active);
|
GameObserver::GetInstance()->ButtonPressed(active);
|
||||||
return true;
|
return true;
|
||||||
@@ -160,8 +163,8 @@ bool CardSelector::CheckUserInput(u32 key)
|
|||||||
}
|
}
|
||||||
if (active != oldactive)
|
if (active != oldactive)
|
||||||
{
|
{
|
||||||
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; }
|
{ CardView* c = dynamic_cast<CardView*>(oldactive); if (c) c->zoom = 1.0; } //Is this needed, I think it is one in Leaving(0) ?
|
||||||
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; }
|
{ CardView* c = dynamic_cast<CardView*>(active); if (c) c->zoom = 1.4; } //Is this needed, I think it is one in Entering() ?
|
||||||
if (oldactive) oldactive->Leaving(0);
|
if (oldactive) oldactive->Leaving(0);
|
||||||
if (active) active->Entering();
|
if (active) active->Entering();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ void DuelLayers::init(){
|
|||||||
Add(NEW GuiHandOpponent(cs, go->players[1]->game->hand));
|
Add(NEW GuiHandOpponent(cs, go->players[1]->game->hand));
|
||||||
Add(NEW GuiPlay(go, cs));
|
Add(NEW GuiPlay(go, cs));
|
||||||
|
|
||||||
Add(NEW GuiAvatars(cs));
|
Add(avatars = NEW GuiAvatars(cs));
|
||||||
Add(NEW GuiPhaseBar());
|
Add(NEW GuiPhaseBar());
|
||||||
Add(NEW GuiFrame());
|
Add(NEW GuiFrame());
|
||||||
Add(NEW GuiBackground());
|
Add(NEW GuiBackground());
|
||||||
@@ -53,6 +53,7 @@ void DuelLayers::CheckUserInput(int isAI){
|
|||||||
if (stack->CheckUserInput(key)) break;
|
if (stack->CheckUserInput(key)) break;
|
||||||
if (combat->CheckUserInput(key)) break;
|
if (combat->CheckUserInput(key)) break;
|
||||||
if (action->CheckUserInput(key)) break;
|
if (action->CheckUserInput(key)) break;
|
||||||
|
if (avatars->CheckUserInput(key)) break;
|
||||||
if (hand->CheckUserInput(key)) break;
|
if (hand->CheckUserInput(key)) break;
|
||||||
if (cs->CheckUserInput(key)) break;
|
if (cs->CheckUserInput(key)) break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,8 @@
|
|||||||
#include "../include/GameApp.h"
|
#include "../include/GameApp.h"
|
||||||
#include "../include/GuiAvatars.h"
|
#include "../include/GuiAvatars.h"
|
||||||
|
|
||||||
|
#define LIB_GRAVE_OFFSET 230
|
||||||
|
|
||||||
GuiAvatars::GuiAvatars(CardSelector* cs) : cs(cs), active(NULL)
|
GuiAvatars::GuiAvatars(CardSelector* cs) : cs(cs), active(NULL)
|
||||||
{
|
{
|
||||||
Add(self = NEW GuiAvatar (SCREEN_WIDTH, SCREEN_HEIGHT, false,
|
Add(self = NEW GuiAvatar (SCREEN_WIDTH, SCREEN_HEIGHT, false,
|
||||||
@@ -52,6 +54,15 @@ int GuiAvatars::receiveEventMinus(WEvent* e)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GuiAvatars::CheckUserInput(u32 key){
|
||||||
|
if (self->CheckUserInput(key)) return true;
|
||||||
|
if (opponent->CheckUserInput(key)) return true;
|
||||||
|
if (selfGraveyard->CheckUserInput(key)) return true;
|
||||||
|
if (opponentGraveyard->CheckUserInput(key)) return true;
|
||||||
|
if (selfLibrary->CheckUserInput(key)) return true;
|
||||||
|
if (opponentLibrary->CheckUserInput(key)) return true;
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void GuiAvatars::Update(float dt)
|
void GuiAvatars::Update(float dt)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -124,6 +124,11 @@ void GuiGameZone::ButtonPressed(int controllerId, int controlId){
|
|||||||
GameObserver::GetInstance()->ButtonPressed(this);
|
GameObserver::GetInstance()->ButtonPressed(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool GuiGameZone::CheckUserInput(u32 key){
|
||||||
|
if (showCards) return cd->CheckUserInput(key);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void GuiGameZone::Update(float dt){
|
void GuiGameZone::Update(float dt){
|
||||||
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
|
for (vector<CardView*>::iterator it = cards.begin(); it != cards.end(); ++it)
|
||||||
(*it)->Update(dt);
|
(*it)->Update(dt);
|
||||||
@@ -133,6 +138,7 @@ void GuiGameZone::Update(float dt){
|
|||||||
|
|
||||||
GuiGameZone::GuiGameZone(float x, float y, bool hasFocus, MTGGameZone* zone, GuiAvatars* parent): GuiStatic(GuiGameZone::Height, x, y, hasFocus, parent), zone(zone){
|
GuiGameZone::GuiGameZone(float x, float y, bool hasFocus, MTGGameZone* zone, GuiAvatars* parent): GuiStatic(GuiGameZone::Height, x, y, hasFocus, parent), zone(zone){
|
||||||
cd = NEW CardDisplay(0, GameObserver::GetInstance(), x, y, this);
|
cd = NEW CardDisplay(0, GameObserver::GetInstance(), x, y, this);
|
||||||
|
cd->zone = zone;
|
||||||
showCards = 0;
|
showCards = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -54,15 +54,12 @@ void MTGCardInstance::copy(MTGCardInstance * card){
|
|||||||
|
|
||||||
text = source->text;
|
text = source->text;
|
||||||
name = source->name;
|
name = source->name;
|
||||||
//strcpy(image_name, source->image_name);
|
|
||||||
|
|
||||||
//rarity = source->rarity;
|
|
||||||
power = source->power;
|
power = source->power;
|
||||||
toughness = source->toughness;
|
toughness = source->toughness;
|
||||||
life = toughness;
|
life = toughness;
|
||||||
lifeOrig = life;
|
lifeOrig = life;
|
||||||
//mtgid = source->mtgid;
|
|
||||||
//setId = source->setId;
|
|
||||||
magicText = source->magicText;
|
magicText = source->magicText;
|
||||||
spellTargetType = source->spellTargetType;
|
spellTargetType = source->spellTargetType;
|
||||||
alias = source->alias;
|
alias = source->alias;
|
||||||
|
|||||||
Reference in New Issue
Block a user