Commit Graph

3734 Commits

Author SHA1 Message Date
Xawotihs
d47ece1202 Fixed rules parsing on Windows 2011-10-01 15:06:24 +00:00
Xawotihs
b36653787e Fixed compilation problems on Window 2011-10-01 14:24:07 +00:00
Xawotihs
9adb9d625d - reworked the testsuite and the rules (storyflow) to use the same game deserialization code, moved that code to the players and zone classes
- removed every references to the gameobserver singleton. This object can now be instantiated several times as it's needed for minmax. To be able to do that, I mostly added a reference to a gameobserver from any targetable object (cards, players, spells) and abilities.
2011-10-01 13:30:30 +00:00
wagic.the.homebrew
d6db0c4f63 Simplified some restriction-parsing related functions 2011-10-01 03:07:58 +00:00
solo81@web.de
d7e9ee7796 Changed the code of all cards with a trigger (@...) and ":aslongas()". Example: Bloodhall Ooze.
This is its new code:
[card]
name=Bloodhall Ooze
auto=@each my upkeep restriction{type(*[black]|myBattlefield)~morethan~0}:may counter(1/1)
auto=@each my upkeep restriction{type(*[green]|myBattlefield)~morethan~0}:may counter(1/1)
text=At the beginning of your upkeep, if you control a black permanent, you may put a +1/+1 counter on Bloodhall Ooze. -- At the beginning of your upkeep, if you control a green permanent, you may put a +1/+1 counter on Bloodhall Ooze.
mana={R}
type=Creature
subtype=Ooze
power=1
toughness=1
[/card]

This new version, using one of Zeth's latest additions ("restriction{...}"), shows to be a nice improvement concerning the ingame experience: NOW, the trigger will only show up in the interruption window if the restriction is matched. In the old version, it always showed up in the restriction window whenever the trigger potentially could trigger, even if the restriction was not matched.

"restriction{}" also gives us more options in coding new cards. This is one of them:

[card]
name=Library of Alexandria
auto={T}:add{1}
auto={T}:draw:1 restriction{type(*|myhand)~equalto~7}
text={T}: Add {1} to your mana pool. -- {T}: Draw a card. Activate this ability only if you have exactly seven cards in hand.
type=Land
[/card]

A famous and powerful classic! And you can for sure only tap it to draw a card if you have 7 cards in it.


Exchanged the Multikicker test for another one. The older one was doing trouble.
2011-09-29 21:16:24 +00:00
guzhenjie1@gmail.com
4ea2446a15 Corrected Sejiri Steppe. 2011-09-29 16:26:28 +00:00
omegablast2002@yahoo.com
3e58366430 corrected "mountains" ==>" mountain" 2011-09-27 13:38:21 +00:00
omegablast2002@yahoo.com
fea034281d added support for suspend x...
suspend(0)={g}{x}

