Commit Graph

451 Commits

Author SHA1 Message Date
wagic.the.homebrew
0b66caebf2 Fix PSP compilation issue I introduced in my previous change 2011-09-23 00:15:32 +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
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
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
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
omegablast2002@yahoo.com
a6c458d0cb ifthen ability sometimes wasn't grabbing the right target, i now pass it through MTGAbility creations target.
also, i see now why targeted counter cost were left broken for so long. i think this way fixes it in all cases. what a pain.
2011-09-15 11:50:04 +00:00
omegablast2002@yahoo.com
d04b4eca38 ai bug fixes, minor refactor of phaseaction/phaseactionmulti/upcost/upcostmulti, counter cost was safed wrong, sorry!, and fixed parsing of upcost..it was chopping the last bracket of the cost when used for things like echo, it required us to add {0} to those cost...that is no longer required. 2011-09-14 20:35:04 +00:00
omegablast2002@yahoo.com
6ea7e00803 added countertrack(counterstring) MTGAbility
what this does currently is remove a counter of the type counterstring and when the ability is destroyed it puts the counter back for us.
meant for weapons used as follows.
auto=teach(creature) countertrack(0/0,1,hand)

when the creature is equipped with this weapon it will remove a hand counter from the creature, when you remove the weapon, or the weapon is destroyed or whatever...it will put a hand counter back on the creature.

added dualwielding thisdescriptor...
auto=this(dualwielding) 2/2
auto=this(dualwielding) firststrike

enabled "restriction{" on phasebased triggers @next and @each...

