Commit Graph

1006 Commits

Author SHA1 Message Date
omegablast2002@yahoo.com
6399917d25 changes:
added abilities:
proliferate
ProliferateChooser:new targetchooser for cards with counter and poison counters "proliferation".

MenuAbility:new internal ability to create custom menus of abilities which can be activated in sequence one after another.

multikicker, syntax kicker=multi{b}
works with variable word "kicked", the amount of times it was kicked.

target=<number>tc,target=<upto:>tc,target=<anyamount>tc,target(<number>tc),target(<upto:>tc),target(<anynumber>tc);
multitarget is now supported with the exception of "devided any way you choose" which can not be supported becuase we allow detoggling of targeted cards with a "second" click....so you can not click the same card 2 times to add it to the targets list twice for example.
this is minor, as the bulk of multitarget is not "devided"
removed 's' parsing for multitarget, added a limit of 1000 to "unlimited" for easier handling; we currently can't handle activation of an ability on a 1000 cards very well on any platform(infact i don't suggest it)

Countershroud(counterstring), this MTGAbility allows you to denote that a card can not have counters of the type "counterstring" put on it.
"any" is for no counters allowed at all. this is a replacement effect. cards state that they can still be the targets of counter effects, however on resolve nothing is placed on them instead.

@counteradded(counterstring) from(target):,@counterremoved(counterstring) from(target):: these are triggers for cards which state "whenever you add a counter of "counterstring" to "target"; added counterEvents struct; 

other changes:
added support for ai handling of multitargeted spells.