cards with x in thier suspend cards will suspend for x turns...x can not be 0 as per mtg rules.
2011-09-27 01:47:08 +00:00
solo81@web.de
29e9cad492 Fixed Tetravite token. 2011-09-25 21:15:45 +00:00
solo81@web.de
28dbb4de96 Fixed One-Eyed Scarecrow. 2011-09-25 21:01:31 +00:00
omegablast2002@yahoo.com
3417799eda removed the phase restrictions enum from activatedability, it inherited this from MTGAbility, the only difference is actiavted ability had opponentturnonly listed as 69, so in some cases it would be 60 and sometimes 69, it will now always be 60 following the enum in mtgability. 2011-09-25 17:02:39 +00:00
omegablast2002@yahoo.com
e2829102aa corrected the test, it was missing choice 0 to gain the life. 2011-09-25 16:57:35 +00:00
omegablast2002@yahoo.com
e117cf82c9 just moving parserestrictions under the parsecastrestrictions...so they are together rather then an entire page apart :) no code change, it just bugged me :P 2011-09-25 13:51:33 +00:00
omegablast2002@yahoo.com
3a2264febb just changing some comments in svn... 2011-09-25 13:41:12 +00:00
omegablast2002@yahoo.com
e8ea5a28d7 added a space to the parsing of who in @next and @each....this space always existed in the coding we use however i am now making it required, the reason is that now we have tool which can include tc's and "s" was finding opponent and my in the tcs effecting the triggeratphase it created. this should correct that issue. 2011-09-25 13:38:15 +00:00
omegablast2002@yahoo.com
96cbe18be0 taught ai basic extracost targeting...by basic i mean its not going to choose a token creature over its 20/20 flyer for the target of an extracost...it will target whatever it can for the cost. but atleast it can handle extra cost which are targeted now, rather then ignore them completely.
also removed a peice of aiplayer::render, that was moved into aiplayerbaka.....
2011-09-24 18:42:37 +00:00
solo81@web.de
404137b144 Added two tests for Morbid. 2011-09-24 13:34:08 +00:00
solo81@web.de
df3b2a7fa6 Corrected several card ids from ISD.
Corrected Grimgrins cost and text.
2011-09-24 12:27:44 +00:00
solo81@web.de
9938e1a57c ISDs _card.dat was missing the "_". Now it works. 2011-09-23 20:11:57 +00:00
omegablast2002@yahoo.com
f04a0dd338 better handling of cards with restrictions for ai. if we can't play it, then don't make it nextcardtoplay. 2011-09-23 19:48:17 +00:00
solo81@web.de
7ba6c8e85d Added Innistrad (ISD). 200 cards out of 264 were codable for now. 2011-09-23 19:12:26 +00:00
omegablast2002@yahoo.com
2bb651c5b4 fixed a crash in "white" rendering when you don't actually have the graphic for "white". 2011-09-23 19:05:10 +00:00
wagic.the.homebrew
eb13d9a0f9 - Mark "equipment" abilities as good for AI (used for MotD) 2011-09-23 10:54:01 +00:00
wagic.the.homebrew
fe88b747c0 - fix for ACounterTracker (this fixes the ability - it wasn't working before - as well as the memory leak)
- fix "release" build in VC++
- Let AI play creatures with ACounterTracker by making that ability a "positive" one (used for MotD)
2011-09-23 10:24:20 +00:00
wagic.the.homebrew
c633dc805f - Adding "connected cards" color rendering
- Made "booster" check mod-dependent in test suite
2011-09-23 07:24:24 +00:00
wagic.the.homebrew
0b66caebf2 Fix PSP compilation issue I introduced in my previous change 2011-09-23 00:15:32 +00:00
solo81@web.de
83cdf5c151 1) Removed all "{0}" from the upcost bracket of all cards with Echo. Once it was needed to work around a bug, but now that the bug is fixed.
2) Updated all {X}-spells with x targets. They are using "prex" instead of "x" now. Their code is now completely   
following the official rules.

3) Changed the code of most cards which search your library for a land card and put it onto the battlefield tapped.
They are using "and((tap))" now. More cards will be changed to that in upcoming revisions.

