Commit Graph

122 Commits

Author SHA1 Message Date
omegablast2002@yahoo.com
0727343ebe first moved the def of handsize for a game into the rules.txt as discussed with wololo...
this update requires you to update your rules folder files!!!

2nd
added 2 new vanguard game modes.
Stone Hewer Basic - when ever a creature enters play, a random equipment with a converted mana cost less than or equal to that creature is put into play and attached to it.
this mode is unlockable, requirement = win a match where 10 or more equipment were in the battlefeild at the moment you won.

Hermit Druid basic- in this game mode, during each of the players upkeeps, a random land card from their deck is placed into the battlefield, these do not count against your 1 land per turn limit.
to unlock this, win any match with less then 10 lands.
2011-05-23 11:46:04 +00:00
omegablast2002@yahoo.com
e275a599b7 ok this may, or may not get me yelled at...but i can explain why i do it in rules...so don't kill me :(
added 
"offerinterruptonphase=blah"
to the parsing of the rules.txt files...the reason i want to handle it inside the rules.txt....
originally i was going to use the options variable for this, then i realized that if i use that variable, it would apply it to every game mode and peoples custom games...so instead i added the parsing in the actual rules.txt files, this way, if we want to offer interrupt on phase blah to MTG, but NOT have this interrupt offered in a mod or different mode, or if the different mod or mode should offer you a chance to interrupt ai in a different phase ...you can set each rule to interrupt in the phase you want...

now for the reason i added it in the first place...previously we were allowed an interrupt when the opponent drew a card in the draw step, this gave us a chance to do stuff on opponents turn....
recently wololo i beleave made draw actions not use the stack anymore(which was a good change, since as per MTG rules the actions of drawing is not a stack action)...but as a side-effect, we lose our chance to interrupt ai and do stuff on ais turn....

also, changed the ingame bonus thing, to start recording stuff towards bonuses on turn 2+...this solves reported issues with story mode "setting up" causing massive bonuses to be gained for doing nothing.....
2011-05-10 17:08:08 +00:00
wagic.the.homebrew
2c0b5baab7 Fix for issue 647 (Evil Presence cast on a swamp removes mana ability) 2011-05-08 09:06:56 +00:00
wagic.the.homebrew
810548d816 Minor GameObserver refactor, should have no impact on the game. 2011-05-03 13:46:50 +00:00
wagic.the.homebrew
0b9ff076e6 Please update your rules folder
- "Manapool empties at the end of each step" becomes an ability, and was moved into the external rules file. "removemana(*) to remove all, removemana(*{G}) to remove all green, removemana(*{G}{B}{R}) to remove all green black red, removemana({G}{G}{B}{U}) (no "*") to remove a specific value.
- Added a possibility to make abilities non interruptible. With little work, this could be added to the parser if needed. Please use with care, let's discuss what is an acceptable usage of this now functionality, if needed.
2011-05-03 11:59:27 +00:00
wagic.the.homebrew
6f5919ed06 Reverting r3496 to fix failing tests 2011-04-21 15:16:22 +00:00
techdragon.nguyen@gmail.com
8bf983e2e5 Flagged numerous peices of code that have local variables that are masking either member variables or variables scoped outside the current scope.
I've marked all the ones I found with the following TODO comment:

TODO: C6246: <blah blah>

a few in particular are the ones related to "oneShot" and "_target".  These are local variables that are declared that
mask either a method parameter or a member variable.
2011-04-21 10:04:32 +00:00
wrenczes@gmail.com
fc0a59a14e Moved GameOptions.h into the precompiled header. Shaves almost 20 seconds off my build times. 2011-04-20 07:50:00 +00:00
omegablast2002@yahoo.com
4c90d9e0c2 you can't pay life which you do not have as life payments. 2011-04-17 20:08:08 +00:00
omegablast2002@yahoo.com
1b6991107b few changes here, mostly small bug fixes,
recoded altercost, its finally not using a dirty clean up.
this fixes the bug with it not effecting ai also and the bug where it was ineffective when combined with affinity creatures...

