Commit Graph

3752 Commits

Author SHA1 Message Date
punkeduard@gmail.com
71bab2ba7b fixed cards:
Bloodcrazed Neonate
Greatsword
Kite Shield
Swiftfoot Boots
Pride Guardian
2011-10-04 07:20:03 +00:00
omegablast2002@yahoo.com
bf42cc1922 updated rules. 2011-10-03 13:14:03 +00:00
omegablast2002@yahoo.com
fe91960980 moved all basic MTG related rules out of the engine and into rules.txt.
this allows users to create a mod without having to struggle with avoiding certain phase based or cost actions.
attackrule and attacker phase can be seperated now by not including auto=attackrule in your rules.txt....this means you can still have an attackers phase, but clicking the cards won't put the cards into attacker mode or add "attacker" to thier menu abilities. ect...

this also allows us to eventaully change/add to these base rules without having to create entirely new rules for them by modifying the base classes with new variables and so on.

IMPORTANT: UPDATE YOUR RULES FOLDER, OR NOTHING WILL WORK FOR YOU.
2011-10-03 13:13:37 +00:00
Xawotihs
74f17946c9 Commented out my wonderful deserialization template for the moment as it
causes problems on Windows
2011-10-02 16:12:22 +00:00
Xawotihs
86131f7ea0 Cleande up the deserialization code 2011-10-02 14:11:30 +00:00
guzhenjie1@gmail.com
7e1566fe77 Corrected Carrion Beetles and Reveillark. 2011-10-02 11:07:15 +00:00
wagic.the.homebrew
2cabab17e2 - Fixed Skirsdag High Priest's id. This is the last fix for issue 741 2011-10-02 09:11:50 +00:00
wagic.the.homebrew
3decbe7f1d - Fix Android compilation issues
- Added a "cachesize" option (not available from the menu, but can be manually edited in players/options.txt, for example cachesize=200 means 200MB of cache). The hardcoded cache on windows/linux is 20MB, which is not enough for Hi Res cards (60 is better, 200 is great)
2011-10-02 09:05:39 +00:00
wagic.the.homebrew
9e572ee416 - Moved "game mode" types of awards outside of a code, and inside of a configuration file (rules/awards.dat). No code is required anymore to create such an award (momir, hermit basic, etc...)
- fixed compilation errors in GameObserver (windows)
2011-10-02 01:03:45 +00:00
Xawotihs
483c767492 Fix players vector (had a couple of 4 players game with the new code), added more cleanup 2011-10-01 23:49:37 +00:00
omegablast2002@yahoo.com
76a8f406ec converted the player arrays into vectors, so we can test is a player is actually there at the time we are trying to access its variables.
this fixes 2 crashes I found, the first, 2 color random mode would crash on load.
2nd, ai vs ai testing would randomly crash, this should fix that also.
I noticed 2 color random mode is now trying to search for it's rules and sometimes flashes for a brief moment "error cant read file" or something like that....I could not find the source of that, it doesn't cause it to crash however it causes it to take a sec longer to load, this is before this commit btw, so the issue is still there.
it was trying to load the rules, flashed the error then crashes...i fixed the crash but not the rules error.

please review, i might have left in useless stuff...
I also did notice something, the way we are creating players is kind of all over the place. imo this is bad, it made this conversation extra hard becuase you create one player over here, another type over there, the human over in this direction, back track and create another somewhere else...this needs to be taken into account for a refactor, all player creation should happen in the same function, and at the same times...

the reason these 2 crashes existed was becuase players were being created before "gameobserver" in some modes, and in other modes, no player would exist at the time game was creating to set the player. but we then later call the same function when we actually load the player using the method specific to a mode.

this just leads to headaches, I mean no offense, just a general observation i made when converting this players array. unfortunately that kind of refactor is just a little beyond my coding ability.
2011-10-01 21:29:22 +00:00
omegablast2002@yahoo.com
70ab70651a fixed a few bad lines in mtg.txt...doc, elvish baserker had some pretty interesting abilities. 2011-10-01 21:28:05 +00:00
Xawotihs
bf37948823 Fixed shop touch/mouse support 2011-10-01 21:22:34 +00:00
omegablast2002@yahoo.com
fe20ae0c24 fixed a crash when AiAction calls player->getObserver in multiclick.
important note: AiAction you always want to call "owner" becuase "player" here means single target spell has a target and the target is "player". I didn't come up with the variable name, sorry it is very confusing in this spot of the code.
2011-10-01 18:42:43 +00:00
Xawotihs
0d279cbf42 Forgot header in previous commit. 2011-10-01 17:57:31 +00:00
Xawotihs
0dc9c4e274 Fixed a leak introduced in r3976 2011-10-01 17:56:40 +00:00
Xawotihs
24df6bbb6f Fixed a crash occurring at booster purchase 2011-10-01 17:29:33 +00:00
Xawotihs
daf362f736 Simplified the parsing, now the TestSuite reworks on Windows. 2011-10-01 17:07:11 +00:00
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