4) Added 2 tests to save "prex".
2011-09-22 23:34:11 +00:00
wagic.the.homebrew
f649fee465 - Minor refactor of a few files: removed some unnecessary calls, etc... 2011-09-22 10:07:05 +00:00
wagic.the.homebrew
ee4c7e23bd - fixed memory leaks introduced in previous revision
- removed incorrect casts of MTGCardInstance into Spell objects.
- AI Test system now allows you to put decks in ai/bakaA and ai/bakaB instead of ai/baka. This allows to let AIPlayerBaka and AIPlayerBakaB play with specific decks
- Test suite speed improvement. Improved the card name cache. Test suite now runs in 850 seconds instead of 950 on my machine.
- minor code cleanup
2011-09-22 04:43:05 +00:00
omegablast2002@yahoo.com
997b154d46 volcanic eruption updated to use prex 2011-09-21 20:28:01 +00:00
omegablast2002@yahoo.com
4419ed4637 changed some logic for getting the pre x without shellcasting(?) spell...the variable word "prex" now returns the difference between the cards cost and the curentmanapool...giving us the value of pre x.some cards might need updating, doc can confirm it.... 2011-09-21 20:27:29 +00:00
wagic.the.homebrew
15f0143a8f AIPlayer minor tweaks:
- In order to clarify getEfficiency, started creating "getEfficiency" functions specific to each type of ability (see example with Damager). This won't reduce the file size but should make things bit clearer
- Minor cleanup of getEfficiency
- bug fixes in getEfficiency
2011-09-21 15:10:06 +00:00
omegablast2002@yahoo.com
11095f3339 added new functionality to AAMover...
you can now do 
moveto(targetzone) and((ability)) 
moveto(mybatlefield) and((transforms((zombie,black)) forever))
2011-09-21 14:06:32 +00:00
omegablast2002@yahoo.com
ab7eb1b93e fixed an error in my last commit. 2011-09-21 12:37:44 +00:00
omegablast2002@yahoo.com
4dbe69dacf fixed ai mana finding which broke in previous ai changes(maybe during the split or fixing the memleak) 2011-09-21 12:12:34 +00:00
omegablast2002@yahoo.com
807e818e92 add the manapool at the end of gotpayments, only once. otherwise we get false amounts. 2011-09-21 11:07:41 +00:00
wagic.the.homebrew
e9ce574bca - Fix a memory leak in AI "payTheManaCost"
- Minor fixes in AI code
- Attempt at preventing the AI from interrupting itself while it's selecting targets. I don't know why this happens, and my fix didn't work. I believe it shouldn't be possible to interrupt when there is an active targetChooser, please let me know if this is an incorrect assumption.
2011-09-21 03:54:47 +00:00
omegablast2002@yahoo.com
206f3b4d3f fixed a crash that happens in thisforeach when the matches is a negitive value. 2011-09-20 17:03:31 +00:00
wagic.the.homebrew
44d9951246 Adding a system to compare two AI implementations (AIPlayerBaka and AIPlayerBakaB). This can be used to make sure a change to the AI is not making the AI weaker, for example. 2011-09-20 11:32:24 +00:00
wagic.the.homebrew
4c45e971c6 Fix missing file (AIPlayerBakaB) 2011-09-20 03:58:12 +00:00
omegablast2002@yahoo.com
e3e0233b8a changed a couple wParsed ints to assign the spell or NULL rather then relying in card to cast it as NULL. 2011-09-20 03:13:52 +00:00
wagic.the.homebrew
fbfac78b09 - Split AIPlayer and AIPlayerBaka in 2 files. Moved all "AI" specific code into AIPlayerBaka, as much as possible.
-- This is a copy/paste and shouldn't have any impact on the logic. I just moved some functions from AIPlayer to AIPlayerBaka
- Added back the possibility to select a different Resource folder with file Res.txt
- Fix a crash when a token id does not exist
2011-09-20 03:06:06 +00:00
omegablast2002@yahoo.com
839d197835 fixed the memleak i introduced. 2011-09-19 20:31:36 +00:00
Xawotihs
bb65d2dc12 - various compilations fixes for Symbian
- small cleanups of the TestSuite and Player classes
2011-09-19 19:49:45 +00:00
omegablast2002@yahoo.com
180462f73c bug fix for an issue with multitarget, after a multitarget ability resolves the first time, i never set the tc->done back to false, so the first card clicked will think it is done every time after the first.
setting tc->done to false after targetability resolve.
2011-09-19 11:32:11 +00:00
omegablast2002@yahoo.com
e0aa60070c ifthen targeting tweak... 2011-09-18 19:35:00 +00:00
guzhenjie1@gmail.com
5abc1293ce Corrected Crumbling Colossus. 2011-09-18 15:52:44 +00:00
omegablast2002@yahoo.com
c0ab80a1bc fixed a bug in targetchoosing where a player would get stuck in a targetchooser under certain situations as follows:
opponent play an ability, player interupts and clicks a card with TargetChooser which has no valid targets; player then tries to cancel targetchooser, instead the stack is displayed again, player is then locked in a TargetChooser unable to click other cards.

originally i was going to do it in the reactToClick however, after thinking about it, it made no sense to me that a targetchooser would be set and a cardwaitingfortargets would be set if you know ahead of time that no valid targets existed.

now when clicking cards which have TargetChoosers and no valid targets, no tc is set, and no cardiswaitingfortargets; instead return 0.
2011-09-18 10:34:40 +00:00
omegablast2002@yahoo.com
2b8d174bfa Reveillark updated 2011-09-18 06:58:29 +00:00
omegablast2002@yahoo.com
4ab6dfd3da extended countertrack and teach( to creatures for use with countertracking...isolated equipment rule that states it can't equip a card it can't target in testDestroy(we want the equipments to stay on a creature even after it's hands are full :)
I'll take a stab at coding the current cards for the mod this evening.
2011-09-17 23:27:00 +00:00