Merge branch 'master' into cmake

This commit is contained in:
xawotihs
2015-10-25 00:22:57 +02:00
60 changed files with 1588 additions and 694 deletions
+3 -3
View File
@@ -30,9 +30,7 @@ before_install:
export ANDROID="android-sdk-linux/tools/android" &&
if [ `uname -m` = x86_64 ]; then sudo apt-get install -qq --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch jq; fi &&
wget http://dl.google.com/android/ndk/android-ndk-r9-linux-x86_64.tar.bz2 -nv &&
wget http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz -nv &&
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
tar -zxf android-sdk_r24.3.4-linux.tgz;
wget http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz -nv;
fi
# Building for Qt here
- if [ "$BUILD_Qt" == "YES" ]; then
@@ -53,6 +51,8 @@ install:
tar -x --xz -f sdk.lzma;
fi
- if [ "$BUILD_ANDROID" == "YES" ]; then
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
tar -zxf android-sdk_r24.3.4-linux.tgz &&
$ANDROID list sdk --extended -a &&
echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-23.0.1,android-10 --no-ui --force --no-https;
fi
Binary file not shown.

Before

Width:  |  Height:  |  Size: 33 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 KiB

@@ -1,5 +1,16 @@
grade=borderline
[card]
name=Arrogant Wurm
abilities=trample,madness
autoexile=restriction{discarded} pay({2}{G}) name(pay 2G to cast) activate name(pay 2G to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
text=Trample -- Madness {2}{G} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={3}{G}{G}
type=Creature
subtype=Wurm
power=4
toughness=4
[/card]
[card]
name=Autumn Willow
abilities=opponentshroud,shroud
auto={G}:-shroud
@@ -24,6 +35,40 @@ power=2
toughness=2
[/card]
[card]
name=Basking Rootwalla
abilities=madness
autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
auto={1}{G}:2/2 limit:1
text={1}{G}: Basking Rootwalla gets +2/+2 until end of turn. Activate this ability only once each turn. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={G}
type=Creature
subtype=Lizard
power=1
toughness=1
[/card]
[card]
name=Big Game Hunter
abilities=madness
autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
auto=bury target(creature[power>=4])
text=When Big Game Hunter enters the battlefield, destroy target creature with power 4 or greater. It can't be regenerated. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{B}{B}
type=Creature
subtype=Human Rebel Assassin
power=1
toughness=1
[/card]
[card]
name=Call to the Netherworld
abilities=madness
autoexile=restriction{discarded} pay({0}) name(pay 0 to cast) activate name(pay 0 to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
target=creature[black]|myGraveyard
auto=moveTo(myHand)
text=Return target black creature card from your graveyard to your hand. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={B}
type=Sorcery
[/card]
[card]
name=Cinder Seer
auto={2}{r}{t}:target(creature,Player) damage:type:*[red]:myhand
text={2}{R}, {T}: Reveal any number of red cards in your hand. Cinder Seer deals X damage to target creature or player, where X is the number of cards revealed this way.
@@ -44,6 +89,16 @@ mana={1}{B}{G}
type=Instant
[/card]
[card]
name=Dark Withering
abilities=madness
autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
target=creature[-black]
auto=destroy
text=Destroy target nonblack creature. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={4}{B}{B}
type=Instant
[/card]
[card]
name=Feral Hydra
type=Creature
subtype=Hydra Beast
@@ -56,6 +111,26 @@ auto={3}:counter(1/1)
#Not all player can use ability
[/card]
[card]
name=Fiery Temper
abilities=madness
autoexile=restriction{discarded} pay({R}) name(pay R to cast) activate name(pay R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
target=creature,player
auto=damage:3
text=Fiery Temper deals 3 damage to target creature or player. -- Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{R}{R}
type=Instant
[/card]
[card]
name=Frantic Purification
abilities=madness
autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
target=enchantment
auto=destroy
text=Destroy target enchantment. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={2}{W}
type=Instant
[/card]
[card]
name=Ghastly Remains
auto=foreach(zombie|myhand) counter(1/1,1)
autograveyard={B}{B}{B}:moveTo(myhand) myUpkeepOnly
@@ -77,6 +152,18 @@ power=4
toughness=4
[/card]
[card]
name=Gorgon Recluse
abilities=madness
autoexile=restriction{discarded} pay({B}{B}) name(pay BB to cast) activate name(pay BB to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
auto=@combat(blocked,blocking) source(this) from(creature):all(trigger[from]) phaseaction[combatends once] destroy
text=Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. -- Madness {B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={3}{B}{B}
type=Creature
subtype=Gorgon
power=2
toughness=4
[/card]
[card]
name=Govern the Guildless
target=creature[-multicolor]
auto=moveto(mybattlefield)
@@ -86,6 +173,17 @@ mana={5}{U}
type=Sorcery
[/card]
[card]
name=Ichor Slick
abilities=madness
autoexile=restriction{discarded} pay({3}{B}) name(pay 3B to cast) activate name(pay 3B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
target=creature
auto=-3/-3
autohand=__CYCLING__({2})
text=Target creature gets -3/-3 until end of turn. -- Cycling {2} ({2}, Discard this card: Draw a card.) -- Madness {3}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={2}{B}
type=Sorcery
[/card]
[card]
name=Ivy Seer
auto={2}{G}{T}:foreach(*[green]|myhand) 1/1 target(creature)
text={2}{G}, {T}: Reveal any number of green cards in your hand. Target creature gets +X/+X until end of turn, where X is the number of cards revealed this way.
@@ -149,6 +247,15 @@ power=1
toughness=1
[/card]
[card]
name=Obsessive Search
abilities=madness
autoexile=restriction{discarded} pay({U}) name(pay U to cast) activate name(pay U to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
auto=draw:1 controller
text=Draw a card. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={U}
type=Instant
[/card]
[card]
name=Ogre Marauder
text=Whenever Ogre Marauder attacks, it gains "Ogre Marauder can't be blocked" until end of turn unless defending player sacrifices a creature.
auto=@combat(attacking) source(this):ability$!name(choose one) if type(creature|mybattlefield)~morethan~0 then choice sacrifice notatarget(creature|mybattlefield) _ choice all(mystored) unblockable ueot!$ opponent
@@ -159,6 +266,15 @@ power=3
toughness=1
[/card]
[card]
name=Psychotic Haze
abilities=madness
autoexile=restriction{discarded} pay({1}{B}) name(pay 1B to cast) activate name(pay 1B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
auto=damage:1 all(creature,player)
text=Psychotic Haze deals 1 damage to each creature and each player. -- Madness {1}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={2}{B}{B}
type=Instant
[/card]
[card]
name=Rakdos Augermage
abilities=first strike
auto={T}:name(target opponent) target(opponent) donothing && all(this) transforms((,newability[ability$!name(discard) reject notatarget(*|opponenthand)!$ targetedplayer && ability$!name(discard) reject notatarget(*|opponenthand)!$ controller])) assorcery
@@ -178,6 +294,17 @@ mana={X}{X}{U}
type=Sorcery
[/card]
[card]
name=Reckless Wurm
abilities=trample,madness
autoexile=restriction{discarded} pay({2}{R}) name(pay 2R to cast) activate name(pay 2R to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
text=Trample -- Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={3}{R}{R}
type=Creature
subtype=Wurm
power=4
toughness=4
[/card]
[card]
name=Sacellum Godspeaker
auto={T}:foreach(creaure[power>4]|myhand) add{G}
text={T}: Reveal any number of creature cards with power 5 or greater from your hand. Add {G} to your mana pool for each card revealed this way.
@@ -236,6 +363,30 @@ mana={G}{W}
type=Instant
[/card]
[card]
name=Strength of Isolation
abilities=madness
autoexile=restriction{discarded} pay({W}) name(pay W to cast) activate name(pay W to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
target=creature
auto=1/2
auto=protection from black
text=Enchant creature -- Enchanted creature gets +1/+2 and has protection from black. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Strength of Lunacy
abilities=madness
autoexile=restriction{discarded} pay({B}) name(pay B to cast) activate name(pay B to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
target=creature
auto=2/1
auto=protection from white
text=Enchant creature -- Enchanted creature gets +2/+1 and has protection from white. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{B}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Zombie Brute
abilities=trample
auto=foreach(zombie|myhand) counter(1/1,1)
File diff suppressed because it is too large Load Diff
@@ -187,6 +187,13 @@ power=1
toughness=1
[/card]
[card]
name=Aladdin's Lamp
alias=1092
text={X}, {T}: The next time you would draw a card this turn, instead look at the top X cards of your library, put all but one of them on the bottom of your library in a random order, then draw a card. X can't be 0.
mana={10}
type=Artifact
[/card]
[card]
name=Alive // Well
text=Put a 3/3 green Centaur creature token onto the battlefield. -- // -- You gain 2 life for each creature you control. -- -- Fuse (You may cast one or both halves of this card from your hand.)
mana={3}{G} // {W}
@@ -470,15 +477,6 @@ type=Enchantment
subtype=Aura
[/card]
[card]
name=Arrogant Wurm
text=Trample -- Madness {2}{G} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={3}{G}{G}
type=Creature
subtype=Wurm
power=4
toughness=4
[/card]
[card]
name=Arrow Volley Trap
text=If four or more creatures are attacking, you may pay {1}{W} rather than pay Arrow Volley Trap's mana cost. -- Arrow Volley Trap deals 5 damage divided as you choose among any number of target attacking creatures.
mana={3}{W}{W}
@@ -993,15 +991,6 @@ toughness=4
text=Flying -- Players can't cast spells during combat. {R}: Target creature attacks this turn if able.
[/card]
[card]
name=Basking Rootwalla
text={1}{G}: Basking Rootwalla gets +2/+2 until end of turn. Activate this ability only once each turn. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={G}
type=Creature
subtype=Lizard
power=1
toughness=1
[/card]
[card]
name=Baton of Morale
text={2}: Target creature gains banding until end of turn. (Any creatures with banding, and up to one without, can attack in a band. Bands are blocked as a group. If any creatures with banding a player controls are blocking or being blocked by a creature, that player divides that creature's combat damage, not its controller, among any of the creatures it's being blocked by or is blocking.)
mana={2}
@@ -1162,15 +1151,6 @@ mana={5}{B}
type=Instant
[/card]
[card]
name=Big Game Hunter
text=When Big Game Hunter enters the battlefield, destroy target creature with power 4 or greater. It can't be regenerated. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{B}{B}
type=Creature
subtype=Human Rebel Assassin
power=1
toughness=1
[/card]
[card]
name=Bind
text=Counter target activated ability. (Mana abilities can't be targeted.) -- Draw a card.
mana={1}{G}
@@ -1875,12 +1855,6 @@ mana={1}{W}
type=Enchantment
[/card]
[card]
name=Call to the Netherworld
text=Return target black creature card from your graveyard to your hand. -- Madness {0} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={B}
type=Sorcery
[/card]
[card]
name=Callous Deceiver
text={1}: Look at the top card of your library. -- {2}: Reveal the top card of your library. If it's a land card, Callous Deceiver gets +1/+0 and gains flying until end of turn. Activate this ability only once each turn.
mana={2}{U}
@@ -3422,12 +3396,6 @@ mana={2}{B}
type=Enchantment
[/card]
[card]
name=Dark Withering
text=Destroy target nonblack creature. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={4}{B}{B}
type=Instant
[/card]
[card]
name=Darkpact
text=Remove Darkpact from your deck before playing if you're not playing for ante. -- You own target card in the ante. Exchange that card with the top card of your library.
mana={B}{B}{B}
@@ -5116,12 +5084,6 @@ mana={R}{G}{W}
type=Sorcery
[/card]
[card]
name=Fiery Temper
text=Fiery Temper deals 3 damage to target creature or player. -- Madness {R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{R}{R}
type=Instant
[/card]
[card]
name=Fight or Flight
text=At the beginning of each opponent's combat phase, separate all creatures that player controls into two piles. Only creatures in the pile of his or her choice can attack this turn.
mana={3}{W}
@@ -5555,12 +5517,6 @@ toughness=3
text=At the beginning of your upkeep, you may ask target player a yes-or-no question. If you do, that player answers the question truthfully and abides by that answer if able until end of turn.
[/card]
[card]
name=Frantic Purification
text=Destroy target enchantment. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={2}{W}
type=Instant
[/card]
[card]
name=Frazzled Editor
mana={1}{R}
type=Creature — Human Bureaucrat
@@ -5928,8 +5884,14 @@ subtype=Turtle
power=2
toughness=4
[/card]
#bug phasealter not turning off
[card]
name=Gibbering Descent
abilities=madness
autoexile=restriction{discarded} pay({2}{B}{B}) name(pay 2BB to cast) activate name(pay 2BB to cast) castcard(normal)?name(put in graveyard) moveto(ownergraveyard)
auto=@each my upkeep:life:-1 controller && reject target(*|myhand)
auto=@each opponentupkeep:life:-1 opponent && ability$!name(discard) target(*|myhand) reject!$ opponent
auto=this(variable{phandcount} <1) phasealter(remove,upkeep,controller)
text=At the beginning of each player's upkeep, that player loses 1 life and discards a card. -- Hellbent - Skip your upkeep step if you have no cards in hand. -- Madness {2}{B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={4}{B}{B}
type=Enchantment
@@ -6429,15 +6391,6 @@ power=0
toughness=3
[/card]
[card]
name=Gorgon Recluse
text=Whenever Gorgon Recluse blocks or becomes blocked by a nonblack creature, destroy that creature at end of combat. -- Madness {B}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={3}{B}{B}
type=Creature
subtype=Gorgon
power=2
toughness=4
[/card]
[card]
name=Gorilla Berserkers
text=Trample; rampage 2 (Whenever this creature becomes blocked, it gets +2/+2 until end of turn for each creature blocking it beyond the first.) -- Gorilla Berserkers can't be blocked except by three or more creatures.
mana={3}{G}{G}
@@ -7441,12 +7394,6 @@ power=1
toughness=1
[/card]
[card]
name=Ichor Slick
text=Target creature gets -3/-3 until end of turn. -- Cycling {2} ({2}, Discard this card: Draw a card.) -- Madness {3}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={2}{B}
type=Sorcery
[/card]
[card]
name=Icy Prison
text=When Icy Prison enters the battlefield, exile target creature. -- At the beginning of your upkeep, sacrifice Icy Prison unless any player pays {3}. -- When Icy Prison leaves the battlefield, return the exiled creature to the battlefield under its owner's control.
mana={U}{U}
@@ -11068,12 +11015,6 @@ type=Legendary Artifact
subtype=Equipment
[/card]
[card]
name=Obsessive Search
text=Draw a card. -- Madness {U} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={U}
type=Instant
[/card]
[card]
name=Obstinate Baloth
auto=life:4
text=When Obstinate Baloth enters the battlefield, you gain 4 life. -- If a spell or ability an opponent controls causes you to discard Hardheaded Baloth, put it onto the battlefield instead of putting it into your graveyard.
@@ -12425,12 +12366,6 @@ mana={1}{B}{B}
type=Sorcery
[/card]
[card]
name=Psychotic Haze
text=Psychotic Haze deals 1 damage to each creature and each player. -- Madness {1}{B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={2}{B}{B}
type=Instant
[/card]
[card]
name=Puca's Mischief
text=At the beginning of your upkeep, you may exchange control of target nonland permanent you control and target nonland permanent an opponent controls with an equal or lesser converted mana cost.
mana={3}{U}
@@ -12474,18 +12409,6 @@ type=Enchantment
subtype=Aura
[/card]
[card]
#to be tested....
name=Puresteel Paladin
auto=@movedTo(equipment|mybattlefield):may draw:1 controller
auto=lord(equipment|mybattlefield) transforms((,newability[{0}:name(equip 0) retarget target(creature|mybattlefield) assorcery restriction{type(artifact|mybattlefield)~morethan~2}]))
text=Whenever an Equipment enters the battlefield under your control, you may draw a card. -- Metalcraft - As long as you control 3 or more artifacts, each Equipment you control has equip {0}.
mana={W}{W}
type=Creature
subtype=Human Knight
power=2
toughness=2
[/card]
[card]
name=Pure // Simple (Pure)
text=Destroy target multicolored permanent.
mana={1}{R}{G}
@@ -12983,15 +12906,6 @@ mana={W}
type=Instant
[/card]
[card]
name=Reckless Wurm
text=Trample -- Madness {2}{R} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={3}{R}{R}
type=Creature
subtype=Wurm
power=4
toughness=4
[/card]
[card]
name=Reclamation
auto=lord(creature[black]) cantattack
auto=lord(creature[black]) {S(land|myinplay)}:-cantattack
@@ -16054,20 +15968,6 @@ mana={X}{R}
type=Instant
[/card]
[card]
name=Strength of Isolation
text=Enchant creature -- Enchanted creature gets +1/+2 and has protection from black. -- Madness {W} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{W}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Strength of Lunacy
text=Enchant creature -- Enchanted creature gets +2/+1 and has protection from white. -- Madness {B} (If you discard this card, you may cast it for its madness cost instead of putting it into your graveyard.)
mana={1}{B}
type=Enchantment
subtype=Aura
[/card]
[card]
name=Strength of the Tajuru
text=Multikicker {1} (You may pay an additional {1} any number of times as you cast this spell.) -- Choose target creature, then choose another target creature for each time Strength of the Tajuru was kicked. Put X +1/+1 counters on each of them.
mana={X}{G}{G}
@@ -16296,15 +16196,6 @@ type=Sorcery
text=You gain 2 life. Then if you have more life than an opponent, draw a card. Rebound (If you cast this spell from your hand, exile it as it resolves. At the beginning of your next upkeep, you may cast this card from exile without paying its mana cost.)
[/card]
[card]
name=Sustaining Spirit
text=Cumulative upkeep {1}{W} (At the beginning of your upkeep, put an age counter on this permanent, then sacrifice it unless you pay its upkeep cost for each age counter on it.) -- Damage that would reduce your life total to less than 1 reduces it to 1 instead.
mana={1}{W}
type=Creature
subtype=Angel Spirit
power=0
toughness=3
[/card]
[card]
name=Sutured Ghoul
text=Trample -- As Sutured Ghoul enters the battlefield, exile any number of creature cards from your graveyard. -- Sutured Ghoul's power is equal to the total power of the exiled cards and its toughness is equal to their total toughness.
mana={4}{B}{B}{B}
@@ -18813,12 +18704,6 @@ mana={2}{B}{B}{B}
type=Enchantment
[/card]
[card]
name=Worship
text=If you control a creature, damage that would reduce your life total to less than 1 reduces it to 1 instead.
mana={3}{W}
type=Enchantment
[/card]
[card]
name=Wort, the Raidmother
text=When Wort, the Raidmother enters the battlefield, put two 1/1 red and green Goblin Warrior creature tokens onto the battlefield. -- Each red or green instant or sorcery spell you cast has conspire. (As you cast the spell, you may tap two untapped creatures you control that share a color with it. When you do, copy it and you may choose new targets for the copy.)
mana={4}{RG}{RG}
@@ -0,0 +1,28 @@
#Hypnotic Specter vs Control Magic
#The opponent of the current controller of Hypnotic Specter
#Must discard at random when combat damage is dealt...
[INIT]
FIRSTMAIN
[PLAYER1]
hand:Control Magic
inplay:Concordant Crossroads
manapool:{B}{B}{U}{U}
[PLAYER2]
inplay:Hypnotic Specter
hand:Forest
[DO]
Control Magic
Hypnotic Specter
next
next
Hypnotic Specter
next
eot
[ASSERT]
UNTAP
[PLAYER1]
inplay:Control Magic, Hypnotic Specter, Concordant Crossroads
[PLAYER2]
graveyard:Forest
life:18
[END]
+1
View File
@@ -311,6 +311,7 @@ evil_presence3.txt
evil_presence_i647.txt
evil_presence_i647_2.txt
exaltedsourcekilled.txt
ExchangeController.txt
executioners_swing.txt
executioners_swing2.txt
executioners_swing3.txt
+10 -1
View File
@@ -2,6 +2,15 @@
#DESC: Tests whether Curiosity works correctly
#DESC: when cast on an opponent's creature
#DESC: http://code.google.com/p/wagic/issues/detail?id=217
#
#revised...10-22-2015...kevlahnota
#2/1/2007 You draw one card each time the enchanted creature damages the opponent. This is not one card per point of damage.
#2/1/2007 If put on your opponent's creature, you do not draw a card when that creature damages you. The creature has to damage your opponent in order to have this work.
#2/1/2007 Drawing a card is optional. If you forget, you can't go back later and do it, even if it is something you normally do.
#9/22/2011 "You" refers to the controller of Curiosity, which may be different from the controller of the enchanted creature."An opponent" refers to an opponent of Curiosity's controller.
#9/22/2011 Any damage dealt by the enchanted creature to an opponent will cause Curiosity to trigger, not just combat damage.
#9/22/2011 Curiosity doesn't trigger if the enchanted creature deals damage to a planeswalker controlled by an opponent.
#
[INIT]
firstmain
[PLAYER1]
@@ -29,7 +38,7 @@ next
combatend
[PLAYER1]
inplay:Curiosity
hand:Island
library:Island
life:14
[PLAYER2]
inplay:Craw Wurm
Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

After

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 47 KiB

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 24 KiB

+143 -16
View File
@@ -556,6 +556,15 @@ private:
intValue = card->previous->previous->sunburst;
}
}
else if (s == "converge")
{
intValue = 0;
for (int i = Constants::MTG_COLOR_GREEN; i <= Constants::MTG_COLOR_WHITE; ++i)
{
if(card->getManaCost()->getManaUsedToCast()->hasColor(i))
intValue +=1;
}
}
else if (s == "targetedcurses")
{
if(card->playerTarget)
@@ -645,11 +654,11 @@ private:
}
else if (s == "p" || s == "power")
{
intValue = target->getPower();
intValue = target->getCurrentPower();
}
else if (s == "t" || s == "toughness")
{
intValue = target->getToughness();
intValue = target->getCurrentToughness();
}
else if (s == "kicked")
{
@@ -679,6 +688,20 @@ private:
{
intValue = target->controller()->opponent()->game->hand->nb_cards;
}
else if (s == "urzatron")//Urza lands
{
if(card->controller()->game->battlefield->hasAlias(4192) && card->controller()->game->battlefield->hasAlias(4193) && card->controller()->game->battlefield->hasAlias(4194))
intValue = 1;
else
intValue = 0;
}
else if (s == "worshipped")//Worship
{
if(card->controller()->game->battlefield->hasType("creature"))
intValue = card->controller()->life;
else
intValue = 0;
}
else if (s == "pancientooze")//Ancient Ooze
{
intValue = 0;
@@ -708,7 +731,7 @@ private:
else if (s == "pbasiclandtypes")//Basic Land types
{
intValue = 0;
int forest, plains, swamp, island, mountain = 0;
int forest = 0, plains = 0, swamp = 0, island = 0, mountain = 0;
for (int j = card->controller()->game->battlefield->nb_cards - 1; j >= 0; --j)
{
if (card->controller()->game->battlefield->cards[j]->hasType("forest"))
@@ -801,7 +824,7 @@ private:
else if (s == "gravecardtypes")//Tarmogoyf
{
intValue = 0;
int art, cre, enc, ins, lnd, sor, trb, pwk = 0;
int art = 0, cre = 0, enc = 0, ins = 0, lnd = 0, sor = 0, trb = 0, pwk = 0;
for (int i = 0; i < 2; i++)
{
Player * p = card->getObserver()->players[i];
@@ -1173,9 +1196,9 @@ public:
class TrcardDrawn: public Trigger
{
public:
TrcardDrawn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false) :
Trigger(observer, id, source,once, tc)
bool thiscontroller, thisopponent;
TrcardDrawn(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc,bool once = false, bool thiscontroller = false, bool thisopponent = false) :
Trigger(observer, id, source,once, tc),thiscontroller(thiscontroller),thisopponent(thisopponent)
{
}
@@ -1184,7 +1207,12 @@ public:
WEventcardDraw * e = dynamic_cast<WEventcardDraw *> (event);
if (!e) return 0;
if (!tc->canTarget(e->player)) return 0;
if(thiscontroller)
if(e->player != source->controller())
return 0;
if(thisopponent)
if(e->player == source->controller())
return 0;
return 1;
}
@@ -1272,8 +1300,10 @@ public:
bool sourceUntapped;
bool limitOnceATurn;
int triggeredTurn;
TrDamaged(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool limitOnceATurn = false,bool once = false) :
Trigger(observer, id, source, once, tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped),limitOnceATurn(limitOnceATurn)
bool thiscontroller;
bool thisopponent;
TrDamaged(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool limitOnceATurn = false,bool once = false, bool thiscontroller = false, bool thisopponent = false) :
Trigger(observer, id, source, once, tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped),limitOnceATurn(limitOnceATurn),thiscontroller(thiscontroller),thisopponent(thisopponent)
{
triggeredTurn = -1;
}
@@ -1290,6 +1320,15 @@ public:
if (fromTc && !fromTc->canTarget(e->damage->source)) return 0;
if (type == 1 && e->damage->typeOfDamage != Damage::DAMAGE_COMBAT) return 0;
if (type == 2 && e->damage->typeOfDamage == Damage::DAMAGE_COMBAT) return 0;
if (e->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
{
if(thiscontroller)
if(e->damage->target != (Damageable *)source->controller())
return 0;
if(thisopponent)
if(e->damage->target == (Damageable *)source->controller())
return 0;
}
e->damage->target->thatmuch = e->damage->damage;
e->damage->source->thatmuch = e->damage->damage;
this->source->thatmuch = e->damage->damage;
@@ -1314,9 +1353,9 @@ class TrLifeGained: public Trigger
public:
TargetChooser * fromTc;
int type;//this allows damagenoncombat and combatdamage to share this trigger
bool sourceUntapped;
TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool once = false) :
Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped)
bool sourceUntapped, thiscontroller, thisopponent;
TrLifeGained(GameObserver* observer, int id, MTGCardInstance * source, TargetChooser * tc, TargetChooser * fromTc = NULL, int type = 0,bool sourceUntapped = false,bool once = false, bool thiscontroller = false, bool thisopponent = false) :
Trigger(observer, id, source, once , tc), fromTc(fromTc), type(type) , sourceUntapped(sourceUntapped) , thiscontroller(thiscontroller) , thisopponent(thisopponent)
{
}
@@ -1330,6 +1369,12 @@ public:
if (fromTc && !fromTc->canTarget(e->player)) return 0;
if (type == 1 && (e->amount > 0)) return 0;
if (type == 0 && (e->amount < 0)) return 0;
if(thiscontroller)
if(e->player != source->controller())
return 0;
if(thisopponent)
if(e->player == source->controller())
return 0;
e->player->thatmuch = abs(e->amount);
this->source->thatmuch = abs(e->amount);
@@ -1417,7 +1462,7 @@ public:
}
};
//targetted trigger
//counter trigger
class TrCounter: public Trigger
{
public:
@@ -1749,7 +1794,9 @@ public:
string destination;
MTGAbility * andAbility;
string named;
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL);
bool undying;
bool persist;
AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string _name, ManaCost * _cost = NULL, bool undying = false, bool persist = false);
MTGGameZone * destinationZone(Targetable * target = NULL);
int resolve();
const string getMenuText();
@@ -2068,6 +2115,7 @@ public:
assert(value < 2);
_target->basicAbilities.set(ability, value > 0);
_target->modifiedbAbi += 1;
return InstantAbility::addToGame();
}
@@ -2080,7 +2128,10 @@ public:
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if (_target)
{
_target->basicAbilities.set(ability, stateBeforeActivation);
_target->modifiedbAbi -= 1;
}
return 1;
}
@@ -4170,7 +4221,9 @@ class AANewTarget: public ActivatedAbility
{
public:
bool retarget;
AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL);
bool reequip;
bool newhook;
AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget = false, ManaCost * _cost = NULL, bool reequip = false, bool newhook = false);
int resolve();
const string getMenuText();
AANewTarget * clone() const;
@@ -4780,6 +4833,49 @@ public:
~AVanishing();
};
//Produce Mana when tapped for mana...
class AProduceMana: public MTGAbility
{
public:
string ManaDescription;
string mana[5];
AProduceMana(GameObserver* observer, int _id, MTGCardInstance * _source, string _ManaDescription);
int receiveEvent(WEvent * event);
int produce();
const string getMenuText();
//virtual ostream& toString(ostream& out) const;
AProduceMana * clone() const;
~AProduceMana();
};
//Produce Mana when a mana is engaged...
class AEngagedManaAbility: public MTGAbility
{
public:
string colorname;
AEngagedManaAbility(GameObserver* observer, int _id, MTGCardInstance * _source, string _colorname) :
MTGAbility(observer, _id, _source)
{
colorname = _colorname;
}
int receiveEvent(WEvent * event)
{
if(WEventEngageMana * isManaProduced = dynamic_cast<WEventEngageMana *> (event))
{
if ((isManaProduced->card == source) && isManaProduced->color == Constants::GetColorStringIndex(colorname))
{
source->controller()->getManaPool()->add(Constants::GetColorStringIndex(colorname),1);
}
}
return 1;
}
AEngagedManaAbility * clone() const
{
return NEW AEngagedManaAbility(*this);
}
};
//Upkeep Cost
class AUpkeep: public ActivatedAbility, public NestedAbility
{
@@ -5953,6 +6049,37 @@ public:
}
};
//Reduce to .. Ali from Cairo...
class AReduceToAbility: public MTGAbility
{
public:
string life_s;
AReduceToAbility(GameObserver* observer, int _id, MTGCardInstance * _source, string _life_s) :
MTGAbility(observer, _id, _source)
{
life_s = _life_s;
}
int receiveEvent(WEvent * event)
{
if(WEventDamage * isDamaged = dynamic_cast<WEventDamage *> (event))
{
if (isDamaged->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
{
Player * p = (Player *) isDamaged->damage->target;
WParsedInt lifetoset(life_s, NULL, source);
if(p && p == source->controller() && p->life <= lifetoset.getValue())
p->life = lifetoset.getValue();
}
}
return 1;
}
AReduceToAbility * clone() const
{
return NEW AReduceToAbility(*this);
}
};
//flanking ability
class AFlankerAbility: public MTGAbility
{
+3 -3
View File
@@ -33,7 +33,7 @@ protected:
/*
** Tries to render the Big version of a card picture, backups to text version in case of failure
*/
static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false);
static void RenderBig(MTGCard * card, const Pos& pos, bool thumb = false, bool noborder = false);
static void RenderCountersBig(MTGCard * card, const Pos& pos, int drawMode = DrawMode::kNormal);
static void AlternateRender(MTGCard * card, const Pos& pos);
@@ -55,8 +55,8 @@ public:
virtual void Render();
virtual void Update(float dt);
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false);
void DrawCard(const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false);
static void DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode = DrawMode::kNormal, bool thumb = false, bool noborder = false);
static JQuadPtr AlternateThumbQuad(MTGCard * card);
virtual ostream& toString(ostream&) const;
+2
View File
@@ -58,6 +58,8 @@ public:
uint8_t colors;
typedef std::bitset<Constants::NB_BASIC_ABILITIES> BasicAbilitiesSet;
BasicAbilitiesSet basicAbilities;
BasicAbilitiesSet origbasicAbilities;
BasicAbilitiesSet LKIbasicAbilities;
map<string,string> magicTexts;
string magicText;
+1
View File
@@ -73,6 +73,7 @@ public:
static hgeParticleSystem * Particles[6];
static bool HasMusic;
static string systemError;
static char mynbcardsStr[512];
static JMusic* music;
static string currentMusicFile;
static void playMusic(string filename = "", bool loop = true);
+1 -2
View File
@@ -24,7 +24,6 @@ private:
float mCreditsYPos;
int currentState;
int mVolume;
char nbcardsStr[400];
vector<string> langs;
vector<string> primitives;
@@ -46,7 +45,6 @@ private:
bool langChoices;
void runTest(); //!!
void listPrimitives();
void genNbCardsStr(); //computes the contents of nbCardsStr
void ensureMGuiController(); //creates the MGuiController if it doesn't exist
string loadRandomWallpaper(); //loads a list of string of textures that can be randolmy shown on the loading screen
@@ -66,6 +64,7 @@ public:
int nextSetFolder(const string & root, const string & file); // Retrieves the next directory to have matching file
void createUsersFirstDeck(int setId);
static void genNbCardsStr(); //computes the contents of nbCardsStr
virtual ostream& toString(ostream& out) const;
enum
+1 -1
View File
@@ -22,7 +22,7 @@ private:
InOutQuadEasing zoomFactorEasing;
DuelLayers* mpDuelLayers;
void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale);
void DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale, float z);
public:
GuiPhaseBar(DuelLayers* duelLayers);
~GuiPhaseBar();
+12
View File
@@ -233,6 +233,10 @@ public:
void addbaseT(int t = 0);
void revertbaseP();
void revertbaseT();
int getCurrentPower();
int getCurrentToughness();
int LKIpower;
int LKItoughness;
void cdaPT(int p = 0, int t = 0);
bool isCDA;
void switchPT(bool apply = false);
@@ -241,6 +245,14 @@ public:
bool isSwitchedPT;
bool isACopier;
bool bypassTC;
bool discarded;
int copiedID;
int modifiedbAbi;
bool StackIsEmptyandSorcerySpeed();
bool isTargetted();
int cardistargetted;
bool isTargetter();
int cardistargetter;
void eventattacked();
void eventattackedAlone();
+5 -1
View File
@@ -230,7 +230,11 @@ class Constants
NOLIFEGAIN = 112,
NOLIFEGAINOPPONENT = 113,
AURAWARD = 114,
NB_BASIC_ABILITIES = 115,
MADNESS = 115,
PROTECTIONFROMCOLOREDSPELLS = 116,
MYGCREATUREEXILER = 117,
OPPGCREATUREEXILER = 118,
NB_BASIC_ABILITIES = 119,
RARITY_S = 'S', //Special Rarity
+2
View File
@@ -103,6 +103,8 @@ class MTGGameZone {
//returns true if one of the cards in the zone has the ability
bool hasAbility(int ability);
//returns true if one of the cards in the zone has the alias
bool hasAlias(int alias);
//returns true if one of the cards in the zone has the type
bool hasType(const char * value);
+8 -8
View File
@@ -76,7 +76,7 @@ public:
MTGPutInPlayRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "cast card normally";
return "Cast Card Normally";
}
virtual MTGPutInPlayRule * clone() const;
};
@@ -90,7 +90,7 @@ public:
MTGKickerRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "pay kicker";
return "Pay Kicker";
}
virtual MTGKickerRule * clone() const;
};
@@ -110,7 +110,7 @@ public:
{
if(alternativeName.size())
return alternativeName.c_str();
return "pay alternative cost";
return "Pay Alternative Cost";
}
virtual MTGAlternativeCostRule * clone() const;
};
@@ -124,7 +124,7 @@ public:
MTGBuyBackRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "cast and buy back";
return "Cast and Buyback";
}
virtual MTGBuyBackRule * clone() const;
};
@@ -139,7 +139,7 @@ public:
MTGFlashBackRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "flash back";
return "Flashback";
}
virtual MTGFlashBackRule * clone() const;
};
@@ -153,7 +153,7 @@ public:
MTGRetraceRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "retrace";
return "Retrace";
}
virtual MTGRetraceRule * clone() const;
};
@@ -168,7 +168,7 @@ public:
MTGMorphCostRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "play morphed";
return "Play Morphed";
}
virtual MTGMorphCostRule * clone() const;
};
@@ -182,7 +182,7 @@ public:
MTGPlayFromGraveyardRule(GameObserver* observer, int _id);
const string getMenuText()
{
return "cast card from graveyard";
return "Cast Card From Graveyard";
}
virtual MTGPlayFromGraveyardRule * clone() const;
};
+2 -1
View File
@@ -44,6 +44,7 @@ public:
int drawCounter;
int epic;
int initLife;
int raidcount;
vector<string> prowledTypes;
vector<MTGCardInstance*>curses;
Player(GameObserver *observer, string deckFile, string deckFileSmall, MTGDeck * deck = NULL);
@@ -71,7 +72,7 @@ public:
ManaPool * getManaPool();
void takeMulligan();
void serumMulligan();
bool DeadLifeState();
bool DeadLifeState(bool check = false);
ManaCost * doesntEmpty;
ManaCost * poolDoesntEmpty;
void cleanupPhase();
+6
View File
@@ -279,6 +279,12 @@ struct WEventCardUnattached : public WEventCardUpdate {
virtual Targetable * getTarget(int target);
};
//event when card moves from player/opponent battlefield to player/opponent battlefield
struct WEventCardControllerChange : public WEventCardUpdate {
WEventCardControllerChange(MTGCardInstance * card);
virtual Targetable * getTarget(int target);
};
std::ostream& operator<<(std::ostream&, const WEvent&);
#endif
+2 -2
View File
@@ -12,8 +12,8 @@ Author: Michael Nguyen
/* Wagic versions */
#define WAGIC_VERSION_MAJOR 0
#define WAGIC_VERSION_MEDIUM 20
#define WAGIC_VERSION_MINOR 1
#define WAGIC_VERSION_MEDIUM 19
#define WAGIC_VERSION_MINOR 2
#define VERSION_DOT(a, b, c) a ##.## b ##.## c
#define VERSION_WITHOUT_DOT(a, b, c) a ## b ## c
+42 -17
View File
@@ -93,9 +93,27 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string
WFont * mFont = observer->getResourceManager()->GetWFont(Fonts::MAIN_FONT);
mFont->SetColor(ARGB(255,255,255,255));
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
mFont->DrawString(_(action).c_str(), x + 35, y + GetVerticalTextOffset(), JGETEXT_LEFT);
JRenderer * renderer = JRenderer::GetInstance();
if (!targetQuad)
{
/*if(source->controller()->isHuman() && source->controller()->opponent()->isAI() && !alt2.size() && _(action).c_str() == source->name)
mFont->DrawString("You play ", x + 35, y-15 + GetVerticalTextOffset(), JGETEXT_LEFT);
else if(source->controller()->isAI() && source->controller()->opponent()->isHuman() && !alt2.size() && _(action).c_str() == source->name)
mFont->DrawString("Opponent plays ", x + 35, y-15 + GetVerticalTextOffset(), JGETEXT_LEFT);*/
mFont->DrawString(_(action).c_str(), x + 35, y + GetVerticalTextOffset(), JGETEXT_LEFT);
}
else
{
renderer->FillRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(235,10,10,10));
/*if(source->controller()->isHuman() && source->controller()->opponent()->isAI())
renderer->DrawRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(245,0,255,0));
else
renderer->DrawRect(x-2,y-16 + GetVerticalTextOffset(), 73, 43, ARGB(245,255,0,0));*/
mFont->DrawString(">", x + 32, y + GetVerticalTextOffset(), JGETEXT_LEFT);
mFont->DrawString(_(action).c_str(), x + 75, y + GetVerticalTextOffset(), JGETEXT_LEFT);
}
JQuadPtr quad = observer->getResourceManager()->RetrieveCard(source, CACHE_THUMB);
if (!quad.get())
quad = CardGui::AlternateThumbQuad(source);
@@ -123,12 +141,12 @@ void Interruptible::Render(MTGCardInstance * source, JQuad * targetQuad, string
targetQuad->SetColor(ARGB(255,255,255,255));
targetQuad->SetHotSpot(targetQuad->mWidth / 2, targetQuad->mHeight / 2);
float scale = mHeight / targetQuad->mHeight;
renderer->RenderQuad(targetQuad, x + 150, y + ((mHeight - targetQuad->mHeight) / 2) + targetQuad->mHotSpotY, 0, scale, scale);
renderer->RenderQuad(targetQuad, x + 55, y + ((mHeight - targetQuad->mHeight) / 2) + targetQuad->mHotSpotY, 0, scale, scale);
targetQuad->SetHotSpot(backupX, backupY);
}
else if (alt2.size())
{
mFont->DrawString(_(alt2).c_str(), x + 120, y + GetVerticalTextOffset());
mFont->DrawString(_(alt2).c_str(), x + 35, y+15 + GetVerticalTextOffset());
}
}
@@ -1219,10 +1237,17 @@ void ActionStack::Render()
mFont->SetColor(ARGB(255,255,255,255));
JRenderer * renderer = JRenderer::GetInstance();
renderer->FillRoundRect(x0 + 16, y0 + 16, width + 2, height + 2, 10, ARGB(128,0,0,0));
renderer->FillRoundRect(x0 - 5, y0, width + 2, height + 2, 10, ARGB(200,0,0,0));
renderer->DrawRoundRect(x0 - 5, y0, width + 2, height + 2, 10, ARGB(255,255,255,255));
//stack shadow
//renderer->FillRoundRect(x0 - 7, y0+2, width + 17, height + 2, 9.0f, ARGB(128,0,0,0));
//stack fill
renderer->FillRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(225,5,5,5));
//stack highlight
renderer->FillRect(x0 - 6, y0+3, width + 15, 30, ARGB(255,89,89,89));
//another border
renderer->DrawRect(x0 - 6, y0+33, width + 15, height - 18, ARGB(255,89,89,89));
//stack border
renderer->DrawRect(x0 - 7, y0+2, width + 17, height + 14, ARGB(255,240,240,240));
std::ostringstream stream;
// WALDORF - changed "interrupt ?" to "Interrupt?". Don't display count down
// seconds if the user disables auto progressing interrupts by setting the seconds
@@ -1235,11 +1260,11 @@ void ActionStack::Render()
else
stream << _(kInterruptMessageString) << " " << static_cast<int>(timer);
mFont->DrawString(stream.str(), x0 + 5, currenty);
mFont->DrawString(stream.str(), x0 + 5, currenty - 2);
// static const float kIconVerticalOffset = 24;
static const float kIconHorizontalOffset = 9;
static const float kBeforeIconSpace = 10;
static const float kIconHorizontalOffset = 10;
static const float kBeforeIconSpace = 12;
//Render "interrupt?" text + possible actions
{
@@ -1248,25 +1273,25 @@ void ActionStack::Render()
if (gModRules.game.canInterrupt())
{
renderer->RenderQuad(pspIcons[7].get(), currentx, kIconVerticalOffset, 0, kGamepadIconSize, kGamepadIconSize);
renderer->RenderQuad(pspIcons[7].get(), currentx, kIconVerticalOffset - 2, 0, kGamepadIconSize, kGamepadIconSize);
currentx+= kIconHorizontalOffset;
mFont->DrawString(_(kInterruptString), currentx, kIconVerticalOffset - 6);
mFont->DrawString(_(kInterruptString), currentx, kIconVerticalOffset - 8);
currentx+= mFont->GetStringWidth(_(kInterruptString).c_str()) + kBeforeIconSpace;
}
noBtnXOffset = static_cast<int>(currentx);
renderer->RenderQuad(pspIcons[4].get(), currentx, kIconVerticalOffset, 0, kGamepadIconSize, kGamepadIconSize);
renderer->RenderQuad(pspIcons[4].get(), currentx, kIconVerticalOffset - 2, 0, kGamepadIconSize, kGamepadIconSize);
currentx+= kIconHorizontalOffset;
mFont->DrawString(_(kNoString), currentx, kIconVerticalOffset - 6);
mFont->DrawString(_(kNoString), currentx, kIconVerticalOffset - 8);
currentx+= mFont->GetStringWidth(_(kNoString).c_str()) + kBeforeIconSpace;
noToAllBtnXOffset = static_cast<int>(currentx);
if (mObjects.size() > 1)
{
renderer->RenderQuad(pspIcons[6].get(), currentx, kIconVerticalOffset, 0, kGamepadIconSize, kGamepadIconSize);
renderer->RenderQuad(pspIcons[6].get(), currentx, kIconVerticalOffset - 2, 0, kGamepadIconSize, kGamepadIconSize);
currentx+= kIconHorizontalOffset;
mFont->DrawString(_(kNoToAllString), currentx, kIconVerticalOffset - 6);
mFont->DrawString(_(kNoToAllString), currentx, kIconVerticalOffset - 8);
currentx+= mFont->GetStringWidth(_(kNoToAllString).c_str()) + kBeforeIconSpace;
}
+163 -21
View File
@@ -390,8 +390,26 @@ int AACopier::resolve()
MTGCardInstance * _target = (MTGCardInstance *) target;
if (_target)
{
source->copy(_target);
MTGCard* clone = MTGCollection()->getCardById(_target->copiedID);
MTGCardInstance * myClone = NEW MTGCardInstance(clone, source->controller()->game);
source->copy(myClone);
source->isACopier = true;
source->copiedID = _target->copiedID;
source->modifiedbAbi = _target->modifiedbAbi;
source->origbasicAbilities = _target->origbasicAbilities;
if(_target->isMorphed)
{
source->power = 2;
source->life = 2;
source->toughness = 2;
source->setColor(0,1);
source->name = "Morph";
source->types.clear();
string cre = "Creature";
source->setType(cre.c_str());
source->basicAbilities.reset();
source->getManaCost()->resetCosts();
}
return 1;
}
return 0;
@@ -1160,14 +1178,14 @@ int GenericPaidAbility::resolve()
baseAbility->target = target;
optionalCost = ManaCost::parseManaCost(baseCost, NULL, source);
// hacky way to produce better MenuText
/*// hacky way to produce better MenuText
AAFakeAbility* isFake = dynamic_cast< AAFakeAbility* >( baseAbility );
size_t findPayN = isFake->named.find(" {value} mana");
if (isFake && findPayN != string::npos) {
stringstream parseN;
parseN << optionalCost->getCost(Constants::MTG_COLOR_ARTIFACT);
isFake->named.replace(findPayN + 1, 7, parseN.str());
}
}//commented out, it crashes cards with recover ability*/
MTGAbility * set = baseAbility->clone();
set->oneShot = true;
@@ -1721,8 +1739,8 @@ AAFrozen * AAFrozen::clone() const
}
// chose a new target for an aura or enchantment and equip it note: VERY basic right now.
AANewTarget::AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget, ManaCost * _cost) :
ActivatedAbility(observer, id, card, _cost, 0),retarget(retarget)
AANewTarget::AANewTarget(GameObserver* observer, int id, MTGCardInstance * card, MTGCardInstance * _target,bool retarget, ManaCost * _cost, bool reequip, bool newhook) :
ActivatedAbility(observer, id, card, _cost, 0),retarget(retarget),reequip(reequip),newhook(newhook)
{
target = _target;
}
@@ -1735,7 +1753,7 @@ int AANewTarget::resolve()
_target = source;
source = (MTGCardInstance *) target;
}
if (_target)
if (_target && !reequip)
{
while (_target->next)
_target = _target->next;
@@ -1772,6 +1790,37 @@ int AANewTarget::resolve()
}
}
if (_target && _target->currentZone == _target->controller()->game->battlefield && reequip)
{
if(!newhook)
{
_target = source;
source = (MTGCardInstance *) target;
}
else
{
while (_target->next)
_target = _target->next;
}
if(_target->hasSubtype(Subtypes::TYPE_EQUIPMENT))
{
for (size_t i = 1; i < game->mLayers->actionLayer()->mObjects.size(); i++)
{
MTGAbility * a = ((MTGAbility *) game->mLayers->actionLayer()->mObjects[i]);
AEquip * eq = dynamic_cast<AEquip*> (a);
if (eq && eq->source == _target)
{
((AEquip*)a)->unequip();
((AEquip*)a)->equip(source);
}
}
}
if(!newhook)
{
target = source;
source = _target;
}
}
return 1;
}
@@ -2069,16 +2118,16 @@ int AADynamic::resolve()
switch(type)
{
case DYNAMIC_ABILITY_TYPE_POWER:
sourceamount = ((MTGCardInstance *) source)->power;
targetamount = ((MTGCardInstance *) _target)->power;
sourceamount = ((MTGCardInstance *) source)->getCurrentPower();
targetamount = ((MTGCardInstance *) _target)->getCurrentPower();
if(eachother )
sourceamount = ((MTGCardInstance *) source)->power;
sourceamount = ((MTGCardInstance *) source)->getCurrentPower();
break;
case DYNAMIC_ABILITY_TYPE_TOUGHNESS:
sourceamount = ((MTGCardInstance *) source)->toughness;
targetamount = ((MTGCardInstance *) _target)->toughness;
sourceamount = ((MTGCardInstance *) source)->getCurrentToughness();
targetamount = ((MTGCardInstance *) _target)->getCurrentToughness();
if(eachother )
sourceamount = ((MTGCardInstance *) source)->toughness;
sourceamount = ((MTGCardInstance *) source)->getCurrentToughness();
break;
case DYNAMIC_ABILITY_TYPE_MANACOST:
if(amountsource == 1)
@@ -2520,6 +2569,10 @@ int AACloner::resolve()
// Use id of the card to have the same image as the original
MTGCard* clone = (_target->isToken ? _target: MTGCollection()->getCardById(_target->getId()));
// If its a copier then copy what it is
if(_target->isACopier)
clone = _target;
Player * targetPlayer = who == 1 ? source->controller()->opponent() : source->controller();
int tokenize = 1;//tokenizer support for cloning
@@ -2550,7 +2603,7 @@ int AACloner::resolve()
if(_target->pbonus > 0)
spell->source->power = _target->power - _target->pbonus;
else
spell->source->power = _target->power + _target->pbonus;
spell->source->power = _target->power + abs(_target->pbonus);
if(_target->tbonus > 0)
{
spell->source->toughness = _target->toughness - _target->tbonus;
@@ -2558,8 +2611,8 @@ int AACloner::resolve()
}
else
{
spell->source->toughness = _target->toughness + _target->tbonus;
spell->source->life = _target->toughness + _target->tbonus;
spell->source->toughness = _target->toughness + abs(_target->tbonus);
spell->source->life = _target->toughness + abs(_target->tbonus);
}
}
list<int>::iterator it;
@@ -2575,6 +2628,8 @@ int AACloner::resolve()
{
spell->source->addType(*it);
}
spell->source->modifiedbAbi = _target->modifiedbAbi;
spell->source->origbasicAbilities = _target->origbasicAbilities;
delete spell;
}
return 1;
@@ -2710,8 +2765,8 @@ AInstantCastRestrictionUEOT::~AInstantCastRestrictionUEOT()
//AAMover
AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost) :
ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName)
AAMover::AAMover(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target, string dest,string newName, ManaCost * _cost, bool undying, bool persist) :
ActivatedAbility(observer, _id, _source, _cost, 0), destination(dest),named(newName),undying(undying),persist(persist)
{
if (_target)
target = _target;
@@ -2758,6 +2813,10 @@ int AAMover::resolve()
andAbilityClone->addToGame();
}
}
if(persist)
spell->source->counters->addCounter(-1,-1);
if(undying)
spell->source->counters->addCounter(1,1);
delete spell;
return 1;
}
@@ -4157,6 +4216,7 @@ for (it = types.begin(); it != types.end(); it++)
for (it = abilities.begin(); it != abilities.end(); it++)
{
_target->basicAbilities.set(*it);
_target->modifiedbAbi += 1;
}
if(newAbilityFound)
@@ -4305,6 +4365,7 @@ int ATransformer::destroy()
for (it = abilities.begin(); it != abilities.end(); it++)
{
_target->basicAbilities.reset(*it);
_target->modifiedbAbi -= 1;
}
for (it = oldcolors.begin(); it != oldcolors.end(); it++)
@@ -4851,6 +4912,78 @@ AVanishing::~AVanishing()
{
}
//Produce Mana
AProduceMana::AProduceMana(GameObserver* observer, int _id, MTGCardInstance * _source, string ManaDescription) :
MTGAbility(observer, _id, source),ManaDescription(ManaDescription)
{
source = _source;
mana[0] = "{g}"; mana[1] = "{u}"; mana[2] = "{r}"; mana[3] = "{b}"; mana[4] = "{w}";
}
int AProduceMana::receiveEvent(WEvent * event)
{
if(WEventCardTappedForMana * isTappedForMana = dynamic_cast<WEventCardTappedForMana *> (event))
{
if ((isTappedForMana->card == source)||(isTappedForMana->card == source->target && ManaDescription == "selectmana"))
produce();
}
return 1;
}
int AProduceMana::produce()
{
if(ManaDescription == "selectmana")
{//I tried menu ability and vector<MTGAbility*abi> to have a shorter code but it crashes wagic at end of turn...
//The may ability on otherhand works but the ability is cumulative...
//This must be wrapped on menuability so we can use it on successions...
AManaProducer *ap0 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[0],NULL,source), NULL, 0,"",false);
MayAbility *mw0 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap0, source,true);
MTGAbility *ga0 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw0);
AManaProducer *ap1 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[1],NULL,source), NULL, 0,"",false);
MayAbility *mw1 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap1, source,true);
MTGAbility *ga1 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw1);
AManaProducer *ap2 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[2],NULL,source), NULL, 0,"",false);
MayAbility *mw2 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap2, source,true);
MTGAbility *ga2 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw2);
AManaProducer *ap3 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[3],NULL,source), NULL, 0,"",false);
MayAbility *mw3 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap3, source,true);
MTGAbility *ga3 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw3);
AManaProducer *ap4 = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(mana[4],NULL,source), NULL, 0,"",false);
MayAbility *mw4 = NEW MayAbility(game, game->mLayers->actionLayer()->getMaxId(), ap4, source,true);
MTGAbility *ga4 = NEW GenericAddToGame(game, game->mLayers->actionLayer()->getMaxId(), source,NULL,mw4);
ga0->resolve();
ga1->resolve();
ga2->resolve();
ga3->resolve();
ga4->resolve();
}
else
{
AManaProducer *amp = NEW AManaProducer(game, game->mLayers->actionLayer()->getMaxId(), source, source->controller(), ManaCost::parseManaCost(ManaDescription,NULL,source), NULL, 0,"",false);
amp->resolve();
}
return 1;
}
const string AProduceMana::getMenuText()
{
return "Produce Mana";
}
AProduceMana * AProduceMana::clone() const
{
return NEW AProduceMana(*this);
}
AProduceMana::~AProduceMana()
{
}
//AUpkeep
AUpkeep::AUpkeep(GameObserver* observer, int _id, MTGCardInstance * card, MTGAbility * a, ManaCost * _cost, int restrictions, int _phase,
int _once,bool Cumulative) :
@@ -5179,7 +5312,7 @@ void ABlink::returnCardIntoPlay(MTGCardInstance* _target) {
return;
}
MTGGameZone * inplay = spell->source->owner->game->inPlay;
/*MTGGameZone * inplay = spell->source->owner->game->inPlay;
spell->source->target = NULL;
for (int i = game->getRandomGenerator()->random()%inplay->nb_cards;;i = game->getRandomGenerator()->random()%inplay->nb_cards)
{
@@ -5193,7 +5326,16 @@ void ABlink::returnCardIntoPlay(MTGCardInstance* _target) {
this->forceDestroy = 1;
return;
}
}
}*/
//replaced with castcard(putinplay)
MTGAbility *a = NEW AACastCard(game, game->mLayers->actionLayer()->getMaxId(), Blinker, Blinker,false,false,false,"","Return to Play",false,true);
a->oneShot = false;
a->canBeInterrupted = false;
a->addToGame();
SAFE_DELETE(spell);
SAFE_DELETE(tc);
this->forceDestroy = 1;
return;
}
spell->source->power = spell->source->origpower;
spell->source->toughness = spell->source->origtoughness;
@@ -5541,7 +5683,7 @@ void AACastCard::Update(float dt)
toCheck->bypassTC = true;
TargetChooserFactory tcf(game);
TargetChooser * atc = tcf.createTargetChooser(toCheck->spellTargetType,toCheck);
if (toCheck->hasType(Subtypes::TYPE_AURA) && !atc->validTargetsExist())
if ((toCheck->hasType(Subtypes::TYPE_AURA) && !atc->validTargetsExist())||toCheck->isToken)
{
processed = true;
this->forceDestroy = 1;
@@ -5724,7 +5866,7 @@ const string AACastCard::getMenuText()
return nameThis.c_str();
if(putinplay)
return "Put Into Play";
return "Cast For Free";
return "Cast Card";
}
AACastCard * AACastCard::clone() const
+1 -1
View File
@@ -267,7 +267,7 @@ void CardDisplay::Render()
int drawMode = DrawMode::kNormal;
if (observer)
{
pos.actY = 150;
pos.actY = 145;
if (x < (CardGui::BigWidth / 2)) pos.actX = SCREEN_WIDTH - 10 - CardGui::BigWidth / 2;
drawMode = observer->getCardSelector()->GetDrawMode();
}
+88 -9
View File
@@ -111,17 +111,17 @@ void CardGui::Update(float dt)
PlayGuiObject::Update(dt);
}
void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb)
void CardGui::DrawCard(const Pos& inPosition, int inMode, bool thumb, bool noborder)
{
DrawCard(card, inPosition, inMode, thumb);
DrawCard(card, inPosition, inMode, thumb, noborder);
}
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb)
void CardGui::DrawCard(MTGCard* inCard, const Pos& inPosition, int inMode, bool thumb, bool noborder)
{
switch (inMode)
{
case DrawMode::kNormal:
RenderBig(inCard, inPosition, thumb);
RenderBig(inCard, inPosition, thumb, noborder);
break;
case DrawMode::kText:
AlternateRender(inCard, inPosition);
@@ -237,6 +237,31 @@ void CardGui::Render()
if (quad)
{
quad->SetColor(ARGB(static_cast<unsigned char>(actA),255,255,255));
//fake border...
JQuadPtr fakeborder;
JQuadPtr highlightborder;
fakeborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white");
highlightborder = game? game->getResourceManager()->GetQuad("white"):WResourceManager::Instance()->GetQuad("white");
if(fakeborder)
{
fakeborder->SetColor(ARGB((int)(actA),15,15,15));
renderer->RenderQuad(fakeborder.get(), actX, actY, actT, (29 * actZ + 1) / 16, 42 * actZ / 16);
}
//draw border for highlighting
if (game)
{
if (card && card->isTargetted() && highlightborder)
{
highlightborder->SetColor(ARGB(95,255,0,0));
renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16);
}
if (card && card->isTargetter() && highlightborder)
{
highlightborder->SetColor(ARGB(95,0,245,0));
renderer->RenderQuad(highlightborder.get(), actX, actY, actT, (30 * actZ + 1) / 16, 43 * actZ / 16);
}
}
//draw the card image
renderer->RenderQuad(quad.get(), actX, actY, actT, scale, scale);
}
@@ -267,7 +292,7 @@ void CardGui::Render()
}
JQuadPtr mor;
if(card->isMorphed && !alternate)
if((card->isMorphed||(card->name == "Morph" && card->isACopier)) && !alternate)
{
mor = card->getObserver()->getResourceManager()->RetrieveTempQuad("morph.jpg");
if (mor && mor->mTex) {
@@ -277,14 +302,45 @@ void CardGui::Render()
}
}
//draw line
if (game)
{
if (card && card->isTargetted())
{
if(card->isTapped())
{
if(mHasFocus)
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0));
else
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,255,0,0));
}
else
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,255,0,0));
}
if (card && card->isTargetter())
{
if(card->isTapped())
{
if(mHasFocus)
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-10,actY - (scale * quad->mHeight / 2)+6.5f, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0));
else
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-8,actY - (scale * quad->mHeight / 2)+4, (scale * quad->mHeight)-0.02f, (scale * quad->mWidth)-0.02f, 1.8f,ARGB(250,0,255,0));
}
else
renderer->DrawRoundRect(actX - (scale * quad->mWidth / 2)-2,actY - (scale * quad->mHeight / 2)-2, (scale * quad->mWidth)-0.02f, (scale * quad->mHeight)-0.02f, 1.8f,ARGB(250,0,255,0));
}
}
//draws the numbers power/toughness
if (card->isCreature())
{
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
char buffer[200];
sprintf(buffer, "%i/%i", card->power, card->life);
renderer->FillRect(actX - (12 * actZ), actY + 6 * actZ, 25 * actZ, 12 * actZ,
renderer->FillRect(actX - (13 * actZ), actY + 4 * actZ, 25.5f * actZ, 14 * actZ,
ARGB(((static_cast<unsigned char>(actA))/2),0,0,0));
renderer->DrawRect(actX - (13 * actZ), actY + 4 * actZ, 25.5f * actZ, 14 * actZ,
ARGB(((static_cast<unsigned char>(actA))),20,20,20));
//damaged or buffed or powered down
if(card->wasDealtDamage && card->life <= 2)
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),255,0,0));//red critical and damaged
@@ -298,7 +354,7 @@ void CardGui::Render()
mFont->SetColor(ARGB(static_cast<unsigned char>(actA),255,255,255));//white default
mFont->SetScale(actZ);
mFont->SetScale(actZ);
mFont->DrawString(buffer, actX - 10 * actZ, actY + 8 * actZ);
mFont->DrawString(buffer, actX - 10 * actZ, actY + 7 * actZ);
mFont->SetScale(1);
}
@@ -988,7 +1044,7 @@ void CardGui::TinyCropRender(MTGCard * card, const Pos& pos, JQuad * quad)
}
//Renders a big card on screen. Defaults to the "alternate" rendering if no image is found
void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb)
void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb, bool noborder)
{
JRenderer * renderer = JRenderer::GetInstance();
//GameObserver * game = GameObserver::GetInstance();
@@ -1013,7 +1069,30 @@ void CardGui::RenderBig(MTGCard* card, const Pos& pos, bool thumb)
}
quad->SetColor(ARGB(255,255,255,255));
float scale = pos.actZ * 250.f / quad->mHeight;
renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale);
//init setname
string cardsetname = setlist[card->setId].c_str();
if(!noborder)
{
if(cardsetname == "2ED"||cardsetname == "RV"||cardsetname == "4ED"||cardsetname == "5ED"||cardsetname == "6ED"||cardsetname == "7ED"||cardsetname == "8ED"||cardsetname == "9ED"||cardsetname == "CHR")
{
//like white border
renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,248,248,255));
//black thin line to simulate card edge
renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(150,20,20,20));
}
else
{
//like black border
renderer->FillRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(255,10,10,10));
//white thin line to simulate card edge
renderer->DrawRoundRect(x-92,pos.actY-130, (scale * quad->mWidth)-10, (scale * quad->mHeight)-11, 9.0f,ARGB(50,240,240,240));
}
//render card image
renderer->RenderQuad(quad.get(), x, pos.actY-2, pos.actT, scale-0.02f, scale-0.02f);
}
else
renderer->RenderQuad(quad.get(), x, pos.actY, pos.actT, scale, scale);
RenderCountersBig(card, pos);
return;
}
+3
View File
@@ -41,6 +41,8 @@ CardPrimitive::CardPrimitive(CardPrimitive * source)
if(!source)
return;
basicAbilities = source->basicAbilities;
origbasicAbilities = source->basicAbilities;
LKIbasicAbilities = source->basicAbilities;
for (size_t i = 0; i < source->types.size(); ++i)
types.push_back(source->types[i]);
@@ -76,6 +78,7 @@ CardPrimitive::~CardPrimitive()
int CardPrimitive::init()
{
basicAbilities.reset();
origbasicAbilities.reset();
types.clear();
+2 -2
View File
@@ -176,7 +176,7 @@ bool CardSelector::CheckUserInput(JButton key)
return true;
}
Target* oldactive = active;
timer = 250;
timer = 800;
int x,y;
JGE* jge = observer->getInput();
if(!jge) return false;
@@ -306,7 +306,7 @@ switch_active:
}
else
{
timer = 250;
timer = 800;
}
return true;
}
+5
View File
@@ -78,6 +78,11 @@ int Damage::resolve()
damage = 0;
//rulings = 10/4/2004 The damage prevention ability works even if it has no counters, as long as some effect keeps its toughness above zero.
//these creature are essentially immune to damage. however 0/-1 effects applied through lords or counters can kill them.
if ((_target)->has(Constants::PROTECTIONFROMCOLOREDSPELLS))
{//damage is prevented as long as the damage source is a spell on the stack...
if((source->currentZone == source->controller()->opponent()->game->stack||source->currentZone == source->controller()->game->stack) && (source->hasColor(1)||source->hasColor(2)||source->hasColor(3)||source->hasColor(4)||source->hasColor(5)))
damage = 0;
}
if ((_target)->has(Constants::PHANTOM))
{
damage = 0;
+2
View File
@@ -276,6 +276,8 @@ void DeckMenu::Render()
JQuadPtr quad = WResourceManager::Instance()->RetrieveTempQuad(currentAvatarImageName, TEXTURE_SUB_AVATAR);
if(quad.get())
{
quad->mWidth = 35.f;
quad->mHeight = 50.f;
if (currentMenuItem->getText() == "Evil Twin")
{
JQuad * evil = quad.get();
+5 -4
View File
@@ -133,13 +133,13 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail)
else
{
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
CardGui::DrawCard(cardPosition.card, pos, asThumbnail);
CardGui::DrawCard(cardPosition.card, pos, asThumbnail, true);
}
}
else
{
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
CardGui::DrawCard(cardPosition.card, pos, DrawMode::kText, asThumbnail);
CardGui::DrawCard(cardPosition.card, pos, DrawMode::kText, asThumbnail, true);
}
}
else
@@ -147,9 +147,10 @@ void DeckView::renderCard(int index, int alpha, bool asThumbnail)
int mode = !options[Options::DISABLECARDS].number ? DrawMode::kNormal : DrawMode::kText;
Pos pos = Pos(cardPosition.x, cardPosition.y, cardPosition.scale * 285 / 250, 0.0, 255);
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail);
CardGui::DrawCard(cardPosition.card, pos, mode, asThumbnail, true);
}
//the three DrawCard function above, I intentionally disabled the rendered border when in Deck Editor since the border must be dynamically resized
//we can pass variables so the DrawCard method knows what to do to the border but... there must be a better way to do it...
int quadAlpha = alpha;
if (!deck()->count(cardPosition.card)) quadAlpha /= 2;
quadAlpha = 255 - quadAlpha;
+4
View File
@@ -39,6 +39,7 @@ bool GameApp::HasMusic = true;
JMusic * GameApp::music = NULL;
string GameApp::currentMusicFile = "";
string GameApp::systemError = "";
char GameApp::mynbcardsStr[512] = {0};
vector<JQuadPtr > manaIcons;
@@ -173,6 +174,9 @@ void GameApp::Create()
LOG("Loading Textures");
LOG("--Loading menuicons.png");
WResourceManager::Instance()->RetrieveTexture("menuicons.png", RETRIEVE_MANAGE);
#if !defined (PSP)
WResourceManager::Instance()->RetrieveTexture("miconslarge.png", RETRIEVE_MANAGE);
#endif
LOG("---Gettings menuicons.png quads");
//Load all icons from gModRules and save in manaIcons -> todo. Change the icons positions on menuicons.png to avoid use item->mColorId
+30 -1
View File
@@ -204,6 +204,8 @@ void GameObserver::nextGamePhase()
cleanupPhase();
currentPlayer->damageCount = 0;
currentPlayer->drawCounter = 0;
currentPlayer->raidcount = 0;
currentPlayer->opponent()->raidcount = 0;
currentPlayer->prowledTypes.clear();
currentPlayer->opponent()->damageCount = 0; //added to clear odcount
currentPlayer->preventable = 0;
@@ -590,6 +592,25 @@ void GameObserver::gameStateBasedEffects()
{
if(getCurrentTargetChooser() && int(getCurrentTargetChooser()->getNbTargets()) == getCurrentTargetChooser()->maxtargets)
getCurrentTargetChooser()->done = true;
/////////////////////////////////////
for (int d = 0; d < 2; d++)
{
MTGGameZone * dzones[] = { players[d]->game->inPlay, players[d]->game->graveyard, players[d]->game->hand, players[d]->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0)
{
for (int c = zone->nb_cards - 1; c >= 0; c--)
{
zone->cards[c]->cardistargetted = 0;
zone->cards[c]->cardistargetter = 0;
}
}
}//check for losers if its GAMEOVER clear the stack to allow gamestateeffects to continue
players[d]->DeadLifeState();
}
////////////////////////////////////
if (mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0)
return;
@@ -608,6 +629,9 @@ void GameObserver::gameStateBasedEffects()
for (int j = zone->nb_cards - 1; j >= 0; j--)
{
MTGCardInstance * card = zone->cards[j];
card->LKIpower = card->power;
card->LKItoughness = card->toughness;
card->LKIbasicAbilities = card->basicAbilities;
card->afterDamage();
card->mPropertiesChangedSinceLastUpdate = false;
if(card->hasType(Subtypes::TYPE_PLANESWALKER) && (!card->counters||!card->counters->hasCounter("loyalty",0,0)))
@@ -761,7 +785,7 @@ void GameObserver::gameStateBasedEffects()
///////////////////////////////////////////////////////////
//life checks/poison checks also checks cant win or lose.//
///////////////////////////////////////////////////////////
players[i]->DeadLifeState();//refactored
players[i]->DeadLifeState(true);//refactored
}
//////////////////////////////////////////////////////
//-------------card based states effects------------//
@@ -824,6 +848,11 @@ void GameObserver::gameStateBasedEffects()
}
}
if(c->modifiedbAbi > 0)
{
c->modifiedbAbi = 0;
c->basicAbilities = c->origbasicAbilities;
}
if(nbcards > z->nb_cards)
{
t = 0;
+18 -10
View File
@@ -85,10 +85,19 @@ void GameStateMenu::Create()
{
for (int j = 0; j < 2; j++)
{
#if defined (PSP)
sprintf(buf, "menuicons%d%d", i, j);
mIcons[n] = WResourceManager::Instance()->RetrieveQuad("menuicons.png", 2 + i * 36.0f, 2.0f + j * 36.0f, 32.0f, 32.0f, buf);
#else
sprintf(buf, "miconslarge%d%d", i, j);
mIcons[n] = WResourceManager::Instance()->RetrieveQuad("miconslarge.png", 4 + i * 72.0f, 4.0f + j * 72.0f, 72.0f, 72.0f, buf);
#endif
if (mIcons[n])
{
mIcons[n]->mHeight = 36.f;
mIcons[n]->mWidth = 36.f;
mIcons[n]->SetHotSpot(16, 16);
}
n++;
}
}
@@ -141,10 +150,10 @@ void GameStateMenu::Start()
WResourceManager::Instance()->ClearUnlocked();
bgTexture = WResourceManager::Instance()->RetrieveTexture("menutitle.png", RETRIEVE_LOCK);
mBg = WResourceManager::Instance()->RetrieveQuad("menutitle.png", 0, 0, 256, 166); // Create background quad for rendering.
mBg = WResourceManager::Instance()->RetrieveQuad("menutitle.png", 0, 0, 0, 0); // Create background quad for rendering.
if (mBg)
mBg->SetHotSpot(128, 50);
mBg->SetHotSpot(0, 0);
if (MENU_STATE_MAJOR_MAINMENU == currentState)
currentState = currentState | MENU_STATE_MINOR_FADEIN;
@@ -160,22 +169,22 @@ void GameStateMenu::genNbCardsStr()
PlayerData * playerdata = NEW PlayerData(MTGCollection());
size_t totalUnique = MTGCollection()->primitives.size();
size_t totalPrints = MTGCollection()->totalCards();
if (totalUnique != totalPrints)
{
if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
sprintf(nbcardsStr, _("%s: %i cards (%i) (%i unique)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
sprintf(GameApp::mynbcardsStr, _("%s: %i cards (%i) (%i unique)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
playerdata->collection->totalCards(), totalPrints,totalUnique);
else
sprintf(nbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique);
sprintf(GameApp::mynbcardsStr, _("%i cards (%i unique)").c_str(),totalPrints,totalUnique);
}
else
{
if (playerdata && !options[Options::ACTIVE_PROFILE].isDefault())
sprintf(nbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
sprintf(GameApp::mynbcardsStr, _("%s: %i cards (%i)").c_str(), options[Options::ACTIVE_PROFILE].str.c_str(),
playerdata->collection->totalCards(), totalPrints);
else
sprintf(nbcardsStr, _("%i cards").c_str(),totalPrints);
sprintf(GameApp::mynbcardsStr, _("%i cards").c_str(),totalPrints);
}
SAFE_DELETE(playerdata);
@@ -726,7 +735,7 @@ void GameStateMenu::RenderTopMenu()
mFont->SetScale(DEFAULT_MAIN_FONT_SCALE);
mFont->SetColor(ARGB(128,255,255,255));
mFont->DrawString(GAME_VERSION, rightTextPos, 5, JGETEXT_RIGHT);
mFont->DrawString(nbcardsStr, leftTextPos, 5);
mFont->DrawString(GameApp::mynbcardsStr, leftTextPos, 5);
renderer->FillRect(leftTextPos, 26, 104, 8, ARGB(255, 100, 90, 60));
renderer->FillRect(leftTextPos + 2, 28, (float)(gamePercentComplete()), 4, ARGB(255,220,200, 125));
char buf[512];
@@ -790,7 +799,7 @@ void GameStateMenu::Render()
scroller->Render();
if (mBg.get())
renderer->RenderQuad(mBg.get(), SCREEN_WIDTH / 2, 50);
renderer->RenderQuad(mBg.get(), (SCREEN_WIDTH/4)-6, 2, 0, 256 / mBg->mWidth, 166 / mBg->mHeight);
RenderTopMenu();
@@ -960,7 +969,6 @@ ostream& GameStateMenu::toString(ostream& out) const
<< " ; mCreditsYPos : " << mCreditsYPos
<< " ; currentState : " << currentState
<< " ; mVolume : " << mVolume
<< " ; nbcardsStr : " << nbcardsStr
<< " ; mCurrentSetName : " << mCurrentSetName
<< " ; mCurrentSetFileName : " << mCurrentSetFileName
<< " ; mReadConf : " << mReadConf
+2
View File
@@ -1,6 +1,7 @@
#include "PrecompiledHeader.h"
#include "GameStateOptions.h"
#include "GameStateMenu.h"
#include "GameApp.h"
#include "OptionItem.h"
#include "SimpleMenu.h"
@@ -167,6 +168,7 @@ void GameStateOptions::Update(float dt)
JSoundSystem::GetInstance()->SetMusicVolume(options[Options::MUSICVOLUME].number);
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
mState = SHOW_OPTIONS;
GameStateMenu::genNbCardsStr();
break;
case WGuiBase::CONFIRM_NEED:
optionsTabs->yieldFocus();
+2
View File
@@ -5,6 +5,7 @@
#include <JRenderer.h>
#include "GameStateShop.h"
#include "GameStateMenu.h"
#include "GameApp.h"
#include "MTGDeck.h"
#include "MTGPack.h"
@@ -840,6 +841,7 @@ void GameStateShop::ButtonPressed(int controllerId, int controlId)
mStage = STAGE_SHOP_SHOP;
mParent->DoTransition(TRANSITION_FADE, GAME_STATE_MENU);
save();
GameStateMenu::genNbCardsStr();
break;
case 14:
mStage = STAGE_SHOP_TASKS;
+3 -1
View File
@@ -30,6 +30,8 @@ void GuiBackground::Render()
}
if (quad.get())
{
renderer->RenderQuad(quad.get(), 0, 18);
quad->mWidth = 480.f;
quad->mHeight = 272.f;
renderer->RenderQuad(quad.get(), 0, 0);
}
}
+3 -1
View File
@@ -483,6 +483,8 @@ void GuiCombat::Render()
}
else
{
observer->opponent()->getIcon()->mHeight = 50.f;
observer->opponent()->getIcon()->mWidth = 35.f;
observer->opponent()->getIcon()->SetHotSpot(18, 25);
enemy_avatar.Render(observer->opponent()->getIcon().get());
}
@@ -502,7 +504,7 @@ void GuiCombat::Render()
ok_quad->SetHotSpot(28, 22);
ok.Render(ok_quad.get());
}
renderer->DrawLine(0, SCREEN_HEIGHT / 2 + 10, SCREEN_WIDTH, SCREEN_HEIGHT / 2 + 10, ARGB(255, 255, 64, 0));
renderer->DrawLine(0, SCREEN_HEIGHT / 2, SCREEN_WIDTH, SCREEN_HEIGHT / 2, ARGB(255, 255, 64, 0));
if (FIRST_STRIKE == step)
{
WFont * mFont = WResourceManager::Instance()->GetWFont(Fonts::MAIN_FONT);
+19 -15
View File
@@ -6,16 +6,20 @@
GuiFrame::GuiFrame(GameObserver* observer)
: GuiLayer(observer)
{
if (observer->getResourceManager())
{
if (observer->getResourceManager()->GetTexture("wood.png"))
wood = observer->getResourceManager()->RetrieveQuad("wood.png", 0, 0, SCREEN_WIDTH, 28);
//if (observer->getResourceManager())
//{
/*if (observer->getResourceManager()->GetTexture("wood.png"))
{
wood = observer->getResourceManager()->RetrieveQuad("wood.png", 0, 0, 0, 0);
wood->mHeight = 32.f;
wood->mWidth = 480.f;
}
else
{
GameApp::systemError += "Can't load wood texture : " __FILE__ "\n";
}
}*/
if (observer->getResourceManager()->GetTexture("gold.png"))
/*if (observer->getResourceManager()->GetTexture("gold.png"))
{
gold1 = observer->getResourceManager()->RetrieveQuad("gold.png", 0, 0, SCREEN_WIDTH, 6, "gold1");
gold2 = observer->getResourceManager()->RetrieveQuad("gold.png", 0, 6, SCREEN_WIDTH, 6, "gold2");
@@ -26,9 +30,9 @@ GuiFrame::GuiFrame(GameObserver* observer)
gold2->SetColor(ARGB(127, 255, 255, 255));
gold2->SetHFlip(true);
}
}
}
step = 0.0;
}*/
//}
//step = 0.0;
}
@@ -38,12 +42,12 @@ GuiFrame::~GuiFrame()
void GuiFrame::Render()
{
JRenderer* renderer = JRenderer::GetInstance();
/*JRenderer* renderer = JRenderer::GetInstance();
float sized = step / 4;
if (sized > SCREEN_WIDTH)
sized -= SCREEN_WIDTH;
renderer->RenderQuad(wood.get(), 0, 0);
if (gold1.get())
renderer->RenderQuad(wood.get(), 0, 0);*/
/*if (gold1.get())
{
renderer->RenderQuad(gold1.get(), -sized, 16);
renderer->RenderQuad(gold1.get(), -sized + 479, 16);
@@ -60,12 +64,12 @@ void GuiFrame::Render()
renderer->RenderQuad(gold2.get(), step / 2, 16);
renderer->RenderQuad(gold2.get(), step / 2 - 479, 16);
}
}
}*/
}
void GuiFrame::Update(float dt)
{
step += dt * 5;
/*step += dt * 5;
if (step > 2 * SCREEN_WIDTH)
step -= 2 * SCREEN_WIDTH;
step -= 2 * SCREEN_WIDTH;*/
}
+4 -4
View File
@@ -262,7 +262,7 @@ void GuiMana::RenderStatic()
float x0 = x - 20 * totalColors;
x0 = max(40.f, x0);
float xEnd = x0 + 20 * totalColors;
r->FillRoundRect(x0, y - 5, static_cast<float> (20 * totalColors + 5), 20, 2, ARGB(128,0,0,0));
r->FillRoundRect(x0, y - 8, static_cast<float> (20 * totalColors + 5), 20, 2, ARGB(128,0,0,0));
int offset = 0;
for (int i = 0; i < Constants::NB_Colors; ++i)
@@ -270,10 +270,10 @@ void GuiMana::RenderStatic()
if (values[i])
{
offset -= 20;
r->RenderQuad(manaIcons[i].get(), xEnd + 15 + offset, y + 5, 0, 0.7f, 0.7f);
r->RenderQuad(manaIcons[i].get(), xEnd + 15 + offset, y + 3, 0, 0.65f, 0.65f);
}
}
r->FillRoundRect(x0, y, static_cast<float> (20 * totalColors + 5), 8, 2, ARGB(100,0,0,0));
//r->DrawRoundRect(x0, y - 8, static_cast<float> (20 * totalColors + 5), 20, 2, ARGB(128,255,255,255));
offset = 0;
for (int i = 0; i < Constants::NB_Colors; ++i)
{
@@ -283,7 +283,7 @@ void GuiMana::RenderStatic()
char buf[4];
sprintf(buf, "%i", values[i]);
mFont->SetColor(ARGB(255,255,255,255));
mFont->DrawString(buf, xEnd + offset + 9, y);
mFont->DrawString(buf, xEnd + offset + 18, y + 5);
}
}
}
+7 -4
View File
@@ -24,7 +24,7 @@
};
*/
const float GuiPhaseBar::zoom_big = (float)(1.5 * 1.4);
const float GuiPhaseBar::zoom_big = (float)(1.5 * 1.25);
const float GuiPhaseBar::zoom_small = 1.5;
const float GuiPhaseBar::step = M_PI/6.0f;
@@ -36,9 +36,9 @@ namespace
const unsigned kPhases = NB_MTG_PHASES - 2; //there are two phases we do not show
}
void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale)
void GuiPhaseBar::DrawGlyph(JQuad *inQuad, int phaseId, float x, float y, float scale, float z)
{
inQuad->SetTextureRect(phaseId * (kWidth + 1), 0, kWidth, kHeight);
inQuad->SetTextureRect(phaseId * (kWidth + 1), z, kWidth, kHeight);
JRenderer::GetInstance()->RenderQuad(inQuad, x, y - scale * kWidth/2, 0.0f, scale, scale);
}
@@ -110,7 +110,10 @@ void GuiPhaseBar::Render()
//hint: sin(circPos + PI/2) = cos(circPos)
const float glyphScale = float(zoomFactor * cosf(circPos) * 0.5f);
DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale);
if (observer->currentPlayer && observer->currentPlayer->isAI() && !observer->currentPlayer->opponent()->isAI())
DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale, 29);
else
DrawGlyph(quad.get(), (displayedPhaseId - 2 + i + kPhases) % kPhases, 0, glyphY, glyphScale, 0);
}
//print phase name
+9 -3
View File
@@ -106,7 +106,7 @@ GuiPlay::BattleField::BattleField() :
attackers(0), height(0.0), red(0), colorFlow(0)
{
}
const float GuiPlay::BattleField::HEIGHT = 80.0f;
const float GuiPlay::BattleField::HEIGHT = 146.0f;
void GuiPlay::BattleField::addAttacker(MTGCardInstance*)
{
++attackers;
@@ -160,7 +160,11 @@ void GuiPlay::BattleField::Update(float dt)
void GuiPlay::BattleField::Render()
{
if (height > 3)
JRenderer::GetInstance()->FillRect(44, SCREEN_HEIGHT / 2 + 10 - height / 2, 318, height, ARGB(127, red, 0, 0));
{
JRenderer::GetInstance()->FillRect(0, SCREEN_HEIGHT / 2 + 8.5f - height / 2, 480, height, ARGB(127, red, 0, 0));
if(red > 1)
JRenderer::GetInstance()->DrawRect(-2, SCREEN_HEIGHT / 2 + 8.5f - height / 2, 484, height, ARGB(255, 255, 165, 0));
}
}
GuiPlay::GuiPlay(DuelLayers* view) :
@@ -270,7 +274,7 @@ void GuiPlay::Replace()
//rerun the iter reattaching planes walkers to the back of the lands.
for (iterator it = end_spells; it != cards.end(); ++it)
{
if ((*it)->card->hasType(Subtypes::TYPE_PLANESWALKER))
if ((*it)->card->hasType(Subtypes::TYPE_PLANESWALKER) && !(*it)->card->isCreature())
{
if (mpDuelLayers->getRenderedPlayer() == (*it)->card->controller())
selfLands.Enstack(*it);
@@ -408,6 +412,8 @@ int GuiPlay::receiveEventPlus(WEvent * e)
Replace();
else if (dynamic_cast<WEventCardUnattached*> (e))
Replace();
else if (dynamic_cast<WEventCardControllerChange*> (e))
Replace();
Replace();
return 0;
}
+19 -8
View File
@@ -60,8 +60,8 @@ void GuiAvatar::Render()
{
if (corner == BOTTOM_RIGHT)
{
x0 -= player->getIcon()->mWidth * actZ;
y0 -= player->getIcon()->mHeight * actZ;
x0 -= Width * actZ;
y0 -= Height * actZ;
}
switch (corner)
{
@@ -69,14 +69,14 @@ void GuiAvatar::Render()
player->getIcon()->SetHotSpot(0, 0);
break;
case BOTTOM_RIGHT:
player->getIcon()->SetHotSpot(35, 50);
player->getIcon()->SetHotSpot(player->getIcon()->mWidth, player->getIcon()->mHeight);
break;
}
player->getIcon()->SetColor(ARGB((int)actA, 255, avatarRed, avatarRed));
r->RenderQuad(player->getIcon().get(), actX, actY, actT, actZ, actZ);
r->RenderQuad(player->getIcon().get(), actX, actY, actT, Width/player->getIcon()->mWidth*actZ, Height/player->getIcon()->mHeight*actZ);
if (mHasFocus)
{
r->FillRect(x0, x0, player->getIcon()->mWidth * actZ, player->getIcon()->mHeight * actZ, ARGB(abs(128 - wave),255,255,255));
r->FillRect(x0, x0, Width/player->getIcon()->mWidth * actZ, Height/player->getIcon()->mHeight * actZ, ARGB(abs(128 - wave),255,255,255));
}
}
@@ -96,18 +96,29 @@ void GuiAvatar::Render()
//Life
char buffer[10];
int lx = 255, ly = 255, lz = 255;
if(life > 24) { lx = 127; ly = 255; lz = 212; }
if(life > 16 && life < 24) { lx = 255; ly = 255; lz = 255; }
if(life > 12 && life < 17) { lx = 255; ly = 255; lz = 105; }
if(life > 8 && life < 13) { lx = 255; ly = 255; lz = 13; }
if(life > 4 && life < 9) { lx = 255; ly = 166; lz = 0; }
if(life < 5) { lx = 255; ly = 40; lz = 0; }
sprintf(buffer, "%i", life);
switch (corner)
{
case TOP_LEFT:
mFont->SetColor(ARGB((int)actA / 4, 0, 0, 0));
mFont->DrawString(buffer, actX + 2, actY + 2);
mFont->SetColor(ARGB((int)actA, 255, 255, 255));
mFont->SetScale(1.3f);
mFont->SetColor(ARGB((int)actA, lx, ly, lz));
mFont->DrawString(buffer, actX + 1, actY + 1);
mFont->SetScale(1);
break;
case BOTTOM_RIGHT:
mFont->SetColor(ARGB((int)actA, 255, 255, 255));
mFont->DrawString(buffer, actX, actY - 10, JGETEXT_RIGHT);
mFont->SetScale(1.3f);
mFont->SetColor(ARGB((int)actA, lx, ly, lz));
mFont->DrawString(buffer, actX, actY - 14, JGETEXT_RIGHT);
mFont->SetScale(1);
break;
}
//poison
+132 -32
View File
@@ -411,6 +411,20 @@ int AbilityFactory::parseCastRestrictions(MTGCardInstance * card, Player * playe
}
}
check = restriction[i].find("discarded");
if(check != string::npos)
{
if(!card->discarded)
return 0;
}
check = restriction[i].find("raid");
if(check != string::npos)
{
if(card->controller()->raidcount < 1)
return 0;
}
check = restriction[i].find("ownerscontrol");
if(check != string::npos)
{
@@ -811,7 +825,16 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
attackingTrigger,attackedAloneTrigger,notBlockedTrigger,attackBlockedTrigger,blockingTrigger);
}
//Card card is drawn
//drawn player - controller of card - dynamic version drawof(player) -> returns current controller even with exchange of card controller
if (TargetChooser * tc = parseSimpleTC(s, "drawof", card))
return NEW TrcardDrawn(observer, id, card, tc,once,true,false);
//drawn player - opponent of card controller - dynamic version drawfoeof(player) -> returns current opponent even with exchange of card controller
if (TargetChooser * tc = parseSimpleTC(s, "drawfoeof", card))
return NEW TrcardDrawn(observer, id, card, tc,once,false,true);
//Card card is drawn - static version - drawn(player) - any player; drawn(controller) - owner forever; drawn(opponent) - opponent forever
if (TargetChooser * tc = parseSimpleTC(s, "drawn", card))
return NEW TrcardDrawn(observer, id, card, tc,once);
@@ -827,35 +850,105 @@ TriggeredAbility * AbilityFactory::parseTrigger(string s, string, int id, Spell
if (TargetChooser * tc = parseSimpleTC(s, "cycled", card))
return NEW TrCardDiscarded(observer, id, card, tc,once,true);
//Card Damaging non combat
//Card Damaging non combat current controller
if (TargetChooser * tc = parseSimpleTC(s, "noncombatdamageof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 2,false,false,once,true,false);
}
//Card Damaging non combat current opponent
if (TargetChooser * tc = parseSimpleTC(s, "noncombatdamagefoeof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 2,false,false,once,false,true);
}
//Card Damaging non combat static
if (TargetChooser * tc = parseSimpleTC(s, "noncombatdamaged", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 2,once);
}
//Card Damaging combat
//Card Damaging combat current controller
if (TargetChooser * tc = parseSimpleTC(s, "combatdamageof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 1,sourceUntapped,limitOnceATurn,once,true,false);
}
//Card Damaging combat current opponent
if (TargetChooser * tc = parseSimpleTC(s, "combatdamagefoeof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 1,sourceUntapped,limitOnceATurn,once,false,true);
}
//Card Damaging combat static
if (TargetChooser * tc = parseSimpleTC(s, "combatdamaged", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 1,sourceUntapped,limitOnceATurn,once);
}
//Card Damaging
//Card Damaging current controller
if (TargetChooser * tc = parseSimpleTC(s, "damageof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 0,sourceUntapped,limitOnceATurn,once,true,false);
}
//Card Damaging current opponent
if (TargetChooser * tc = parseSimpleTC(s, "damagefoeof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 0,sourceUntapped,limitOnceATurn,once,false,true);
}
//Card Damaging static
if (TargetChooser * tc = parseSimpleTC(s, "damaged", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrDamaged(observer, id, card, tc, fromTc, 0,sourceUntapped,limitOnceATurn,once);
}
//Lifed
//Lifed current controller
if (TargetChooser * tc = parseSimpleTC(s, "lifeof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0,sourceUntapped,once,true,false);
}
//Lifed current opponent
if (TargetChooser * tc = parseSimpleTC(s, "lifefoeof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0,sourceUntapped,once,false,true);
}
//Lifed static
if (TargetChooser * tc = parseSimpleTC(s, "lifed", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrLifeGained(observer, id, card, tc, fromTc, 0,sourceUntapped,once);
}
//Life Loss
//Life Loss current player
if (TargetChooser * tc = parseSimpleTC(s, "lifelostof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrLifeGained(observer, id, card, tc, fromTc,1,sourceUntapped,once,true,false);
}
//Life Loss current opponent
if (TargetChooser * tc = parseSimpleTC(s, "lifelostfoeof", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
return NEW TrLifeGained(observer, id, card, tc, fromTc,1,sourceUntapped,once,false,true);
}
//Life Loss static
if (TargetChooser * tc = parseSimpleTC(s, "lifeloss", card))
{
TargetChooser *fromTc = parseSimpleTC(s, "from", card);
@@ -2652,6 +2745,24 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return NEW AEvolveAbility(observer, id, card);
}
//produce additional mana when tapped for mana
if (s.find("produceextra:") != string::npos)
{
return NEW AProduceMana(observer, id, card,s.substr(13));
}
//produce additional mana when a mana is engaged
if (s.find("producecolor:") != string::npos)
{
return NEW AEngagedManaAbility(observer, id, card,s.substr(13));
}
//reducelife to specific value
if (s.find("reduceto:") != string::npos)
{
return NEW AReduceToAbility(observer, id, card,s.substr(9));
}
//flanking
if (s.find("flanker") != string::npos)
{
@@ -3083,7 +3194,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a;
}
//get a new target
//get a new target - retarget and newtarget makes the card refreshed - from exile to play...
if ((s.find("retarget") != string::npos) || s.find("newtarget") != string::npos)
{
MTGAbility * a = NEW AANewTarget(observer, id, card,target, (s.find("retarget") != string::npos));
@@ -3091,6 +3202,14 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return a;
}
//get a new target for puresteel paladin...etc for equipments inplay only.. newhook & rehook supports stone hewer basic... the card is reequipped
if ((s.find("rehook") != string::npos) || s.find("newhook") != string::npos)
{
MTGAbility * a = NEW AANewTarget(observer, id, card,target, false,NULL,true,(s.find("newhook") != string::npos));
a->oneShot = 1;
return a;
}
//morph
found = s.find("morph");
if (found != string::npos)
@@ -3542,6 +3661,9 @@ int AbilityFactory::abilityEfficiency(MTGAbility * a, Player * p, int mode, Targ
badAbilities[(int)Constants::WEAK] = true;
badAbilities[(int)Constants::NOLIFEGAIN] = true;
badAbilities[(int)Constants::NOLIFEGAINOPPONENT] = true;
badAbilities[(int)Constants::CANTLOSE] = false;
badAbilities[(int)Constants::CANTLIFELOSE] = false;
badAbilities[(int)Constants::CANTMILLLOSE] = false;
if (AInstantBasicAbilityModifierUntilEOT * abi = dynamic_cast<AInstantBasicAbilityModifierUntilEOT *>(a))
{
@@ -4249,7 +4371,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
if (current->hasType(Subtypes::TYPE_CREATURE))
{
card->controller()->game->putInGraveyard(current);
damage += current->power;
damage += current->getCurrentPower();
}
}
observer->mLayers->stackLayer()->addDamage(card, target, damage);
@@ -4578,6 +4700,8 @@ int ActivatedAbility::isReactingToClick(MTGCardInstance * card, ManaCost * mana)
return 0;
if (cPhase != MTG_PHASE_FIRSTMAIN && cPhase != MTG_PHASE_SECONDMAIN)
return 0;
if (player->opponent()->getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0||game->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0||player->getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0)
return 0;
break;
}
if (restrictions >= MY_BEFORE_BEGIN && restrictions <= MY_AFTER_EOT)
@@ -5000,30 +5124,6 @@ int TriggeredAbility::receiveEvent(WEvent * e)
resolve();
return 1;
}
if(dynamic_cast<WEventLife*>(e))
{
//check life state on life triger
WEventLife * lifecheck = dynamic_cast<WEventLife*>(e);
if (lifecheck->player->DeadLifeState())
{
return 0;
}
fireAbility();
return 1;
}
if(dynamic_cast<WEventDamage*>(e))
{
//check life state on damage trigger
WEventDamage * lifecheck = dynamic_cast<WEventDamage*>(e);
if (lifecheck->damage->target->type_as_damageable == Damageable::DAMAGEABLE_PLAYER)
{
Player * triggerPlayer = (Player *) lifecheck->damage->target;
if(triggerPlayer->DeadLifeState())
return 0;
}
fireAbility();
return 1;
}
WEventZoneChange * stackCheck = dynamic_cast<WEventZoneChange*>(e);
if(stackCheck && (stackCheck->to == game->currentPlayer->game->stack||stackCheck->to == game->currentPlayer->opponent()->game->stack))
{
+90 -1
View File
@@ -58,6 +58,13 @@ MTGCardInstance::MTGCardInstance(MTGCard * card, MTGPlayerCards * arg_belongs_to
isSwitchedPT = false;
isACopier = false;
bypassTC = false;
discarded = false;
copiedID = getId();
modifiedbAbi = 0;
LKIpower = power;
LKItoughness = toughness;
cardistargetted = 0;
cardistargetter = 0;
}
MTGCardInstance * MTGCardInstance::createSnapShot()
@@ -75,6 +82,8 @@ void MTGCardInstance::copy(MTGCardInstance * card)
CardPrimitive * data = source->data;
basicAbilities = card->basicAbilities;
origbasicAbilities = card->origbasicAbilities;
modifiedbAbi = card->modifiedbAbi;
for (size_t i = 0; i < data->types.size(); i++)
{
types.push_back(data->types[i]);
@@ -574,11 +583,13 @@ Player * MTGCardInstance::controller()
int MTGCardInstance::canAttack()
{
if (basicAbilities[(int)Constants::CANTATTACK])
return 0;
if (tapped)
return 0;
if (hasSummoningSickness())
return 0;
if ((basicAbilities[(int)Constants::DEFENSER] || basicAbilities[(int)Constants::CANTATTACK]) && !basicAbilities[(int)Constants::CANATTACK])
if (basicAbilities[(int)Constants::DEFENSER] && !basicAbilities[(int)Constants::CANATTACK])
return 0;
if (!isCreature())
return 0;
@@ -718,6 +729,84 @@ void MTGCardInstance::switchPT(bool apply)
}
}
int MTGCardInstance::getCurrentPower()
{
if(!isInPlay(observer))
return LKIpower;
return power;
}
int MTGCardInstance::getCurrentToughness()
{
if(!isInPlay(observer))
return LKItoughness;
return toughness;
}
//check stack
bool MTGCardInstance::StackIsEmptyandSorcerySpeed()
{
if((getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) == 0) &&
(getObserver()->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN ||
getObserver()->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN) &&
controller() == getObserver()->currentPlayer &&
!getObserver()->isInterrupting)
{
return true;
}
return false;
}
//check targetted?
bool MTGCardInstance::isTargetted()
{
if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0)
{
ActionStack * stack = observer->mLayers->stackLayer();
for (int i = stack->mObjects.size() - 1; i >= 0; i--)
{
Interruptible * current = ((Interruptible *) stack->mObjects[i]);
if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED)
{
if(current->type == ACTION_SPELL)
{
Spell * spell = (Spell *) current;
if(spell->getNextTarget() && spell->getNextTarget() == (Targetable*)this)
return true;
}
}
}
}
if(cardistargetted)
return true;
return false;
}
//check targetter?
bool MTGCardInstance::isTargetter()
{
if(getObserver()->mLayers->stackLayer()->count(0, NOT_RESOLVED) != 0)
{
ActionStack * stack = observer->mLayers->stackLayer();
for (int i = stack->mObjects.size() - 1; i >= 0; i--)
{
Interruptible * current = ((Interruptible *) stack->mObjects[i]);
if ((current->type == ACTION_SPELL || current->type == ACTION_ABILITY) && current->state == NOT_RESOLVED)
{
if(current->type == ACTION_SPELL)
{
Spell * spell = (Spell *) current;
if(spell && spell->source == this)
return true;
}
}
}
}
if(cardistargetter)
return true;
return false;
}
int MTGCardInstance::canBlock()
{
if (tapped)
+5 -1
View File
@@ -143,7 +143,11 @@ const char* Constants::MTGBasicAbilities[] = {
"spellmastery",
"nolifegain",
"nolifegainopponent",
"auraward"
"auraward",
"madness",
"protectionfromcoloredspells",
"mygcreatureexiler",
"oppgcreatureexiler"
};
map<string,int> Constants::MTGBasicAbilitiesMap;
+38
View File
@@ -322,9 +322,19 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
int doCopy = 1;
bool shufflelibrary = card->basicAbilities[(int)Constants::SHUFFLELIBRARYDEATH];
bool inplaytoinplay = false;
bool ripToken = false;
if (g->players[0]->game->battlefield->hasName("Rest in Peace")||g->players[1]->game->battlefield->hasName("Rest in Peace"))
ripToken = true;
//Madness or Put in Play...
for(int i = 0; i < 2; ++i)
{
if (card->discarded && (to == g->players[i]->game->graveyard) && (from == g->players[i]->game->hand))
{
if(card->basicAbilities[(int)Constants::MADNESS])
to = g->players[i]->game->exile;
}
}
//Darksteel Colossus, Legacy Weapon ... top priority since we replace destination directly automatically...
for(int i = 0; i < 2; ++i)
{
@@ -339,6 +349,8 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
for(int i = 0; i < 2; ++i)
{
if ((to == g->players[i]->game->graveyard) && (
(g->players[i]->game->battlefield->hasAbility(Constants::MYGCREATUREEXILER) && card->isCreature()) ||
(g->players[i]->opponent()->game->battlefield->hasAbility(Constants::OPPGCREATUREEXILER) && card->isCreature())||
g->players[i]->game->battlefield->hasAbility(Constants::MYGRAVEEXILER) ||
g->players[i]->opponent()->game->battlefield->hasAbility(Constants::OPPGRAVEEXILER)))
{
@@ -353,6 +365,8 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
== g->players[1]->game->inPlay))
{
doCopy = 0;
asCopy = true;//don't send zone change event so it will not destroy the GUI when multiple switching of control...
inplaytoinplay = true;//try sending different event...
}
if (!(copy = from->removeCard(card, doCopy)))
@@ -361,6 +375,13 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
{
copy->miracle = true;
}
if (card->discarded)
{//set discarded for madness...
if(from == g->players[0]->game->hand || from == g->players[1]->game->hand)
copy->discarded = true;
else//turn off discarded if its previous zone is not in hand...
copy->discarded = false;
}
if (options[Options::SFXVOLUME].number > 0)
{
if (to == g->players[0]->game->graveyard || to == g->players[1]->game->graveyard)
@@ -417,6 +438,11 @@ MTGCardInstance * MTGPlayerCards::putInZone(MTGCardInstance * card, MTGGameZone
WEvent * e = NEW WEventZoneChange(copy, from, to);
g->receiveEvent(e);
}
if(inplaytoinplay)
{
WEvent * ep = NEW WEventCardControllerChange(copy);
g->receiveEvent(ep);
}
return ret;
}
@@ -748,6 +774,18 @@ bool MTGGameZone::hasAbility(int ability)
return false;
}
bool MTGGameZone::hasAlias(int alias)
{
for (int i = 0; i < (nb_cards); i++)
{
if (cards[i]->alias == alias)
{
return true;
}
}
return false;
}
int MTGGameZone::seenThisTurn(TargetChooser * tc, int castMethod, bool lastTurn)
{
//The following 2 lines modify the passed TargetChooser. Call this function with care :/
+37 -44
View File
@@ -284,7 +284,6 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost *)
{
int cardsinhand = game->players[0]->game->hand->nb_cards;
Player * player = game->currentlyActing();
Player * currentPlayer = game->currentPlayer;
if (!player->game->hand->hasCard(card))
return 0;
if ((game->turn < 1) && (cardsinhand != 0) && (card->basicAbilities[(int)Constants::LEYLINE])
@@ -310,18 +309,12 @@ int MTGPutInPlayRule::isReactingToClick(MTGCardInstance * card, ManaCost *)
{
if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(card, game->currentActionPlayer->game->inPlay) == PlayRestriction::CANT_PLAY)
return 0;
if (player == currentPlayer
&& (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN || game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN)
)
{
if (card->StackIsEmptyandSorcerySpeed())
return 1;
}
else
return 0;
}
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH)
|| (player == card->controller() && !game->isInterrupting
&& (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN
|| game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
)
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (card->StackIsEmptyandSorcerySpeed()))
{
if(card->controller()->epic)
return 0;
@@ -631,7 +624,6 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *
int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *, ManaCost *alternateManaCost)
{
Player * player = game->currentlyActing();
Player * currentPlayer = game->currentPlayer;
if (!alternateManaCost)
return 0;
@@ -645,17 +637,12 @@ int MTGAlternativeCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *
{
if (game->currentActionPlayer->game->playRestrictions->canPutIntoZone(card, game->currentActionPlayer->game->inPlay) == PlayRestriction::CANT_PLAY)
return 0;
if (player == currentPlayer
&& (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN
|| game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN)
)
if (card->StackIsEmptyandSorcerySpeed())
return 1;
else
return 0;
}
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::SPELLMASTERY) || card->has(Constants::OFFERING)
|| (player == card->controller() && !game->isInterrupting
&& (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN
|| game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
)
else if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || card->has(Constants::SPELLMASTERY) || card->has(Constants::OFFERING) || (card->StackIsEmptyandSorcerySpeed()))
{
if(card->controller()->epic)
return 0;
@@ -1042,11 +1029,7 @@ int MTGMorphCostRule::isReactingToClick(MTGCardInstance * card, ManaCost *)
if(card->controller()->epic)//zoetic cavern... morph is casted for a cost...
return 0;
//note lands can morph too, this is different from other cost types.
if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (player == card->controller()
&& !game->isInterrupting
&& (game->getCurrentGamePhase() == MTG_PHASE_FIRSTMAIN
|| game->getCurrentGamePhase() == MTG_PHASE_SECONDMAIN))
)
if ((card->hasType(Subtypes::TYPE_INSTANT)) || card->has(Constants::FLASH) || (card->StackIsEmptyandSorcerySpeed()))
{
if (card->controller()->game->playRestrictions->canPutIntoZone(card, card->controller()->game->stack) == PlayRestriction::CANT_PLAY)
return 0;
@@ -1415,6 +1398,7 @@ int MTGCombatTriggersRule::receiveEvent(WEvent *e)
if (card && card->isAttacker())
{
card->eventattacked();
card->controller()->raidcount += 1;
}
}
}
@@ -2293,6 +2277,10 @@ int MTGPersistRule::receiveEvent(WEvent * event)
if (e->from == p->game->inPlay)
ok = 1;
}
if (card->owner->game->battlefield->hasAbility(Constants::MYGRAVEEXILER)||card->owner->opponent()->game->battlefield->hasAbility(Constants::OPPGRAVEEXILER))
ok = 0;
if ((card->owner->game->battlefield->hasAbility(Constants::MYGCREATUREEXILER)||card->owner->opponent()->game->battlefield->hasAbility(Constants::OPPGCREATUREEXILER))&&(card->isCreature()))
ok = 0;
if (!ok)
return 0;
@@ -2301,19 +2289,28 @@ int MTGPersistRule::receiveEvent(WEvent * event)
Player * p = game->players[i];
if (e->to == p->game->graveyard)
{
MTGCardInstance * copy = p->game->putInZone(e->card, p->game->graveyard, e->card->owner->game->temp);
MTGCardInstance * copy = e->card;
if (!copy)
{
DebugTrace("MTGRULES: couldn't move card for persist/undying");
return 0;
}
Spell * spell = NEW Spell(game, copy);
spell->resolve();
string code = "";
bool persist = false;
bool undying = false;
if(card->basicAbilities[(int)Constants::PERSIST])
spell->source->counters->addCounter(-1, -1);
{
code = "Persist";
persist = true;
}
else
spell->source->counters->addCounter(1,1);
delete spell;
{
code = "Undying";
undying = true;
}
AAMover *putinplay = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), copy, copy,"ownerbattlefield",code,NULL,undying,persist);
putinplay->oneShot = true;
putinplay->fireAbility();
return 1;
}
}
@@ -2535,20 +2532,18 @@ int MTGLegendRule::added(MTGCardInstance * card)
MultiAbility * multi = NEW MultiAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card, NULL);
for(unsigned int i = 0;i < oldCards.size();i++)
{
AABuryCard *a = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i]);
a->menu = "Keep New";
AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New");
a->oneShot = true;
multi->Add(a);
}
multi->oneShot = 1;
MTGAbility * a1 = multi;
selection.push_back(a1);
AABuryCard *b = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, card);
b->menu = "Keep Old";
AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old");
b->oneShot = true;
MTGAbility * b1 = b;
selection.push_back(b1);
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Choose Legend");
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Legendary Rule");
menuChoice->addToGame();
}
return 1;
@@ -2612,20 +2607,18 @@ int MTGPlaneWalkerRule::added(MTGCardInstance * card)
MultiAbility * multi = NEW MultiAbility(game,game->mLayers->actionLayer()->getMaxId(), card, card, NULL);
for(unsigned int i = 0;i < oldCards.size();i++)
{
AABuryCard *a = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i]);
a->menu = "Keep New";
AAMover *a = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, oldCards[i],"ownergraveyard","Keep New");
a->oneShot = true;
multi->Add(a);
}
multi->oneShot = 1;
MTGAbility * a1 = multi;
selection.push_back(a1);
AABuryCard *b = NEW AABuryCard(game, game->mLayers->actionLayer()->getMaxId(), card, card);
b->menu = "Keep Old";
AAMover *b = NEW AAMover(game, game->mLayers->actionLayer()->getMaxId(), card, card,"ownergraveyard","Keep Old");
b->oneShot = true;
MTGAbility * b1 = b;
selection.push_back(b1);
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Choose Planeswalker");
MTGAbility * menuChoice = NEW MenuAbility(game, game->mLayers->actionLayer()->getMaxId(), card, card,true,selection,card->controller(),"Planeswalker Rule");
menuChoice->addToGame();
}
return 1;
@@ -2707,7 +2700,7 @@ int MTGLifelinkRule::receiveEvent(WEvent * event)
WEventDamage * e = (WEventDamage *) event;
Damage * d = e->damage;
MTGCardInstance * card = d->source;
if (d->damage > 0 && card && card->basicAbilities[(int)Constants::LIFELINK])
if (d->damage > 0 && card && (card->basicAbilities[(int)Constants::LIFELINK]||card->LKIbasicAbilities[(int)Constants::LIFELINK]))
{
card->controller()->gainLife(d->damage);
return 1;
@@ -2751,7 +2744,7 @@ int MTGDeathtouchRule::receiveEvent(WEvent * event)
return 0;
MTGCardInstance * _target = (MTGCardInstance *) (d->target);
if (card->basicAbilities[(int)Constants::DEATHTOUCH])
if (card->basicAbilities[(int)Constants::DEATHTOUCH]||card->LKIbasicAbilities[(int)Constants::DEATHTOUCH])
{
_target->destroy();
return 1;
+18 -3
View File
@@ -34,6 +34,7 @@ Player::Player(GameObserver *observer, string file, string fileSmall, MTGDeck *
extraTurn = 0;
drawCounter = 0;
epic = 0;
raidcount = 0;
prowledTypes.clear();
doesntEmpty = NEW ManaCost();
poolDoesntEmpty = NEW ManaCost();
@@ -89,7 +90,7 @@ bool Player::loadAvatar(string file, string resName)
}
mAvatarTex = rm->RetrieveTexture(file, RETRIEVE_LOCK, TEXTURE_SUB_AVATAR);
if (mAvatarTex) {
mAvatar = rm->RetrieveQuad(file, 0, 0, 35, 50, resName, RETRIEVE_NORMAL, TEXTURE_SUB_AVATAR);
mAvatar = rm->RetrieveQuad(file, 0, 0, 0, 0, resName, RETRIEVE_NORMAL, TEXTURE_SUB_AVATAR);
return true;
}
@@ -236,7 +237,7 @@ void Player::serumMulligan()
//Draw hand no penalty
}
bool Player::DeadLifeState()
bool Player::DeadLifeState(bool check)
{
if ((life <= 0)||(poisonCount >= 10))
{
@@ -263,7 +264,21 @@ bool Player::DeadLifeState()
}
if (cantlosers < 1)
{
getObserver()->setLoser(this);
if(!check)
{
ActionStack * stack = getObserver()->mLayers->stackLayer();
for (int i = stack->mObjects.size() - 1; i >= 0; i--)
{
Interruptible * current = ((Interruptible *) stack->mObjects[i]);
Spell * spell = (Spell *) current;
if (current->type == ACTION_SPELL)
spell->source->controller()->game->putInGraveyard(spell->source);
current->state = RESOLVED_NOK;
}
}
if(check)
game->owner->getObserver()->setLoser(this);
return true;
}
}
+5
View File
@@ -859,6 +859,11 @@ bool TargetChooser::canTarget(Targetable * target, bool withoutProtections)
if (card->protectedAgainst(targetter)) return targetter->bypassTC;
if (card->CantBeTargetby(targetter)) return targetter->bypassTC;
if ((targetter->controller() != card->controller()) && card->has(Constants::OPPONENTSHROUD)) return targetter->bypassTC;
if (card->has(Constants::PROTECTIONFROMCOLOREDSPELLS))
{//a spell that has no target=criteria means it's not targetted unless its a workaround card...
if((targetter->spellTargetType.size()) && (targetter->hasColor(1)||targetter->hasColor(2)||targetter->hasColor(3)||targetter->hasColor(4)||targetter->hasColor(5)))
return targetter->bypassTC;
}
}
return true;
}
+14
View File
@@ -106,6 +106,7 @@ WEventCardSacrifice::WEventCardSacrifice(MTGCardInstance * card, MTGCardInstance
WEventCardDiscard::WEventCardDiscard(MTGCardInstance * card) :
WEventCardUpdate(card)
{
card->discarded = true;
}
WEventCardCycle::WEventCardCycle(MTGCardInstance * card) :
@@ -121,6 +122,8 @@ WEventVampire::WEventVampire(MTGCardInstance * card,MTGCardInstance * source,MTG
WEventTarget::WEventTarget(MTGCardInstance * card,MTGCardInstance * source) :
WEventCardUpdate(card),card(card),source(source)
{
card->cardistargetted = 1;
source->cardistargetter = 1;
}
WEventCardChangeType::WEventCardChangeType(MTGCardInstance * card, int type, bool before, bool after) :
@@ -162,6 +165,11 @@ WEventCardUnattached::WEventCardUnattached(MTGCardInstance * card) :
{
}
WEventCardControllerChange::WEventCardControllerChange(MTGCardInstance * card) :
WEventCardUpdate(card)
{
}
WEventCombatStepChange::WEventCombatStepChange(CombatStep step) :
WEvent(), step(step)
{
@@ -316,6 +324,12 @@ Targetable * WEventCardUnattached::getTarget(int target)
return NULL;
}
Targetable * WEventCardControllerChange::getTarget(int target)
{
if (target) return card;
return NULL;
}
std::ostream& WEvent::toString(std::ostream& out) const
{
return out << "EVENT";