changed a few of delete( into SAFE_DELETE(, safed up a couple areas where they did not seem safe to me;

added better handling of menus presented to ai, it will try to select the best based on eff returns.

added varible lastactioncontroller for ai use, it keeps it truely from ever tripping over itself and brings ai more inline with MTG rules.

converted TC into a protected member.
added "abilitybelongsto" string to tc, and set "owner" of the tc. a tc should never belong to "no one" it should always have a owner.
abilitybelongs to string is solely for easier debugging, i found it was a pain to never know what ability created a tc while i coded multitarget. the owner of the tc is the only one that should be using it, if an ability needs to declare the opponent as the owner (choose discard which is currently unsupported for example) this will allow us to better handle that situation by setting the tc owner in the ability which called it.

rewrote the logic of "checkonly" in ai choose targets, the only time it is "checkonly" is when it is trying to see if it had a target for a spell before it cast it, i now set this in the actual function call instead, the old method was far to error prone.

wrote logic for ai checking of menu objects presented to it,
ai will now make better choices when a menu is presented to it based on what it already knows. this changes it from it's old method of "just click the first option".

taught ai how to use multi-mana producers such as birds and duel lands by adding a method for it to find it's mana for a payment. it can effectively use cards like birds of paradise and sol ring(without locking up). It's primary method of pMana searching was maintain for performance(no need to deep search if we have it in pMana).

added a vector to actionlayer to store mana abilities for pMana. this provides us with a dramatic improvement when mana lords are present by reducing the amount of objects that need checking when ai checks pMana.
with 80 mana objects and a ton of lords one instance i checked went from 8000ish checks down to 80<===big difference.

added "tapped" green coloring(sorry i missed that!)...added red coloring to current actionLayers current action card (usually the source).

changed "type(" restrictions second amount from atoi into wparsedint for more flexiable coding.

add "&" parsing to CD targetchooser, removed "iscolorandcolor" variables and functions becuase they were a hack the real fix was this.
cretaure[dragon&black&blue] a creature that is a dragon, and black and also blue.

changed some of the ai computeactions and
removed unneeded gaurds in ai chooseblockers, they did more harm then good.
2011-09-01 20:03:26 +00:00
wagic.the.homebrew
0bc6352d62 - Fix a bug with story mode not able to find (unzipped) campaigns 2011-08-22 12:33:39 +00:00
wagic.the.homebrew
e27cf56fa2 - Support for Zip Filesystem. It is now possible to zip the entire Res folder ("store" method preferred, zip so that the root of the zip has ai, player, etc...) in one single file for read only. Write access is done in another folder (hardcoded to be User/ for now, can be updated depending on platforms, etc...
-- zipFS has several limitations...
--- in a general way, seekg doesn't work... so getting a file's size needs to be done through JFileSystem.
--- getLine on files open with zipFS doesn't work so great. Not sure if it is a normal issue because files are open in binary or not... JFileSystem therefore offers a "readIntoString" function that needs to be used instead of the usual "getline" technique. However getLine can then be used on a stream connected to the string.

-- tested on Windows and PSP, I also made sure android still works, but haven't tested zip support on Android.
-- I tried to maintain backwards compatibility, but this might break on some platforms, if I broke some platforms and you can't find a way to fix them, please contact me and we'll figure something out
-- This removes wagic::ifstream. I didn't reimplement the securities that were involved in this, apologies for that. Might be useful to reimplement such securities in JFileSystem
-- I haven't tested options/profiles in a deep way, it is possible I broke that.
2011-08-21 09:04:59 +00:00
Xawotihs
2c34a88ff0 Reuse swipe code of Android with Qt, associate "swipe left" to "other cards" in the shop. 2011-08-14 18:13:28 +00:00
Xawotihs
c188b4d104 Fixed "Werror" related compilation problems on Linux and Meego. 2011-08-14 18:09:02 +00:00
Xawotihs
8f1e97f8f9 Fixed compilation problem with VC2010 2011-08-14 14:42:37 +00:00
Xawotihs
f1b44d5330 Trophies icon usable by click/touch 2011-08-12 23:00:31 +00:00
Xawotihs
6631452067 Fixed undefined NEW compilation problem 2011-08-07 20:42:35 +00:00
wagic.the.homebrew
765b6b0412 - Moved Cast Restriction variables "out" of CardPrimitives (replaced with a pointer). This frees 64bytes off of CardPrimitives on Windows, I assume something similar on the PSP, which gives a result of more than 500kB freed
- fix for issue 716 (text not rendered in some cases) 
Test suite passes
2011-08-07 05:05:28 +00:00
wagic.the.homebrew
9f3a42d0c6 - removed "image_name" variable from MTGCard. this should free roughly 200kB with the current amount of MTGCard objects we have. (Which counterbalances the "roughly 150kB in Introduced in CardP Primitives recently :( ) 2011-08-07 04:01:56 +00:00
Xawotihs
eac5a35b43 Cleaned up my phasebar code and merged it into the overall item selection code 2011-08-04 05:57:10 +00:00
omegablast2002@yahoo.com
46dfe03099 fix psp build, guiphasebar int order error. 2011-08-03 16:27:28 +00:00
Xawotihs
097c40149d Phase bar is now clickable/touchable and animated. 2011-08-01 21:26:12 +00:00
wagic.the.homebrew
78efba08b1 - fix for counters slowness on psp 2011-07-30 14:29:12 +00:00
wagic.the.homebrew
794be140ce - graphical representation of counters. see graphics/counters/quest.jpg for an example
- rewrote some code dealing with text formatting for a card when rendering in text mode. I could swear my code has been reverted. If somebody has good reason to believe we should re-process the string formatting on every frame, please let me now. I believe my change can help rendering speed of text mode a lot.
- counters change to vector instead of array
2011-07-29 17:43:45 +00:00
wagic.the.homebrew
9631171ad1 Cleanup of some Trigger code 2011-07-28 13:51:42 +00:00
omegablast2002@yahoo.com
2e5222bf5d fixed an issue with @discarded...the trigger would only fire once becuase i was not passing the constructors variable for once to the object.... 2011-07-28 11:30:37 +00:00
wagic.the.homebrew
ef5e011e23 - Removed "isClone" flag. This flag was error prone. The "core" classes now have decent copy constructors, and ideally long term we should create copy constructors for the abilities that have additional pointers in them.
-- The test suite passes but this is a big change. I might have introduced some memory leaks or bugs. I might have fixed some bugs, too
2011-07-27 14:31:27 +00:00
omegablast2002@yahoo.com
444d13b457 added an "ifnot|if then" ability, with the option to turn on kicker payment menu choice, it created issue with the cards which were using the "kicker" workaround to show that a card was cast...
the ability checks against any of the current cast restriction checks and is written in the following syntax
example phaige the untouchable is 
auto=ifnot casted(this) then wingame opponent
if|ifnot condiation then ability
this can also be used in && abilities such as this card
pulse of the grid
auto=draw:2 && target(*|myhand) reject && if type(*|opponenthand)~morethan~type(*|myhand) then moveto(myhand) all(this)

this adds a few cards in its current state, though the aim for this ability was removing the use of "kicker" workaround for cards like the divinity creatures.
i plan to extend this to support such effects as "if spentmana({b}{u}) then effect....and other conditional checks currently not possible even with workarounds.

I'm committing these now since im working on abilities for kiaos mod and don't want to have a 20 page changelog.

also added missing text to binding grasp, it was thought that it was bugged becuase it simply "ended" its effect....however this is a confusion since the effect was ending due to upcost not being paid, however the card text did not reflect that it had a upcost....
2011-07-23 10:36:03 +00:00
omegablast2002@yahoo.com
bd1c31b6f9 moved the parsing of cast restriction into abilityfactory and out of mtgability...this is so new abilities can take adventage of these checks through the use of AbilityFactory af. 2011-07-23 09:03:33 +00:00
Xawotihs
c2879b0b6e Fixed a selection problem sometimes hapenning on the hand zone in touch/mouse mode and removed dead code. 2011-07-14 21:21:24 +00:00
wagic.the.homebrew
8c79e0644c Fix memory leak in ATransforms ability
- Blame is on me for the bad design behind the "isClone" flag, I need to get rid of that flag in the long term.
2011-07-14 13:49:46 +00:00
wagic.the.homebrew
3148a25f3a - Manual cache cleanup in the menu to help a bit with issue 693. This is unfortunately not enough, we are dealing with ram fragmentation problems here :( 2011-07-10 13:51:39 +00:00
wagic.the.homebrew
e84ad44e47 - Extended TutorialMessages into a message system that shows up every time a new game is started.
-- instead of tutorial(my message), use message(my message) for such messages. 
-- Counting on people to use it, now that it's here ;)
2011-07-10 01:55:20 +00:00
wagic.the.homebrew
8546f3dff8 Fix for issue 700 (Basic Lands randomly stop working) 2011-07-09 09:25:31 +00:00
omegablast2002@yahoo.com
f88178f2cf refactored the typemin: cast restriction, there was a reported bug with it and while debugging it screamed refactor.
so i converted it from string comparisons and counting the battlefield..into targetchoosers with declarable operator.
simplified the code from the mess it was before into something alot easier to card code with.

example before:
mytypemin:less type(land),opponenttypemin:* type(land)
becomes
type(land|mybattlefield)~lessthan~type(land|opponentbattlefield)

the new syntax is:
type(targetchooser)~operator~number
type(targetchooser)~operator~type(targetchooser)
the operator are:
morethan
lessthan
equalto
2011-07-07 11:39:06 +00:00
wrenczes@gmail.com
c5963c3c23 Three improvements involving image caching:
1) prevent the textureQuad map from containing references to cards when we're returning a temp (card backdrop) image in the threaded version.
2) we had two copies of the pspicon image in the cache (ie the regular & managed).  Changed the reference in the DeckMenu code to use the managed instance.
3) Fixed a problem with a default constructor param that would set RESOURCE_LOCKED on certain images.  I noticed that the 'NEW' image was locking itself in the cache because no resource modes was being passed in, so the default constructor param was setting it to locked.  This seems like a bad idea - if you're not explicitly locking a resource in the call, that shouldn't be the default behaviour.

Also added an assert safeguard to catch the possibility of 'overlocking' an image resource, as this probably means the image fetching routine is being abused somehow.
2011-07-07 07:37:17 +00:00
omegablast2002@yahoo.com
a59dec1500 added "once" support for the remaining triggers that did not have it.
this is basically one activation for the existence of the trigger, meaning if it is used on a card, and the trigger exist for inplay, it will only activate one time while that card is inplay, it will activate again if the card leaves play and is put back in play again by another effect, 
this was originally added for cards such as the hidden enchantment cycle.
2011-07-05 14:14:18 +00:00
Xawotihs
c25dfe426f Fixed issue 677 2011-07-04 19:09:19 +00:00
wagic.the.homebrew
52b83a135c - Added TutorialMessage ability
-- Tutorial Messages are an ability like any other, except it can only be displayed once. Subsequent calls are ignored, the ability is removed from the game as soon as it is added
-- This allows to add event triggered messages ingame. Messages are either text, or images (I don't have an image sample, but rules/classic.txt has a few examples that might help)
-- only tested on Windows, although I made sure the PSP version compiles. Hopefully I also made the necessary for it to work in the touch version (touching the screen should be enough to close the tuto message)
-- Room for improvement: possibility to choose a title in text mode, possibility to have some messages depending on others (e.g.: don't show message X until message Y has been shown), improve some of the abilities and triggers to give more flexibility, add events outside of game, to allow tuto messages in deck creator, etc...
2011-07-03 08:47:51 +00:00
Xawotihs
7bb49068b1 Use Will's scrolling support to add next phase (scroll up) and interrupt (scroll down) in the duel state. 2011-06-26 20:51:45 +00:00
wrenczes@gmail.com
741f662bb0 Tied in my recent Android flick gesture addition to a Scroll() function. GameState now has a virtual function OnScroll() call that, by default is a no-op; each game state can choose to override how to respond to flick gestures. I've added one such override in the Deck Editor so that a flick up/down acts like the psp button up/down for scrolling between color filters. 2011-06-15 09:52:11 +00:00
Xawotihs
4bf255596f Activated mouse tracking in option and award menus. Activated offset support in SimpleMenu, it should help for issue 674 2011-06-04 16:22:45 +00:00
Xawotihs
40208c4835 Fixed issue 674 for deck selection in menu by mouse/touch 2011-06-03 20:01:50 +00:00
wrenczes@gmail.com
bed971c84c Last of my warning cleanup - as of this revision, all warnings in the windows build are gone. I've turned on the 'treat warnings as errors' option in the mtg project to mirror our makefile behaviour on psp. 2011-06-03 01:07:48 +00:00
omegablast2002@yahoo.com
cb9e5f2e95 as requested by doc, added a tag for lords to allow an over-ride for effect so theyre not removed from the game by GameObserver until the lords remove it themselves.
ie:
Card Name:
Quick Sliver
Mana Cost:
Converted Mana Cost:2
Types:Creature — Sliver
Card Text:Flash
Any player may cast Sliver cards as though they had flash.

without an over-ride testdestroy removes the observer before it can be any use to us.

i only enabled this for the lords/this'es....
2011-06-02 23:46:44 +00:00
wrenczes@gmail.com
945c2601d0 Fixed the SimpleMenu to recenter itself as its default behaviour during construction. (You can still override it to position it explicitly if needed.) This fixes the bad alignment of the menu when you'd select single player & the hermit mode was unlocked. 2011-06-02 18:27:00 +00:00
wrenczes@gmail.com
5b8ecd0cf7 More warning cleanup - converted certain class functions to return bool instead of int where appropriate. Also fixed the sdl update() tickCount assignment that I just broke in my last checkin. 2011-06-02 07:01:42 +00:00
wrenczes@gmail.com
90b1058ad5 More warning cleanup (type to type conversion warnings). 2011-06-02 06:14:28 +00:00
wrenczes@gmail.com
4018d17370 more compiler warning cleanup. 2011-06-02 05:48:37 +00:00
wrenczes@gmail.com
a06558be55 Some warning cleanup involving (seemlingly unintended) bool to int conversions. It seems that the original design intent was to pass down IDs to the base class JGuiObject, but certain classes broke the pattern with their constructors.
(One could argue that this ID is completely meaningless and could be entirely ripped out, as the IDs obviously never made it to their intended target...)
2011-06-02 05:33:45 +00:00
wagic.the.homebrew
34311a4499 - Removing "mCount" variable from GuiLayers 2011-05-29 04:40:13 +00:00
wagic.the.homebrew
a84eb8dc22 -Fix for issue 583 (fireball crash)
-- converted an array into a vector to avoid weird edge cases
-- fixed bugs with array "backupTargets"
2011-05-26 12:27:44 +00:00
omegablast2002@yahoo.com
31ed7d38e6 removing unused variables... 2011-05-24 03:46:06 +00:00
Xawotihs
00aa339a1b Fixed linking problem 2011-05-23 18:14:04 +00:00
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
4793ba76bb taught ai how to use ability fizzlers such as Glen Elendra Archmage...reworked fizzle to cover both cases of ai trying to target a card on the stack. 2011-05-17 13:58:28 +00:00
wagic.the.homebrew
9b63553c3e - Minor code cleanup (removed AABanishCard class and unused banishmentType variables) 2011-05-16 23:41:52 +00:00
wagic.the.homebrew
480875d57a - Subtypes "getValuesById" now returns a reference
- Minor cleanup of Transformer per one of my comments a few days ago.
2011-05-16 23:19:08 +00:00
wagic.the.homebrew
2f3e6b56e5 - Fix for issue 660 (changelings have become slower)
-- I removed the string comparison, which was expensive (the test is not necessary anymore, since it was "shielding" us from fake types (names), which are not creature subtypes, and therefore do not go through). I also moved one function call outside of the loop, just in case that wasn't optimized by the compiler.
- Removed unused Subtypes.cpp function (I don't really want people to use it, it can be quite expensive if used incorrectly)
- moved a test for issue 501 that has been fixed a while ago (we forgot to add the test to the test suite)
2011-05-15 14:38:41 +00:00