removed a aspect of the wolf class...
soft coded support for aspect of the wolf...using word variable subkeyword "halfup" and "halfdown"
it can go anywhere a parsable word vairable is stringing...i preffer the front of it...
these are Wparsedint subkeywords, not keywords you can use with standard abilities...
its meant to return half the varible rounds up, or down...

fixed player not losing with cantlifelose when they have 10 or more poison...the player should die.

reworked taplandformana, i send the main card as a target now, check against the cost if its affordable...anyways, i discussed this bool function a while back with devs and wololo saw the same issues i saw in it...he then removed it from being used as an if statement...i changed it back to an if statement with the new checks...we are either going to go back to a void, or go all the way bool, but not inbetween.
2011-04-16 17:00:51 +00:00
wrenczes@gmail.com
99ed83c5e8 Performance improvements/cleanup: card->hasType("foo") performs a string lookup for an integer id. Now that our primitives have over 1000 types (1018, I believe is the number I saw while debugging), this is not the cheapest lookup. Over the course of time, a lot of new rules have crept in the code - support for 'aura', 'equipment', and recently 'planeswalker'. While profiling, I saw an inordinate amount of time being used doing map lookups for these strings. Since they're used so frequently, I've added them to the SubTypes enumeration, and swapped out doing the string lookup in favour of using the int ID directly. I also found a few places where we were using hasType("Creature") or hasType("land") when we already had helper functions to do the int lookup, so I swapped these in as appropriate, as well as a couple of places where we had hasType("instant") instead of hasType(Subtypes::TYPE_INSTANT), etc. 2011-04-10 00:07:34 +00:00
omegablast2002@yahoo.com
553615a563 sending @discarded events for the auto hand cleaning and clean up step discard events 2011-04-04 19:52:58 +00:00
omegablast2002@yahoo.com
2eca724001 2 things,
fixed a bug with Withering Wisps, moved the parsing of the limit string into the isreactingtoclick function, this allows word varibles such as type: to be used.

2nd, removed a varible isTempPhased, it *appear* it might not be needed, tho i didn't handle phasing the way im converting it to for a reason, so cross your fingers and hope all goes well.
BTW: do not email me about any bugs that ariase with phasing or phased out creature, im not excepting bug reports on it to my email box...instead open a ticket with a repro method and mark it as critical.
2011-04-03 12:24:21 +00:00
wagic.the.homebrew@gmail.com
6b89899d1b Erwan
- deprecated the following keywords (see list below for new usage)
-- cantcreaturecast => auto=maxCast(creature)0
-- cantspellcast => auto=maxCast(*)0
-- onlyonecast => auto=maxCast(*)1 
-- bothcantcast => auto=maxCast(*)0 auto=maxCast(*)0 opponent
-- bothnocreature => auto=maxCast(creature)0 auto=maxCast(creature)0 opponent
-- oneboth => auto=maxCast(*)1 auto=maxCast(*)1 opponent

Strangely enough, I couldn't find most of these keywords in mtg.txt?

I also removed variables such as "spellCastedThisTurn" and stuff like that... now if you want to know how many spells were cast in one turn by a given player, use player->game->stack->seenThisTurn("*").
seenThisTurn can take a string representing a TargetChooser, or better, a TargetChooser.

I can't guarantee I didn't break anything, but the test suite passes and the AI seems to run ok
2011-02-13 11:23:51 +00:00
wagic.the.homebrew@gmail.com
8eac9c587e Erwan
- added maxCast and maxPlay abilities, this deprecates the following abilities: nospells,nocreatures,onlyonespell,land
I usually don't like to deprecate abilities, but the existing ones, despite having easy to remember names, were really not flexible enough.

If you want to use these old keywords, instead use:
-- nospells  =>  maxCast(*)0
-- onlyOneSpell => maxCast(*)1
--nocreatures => maxCast(creature)0
--land:1 => maxplay(land)+1

