58 Commits

Author SHA1 Message Date
Vittorio Alfieri
2ff2d4ac79 Added/fixed primitives, improved "anytypeofmana" ability for both player and AI and implemented "anytypeofmanaability" keyword to allow the user and the AI to spend mana of any color to activate abilities. 2021-01-15 18:25:38 +01:00
Anthony Calosa
151905c5f3 Transform Trigger, Turnlimit for TrCardAddedtoZone
Cleaned primitives, and fix SOI cards (remove workarounds) todo(recheck
BFZ and OGW)
2016-08-10 01:54:24 +08:00
Anthony Calosa
69db7f7384 Add support for reducing Hybrid cost
it doesn't remove the hybrid icons but it reduces the cost.
2016-07-11 07:55:12 +08:00
Anthony Calosa
4da7f77089 Cleanup tabs 2016-07-07 13:25:36 +08:00
zethfoxster
6ee00c138c Pretty huge patch here(sorry old habits never die :( )
lots of changes, many bug fixes,
first
added auto=count(targetchooser)
and countedamount wparsed int
they work together for cards where it is difficult to get working without knowing in advance how many we had ie: exile blah creatures, for each creature you exiled do effect.
auto=count(creature|mybattlefield)
auto=moveto(exile)
auto=draw:countedamount
it takes into account token creatures, which our old methods did not.

second, added "freeze" which is a "frozen" that automatically taps your target for you, for use when nesting or whenever needed where it was difficult to nest the ability with tap included.

added devotion for "iroas"

added reveal:x and scry x
reveal contains optionone/optiononeend ; optiontwo/optiontwoend ; repeat; afterrevealed/afterrevealed end.

this ability has heavy use of targetListIsSet(<amount>) and upto:amount, you MUST be certain that all cards being revealed have an action that removes them from reveal either in the first, second, or 3rd ability.
there are over 300 examples in the new card code, the ability is VERY easy to understand.

scry contains automatic put on top, put on bottom, then scrycore/scrycoreend which is an ability to fire.
it also contains keywords, dontshow which is nested in scrycore, scry reveals, puts on top or bottom, then reveal AGAIN, and does an effect, dontshow eliminates the 2nd revealing.
is also contains "delayed" keyword, which delays the ability until AFTER the core fires.

added bestow. update rules mtg.txt!!!!
examples are in primitives, every bestow card was supported.

added a new lord based on varibles and restrictions
while(restriction{morbid})
while(varible:blah)
this simplifies and expands on this(, allowing you to even use while(cantarget together and check if a card is targetable by the variable. examples are in primitives

added token(by card name)
auto=token(Eldrazi Scion) 
will search primitives and card dats for this card and give it to you as a token.
valid card dat info is still required.

added variable delirium
added restriction madnessplayed to allow checking if the card was played with madness.

added restriction "geared" for checking if a card has equipment on it.

added abilities words
skulk

menace <--cant be blocked except by 2 or more, if you dont block it with 2 or more we automatically unassign the single blocker and the creature is considered not blocked.

nosolo <--cant attack alone

mustblock <---if you dont assign as a blocker, we assign automatically the first thing it can block legally.

changed iscolorless back to "colorless"

enjoy, cards coming soon, theyre coded but im debating on not alpha sorting, cards being added this patch 965 uniques.

there is a section of the commit which was just VS2016 normalizing line ends, sorry if it makes it a cluster mess.
2016-06-28 18:40:55 -04:00
Anthony Calosa
4d3277f41b fix produce color
when you produce the chosen color, add mana of that color.
2016-06-23 17:44:50 +08:00
Anthony Calosa
0f74558892 Refactor & Fix Devotion
Fix Devotion Count example you have Mogis, God of Slaughter(2 B R),
Ashenmoor  Liege(1 B/R B/R B/R), and Rakdos Cackler (B/R) - will be 6
Devotion to Red and Black, since you count the symbol, B/R (hybrid mana)
should return as 1.
2016-06-11 20:39:56 +08:00
Anthony Calosa
cd1b629191 Fix Segmentation Fault & Formatting 2015-11-10 11:58:36 +08:00
Anthony Calosa
406f68ac5b Overload Cards
the alias is for the Overload Check and Alternate Cost Restriction...
???Bestow???
2015-11-09 19:04:31 +08:00
Anthony Calosa
60ba4e3eeb altercost should affect retrace, flashback, buyback costs 2015-11-04 06:41:59 +08:00
Anthony Calosa
fa14219e12 Fix for Devotion, added some "Chroma" cards 2014-12-05 10:18:05 +08:00
Xawotihs@gmail.com
98861dd916 Fixed memory leaks and refactored a bit the ManaCost class while I was at it. 2013-10-19 14:29:17 +00:00
pankdm
f7eded7417 Devotion mechanics (thanks to excessum for patch)
+ some refactoring:
extrManaCost --> ExtraManaCost
unattachCost --> UnattachCost
2013-10-18 06:37:09 +00:00
omegablast2002@yahoo.com
b61cd2f69a megapatch contents
added
"whenever a creature enters the battlefield you may pay {1}, if you do gain one life"
conditional may pay({cost}) effect 
this version is a super type ability, and can only be used in certain combos.

to nest you will need to use it in its subtype pay[[{cost}]] effect
pay keyword can have sideeffects coded as follows
pay[[{1}]] life:1?life:-1
pay one mana and gain 1 life, if you dont then you lose one life. notice no space between the abilities and the question mark.

added castcard()
a method to cast a targeted card, this contains the following subkeywords which can be used in combinations
(normal)
(restricted)
(copied)
(noevent)
castcard(restricted copied noevent) for example will cast a card that is a copy or the spell without sending a cast event only when the spell is castable.
"normal" subkeyword cast the actual spell, not a copy.

extended the use of exiledeath to everyzone, any card going from any zone to graveyard is placed in exile if it has exiledeath.

limited swipe left to open hand only when hand is closed view.

"moveto(" can now be named.
2013-06-18 01:41:34 +00:00
Xawotihs@gmail.com
eec9bb44a8 Fixed warnings from linux and Android compilers
Cleaned up network code on Linux, it still does not work correctly
2013-01-26 22:17:43 +00:00
omegablast2002@yahoo.com
d078872dfc this is the first draft of a simple ai combo system,
format is as follows

HINT#combo hold(blah|myhand)^until(blah|mygraveyard)^until(blah|opponentshand)^restriction{type(creature|mybattlefield)~morethan~2}^cast(blah) targeting(blah|mygraveyard)^totalmananneeded({g}{g}{r}{u}{2})

the ai can be told to hold more then one card, until as many condiations as you want are met, until( is a TC and can basically be used in a fasion of saying "hold arbor elf until you have a lord of atlantas in play and a gaint growth in you hand" 

once the condiations are met you can later tell it to cast(gaint growth) targeting(arbor elf[fresh]|mybattlefield)...

I also included the whole of the games restrictions system...
so you can get really really creative with this so far.

the next thing I will do is ability targeting and card favoring.
2012-08-19 21:53:57 +00:00
omegablast2002@yahoo.com
18cd8b5082 added limiting of x to a color to fix Consume Spirit from being able to use any color..
{x:black}
{x:color}

creating a snapshot of a card instance in garbage for stored cards, the issue with previous version was it was using base model value instead of what the storedcard was actually at the time it was in battlefield. example, animal boneyard test was coming up 1 toughness short becuase the creature storedcard pointed to was sent to graveyard for the sacrifice. 

changed myStored TargetChooser to use storedSourceCard instead, as this is supposed to point to the actual card and not a snapshot.
2012-04-07 05:16:55 +00:00
rodrigodemoura@gmail.com
45b4272c5e Include the Phyrexian mana display. Include more features in modrules.xml: Now is possible to change font color, Size. Include icon tag. Is possible select position to show the icon, size and where the image is stored
<item name="icon">
 <position x="0" y="25"/>
 <iconposition x="1" y="2"/> 
 <filename>menuicons.png</filename> 
 <sizeicon>5<sizeicon>
</item>
Issue: 663
2012-02-13 15:28:55 +00:00
techdragon.nguyen@gmail.com
228fe23e49 removed calls to ManaCost::init() as all but two are actually necessary.
moved init() from ManaCost to a private call
changed ManaPool method init() to Empty() to better represent what it does.  
renamed ManaCost::reinit to resetCosts() as reinit sounds like your are returning the ManaCost object back to initial state which is not what happens.  Only the cost related members are reset, the bool isMulti is left alone
2012-02-02 01:10:11 +00:00
omegablast2002@yahoo.com
fbebcd681e added a new aihint #HINT:dontattackwith(targetchooser)
which tells the ai not to use the targetible cards as attackers, this can be card names, and CD modes.

modified the way ai handles multikicker. it will not be casting 1/1 joragas anymore :D

made WParsedInt ignore "+" signs....

added a new affinity ability...autohand=affinity(creature[vampire]|mygraveyard) ....
this is essentially affinity for creatures in your grave.

added supkeyword to clone clone addtype(zombie)....it adds the type listed to the cards types on clone...

reparse PT bonus on resolve.

reworked bushido, it should now work correctly...aside from that it now excepts word variables...fumiko is now bushido(type:creature[attacking]:battlefield/type:creature[attacking]:battlefield)

added a keyword to access acontrolsteal..the keyword is "steal"
auto=ueot steal target(creature) 

reworked persist to handle undying..added the new counter handling rules intruduced by wotc in ISD


added a vector cardsAbilities to mtgcardinstance...this keeps the abilities added to the game for a card to use stored where we can easly alter or remove them.

added an automatic increase to geteff return if the ability is a putinplay ability.

finished coding support for flip and double sided cards, though viewing the "other side" is still not possible yet.
the ability follows the mtg rules.
the ability syntax is flip(card name)...a card can flip into any other card by name...even flip into itself.

added a "canPay() call for Ninja cost...to prevent it from coming up in a menu unless you're in blockers....

added 3 new restriction types that work very similar to type(
thisturn(tc)~morethan~2
lastturn(tc)~lessthan~thisturn(tc)
compare(wordvarible)~equalto~compare(wordvarible)

these are pretty self explanitory.

moved "&&" ability parsing below "this(" allowing "this(" to grant abilities now which contain &&...enclave egologist bug is fixed by this.

fixed an issue with combatspirit link for some reason the way i was doing the bool was not always working.

took care of the todo for AProtectionFrom...you can now give a protection from(blah) in a instant or ueot ability.

added altho very limited right now a "targetedplayer" tc word. i hope to increase this with time.

as always my sidekick doc already has some cards coded for this and test will follow the addition of the cards.
2012-01-31 14:07:40 +00:00
omegablast2002@yahoo.com
be33659081 fix for cumulative upcost, extra cost were not being multiplied
[card]
name=Phyrexian Soulgorger
auto=cumulativeupcost[{S(creature|myBattlefield)}] sacrifice
text=Cumulative upkeep - Sacrifice a creature. (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.)
mana={3}
type=Snow Artifact Creature
subtype=Construct
power=8
toughness=8
[/card]
was only charging you 1 sacrifice per upkeep.

added thisTargetComparison, this(cantargetcard(targetchooser))...its a thisdescriptor that compares if the card can be targeted by a target chooser...
2011-12-29 19:55:45 +00:00
rodrigodemoura@gmail.com
e6b199f599 Modifications to make the game more generic.
Included in a new modrules.xml tags.
 <cardgui>
   <background> Stores information concerning the colors </ background>
   <renderbig> Stores information to draw the card </ renderbig>
  <rendertinycrop> Stores information to draw the card </ rendertinycrop>
 </ cardgui>

 Change the variables array for vectors
2011-10-13 12:25:58 +00:00
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
wrenczes
0cb8c50b39 Replaced ManaCost's int array with int8_t. Shrinks ManaCost by another 24 bytes, which in turn lowers CardPrimitive's footprint by the same amount. 2011-05-04 10:02:47 +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
wrenczes@gmail.com
ba0f5c4191 Reduced ManaCostHybrid's internals to uint8_t instead of ints. Removed the hardsized array of ManaCostHybrid pointers, and replaced it with a vector of objects, got rid of all the unnecessary new/delete code everywhere.
Also deleted "extraCostsIsCopy" from ManaCost - unused variable.

Overall, drops ManaCost from 148 bytes to 120 (which in turn reduces CardPrimitive's memory footprint by the same amount, since it encapsulates a ManaCost).
2011-04-28 07:49:51 +00:00
wrenczes@gmail.com
6fbc019ecc Added object analytics around ExtraCost & ManaCost; some formatting style cleanup. 2011-04-24 10:33:38 +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
omegablast2002@yahoo.com
93d9347566 added "colors" to word variables
========================================
added a function to return the action element id by mtgcardinstance.
=======================================
refactored all 5 combat triggers to be handled in a single class, this change helps reduce the "bits and pieces" of trigger restrictions which some did support while others didnt, it also allows for easier editing and debugging if future code needs to be added to it.
refactored the parsing for the combat triggers also, so that a combat trigger can be built from a single object if it only contains "or"...amongst other reasons.
the new syntax is auto=@combat(blocking,attacking,turnlimited,once) source(TC) from(TC):effect...all the same words are still used, except they are now all included inside the combat(-----) this includes restrictions for the triggers. if a card still needs multiple triggers from some reason...it is still 100% allowed to have as many as you want, with whatever you want inside them...check updated primitive for examples.
the required sections are auto=@combat(atleast one trigger) source(TC):effect.

=========================================

moved the limitsperturn "limit:" from genericactivatedability up to its parent class activatedability, did this for the following reason
first rules correction, the previous method tracked uses on resolve, which is incorrect, it should count as the ability is fired and placed on the stack.
second, it keeps all the actiavted ability restrictions in the same place, this is the location we are checking summoning sickness, actived restrictions such as "myturnonly" ect. makes sense to handle it in the parent.
third, it allow any and all future activated abilities easy access to "limit:" if needed, it would only require adding a limit string to pass on construction to the child classes instead of recoding the same exact checks as genericactivated.
=======================================================
reworked "name(" so that it no longer is required to be used inside a "&&" ability, also it no longer will create a MTGAbility object with a false return. that was just dirty of me :/
enabled "name(" to replace the menutext of alternative cost. 
"other={cost} name(holy cow)"
will display "holy cow" instead of "pay alternative cost", this change is nice because we ended up using "other" cost for WAY more then originally planned...now we can label it exactly what it should say when you click it.
======================================================
added a subtype keyword for powertoughnessmodifier so that you can basically switch on non-static variables for it...lifetotal/lifetotal nonstatic...PT can now except all word variables as i added reparsing of the ints, had to maintain old methods as ai needs them to decide what to do with them.
======================================================
removed the following extremely redundant classes
both ABecomes classes---atransformer has become far superior to it, i kept the "becomes(" parsing tho, and it will act exactly as it use to, except now it has access to most of the subkeywords of transforms...it also now allows word variables. and excepts "forever" as a tag. added "newcolor" subkeyword to transforms to create the "becomes(" adding a color without removing colors effect. "becomes(" now returns a constructor for ATransformer that emulates becomes( exactly as it worked before.

both forevertransformer classes, the only difference between the 2 was one subkeyword, and "forever" did not return a "destroy()"...i recreated this in less then 4 lines and a bool. that was sloppy of me :( i guess we learn and improve.
============================================================================
i removed the parsing of card casting restriction from the first pass when cards load, instead of making it a cardprimitive object, i now simply pass the string through the card and build the restrictions when theyre actually needed and checked.
this change allowed for alot of clean up, removing enum and dependancy on cardprimitive, and combining both allowedAltCast and allowedtocast functions checks through a new function "parseCastRestrictions"...this change keeps all the cast resrictions in a single place, which makes it easier to debug or add if needed, and while i was at it, i enabled it so cards can now contain as many restrictions as you want *of the available ones* 
added "turn:" as a restriction to make it so "fourth turn" could actually be ANY turn you list, this allowed me to remove a dirty line of code which was checking if a card was o converted cost but had a suspend...lotus bloom...which can not be cast normally..for cards like this now you can use restriction=turn:200 or otherrestriction=turn:200....
=========================================================================
added Phyrexian Mana...svntax {p(r)} ....this will always be payable with 2 life, but if you have a red mana for this example, it will charge you the red mana instead...you can have any combination of P mana you want in any of the games manacost.
===================================================
reworked a bit of the ai logic i added, it now has true interrupting and can now correctly target for fizzles, Ai will go into full out counterspell wars with you now...
===================================================
added a ingame reward system with fancy flying text animations, they reward the player with actual credits, but are extremely hard to trigger off, theyre not meant to be something you see every 5 secs, but something that when you see them trigger you go "damn that was cool"
the triggers and effects are as follows
first the combo system:
you have to chain cast 5 or more card, without tapping or being interupted, tiny bonus for this..chain is broken as soon as you or your opponent tap something.
next combo level is
Abundant Resources - chain 10 or more spells same condition 
then
killer - chain 15 or more same condition
this will include a flying text render once a chain is successfully started (5+ cast)
this bonus can be triggered multiple times in a match

the next bonus is
+ //creatures entering play consecutively will allow you a chance 
+ //to gain a bonus for maintaining force sizes, it will trigger every 10th
+ //creature which enters play consecutively.
this is restarted every time a noncreature enters play.
the levels are as follows, 
Deadly Force Bonus! -10 creatures enter play consecutively
Extreme Infantry Bonus! - 10 creatures enter play consecutively and you maintain a force size of 20+
Malignant Conqueror Bonus! -10 creatures enter play consecutively and you maintain a force size of 40+
this can only be triggered once per level per match.

next bonus is given for having alot of a specific type come into play under your control during a match, this bonus only triggers once per match.
the levels are:
Toy Collector!
Beast Tamer!
Vampire King!
Lord of Swarms!
Master of Elements!
Zombie Apocalypse!
Sword And Shield!
Medic!
The Promenade!
Heavenly Host!
Teeth And Scales!
its pretty easy to figure out what each requires to trigger, teeth and scales for example is dragons, wurms, drakes, and snakes.
the final bonus is deal 100 damage from a single source in a single damage event, this one triggers only once per match.
============================================================
fixed the following bugs::::
regenerate was not working for non-creature regeneration ie:welding jar

ai would sometime get stuck in a infinate loop tho extremely rarely while deciding what to do, the cause 
if (clickstream.empty())
computeActions();
is NOT enough...ai should NEVER be computing actions (finding a card or ability to play) when it is NOT the active player..meaning, it does not have priority. 
g->currentlyActing() is the player that has priority. 
if (clickstream.empty() && g->currentlyActing() == this)...loop fixed :)

dynamicability had a couple weird results, from sources which dont have an amount to return, i now check this and if non, the amount is 0.

transformer will no longer add the same types a card already has..

removed an unneeded 
if (!activated) ....oris bug seems to be corrected with this change.

wrapped limitsperturn checks in a conditional to skip it if there is no limit string. 

added safer method to get the target of the combat trigger. the previous could potentially cause a crash if you interrupted the ability while the combat trigger was on the stack, it would do a call to "getnextopponent" and return a null pointer. i now send the opponent with the event. 

fixed a crash that would happen when a card did not have a type= line. having a type or subtype line is now optional. and highly recommended to avoid using "type=nothing"

moved a function call in buyback isreactingtoclick so that it checks if its in the hand before parsing the restrictions for it.

removed allowedtocast function calls from the alternative payment types, they are only supposed to check allowedtocast if it is something like "buyback" and kicker...not "you may pay this instead"....

corrected an issue with type: variable where it would add the amount depending on the activeplayer. to correct i added a method to call TargetZoneChooser::targetsZone( with a mSource...so that you can set the source card for the scan.

note: all test pass.
2011-04-12 20:54:34 +00:00
omegablast2002@yahoo.com
3f090c7be8 added basic suspend.
syntax
suspend(number of time counter)={cost}
suspend(3)={g}
2011-02-25 18:40:23 +00:00
techdragon.nguyen@gmail.com
4cbf3ddeb5 removed extraneous function. Not meant for last check in 2011-02-09 13:21:26 +00:00
techdragon.nguyen@gmail.com
2c0da5e7e6 added copy constructor with operator=
updated constructor for ManaCost*

TODO:  May have to look at ManaPool in case that needs updates as well.
2011-02-09 12:03:15 +00:00
techdragon.nguyen@gmail.com
767983631a * moved deck saving to end of match. It now only saves when you've actually completed a game.
* added additional meta data for decks when saving them back to file.
  - decks saved this way now are split into three regions: creatures, spells and lands.  It's more for a visual sorting if a
     player wanted to look at the deck outside of the game.  It does not impact the deck loading negatively at all.  It may
     increase performance in cases where the deck was previously defined using the canonical names of the cards as the numeric ids
     reduce the work done when looking up the cards by name.
* modified ManaCost toString method.
* added toString method for ManaCostHybrid ( possibly make ManaCostHybrid a subclass of ManaCost)
* added additional operator overloading for ManaCost for printing to cover ManaCost when it's a pointer as well as a copy
   ( TODO: might want to check if making usage of ManaCost as a copy as opposed to a ptr is really necessary in most cases. )
* added alternate version of "trim" to handle trimming temporary strings as returned by things like ostringstream.str().
 - This was necessary since the PSP compiler doesn't do the necessary adjustments for those types of calls.
2011-02-04 12:37:44 +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
techdragon.nguyen@gmail.com
e53c16f700 No code change just reformatting of header files.
finishing up my reformatting of the source from November/December following the guidelines that were posted.
some extra things I added:
   * Any empty virtual declarations were kept to one line.  
   * Enums were split up into separate lines to promote uniformity across all headers. ( each header file had a different style for enums)
2011-01-21 18:01:14 +00:00
wagic.the.homebrew@gmail.com
6d3d4c1792 Erwan
- refactor of MTGRules.cpp (buyback/flashback/retrace/alternative).
This change has been reviewed by myself, Wil, and Mike. The test suite passes.
More cleanup can be done, I will work on that later on.
2011-01-21 10:27:45 +00:00
wrenczes@gmail.com
2d30dece25 Sigh - revert out changes relating to my boost::shared_ptr experiments. (Did I mention I hate AnkhSvn? Why does it auto-select files in other changelists?? ) 2010-11-02 04:31:10 +00:00
wrenczes@gmail.com
1325fff26b Fixed the vs2010 solution - included newly added files to the project. 2010-11-02 04:28:32 +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
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
omegablast2002@yahoo.com
99da45f400 Added support for "buyback" and "flashback" with optional auto=buyback/flashback line support. 2010-09-10 18:00:37 +00:00
omegablast2002@yahoo.com
0b4dde558b added support for alternative casting cost, evoke, added support for phantom cycle,hydras, added support for exile/bounce as casting cost 2010-08-30 18:45:38 +00:00
wagic.the.homebrew@gmail.com
22a35d2265 Erwan
- Added remove/add counters as a cost, patch by Salmelo, thanks man!. See primitives/mtg.txt -> Thallid to see how it works
- added test for i286 by salmelo
- added basic display for counters (this needs improvement) by salmelo
2010-03-22 04:26:42 +00:00
wagic.the.homebrew@gmail.com
da9a82cff4 Erwan
- removed some unused code. Please review!
- Added protection from() auto keyword. It is still possible to use protection from [color] in abilities, but when it is not possible, please use protection from([target]) in auto=
2009-11-21 07:26:26 +00:00
wagic.the.homebrew@gmail.com
61cb849d33 Erwan
-attempt at issue 81. It will do for now
2009-10-04 08:39:34 +00:00
wagic.the.homebrew@gmail.com
9704ee4a24 Erwan
- opponentshroud small bug fix
- added "kicker=" line and "kicker" auto keyword. See Vines of Vastwood (ZEN) for an example. WARNING: kicker= line has to be AFTER "mana=" line
- daily build
2009-09-27 09:53:29 +00:00
wagic.the.homebrew@gmail.com
0dfa3f2e16 Erwan
-fixesRockslide Elemental, Welkin Hawk
-Added messages for Manapool updates
-Cleaned up ManaProducer code
2009-08-26 14:30:24 +00:00
wagic.the.homebrew@gmail.com
75720b9459 Erwan
-Fix for sacrifice costs
2009-06-09 14:07:07 +00:00
jean.chalard
dd054c4963 J :
* ostream printing of JGui objects.
2009-05-23 08:34:50 +00:00
wagic.the.homebrew@gmail.com
33e79e234e Erwan
- Cache size is now an option
2009-04-19 06:02:29 +00:00