i will work more on countertrack to extend it to domains if it currently isnt possible to use it in this case(haven't tested it on domains)....
2011-09-13 14:33:13 +00:00
omegablast2002@yahoo.com
23f056f39c added restriction keyword "morbid" it has very specific rules that can not be done with current support...it can be used anywhere existing restrictions can be used....
example card..
[card]
name=Morkrut Banshee
auto=if morbid then choice target(creature) -4/-4 ueot
power=4
toughness=4
mana={3}{b}{b}
[/card]
2011-09-12 20:15:51 +00:00
omegablast2002@yahoo.com
a42abc3017 multitargeted effects that require a minimum amount of targets should always be directed to the target_ok_full check. they can not be ended early by clicking the source. 2011-09-12 16:08:11 +00:00
omegablast2002@yahoo.com
6a8f7374cb added weapon handling for connect, please be sure to code these weapons as follows
target=*|mybattlefield
auto={0}:equip
auto=connect
notice i declare the equip before the connect, this is becuase connect will use the equip ability of the card to handle it. 
target= can be used for connecting them now as the first time equip. please remember to use teach( or autoskill= to avoid giving abilities forever to a target...this makes equipments hybrid auras.

also, moved parentchildrule init from original init to rules.txt...
in yourrules.txt
should look like this:

include mtg.txt
name=Classic
[INIT]
mode=mtg
auto=connectrule
[PLAYERS]
auto=shuffle
auto=draw:7

i did this becuase i want to reuse the parentchild associations for mtgabilities...and if parents will always kill thier children, i won't be able to use it :P

changed connect into an instant ability, i don't want this ability to be done by menu choice.
2011-09-10 21:28:20 +00:00
omegablast2002@yahoo.com
c0e8dcb1c9 this is the first basic rules of kais mod.
added parentchildrule which currently only handles the removel of children if a parent dies, but will be extended to handle other actions based on event receiving that deal with child and parent association.

add keyword targetable ability "connect"
connect means "the source adds the target to it's parent vector, the target adds the source to it's children vector"
this can be multitargeted, so it is possible that 
"Big Bad Dragon" can live it 2 different domains. 
not sure if this was even asked for, but i thought it would be cool to be able to say
"to play big bad creature you need to give it 2 homes"
or
"big bad creature can live in upto 4 homes"
this adds a level of stratigy, becuase now big bad creature can have "all creatures which share a domain with big bad creature gain +2/+2"...or "all domains that city planner live in gain 1 capacity"
but also add the possibility of faster removel from a card like
"destroy all creatures on target domain".
i thought it would be a nice add to kai rules.

connect clears a target= on a card after connecting...this is to avoid abilities transfering to the target, unless you want it to effect the target like
"tap target domain as this becomes a inhabatant"
target=domain
auto=tap
auto=connect
auto=<==this line on will not be targeting the domain
2011-09-10 19:37:44 +00:00
omegablast2002@yahoo.com
1fefc33777 removed a compile error, variables that were unreferenced.
small add with big impact:
added the useage of castrestriction on triggers and activated abilities. 
this can be used to create such cards as library of alexandria. 
{t}:draw:1 restriction{type(*|myhand)~equalto~7}
and replace instances were we were putting false triggers on the stack from abilities which contained nested aslongas...
meaning cards like epic struggle, won't need to be triggered every turn even if you have no creatures...
for epic struggle here is an example of how to replace it
@each myupkeep restriction{type(creature|mybattlefield)~morethan~19}:wingame controller
any of the current cast and other restrictions can be used. this includes turn:1 <===and various others such as phase based checking.
syntax is 
restriction{ whatever casting/other restriction you want }
a nice quality of life fix for false triggers (which don't mean theyre incorrect, just annoying when they trigger when they will do nothing)
another example would be the triggers on cards like 
skullcage.
auto=@each opponent upkeep:aslongas(*|opponenthand) damage:2 opponent >4
auto=@each opponent upkeep:aslongas(*|opponenthand) damage:2 opponent <3
becomes
auto=@each opponent upkeep restriction{type(*|opponenthand)~morethan~4}:damage:2 opponent
auto=@each opponent upkeep restriction{type(*|opponenthand)~lessthan~3}:damage:2 opponent

now instead of triggering every opponent upkeep even without a resolve...it will only triggers when the restriction requirement is met.

enjoy :)
note:all test pass.
2011-09-09 10:34:05 +00:00
omegablast2002@yahoo.com
361373d579 try number 2 on reinstate, i only dynamic cast Mayability once now, and use it to check against all targets, this avoids calling dynamic cast 2 times per target. 2011-09-06 02:19:57 +00:00
omegablast2002@yahoo.com
fdfcaf854d changed a piece of logic back to it's original logic, the refactor in last commit broke some functionality in multitarget effects which have no test added yet. 2011-09-05 17:40:25 +00:00
wagic.the.homebrew
5498187200 - Fix a bug making some mana abilities interruptible, introduced in r3869
- Cleaned up some code in MTGAbility.cpp
The test suite passes.
2011-09-05 13:25:01 +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
Xawotihs
c188b4d104 Fixed "Werror" related compilation problems on Linux and Meego. 2011-08-14 18:09:02 +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
9631171ad1 Cleanup of some Trigger code 2011-07-28 13:51:42 +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
11473e0fb5 added "while" tag to this's i added it to lords a while ago to fix a similar issue where the lords were taking on the "oneshot" variable of their abilities in cases where you really didn't want them too...
its basically an over ride....
2011-07-26 16:39:12 +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
omegablast2002@yahoo.com
e8b8079ef6 fixed a bug where you could equip opponents creatures with your equipment, it is quite possible that we have *always* been able too but no one has actually tried. anyways "myBattlefield" does not compare to "mybattlefield"...
i seriously think we devs should consider making all ability coding required lowercase. not card names and text, but coding such as targetchoosers "thisForEach(creature[Black;White]|myBattlefield) moveto(myGraveYard) ...<---this is not uniform...and leads to people using such coding in the source ....i think i suggested this once and was instantly shot down...however, this is the 2nd instance where a bug has arose from the comparing of capitalized vs lower case..becuase we all assume that every line is going to be dropped to lower case as the game reads them.....
2011-07-20 17:17:52 +00:00
omegablast2002@yahoo.com
ff1a1dde86 updated a piece i forgot for type( restriction. this fixes feast for blood. 2011-07-11 12:59:44 +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
dbbf5e4cb6 added the support to fix avatar of might...you can now do
otherrestriction=type(creature|mybattlefield)~lessthan~type(creature|opponentbattlefield)-3

which means, if the statement above is true you can play the card....if you subtract 3 from the amount the opponent has in creatures, and you are still less then the opponent...then that means he has atleast 4 more creatures than you do.

so right after the type(blah) you can add +number or -number...and it will modify the amount to compare.
2011-07-08 10:47:28 +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
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
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
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
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
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
24049d3da4 fixed a reported bug with blood chief accession, the cause was a goof up in logic, in the refactor to this section, foelost( parsing was changed to be its bool for lifelost....however since it was changed and we now didn't declare that "foelost(" was "found"...found was a null variable when we tried to atoi it.... 2011-05-19 12:35:35 +00:00
omegablast2002@yahoo.com
426cc68950 fixed a bug where "becomes(" was no longer giving more the a single ability to a card, example, inkmoth nexus would only gain flying, and not gain infect, this i imagine was due in part to a goof up...we split the string at the top by comma, in the refactor for this section it was changed to be either "" or becomesblah[2] <--this is incorrect, becuase what if a card would gain 2 abilities or more ...the we need to append the rest of the split portions back into the abilities string for adding.
also a piece that didn't get in my last commit, nothing big just 2 lines...not sure why on earth it didn't commit them before...
2011-05-19 12:17:53 +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@gmail.com
1ee3c9eccc - revert r3645
- fix memory leak in GenericInstantAbility
2011-05-11 08:06:53 +00:00
omegablast2002@yahoo.com
2c9d029bdc fixed a memleak introduced in r3639..
i also changed the logic behind wololo "ueot " instant ability creator...instead of sending it directly to genericinstantability i created a new class called AGenericInstantWrapper...which handles the adding, cloning, removel ect, exactly how we have always handled "instant abilities"...this should correct any further "odd edge case" issues with the new "ueot " code...

later i will varify if it works with every single ability we current build with a wrapper class...and see if i cant remove them all and convert "ueot " into the NEW until end of turn handling method....lets cross our fingers as it would remove ALOT of extra code if successful....
2011-05-10 18:52:51 +00:00
omegablast2002@yahoo.com
01cfbf5a02 couple bug fixes, changed a subkeyword of transforms "removesubtypes" to "removealltypes" remove all the types of the card, added "removecreaturesubtypes" to maintain previous support it was used for. 2011-05-09 15:55:34 +00:00
omegablast2002@yahoo.com
27df1e9172 removed a check that was causing gem hide sliver lorded manaproducer to not reacttoclick...i moved the check for extra cost to activatedability, so this became obsolete.... 2011-05-08 11:59:08 +00:00
techdragon.nguyen@gmail.com
82058e97c5 * fixed some formatting
* pruned out unused local variables. 
----  There's no need to define something if it isn't going to be referenced. It consumes extra memory temporarily and more than anything is a potential cause for confusion down the road.
2011-05-08 11:56:25 +00:00
omegablast2002@yahoo.com
2c34aaf8a5 fixed a bug intruduced by a refactor to the parsing of transforms ability with caused "newability" to be split incorrectly...im sure it was a mistake, or maybe rushed? at the point this code is "parsing between" the abilities have already been split up...all we do here is erase the "newability[" and last of "]" from the string.... 2011-05-08 09:32:07 +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