note maxPlay and maxCast. They follow similar rules, but maxPlay monitors the number of cards that are going on the Battlefield, while maxCast monitors the stack. In most cases, maxCast should be the one to use, but lands are a special case because they go directly to play.

I unfortunately cannot guarantee I didn't break anything, especially in the AI, but the test suite passes ,and I added a few additional tests yesterday and today, to feel more confident about the change.

next step is removing the creatures keywords that do the same kind of thing (cantcast, etc...) and replace them with maxCast
2011-02-13 08:01:13 +00:00
wagic.the.homebrew@gmail.com
60017a6652 Erwan
- replaced variables canPutLandsIntoPlay and landsPlayerCanStillPlay with a PlayRestrictions class.
- Added  seenThisTurn(TargetChooser * tc) in MTGGameZones, which allows to count how many cards matching a targetChooser have been in a given zone in the current turn. With minor work, this can probably be reused by the ability parser for some cards that need to count how many **** where played or put on the stack during a turn.
-- for example player->game->stack->seenThisTurn([put a TypeTargetChooser("creature") here]) would give you the number of creature spells cast by the player this turn.
- This is the first step of a refactor that aims at removing all the adhoc variables for "cant cast". I plan to get rid of the following variables in Player.h (and the associated code, which hopefully will become smaller):  
    int castedspellsthisturn;
    bool onlyonecast;
    int castcount;
    bool nocreatureinstant;
    bool nospellinstant;
    bool onlyoneinstant;
    bool castrestrictedcreature;
    bool castrestrictedspell;
    bool onlyoneboth;
    bool bothrestrictedspell;
    bool bothrestrictedcreature;

They will be replaced by the PlayRestrictions system, and hopefully I'll have time to update the parser to make this more generic as well.
My initial goal with this change was to move the limit of 1 land per turn outside of the code, and make it an external rule in Rules/mtg.txt. I have yet to do it.
2011-02-12 16:31:07 +00:00
omegablast2002@yahoo.com
0a60979554 fix and completely reworked affinity AGAIN.
moved it out of rules, it was FAR to error prone and after fixing bugs on this ability about 12 times, im done with it.

noticed yesterday that it was removing the completely wrong amounts, and not maintaining its cost AT ALL. so i got sick of adjusting it as a rule, its now a statebased effect, called through gamestatebasedeffect as a side function.

the new affinity is less then 100 lines of code, down from 300. to acomplish the effect with FAR less effort. it is also FAR easier to maintain in the future if i die or leave the scene or whatever.

added a new count tool for MTGGameZones canByCanTarget...which allows for returns of amounts based on if it can be targetted by a tc. much like how listmaintainer does it. affinitygreencreature will not be the only ability to use this function, just a heads up. its just the first to do so.

hopefully this much more accurate affinity will be the last version...considering adding the other types which old affinity couldnt handle :D
2011-02-12 15:06:28 +00:00
omegablast2002@yahoo.com
e7fc20bd4c added
this(damaged)
added
targetchooser [damaged] status
added
targetchooser [controllerdamager]
targetchooser [opponentdamager]

basically checks for whos doing damage to who in a match per turn.
2011-02-02 18:22:08 +00:00
techdragon.nguyen@gmail.com
6ddaf8b74b removed draw method from GameObserver as it is no longer used since the refactor of the
player mulligan code.
2011-01-31 08:38:14 +00:00
omegablast2002@yahoo.com
63b3bdfef6 missed a spot to send @targeted events. 2011-01-22 22:02:20 +00:00
omegablast2002@yahoo.com
473abd9814 im forced to do this commit in whole instead of parts as originally planned, and before my beta test period of the changes is complete BECAUSE there are people doing "clean up" and the MASSIVE amount of conflicts i have to resolve from it is WAY too much for me to take on after nearly 200 hours of coding this patch. i cant seem to get enough respect to have people hold off on "clean up" so this brings me to being forced to do a full commit before playtest period is done, so they can go ahead with there *super important* clean up.
ok i WAS going to write a full change log with code exsamples ect, but since im rushed you will get the short version of this log.

first bug fixes, and there were many, 
indestructible creature bug fixed
halimar execavator *embearessing youtube video" bug is fixed

token text now displays source name and tokens abilities

fixed a card view null pointer in an iterator when code used combinations of foreach and aslongas with CD.

epic struggle bug fixed, aslongas was only parsing one space to the right of the operator.

extra cost containing targetting fixed, cards can now have multiple extra cost in all mana...this includes giving a card 2 targeted sacrifices as its main cost.

angelic chorus bug fixed, the card will be soft coded now.

and many other minor bugs fixed, hard to remember all which were fixed.

now, new abilities = words
"legendarylandwalk",
"desertlandwalk",
"snowforestlandwalk",
"snowplainslandwalk",
"snowmountainlandwalk",
"snowislandlandwalk",
"snowswamplandwalk",
"snowlandwalk",
"nonbasiclandwalk",
"strong",//cant be blocked by creature with less power
"weak",//cant block creatures with more power
"phasing",

all true landwalks will now be supported.

new cost types:
morph which is coded as follows
[card]
name=Bloodstoke Howler
facedown={3}
autofacedown={6}{R}:morph
autofaceup=3/0 all(beast|mybattlefield))
text=Morph {6}{R} (You may cast this face down as a 2/2 creature for {3}. Turn it face up any time for its morph cost.) -- When Bloodstoke Howler is turned 
face up, Beast creatures you control get +3/+0 until end of turn.
mana={5}{R}
type=Creature
subtype=Beast
power=3
toughness=4
[/card]

you will notice new auto lines autofaceup and autofacedown
these are abilities the cards will have when theyre in that state.
the cost is coded as
facedown={cost}
when a card is faced up it gains auto= lines also.
tho is played normally it will NOT gain autofaceup=lines

card restrictions:
cards can now have restrictions placed on them the restrictions are.
all previous restrictions usable in activated abilities
with the follow additions
control two or more vampires
control less creatures
control snow land
casted a spell
one of a kind
fourth turn
before battle damage
after battle
during battle

[card]
name=Blood Frenzy
target=creature[attacking;blocking]
restriction=before battle damage
auto=4/0
auto=treason
text=Cast Blood Frenzy only before the combat damage step. -- Target attacking or blocking creature gets +4/+0 until end of turn. Destroy that creature 
at the beginning of the next end step.
mana={1}{R}
type=Instant
[/card]

other cost now can have specail restrictions also:
otherrestriction=mytypemin:1 type(swamp),opponenttypemin:1 opponenttype(plains)
these are minimums required inplay of a type
it can be just you, or you and opponent or just opponent
you can also use the words "more" and "less" and * to compare the 2 players fields.

[card]
name=Cho-Arrim Legate
abilities=protection from black
other={0}
otherrestriction=mytypemin:1 type(swamp) , opponenttypemin:1 opponenttype(plains)
text=Protection from black -- If an opponent controls a Swamp and you control a Plains, you may cast Cho-Arrim Legate without paying its mana cost.
mana={2}{W}
type=Creature
subtype=Human Soldier
power=1
toughness=2
[/card]

activated ability gained a new restriction "opponentturnonly"

variables will now be recalculated during the resolve of the major abilities to produce the most current number.
{x}:draw:x <----
new number variables words:
using draw as an exsample
draw:auras <--auras on a creature

draw:type:ally <---counts the allys in your field. self explanitory

draw:thatmuch <--mostly a triggered effects number.
when you take damage draw that much

draw:lifelost
draw:oplifelost
these return the value of the life lost that turn.

new TRIGGER restricitions
sourcenottap
sourceTap
foelostthree<--card cycle uses opponent lost life
foelosttwo<--same as above
once<--this trigger will only ever trigger one time and never again.

new card discriptor words
[multicolor]
[leveler]
[enchanted]
[blackandgreen]
[blackandwhite]
[redandblue]
[blueandgreen]
[redandwhite]
CD will now recalculate the number again on resolve
meaning {x}:target(CreatureTargetChooser[manacost <=x]) will work, with an added bonus {x}:target(CreatureTargetChooser[manacost <=any word variable])

new this(:
this(tapped)<--for strange case cards.
this(untapped)
this(auras)

new MTGAbility keywords
(blink)
(blink)forsrc <--stay blinked while source inplay
hand(blink <---adding hand to the front makes it target hand.

livingweapon
this is an extension of token, simple attach the words "livingweapon" to the front of token( and it will autoamtically token that and attach the card to it.

token( gained:
"targetcontroller" targetting.
"battleready" if put in the tokens abilities it will be a attacker and tapped as it is entering play.


phaseout <--self explanitory

spiritlink <--stacking lifelink style effect that benifits the OWNER of the card.
combatspiritlink same as above.

stacking flanking, requires 2 abilities unfortunately

[card]
name=Agility
target=creature
auto=teach(creature) flanker
auto=teach(creature) flanking
text=Enchant creature -- Enchanted creature gets +1/+1 and has flanking. (Whenever a creature without flanking blocks this creature, the blocking 
creature gets -1/-1 until end of turn.)
mana={1}{R}
type=Enchantment
subtype=Aura
[/card]

removeallcounters(number/number,name)
removes all counters of the type from a card, can all be
"all"
vampire hexmage effect.

added new tools for transforms
,setpower=number
,settoughness=number
removetypes

morph
autofacedown={0}:morph

eradicate <---same as the card name.

cumulativeupcost[ <--self explanitory

upcostmulti[ <--an upcost that will resolve with a && ability

phaseaction[ phase name ] ability

an ability that will trigger on the stated phase name.
also support for phaseactionmulti[

new triggers added:
@vampired( <--sengir vampire effect
@targeted( 
@lifeloss(
@lifed(

add a special ability builder called dynamicability
it acts alot like a choose your own adventure book

dynamicability<! variable 1, variable 2, variable 3,variable 4!> optional ability targetting the original target.

variable list 1:
this is the primary amount source
source
mytgt
myself
myfoe
variable list 2:
this is the variable we're after, or the amount
power
toughness
manacost
colors
age
charge
oneonecounters
thatmuch
variable list 3:
this is the main effect
strike
draw
lifeloss
lifegain
pumppow
pumptough
pumpboth
deplete
countersoneone
variable list 4:
how it will do this effect to.
itself
eachother
targetcontroller
targetopponent
tosrc
srccontroller
srcopponent

the best way to explain its usage is to look at cards coded with this ability. or experiment with combinations.

new gameoption
First turn player:player, opponent, random
who takes the first turn

added poisoned status, tho not complete since MBS hasnt spoiled enough cards to see where this variable will be used.

taught ai how to counter spell
improved ai, it will now cast instants during interupts and during your turn.
previously ai treated instant cards the same as it treated sorceries, which was not fair to the ai.

im sure there is some messed items, but the rev directly before this one had formatting in the code that created hundreds of conflicts with this one, so i had to dig this info out of red and green sections.

cards and test are coming soon, i ask PLEASE do not alter these new additions until the test are commited.
im commiting without the test because instead of allowing me to proceed with my beta test period, there are some that wish to rush me into a commit. if you do not like this commit revert it, i absolutely on no grounds give permission to recommit afterwards. and i will not recommit if a revert is called.
2011-01-21 20:18:56 +00:00
omegablast2002@yahoo.com
d8d4977e5b fixed a rare crash when more then one creature had either treason or unearth in the battlefield at the same turn...they would be put in graveyard and the z->nbcards would change in value, meaning that the incrementer was now able to accidently step out of the vector and hit an invalid pointer. now once it hits the bottom of each pass if the number of cards changed in the field start the cycle over. 2010-12-19 21:20:30 +00:00
omegablast2002@yahoo.com
4458e61b75 2 things, moved poison count wingame to the top with the life, there were cases where it wasnt respecting "cantlose" cards. and 2nd gave Ai *some* direction as to what to do with poison counters. i saw him place poison counters on himself to death in a single round...its was embarrassing. 2010-12-16 16:09:35 +00:00
techdragon.nguyen@gmail.com
fe75493ffa No code change. Reformat code 2010-12-11 22:42:48 +00:00
omegablast2002@yahoo.com
c54de679d4 couple bug fixes, a slight refactor,
ok here goes, first, fixed a crash that would happen when ever a player would gain more then 2000 life or take more then 2000 damage...the buffer was becoming corrupted i imagine because it was too small, increasing it to 10 slots allowed players to successfully take massive amounts of damage, highest i bothered checking was about 35k gained/lost, no crash...

2nd, removed the and refactored cantcaster rule, moved it to stateEffects() and renamed stateeffects to better reflect what it will be handling,

removed sneak attack rule and moved it into stateeffects

the following ints have been converted into bool, 
all the cantcasters, canputlandsintoplay is becoming a bool, the amount of lands you can play is now handled by a new varible int landsPlayerCanStillPlay (this is for my ability additional lands increase in support on perminents coming after the release)

the changes to bools were for an obvious reason, they were all ints pretending to be bools, my varibles were confusing as you would often see code like this if(cantblahblah > 0)
which to another coder might not make any sense.

these varible ints were returning 0 as false and 1 as true...changed them all to bools, same goes for putlandsinplay int, in half the places it was being used as a bool, AND it was tracking the amount, when i was coding additional land ability, this made it impossible to maintain correct amounts without damaging the rest of the code.
as a bool, controlled by stateeffects, it can now be used correctly as a bool in all cases, and the stateEffects manages the switch on it to false if you no longer have any landsPlayerCanStillPlay left.

the refactor on cantcaster was also a bug fix, it was reported to me that cantcasters were not correctly working, sometimes ai or player would still be allowed to play a card with one in play, because of the old way i had it setup somecases of bothcantcaster were reseting the cantcast to 0, basically making the check do nothing.

it is now handled in stateeffects if you have one in play, then its true, if not then false...this returns very accurate tracking of the cards instantly instead of checking as cards enter or left play.

the "both" versions now have their own bools to avoid future conflicts with the single player cantcast...

added a case for the fancy moving text, some move to library effects were incorrectly returing fetch.
2010-12-10 20:51:50 +00:00
wrenczes@gmail.com
4fd67bd1fd line endings -> Unix. No code changes here. 2010-12-10 08:38:09 +00:00
omegablast2002@yahoo.com
1fe35da5b3 forgot to change back one line i changed, this is part of the manual revert i did earlier. 2010-12-09 18:34:23 +00:00
wagic.the.homebrew@gmail.com
6360734ea3 Erwan
-Attempt at fixing issue 538. This is a wild guess, but basically 1 000 000 bytes is NOT enough to decompress a 512*512*4 texture (32bits png). We need at least 1MB (1024*1024) AND some additional space for the decompression process. Based on that, bumped the 1 000 000 (minimum contiguous ram necessary to start decompressing a picture) to 1 500 000. I've had pretty good results so far but this needs confirmation
- GameObserver <- changes from Win to *nix carriage returns.
2010-12-09 13:47:04 +00:00
omegablast2002@yahoo.com
5d96f68d21 reverted my changes in rev 2774 which intruduced bugs, coincidently stumbled across what really fixed triggers substep, which was moving it into stateeffects...this revert reintruduces the double interrupt offer to combatdamage in some specail cases. 2010-12-09 13:31:09 +00:00
omegablast2002@yahoo.com
f227c4775d moved phase pass automation into stateeffects() where it should have been from the start, it really shouldnt be run as part of "update()" it bothered me enough to actually move it. 2010-12-08 15:33:02 +00:00
omegablast2002@yahoo.com
6348940dc6 added a automatic move forward if trigger step if playmode == test suite...this will still trigger the steps actual functions and test that are using trigger step will require an extra "next" test that are not using trigger step for anything will not need the extra "next" 2010-12-08 14:32:12 +00:00
techdragon.nguyen@gmail.com
def9a8b229 added additional debug statement to show current turn. 2010-12-08 08:21:54 +00:00
omegablast2002@yahoo.com
d3a4745686 did a couple things here, fixed issue507 but also, very very very possibly fixed issue548, tho i will leave the closing of those 2 tickets to wololo, as he was the one who originally reported them.
another issue i fixed, when last trigger would be resolving in "trigger" substep, the game was moving to next combatstep before you could finish it, NOW the game correctly finishes resolving any triggers that might have fired off in "Triggers" substep, THEN it adds combatdamage step to the stack. this also fixes an issue where if you were multiblocked and combattriggers fired off, then your trigger would be UNDER the "ordering window" and unresolvable.

added waitingforanwsers return to userRequestNextGamePhase
when youre "waiting for anwsers" that means you have a menu box open and the game is waiting for you to decide....this was one of the causes of the rush to combat damage while youre still selecting something on a menu.

moved Trigger step call to requestnextgamephase into stateEffects() and out of updates, works MUCH better this way. i wonder why this isnt handling more of the automated functions, i suggest we consider moving the autopassphase into stateEffects() also as it will most likely be handled much better in there then in the update function.


also,
adjust Ailessons on Adrawer, it was still getting a little too excited about drawing cards. 
moved around the eff setting on grantingability lessons.
having it set to 0 BEFORE actually giving it a value was conter productive.

added a peice of commented out code in "isintop" function that if you uncomment will allow you to have Ai ALWAYS multiblock you.

im pushing this in as i feel comfortable with the positives and havent really come across an adverse effect yet.
however i am just one person and testing something like this is much easier with alot more then 1 person on it.
2010-12-07 17:58:46 +00:00
wrenczes@gmail.com
ffd3b7b074 At Z's request, fixed Issue 184, ExtraCost types with targets such as Siege-Gang Commander/Drowner of secrets combined with targeted abilities bug.
This one was a bit of a doozy to fix correctly, but the actual fix ended up being fairly simple - the upshot is that TargetAbility never checked for whether an extra cost needed setting prior doing a target selection.  While at it, I discovered and fixed another bug:  if you're in the middle of an extra cost choice (like sacrifice, for instance) and hit the next phase button, the game would let you proceed, and then hang in an endless loop.

While at it, did a little cleanup/refactoring around GameObserver's waitForExtraPayment - any time a bool has something that sounds like a verb, it probably deserves to be a function.  Now it is. (I needed to refactor it anyway, as I reused that code for the next phase hang.)

Note that after this fix, I had to patch two test cases (siege_gang_commander.txt & seismic_assault.txt) - since I've change the selection order (ie a target ability with a sacrifice cost requires the cost to be paid up front before picking the target), this means that tests involving targeting & sacrifices need to switch the order of the cards to pass.
2010-12-06 06:49:36 +00:00
wagic.the.homebrew@gmail.com
c7a17a0e57 Erwan
- some code cleanup, as I am trying to figure out the root cause for issue 548
2010-12-05 14:13:42 +00:00
wrenczes@gmail.com
65e38b0694 Another change that looks bigger than it is: changed out the global extern WResourceManager to a real singleton. This means that it's no longer being init'ed at static initialization time, and we can debug construction/destruction properly; it's also safer in a multithreaded context. 2010-12-01 08:22:17 +00:00
omegablast2002@yahoo.com
2aa47cd68b reverted the change i made, found specail cases where this cause bugs. 2010-11-24 14:40:06 +00:00
omegablast2002@yahoo.com
d1577ef35e corrected an issue where the player was being offered interupt 2 times for "combat damage" not closing the ticket until i can get some help verifying that it covers all cases where it might be true. 2010-11-24 13:46:27 +00:00
wagic.the.homebrew@gmail.com
f7bcbb42dc Erwan
- had some problems compiling for the PSP. I assume I was the only one, please let me know if the "include JLogger" lines are not needed (they were needed for me)
- Fix a memory leak when playing in "random deck" mode
- Prevent the AI from playing cards with a cost it cannot understand (ExtraCosts with a target).
2010-11-18 14:04:24 +00:00
techdragon.nguyen@gmail.com
acd7bb1aa4 reformatting code according to guidelines defined at
http://wololo.net/forum/viewtopic.php?f=35&t=2235&start=10
2010-11-16 00:55:16 +00:00
techdragon.nguyen@gmail.com
f176f7378d removed redundant delete of mPlayer[i]->game as it is already taken care of in the destructor for Player in the next line. 2010-11-10 00:53:56 +00:00
wrenczes
d5f3e4cfea Enabled precompiled headers for the build. This cuts the win compile time in debug by at least half on my laptop; on the psp compile, it shaves it down by ~ 45 seconds. I only did a cursory inspection of what to add to PrecompiledHeader.h, there's probably more that we can throw in there for more incremental speed improvements.
Also fixed the project includes so that we don't need to always use the indirect include path, ie:
#include "../include/foo.h" -> #include "foo.h"

I'm don't know much about make files - if I busted the linux build, mea culpa, but I think we're okay on that front too.  For future reference, here's the most straightforward link on the topic of adding pch support to make files:

http://www.mercs-eng.com/~hulud/index.php?2008/06/13/6-writing-a-good-makefile-for-a-c-project
2010-10-24 05:55:24 +00:00
omegablast2002@yahoo.com
98e34c4eca changed some of the ability names as requested, autoformatted ability.cpp as it was getting pretty messy. added @attackedalone( trigger. added "removefromcombat" mtgability. im going on vacation, whoosh :P 2010-10-18 15:56:32 +00:00
omegablast2002@yahoo.com
d13e8904b5 massive update, additions and changelog in first comment. 2010-10-18 10:46:36 +00:00
wrenczes@gmail.com
e45735267b More work on cleaning up debug trace logs. Added getDisplayName() overrides to the Ability & NextGamePhase interrupts so that there's now more contextual info in the output log. You'll now see what game phase is being added/resolved on the stack, and instead of a generic 'StackAbility' entry, it'll tell you what source it's coming from.
Also deleted a few debug output traces that were truly uninformative.
2010-10-07 08:13:22 +00:00
techdragon.nguyen@gmail.com
8e83e0d632 Issue: 474
modified player status to recognize that test suite has been activated.  This is to allow deactivation of "phase skip automation" game setting during test suite.  
TODO: fix "Phase Skip Automation" such that if turned on the test suite does not break.  This fix should be considered temporary
2010-10-04 16:26:55 +00:00
wagic.the.homebrew@gmail.com
f3cc20eb31 Erwan
- Fix for issue 284 (Damage not triggering when creature dies in combat phase)
2010-09-25 05:15:09 +00:00
omegablast2002@yahoo.com
75c0733a38 Condensed castrestrictions/handsize rule massively. handled by 1 rule now and checked in one pass. 2010-09-24 19:26:32 +00:00
omegablast2002@yahoo.com
65673ca0b2 added support for no max hand size, added nonstatic lifetotal checks, added a check for how many equips a card has, added a fix for a typo in affinityswamp. 2010-09-17 17:37:18 +00:00
omegablast2002@yahoo.com
b507053a1d fixed storm spellcount, affinity/manaredux invis mana, added true "retrace" added 3 new extra cost types. 2010-09-14 17:15:33 +00:00