3115 Commits

Author SHA1 Message Date
Vittorio Alfieri
8e551bb287 Added/fixed primitives, updated the "missing_cards_by_sets" folder, moved AI avatar images to main graphics folder. 2021-12-21 14:14:38 +01:00
Vittorio Alfieri
fa7a0daae1 Added Y22 set, improved Android downloader for Y22 set, added new restriction "librarycast" to check if a card has been casted from library, added new keyword "startingplayer" to retrieve who was the starting player, added a new ability "nodamageremoved" to avoid damage is removed from a card (e.g. "Patient Zero"), fixed a possbile crash when using "andability" option in "moverandom" ability (e.g. cards with seek abilites), added "myname" option to conjure "ability" to refer the orginal source card name (e.g. "Clone Crafter"), added new zone definitions "myhandlibrary" and "opponenthandlibrary" to refer same time hand and library zone of a player, added new ability "nonight" to avoid it can become night (e.g. "Angel of Eternal Dawn"), improved all cards with "it becomes night" ability. 2021-12-20 18:55:54 +01:00
Vittorio Alfieri
7fa03e620d Fixed several primitives, added a new Commander Deck for AI, Fixed an issue on "blink" return ability (e.g. "Otherworldly Journey"), improved "exerted" trigger adding "turnlimited" option, added a new keyword "losesatype" to remove a specific type from a card (e.g. "Conversion"), improved "vanishing", "fading" and "bloodthirst" keywords in order to allow the usage of variables (e.g. "Tidewalker"), added new triggers "poisonedof" and "poisonedfoeof" to handle the event when a player gets a poison counter, added new keywords "countershroud" to avoid a card can get any kind of counter, added new keywords "expshroud" and "energyshroud" to avoid a player can get one of those counters, added new option "uent" for "transforms" keyword ability to allow transformation effects end at the end of your next turn, fixed an issue on "swap" keyword when a non-creature card is firstly transformed into a creature (e.g. "Wandering Fumarole"). 2021-12-18 13:45:58 +01:00
Eduardo
8551f55636 Fixes to primitives
ancestral blade not attaching to token
etherium spinner token wasn't artifact
Ichthyomorphosis
Jungle Creeper must activate from GY
Lightning Skelemental crashed the game
Vedalken Plotter
Steel-Plume Marshal is only for flying
Venser emblem created by the AI lets the player exile
Markov Purifier was drawing two cards
Jace, Mirror Mage clone was legendary
2021-12-08 23:16:00 -06:00
Vittorio Alfieri
059107b007 Fixed DBL set. 2021-12-08 09:44:06 +01:00
Eduardo
a4670f0b82 Fixes to primitives
Enemy of Enlightenment type
Bereaved Survivor type
Suppression Bonds target
Wintermoor Commander effect
Tibalt, Rakish Instigator token damage target
Zurzoth, Chaos Rider token damage target
Dega Sanctuary extra "}"
Ephara's Enlightenment bounce
the caster of Swan Song was getting the swan, still not 100 % accuarate in case you want to counter your card
Estrid, the Masked untap
2021-12-07 00:43:06 -06:00
Eduardo
5421c0cfda Fixes to primitives
Zacama, Primal Calamity
phylath
Dowsing Dagger
domri's ambush
tireless provisioner
cemetery desecrator
deadly brew
2021-12-05 20:16:18 -06:00
Vittorio Alfieri
b8435778fe Fixed "Jandor's Ring" primitive, added DBL set, improved Android downloader. 2021-12-03 18:29:33 +01:00
Eduardo
68e08783c6 Fixes to primitives
portal of sanctuary
zacama desc
All that glitters crashed the game
Dread Warlock
Song of the Dryads no need to teach a forest add G
Cavern Lampad
Inspired Ultimatum crashed the game
Sever the Bloodline
2021-12-03 01:38:06 -06:00
Vittorio Alfieri
6c0740c78c Fixed primitives, avoided a crash when destroying "transforms" ability for cards in library, added random deck selection to Stone Hewer Basic mode, fixed random deck selection from Commander mode, improved exclusive color filter to include monocolored artifacts, added PSP_LARGE_MEMORY define to Makefile to allow more RAM for PSP version. 2021-12-02 18:55:53 +01:00
Eduardo
d969b6ce7a Bug fixes and Egg creature type update
Ironroot Warlord
Cauldron Familiar
Feasting Troll King
archway commons
song of the dryads goes to the graveyard after turning the creature into forest
crack open targets
Roc Egg, Dragon Egg,other cards with type Egg
atla palani
wayward sword can attack PW
birthing boughs does not create artifacts
psychic symbiont
syphon essence
saryth hexproof
2021-11-30 16:30:48 -06:00
Vittorio Alfieri
b5c1b09c04 Fixed "Oko, Thief of Crowns" primitive. 2021-11-26 13:40:03 +01:00
Vittorio Alfieri
e47f3f5471 Improved zones management for commandzone and sideboard (e.g. now the game consider those zone as all the others for every ability such as "lord" and "aslongas"). 2021-11-22 16:17:10 +01:00
Vittorio Alfieri
217a5aa93e Fixed primitives. 2021-11-21 23:13:33 +01:00
Vittorio Alfieri
d11facd7d4 Fixed primitives, added a new keyword "eval()" in ManaCost parser to allow the usage of a variable in the manacost (e.g. "{eval(evictmc)}" in primitive "Prototype Portal"). 2021-11-21 13:38:09 +01:00
Vittorio Alfieri
6ca5291790 Updated the changelog. 2021-11-19 16:17:18 +01:00
Eduardo
14103a840d Bug fixes on primitives
Vance's Blasting Cannons
Vona, Butcher of Magan
Niambi, Faithful Healer
bone harvest and similar cards add a choose 0 targets option
Arborea Pegasus
Arcbound Shikari
Keldon Raider
Aurelia, Exemplar of Justice
Mu Yanling, Sky Dancer
Voldaren Pariah
Yarok's Fenlurker
2021-11-18 20:06:17 -06:00
Vittorio Alfieri
31b3a7e785 Fixed typos in primitives text, improved Deck Editor menu' commands (now select button toggle the Sideboard/Commanders/Dungeons view while the Note Button open the quick filter), added a new menu' option in Deck Editor to toggle Grid/Carousel view (useful on PSP/PSVita). 2021-11-18 20:42:21 +01:00
Vittorio Alfieri
152dafc90f Fixed primitives, fixed a commander deck for AI, improved all cards with partner ability, added a "partner=" key to associate the partner to a primitive, added new keywords "withpartner", "partname" and "haspartner" to improve the Target Chooser for cards with partner, improved the Commander rules to allow double commander just with specifc partner, improved background images management for game settings, deck selection, deck editor background, post-match credits, deck editor selection and trophies room (now it's possibile to randomly use up to 10 background images). 2021-11-18 11:48:27 +01:00
Vittorio Alfieri
477ffa6a0c Fixed primitives, updated italian lang file, added a new setting to sort decks by creation date (by default they will be sorted by name), added new filters to match cards that don't contain a particular color or that are multicolored, fixed an issue when the transformation with uynt is triggered by instant/sorcery or by card that left the battlefield before the ability ending turn, fixed a rendering overlap on mana symbols in deck editor, fixed some crashes on ManaCost parser (e.g. Filter by mana producer). 2021-11-15 21:38:04 +01:00
Vittorio Alfieri
2eed51dea6 Fixed "Mana Hellkite" and added its token primitive, fixed token in VOW set. 2021-11-14 19:13:25 +01:00
Vittorio Alfieri
c55c9c2507 Fixed primitives, improved background images management for game settings, deck selection, deck editor background, post-match credits, deck editor selection and trophies room (now it's possibile to randomly use up to 3 background images and if the chosen image is not available, it will be rendered the default one). 2021-11-14 14:24:27 +01:00
Eduardo
96f7072a77 fixed primitives, several bugs and crashes
The Locust God
Pest tokens should be black not blue
Shabraz, the Skyshark
Arlinn Kord
Tovolar, Dire Overlord
mystic skull
golden guardian
blink of an eye
Got arctic treeline in momir, the only cards that should have rarity=L are basic lands or else you get them in momir since they have basic subtypes
storm the festival desc
rise of the ants
dryad's revival shouldn't be able to retrive itself or play with an empty GY
shiny impetus
malevolent hermit
whirlwind of thought
kiora's dismissal description
glorious protector
Aurora Phoenix is not a partner
Bastion Protector auto=lord(creature[iscommander]|mybattlefield) indestructible
Golgari Findbroker auto=target(*[-instant;-sorcery]|mygraveyard) moveto(ownerhand)
Ulrich's Kindred auto={3}{G}:target(*[wolf;werewolf;attacking]) indestructible ueot
Hard Evidence
King of the Pride auto=lord(creature[cat]|myBattlefield) 2/1
Lathliss, Dragon Queen auto={1}{R}:all(dragon|myBattlefield) 1/0 ueot
2021-11-13 22:40:07 -06:00
Vittorio Alfieri
9957719e0c Fixed VOW set, added new AI deck, improved Android downloader for VOC and VOW sets. 2021-11-13 20:25:10 +01:00
Vittorio Alfieri
8b91048d12 Fixed VOW and VOC sets, improved Android downloader for VOC and VOW sets. 2021-11-11 19:36:16 +01:00
Vittorio Alfieri
6d46467861 Added/fixed primitives, added VOW and VOC sets, fixed order index of CC2 set, updated the "missing_cards_by_sets" folder, added new keyword "findlasttype" to find the index of latest card with specified type in target player graveyard (e.g. "Timothar, Baron of Bats"), improved Android downloader. 2021-11-10 18:25:47 +01:00
Vittorio Alfieri
8012672a70 Fixed primitives, fixed a problem on "flip" ability for some backside cards (e.g. "Edgar Markov's Coffin"), added new keywords "pnumcreswp" and "onumcreswp" to calculate the number of creatures that have toughness greater than their power. 2021-11-07 22:13:39 +01:00
Vittorio Alfieri
f371295f24 Fixed a bug related to the "turnlimited" option on several ability triggers (e.g. Vampired, Discarded, etc.), restored some test of regression suite after this bug resolution. 2021-11-03 23:52:55 +01:00
Vittorio Alfieri
79e560e2b2 Fixed primitives, added new ability "exploits" to sacrifice a creature, added new trigger "exploited" and improved all primitives with Exploit ability, improved "tokencreated" and "sacrificed" triggers to allow "turnlimited" option, improved "flip" ability in order to keep track of current zone before flip. 2021-11-03 22:17:18 +01:00
Vittorio Alfieri
3baa6acaaf Fixed primitives, added new macro "_TRAINING_" for new ability "Training", added new trigger "trained", added "trainer" restriction to check if player controls an attacking creature with greater power than the current one, improved "ninjutsu" ability when the targeted card is already in play (e.g. "Olivia, Crimson Bride"), improved "flip" ability in order to add the "andability" option and in ordeer to prevent flipped auras go to graveyard, improved "andability" option for "imprint", "haunt" and "conjure" ability, improved "retarget" and "newtarget" keywords with "fromplay" option (to use with flipped auras e.g. "Vengeful Strangler"), replaced old "praidcount" and "oraidcount" with new keywords "pattackedcount" and "oattackedcount". 2021-10-31 21:40:37 +01:00
Vittorio Alfieri
051f498e54 Fixed "Mindbreak Trap", "Summary Dismissa" and "Obeka, Brute Chronologis" primitives. 2021-10-27 15:43:07 +02:00
Vittorio Alfieri
0824ea3984 Fixed a Bug in MusicExist method of GameStateDuel class when filename parameter was empty (this could lead to a wrong check on which soundtrack has to be played). 2021-10-23 21:44:28 +02:00
Vittorio Alfieri
63c5ff2789 Renamed some decks for AI. 2021-10-23 11:58:00 +02:00
Vittorio Alfieri
31530215a5 Renamed a deck for AI, fixed test suite (one test seems to randomly fail on AI choice without a real bug). 2021-10-21 10:51:30 +02:00
Vittorio Alfieri
78658a6a9e Added/fixed primitives, updated the "missing_cards_by_sets" folder, renamed several decks for AI, added "noentertrg" and "nodietrg" keywords to allow creatures enter the battlefield or die without causing abilities to trigger (e.g. "Hushbringer"). 2021-10-21 09:53:39 +02:00
Vittorio Alfieri
41a89c7324 Added "Spell Queller" primitive, updated the "missing_cards_by_sets" folder. 2021-10-20 16:26:31 +02:00
Vittorio Alfieri
3130049c63 Added Q06 set, improved Android downloader, fixed bug for indestructible creatures that have to go different zone after death (e.g. if they have exiledeath ability), fixed a bug when indestructible creatures have toughness = 0 (e.g. "March of the Machines" with manacost = 0 artifacts). 2021-10-20 14:52:15 +02:00
Vittorio Alfieri
fcb073ccd6 Fixed "Krenko Commander" and "Plane of the Apes" decks for AI, added a commandline trace to check which soundtrack file is currently playing. 2021-10-18 11:33:15 +02:00
Vittorio Alfieri
5bf5e1dfba Added a new deck named "Krenko Commander" for AI (credits to Bob). 2021-10-17 11:39:07 +02:00
Vittorio Alfieri
6d1e16441e Fixed "Cursed Mirror". 2021-10-15 17:47:13 +02:00
Vittorio Alfieri
316e2b21b4 Fixed "Sylvan Awakening", "Sylvan Library" and "Sylvia Brightspear" primitives. 2021-10-15 16:53:45 +02:00
Vittorio Alfieri
984aac51f4 Fixed all primitives with damage modifier, improved "damaged" trigger for Planeswalkers. 2021-10-15 13:36:31 +02:00
Vittorio Alfieri
eb35e3589b Fixed primitives, improved Aftermath casting rule: now the casted card becomes instant or sorcery in the stack according to the casted half, fixed a bug with the previous zone of cards casted using the "putinplay" option of "castcard" keyword. 2021-10-14 15:39:58 +02:00
Vittorio Alfieri
9c2eee7d7e Fixed primitives, added new ability "hasaftermath" to implement Aftermath cost with Flashback and refactored all cards with Aftermath cost (now they use a special version of Flashback but they don't count as flashback spell), added a new ability "spellmover" to implement all cards that have to target a spell on stack to move to some other zone (they are not real counters so they don't care about "nofizzle" or "nofizzlealternative" abilites of their target), fixed all primitives with "spellmover" ability, added a new keyword "storedname" to target card with a specifc previously stored name, improved "fizzleto" ability in order to allow to move the fizzled card on second place from the top or to exile and imprint the target name. 2021-10-13 23:42:45 +02:00
Vittorio Alfieri
fbcb1feb88 Fixed primitives, fixed "proliferate" target chooser, improved "cycled" and "discarded" triggers, added new keywords "pcycledcount" and "ocycledcount" to calculate how may cards have been cycled this turn from a specific player, added new menu choices to instantly select/deselect and confirm all the possible targets (in any zone) during the target selection of an ability (e.g. Proliferation ability can target a lot of permanents and players so using that menu choice all the targets will be instantly chosen and then the current player will be able to remove any of them or confirm the entire selection). 2021-10-13 17:39:48 +02:00
Vittorio Alfieri
371d4c9f85 Fixed and improved the Deck Importer (from MTGO) in Android application. 2021-10-12 16:32:26 +02:00
Vittorio Alfieri
c1f3913295 Added a new menu choice to instantly choose all the possible targets (on battlefield) of an ability during its target selection (e.g. Proliferation ability can target a lot of permanents and players so using that menu choice all the targets will be instantly chosen and then the current player will be able to remove any of them or confirm the entire selection). 2021-10-12 15:51:12 +02:00
Vittorio Alfieri
4623167b0f Fixed the Proliferation and Damageable target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar), fixed a Travis build toolchain error. 2021-10-09 13:31:30 +02:00
Vittorio Alfieri
4e18b6d799 Fixed the Proliferation and Damageable target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar). 2021-10-09 13:03:14 +02:00
Vittorio Alfieri
45b077e930 Fixed "Tergrid, God of Fright" primitive. 2021-10-09 00:50:05 +02:00
Vittorio Alfieri
1f6db30277 Fixed "Force of Vigor" and "Slogurk, the Overslime" primitives. 2021-10-09 00:14:29 +02:00
Vittorio Alfieri
fd76775923 Fixed a bug on deck choosing menu when an AI deck has no avatar image (it will be used "baka.jpg"), added new default avatar images for AI decks (up to 200), fixed "_PROLIFERATE_" macro and fixed all primitives with "proliferate" ability, improved the "proliferation" keyword for target chooser in order to avoid targeting permanents or players without counters and/or with some protections (e.g. hexproof, shroud and similar). 2021-10-08 23:01:37 +02:00
Vittorio Alfieri
aafaadb76f Removed the previous limit of 99 avatars images, if "avatarXX.jpg" image is not present, for deckXX.txt of AI it will be used "baka.jpg" image instead. 2021-10-07 15:07:00 +02:00
Vittorio Alfieri
99b501105d Fixed primitive "Armament Master" (issue #1075 opened by @remigiusz-suwalski). 2021-10-06 10:34:27 +02:00
Vittorio Alfieri
b84745e063 Added "--no-check-certificate" option to download the PSP SDK. 2021-10-01 18:01:19 +02:00
Vittorio Alfieri
89024241a8 Added/fixed primitives, updated the "missing_cards_by_sets" folder. 2021-10-01 17:53:28 +02:00
Vittorio Alfieri
c60ffba70d Added/fixed primitives, updated the "missing_cards_by_sets" folder, added missing Conspicacy cards and tokens in CNS set, added Conspicacy cards management, added new ability "isconspiracy" to identify the Conspicacy cards into the Sideboard, added "Conspiracy" type in "Subtypes.h" enum definition, added a fix in "GameObserver::Affinity()" method in order to avoid a crash when the card is a Conspiracy in the commandzone. 2021-09-28 16:22:13 +02:00
Vittorio Alfieri
d3fad48367 Fixed typos on "Teferi, Who Slows the Sunset" primitive. 2021-09-27 15:01:10 +02:00
Vittorio Alfieri
79d353d3ee Fixed a bug on game achievements percentage calculation. 2021-09-27 11:33:35 +02:00
Vittorio Alfieri
9e3caa635d Added new decks for AI, improved "genrand", "altercost" and "changecost" keywords in order to allow the usage of a variable instead of a simple number (e.g. "altercost(colorless, -phandcount)"). 2021-09-26 12:22:28 +02:00
Vittorio Alfieri
8ae7439978 Fixed changelog after pull merge. 2021-09-24 23:11:37 +02:00
Vittorio Alfieri
f9f1f0f53d Fixed changelog after pull merge. 2021-09-24 23:08:45 +02:00
Vittorio Alfieri
1efc38ef0f Merge pull request #1074 from remigiusz-suwalski/refactor-202d46176
Upgrade AI decks 3, 30-36, 38 to modern frames
2021-09-25 00:04:47 +03:00
Vittorio Alfieri
6538f1625e Fixed primitives, fixed MIC set, improved Android downloader, added "Dungeon" and "Emblem" types in "Subtypes.h" enum definition, added a fix in "GameObserver::Affinity()" method in order to avoid a crash when the card is null or if it's a Dungeon in the commandzone. 2021-09-24 23:03:54 +02:00
Remigiusz Suwalski
5810a36610 Upgrade AI decks 3, 30-36, 38 to modern frames
Initially committed in 89dae6523 (Nov 3, 2008) and 202d46176 (Sep 22, 2009).

Major changes done only in deck3:
- Castle -> Builder's Blessing (functional reprint)
- Ironroot Treefolk (vanilla 3/5) -> Spitting Spider (reach, 3/5)
- Thicket Basilisk (deathtouch 2/4) -> Kessig Recluse (reach, deathtouch 2/3)
- Pearled Unicorn (cmc 3, 2/2) -> Ronom Unicorn (cmc 2, 2/2)
- Scryb Sprites (flying 1/1) -> Scute Mob (1/1, +4/+4 with 5 lands)
- Shanodin Dryads -> Jukai Messenger (functional reprint)
- War Mammoth (trample 3/3) -> Rhox Charger (trample, exalted 3/3)

Also deck34 (Kobolds) was kept with original frames because Kobolds were never reprinted.
2021-09-24 19:20:21 +02:00
Vittorio Alfieri
cd677111b7 Fixed primitives, improved "@discarded", "@counteradded" and "@counterremoved" triggers in order to user "all(trigger)" target. 2021-09-22 18:56:43 +02:00
Vittorio Alfieri
6be219f586 Added/fixed primitives, replaced all occurrences of "AEther" with "Aether" in each ".txt" and ".dat" file according to the new naming convention (pull request #1072 by @remigiusz-suwalski). 2021-09-22 14:33:54 +02:00
Vittorio Alfieri
e2ac10be95 Fixed primitives, fixed STA set, fixed a bug in new background images management. 2021-09-21 09:24:38 +02:00
Vittorio Alfieri
832d033488 Fixed primitives, improved background images management, now it's possbile to add a different background for opponent deck choosing (menupanel2.jpg) and added a new sub-folder "background" for custom themes where it will be possbile to store up to six new background images for battlefield (from "backdrop1.jpg" to "backdrop6.jpg") that will be randomly choosen when match starts. 2021-09-20 15:36:42 +02:00
Vittorio Alfieri
e2a1705b3f Fixed a bug on sound tracks for PSP/PSVita devices, removed a test on vampired trigger due to a fake error on test suite. 2021-09-19 18:17:12 +02:00
Vittorio Alfieri
ff47c0dd44 Fixed typos in several primitives, updated the "missing_cards_by_sets" folder, fixed MID, MIC and CC2 sets. 2021-09-19 16:54:43 +02:00
Vittorio Alfieri
c2482a50f5 Added/fixed primitives, updated the "missing_cards_by_sets" folder, added MID, MIC and CC2 sets, improved Android downloader for new added sets. 2021-09-19 15:54:37 +02:00
Vittorio Alfieri
ddda01dd86 Added/fixed primitives, added MID, MIC and CC2 sets, improved Andorid downloader for new added sets. 2021-09-19 14:30:56 +02:00
Vittorio Alfieri
8cc3a5b4e3 Merge pull request #1070 from remigiusz-suwalski/refactor-89dae6523
Upgraded AI decks 7, 9, 10 to modern frames in a human-friendly format.
2021-09-18 18:44:11 +03:00
Vittorio Alfieri
1306a43f33 Added/fixed primitives, updated the "missing_cards_by_sets" folder. 2021-09-18 17:42:21 +02:00
Remigiusz Suwalski
06923a0824 Upgrade AI decks 7, 9, 10 to modern frames
Initially committed in 89dae652 (Nov 3, 2008).
2021-09-17 21:47:31 +02:00
Vittorio Alfieri
f671f61713 Fixed primitives, improved sound tracks management, now it's possbile to add a custom tracks for Shop section (Track2.mp3), Option window (Track3.mp3) and Awards section (Track4.mp3) and it's also possible to add two subfolders "MainMenu" and "Battlefield" within "suound" folder where it's possbile to add twenty custom songs ("TrackMenuXX.mp3" and "TrackDuelXX.mp3") that will be played randomly in main menu windows and when match starts. 2021-09-16 22:11:43 +02:00
Vittorio Alfieri
2af470e42b Fixed AFR, STA, STX and J21 sets, fixed "_PROLIFERATE_" macro and fixed primitives with "proliferate" ability, fixed all primitives with "mutate" ability, improved "proliferate" and "duplicatecounters" keywords, added a new target "permanent" to target togheter a player and permanents on battlefield (e.g. cards with "proliferate"). 2021-09-13 18:56:16 +02:00
Vittorio Alfieri
04a6a4bfe2 Added/Fixed primitives, updated the "missing_cards_by_sets" folder, added a new option "keepname" to keep the original name after the copy (e.g. Olag, Ludevic's Hubris), implemented a fix to avoid triggering of oneshot abilities when "flip" ability is used to return from a copy, fixed an issue with colors and "transforms" keyword, implemented a fix to avoid crashes when the card paying extracost has also a cost alteration (e.g. combo with "Pirate's Pillage" and "Ruby Medallion"), added a new keyword "totmanaspent" to return the real amount of mana spent to cast a card (e.g. Memory Deluge), added new keywords "pnumofidentitycols" and "onumofidentitycols" to return the total amount of commander identity colors for controller or opponent (e.g. War Room), improved "totcnt" keyword, added new keywords "totalcololorsinplay" and "oppototalcololorsinplay" to return the total amount of colors on controller or opponent battlefield (e.g. Moonveil Regent), added new keywords "pcoven" and "ocoven" to return if a player controls three or more creatures with different powers (e.g. Augur of Autumn). 2021-09-12 21:18:43 +02:00
Vittorio Alfieri
9aa15766d4 Added/fixed primitives, updated the "missing_cards_by_sets" folder, added new ability "hasstrive" to implement Strive cost with multikicker and refactored all cards with Strive cost (now they use a special version of multikicker but they don't count as kicked spell), improved "targeted" and "vampired" trigger to allow the "turnlimited" option, improved Android gesture to emulate "option menu" button pressure (slide down) and emulate "back" button pressure (slide up). 2021-09-07 21:41:24 +02:00
Vittorio Alfieri
9dabf121d3 Fixed primitives, changed type of "isFlipped" card variable from bool to int and fixed a related bug on targeting cards with "isFlipped" attribute, improved "disturb" ability (now fi you counter a card casted with disturb it correctly goes to exile), added "decayed" ability, added two new zone alias "mycommandplay" and "opponentcommandplay" for targeting Battlefield and CommandZone at the same time. 2021-09-06 17:31:36 +02:00
Vittorio Alfieri
ccae9673e6 Fixed bug that was not correctly showing the full Commander decks list in the deck choosing menu page, added a new gesture for Android to emulate back button pressure: now sliding from down to up for almost all screen size will trigger the back button in game (e.g. pause match in gameplay, going back from shop, and so on). 2021-09-05 01:15:01 +02:00
Vittorio Alfieri
c211b2eaa4 Fixed several primitives with "castcard" ability, fixed a bug when using "noevent" and "copied" options togheter with "namedcard" option in "castcard" ability, allowed the usage of "and!()!" ability with "namedcard" option in "castcard" ability for permanents, added "daybound" and "nightbound" abilities. 2021-09-04 21:14:05 +02:00
Vittorio Alfieri
cc16db7256 Added/fixed primitives, refactored and improved almost all transforming human cards (included all the Werewolves), improved "flip ability and "doubleside" ability adding a new "backside" option, fixed a bug on "doubleside" ability for planeswalkers, added "backside=" key to CardPrimitive in order to specify the other side of double-faced cards, added "hasbackside" option to target chooser in order to find cards which have a back side, added "dualfaced" that return 1 if a card has a backside card, fixed loyalty counter ability on planeswalker flip (is was not resolving correctly), changed type of damageToController, damageToOpponent, damageToCreature, wasDealtDamage, combatdamageToOpponent from bool to int in order to retrieve those values if needed, added "totaldmg" keyword that returns the total amount of damage dealt by a creature in the current turn, added new restriction "coven in order to check if a player controls three or more creatures with different powers, added new ability "hasdisturb" when the Retrace cost of a card is a disturb cost (e.g. "Beloved Beggar"). 2021-09-04 01:48:47 +02:00
Vittorio Alfieri
236f677f2a Fixed primitives, fixed some possible crashes on Commander Format. 2021-09-03 00:33:53 +02:00
Vittorio Alfieri
001cea95bd Added/fixed primitives, updated the "missing_cards_by_sets" folder, fixed several crash on Commander Format, fixed a possible crash using "and!()!" with "imprint", added a new macros "_REBOUND_" and "_GOAD_" related to rebound and goad abilities and refactored all cards using them, implemented a new keywords "haunt", "hasprey", "preyname" and "isprey" related the haunting ability and improved all cards using it, Added "commander" and "\*" to HINT castpriority for AI decks in order to allow the user to give a cast priority to commanders. 2021-09-02 19:32:45 +02:00
Vittorio Alfieri
54d0c32035 Added/fixed primitives, updated the "missing_cards_by_sets" folder, improved all cards with replicate (now they use a special version of multikicker but they don't count as kicked spell), improved all cards with "fizzle" and "fizzleto" ability and improved engine for "fizzle" and "nofizzle" ability (e.g. now it's possible to grant a card the nofizzle ability on stack), added new keyword "mycolnum" to count the number colors of a card. 2021-08-31 20:06:33 +02:00
Vittorio Alfieri
45de20c8d3 Added/fixed primitives, updated the "missing_cards_by_sets" folder, added a new trigger when a player shuffles his/her library, added new keywords "plastshlturn" and "olastshlturn" to retrieve the last turn a player shuffled his/her library, refactoring of some source files. 2021-08-30 23:02:54 +02:00
Vittorio Alfieri
e1f91a50f6 Fixed dat file for J21 set, improved Android downloader for J21 set. 2021-08-30 12:15:43 +02:00
Vittorio Alfieri
790f02905a Fixed dat file for MB1, PRM and PSAL sets. 2021-08-29 23:54:35 +02:00
Vittorio Alfieri
32008496b3 Added/fixed primitives, fixed dat file of several sets, updated the "missing_cards_by_sets" folder, updated README.md file, improved Android downloader. 2021-08-29 19:51:13 +02:00
Vittorio Alfieri
ebc281da6e Added/fixed primitives, improved the way to limit the number of total primitives to load at startup using the file named LimitedCardList.txt (that has to be copied in User folder). This should help to run the game even on older devices with low RAM such as PSP-3000 (It needs also a lighter graphics sub-folder in Res folder). 2021-08-28 16:34:22 +02:00
Vittorio Alfieri
8d6e0122bb Added/fixed primitives. 2021-08-27 23:47:47 +02:00
Vittorio Alfieri
1ce0facf21 Added/fixed primitives, Added keywords "showopponenthand" and "showcontrollerhand" to allow controller and opponent to play with their hand revealed, added "mytarg" prefix to check values for a card target as like we do for "storedcard" prefix (e.g. "Redirect"), fixed "undocpy" keyoword for all cards (e.g. "Renegade Doppelganger") that have to be back from a previous copy. 2021-08-27 00:29:47 +02:00
Vittorio Alfieri
bbc25e2727 Added/fixed primitives, Improved AI: now it can plays cards using morph cost too. 2021-08-25 15:30:44 +02:00
Vittorio Alfieri
c7c2025fc9 Added/fixed primitives, improved "TurnSide", "Morph" and "Flip" abilities when dealing with Commanders, added "fresh" attribute to cards just put in Sideboard, added a put back rule when a Commander is put in Sideboard, allowed to cast a card with kicker or alternative or morph cost from the CommandZone: in case of Morphed or DoubleFace cards (e.g. "Tergrid, God of Fright"), they will be put in play but they won't be Commander, but when they will be put elsewhere (e.g. destroyed) they may be back to the CommandZone with the usual Commander put back rule. 2021-08-24 22:43:55 +02:00
Vittorio Alfieri
6331b1daf4 Updated changelog with last 3 years of modifications (issue #1067 by @remigiusz-suwalski), added tokens in ELD set, improved Android downloader for ELD set, fixed primitives with "asflash" ability, improved all cards with adventure: now they become instants or sorceries in stack to activate the correct trigger (e.g. with Magecraft combos), added "nomovetrigger" ability for all the "fake" cards (e.g. cards which are simple abilities) in order to don't trigger any event on their cast since they are not real cards. 2021-08-23 02:26:16 +02:00
Vittorio Alfieri
c978223b10 Updated changelog with last 3 years of modifications (issue #1067 by @remigiusz-suwalski), added tokens in ELD set, improved Android downloader for ELD set, fixed primitives with "asflash" ability, improved all cards with adventure: now they become instants or sorceries in stack to activate the correct trigger (e.g. with Magecraft combos), added "nomovetrigger" ability for all the "fake" cards (e.g. cards which are simple abilities) in order to don't trigger any event on their cast since they are not real cards. 2021-08-23 02:18:04 +02:00
Vittorio Alfieri
cd9e5fb2e5 Fixed "Cunning Rhetoric". 2021-08-20 09:39:28 +02:00
Vittorio Alfieri
7d465bfbc4 Fixed a crash on "Tevesh Szat, Doom of Fools" primitive. 2021-08-19 23:51:26 +02:00
Vittorio Alfieri
bdba322558 Fixed "City's Blessing" macros, fixed "Jared Carthalion, True Heir", added new keyoword "noncombatvigor" for cards such as "Stormwild Capridor". 2021-08-19 15:45:30 +02:00
Vittorio Alfieri
d3167bb4f4 Added/fixed primitives, renamed "The Monarch" and "City's Blessing" cards in CN2 and RIX sets, added 2 new macros for Monarch abilites, refactoring of all cards with _ASCEND_ and _MONARCH_ macros. 2021-08-19 14:09:57 +02:00
Vittorio Alfieri
f4c27968a1 Added/fixed primitives. 2021-08-18 14:46:03 +02:00
Vittorio Alfieri
2f4869434c Added/fixed primitives and macros, fixed RIX and CN2 sets in order to allow images for Monarch and City's Blessing ebmlems, updated all cards with "Monarch" and "Ascend" related abilities, improved "token" keyword in order to allow the usage of "notrigger" option even when we are creating a named token, moved Monarch rules from general txt files to the specific Monarch emblem, improved Android downloader for RIX set. 2021-08-17 23:34:05 +02:00
Vittorio Alfieri
cb74126544 Fixed "Migratory Greathorn". 2021-08-16 23:08:36 +02:00
Vittorio Alfieri
2fe8a0e473 Added/fixed primitives and switched "Hound" type to "Dog" type. 2021-08-16 15:32:44 +02:00
Vittorio Alfieri
73d9173aa0 Fixed "Fabled Passage". 2021-08-15 14:28:20 +02:00
Vittorio Alfieri
f7ce614df8 Fixed "Chance Encounte" and "Tavern Scoundrel". 2021-08-15 13:40:37 +02:00
Vittorio Alfieri
d85f3f7743 Fixed "Shadowspear" and other primitives related to shroud abilities. 2021-08-15 13:09:58 +02:00
Vittorio Alfieri
54b6aa0437 Fixed J21 set, added/fixed primitives. 2021-08-13 23:43:37 +02:00
Eduardo
b84ddc5687 Misspell Battalion 2021-08-12 20:22:54 -05:00
Eduardo
b7f80f3851 New macros and primitives fixes
Fixes to whenever you draw your second card each turn, batallion
2021-08-12 20:16:29 -05:00
Vittorio Alfieri
a296db349c Fixed "Pox" and "Blast Zone". 2021-08-12 20:19:56 +02:00
Vittorio Alfieri
1e0928b227 Added a way to limit the number of total primitives to load at startup using a file named LimitedCardList.txt (that has to be copied in User folder). This should help to run the game even on older devices with low RAM such as PSP-3000 and PSVita (with Adrenaline). 2021-08-12 19:10:48 +02:00
Vittorio Alfieri
ecc5ddfe28 Fixed "Tevesh Szat, Doom of Fools". 2021-08-11 12:18:50 +02:00
Eduardo
730ddd2b50 Changes to Random modes and improved filters
Improved search restriction by type, allow you to search for "enchantment creature" or "legendary artifact", the engine no longer excludes or prevents searching two "types".
2021-08-10 23:36:23 -05:00
Vittorio Alfieri
b3b127ac2f Fixed "Tergrid, God of Fright" and fixed some typos in primitives. 2021-08-10 20:08:22 +02:00
Vittorio Alfieri
3219360cd7 Added ZNR showcase cards, improved Android downloader for ZNR set, fixed primitives: "Tyrite Sanctum", "Tergrid, God of Fright" and "Liliana, Dreadhorde General". 2021-08-10 15:42:57 +02:00
Eduardo
cd55b4342c Fixes to primitives
Deep Forest Hermit
Elvish Rejuvenator
Force of Virtue
Potion of Healing
Quakefoot Cyclops
the mending of dominaria
titan hunter
valiant knight
Mausoleum Turnkey
Infested Roothold  is cast not just ETB
Treasured Find should be exiled
Mu Yanling, Sky Dancer + ability
2021-08-09 13:52:47 -05:00
Vittorio Alfieri
1727e11091 Fixed Plaguecrafter and Steel Hellkite. 2021-08-09 12:09:02 +02:00
Vittorio Alfieri
9db4b9e2d4 Improved Android downloader for J21 set. 2021-08-08 00:53:14 +02:00
Vittorio Alfieri
b7e0fc6d8b Added/fixes primitives. 2021-08-07 17:32:51 +02:00
Vittorio Alfieri
0f9b4c6ab2 Added J21 set and added/fixed primitives. 2021-08-07 15:55:28 +02:00
Vittorio Alfieri
a82636b099 Fixed "Jolrael, Mwonvuli Recluse", fixed "Corrosive Ooze", added new keyword "all(myeqp)" in order to target all the equipments attached to a creature (e.g. Corrosive Ooze). 2021-08-07 13:42:28 +02:00
Eduardo
b97bd275e4 Macros for Enraged and Blocked
Removing macros that are not necessary.
Added enrage and blocked macross.

Corrosive Ooze didn't have a code and was causing problems.
2021-08-06 20:36:03 -05:00
Vittorio Alfieri
b70e03a5cf Added/fixed primitives. 2021-08-05 17:33:25 +02:00
Vittorio Alfieri
946557acf2 Fixed Muxus, Goblin Grandee, fixed Time Wipe. 2021-08-05 14:11:07 +02:00
Eduardo
f792729f80 Primitive fiexes and macros replacements
Removing typos in firststrike, @@ and ==.
death's-head buzzard didn't gave creatures -1/-1
ponyback brigade morphed created 6 tokens
Cavalier of Flame wasn't working
Duplicate ability in Lone Revenant
Macros for:
_ADDENDUM_
CONSTELLATION_
_FEROCIOUS_
_POPULATE_
_RALLY_
2021-08-04 19:57:55 -05:00
Vittorio Alfieri
4458a6e780 Fix Mulligan when Human player is not the first one. 2021-08-04 15:24:21 +02:00
Vittorio Alfieri
2ca03bb1f0 Fixed Muxus, Goblin Grandee and fixed Liliana, the Last Hope, added conjure keyword for J21 set, added perpetual counters and abilities for J21 set, improved imprint keyword, improved moverandom keyword for J21 set. 2021-08-04 12:33:28 +02:00
Vittorio Alfieri
e6ffd056b5 Fixed MED and THB sets and fixed Liliana, the last Hope. 2021-08-04 09:07:37 +02:00
Eduardo
46ec7dc0c6 Adding missing Planeswalkers to Mythic Edition and replaced code for _ATTACKING_
WAR OF THE SPARK MYTHIC EDITION  8 Cards missing
Replaced @combat(attacking) source(this): for _ATTACKING_all
2021-08-03 18:58:30 -05:00
Eduardo
8ab49e021f Fixed Flipwalkers and some macros replacements
Legendary creatures that transforms into planeswalkers.

_LANDFALL_
_HEROIC_

If Lotus Field enters the battlefield while you control fewer than two other lands, you must sacrifice each land you control, including Lotus Field.
2021-08-02 20:38:25 -05:00
Eduardo
fb64821e0c Fixes to primitives
kykar, winds's fury
Portal of Sanctuary
Arasta of the Endless Web
The Binding of the Titans exiles opponent cards to my zone
miscast
Greenbelt Rampager
increasing ambition
Brago, king eternal no return of the king
enshrined memories
izzet charm loot
said // done
gallia of the endless dance
shatter the sky is green
Arasta of the Endless Web
Nylea, keen-eye puts creature into field instead of hand
2021-08-02 13:23:46 -05:00
Vittorio Alfieri
ef3e743980 Fixed primitives. 2021-07-30 14:30:14 +02:00
Eduardo
cffda7421f Fixes to Primitives
lesser masticore
auto=auto replaced for auto
Lady Caleria: Human Archer -> Elf Archer
Ridgescale Tusker: Beast -> Pangolin Beast
Yawgmoth, Thran Physician abilities=protection from(human)
Subtlety targets a spell not a permanent
dwarven mine and other similar lands from Eldraine
Gingerbread Cabin
Idyllic Grange
Mystic Sanctuary
Witch's Cottage
Blinding Radiance
Trial of Ambition should target
grasping scoundrel
Eater of the Dead exiles itself
corpseweft exiles itself
blur of blades
radiant destiny choose a creature type not a color
brush with death
amorphous axe
Excavation Technique
Conqueror's Foothold
shipwreck looter and other cards that loot (draw then discard)
rabid bite
2021-07-30 00:33:47 -05:00
Vittorio Alfieri
bb5a9dd31e Fixed issue #1065 by @DoidArthas: now on Flip keyword we try to keep auras and equipments effects on transformed card basic abilities (e.g. Pacifism on Werevolwf). 2021-07-29 10:06:28 +02:00
Vittorio Alfieri
2cbb011fe3 Added/fixed primitives, fixed crash with Taj-Nar Swordsmith, Fixed monarch switch after player takes combat damage, fixed allsubtypes in transforms keyword, fixed controllerdamager and opponentdamager keywords and all primitives using them, fixed Emerge alternative cost restriction, fixed Kinship condition on same creature subtype, added alterexperience keyword and fixed all primitives that use experience counters, fixed all primitives using ability counters from Ikoria, fixed mypoolsave keyword in order to don't finish effect at the end of turn, fixed all primitives using mypoolsave (e.g. Omnath, Locus of Mana), fixed Gravepurge and Daretti, Scrap Savant, in order to allow the player to discard zero cards while using their effects. 2021-07-29 03:33:33 +02:00
Vittorio Alfieri
d2fbaaf320 Improved Cursed Scroll and Magus of the Scroll, added/fixed primitives, solved Werewolf's Issues #1064 by @DoidArthas. 2021-07-27 14:37:18 +02:00
Eduardo
1c9da2e6e6 Fixes to primitives and oracle text update
Changed the subtype Hound to Dog
Added Bard and Ranger subtype

Kalitas, Traitor of Ghet
Champion of Stray Souls
Gingerbread Cabin
Idyllic Grange
Barrage Tyrant missing '}'
Lesser Masticore
Gisa and Geralf
Eliminate space in instances of "target ("
2021-07-27 00:39:01 -05:00
Vittorio Alfieri
d8f1ff33de Fixed promo sets order index. 2021-07-26 14:34:28 +02:00
Vittorio Alfieri
c1404ff082 Added PLG21 set, improved Android downloader, fixed Nicol Bolas, God-Pharaoh (issue #1063 by @DoidArthas) 2021-07-26 10:53:10 +02:00
Vittorio Alfieri
f499a1e52f Improved Cursed Scroll and Magus of the Scroll, fixed Android downloader. 2021-07-25 21:54:39 +02:00
Eduardo
9bdf0e0690 Fixes to primitives and useless comments removed
stingerfling spider
cliffhaven kitesail
Enlarge
The Akroan War second ability does nothing
Silas Renn, you still have to pay the cost
Urza's Saga shouldn't lose previous abilities
Rocky Tar Pit and similar fetchlands got interrupted
Grand Architect didn't turn creature blue
component pouch
scrapyard recombiner
Harmony of Nature
porcuparrot didn't work with (player,creature,planeswalker), other cards seems to work with that syntaxis
Taranika, Akroan Veteran
Elspeth Conquers Death
Phyrexian Ingester can exile opponents cards
Taborax, Hope's Demise (never use "another" to specify "other" target)
Inniaz, the Gale Force doesn't fly
frost titan
Gustrider Exuberant flying
Kasmina, Enigmatic Mentor crashes the game when the AI tries to use it
2021-07-25 14:09:40 -05:00
Eduardo
7e2162bcc3 Replacing for macros _DIES_
Replacing the string "@movedto(this|graveyard) from(battlefield):" for the macros _DIES_ for readability, consistency and bugs reduction.
2021-07-25 13:54:21 -05:00
Vittorio Alfieri
57b8178d86 Fixed primitives. 2021-07-24 00:03:26 +02:00
Eduardo
b2a4edae9f token(The Atropal)
token(The Atropal)
2021-07-21 18:47:31 -05:00
Eduardo
35a79cb723 Restore to previous modifications in borderline and bug fixes
Metamorphose should put cards at top of library
Dark-Dweller Oracle missing closing parenthesis
Chandra, Bold Pyromancer -3
Militant Angel before attacks used to create a token
Typos in some operators, (never should be a '=>')
2021-07-21 18:41:09 -05:00
Vittorio Alfieri
0057269361 Fixed "The Atropal" token card in AFR set, improved Android downloader. 2021-07-21 18:15:05 +02:00
Vittorio Alfieri
849194b8da Added/fixed primitives, removed deckmaster.info source from Android downloader, fixed HTR18 set, fixed "menace" blocking issue from AI, improved Graft ability from AI, fixed hangs on Offering costs for both human and AI, added a new keyword "ishuman" to distinguish if a card controller is human or AI (e.g. on Graft trigger), fixed a possbile hang on negative manacost payment. 2021-07-21 10:51:13 +02:00
Eduardo
cabc0757be Bug Fixes and replaced instances of a creature dying for the macros _DIES_
Errors Fixed:

Vicious Rumors doesn't mill
Barrin, Tolarian Archmage should not return itself
Thassa, Deep-Dwelling is wrong
Bruse Tarl, Boorish Herder
Spiteful Sliver targets creatures
Karn, Scion of Urza -2 ability
Grand Master of Flowers was blue
Forsaken Monument has CMC of zero
Shadowspear can't equip
You Happen On a Glade
Disease Carriers
Desperate Castaways
Grim Physician targets a card in graveyard
Legion's Judgment had a typo
2021-07-21 00:17:54 -05:00
Vittorio Alfieri
23fa7f9f6e Added/fixed primitives. 2021-07-18 14:21:39 +02:00
Vittorio Alfieri
3442e7cb16 Fix proliferate ability. 2021-07-17 02:56:15 +02:00
Vittorio Alfieri
31ab9edc81 Added HTR18, HT19, AFR and AFC sets, added/fixed old primitives, improved Android dowloader, fixed it lang file, fixed IMA rarities, fixed order index of some old sets, added all features from D&D such as Dungeon Cards and Dice (d20,d10, adn so on). 2021-07-17 02:33:08 +02:00
Eduardo
d98956a1b8 Fixes to primitives
Dwarven Mine, no need to tap for red since it's a mountain
Mystic Sanctuary, no need to tap for blue since it's an island
Earthshaker Giant does not work
Ranger-Captain of Eos puts card into play not into hand
Jorn, God of Winter has wrong stats
Enemy of Enlightenment subtype misspell
Heavenly Qilin subtype misspell
Urza's Saga subtype misspell
Spirit of the Aldergard subtype misspell
dire tactics loses life even with human on board
piercing rays taps 2 creatures
shipwreck moray should grant +2/-2
sorin, vampire lord text is wrong
spontaneous artist grants 2 energy
Spinerock Knoll does nothing
2021-07-09 20:32:16 -05:00
Vittorio Alfieri
f0ee95b483 Fixed Mana Drain (issue #1060 by @Gourajiro), fixed Reinterpret, fixed the taskboard menu choice during game. 2021-06-29 16:38:58 +02:00
Vittorio Alfieri
5b7d8662b7 Improved in-game menu (now the Cancel choice is on top and it's possibile to open/close the taskboard during game), improved add/remove "counter" keyword in order to avoid the trigger if needed (e.g. loop avoidance), fixed Italian and Spanish languages. 2021-06-18 12:22:16 +02:00
Vittorio Alfieri
5f0883943a Added H1R set, added/fixed prmitives, improved Android downloader. 2021-06-17 11:14:09 +02:00
Vittorio Alfieri
9df5bb29ab Added MH2 set, improved Android downloader, added/fixed primitives, improved coin flip event trigger, improved discarded attribute, improved castcard keyword (now it's possible to specify the x value in cost), improved add/remove/mod counter trigger, improved the "spent" and "converge" keyword for spell still in the stack. 2021-06-16 17:07:44 +02:00
Vittorio Alfieri
55edfc6374 Added HA5 set and imnproved Android downloader. 2021-05-22 20:40:04 +02:00
Vittorio Alfieri
79716a4533 Added a new rule to flip back modal dual face card on each phase and after each action, fixed "Aladdin's Lamp" and "Turntimber Symbiosis" primitives, allowed the AI to play back side of modal dual face cards, improved the "doubleside" keyword to flip modal dual face cards, improved filters to target flipped cards using the "isflipped" keyword, fixed a crash when zone pointer was null in GameObserver::logAction method. 2021-04-28 17:03:29 +02:00
Vittorio Alfieri
ac273b1947 Fixed a bug: It's not allowed to turn side of double faced cards when they are on battlefield. 2021-04-27 21:08:51 +02:00
Vittorio Alfieri
8b358b3d1c Fixed a bug: AI does not have to use the doubleside ability to avoid loops. 2021-04-27 17:44:41 +02:00
Vittorio Alfieri
6fb3feef72 Added/Fixed primitives, improved the Double Face Modal cards management: now it's possibile to click on card to flip the side in odrer to read card infos such as name, manacost, text and types, improved the "moveto" keyword in order to allow the usage of the "temp" zone for removing unecessary cards from game (e.g. duplicated card generated from some dual face cards), added the option "nolegend" to the "copy" keyword in order to crerate copy of legendary cards that are not legendary (e.g. Echoing Equation), added the keywords "doublefacedeath" and "gaineddoublefacedeath" to send a card to temp zone after death (e.g. duplicated card generated from some dual face cards), added the keywords "lifefaker" to identify the cards wich modify the life increasement when a @lifeof triggers occours (e.g. Angel of Vitality). 2021-04-27 15:35:54 +02:00
Vittorio Alfieri
e265dc3e7f Completed STX set, fixed/added primitives, improved Android downloader, implemented the usage of ^ instead of , char (e.g. target multiple zones within transforms keyword), improved the code to avoid the multiple triggers in case of abilities gained from other cards (e.g. Kasmina, Enigma Sage). 2021-04-26 19:23:31 +02:00
Vittorio Alfieri
68a64238cb Added/fixed primitives, added new keywords "fourtimes", "fivetimes", "thirdpaid", fixed Tavis-CI build. 2021-04-21 18:27:33 +02:00
Vittorio Alfieri
abe8b580c8 Fixed Travis-CI build. 2021-04-21 11:41:59 +02:00
Vittorio Alfieri
71ff7baf85 Fix error import QTOpenGL 2021-04-21 11:32:13 +02:00
Vittorio Alfieri
286ccaafb2 Fixed Travis-CI build 2021-04-21 11:13:49 +02:00
Vittorio Alfieri
2c80570cf4 Fixed Travis-CI build 2021-04-21 11:12:02 +02:00
Vittorio Alfieri
6a311f2cd6 Fixed Travic-CI build. 2021-04-21 11:08:55 +02:00
Vittorio Alfieri
2028c5c79d Update travis-script.sh 2021-04-21 11:05:59 +02:00
Vittorio Alfieri
a6bec1a96e Update .travis.yml 2021-04-21 10:56:21 +02:00
Vittorio Alfieri
d11ac6cf8b Update .travis.yml 2021-04-21 10:52:12 +02:00
Vittorio Alfieri
ff63f98b56 Update .travis.yml 2021-04-21 10:45:57 +02:00
Vittorio Alfieri
e8f853eb37 Try to change java version. 2021-04-21 10:42:54 +02:00
Vittorio Alfieri
568dd65173 Update .travis.yml 2021-04-21 10:38:43 +02:00
Vittorio Alfieri
2a45b9f8df Update .travis.yml 2021-04-21 10:34:08 +02:00
Vittorio Alfieri
372715fab7 Update .travis.yml 2021-04-21 10:32:04 +02:00
Vittorio Alfieri
59c3926f16 Update .travis.yml 2021-04-21 10:30:02 +02:00
Vittorio Alfieri
03fbbbb2bb Update .travis.yml 2021-04-21 10:27:20 +02:00
Vittorio Alfieri
74da665ec9 Changed target and source java version from 1.5 to 1.6 2021-04-21 09:58:25 +02:00
Vittorio Alfieri
8d2cc7124e Fixed Travis-CI build. 2021-04-21 09:21:53 +02:00
Vittorio Alfieri
7ae1a6137e Update .travis.yml 2021-04-21 09:18:57 +02:00
Vittorio Alfieri
c802be4a9d Test Travis-CI compilation. 2021-04-21 09:13:33 +02:00
Vittorio Alfieri
9ba9008126 Update .travis.yml 2021-04-21 09:05:42 +02:00
Vittorio Alfieri
8ee1d185d5 Try to solve Travis-CI environment problems. 2021-04-21 08:53:30 +02:00
Vittorio Alfieri
66e0a88809 Update .travis.yml
Fix compilation issue.
2021-04-21 00:10:43 +02:00
Vittorio Alfieri
34765237e0 Update .travis.yml
Fix compilation issue.
2021-04-21 00:07:49 +02:00
Vittorio Alfieri
5153c3b9c0 Update .travis.yml
Test to fix compilation.
2021-04-21 00:01:05 +02:00
Vittorio Alfieri
9da159a607 Added C21, STA and STX (still in progress) sets, improved Android downloader, added/fixed primitives, added a keyword to get if a card has "X" in its cost, fixed a crash while targeting a spell on stack, added a new option "nolegend" to clone keyword in order to create a token without legendary type and rule, improved "hascnt" keyword with "anycnt" option to count all counters on a card, added a new keyword "hasstorecard" to get if a card has a stored card or not(e.g. fizzlers), added a new keyword "pgmanainstantsorcery" to count the mana value of all instants and sorceries in player graveyard, added a new keyword "currentphase" to get the current game phase. 2021-04-20 23:34:30 +02:00
Vittorio Alfieri
d7838829ad Added/fixed primitives. 2021-03-12 17:06:51 +01:00
Vittorio Alfieri
cea45370a6 Added/fixed primitives. 2021-03-11 21:56:03 +01:00
Vittorio Alfieri
2234a508c3 Added/fixed primitives, added a new ability "undamageable" (e.g. Dralnu, Lich Lord). 2021-03-11 16:39:50 +01:00
Vittorio Alfieri
37ce334688 Added TSR and HA4 sets, added/fixed primitives, improved Android downloader, fixed a crash when AI pays a Convoke alternative cost, fixed a random crash on Windows when opening zip files, fixed a random crash in destroy ability method (e.g. blasphemous act). 2021-03-09 19:07:31 +01:00
Vittorio Alfieri
2abb218164 Fixed Synthetic Destiny. 2021-02-24 18:25:06 +01:00
Vittorio Alfieri
c8f763173d Improved AI: now during opponent's turn it will not search just for instant cards from hand but it can also play cards with "flash" ability from all the other available zones (e.g. "flash" cards from graveyards which have "canplayfromgraveyard" of Flashback and/or Retrace cost). 2021-02-23 12:59:22 +01:00
Vittorio Alfieri
81d4b3d84f Improved AI: now it can plays cards using alternative cost too, fixed thisturn restriction in some primitives. 2021-02-22 19:16:54 +01:00
Vittorio Alfieri
8d740c6bc1 Fixed Hero of Bretagard. 2021-02-19 22:23:26 +01:00
Vittorio Alfieri
d3379c9c08 Fixed a crash when AI try to activate a combo (caused by new ANYTYPEOFMANA management), fixed the Visual C++ project file descriptor, fixed ELD set DAT file, improved Andorid downloader, fixed primitives. 2021-02-19 18:50:25 +01:00
Vittorio Alfieri
89cdeead88 Fixed some borderline primitives. 2021-02-18 19:03:46 +01:00
Vittorio Alfieri
17d6860505 Improved AI: now it can cast spells from graveyard using thier Flashback and Retrace costs, fixed a crash in Deck Editor stats loader when a card ability contains some "add" substrings (e.g. "counteradded" followed by "restriction{"), added/fixed primitives. 2021-02-18 12:48:59 +01:00
Vittorio Alfieri
bc9142ad6e Improved AI: now it can activate abilities of cards in all zones such as commandzone, hand, graveyard and exile using the keywords "autohand", "autocommandzone", "autograveyard" and "autoexile" just as normal Human player does. 2021-02-17 15:31:31 +01:00
Vittorio Alfieri
6c9c770f2d Fixed all primitives with Fuse cost (now we use a special kicker cost for them), fixed all primitives with double kicker cost (now we use other and kicker cost togheter), added a new ability "hasnokicker" for primitives which have kicker for other purpose (e.g. Fuse cards), fixed an issue on cost name for both kicker and retrace cost, improved green highlight management for cards which can play in exile and graveyard (such as retrace cards, flashback cards, and so on), improved kicker cost management. 2021-02-16 16:08:08 +01:00
Vittorio Alfieri
ed330fa70c Fixed Lukka, Coppercoat Outcast. 2021-02-15 20:56:52 +01:00
Vittorio Alfieri
7bce2a19e2 Fixed Lukka, Coppercoat Outcas. 2021-02-15 20:06:15 +01:00
Vittorio Alfieri
60ca9e05c0 Added the possibility to specify a name for Kicker cost and Retrace cost with "name()" keyword, implemented Escape cost with Retrace cost, implemented Fuse cost with Kicker cost, fixed several primitives. 2021-02-15 18:41:59 +01:00
Vittorio Alfieri
f383d0b8a5 Fixed some primitives. 2021-02-13 18:54:15 +01:00
Vittorio Alfieri
b17eb2c870 Fixed primitives with "scry" and "reveal" abilities. 2021-02-12 17:00:20 +01:00
Vittorio Alfieri
d3c0e397b6 Added/fixed primitives, fixed/improved several primitives with "reveal" ability, added a new keyword "findfirsttype" to allow AI to user a kind of "revealuntil" ability from its library, fixed a crash wthen temp zone has duplicated cards from other zones (such as library). 2021-02-12 11:57:27 +01:00
Vittorio Alfieri
a72c35a693 Fixed all cards with "scry" ability, fixed all cards with "surveil" ability, fixed all cards with "explores" ability, fixed all cards with "adventure" ability. 2021-02-10 22:29:08 +01:00
Vittorio Alfieri
d0d7554b1d Fixed cost reduction issue for card with X in their main cost or alternative cost. 2021-02-09 12:10:15 +01:00
Vittorio Alfieri
cf9f6ed474 Fixed cost reduction issue for card with X in their cost. 2021-02-08 23:10:01 +01:00
Vittorio Alfieri
eb8da4d4b2 Fixed issue #1054 (opened by @ranger7271), fixed/added primitives with "scry" ability, improved scry ability for both Human and AI player, added a new ability to replace the scry ability with some actions (e.g. Eligeth, Crossroads Augur). 2021-02-08 17:08:20 +01:00
Vittorio Alfieri
a858ed405f Fixed some primitives with "Suspend" ability. 2021-02-06 17:31:13 +01:00
Vittorio Alfieri
8f432718cf Fixed primitives with "preventalldamage from" ability. 2021-02-05 22:27:30 +01:00
Vittorio Alfieri
f1ee227b84 Fixed deck selection in Deck Editor Menu (now it shows both Classical Decks and Commander Decks using a CMD suffix) and fixed deck selection in Demo Mode (now it filters decks according to game mode as it happens in normal game mode). 2021-02-05 11:25:04 +01:00
Vittorio Alfieri
8c031585cf Fixed some borderline primitives. 2021-02-04 18:29:49 +01:00
Vittorio Alfieri
74ddb33239 Fixed "anyzone" keyword: now it includes commandzone, reveal and sideboard too. 2021-02-04 12:54:22 +01:00
Vittorio Alfieri
a00919cc02 Added/fixed primitives. 2021-02-02 18:39:23 +01:00
Vittorio Alfieri
6fe1e4d351 Fixed some borderline primitives. 2021-02-01 16:58:52 +01:00
Vittorio Alfieri
f6274dc914 Fixed C18 set, fixed primitives from KHM set, improved Android downloader. 2021-01-31 15:28:35 +01:00
Vittorio Alfieri
783bcf1142 Added KHM and KHC sets, improved Android downloader, fixed/added primitives, improved "hascnt" keyword, added "myhandexilegrave" and "opponenthandexilegrave" zone targeters. 2021-01-31 00:59:15 +01:00
Vittorio Alfieri
b9d6410aba Fixed Garruk's Harbinger and Gishath, Sun's Avatar (issue #1052 by @ranger7271). 2021-01-28 21:59:47 +01:00
Vittorio Alfieri
b35e503a0f Fixed Flamerush Rider, added battleready option to "clone with" keyword. 2021-01-28 15:56:15 +01:00
Vittorio Alfieri
024e015dfc Fixed primitives, fixed a random crash in ActionStack.cpp, added a way to search wallpaers in theme folder before to search them in the default folder, improved the keyword to retrieve the highest power and toughness of creatures in play, now it's possibile to use "pwr:" and "ths:" instead of "power:" and "toughness:", so it's possibile to use this keyword in variable{} construct too. 2021-01-27 11:16:41 +01:00
Vittorio Alfieri
dd844fc25e Fixed Etchings of the Chosen (issue #1051 by @ranger7271), added primitives with choose card name, added two keywords "chooseaname" and "chooseanameopp" to choose a card name ("chosenname" and "lastchoosenname") between your cards or opponent cards, added a keyword "[attached]" to target equipment attached to a permanent. 2021-01-26 20:47:33 +01:00
Vittorio Alfieri
c60f8787d1 Added a new keyword "excessdamage" to retrieve theamount of exceeded damage to creature or planeswalker, fixed an issue on planeswalker damage count, added a new keyword "genrand" to generate a random number between 0 and a specific number (e.g. "genrand3"), improved Flip ability in order to allow the flip back from copy for a generic card name (e.g. "flip(myorigname) undocpy)" 2021-01-25 17:24:15 +01:00
Vittorio Alfieri
4bdc1fdfe1 Fixed Treasure token, added boast trigger event, added new keyword "hascnt" to retrieve the amount of specific counter type on a card (e.g. hascntloyalty). 2021-01-24 20:37:14 +01:00
Vittorio Alfieri
f6199719fd Fixed issues #1049 and #1050 opened by @ranger7271, improved imprint keywords, improved boast ability, added a new "hasability" keyword to check if a card has an ability or not. 2021-01-24 15:53:49 +01:00
Vittorio Alfieri
2b7baf7fc8 Improved foretell mechanics, added a trigger for foretold cards, added a new keyword "snowdiffmana" to compare snow mana pool and mana cost of a target card, improved phaseaction "checkexile" condition. 2021-01-22 19:37:09 +01:00
Vittorio Alfieri
5184132e8b Fixed primitives, added "notshare!" keyword (e.g. to search cards with different names), improved decks selection according to chosen game mode (e.g. Game will show commander decks only in commander mode and it will hide them in other modes). 2021-01-22 14:15:43 +01:00
Vittorio Alfieri
3a38e7f4ab Added/fixed primitives, implemented a new keyword to count the greatest number creatures that share same subtype (creatures with changeling counts as +1 for all creature types) 2021-01-21 15:53:27 +01:00
Vittorio Alfieri
17fdc5bc9f Fixed primitives, fixed multiple snow mana cost payments, added keywords to count snow mana pool (total and single colors). 2021-01-20 18:27:20 +01:00
Vittorio Alfieri
0b5f375df6 Fixed primitives, fixed multiple snow mana cost payments, added keywords to count snow mana pool (total and single colors). 2021-01-20 18:11:56 +01:00
Vittorio Alfieri
f982124209 Added boast ability, refactored WParsedInt class (this class has been removed from AllAbilities.h file and it has been included into two dedicated .h and .cpp files), refactored all makefiles (Windows, Linux, PSP and Android) in order to to include the new .h and .cpp files added for WParsedInt class. 2021-01-18 17:11:09 +01:00
Vittorio Alfieri
177541b30c Added/fixed primitives, improved "@draw" trigger, added a "@scryed" trigger for scry ability, added a new keyword "placefromthetop" to put a card in a specifc position of owners library from the top. 2021-01-16 16:35:18 +01:00
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
Vittorio Alfieri
77c48dc1d5 Fixed/refactored primitives after the parser has been improved in order to allow the usage of "^" instead of "," char in a lot of abilities (e.g. to use the token, flip, rampage, phasealter, becomes keywords inside transforms or to target a card with a "," char in its name). 2021-01-15 00:43:13 +01:00
Vittorio Alfieri
91d19e2852 Fixed WAR, C18, PAL00, UST set, added/fixed primitives, improved Android downloader, implemented Foretell ability, improved castcard keyword, improved "can play" restriction, improved primitives parsed in order to allow the nesting of transforms, ability$! reveal, scry, pay, grant keywords. 2021-01-14 17:51:13 +01:00
Vittorio Alfieri
69885cf90a Added/Fixed primitives, improved PAYZERO rule for commandzone. 2021-01-11 16:53:14 +01:00
Vittorio Alfieri
6229de7c55 Fixed MB1 set, added/fixed primitives, improved Android downloader, improved keywords to remove and add counters. 2021-01-10 17:48:08 +01:00
Vittorio Alfieri
7c8b634086 Added a new game option to allow the user to decide how to sort sets in filter and award section (by sector, by name or by release date). 2021-01-09 13:34:42 +01:00
Vittorio Alfieri
7a6c4b2c15 Added ATH and DDN sets, refactored all sets to add a new tag for better sorting in set filter and award section, improved Android downloader. 2021-01-09 02:26:38 +01:00
Vittorio Alfieri
eaaa4d783b Fixed/added primitives, added keyword to alter devotion count, added keyword to target cards with flashback cost, added "duplicatecounters(single)" keyword to add a counter of a specific kind already present on a permanent or a player. 2021-01-07 18:56:47 +01:00
Vittorio Alfieri
4c00dfb3b6 Fixed Duplicant primitives. 2021-01-06 18:59:08 +01:00
Vittorio Alfieri
fe1a89e67a Improved the Imprint keyword ability and fixed Duplicant primitive. 2021-01-06 16:32:14 +01:00
Vittorio Alfieri
5dbe6f8c9c Fixed primitives. 2021-01-06 11:46:38 +01:00
Vittorio Alfieri
0fce1c591f Improved "can play land" restriction used for double-face modal cards from Zendikar Rising set. 2021-01-05 22:25:40 +01:00
Vittorio Alfieri
d9e3101212 Fix for IP Address resolution on Wondows for 2 Players mode. 2021-01-03 14:19:16 +01:00
Vittorio Alfieri
21b5308420 Fixed code trying to make the 2 Players mode work better. 2021-01-03 01:07:18 +01:00
Vittorio Alfieri
0d31ec5b21 Added missing graphics for game modes unlock, fixed italian lang, fixed awards dat file, fixed a bug on Game Award section, refactoring for AllAbilities.h file. 2021-01-01 16:14:58 +01:00
Vittorio Alfieri
65bf650868 Improved and added new "starting life" related keywords, fixed all primitives related to "starting life" keywords. 2021-01-01 03:47:02 +01:00
Vittorio Alfieri
e3aff3c23a Fixed trophy image rendering for hi-res quality, fixed all primitives with XX cost, added some missing primitives from ol sets. 2020-12-31 17:32:34 +01:00
Vittorio Alfieri
1444ed6b7c fixed bug causing AI never play a card there are one or more cards in graveyard or other zones, fixed and improved removemana ability, fixed/added primitives. 2020-12-30 17:52:06 +01:00
Vittorio Alfieri
1f98173197 Avoided a memory allocation error of SDL EnginePlayer on Android version when loading more than 32 audio samples at same time. 2020-12-27 01:08:51 +01:00
Vittorio Alfieri
b7c6725b44 Fixed Italian and Spanish lang, fized Commander award condition. 2020-12-26 22:14:58 +01:00
Vittorio Alfieri
f9e0746e1c Increased Android SDK and NDK version for Android 10, updated Italian and Spanish lang files, patch boost dependencies for TIME_UTC definition, fixed import for usleep. 2020-12-26 17:19:02 +01:00
Vittorio Alfieri
b2c55e307c Updated spanish lang, Improved Commander rules and award, fized/added all primitives with divide damage between one or more targets. 2020-12-26 01:45:13 +01:00
Vittorio Alfieri
99033e3fb2 Fixed Edgar Markov, issue #1047 2020-12-25 01:05:10 +01:00
Vittorio Alfieri
053f202f32 Fixed primitives with imprint ability. 2020-12-25 00:00:03 +01:00
Vittorio Alfieri
991625dea4 Fixed Duplicant primitive. 2020-12-24 12:43:32 +01:00
Vittorio Alfieri
0ca310da54 Added feature to allow some cards to copy and flip back at the end of turn, added feature to use type: keyword with chosentype and chosencolor combo, fixed crashes on "can play land" restriction, fixed land primitives with pay life or tap condition to avoid crashes. 2020-12-23 12:39:18 +01:00
Vittorio Alfieri
d40d6f319e Fixed/added primitives from older sets. 2020-12-22 17:56:49 +01:00
Vittorio Alfieri
3a8d70ff27 Fixed all primitives with Domain ability, fixed issue #1044 opened by DroidArthas. 2020-12-22 12:38:24 +01:00
Vittorio Alfieri
1aed1c1517 Fixed and improved the Deck Importer (from MTGO) in Android application, fixed frozen and freeze untap bug, fixed/added primitives. 2020-12-21 22:39:18 +01:00
Vittorio Alfieri
a801069a3a Improved explores ability, added new trigger to handle the explores event from a card, added/fixed primitives from older sets, fixed RIX dat file. 2020-12-20 23:14:44 +01:00
valfieri
e67078355a Improved target chooser to allow a multiple selection for player, creature and planeswalkers, now it's possible to use target(player,creature,planeswalkers) as well as target(<variable>player,creature,planeswalkers) and so on. Added abilities for giving exiledeath and handdeath to instant and sorceries (the previous were not working fine), Added ability to identify the cards with Cycling ability as a target, Updated all primitives with cycling ability, fixed all primitives with choose any target ability, Added/fixed primitives from RIX set. 2020-12-18 19:04:51 +01:00
valfieri
0d2e4af2a3 Added new keyword to count creature of the same type with both unique and common names, added/fixed primitives form M19 set.
Added new keyword to count creature of the same type with both unique and common names, added/fixed primitives form M19 set.
Added new keyword to count creature of the same type with both unique and common names, added/fixed primitives form M19 set.
Added new keyword to count creature of the same type with both unique and common names, added/fixed primitives form M19 set.
Added new keyword to count creature of the same type with both unique and common names, added/fixed primitives form M19 set.
2020-12-16 18:05:29 +01:00
valfieri
3e7ef8c77c Added abilities for cards which have to return battlefield or hand instead of graveyard (e.g. just like exiledeath ability), improved fresh attribute management also for card moved in hand, library, commandzone and for instants and sorcery spells, added/fixed primitives. 2020-12-16 12:21:57 +01:00
valfieri
b09763d89e Improved Die Roll event and trigger, added Flip Coin trigger management, added/fixed almost all primitives with "roll a die ability", fixed some tab chars in source files. 2020-12-15 19:49:06 +01:00
valfieri
bf3d35463f Added commander mode achievement and improved its graphic resources, added fixed primitives, fixes RNA set file, added new keyword and events to code the ability of six-side die roll. 2020-12-14 19:20:05 +01:00
valfieri
a753bb0c1b Implemented new keyword for creatures which have to be blocked from 3 or more other creatures, added/fixed primitives. 2020-12-11 16:41:20 +01:00
valfieri
d2ea81bdbc Added/fixed some primitives. 2020-12-10 10:37:32 +01:00
valfieri
d4b663220f Fixed compilation issue on AllAbilities.h 2020-12-09 21:12:22 +01:00
valfieri
f4353fb0e9 Fix compilation issue. 2020-12-09 20:54:35 +01:00
valfieri
3ec955bf2c Added/fixed primitives. 2020-12-09 20:32:26 +01:00
valfieri
68d21ddd23 Added/fixed primitives and implemented new keywords to count the single color symbols in player's manapool. 2020-12-09 19:28:28 +01:00
valfieri
16e6df9503 Added CC1 set, added/fixed primitives related to commander abilities, fixed cost increase for Commanders who have been cast multiple times. 2020-12-09 15:23:15 +01:00
valfieri
7c696ac213 Improved Commander format card selection rule, added new keyword
"autocommandzone=" to trigger abilities from Command Zone (e.g. Commander Ninjutsu), added/fixed some primitives, added a new GUI Button to show Player's Sideboard.
2020-12-08 20:48:11 +01:00
valfieri
d18232df10 Fixed Commander Format selection of identity color, added/fixed primitives related to commanders abilities. 2020-12-08 00:32:33 +01:00
valfieri
d6a1a8eda8 Added/fixed some primitives, improved Deck Editor to allow user to choose commanders from collection and add them to their decks. Implemented command color identity rule and single card instance limitation for Commander Format game mode. 2020-12-07 19:25:06 +01:00
valfieri
ced2c85076 Implemented Commander mode and rules, added Command Zone to game, added/fixed primitives, increased the major release version. 2020-12-06 20:11:51 +01:00
valfieri
6ef9ecc147 Fixed/added some primitives. 2020-12-01 18:13:59 +01:00
valfieri
c704dfbfb2 Added CMR set, added Monarch game mode, added/fix several primitives and improved Android downloader. 2020-11-30 10:55:42 +01:00
valfieri
d751ed3540 Fixed and added some primitives. 2020-11-19 14:12:44 +01:00
valfieri
1202ea609e Added KLR set, fixed some primitives and improved Android downloader. 2020-11-18 19:45:26 +01:00
valfieri
252e66736a Fixed a crash occurring on token clone (e.g. Doubling Season) as described in the issue #1040. 2020-11-18 15:22:25 +01:00
valfieri
42f2c34a46 Changed implementation strategy for altercosat in anyzone for some cards due to some problem. 2020-10-27 11:59:33 +01:00
valfieri
c78e90a5b5 Fixed Cursed Scroll primitive. 2020-10-21 21:24:14 +02:00
valfieri
a52cd305b7 Added Cursed Scroll primitive. 2020-10-21 18:53:44 +02:00
valfieri
6a00c0ad1d Added EasyPBPRX program to the release to sign PRX up to 8Mb size. 2020-10-20 09:59:09 +02:00
valfieri
e6c1f652db Added PLIST set and missing primitives, improved Android downloader and fixed all primitives with Adapt ability. 2020-10-19 22:19:51 +02:00
valfieri
48bdc6c951 Fixed The Great Henge primitive. 2020-10-18 19:08:47 +02:00
valfieri
939dc20855 Fixed all primitives with Escape cost, fixed token creation (the movedto triggers were not activating correctly due to a bug). 2020-10-18 17:28:25 +02:00
valfieri
8c39eac856 Removed FTP transfer due to many failures detected. 2020-10-16 23:48:33 +02:00
valfieri
272199dced Modified the timeout for FTP transfer. 2020-10-16 23:07:17 +02:00
valfieri
cab90b8fe2 Set timeout for FTP transfer. 2020-10-16 21:31:28 +02:00
valfieri
d5a8b80f5a Improved Modal Double Faced Lands of Zendikar Rising set. 2020-10-16 20:52:30 +02:00
valfieri
4f3a179be4 Added a python script to upload Travis-CI build files on external FTP server. 2020-10-16 18:40:27 +02:00
valfieri
519c90dd9d Improved Modal Double Faced Lands of Zendikar Rising set. 2020-10-16 15:55:05 +02:00
valfieri
3d46b41efc Fixed travis.yml file for Travis-CI build.
Fixed travis.yml file for Travis-CI build.
Fixed travis.yml file for Travis-CI build.
2020-10-16 11:46:39 +02:00
valfieri
fbf1f9e1e0 Updated the python script to upload the Travis-CI build results to a specific GitHub release. 2020-10-16 00:27:08 +02:00
Vittorio Alfieri
d0cd6e8b21 Update .travis.yml 2020-10-15 17:04:32 +02:00
Vittorio Alfieri
90c51fbb2d Update .travis.yml 2020-10-15 17:01:43 +02:00
Vittorio Alfieri
edf7714f0c Update .travis.yml 2020-10-15 16:58:58 +02:00
Vittorio Alfieri
77241ee496 Update .travis.yml
Updated GitHub variables
2020-10-15 16:56:24 +02:00
Vittorio Alfieri
ad0e8383e4 Update .travis.yml 2020-10-15 16:32:29 +02:00
Vittorio Alfieri
795debeb0d Update .travis.yml
test secure variables
2020-10-15 16:27:26 +02:00
Vittorio Alfieri
b7a7efd9db Update .travis.yml
Test with new token and github user
2020-10-15 16:24:20 +02:00
Vittorio Alfieri
d005aefdc7 Update .travis.yml
test variables
2020-10-15 16:17:06 +02:00
valfieri
30647615f2 Fixed Archfiend's Vessel and Orah, Skyclave Hierophant primitives. 2020-10-15 13:58:47 +02:00
valfieri
3ee3aaf7d8 Fixed Relic Viel sacrifice ability. 2020-10-15 11:59:37 +02:00
valfieri
a2403e4eee Fixed Enhanced Surveillance primitive. 2020-10-14 21:59:31 +02:00
Xawotihs
3e618c062a Update README.md 2020-10-14 17:35:36 +02:00
Xawotihs
b1bc13cb0d Switched badge from travis-ci.org to travis-ci.com 2020-10-14 16:14:24 +02:00
valfieri
fe60f5fe81 Fix mana cost of Relic Vial. 2020-10-14 14:19:06 +02:00
valfieri
7bf463c7ea Fixed all the Modal Double Faced card from Zendikar Rising set, now we don't use the alternative cost anymore but the autohand keyword instead which required another enhancement for Flip forcetype keywords, fixed a bug on Changezone trigger. 2020-10-14 03:30:32 +02:00
valfieri
e1df4e5072 Improved Life gain trigger (now it's possible to specify a "from" clause and it's possible to add the "limitOnceATurn" restriction) and fixed all the primitives with gives life on life gain event without producing any loop and reviewed all the primitives with the "@lifeof" trigger. 2020-10-13 18:32:51 +02:00
valfieri
1b860218e0 Fix primitive from Zendikar Rising set. 2020-10-12 21:29:35 +02:00
valfieri
75347a2f37 Fixed a crash on counterremoved trigger, fixed/add some primitives that have ability to double the damage to any target. 2020-10-12 17:20:07 +02:00
valfieri
29985718a7 Added missing cards from GRN sets, improved mutation trigger, improved Surveil ability, implemented trigger and offset on surveil ability to allow combo with other cards (see issue #1037 opened by luisguerin). 2020-10-12 01:25:34 +02:00
valfieri
8cf2b7ab69 Fixed primitives list contained in issue #1037 opened by luisguerin. 2020-10-11 00:32:20 +02:00
valfieri
a99eaac35d Improved kicker cards comparison criteria (now it's possible to search for a multi kicked card in stack), added a new castcard mode with multikicker option, added all Zendikar Risings primitives to borderline collection, changed in all primitives the restriction "kicker" with a new sintax "if paid(kicker) then" in order to fit with the new kicker logic comparison criteria and castcard option. 2020-10-10 02:44:57 +02:00
valfieri
c4eb931192 Fixed primitives and planeswalkers, fixed a bug on counter comparison criteria when cards are changing zone (eg. @movedto(creature[counter{1/1}]|mygraveyard) from(mybattlefiled) now it's working fine). 2020-10-09 19:16:03 +02:00
valfieri
a6a053e10e Improved the Modal Double Faced cards for Zendikar set, added primitives that deals x damage divided on any target, added/fixed planeswalkers and improved kicker cost event handling. 2020-10-08 19:18:52 +02:00
valfieri
ad26450151 Improved Android downloader, fixed snow mana cost, merged opponentlifetotal and oplifetotal keywords 2020-10-06 19:00:39 +02:00
valfieri
e4f5d7784a Fixed typos in some primitive's restrictions. 2020-10-05 14:06:21 +02:00
valfieri
023816aa65 Fixed and added cards with kicker, multi-kicker, replicate and strive costs. 2020-10-05 02:56:16 +02:00
valfieri
bf6439db00 Improved Kicker cards, now it's possible to target a specific card with kicker cost and handle any event connected to a kicker casting cost. 2020-10-03 16:54:17 +02:00
valfieri
1b320d5325 Fixed party counter routine and removed tabbed chars from cpp file. 2020-10-01 18:29:20 +02:00
valfieri
6d872ed176 Improved the Modal Double Faced cards for Zendikar Rising (es. nofizzle when choosing land face, flip for instant and sorcery, new restriction for playing land face during turn). 2020-09-30 12:18:08 +02:00
valfieri
00ce669edb Fixed primitives and tokens, implemented count for party of creatures in Zendikar cards. 2020-09-29 18:12:24 +02:00
valfieri
61dc3013f4 Added ZNR, ZNE, ZNC sets, fixed some primitives and improved Android downloader. 2020-09-27 22:54:35 +02:00
valfieri
c4ba879382 Fixed primitives, fixed alias 1117 and fixed the bug on lastCardDrawn from library. 2020-09-21 17:56:20 +02:00
valfieri
495e5f1429 Fixed primitives. 2020-09-20 21:57:39 +02:00
valfieri
827f5a71bc Fixed primitives. 2020-09-19 22:26:23 +02:00
valfieri
573c72f72d Merged with last master commit, fixed primitives and languages. 2020-09-16 11:32:43 +02:00
Eduardo
612be9737d Changes to some game modes I created and fixes to primitives
Some minor changes to some game modes, by the way, can we make it easier to unlock the random modes?
2020-09-09 22:47:21 -05:00
valfieri
4bc339e82b Fixed primitives and planeswalkers. 2020-09-07 13:24:29 +02:00
valfieri
668fc41862 Fixed and added macros for primitives. 2020-08-31 09:04:34 +02:00
Eduardo
457b8c3bf2 Merge branch 'master' of https://github.com/WagicProject/wagic 2020-08-28 12:13:04 -05:00
Eduardo
135f2a1e45 Bug fixes on primitives, borderline and planeswalkers
Changes tested, fixes to buggy cards or cards that used to crash the game.

Using comma inbetween brackets crashes the game, attributes must be separated by semicolon.

WRONG target(creature[attacking,blocking]|battlefield)
RIGHT    target(creature[attacking;blocking]|battlefield)
2020-08-28 12:12:49 -05:00
valfieri
2d9cab915a Fixed some primitives and merged with last GIT commit. 2020-08-26 09:25:49 +02:00
Eduardo
22d8d16b71 Merge branch 'master' of https://github.com/WagicProject/wagic 2020-08-25 12:46:58 -05:00
valfieri
453906e350 Added AKR and ANB sets, Fixed Aftermath primitives and DAT files for AKH and HOU sets, Added extended art cards to 2XM set and improved Android downloader. 2020-08-15 20:45:50 +02:00
Eduardo
5e16e0d1ba Fixes to borderline cards mostly and to rules.cpp
-----fix-----
magosi,
astroblade
sinew and steel
echo of eons
spy network
drudge sentinel
crash of rhino
crashing footfalls
kelsien
Crumbling Vestige
make obsolete
desperate cast
gravebreaker lamia
2020-08-10 20:13:01 -05:00
valfieri
1c09918225 Fixed and added some card prmitives. 2020-08-10 10:17:52 +02:00
valfieri
251e1634f7 Fixed tokens and planeswalkers primitives. 2020-08-09 12:21:49 +02:00
valfieri
727d4579a0 Added 2XM set, fixed card and planeswalkers primitives, fixed a crash on token creation, fixed prowess and mentor abilities, added new restrictions, improved Android downloader. 2020-08-08 19:46:07 +02:00
valfieri
52e3177ef2 Added new features and triggers to game about tokens and counters, fixed and added new primitives. 2020-07-10 19:53:46 +02:00
valfieri
fc40971dc7 Added JMP, SSR and M21 sets, fixed C14 set, added new primitives and improved Android downloader. 2020-07-04 22:29:09 +02:00
valfieri
ccc26f400d Fixed crash on Dread Presence and added new primitives. 2020-06-24 21:20:39 +02:00
valfieri
210a250dce Added new primitives and added a new menu choice to toggle all creature to attacking mode during attack phase. 2020-06-22 22:35:33 +02:00
valfieri
a2594f1fb7 Fix X cost for Alternative payment, added new primitives. 2020-06-15 17:14:22 +02:00
valfieri
587155353c Fixed Legend rule for mutating cards, avoided spell targeting for mutated down cards, added new primitives. 2020-06-14 14:03:00 +02:00
valfieri
2b398b425d Fixed Sliding Menu for Android App, added new primitives and fix mutating cards. 2020-06-12 16:47:11 +02:00
Vittorio Alfieri
67c7102687 Fix !share!types! keyword 2020-06-11 00:10:41 +02:00
Vittorio Alfieri
6212af0f48 Fix !share!types! keyword 2020-06-11 00:09:32 +02:00
Vittorio Alfieri
5688b28981 Fix !share!types! problem for creatures with no subtypes 2020-06-10 23:50:07 +02:00
valfieri
c162eff8cf Fix build error to_string 2020-06-10 23:36:49 +02:00
valfieri
60e6d314e0 Fixed some primitives and fixed a problem with share!types! keyword. 2020-06-10 23:13:18 +02:00
Vittorio Alfieri
7cf722114b Fix VERSION_GAME macro for 3 params.
Error on build.
2020-06-10 00:26:52 +02:00
valfieri
8645cb9e1e Fix date in Dat files, Added IKO and HA3 sets, updated the manifest and build files, Added SD card support for Android, Fix the Android app crash when resuming from background, Improved Android downloader, added finger sliding popup menu for Android devices without sidebar menu, fixed several crashes during game, added the mutating card ability, fixed the adventure card ability, added new borderline primitives. 2020-06-10 00:10:59 +02:00
valfieri
275eb9e06e Merged and sorted all primitives in their respective files. 2020-05-09 15:31:46 +02:00
valfieri
60b4bb31f5 Added more C20 primitives. 2020-05-08 23:23:41 +02:00
valfieri
a5eb2eba37 Fixed C20 set file and improved Android downloader. 2020-05-08 18:29:31 +02:00
valfieri
a00cf2a1d1 Added borderless images support on Android card images downloader. 2020-04-19 17:22:14 +02:00
valfieri
b863188c3c Fixed card types and subtypes visualization, added C20 set and improved Android downloader. 2020-04-16 21:21:34 +02:00
valfieri
21778de9fb Fix primitives with Escalation keyword. 2020-03-30 11:15:31 +02:00
valfieri
c81eecf6d2 Fix on primitives with Explores and Escalation keywords. 2020-03-29 16:28:57 +02:00
valfieri
402323a990 Fix primitives with Explores and Escalation keywords. 2020-03-28 16:35:08 +01:00
valfieri
75b335e59c Fixed some primitives. 2020-03-23 19:51:24 +01:00
valfieri
9f69336c94 Added HA2 set and improved Android downloader. 2020-03-17 20:57:21 +01:00
valfieri
331e54a732 Added THB and UND sets, improved Android image downloader. 2020-03-12 18:58:24 +01:00
valfieri
3d25630dd6 Added MB1 set and improved Android downloader. 2019-12-11 00:22:13 +01:00
valfieri
5b652ba688 Removed MB1 set. 2019-12-09 23:02:19 +01:00
valfieri
c60df6c99d Fixed MB1 set and improved Android downloader. 2019-12-09 17:04:18 +01:00
valfieri
8bef671a70 Added MB1 set and improved Android downloader. 2019-12-08 16:43:15 +01:00
valfieri
9df8e90ab6 Reverted .travis.yml 2019-12-08 12:38:48 +01:00
valfieri
45d7cecaf3 Test Travis secure vars. 2019-12-08 12:30:22 +01:00
valfieri
730c8479f9 Test travis secure vars. 2019-12-08 12:02:42 +01:00
valfieri
1dca08a33b Fixed Android Downloader. 2019-12-06 11:37:07 +01:00
valfieri
233cec7a9f Added CN2, ME1 and SLD set, fixed primitives, fixed test and improved Android Downloader. 2019-12-06 11:32:27 +01:00
valfieri
08f69dc832 Added HA1 set, fixed primitives and improved Android downloader. 2019-11-22 22:22:25 +01:00
valfieri
464a6ff1b8 Fixed GN2 set/primitives and improved Android downloader. 2019-11-15 18:04:44 +01:00
valfieri
c664760359 Removed duplicated card in Guild Kit sets and improved Android downloader. 2019-11-09 16:47:09 +01:00
valfieri
f180b8cc56 Added GK1_AZORIU, GK1_BOROS, GK1_DIMIR, GK1_GOLGAR, GK1_IZZET, GK1_SELESN, GK2_GRUUL, GK2_ORZHOV, GK2_RADKOS, GK2_SIMIC, GN2, PAL00, PAL01, PAL02, PAL03, PAL04, PAL05, PAL06, PAL99, PARL sets, improved Android downloader, added new primitives and updated the release version to 0.22.2 2019-11-08 16:54:05 +01:00
valfieri
044bbb3d4b Fixed MH1 set and primitives. 2019-11-04 17:05:52 +01:00
valfieri
c4884e4715 Added DPA, PDP10, PDP11, PDP12, PDP13, PDP14, PMPS, PMPS06, PMPS07, PMPS07, PMPS08, PMPS09, PMPS10, PMPS11 sets and improved Android downloader. 2019-11-03 14:16:15 +01:00
valfieri
253be9e9bd Fixed Flaxen Intruder primitives of ELD set. 2019-11-01 22:56:31 +01:00
valfieri
db517858fa Added PS11, PSAL sets and improved Android downloader. 2019-11-01 21:12:42 +01:00
valfieri
923a8e8fd9 Fixed primitives. 2019-10-25 23:56:03 +02:00
valfieri
8d395620a1 Fixed ELD set. 2019-10-25 21:19:45 +02:00
valfieri
a547591608 Added ANA, H17, HTR, HTR17, MPS, PGRU, PHPR, PI13, PI14, PIDW and improved Android downloader. 2019-10-25 18:08:09 +02:00
valfieri
601a4432dc Added new option to show/hide card borders. 2019-10-25 00:23:46 +02:00
valfieri
ca7c8f5cf9 Removed outer border from rendered cards. 2019-10-24 17:53:43 +02:00
valfieri
f44ad43413 Added PZ2 set and improved Android Downloader. 2019-10-22 19:16:37 +02:00
valfieri
1ec448daef Fixed ELD Adventure primitives. 2019-10-13 15:50:25 +02:00
valfieri
adee84d60f Fix GRN and RIX primitives. 2019-10-12 22:17:47 +02:00
valfieri
a46786eb28 Fixed a GRN primitive. 2019-10-12 18:14:25 +02:00
valfieri
5c7b4b7618 Fixed ELD primitive. 2019-10-12 17:56:43 +02:00
valfieri
bdcb10a54f Fixed primitives of GRN and ELD sets. 2019-10-12 17:25:30 +02:00
valfieri
6083ad76d6 Fixed Midnight Reaper primitive in GRN set. 2019-10-10 23:26:25 +02:00
valfieri
b66674492b Fixed Crash on Dread Presence deletion, Fixed primitives for ELD set. 2019-10-08 22:20:53 +02:00
valfieri
0f0e627cf5 Fixed M20 primitives. 2019-10-07 19:40:45 +02:00
valfieri
83e7bfffd0 Fixed primitives of ELD, GRN and M20 sets. 2019-10-06 20:59:57 +02:00
valfieri
28b1c0e86f Fixed primitives for ELD and XLN sets. 2019-10-06 17:11:23 +02:00
valfieri
d0e4aa635b Fixed M20 primitives. 2019-10-06 16:21:43 +02:00
valfieri
a82a2e3571 Fixed some primitives for M20 and ELD sets. 2019-10-06 15:51:47 +02:00
valfieri
68161b2aaa Added new primitives for ELD set. 2019-10-06 00:29:07 +02:00
valfieri
4e7463c77e Added PZ1 set and improved Android downloader. 2019-10-05 16:02:38 +02:00
valfieri
8ab7212aa2 Added new primitives for PRM and ELD sets, removed some duplicated primitives. 2019-10-04 21:24:55 +02:00
valfieri
16d989e8ca Added ELD set and improved Android downloader. 2019-10-01 18:29:58 +02:00
valfieri
0c8e51693a Added PRM and TD0 set and Improved Android Downloader. 2019-09-27 19:14:01 +02:00
valfieri
9f4e7fb7b2 Fixed image name search bug on Android Downloader. 2019-09-25 19:44:59 +02:00
valfieri
9dd5807cae Added TPR set and improved Android Downloader. 2019-09-22 11:33:06 +02:00
valfieri
7441ae2e8b Added VMA set and Improved Android Downloader. 2019-09-21 15:27:03 +02:00
valfieri
c8869f4048 Fix Yawgmoth, Thran Physician 2019-09-20 18:54:22 +02:00
valfieri
21440c977d Fix Android Downloader. 2019-09-19 19:06:40 +02:00
valfieri
06ccc923ea Added GS1 set and Improved Android Downloader. 2019-09-19 17:58:32 +02:00
valfieri
c82fc3b5ce Added GNT set and Improved Android Downloader 2019-09-17 14:07:51 +02:00
valfieri
7a19ae8f40 Fix Android Downloader, Added zombie to 10E set, fixed Liliana the Last Hope. 2019-09-17 00:14:34 +02:00
valfieri
43be15e832 Fixed Loxodon Lifechanter 2019-09-16 20:57:51 +02:00
valfieri
4ce2a5c36e Fixed Liliana of the Veil, Bloodthirsty Aerialist and Twinblade Paladin. Improved Android Downloader 2019-09-16 16:59:51 +02:00
valfieri
82e53a8c39 Added MD1/V16/W16 sets and updated Android Downloader. 2019-09-14 09:51:00 +02:00
valfieri
dcc7e23b84 Fix Resources zip filename on Android downloader. 2019-09-13 19:48:21 +02:00
Vittorio Alfieri
54e4d881a7 Merge pull request #1027 from Vitty85/master
Added TD2 set, increased Wagic version to 0.22.1, fixed some bugs in Android Java wrapper.
2019-09-13 19:01:27 +02:00
valfieri
83f8d1c5d7 Added TD2 set, increased Wagic version to 0.22.1, fixed some bugs in Android Java wrapper. 2019-09-13 18:35:23 +02:00
Xawotihs
cf738e76d3 Merge pull request #1026 from Vitty85/master
Removed almost all duplicated primitives fixed life gain loop adding new keyword "except", added PCA/W17/DDR sets and merged the PSP graphic Folder with PC/Android one
2019-09-12 13:33:25 +02:00
valfieri
744e380df9 Added DDR set and improved Android Downloader. 2019-09-12 00:27:00 +02:00
Xawotihs
8970fa673b Should fix broken QT build 2019-09-11 22:30:03 +02:00
valfieri
88e09bbd05 Added W17 set 2019-09-11 19:40:04 +02:00
valfieri
7d86578152 fix missing bracket 2019-09-11 19:00:36 +02:00
valfieri
6fd6f9061c Added several ifdef PSP for different resolution image to merge the graphics folders. 2019-09-11 18:39:42 +02:00
valfieri
ba918b27ee merged the graphics dir with PSP one, modified code with ifdef PSP in order to load different resolution images for different devices. 2019-09-11 17:22:28 +02:00
valfieri
0b90a471d6 Correctly renamed PSP menu background image for deck selection 2019-09-11 00:56:40 +02:00
valfieri
24fd17ecf8 Added testcases for new keyword except used by Angel of Vitality. 2019-09-10 19:59:35 +02:00
valfieri
06ec97676e Fixed Angel of Vitality in M20 set and added new keyword "except" for @lifeof trigger in order to avoid a life gain loop when a card needs to increment life gaining in that phase (eg. Angel of Vitality). 2019-09-10 17:02:50 +02:00
xawotihs
4e4752856b Removed mac specific build files 2019-09-09 23:39:54 +02:00
Xawotihs
bc79115985 Added a build specific for mac 2019-09-09 22:16:40 +02:00
valfieri
6ecd762d18 Added Vitty85 to credits. 2019-09-09 20:38:22 +02:00
valfieri
0fa1f04e71 Fixed Angel of Vitality primitive (still a bit buggy but not looping) 2019-09-09 17:50:21 +02:00
valfieri
225be4d9aa Added PCA set to Resources 2019-09-09 11:53:19 +02:00
Xawotihs
29b89ba562 Removes -qt=qt5 for osx 2019-09-09 00:00:59 +02:00
Xawotihs
7d51b985a6 Sorting the qmake path 2019-09-08 23:47:19 +02:00
Xawotihs
91bfa11a4f we build res if we build psp, removed the ref to the mac script 2019-09-08 23:27:47 +02:00
Xawotihs
46834a6ee9 Let's build the res zip only if needed 2019-09-08 23:11:31 +02:00
valfieri
07119b88f6 Fix Glacial Revelation primitives in MH1.txt 2019-09-08 20:45:29 +02:00
Xawotihs
95af76a3b2 installing ant on osx as well 2019-09-08 20:18:46 +02:00
valfieri
0132f7aa5e Removed almost all duplicated primitives 2019-09-08 18:59:08 +02:00
xawotihs
4df34c82c2 Fied typo for osx 2019-09-08 18:49:34 +02:00
xawotihs
50d49e47e7 Merge branch 'master' into matrix 2019-09-08 18:31:39 +02:00
xawotihs
b29c37eb25 Should fix a typo 2019-09-08 18:30:59 +02:00
xawotihs
c7d09d8389 First try on matrix without cmake 2019-09-08 18:17:51 +02:00
Xawotihs
87ce6df145 Merge pull request #1025 from Vitty85/master
Fix for PSP/Android and added new sets M20/MH1/SS2/C19 and fixed UST/V17 sets
2019-09-08 17:49:11 +02:00
valfieri
f5a20110c4 Removed duplicated Tireless Tracker 2019-09-08 17:02:45 +02:00
valfieri
264183a42a Recompilef libs wtih JDK 1.7 2019-09-08 13:10:45 +02:00
valfieri
af0de566fe Set travis toolchain android target to 23 2019-09-08 12:36:33 +02:00
valfieri
480adfe83a Target android back to 29 2019-09-08 12:26:51 +02:00
valfieri
ce5b07b5b1 Removed java.util.stream dependency because not supported in Travis CI Android compiler. 2019-09-08 10:15:15 +02:00
valfieri
09098893e6 Removed dependencies from java.nio package and decreased target android version from 29 to 13 2019-09-08 09:57:00 +02:00
valfieri
414d99525d Fix Prismatic Vista card 2019-09-08 01:56:55 +02:00
valfieri
4f42ddadb5 Restored 29 target platform for Android 2019-09-07 23:17:13 +02:00
valfieri
901a7ca984 Revert TIME_UTC_ to TIME_UTC because Travis CI compile errors. 2019-09-07 22:38:46 +02:00
valfieri
d3feccff75 restored gnustl_static flag for android compile since travis toolchain doesn't support c++_static flag 2019-09-07 22:26:50 +02:00
valfieri
ccd17d32d0 Restored Android version to 16, Removed modification to boost, fixed primitives MH1 and M20, Fixed Snow mana issue. 2019-09-07 22:05:01 +02:00
valfieri
5c67d11aa6 fix spaces 2019-09-06 08:41:27 +02:00
Vitty85
7a529bac6d Merge branch 'master' into master 2019-09-06 08:38:04 +02:00
valfieri
2c62cfd487 replaced tabs with 4 spaces. 2019-09-06 08:31:39 +02:00
Xawotihs
a27216c317 Deactivating mac/ios build as currently broken 2019-09-05 22:24:33 +02:00
xawotihs
8315acbe86 Removed death_grasp.txt and ai/goblin_artillery.txt from the testsuite (see issue#1023) 2019-09-04 22:39:41 +02:00
Xawotihs
7a2f23db45 Using trusty dist as it seems the only one supported for Android. 2019-09-04 16:01:50 +02:00
Xawotihs
711f52e5ce Updating JDK to 7 2019-09-03 23:15:48 +02:00
valfieri
91f50009e1 Fix 2 cards mana cost in MH1 set. 2019-09-03 22:52:08 +02:00
Xawotihs
0cf8c1a970 Installing ant for android build 2019-09-03 22:40:11 +02:00
Xawotihs
2750b34b4f Trying to fix python dependencies 2019-09-03 22:24:39 +02:00
xawotihs
b023dd89b6 - Should remove an error with the PSP compiler 2019-09-03 22:09:44 +02:00
valfieri
9504027fdc Fix on token image saving in Android Downloader 2019-09-03 18:18:25 +02:00
valfieri
5c7528dbcf Fix timeout on image database download. 2019-09-03 14:04:07 +02:00
valfieri
e856538259 Added retries on image and database file download for Android Downloader program. 2019-09-02 19:52:46 +02:00
valfieri
1749330e8a Fix on some token images. 2019-09-02 12:01:45 +02:00
valfieri
893e64e4f7 Fix on 439538t token image 2019-09-01 17:04:22 +02:00
valfieri
169467158a Fix for some duplicated token on Android Image Downloader. 2019-09-01 16:59:59 +02:00
valfieri
ab0a5496b0 Set socket timeout on Android Downloader and fixed some minor exceptions. 2019-09-01 13:12:56 +02:00
valfieri
0c4deea3ed Fix names of Tokens in Android Image downloader. 2019-09-01 00:50:13 +02:00
valfieri
dd785a872e Fix some token names on Android Downloader 2019-08-31 14:15:20 +02:00
valfieri
c8603204ac Removed one comment on old IFDEF PSP 2019-08-31 11:23:56 +02:00
valfieri
ae81568463 Fixed a bug on set name when using the fast download method 2019-08-31 10:52:33 +02:00
valfieri
2fe9924fe5 Improved the Android downloader, now it's a lot faster because all the image urls have been indexed. 2019-08-31 01:23:36 +02:00
valfieri
818233213e Fix on UST card download image 2019-08-29 21:11:24 +02:00
valfieri
d9019c0808 Fix on some indexes on image donwloader. 2019-08-29 19:20:11 +02:00
valfieri
fdaed6503a Fixed V17 set total card numbers from 16 to 29 in dat file. Improved Android card image downloader. 2019-08-29 17:54:26 +02:00
valfieri
e10213a373 Improved Android Downloader: Bug Fixing and boosted token searching algorithm. 2019-08-28 23:55:36 +02:00
valfieri
34732a5f54 Improved Android downloader: the token searching algorithm has been boosted in terms of speed and reliability. 2019-08-28 17:35:40 +02:00
valfieri
d8d6025652 Fixed minor bugs on downloader. 2019-08-28 00:46:08 +02:00
valfieri
01117f4cb7 Improved Token searching algorithm and fixed some image URLs with higher resolution from DeckmMster and ScryFall. 2019-08-28 00:12:53 +02:00
valfieri
a25448cde7 Improved downloader, added pause/resume. 2019-08-27 12:02:55 +02:00
valfieri
ef4b18b394 Fix on UST set for Android Downloader and fix on StopDownload action. 2019-08-26 19:30:58 +02:00
valfieri
683b2fbed8 Improved Android Downloader, fix on UST set. 2019-08-26 17:19:28 +02:00
valfieri
cdfadec38b Improved Android Downloader and bug fixing 2019-08-26 17:08:23 +02:00
valfieri
7b434f33e8 Improved Android Downloader: added Image Resolution chooser and fixed several bugs. 2019-08-26 15:36:26 +02:00
valfieri
29f1420abc Improved Android Downloader and added the multiple set selection in the download option menu. 2019-08-26 00:44:12 +02:00
valfieri
39884d9711 Improved Dowloader: Set Async thread and displayed a progress bar for resource loading and card image downloading. 2019-08-25 22:29:24 +02:00
valfieri
a5c9f877f7 Improved Downloader and Option Menu handlers. 2019-08-25 00:52:05 +02:00
valfieri
c603765908 Improved Android Image Downloader adding execptions and errors handling 2019-08-24 23:58:59 +02:00
valfieri
a0b4a1f77c Improved Android Image Downloader 2019-08-24 23:54:42 +02:00
valfieri
e0a2a45037 Improvement on token search algorithm, not it even uses deckmaster website. 2019-08-23 23:00:46 +02:00
valfieri
4c6f5126a6 Improved token search algorithm. 2019-08-23 16:17:16 +02:00
valfieri
50da2fef42 Fix on C19 _cards.dat file (added double cards such as dusk/dawn, etc.) 2019-08-23 15:24:31 +02:00
valfieri
9dfd513ad3 Fix on Android downloader and code indent 2019-08-23 12:58:10 +02:00
valfieri
30622010df Fix Exception on Android downloader. 2019-08-23 12:45:17 +02:00
valfieri
f4d9de9490 Added the C19 set and primitives 2019-08-23 01:27:03 +02:00
valfieri
1092d4121a Improved Downloader adding retries and a better token search algorithm. 2019-08-22 18:52:40 +02:00
valfieri
2ec4b78a8a Improved the Image Downloader (now Zip works at the end of download!) 2019-08-22 04:26:38 +02:00
valfieri
1b88f7d3f9 Improved Image Downloader (but still zipper not working on Android) 2019-08-22 00:50:02 +02:00
valfieri
2ac3ec6f09 Added SS2 set. 2019-08-20 15:27:07 +02:00
valfieri
73138d2176 Downloader for Card Images now working on Android version with OptionMenuButton (no zip) 2019-08-20 00:49:38 +02:00
valfieri
7cb0d8b843 Retored Option Menu Android and added a draft of card images downloader (not working yet) 2019-08-19 00:20:02 +02:00
valfieri
1dc5c48ff6 Separated graphics of PSP from PC/Android version 2019-08-18 17:48:06 +02:00
valfieri
42754fd83c Fix on Primitives and Fix Android 2019-08-18 17:44:07 +02:00
valfieri
301de0f6f7 Android Fix 2019-08-18 17:33:00 +02:00
valfieri
9be1d44788 Android Fix 2019-08-18 17:11:20 +02:00
valfieri
7328c45013 Added PSP res file, fixed bug for PSP version and added M20, MH1 and UST sets and primitives. 2019-08-10 01:10:26 +02:00
Eduardo
3d9526a1dd Commander Anthology (CMA) Correction 2019-05-08 16:37:47 -05:00
Eduardo
1b8157ef0e Merge branch 'master' of https://github.com/WagicProject/wagic 2019-05-05 21:17:22 -05:00
Eduardo
8d20fd6483 Fixes to primitives 2019-05-05 21:17:15 -05:00
Eduardo
66741957c3 Revert "Fixes to primitives"
This reverts commit eb7d8850f4.
2019-05-05 21:14:27 -05:00
Eduardo
eb7d8850f4 Fixes to primitives 2019-05-05 21:13:48 -05:00
Eduardo MG
934b9d2856 Delete CM1.zip 2019-05-04 15:57:56 -05:00
Eduardo MG
0af443b753 Commander's Arsenal (CM1)
Commander's Arsenal (CM1) had the wrong name, this is the correct name and set code.
2019-05-04 15:53:57 -05:00
Eduardo MG
41e160ae34 War of the Spark _cards.dat 2019-05-01 17:57:12 -05:00
Eduardo
8b620627d9 Major Corrections to WAR and removing crashing cards
Cards that check the colors of mana that lands on the opponent battlefield crashes the game, hard to reproduce but happens often enought that I decided to remove them.

Minor fixes in set and Major fixes in WAR primitives
2019-05-01 17:19:01 -05:00
Eduardo
d943778309 Double face cards should be marked as tokens 2019-05-01 17:09:27 -05:00
Eduardo
06cb835a5b Teaching AI proliferate and shocklands
Some minor changes, corrections to XLN and C17, changing name of game mode from horde to tribal wars
2019-05-01 17:00:48 -05:00
Eduardo
f1a529576e Preparing for a release, bug fixes and adjustments to game modes
Updating macros and new cards marked as borderline
2019-04-25 18:03:41 -05:00
Eduardo MG
1af3cff419 Uploading sets since Amonkhet until War of the spark
These are graded as borderline, each set has it's individual txt file, not integrated to the main mtg.txt to make them easier to manage, with the appropiate tools and more testing the files can be integrated. 

Includes standard sets(expansions) and supplemental products(masters sets, commander) since Amonkhet.
2019-04-25 17:53:49 -05:00
Eduardo
5db6b807ba Set limited game mode, AI changes, primitives and _cards.dat corrections
New set limited ,where you get a deck two random sets.

Still playing with the AI values and hueristics.

Cards fixes. Masters Edition should be named ME1 and the Mythic Edition is MED, the cards multiverse ids are still the same so the decks and references should not change.
2019-04-20 15:51:52 -05:00
Eduardo MG
1c6b0bdfd5 New game modes
Rules for several new game modes and rules

horde, get a random tribe and summon a creature from your deck each turn
paradise, lands tap for all mana
false god, exchange permanents at upkeep
morinfen, lose 1 life for every permanent you control at upkeep, starts at 50 life
2019-04-20 12:25:58 -05:00
Eduardo
3dfcc65fa6 Bug fix for the biggest crash and fixes to the primitives
I figured a while ago that the cause of the crash was a rendering issue, not an engine issue, since you could copy spells in the stack if you didn't targeted them. The crash was most likely in ActionStack, just had to follow the trace. It doesn't affect anithing else, that line was trying to render something in the stack that's a permanent but it always had bad ptrs.
2019-04-17 20:28:43 -05:00
Eduardo
c3937ce517 Fixing primitives and mayor bugs report
Game crashes when AI plays a card with cost {X} and that targets a player, this cards can be coded around that restriction and still work as per the rules.

The BIGGEST BUG the game has now is that crashes occur when a PERMANENT TARGETS A SPELL IN THE STACK, sometimes the AI can make this cards work (WTH!?) but never the player.

Effects like mirari and similar could be coded so that you don't target the spell but trigger and copy the source of the trigger, look at the code of mirari for this to be more clear.

This effect used to work for many many years I remember  Glen Elendra Archmage being one of my favorite cards back in the day. This bug has been present since god knows when, as early as october 2016: https://wololo.net/forum/viewtopic.php?f=4&t=66296&start=150#p98160

Also freaking Lemures caused the AI to just keep repeating the effect so I put a limit on activations on them.
2019-04-14 21:56:20 -05:00
Eduardo
ab1fbaa806 New game modes, bug fixes in primitives, improving AI, new planeswalkers type rule
New rules based on vanguard, 3 new random game modes, one is tribal and one uses any card in the game.

Several corrections and bugs fixes. Cards with x in their cost and that can target any player used to crash the game.

Teaching AI new things and changing values of efficiency.

You can have multiple "Jace" planeswalkers, you can't have two of the exact same name (no two Jace, the mind sculptor).
2019-04-14 19:57:01 -05:00
Eduardo
6eca5bea2f Last March Update
Some bug fixing to the primitives, the fetchlands are so buggy that I restored to a simple version

Some minor UI improvements
2019-03-31 20:53:13 -06:00
Rolzad73
e4d73d95ec - removing debug info after travis build fix 2019-03-27 22:50:10 -04:00
Rolzad73
363383df6d - try to fix travis build travis script debug pt 7 (groovy, Java 8 incompatibility) 2019-03-27 22:15:48 -04:00
Rolzad73
0d05804376 - try to fix travis build travis script debug pt 6 (ant error log too long) 2019-03-27 22:04:11 -04:00
Rolzad73
cdd36a404b - try to fix travis build travis script debug pt 5 2019-03-27 21:42:37 -04:00
Rolzad73
64c509980c - fix bad commit travis.yml 2019-03-27 21:39:38 -04:00
Rolzad73
46ba018201 - try to fix travis build travis script debug pt 4 2019-03-27 21:37:38 -04:00
Rolzad73
0cb931e6e2 - try to fix travis build travis script debug pt 3 2019-03-27 21:25:26 -04:00
Rolzad73
58af6f73d9 - try to fix travis build travis script debug pt 2 2019-03-27 21:12:46 -04:00
Rolzad73
e81f1299cb - try to fix travis build travis script debug 2019-03-27 21:03:40 -04:00
Rolzad73
9b5f9684b0 - try to fix travis build android dependancies pt 3 2019-03-27 20:48:21 -04:00
Rolzad73
d934c0948c - try to fix travis build android dependancies pt 2 2019-03-27 20:45:05 -04:00
Rolzad73
917a3a88df - try to fix travis build android dependancies 2019-03-27 20:38:51 -04:00
Rolzad73
dc5b8a8c52 - try to fix travis build 2019-03-27 15:50:08 -04:00
Eduardo MG
d2b44e652b Uploading a couple of years of sets
RNA Guild Kit		Set Code: GK2
Ravnica Allegiance	Set Code: RNA
Ultimate Box Topper Set Code: PUMA
Ultimate Masters	Set Code: UMA
GRN Guild Kit		Set Code: GK1
Guilds of Ravnica	Set Code: GRN
Commander 2018	Set Code: C18
Core Set 2019		Set Code: M19
Signature 
Spellbook: Jace	Set Code: SS1
Battlebond 		Set Code: BBD
Commander Anthology 
Volume II			Set Code: CM2
Dominaria		Set Code: DOM
Duel Decks: Elves 	
vs. Inventors		Set Code: DDU
Masters 25 		Set Code: A25
Rivals of Ixalan	Set Code: RIX
Unstable			Set Code: UST
Explorers of Ixalan   Set Code: E02
From the Vault: 
Transform		Set Code: V17
Iconic Masters		Set Code: IMA
Duel Decks: Merfolk
vs. Goblins		Set Code: DDT
Ixalan			Set Code: XLN
Commander 2017	Set Code: C17
Hour of Devastation Set Code: HOU
Archenemy: Nicol 
Bolas			Set Code: E01
Commander Anthology	Set Code: CMA
Amonkhet			Set Code: AKH
Amonkhet 
Invocations			Set Code: MP2
Duel Decks: Mind 
vs. Might			        Set Code: DDS
Modern Masters 2017	Set Code: MM3
2019-03-26 20:35:45 -06:00
Eduardo
1ce3b469e7 Update primitives
Added the supertype Legendary to Planeswalkers.

When you pay life the code should be {L:1}  not just {L} or else the cards ave very buggy.

Several bug fixes, card corrections and typos.
2019-03-26 16:50:34 -06:00
Anthony Calosa
07e6d90c98 Merge pull request #975 from kevlahnota/master
Some fixes
2017-08-06 13:33:07 +08:00
Anthony Calosa
85231cda01 Fix Nissa's Chosen
Code seems workaround, it needs hardcoded...
2017-08-05 22:09:49 +08:00
Anthony Calosa
8549b7b1b4 Interrupt targetted abilities
This should have an option...
2017-08-05 18:52:27 +08:00
Anthony Calosa
9f58ef9916 small fixes for primitives 2017-08-05 18:16:47 +08:00
Anthony Calosa
c734ee9fd1 Add exert Indicator
"*" signifies exert
2017-08-05 18:16:24 +08:00
Anthony Calosa
77d87902d9 Add restriction for exert
hasexerted and notexerted
2017-08-05 18:15:44 +08:00
Anthony Calosa
b5c8656ac9 Fix Blink 2017-08-05 18:15:13 +08:00
Anthony Calosa
28f6b73da6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-08-03 20:03:26 +08:00
Anthony Calosa
521b505543 Merge pull request #974 from kevlahnota/master
Fix morbid
2017-08-03 19:54:35 +08:00
Anthony Calosa
c5a3310103 quick Fix for zerodead 2017-08-03 18:32:16 +08:00
Anthony Calosa
0c053c713a fix morbid
also added zerodead restriction - returns true if you dont have any
creature that died this turn
2017-08-03 18:27:45 +08:00
Anthony Calosa
bc06f93aae Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-08-03 15:52:56 +08:00
Anthony Calosa
8e919aeeb1 Merge pull request #973 from kevlahnota/master
Support for AKH/HOU Mechanics
2017-08-03 10:36:15 +08:00
Anthony Calosa
6bd09e42e0 Add support for Amonkhet Mechanics
and fix some cards.
Added exerted trigger, event and add removemc keyword inside transforms
ability so we can soft code Embalm and Eternalize...
2017-08-03 09:49:37 +08:00
Anthony Calosa
1f670b9919 Merge pull request #12 from WagicProject/master
Update unsuported cards, set a condition for showing poison counters …
2017-08-03 09:16:30 +08:00
punkeduard
c805a58fb0 Update unsuported cards, set a condition for showing poison counters and energy counter, added tribal al card type check, show the amount o 2017-08-02 18:42:52 -05:00
Anthony Calosa
34517004df Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-05-09 12:38:59 +08:00
Anthony Calosa
b0506bcd96 Merge pull request #968 from kevlahnota/master
readded fixes by punkeduard
2017-05-09 12:29:16 +08:00
Anthony Calosa
7a3a6c04a6 readded fixes by punkeduard 2017-05-09 12:28:07 +08:00
Anthony Calosa
54e4b08e1f Merge pull request #11 from WagicProject/master
test pull
2017-05-09 12:25:45 +08:00
Anthony Calosa
67c22c5186 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-05-09 12:09:12 +08:00
punkeduard
87aba86fa8 Revert "Fixing bugs in the primitives"
This reverts commit 665f8ce755.
2017-05-08 22:17:27 -05:00
Rolzad73
28ea300f42 - fix forward declaration 2017-05-08 19:39:32 -04:00
Rolzad73
858c26b46a Merge pull request #966 from WagicProject/key_bind_changes
Key bind changes
2017-05-08 19:03:03 -04:00
Rolzad73
70a6c7149c - semi cleanup 2017-05-08 19:01:41 -04:00
Rolzad73
b4a34216c8 - updated Qt keybinding translation 2017-05-08 18:58:47 -04:00
Anthony Calosa
3868f4eb98 Merge pull request #965 from kevlahnota/master
Minor Corrections
2017-05-08 12:15:44 +08:00
Anthony Calosa
44304ee5b3 minor corrections 2017-05-08 11:41:00 +08:00
Anthony Calosa
9f4b8d65c8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-05-08 11:33:57 +08:00
punkeduard
665f8ce755 Fixing bugs in the primitives
Daring Sleuth was crashing the game in the collection
2017-05-03 14:42:10 -05:00
Anthony Calosa
e1d5348f23 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-20 11:37:01 +08:00
Anthony Calosa
b596dc9eea Merge pull request #964 from kevlahnota/master
Add some cards
2017-03-20 06:09:04 +08:00
Anthony Calosa
eb8370b86b add some cards
also added countb() - countedbamount..
2017-03-19 21:57:59 +08:00
Anthony Calosa
fa69686f0a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-19 08:59:21 +08:00
Rolzad73
3fe5372d28 non-commit to test build 2017-03-18 11:27:20 -04:00
Anthony Calosa
3058d42b49 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-16 20:58:36 +08:00
Anthony Calosa
4975ee0028 Merge pull request #963 from kevlahnota/master
Bushido, Modular points
2017-03-16 17:53:14 +08:00
Anthony Calosa
d4e1d809f3 Bushido & Modular
add Bushido and Modular points
2017-03-16 16:58:56 +08:00
Anthony Calosa
44cb0d995e support some cards discarded by opponent 2017-03-16 10:58:27 +08:00
Anthony Calosa
c73d08187b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-16 06:11:27 +08:00
Anthony Calosa
4382c34539 Merge pull request #962 from kevlahnota/master
minor fixes
2017-03-15 12:54:44 +08:00
Anthony Calosa
cb173b7bf9 update unsupported 2017-03-15 11:46:47 +08:00
Anthony Calosa
b5d4674471 unused variable 2017-03-15 11:23:53 +08:00
Anthony Calosa
be1803dfb6 unearth rule 2017-03-15 06:35:30 +08:00
Anthony Calosa
417c1af21e hide action stack
if there's a human player and a menu object
2017-03-15 06:31:39 +08:00
Anthony Calosa
00bccd02da Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-15 06:16:46 +08:00
punkeduard
8596443da5 Fixing card primitives
Add flying to an angel and corrected some values on mana costs
2017-03-14 12:53:29 -06:00
Anthony Calosa
a2eda76a26 fix prefetch options 2017-03-14 17:06:14 +08:00
Anthony Calosa
b4e25838bd update targetchooser 2017-03-14 09:15:14 +08:00
Anthony Calosa
44d703887c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-14 09:12:05 +08:00
Anthony Calosa
29fd3e4c96 Merge pull request #961 from kevlahnota/master
Totem Armor
2017-03-14 05:39:38 +08:00
Anthony Calosa
0778b13e2b Totem Armor 2017-03-14 03:40:29 +08:00
Anthony Calosa
bef1f6d8b8 aura parent 2017-03-13 18:16:22 +08:00
Anthony Calosa
d6a0b04930 Partial fix for Cards with Bestow
missing was to seperate the mode as aura enchantment or enchantment
creature when cast and update the cost
2017-03-13 13:32:43 +08:00
Anthony Calosa
87ae60f323 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-12 22:14:59 +08:00
Anthony Calosa
85df061701 Merge pull request #960 from kevlahnota/master
Update Rules
2017-03-12 12:14:09 +08:00
Anthony Calosa
4ed44c638f Update Rules
Also fix stack display and removed unnecessary code (border for card is
targetted/targetter since we used forcedborder in actionstack). Also
fixed some cards
2017-03-12 10:53:39 +08:00
Anthony Calosa
54f0cd7864 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-12 07:36:00 +08:00
Rolzad73
4f523b1b9b Non-commit to test build system 2017-03-11 12:01:07 -05:00
Anthony Calosa
d492481a4f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-11 22:10:28 +08:00
Anthony Calosa
3975a45858 Merge pull request #959 from kevlahnota/master
Hide action stack & Sorted Filter
2017-03-11 10:48:17 +08:00
Anthony Calosa
5f2fbb370c fix 2017-03-11 07:57:54 +08:00
Anthony Calosa
d9bd6bbb32 cascade, cascade 2017-03-10 19:25:54 +08:00
Anthony Calosa
31814bda37 sort filter 2017-03-10 19:24:49 +08:00
Anthony Calosa
8f61b590f8 Hide Action stack if there's a menu object 2017-03-10 19:24:39 +08:00
Anthony Calosa
37642c1f78 rageform
rageform, lightform & cloudform support. withenchant is for only these
cards...
2017-03-10 14:14:02 +08:00
Anthony Calosa
8ea7b4d4cb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-10 13:43:31 +08:00
Anthony Calosa
245f5c6e93 Merge pull request #958 from kevlahnota/master
Ripple Cards
2017-03-10 12:58:02 +08:00
Anthony Calosa
88d1c29621 safe delete 2017-03-10 08:49:35 +08:00
Anthony Calosa
44926393ac Ripple cards 2017-03-10 07:19:29 +08:00
Anthony Calosa
5d790c9406 moved lastcontroller override 2017-03-10 07:19:15 +08:00
Anthony Calosa
66261b0f51 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-10 07:08:56 +08:00
Anthony Calosa
e99a9abacd Merge pull request #957 from kevlahnota/master
Provoke
2017-03-09 19:34:10 +08:00
Anthony Calosa
b01c1455f5 Provoke
also add aicode for Amplify cards
2017-03-09 18:37:55 +08:00
Anthony Calosa
650d794eec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-09 14:33:29 +08:00
Anthony Calosa
acf74e7f6e Merge pull request #956 from kevlahnota/master
Manifest Cards & corrections
2017-03-09 09:07:45 +08:00
Anthony Calosa
53f0c2421d manifest support
also fix guiplay
2017-03-09 07:44:06 +08:00
Anthony Calosa
01d46615a7 fix credits 2017-03-09 02:01:08 +08:00
Anthony Calosa
57f55e4270 corrections 2017-03-08 22:44:34 +08:00
Anthony Calosa
5c159e86d7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-08 20:52:04 +08:00
Anthony Calosa
fb03037923 Merge pull request #955 from kevlahnota/master
Adjust stack display & game credits
2017-03-08 16:14:09 +08:00
Anthony Calosa
ff6e4aec9a adjust stack display & game credits
the stack will display the latest object always on TOP so we can see
which will resolve first, the last to resolve will always be on
bottom... also increase credit bonus. default is 500 credits and for
momir will be 800 credits.
2017-03-08 13:38:19 +08:00
Anthony Calosa
c78db0eb26 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-08 05:46:00 +08:00
Anthony Calosa
324e206b74 Merge pull request #954 from kevlahnota/master
Deck Sideboard and Wish Cards
2017-03-08 02:37:09 +08:00
Anthony Calosa
030dca051a support for wish cards and deck sideboard 2017-03-07 23:42:34 +08:00
Anthony Calosa
24e3fd3267 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-07 15:47:18 +08:00
Anthony Calosa
a28f6b1194 Merge pull request #953 from kevlahnota/master
Etched Affinity stalling the game
2017-03-07 05:32:38 +08:00
Anthony Calosa
38e97aa79f fix etched affinity stalling the game
add an alias for glimmervoid and removed the hold combo hint for
glimmervoid, just tried etched affinity vs etched affinity on demo for
50 games... it doesn't stall anymore. it seems there's a conflict
somewhere parsing hint combo? not really sure... also in momir the ai
don't click choose a color command, noticed on lotus cobra so i changed
the chooseacolor to abilty$! add{mana} ...
2017-03-06 17:52:44 +08:00
Anthony Calosa
8adfd1b10b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-06 12:52:58 +08:00
Anthony Calosa
ffda7a53fe Merge pull request #952 from kevlahnota/master
Prefetching as options
2017-03-06 11:19:53 +08:00
Anthony Calosa
20ddd9157f prefetching options 2017-03-06 10:41:52 +08:00
Anthony Calosa
a3f329bd7a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-06 10:40:25 +08:00
Anthony Calosa
13c6837b60 Merge pull request #951 from kevlahnota/master
Show large images on grid deck view user option
2017-03-06 06:25:03 +08:00
Anthony Calosa
84fe9fbc74 highlight border fix
all selected/targeted cards ar bordered red while the source is green
border
2017-03-05 22:38:53 +08:00
Anthony Calosa
e5ec92ac2a corrected order of options 2017-03-05 22:09:12 +08:00
Anthony Calosa
12155f9390 forgot this 2017-03-05 21:56:54 +08:00
Anthony Calosa
00da0bd0d1 seperate tabs
Misc setting that I added
2017-03-05 21:28:18 +08:00
Anthony Calosa
4bf5943ac5 show large images on grid deck view user option
also forced border targets and target source
2017-03-05 19:43:49 +08:00
Anthony Calosa
f205de7205 minor fix 2017-03-04 09:15:50 +08:00
Anthony Calosa
f782c535f9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-04 06:49:06 +08:00
Anthony Calosa
030d6bc4bb Merge pull request #950 from kevlahnota/master
Swap zones - exile and library for opponent
2017-03-04 05:42:34 +08:00
Anthony Calosa
9c10574e49 replaced some overlay 2017-03-04 04:24:40 +08:00
Anthony Calosa
9512e5c3db fix overlapping of phaseinfo/phase bar
the opponent cards will stack according to handsize
2017-03-04 04:24:10 +08:00
Anthony Calosa
8686fef96a enstacking of card during combat
during combat damage, the cards will not move/enstack so we can see what
happened to those creatures...
2017-03-04 04:23:19 +08:00
Anthony Calosa
06285c11c7 swap zone position for opponent
swap position of opponent exile zone and opponent library zone, since a
lot of codes use reveal for library, and hand, it's much easier to
target the exile . Also cards that display from the top of library is
not blocked anymore.
2017-03-04 04:21:43 +08:00
Anthony Calosa
3b58790c96 Add files via upload 2017-03-04 02:34:33 +08:00
Anthony Calosa
a8b494f960 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-04 02:28:51 +08:00
Anthony Calosa
72c6f448d0 Merge pull request #949 from kevlahnota/master
Support for playing the top card of library
2017-03-03 22:57:37 +08:00
Anthony Calosa
ce3c75817c draw line when attacking planeswalker 2017-03-03 22:20:38 +08:00
Anthony Calosa
56c943d6d1 bug fix
reset will attack player/planeswalker
2017-03-03 22:20:13 +08:00
Anthony Calosa
21b0b4c524 Play the Top Card of Library 2017-03-03 18:49:36 +08:00
Anthony Calosa
51daf691b3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-03 11:20:39 +08:00
punkeduard
e889aff42c Merge branch 'refs/heads/Mine' 2017-03-02 20:37:48 -06:00
punkeduard
df07b6dc9e Corrected some text on cards primitives 2017-03-02 20:34:30 -06:00
Anthony Calosa
63c15b54d6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-03 06:31:41 +08:00
Anthony Calosa
b76a231083 Merge pull request #948 from kevlahnota/master
Attack Menu
2017-03-03 06:06:57 +08:00
Anthony Calosa
e0f58e1916 attack/block cost value 2017-03-03 00:39:23 +08:00
Anthony Calosa
78bfa604e2 tidy up attack menu 2017-03-02 21:46:29 +08:00
Anthony Calosa
dcbe0c40b0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-02 18:59:07 +08:00
Anthony Calosa
f384d75de8 Merge pull request #947 from kevlahnota/master
Fix Aura/Equipment on Illegal Objects
2017-03-02 16:51:11 +08:00
Anthony Calosa
cf6084071b fix aura attached on illegal objects
704.5n If an Aura is attached to an illegal object or player, or is not
attached to an object or player, that Aura is put into its owner’s
graveyard.

704.5p If an Equipment or Fortification is attached to an illegal
permanent, it becomes unattached from that permanent. It remains on the
battlefield.

704.5q If a creature is attached to an object or player, it becomes
unattached and remains on the battlefield. Similarly, if a permanent
that’s neither an Aura, an Equipment, nor a Fortification is attached to
an object or player, it becomes unattached and remains on the
battlefield.
2017-03-02 14:26:06 +08:00
Anthony Calosa
0150796064 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-02 14:10:01 +08:00
Anthony Calosa
f91186ffa4 Merge pull request #946 from kevlahnota/master
lastcontroller & card update
2017-03-02 10:50:43 +08:00
Anthony Calosa
ba73da321b minor 2017-03-02 07:56:41 +08:00
Anthony Calosa
8ae3e1ea98 quick fix 2017-03-01 21:13:47 +08:00
Anthony Calosa
fa5b075af5 update lords
lastcontroller override
2017-03-01 20:51:06 +08:00
Anthony Calosa
a66fced2f7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-03-01 18:51:26 +08:00
Anthony Calosa
33492602fb Merge pull request #945 from kevlahnota/master
Updated attack rule & revert some activated "lord" to use "all"
2017-03-01 18:49:02 +08:00
Anthony Calosa
b7dae1025b Refactored PW Attack Rule 2017-03-01 17:53:40 +08:00
Anthony Calosa
7627a00dce arboria 2017-03-01 16:09:31 +08:00
Anthony Calosa
d761bac85c revert pw attack rule
need to refactor this as this cause crashes on android when you cast a
planeswalker
2017-03-01 16:07:12 +08:00
Anthony Calosa
3bf1cca118 removed this 2017-03-01 14:15:57 +08:00
Anthony Calosa
cdb056e8ba forgot this 2017-03-01 10:45:17 +08:00
Anthony Calosa
e47256eae7 update cant attack rule
If it says cant attack or cant attack You or PlanesWalker, creatures
cant attack a player or planeswalker, If it says cant attack You,
creatures cant attack a player only but can attack a PlanesWalker
2017-03-01 10:35:47 +08:00
Anthony Calosa
5f1874edae planeswalker attack 2017-03-01 06:36:10 +08:00
Anthony Calosa
22376e873e corrections
seems lord is persistent now
2017-02-28 21:45:34 +08:00
Anthony Calosa
02d882a7c3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-28 18:22:59 +08:00
Anthony Calosa
d878e0c450 Merge pull request #944 from kevlahnota/master
Momir Indicator (non PSP)
2017-02-28 18:12:40 +08:00
Anthony Calosa
1430cfd6b4 momir indicator (non PSP)
green + can play a land, red + means you already played a land/ or cant
play a land anymore. also some minor fix
2017-02-28 17:32:01 +08:00
Anthony Calosa
5a3493c0c9 update spelltargettype 2017-02-28 16:19:59 +08:00
Anthony Calosa
911f8f6de6 update scry then draw
also moved "show token in editor" in general settings
2017-02-28 10:41:46 +08:00
Anthony Calosa
fe8fbd058b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-28 06:50:13 +08:00
Anthony Calosa
c4529a0949 Merge pull request #943 from kevlahnota/master
Filter View
2017-02-28 06:23:21 +08:00
Anthony Calosa
6ec3a68f0a update some cards 2017-02-27 22:52:33 +08:00
Anthony Calosa
458731778d add options show tokens
you can display tokens in editor (show tokens and choose 0 manacost) but
you can't add them, useful for tracking missing images...
2017-02-27 21:50:15 +08:00
Anthony Calosa
64547271dc Filter View
Tokens are excluded in deck editor, filter and adjust filter menu
2017-02-27 13:21:35 +08:00
Anthony Calosa
9e584951ac Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-27 06:50:31 +08:00
Anthony Calosa
c859fdd08e Merge pull request #942 from kevlahnota/master
Crash fix and some card update
2017-02-27 00:34:16 +08:00
Anthony Calosa
1380ee6f20 equal
typo fix
2017-02-26 23:21:23 +08:00
Anthony Calosa
2da2272a53 update some cards 2017-02-26 23:13:45 +08:00
Anthony Calosa
17b6996ae4 tokens
cant buy and/or add tokens in deck editor and shop...
also adjust filter menu
2017-02-26 21:21:11 +08:00
Anthony Calosa
0f82b6efba crash fix mana ability filter 2017-02-26 15:22:16 +08:00
Anthony Calosa
178fcb9717 update some cycled cards 2017-02-26 09:38:11 +08:00
Anthony Calosa
19f0c653d1 add 1k to steal credits
maxglee profile
2017-02-26 09:36:32 +08:00
Anthony Calosa
7dc76876e4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-25 20:48:07 +08:00
Anthony Calosa
60457886cc Merge pull request #941 from kevlahnota/master
Customlen
2017-02-25 12:19:25 +08:00
Anthony Calosa
ec078b6ccc customLen
for formatting text on booster shop, we pass the desired length from
getformatted text with noremove(no removal of {}) enabled, if its not
enabled then default the value to zero(passing zero means use the
default values)
2017-02-25 07:27:57 +08:00
Anthony Calosa
ec730a4383 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-25 07:22:27 +08:00
Anthony Calosa
b2b3255f59 Merge pull request #940 from kevlahnota/master
Booster Shop
2017-02-24 22:21:22 +08:00
Anthony Calosa
df925cfcb0 booster shop enhancement 2017-02-24 21:45:43 +08:00
Anthony Calosa
5b96f30b1a reversed 2017-02-24 18:22:01 +08:00
Anthony Calosa
8feb870c8f shop enhancements 2017-02-24 17:29:59 +08:00
Anthony Calosa
d0b2340a73 crash fix in buying booster
this should be in game only
2017-02-24 15:04:12 +08:00
Anthony Calosa
efac298eb0 revert jtypes 2017-02-24 15:03:28 +08:00
Anthony Calosa
453c5b0d6e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-24 10:06:00 +08:00
Anthony Calosa
816010582a Merge pull request #939 from kevlahnota/master
Update some cards
2017-02-24 08:55:00 +08:00
Anthony Calosa
a260eb11a8 crash fix 2017-02-24 07:25:38 +08:00
Anthony Calosa
b1d271f1c2 add forced interrupt 2017-02-24 07:25:19 +08:00
Anthony Calosa
3faa959c09 updated some cards 2017-02-24 06:02:00 +08:00
Anthony Calosa
a12a5e1637 test swap 2017-02-23 19:05:37 +08:00
Anthony Calosa
7c6d59a292 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-23 19:04:15 +08:00
Anthony Calosa
9836d8595c Merge pull request #938 from kevlahnota/master
Refactor efficiency
2017-02-23 18:17:15 +08:00
Anthony Calosa
c9d5dfaf1b minor adjustments 2017-02-23 18:16:23 +08:00
Anthony Calosa
028f6cbb4e u32 2017-02-23 17:11:42 +08:00
Anthony Calosa
c56d1b0bec pixel type
psp
2017-02-23 16:33:38 +08:00
Anthony Calosa
2e61f6c13d test pixel_type 2017-02-23 16:08:04 +08:00
Anthony Calosa
8437467320 refactor revealed efficiency
it's based now on actual aicode if it's available.
2017-02-23 14:10:27 +08:00
Anthony Calosa
039be43c2b set the current controller to do action
let the controller of the action do the abilty, also fix casted cards
that's been casted using castcard and be put into its owner's graveyard
2017-02-23 14:04:16 +08:00
Anthony Calosa
a1af7d9b9f add black border option
if enabled, all cards will have black border
2017-02-23 08:38:15 +08:00
Anthony Calosa
4ce37964f4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-22 22:26:28 +08:00
Anthony Calosa
c1cdfa78d3 Merge pull request #937 from kevlahnota/master
update some cards
2017-02-22 22:06:31 +08:00
Anthony Calosa
ff4911116c update some cards
removed phasedout trigger
add phasedoutbonus - ability
2017-02-22 18:25:39 +08:00
Anthony Calosa
bb9d98cc0c AI ignore sphinx of jwar isle 2017-02-20 23:23:13 +08:00
Anthony Calosa
2d93d9b3cc moved this block for PSP
maybe we can fix the GUI for psp, low priority for now
2017-02-20 22:08:09 +08:00
Anthony Calosa
1c60ba6e7f crash fix
when you generate a castcard, then exit the game, an exception occurs to
SAFE_DELETE(cards[i]->previous) && SAFE_DELETE(cards[i]) in
mtggamezones.cpp line 548 and 549.
2017-02-20 22:06:56 +08:00
Anthony Calosa
11b3989615 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-20 10:08:28 +08:00
Anthony Calosa
c9f26a48c7 Merge pull request #936 from kevlahnota/master
update some cards
2017-02-19 23:23:06 +08:00
Anthony Calosa
75cbaf0f06 update mana producer
change && to andability
2017-02-19 22:44:33 +08:00
Anthony Calosa
de1dc6828d try to fix phase name
sometimes its invalid phase name
2017-02-19 22:11:54 +08:00
Anthony Calosa
e6bf23e536 add saclands cost
sacrifice all lands {saclands} cost
2017-02-19 22:11:16 +08:00
Anthony Calosa
5b16ff4a69 bypass update when reveal display is still active 2017-02-19 21:11:24 +08:00
Anthony Calosa
ed42c3fd29 support andability in mana producer
so cards that parse mana abilities can be read (reflecting pool. etc..
fixes issue #700 but we need to update the code from add{mana} && do
something to add{mana} and!( do something)! )
2017-02-19 21:11:02 +08:00
Anthony Calosa
9cd67eedc1 refactor canproducemana 2017-02-19 21:08:07 +08:00
Anthony Calosa
acc589bdb6 universal border 2017-02-19 10:16:25 +08:00
Anthony Calosa
2d78512ca2 bypass gamestate check
when there is an opened display for reveal... it will update after its
finished...
2017-02-19 10:14:43 +08:00
Anthony Calosa
84023a5f66 test fix 2017-02-18 21:36:38 +08:00
Anthony Calosa
443f378d1b updated some card
a lot of cards needs update though...
2017-02-18 21:20:45 +08:00
Anthony Calosa
d4989d7576 replaced alphabeta 2017-02-17 21:31:41 +08:00
Anthony Calosa
860b0b64e3 Adjust Extracost string 2017-02-17 19:17:23 +08:00
Anthony Calosa
ba40253a46 Phase out Event & Trigger 2017-02-17 14:25:33 +08:00
Anthony Calosa
95b81b6425 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-17 05:26:28 +08:00
Anthony Calosa
b664c2bed1 Merge pull request #935 from kevlahnota/master
Some New Changes
2017-02-16 22:33:58 +08:00
Anthony Calosa
c6c4c17b30 try to fix parenthesis
:(
2017-02-16 21:57:17 +08:00
Anthony Calosa
5e46016c4d added new legend & pw rule, trigger & event
added new pw & legend rule (i just leave the old rules behind and
disabled it), added phasesin, faceup, copiedacard event, added facedup &
phasedin trigger.
2017-02-16 21:26:03 +08:00
Anthony Calosa
da874738d6 castcard generated card 2017-02-16 17:10:06 +08:00
Anthony Calosa
0a68a056d8 refactor canproducemana 2017-02-16 16:55:13 +08:00
Anthony Calosa
5a3a32462d first set of changes
updated some cards
2017-02-16 02:44:42 +08:00
Anthony Calosa
c70762f871 readded modified rule 2017-02-16 02:39:03 +08:00
Anthony Calosa
6c28496dd8 reduced efficiency 2017-02-16 00:42:54 +08:00
Anthony Calosa
90ed6e1fdd chooseacolor indicator
replaced text with color filled rectangle
2017-02-16 00:28:07 +08:00
Anthony Calosa
60d7675a36 necroed
hide cards using necroed
also fix castcard target if its a land.
2017-02-15 10:27:56 +08:00
Anthony Calosa
a9b42127d1 added mypos
mypos returns cards zpos (zone position)
2017-02-15 07:30:13 +08:00
Anthony Calosa
01fdcfdfec zpos and zone display
added zone position (adjust dynamically), also inverts the display of
the zone so we always get the top/recent one... the library zpos is
inverted so if we choose to target the top 5 zpos like
target(*[zpos>=5|mylibrary), it will do from top to bottom... this is
only for AI so we can add alternate code for them since they cant use
reveal atm, we can make them target within allowed range...
Also this commit disabled the  new legend and planeswalker rule since it
conflicts with reveal ability, unless I/We figure it out, I recommend to
use the old one...
2017-02-14 22:30:50 +08:00
Anthony Calosa
2d383e237f hiddenview
if the target is in library and the source has the hiddenface ability
then hide it
2017-02-14 05:09:28 +08:00
Anthony Calosa
143b3d98b1 modified guiopponenthand 2017-02-13 20:11:07 +08:00
Anthony Calosa
6f4377de76 Inverted this
we transform with no value.. get the value first then transform it to
lower...
2017-02-13 17:54:55 +08:00
Anthony Calosa
722056e78a moved this 2017-02-13 10:43:22 +08:00
Anthony Calosa
21710ddfb3 refactor AAMover getmenu text 2017-02-13 09:35:05 +08:00
Anthony Calosa
13f590c6a2 hiddenface
if the source has hiddenface ability then all of its targets will not
show on the stack ability, useful for cards like demonic tutor etc...
2017-02-13 08:26:06 +08:00
Anthony Calosa
d604ae2d77 add gravecast restriction
if gravecast then do something
-> translates when this card was cast from a graveyard
2017-02-13 07:49:37 +08:00
Anthony Calosa
7a35c253cb refine display 2017-02-12 19:43:10 +08:00
Anthony Calosa
b5129f702e add multi target quads
stack displays target quads up to 10 targets. also displays actual
number of targets...
2017-02-12 10:29:13 +08:00
Anthony Calosa
6b1e51b4f6 revised masks 2017-02-12 07:08:31 +08:00
Anthony Calosa
3776bff594 add effeciency to use the reveal ability
aicode overrides this on resolve and it seems most cards that have this
has possitive effect
2017-02-11 22:04:20 +08:00
Anthony Calosa
3afcc7fdf9 fix hang aicode ability controller
aicode should be dedicated for AI only...
2017-02-11 18:25:45 +08:00
Anthony Calosa
e74921cbdf fix crash for multiple andAbility 2017-02-11 16:17:31 +08:00
Anthony Calosa
e9c33e3bea revised shocklands 2017-02-11 01:28:14 +08:00
Anthony Calosa
36d4db49ca bug fix 2017-02-11 00:04:17 +08:00
Anthony Calosa
2c40c77403 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-11 00:02:22 +08:00
Anthony Calosa
15febaf851 Merge pull request #934 from kevlahnota/master
Crash fix
2017-02-10 23:02:33 +08:00
Anthony Calosa
02dce1af2e crash fix
transform getaicustomcode to lower
2017-02-10 21:00:18 +08:00
Anthony Calosa
5915ceb0a5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-10 17:36:55 +08:00
Anthony Calosa
d6f666d9a0 Merge pull request #933 from kevlahnota/master
added AER Cards
2017-02-10 16:53:28 +08:00
Anthony Calosa
37fa69fc39 added AER cards 2017-02-10 16:10:15 +08:00
Anthony Calosa
8e47927805 some corrections 2017-02-10 16:03:03 +08:00
Anthony Calosa
f1c1161da5 added AER set 2017-02-10 16:02:29 +08:00
Anthony Calosa
392382e3e3 missing AER 2017-02-10 16:00:03 +08:00
Anthony Calosa
d6403918b6 crash fix
corrected some cards that crashes the game
2017-02-10 13:57:46 +08:00
Anthony Calosa
fc9b0b233c add attacker mask 2017-02-10 10:50:09 +08:00
Anthony Calosa
f16755b86b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-10 09:20:00 +08:00
Anthony Calosa
f45e975b14 add remake keyword
alternative for becomes for use inside transforms...
ex. emblem transforms((,newability[target(land)
remake(creature:1/2:red)])) forever dontremove
2017-02-09 22:38:00 +08:00
Anthony Calosa
b3de6a283d Merge pull request #932 from kevlahnota/master
Some bug fixes
2017-02-09 21:48:51 +08:00
Anthony Calosa
7fa204fc9c forgot to change this 2017-02-09 19:15:32 +08:00
Anthony Calosa
f284a9691b some fixes
fixes fabricate
fixes lorded lands
add propagate keyword (like proliferate but it increases all counters)
cards with proliferate can choose a player now
2017-02-09 15:22:10 +08:00
Anthony Calosa
9bb63a68f5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-08 21:34:15 +08:00
Rolzad73
77d20e89c8 - fixed upload-binaries error from bad debug trace 2017-02-07 20:58:32 -05:00
Anthony Calosa
66f664207a Merge pull request #931 from kevlahnota/master
Changes
2017-02-07 22:12:39 +08:00
Anthony Calosa
bac69f95d8 some changes
change keyword "makecardt" alternative token creator to "create" keyword
add lifeleech - gain life lost with target
2017-02-07 21:22:49 +08:00
Anthony Calosa
75e372ac9b adjust enstack attackers
so we have small room for the phase wheel for touch enabled device
2017-02-07 17:00:37 +08:00
Anthony Calosa
ef31192f33 modified flickleft for android
if you flick/swipe left or right when the closedhand option is visible
in Android, you simulate scroll up/down.
example scenario at opponent's turn with a spell on the stack, swipe
down to interrupt then do something, if you open a zone like library or
graveyard or exile and you want to interract from the zone there (like
casting spell or doing ability from that zone, you can flick left or
right to close that zone so you can tap for mana or any other extra
costs for that spell, you can open the zone if possible just by tapping
it like it used to.)
2017-02-07 16:59:19 +08:00
Anthony Calosa
fde707b726 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-07 16:52:04 +08:00
Anthony Calosa
e158e95245 Merge pull request #930 from kevlahnota/master
auto close
2017-02-07 14:08:54 +08:00
Anthony Calosa
5b23cc2e33 auto close 2017-02-07 13:10:58 +08:00
Anthony Calosa
c72cdff0f1 Merge pull request #929 from kevlahnota/master
Some Bug Fixes
2017-02-06 22:25:59 +08:00
Anthony Calosa
831c8f73b0 some bug fixes
fix where the copier is treated as the same copied card, also fixes the
display ability of momir (forced), disabled reveal for AI if aicode is
not found (should add alternate for ai).
2017-02-06 21:48:41 +08:00
Anthony Calosa
2dc6c62acb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-06 21:47:48 +08:00
Anthony Calosa
9e1d1a056c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-06 05:56:00 +08:00
Rolzad73
9a32ae2c6d Merge pull request #928 from WagicProject/appveyor_testing
Just adding some console output to Appveyor build
2017-02-05 16:23:10 -05:00
Anthony Calosa
b1a2003a84 Merge pull request #927 from kevlahnota/master
Modified Momir
2017-02-05 22:57:38 +08:00
Anthony Calosa
e2c1d62552 modified Momir 2017-02-05 22:14:20 +08:00
Anthony Calosa
db0f6d6c0b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-05 21:08:37 +08:00
Xawotihs
bc44ee8056 And again 2017-02-05 11:48:30 +01:00
Xawotihs
65a9bd55d8 Tries to fix iOS/MacOSX builds 2017-02-05 11:03:51 +01:00
Anthony Calosa
2aa0668c28 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-05 16:45:13 +08:00
Rolzad73
9f5e37a03c - added even more meaning to release upload script case 2017-02-05 01:13:38 -05:00
Rolzad73
f27763870c Merge pull request #926 from WagicProject/qt_test_crash_fix
small QT build CI fix
2017-02-05 01:00:52 -05:00
Rolzad73
ab22e02db8 - cleaned up error msg bug 2017-02-05 00:38:37 -05:00
Rolzad73
257afd3525 - added more meaning to release upload script case 2017-02-05 00:29:00 -05:00
Rolzad73
eec38de558 - testing appveyor env vars 2017-02-05 00:04:47 -05:00
Rolzad73
35de677999 - stop mysterious ~QNetworkConfiguration() SIGSEGV issue at end of console testsuite run 2017-02-04 23:09:13 -05:00
Anthony Calosa
8b9dfdf96d bug fix 2017-02-05 08:07:12 +08:00
Anthony Calosa
c830ef88ca Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-05 07:11:05 +08:00
Anthony Calosa
ba0daed776 Merge pull request #924 from kevlahnota/master
Refactor countManaProducedby
2017-02-05 06:38:05 +08:00
Anthony Calosa
f37d946b4e Removed unused variable 2017-02-04 23:33:08 +08:00
Anthony Calosa
477419cc32 Refactor countManaProducedby
cards that uses this should not crash anymore with lorded mana producer
from instants like rain of filth...
2017-02-04 22:37:21 +08:00
Anthony Calosa
70e8d1c4b3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-04 20:47:05 +08:00
Rolzad73
732f795be4 - fixing last commit broke no QT builds 2017-02-03 21:05:14 -05:00
Rolzad73
00536fa3d9 - Qthread include fix for console QT build method and QT TESTSUITE target 2017-02-03 19:42:55 -05:00
Anthony Calosa
042f00cc58 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-03 22:31:33 +08:00
Anthony Calosa
acef89ea03 Merge pull request #923 from kevlahnota/master
Revert Functionality
2017-02-03 21:46:21 +08:00
Anthony Calosa
d7770d285f not needed anymore 2017-02-03 20:55:32 +08:00
Anthony Calosa
7932941a01 Revert Functionality
AACopier and AACloner should work with andAbility now...
2017-02-03 20:45:46 +08:00
Anthony Calosa
c4eac5e62b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-03 15:55:27 +08:00
Anthony Calosa
763bd60e74 Merge pull request #922 from kevlahnota/master
Some Fixes
2017-02-03 15:12:17 +08:00
Anthony Calosa
3fa52e7ac5 corrections 2017-02-03 14:26:26 +08:00
Anthony Calosa
9104afdef7 Cleanup 2017-02-03 10:39:45 +08:00
Anthony Calosa
942c95e736 revised copier copied abilities
the clone should copy original abilities only
2017-02-03 10:31:10 +08:00
Anthony Calosa
dc696a0f45 fix random segmentation fault
should fix the crash -> rain of filth in test suite
2017-02-03 10:30:14 +08:00
Anthony Calosa
d26e9da6c4 add some restrictions 2017-02-03 07:59:13 +08:00
Anthony Calosa
ea09b1f6bc Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-03 02:35:24 +08:00
Rolzad73
da033eb28e Merge pull request #919 from WagicProject/key_bind_changes
key binding related
2017-02-02 11:18:46 -05:00
Rolzad73
b2a0ccba05 - removed leftover trace log 2017-02-02 10:08:58 -05:00
Anthony Calosa
3f146c94e5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-02 13:46:21 +08:00
Anthony Calosa
9d92bdcd75 Merge pull request #918 from kevlahnota/master
Refactor PW Rule & some bug fixes
2017-02-02 13:21:57 +08:00
Anthony Calosa
6354d8ccca revised pw rule
also fixed where planeswalker can use its ability after it was
transformed/flipped by activation ex. Garruk Relentless... You can’t
activate a loyalty ability of Garruk Relentless and later that turn
after he transforms activate a loyalty ability of Garruk, the
Veil-Cursed.
2017-02-02 11:58:51 +08:00
Rolzad73
1d0237f15d - added ability to reload default key bindings
- reverted keybindings display back to action names instead of PSP key equivalent (see commit commit 168154b52d)
2017-02-01 22:53:01 -05:00
Anthony Calosa
c535d033ec fix Dark Depths
there should a window for the triggered sacrifice and legend rule.
2017-02-02 11:08:17 +08:00
Anthony Calosa
fcf900c5e0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-02 11:05:20 +08:00
Anthony Calosa
c265ce8222 Bug Correction
PermanentAbility to ListMaintainerAbility in Legend Rule, it seems It's
finally fixed even with a lot of targetchooser and copy effects.
2017-02-02 09:58:38 +08:00
Anthony Calosa
658b90067a Merge pull request #917 from kevlahnota/master
Crew Bonus & Bug Fix
2017-02-02 03:09:11 +08:00
Anthony Calosa
80b6496780 bug fix 2017-02-01 22:37:00 +08:00
Anthony Calosa
711934a249 Crew Corrections 2017-02-01 18:40:09 +08:00
Anthony Calosa
ea5e397595 Crew Ability Cost & Crewbonus
Revised cards to use {crew(targetchooser)} (modified taptargetcost) so
it can use crewbonus ability from other creatures.
2017-02-01 17:11:55 +08:00
Anthony Calosa
c8dc416071 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-01 17:08:02 +08:00
Anthony Calosa
30026fc307 Merge pull request #916 from kevlahnota/master
refactor Legend Rule and other Bug fixes
2017-02-01 10:40:02 +08:00
Anthony Calosa
7b0fdcd721 refactor Legendary Rule 2017-02-01 09:49:36 +08:00
Anthony Calosa
c0afb3b95e added WEventGameStateBasedChecked 2017-02-01 09:48:40 +08:00
Anthony Calosa
5504bf23d1 corrected dimir doppelganger 2017-02-01 09:47:31 +08:00
Anthony Calosa
28b51d3335 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-02-01 09:33:35 +08:00
Rolzad73
fb91726c35 Merge pull request #915 from WagicProject/test_suite_function_fix
- fixed small compiling error for a function in testsuite
2017-01-31 13:10:19 -05:00
Anthony Calosa
a97a7edca6 minor refactor 2017-01-31 22:01:19 +08:00
Anthony Calosa
92b4909fc8 add some cards 2017-01-31 21:19:34 +08:00
Anthony Calosa
3998c21178 fix persist on copied card 2017-01-31 20:11:59 +08:00
Anthony Calosa
41d925d7c9 add support for activated copier
thespian stage etc...
2017-01-31 20:11:09 +08:00
Anthony Calosa
7029636291 some corrections 2017-01-31 04:16:47 +08:00
Rolzad73
a916c1067f - fixed small compiling error for a function in testsuite
- indentation formatting on DebugRoutines
2017-01-30 14:02:25 -05:00
Anthony Calosa
7322d4da8b fix castcard opponent spell
the casted non-permanent card from opponent will now move to its owner
graveyard...
2017-01-30 07:09:21 +08:00
Anthony Calosa
31f15b12cb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-29 20:16:09 +08:00
Anthony Calosa
4d3e463aba Merge pull request #913 from kevlahnota/master
Revised AACopier and Fix Legend Rule
2017-01-29 17:17:04 +08:00
Anthony Calosa
166526dbbe Fix Legend Rule
Should fix the the move to graveyard effect with targetchooser
ability...
2017-01-29 16:30:13 +08:00
Anthony Calosa
348ada3f0d revised aacopier
I think we still need to change legend to a trigger once it detects
multiple legends in play then trigger it at once with targetchooser to
select which cards to sacrifice as state based... vector of  unique
names or id or mtgcardinstance?
2017-01-29 16:09:49 +08:00
Anthony Calosa
2c5f6d8332 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-29 10:29:10 +08:00
Anthony Calosa
e128d548f4 disable andAbility for aacopier
so it will not conflict with original legend rule...
2017-01-29 10:27:18 +08:00
Rolzad73
bb2ab1c1fe Merge pull request #911 from Rolzad73/x11_fixes
X11 build fixes
2017-01-28 13:17:50 -05:00
Rolzad73
715bedb71a - Travis PSP build broke, attempt to fix 2017-01-28 05:05:35 -05:00
Rolzad73
8fed9e47d1 - Travis PSP build broke, attempt to fix 2017-01-28 04:50:07 -05:00
Rolzad73
89f8f7e25e Merge pull request #910 from WagicProject/travis_edit
Test travis QT build artifact zipped for upload
2017-01-28 04:43:06 -05:00
Rolzad73
7bbba293a6 - reverted Travis test 2017-01-28 04:42:42 -05:00
Rolzad73
d57a694d3c - last commit small clean 2017-01-28 04:32:39 -05:00
Rolzad73
f31d5c04c8 - revert android gamepad log change for mergable x11 fixes 2017-01-28 04:29:47 -05:00
Rolzad73
85f66a8fec X11 build fixups
- fixed -Werror=misleading-indentation warning
- fixed -Werror=nonnull-compare warning on xll and QT builds
- PNG_LIBPNG_VER backward compatibily changes
- giflib backward compatibily changes
- resolved some undefs for X11 build
- silenced some small compile warnings in JGE Makefile
- added -DTIXML_USE_STL to remaining build types (PSP had it added)
- fixed x11 Boost incompatibility issue part of #548
- reworked PrecompiledHeader.h platforms used
2017-01-28 04:19:46 -05:00
Rolzad73
48ec606bc5 - attempt to break build upload sequence 2017-01-28 04:09:03 -05:00
Rolzad73
75cc809b16 - travis QT build artifact zipped for upload 2017-01-28 02:16:03 -05:00
Anthony Calosa
2a27a491e7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-28 13:23:44 +08:00
Anthony Calosa
3e75d70632 revert this
I introduce more bugs than helped. I think there's alternative method
for this,,,
2017-01-28 13:23:30 +08:00
Anthony Calosa
cf2d094df6 Merge pull request #905 from kevlahnota/master
Added KLD primitives
2017-01-28 12:41:10 +08:00
Rolzad73
18a7955240 Merge pull request #907 from WagicProject/travis_edit
attempt to add release upload from Travis CI for QT Linux variant
2017-01-27 23:36:51 -05:00
Rolzad73
22ebc27997 - attempt to add release upload from Travis CI for QT Linux variant 2017-01-27 22:57:21 -05:00
Anthony Calosa
c53ee24b5b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-28 07:38:50 +08:00
Anthony Calosa
25e681c04a test fix ensnaring bridge 2017-01-28 07:38:45 +08:00
Anthony Calosa
365e0b49ae cleanup 2017-01-28 07:38:27 +08:00
Rolzad73
e3dc78b28e - created proper branch on separate fork for dev work 2017-01-27 11:58:59 -05:00
Rolzad73
e3319f6fe4 Merge pull request #2 from WagicProject/master
Pulling changes from original project to forked version
2017-01-27 11:34:01 -05:00
Rolzad73
0a9b006a94 Merge pull request #906 from Rolzad73/master
Merge pull request #1 from WagicProject/master
2017-01-27 11:28:28 -05:00
Anthony Calosa
5692be3b66 remove 2 duplicate
Stone Quarry & Woodland Stream
2017-01-27 23:25:48 +08:00
Anthony Calosa
6ea5dea849 Added KLD primitives 2017-01-27 23:19:01 +08:00
Anthony Calosa
8debcf0fa2 KLD missing cards 2017-01-27 23:18:28 +08:00
Anthony Calosa
1cf4845cb2 added KLD set 2017-01-27 23:17:15 +08:00
Anthony Calosa
b9d1292add Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-27 22:15:27 +08:00
Anthony Calosa
19063fd8db some refactor
change some card from using "all" to "lord"
2017-01-27 22:15:03 +08:00
Rolzad73
76cf732100 Merge pull request #904 from WagicProject/build_clean
Simple build.xml cleanup
2017-01-26 23:17:13 -05:00
Anthony Calosa
30a7eef611 some corrections 2017-01-27 11:01:28 +08:00
Rolzad73
99f0020583 fix build.xml wrap error 2017-01-26 20:48:38 -05:00
Rolzad73
f2e0da47ed - minor whitespace and duplicate task (build.meego.changelog) cleanup of mtg ant build file 2017-01-26 20:05:19 -05:00
Anthony Calosa
ca66a428d8 C16 missing list 2017-01-27 06:18:36 +08:00
Anthony Calosa
f077a4e074 Merge pull request #903 from kevlahnota/master
KLD & AER support
2017-01-27 06:00:58 +08:00
Anthony Calosa
e46631a960 Merge branch 'master' of https://github.com/kevlahnota/wagic 2017-01-26 23:18:43 +08:00
Anthony Calosa
2da1957c70 Added C16 primitives 2017-01-26 23:18:37 +08:00
Anthony Calosa
ad6c48688d Added C16 set 2017-01-26 23:18:34 +08:00
Anthony Calosa
71da7fb384 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2017-01-26 23:11:52 +08:00
Anthony Calosa
0159e0e41e added some fixes 2017-01-26 22:34:07 +08:00
Anthony Calosa
457a3fdc7a Merge pull request #902 from WagicProject/travis_java_build_fix
Travis java build fix
2017-01-26 21:28:17 +08:00
Anthony Calosa
8507c0138d crash fix
when loading collection and shop
2017-01-26 21:02:12 +08:00
Anthony Calosa
4f7901b946 minor refactor 2017-01-26 21:01:45 +08:00
Anthony Calosa
e239dc039b fix phaseinfo/fakebar graphics
it should look nice now.. :)
2017-01-26 18:33:04 +08:00
Anthony Calosa
1428eeba06 fix copier token image 2017-01-26 15:32:17 +08:00
Anthony Calosa
adcf6fb86d refactor some equipments 2017-01-26 09:45:18 +08:00
Anthony Calosa
de2d663968 unattach animated equipment
another bug found is when the equipment becomes a creature, its ability
is granted to itself...
2017-01-26 02:12:02 +08:00
Anthony Calosa
60f6c683a3 test fix equipment
also added some primitive fixes, added macro for fabricate
2017-01-25 18:29:27 +08:00
Rolzad73
f8009672e9 - Travis build fix cleanup 2017-01-24 15:30:34 -05:00
Rolzad73
9fe5ac1994 - attempt forced JVM version setting for travis build 2017-01-24 14:51:03 -05:00
Rolzad73
58efb51c07 - attempt forced JDK version setting for travis build 2017-01-24 13:56:40 -05:00
Anthony Calosa
5c3a064746 aicode and revised legendary rule
added aicode for cards that uses reveal. since reveal cancels for ai,
aicode is the alternative code. use basic code only.
aicode=activate dosomething...
aicode - use with caution, its very basic atm and you must test each
card that uses it as it can cause crash.
legendary rule moved to game state based effect so it will not conflict
with cards with copy effects and andability. the legendary check applies
only when  legendrule is found.
2017-01-24 16:10:35 +08:00
Anthony Calosa
94aefa6dba notany attribute
anytypeofmana makes manacost colorless... wip
2017-01-23 18:32:58 +08:00
Anthony Calosa
7f6e96459c added "energized" event
energizedof(player):do something
energizedfoeof(player):do something
also some fixes in the primitives
2017-01-23 11:41:19 +08:00
Anthony Calosa
6fe57be115 fix for cards with restrictions 2017-01-22 00:14:46 +08:00
Anthony Calosa
37b3f28065 additional fixes 2017-01-21 04:30:00 +08:00
Anthony Calosa
0b9468da1b add EXP
Zendikar Expeditions
2017-01-20 16:49:00 +08:00
Anthony Calosa
e558f21ebc add penergy & oenergy
count energy counters available
2017-01-20 15:39:27 +08:00
Anthony Calosa
71c1512ef2 some fixes
primitve corrections
2017-01-20 15:37:36 +08:00
Anthony Calosa
d03ebdace8 Support for KLD and AER
Kaladesh & Aether Revolt
2017-01-18 22:13:51 +08:00
Anthony Calosa
d86b9119a4 fix castcard interaction to reveal window
uses afterrevealed and becomes
2017-01-17 18:24:50 +08:00
Anthony Calosa
0ab872e152 Additional primitive fixes 2017-01-16 06:48:07 +08:00
Anthony Calosa
5e7f81678d Added some fixes by Toben
thanks Toben
2017-01-14 10:33:49 +08:00
Anthony Calosa
ff510248e9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-08 06:01:40 +08:00
Anthony Calosa
bba5d4380d Merge pull request #897 from kevlahnota/master
revised tnum attribute
2016-09-08 05:53:32 +08:00
Anthony Calosa
39ad95d4db revised tnum attribute
so it can be used inside makecardt, also
2016-09-08 05:13:52 +08:00
Anthony Calosa
e9adde8ac6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-06 21:29:55 +08:00
Anthony Calosa
8fc120d9f9 Merge pull request #895 from kevlahnota/master
revised "steal" ability
2016-09-06 16:38:39 +08:00
Anthony Calosa
7f8339aedf revised "steal" ability
steal - gain control of target/s until it leaves battlefield or  its
current controller loses control of the "stealer"...
2016-09-06 15:47:09 +08:00
Anthony Calosa
d2183f3b91 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-06 15:08:32 +08:00
Anthony Calosa
11b4aa7308 Merge pull request #894 from kevlahnota/master
Sorted & Updated Primitives
2016-09-05 19:44:42 +08:00
Anthony Calosa
51481daf03 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-09-05 18:20:14 +08:00
Anthony Calosa
1bdd0f6e26 Sorted & Updated Primitives,
also added some cards
2016-09-05 18:20:05 +08:00
Anthony Calosa
1de492973e update missing cards by sets 2016-09-05 17:54:41 +08:00
Anthony Calosa
eea96dac73 Added CNS 2016-09-05 15:25:17 +08:00
Anthony Calosa
ebc378a620 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-05 15:22:42 +08:00
Anthony Calosa
3d08ca0cc1 Merge pull request #893 from kevlahnota/master
revised "colorless" attribute in targetchooser
2016-09-04 14:35:48 +08:00
Anthony Calosa
f11cc41df8 revised "colorless" attribute in targetchooser
also fix worldly tutor
2016-09-04 13:14:19 +08:00
Anthony Calosa
19ce59b1b4 Merge pull request #890 from kevlahnota/master
Add some C15 cards
2016-09-03 22:38:38 +08:00
Anthony Calosa
5101ac9d8e add some C15 cards 2016-09-03 21:38:24 +08:00
Anthony Calosa
5149882bb5 Add files via upload 2016-09-02 23:49:03 +08:00
Anthony Calosa
26222ee853 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-09-02 10:12:55 +08:00
Anthony Calosa
0394e2cda9 Add files via upload 2016-09-02 10:12:42 +08:00
Anthony Calosa
501b310efa add some C14 cards 2016-09-02 10:11:51 +08:00
Anthony Calosa
53e0b1b81c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-09-01 19:19:17 +08:00
Anthony Calosa
81be616847 Merge pull request #888 from kevlahnota/master
Add some missing cards from CMD
2016-08-31 16:19:33 +08:00
Anthony Calosa
b9b2c9afb0 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-08-31 14:03:36 +08:00
Anthony Calosa
848cd9a485 Add files via upload 2016-08-31 14:03:22 +08:00
Anthony Calosa
75921e1130 add some cards from CMD to C13 2016-08-31 14:02:16 +08:00
Anthony Calosa
0b14639c66 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-31 01:48:52 +08:00
Anthony Calosa
5c54f85de4 Merge pull request #887 from kevlahnota/master
Add some cards from BFZ to EMN
2016-08-31 01:30:36 +08:00
Anthony Calosa
0202313bc8 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-08-31 00:01:00 +08:00
Anthony Calosa
2671826b19 add some cards from BFZ to EMN 2016-08-31 00:00:43 +08:00
Anthony Calosa
7dc89ad090 Add files via upload 2016-08-31 00:00:16 +08:00
Anthony Calosa
c54f0ea329 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-30 22:04:00 +08:00
Anthony Calosa
d90f3ce309 Merge pull request #886 from kevlahnota/master
Add some cards from KTK block
2016-08-30 18:23:50 +08:00
Anthony Calosa
bcc6ced47c Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-08-30 17:37:45 +08:00
Anthony Calosa
1b5c61a285 added some cards from KTK sets
Also fix typos reported by sage. Thanks.
2016-08-30 17:37:38 +08:00
Anthony Calosa
ca95192de3 Add files via upload 2016-08-30 17:37:35 +08:00
Anthony Calosa
c2e04443e3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-30 07:40:47 +08:00
Anthony Calosa
f4f8c94c6a Merge pull request #885 from kevlahnota/master
add custom name for generic reveal ability
2016-08-29 22:42:35 +08:00
Anthony Calosa
f957fca162 add custom name for generic reveal 2016-08-29 20:58:55 +08:00
Anthony Calosa
9671711bf5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-29 09:05:15 +08:00
zethfoxster
ea3d4c67f8 Merge pull request #883 from zethfoxster/master
getting master
2016-08-28 10:05:51 -04:00
Anthony Calosa
cab1f59181 Merge pull request #882 from kevlahnota/master
Add missing cards from THS
2016-08-28 14:39:25 +08:00
Anthony Calosa
8c01611850 Add files via upload 2016-08-28 12:42:31 +08:00
Anthony Calosa
d6b682ab88 update/fix some card codes
also add some missing cards from THS block
2016-08-28 12:41:41 +08:00
zethfoxster
d2beaa0ab9 Merge pull request #51 from WagicProject/master
getting master
2016-08-27 14:19:59 -04:00
Anthony Calosa
ce0fafd45b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-27 20:28:26 +08:00
Anthony Calosa
c0dbd00b74 Merge pull request #881 from kevlahnota/master
fix halfup logic when used on negation
2016-08-27 20:16:31 +08:00
Anthony Calosa
a556aed34f Add files via upload 2016-08-27 19:32:48 +08:00
Anthony Calosa
8d19ee8ab3 add some missing cards 2016-08-27 19:31:27 +08:00
Anthony Calosa
8c4c80731c fix halfup logic when used on negation
halfup is computation is correct but when used in negation, you must use
the halfdown, example if you have 5 life and you pay half your life
rounded up, you must have 3 life, so life:-halfdownlifetotal. if you use
halfup you will lose 3 life...
2016-08-27 16:23:42 +08:00
Anthony Calosa
de6619b383 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-27 16:17:44 +08:00
Anthony Calosa
941dc253fb Merge pull request #880 from kevlahnota/master
fix some cards and add some missing
2016-08-27 15:55:54 +08:00
Anthony Calosa
25705a6b02 Add files via upload 2016-08-27 14:58:09 +08:00
Anthony Calosa
4d56269130 fix some cards and add some missing
it seems " add " inside name causes issue when parsed (cause crash in
deck editor like arlinn kord), renaming it fixes it...
2016-08-27 14:56:54 +08:00
zethfoxster
96236df293 Merge pull request #50 from WagicProject/master
getting master
2016-08-26 18:55:33 -04:00
Anthony Calosa
f447482e32 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-26 18:02:27 +08:00
Anthony Calosa
401b8fc496 Merge pull request #878 from kevlahnota/master
Add some cards (various from SHM to ROE)
2016-08-26 16:11:38 +08:00
Anthony Calosa
2e2a2aaf03 cleanup card.dat 2016-08-26 15:33:38 +08:00
Anthony Calosa
66c2ab38ed fix some cards 2016-08-26 14:20:02 +08:00
Anthony Calosa
6e0b7e2c23 add missing break 2016-08-26 14:20:02 +08:00
Anthony Calosa
f335623f69 update missing cards by sets
Shadowmoor, Alara, Zendikar blocks
2016-08-26 12:11:28 +08:00
Anthony Calosa
f8369ee39a add some missing cards
from SHM to ROE
2016-08-26 11:31:48 +08:00
Anthony Calosa
2a1bacdfa4 add "abilitycontroller" for dynamicability
for use inside ability$! dynamicability<who> !$ who
2016-08-26 11:23:52 +08:00
Anthony Calosa
a93dd6586d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-25 22:26:56 +08:00
Anthony Calosa
f3dd1be125 rebounded trigger
for use with rebound cards only
2016-08-25 22:25:34 +08:00
Anthony Calosa
5b49530df9 add reset alternate cost paid 2016-08-25 22:22:55 +08:00
zethfoxster
00555e3c75 Merge pull request #49 from WagicProject/master
getting master
2016-08-24 21:13:03 -04:00
Anthony Calosa
972746d388 Merge pull request #877 from kevlahnota/master
Fix enters tapped cards, add some missing cards from LRW
2016-08-25 04:23:23 +08:00
Anthony Calosa
db3aaf96c7 add LRW & MOR missing cards by sets 2016-08-25 03:42:24 +08:00
Anthony Calosa
e12c87b869 add some missing cards from lorwyn
also fix card enters tapped
2016-08-25 03:40:38 +08:00
Anthony Calosa
ad80b000c9 find missing art on stored source card
when tokencreator is used inside ability$!!$ who, try to get the token
images and id from stored source
2016-08-25 03:40:38 +08:00
Anthony Calosa
9bcc54c56c add "recent" & "raidcount"
the recent attribute is to parse new cards entered play, then turns
itself to 0 if some stuff happened since it's already in play...
2016-08-25 03:40:38 +08:00
Anthony Calosa
3e6d207bf0 Merge pull request #876 from kevlahnota/master
Add some missing cards
2016-08-25 01:06:23 +08:00
Anthony Calosa
6c836e0fde update missing cards by sets
from ravnica to timespiral blocks
2016-08-25 00:23:24 +08:00
Anthony Calosa
5f9e123571 added some cards
from ravnica, ice age and time spiral blocks
2016-08-25 00:21:48 +08:00
Anthony Calosa
20ba624de2 commented out this
commented out the the spelltargettypes (I think I added these before for
debugging purposes)
2016-08-25 00:20:52 +08:00
Anthony Calosa
12426cf8a7 added nonplaynonexile
for use inside transforms since we cant use commas
2016-08-25 00:20:18 +08:00
Anthony Calosa
1cd6f00c59 add manapool count
also add getStringValue for menutext
2016-08-25 00:17:16 +08:00
Anthony Calosa
365d5784b7 Merge pull request #875 from kevlahnota/master
update PPR
2016-08-23 12:22:37 +08:00
Anthony Calosa
a90cddf589 update PPR
also fix cards  "when you cast" triggers, They must trigger when cast,
not when it resolves...
2016-08-23 11:27:40 +08:00
zethfoxster
5f71017142 Merge pull request #48 from WagicProject/master
getting master
2016-08-22 21:31:19 -04:00
Anthony Calosa
c81402b8ce Merge pull request #874 from kevlahnota/master
Add some cards from SOK
2016-08-23 07:27:20 +08:00
Anthony Calosa
6122410db1 Add files via upload 2016-08-23 06:51:22 +08:00
Anthony Calosa
42e240c9ab add some cards from kamigawa 2016-08-23 06:49:57 +08:00
Anthony Calosa
01459b7759 Merge pull request #873 from kevlahnota/master
Fix granted flashback, add flashback indicator
2016-08-22 11:33:33 +08:00
Anthony Calosa
cd2f4480f4 alternate token creator
uses ":" instead of comma, makecardt(name:type:p/t:ability:color) ex.
makecardt(Eldrazi Horrors:Creature Eldrazi Horror:3/2:haste:battleready)
2016-08-22 10:21:00 +08:00
Anthony Calosa
ce92679be0 add AACloner andAbility 2016-08-22 10:18:23 +08:00
Anthony Calosa
e9705b2cc5 fix crash temporary flashback
should fix snapcaster mages ability and the likes
2016-08-22 10:17:48 +08:00
Anthony Calosa
a2007dd59e border indicator flashback 2016-08-22 10:17:05 +08:00
Anthony Calosa
d6052b718e Merge pull request #872 from kevlahnota/master
cleanup
2016-08-22 09:18:11 +08:00
Anthony Calosa
6bfc79fb03 test
test if the name is the cause of this...
2016-08-22 08:30:13 +08:00
Anthony Calosa
e9a5f30c71 cleanup 2016-08-22 07:36:23 +08:00
Anthony Calosa
9a61b7f13b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-22 07:27:34 +08:00
Anthony Calosa
2073f3d7ed Merge pull request #870 from kevlahnota/master
Battleready token for Hanweir
2016-08-21 22:13:00 +08:00
Anthony Calosa
774cd46892 Hanweir the Writhing Township token
battleready and fix Make Mischief
2016-08-21 22:10:14 +08:00
Anthony Calosa
f593ee7c9f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-21 14:13:25 +08:00
Anthony Calosa
47d35446e2 Merge pull request #869 from kevlahnota/master
Add some cards & fix
2016-08-21 13:10:59 +08:00
Anthony Calosa
3e16969808 update missing cards by sets
ODY to 5DN
2016-08-21 12:28:02 +08:00
Anthony Calosa
3e95f5cd05 add some cards 2016-08-21 12:26:21 +08:00
Anthony Calosa
15a8437d79 check imprinted card
fix crash
2016-08-21 11:28:17 +08:00
Anthony Calosa
6a213bffa6 Domain count 2016-08-21 11:27:50 +08:00
Anthony Calosa
5be01a7577 add percentage on awards 2016-08-21 08:56:39 +08:00
zethfoxster
89b8eabe0c Merge pull request #47 from WagicProject/master
getting master
2016-08-20 13:54:25 -04:00
Anthony Calosa
3cecc34a9c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-20 17:54:42 +08:00
Anthony Calosa
9e76214be8 Merge pull request #867 from kevlahnota/master
Added some cards from INV & MRQ
2016-08-20 16:46:48 +08:00
Anthony Calosa
5b059f974f update missing cards by sets 2016-08-20 16:07:11 +08:00
Anthony Calosa
ecb4f64f91 added some cards
I think I added abilitycontroller before, I just forgot to add a card
that can use it (Gerrard's Verdict)
2016-08-20 16:04:17 +08:00
zethfoxster
992121c659 Merge pull request #46 from WagicProject/master
getting master
2016-08-19 21:25:18 -04:00
Anthony Calosa
cbc41214d8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-20 04:32:19 +08:00
Anthony Calosa
53c7a81666 Merge pull request #866 from kevlahnota/master
change naming convention
2016-08-20 04:03:53 +08:00
Anthony Calosa
a63065b44f try to fix 2016-08-20 03:04:58 +08:00
Anthony Calosa
cec4494ce6 fix can produce mana
limited for land...
2016-08-20 00:21:58 +08:00
Anthony Calosa
60411027ca change plandtype & olandtype parsing 2016-08-19 23:34:01 +08:00
Anthony Calosa
8d7b9293b5 change naming convention
to avoid confusion
2016-08-19 20:29:41 +08:00
Anthony Calosa
2133dfd80c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-19 18:53:27 +08:00
Anthony Calosa
1a75f51aa6 Merge pull request #865 from kevlahnota/master
update missing cards by sets
2016-08-19 18:51:13 +08:00
Anthony Calosa
2a8c036c63 moved rayne to borderline
@targeted needs update for player targets
2016-08-19 18:18:18 +08:00
Anthony Calosa
c90f357bff added myzones & oppzones 2016-08-19 18:08:36 +08:00
Anthony Calosa
4d381452b5 added rath & artifact cycle in missing cards 2016-08-19 18:07:08 +08:00
zethfoxster
087b53c1c5 Merge pull request #45 from WagicProject/master
getting master
2016-08-18 23:08:21 -04:00
Anthony Calosa
58a2769f2b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-19 07:22:52 +08:00
Anthony Calosa
ce38c3e5c5 Merge pull request #864 from kevlahnota/master
re added my previous changes
2016-08-18 21:48:19 +08:00
Anthony Calosa
12f7d5e4b6 added missing cards by sets
todo... since i'll recheck all expansions
2016-08-18 21:43:54 +08:00
Anthony Calosa
fd703dd4d1 re added my previous changes 2016-08-18 21:40:38 +08:00
Anthony Calosa
3ef4c1f6e0 Merge pull request #863 from kevlahnota/master
Added the Missing EMN and other cards
2016-08-18 20:04:19 +08:00
Anthony Calosa
0e95444552 added the EMN cards 2016-08-18 20:02:02 +08:00
Anthony Calosa
aca90db2c2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-18 19:13:41 +08:00
Anthony Calosa
09edd055e6 Merge pull request #862 from kevlahnota/master
"blocked" attribute & add some cards
2016-08-18 18:55:28 +08:00
Anthony Calosa
892ef6b1b3 Add CD Blocked & some cards
cd "blocked" should fix Smite , Tattermunge Witch
2016-08-18 17:57:14 +08:00
Anthony Calosa
ed838815ef Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-18 06:19:42 +08:00
Anthony Calosa
8d8c4d1a95 Merge pull request #861 from kevlahnota/master
Balance cards & Kozilek
2016-08-17 20:50:03 +08:00
Anthony Calosa
debdf917ea Added "Balance" cards & Fix Kozilek
Added Balance, Balancing Act, Natural Balance & Restore Balance. Fix
Kozilek, the Great Distortion autostack ability
2016-08-17 20:48:51 +08:00
Anthony Calosa
f03961bc19 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-17 18:42:43 +08:00
Anthony Calosa
fb4572264d Merge pull request #860 from kevlahnota/master
Fixed OGW cards & Sorted Primitives
2016-08-17 05:27:08 +08:00
Anthony Calosa
d7445a70f9 Fix OGW cards & Sorted Primitives
todo recheck BFZ
2016-08-17 04:49:50 +08:00
Anthony Calosa
78bcf9a738 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-17 04:24:53 +08:00
zethfoxster
d71c85412f Merge pull request #859 from zethfoxster/master
pushing to master
2016-08-16 13:38:42 -04:00
zethfoxster
f5c9ab72ef adding eldrich moon cards, and part 1 of my unsupport scan through...these are not sorted and are added at the bottom.
there are way more in unsupported that need checking, im going through it slowly but thought i should add this
2016-08-16 13:34:14 -04:00
zethfoxster
5c4cd74c39 Merge pull request #44 from WagicProject/master
getting master
2016-08-16 13:29:59 -04:00
Anthony Calosa
5a1daf5dc9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-16 18:32:43 +08:00
Anthony Calosa
4de2a45195 Merge pull request #858 from kevlahnota/master
add CD geared attribute
2016-08-16 17:28:01 +08:00
Anthony Calosa
91d3a6ecb7 Minor Cleanup 2016-08-16 16:11:44 +08:00
Anthony Calosa
763918e129 added CD geared attribute 2016-08-16 15:42:22 +08:00
Anthony Calosa
525c166f62 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-16 14:30:02 +08:00
Anthony Calosa
6b2ed24fc3 Merge pull request #857 from kevlahnota/master
Fixed some cards
2016-08-16 13:17:07 +08:00
Anthony Calosa
1eae3a032f Fixed some cards
replaced @lifed with @lifeof, had to hardcode conduit of ruin...
2016-08-16 12:17:53 +08:00
zethfoxster
755cfe19d5 Merge pull request #43 from WagicProject/master
getting master
2016-08-14 22:58:36 -04:00
Anthony Calosa
559331cf82 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-15 10:29:03 +08:00
Anthony Calosa
18fddb1537 Merge pull request #856 from kevlahnota/master
adjust p/t & fix copying animated land
2016-08-14 22:11:53 +08:00
Anthony Calosa
861620cb6e fix AI deck129 invalid mtgid 2016-08-14 21:53:54 +08:00
Anthony Calosa
568f3ae94f fix copying man lands 2016-08-14 21:26:33 +08:00
Anthony Calosa
0af00a313e adjust p/t box when tapped only 2016-08-14 21:26:19 +08:00
Anthony Calosa
ff52f020e2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-14 21:21:22 +08:00
Anthony Calosa
55bf7bcbda Merge pull request #855 from kevlahnota/master
Minimal Graphics mod
2016-08-14 15:51:32 +08:00
Anthony Calosa
bccb740c45 Minimal mod card scale
it's a minimal graphics mod so it's easier to debug. It's a smaller card
scale of big render so we have more space to view in game.
2016-08-14 14:59:49 +08:00
Anthony Calosa
b7307adc10 fix copier copying a copier 2016-08-14 14:28:14 +08:00
Anthony Calosa
edb71dcef0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-14 09:32:42 +08:00
Anthony Calosa
7ddf232615 Merge pull request #854 from kevlahnota/master
Re upload sets
2016-08-14 09:27:41 +08:00
Anthony Calosa
a7cdb0a514 re upload sets 2016-08-14 09:24:15 +08:00
Anthony Calosa
7157e571c8 fateshaper flying 2016-08-14 09:22:11 +08:00
Anthony Calosa
d073b7b3c0 remove sets with no carriage returns
will reupload the new ones
2016-08-14 09:21:47 +08:00
zethfoxster
27d67398fb Merge pull request #42 from WagicProject/master
getting master
2016-08-13 12:49:52 -04:00
Anthony Calosa
cc6ced9197 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-13 23:31:50 +08:00
Anthony Calosa
712e42c71f Merge pull request #853 from kevlahnota/master
Carriage Returns
2016-08-13 23:29:09 +08:00
Anthony Calosa
53efc96e30 add carriage returns
it's not visible but instead of lf, replaced it with crlf
2016-08-13 23:26:58 +08:00
Anthony Calosa
5b2ac0f022 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-13 23:20:37 +08:00
Anthony Calosa
b5cdcc29bc Merge pull request #852 from kevlahnota/master
Revert my Graphic changes and other fixes
2016-08-13 21:41:56 +08:00
Anthony Calosa
df3e6e5fb7 fix flip and image 2016-08-13 21:14:43 +08:00
Anthony Calosa
27145bdabe revised fix for copier 2016-08-13 20:12:55 +08:00
Anthony Calosa
71aedfd96d this must be copy 2016-08-13 17:39:11 +08:00
Anthony Calosa
8530292fef Revert my Graphic changes
I think it's the one who cause those crashes
2016-08-13 16:45:46 +08:00
Anthony Calosa
f1bc268f58 add mycastingzone & oppcastingzone
to simplify code
2016-08-13 10:55:58 +08:00
Anthony Calosa
2e79f5a369 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-12 20:47:48 +08:00
Anthony Calosa
1427b1709a Merge pull request #851 from kevlahnota/master
remove changes AACopier
2016-08-12 20:14:51 +08:00
Anthony Calosa
960d4d35fb remove my changes in aacopier
since I introduce a weird crash bug with it.
2016-08-12 17:14:52 +08:00
Anthony Calosa
7a467ce860 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-12 17:01:42 +08:00
Anthony Calosa
cd46314b4e Merge pull request #850 from kevlahnota/master
Fix Deathbringer Liege
2016-08-12 16:26:25 +08:00
Anthony Calosa
9c81acff53 Fix Deathbringer Liege 2016-08-12 16:25:37 +08:00
zethfoxster
d8b2e2873b Merge pull request #41 from WagicProject/master
getting master
2016-08-11 23:27:16 -04:00
Anthony Calosa
98cd6675d9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-12 10:00:11 +08:00
Anthony Calosa
002085ad32 Merge pull request #849 from kevlahnota/master
Add Game/Player Info
2016-08-12 09:18:32 +08:00
Anthony Calosa
2e525dfdcc exclude card that copied a token.
I added a new search for tokens just below this
2016-08-12 07:44:59 +08:00
Anthony Calosa
a378e3a72d fix extracosts on cumulative upcost
since Manacost::copy copies, extracost, if this is enabled, extracost is
doubled. tested with Aboroth
2016-08-12 07:43:39 +08:00
Anthony Calosa
7e14b2fc5a exception testsuite
the current implementation was clone must be recognized by id in the
scripted test.
2016-08-11 21:05:00 +08:00
Anthony Calosa
51016f9258 revised AACopier 2016-08-11 18:52:18 +08:00
Anthony Calosa
adad723110 game mode info 2016-08-11 14:26:41 +08:00
Anthony Calosa
a10e7ab279 Revert "copy/flip limit"
This reverts commit 0c124327de.
2016-08-11 11:03:37 +08:00
Anthony Calosa
0c124327de copy/flip limit
if the copy/flip is activated, it means it's already in the battlefield,
so "enters the battlefield" must not trigger...
2016-08-10 19:49:31 +08:00
zethfoxster
6c5f706064 Merge pull request #40 from WagicProject/master
getting master
2016-08-09 22:14:58 -04:00
Anthony Calosa
2422e72713 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-10 09:51:23 +08:00
Anthony Calosa
e49e4a5e67 Merge pull request #848 from kevlahnota/master
Fix SOI cards
2016-08-10 08:28:52 +08:00
Anthony Calosa
14d8d65de0 asflash
spellmastery is for alternate cost, added asflash... so cards that find
cards with flash don't find asflash...
2016-08-10 07:31:15 +08:00
Anthony Calosa
d3305cadb6 quick sliver typo 2016-08-10 07:18:46 +08:00
Anthony Calosa
17c28ca584 revised Quick Sliver & Shimmer Myr 2016-08-10 06:39:09 +08: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
ab49ea07e8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-09 13:28:52 +08:00
Anthony Calosa
8e436e6b55 Merge pull request #847 from kevlahnota/master
Fix Hint
2016-08-09 04:56:06 +08:00
Anthony Calosa
de5414ec19 Fix Etched Affinity Combo
Fix Glimmervoid Combo Hint
2016-08-09 02:58:48 +08:00
Anthony Calosa
e5d71579af Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-09 02:57:43 +08:00
Anthony Calosa
5ec4c9714c Merge pull request #846 from kevlahnota/master
adjust rendered card
2016-08-09 01:15:18 +08:00
Anthony Calosa
eafb2558c2 adjust rendered card 2016-08-09 00:38:33 +08:00
Anthony Calosa
4cefcb26c2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 20:28:53 +08:00
Anthony Calosa
8a86e7d0f7 Merge pull request #845 from kevlahnota/master
border & mask
2016-08-08 18:45:44 +08:00
Anthony Calosa
b20fb61e1c border & mask
add border to alternate render, fix mask shadow
2016-08-08 18:13:00 +08:00
Anthony Calosa
feeed99c62 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 18:11:48 +08:00
Anthony Calosa
aa5008f865 Merge pull request #844 from kevlahnota/master
Fix cards reported on forums
2016-08-08 15:44:57 +08:00
Anthony Calosa
c4ce2aa977 fix Forgotten Creation and Fable of Wolf And Owl
Forgotten Creation typo and Fable of Wolf and Owl ability clashing
2016-08-08 15:42:35 +08:00
Anthony Calosa
7cc31a473c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 15:41:33 +08:00
Anthony Calosa
a8193012aa Merge pull request #843 from kevlahnota/master
tnum:number parameter for token images
2016-08-08 15:11:18 +08:00
Anthony Calosa
eb0ecedecf revised token id (tnum:num parameter)
this should not conflict like earlier version.
ex:
[card]
name=Fable of Wolf and Owl
auto=@movedTo(*[green]|mystack):may token(Wolf,Creature
Wolf,2/2,green,tnum:11)
auto=@movedTo(*[blue]|mystack):may token(Bird,Creature
Bird,1/1,flying,blue,tnum:12)
text=Whenever you cast a green spell, you may put a 2/2 green Wolf
creature token onto the battlefield. -- Whenever you cast a blue spell,
you may put a 1/1 blue Bird creature token with flying onto the
battlefield.
mana={3}{GU}{GU}{GU}
type=Enchantment
[/card]
tnum uses -source id  & tnum (concatenated)
2016-08-08 13:49:24 +08:00
Anthony Calosa
de44abd529 Revert "fix token names with ",""
This reverts commit 65ef1f384c.
2016-08-08 11:29:04 +08:00
Anthony Calosa
9807ca99f9 Revert "multi tokens images on same source"
This reverts commit 8c9d2d6f1d.
2016-08-08 11:20:25 +08:00
Anthony Calosa
8c9d2d6f1d multi tokens images on same source
you can specifiy tnum:number on token parameters and it will concatenate
the default token id and the specified number. example: token(Saproling,
Creature Saproling, 1/1, green, tnum:15) if the source id is 12345, the
default token id will be -12345, concat tnum, id will be -1234515 and
the game will try to find the image 1234515t.jpg
2016-08-08 10:37:27 +08:00
Anthony Calosa
65ef1f384c fix token names with "," 2016-08-08 10:15:50 +08:00
Anthony Calosa
bf2cc36719 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-08 09:30:33 +08:00
Anthony Calosa
34ffe7eefa Merge pull request #842 from kevlahnota/master
resized avatar
2016-08-07 22:37:57 +08:00
Anthony Calosa
b756c8b9ec resize avatar 2016-08-07 22:33:40 +08:00
Anthony Calosa
19a98c9ad6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 22:26:39 +08:00
Anthony Calosa
e159025ebb Merge pull request #841 from kevlahnota/master
Fix Master Transmuter & Westvale Abbey
2016-08-07 19:46:56 +08:00
Anthony Calosa
05e81ad923 Fix Westvale Abbey and Master Transmuter 2016-08-07 19:42:56 +08:00
Anthony Calosa
8e1a0eb20f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 15:29:23 +08:00
Anthony Calosa
a881b8fa5a Merge pull request #840 from kevlahnota/master
Minor adjustment
2016-08-07 14:08:51 +08:00
Anthony Calosa
6982030013 Minor adjustment 2016-08-07 14:08:09 +08:00
Anthony Calosa
01da4c6af5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 14:06:22 +08:00
Anthony Calosa
a42805d4cc Merge pull request #839 from kevlahnota/master
Fix Enstack Attackers
2016-08-07 13:24:54 +08:00
Anthony Calosa
01145c4581 new adjustments 2016-08-07 13:24:14 +08:00
Anthony Calosa
4d1dfb58ff Fix Enstack Attackers
If you have 40+ tokens as attackers in play, stack them on the attackers
tightly...
2016-08-07 11:49:57 +08:00
Anthony Calosa
43f44a4142 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 11:47:32 +08:00
Anthony Calosa
b314d3cafe Merge pull request #838 from kevlahnota/master
corrected typo
2016-08-07 11:21:43 +08:00
Anthony Calosa
9bbf28e44b correction 2016-08-07 11:21:07 +08:00
Anthony Calosa
d995d25f69 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 10:37:31 +08:00
Anthony Calosa
1f58b8e6a7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-07 10:30:42 +08:00
Anthony Calosa
eeb881cdc2 Merge pull request #837 from kevlahnota/master
AACopier andAbility support
2016-08-07 10:29:06 +08:00
Anthony Calosa
807874ce5d add andAbility support for AACopier
the granted ability must exists only if you copy a card, if you don't
copy any card, the source doesn't have any granted abillities.
2016-08-07 10:15:11 +08:00
punkeduard
213d11c8e9 Changes to primitives
name=Ojutai, Soul of Winter
name=Atarka, World Render
name=Kolaghan, the Storm's Fury
name=Savageborn Hydra
2016-08-06 21:03:23 -05:00
Anthony Calosa
dfd0761506 Corrected cards reported from forums 2016-08-07 09:59:59 +08:00
Anthony Calosa
4c30086896 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-06 21:28:57 +08:00
Anthony Calosa
1efdca399e Merge pull request #836 from kevlahnota/master
re enabled token quads
2016-08-06 20:29:09 +08:00
Anthony Calosa
4f27c8051a forgot these 2016-08-06 19:55:18 +08:00
Anthony Calosa
d43693fef0 when ingame, try finding the quad
for copier/cloner when copying token generated cards...
2016-08-06 19:41:34 +08:00
Anthony Calosa
88f0202b16 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-06 19:06:57 +08:00
Anthony Calosa
be98e0b543 Update CardGui.cpp
Disabled temporary...
2016-08-06 01:40:21 -05:00
Rolzad73
8a907bb3f3 Merge pull request #835 from WagicProject/android_tweaks
Android tweaks
2016-08-06 00:25:36 -04:00
Anthony Calosa
1b34a478a1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-06 08:04:15 +08:00
Anthony Calosa
cda0bba555 Merge pull request #834 from kevlahnota/master
Copied token images
2016-08-05 22:26:57 +08:00
Anthony Calosa
dae1b10de1 Copied Token Image
If the image is not found, try finding the token counterpart by Id
2016-08-05 21:52:46 +08:00
Rolzad73
0c4e72ece2 - attempt to fix storage location list issue on Android 4.3+ 2016-08-04 14:53:52 -04:00
Rolzad73
77dfd51b28 - Android debug logging organization 2016-08-04 13:15:49 -04:00
Rolzad73
b601a549d0 - added option for Android x86 build types 2016-08-04 11:26:41 -04:00
Anthony Calosa
c4907edd76 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 21:19:32 +08:00
Anthony Calosa
dcf4148d75 Merge pull request #831 from kevlahnota/master
fix code monk token
2016-08-04 21:02:34 +08:00
Anthony Calosa
8afeef568f update ability
prowess +1/+1 is ueot
2016-08-04 20:55:36 +08:00
Rolzad73
dd5635d9cd - only minor whitespace formatting Android 2016-08-04 08:32:17 -04:00
Rolzad73
62a6ddf3ca - update android gitignore
- update android launcher icons
2016-08-04 08:02:32 -04:00
Anthony Calosa
195daa97f3 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 13:59:34 +08:00
Anthony Calosa
b1c5c87443 Merge pull request #830 from kevlahnota/master
Fix AttackCost & BlockCost, Add nonCombatDamage count
2016-08-04 12:16:48 +08:00
Anthony Calosa
1ab88940f9 add nonCombatDamage count 2016-08-04 09:56:53 +08:00
Anthony Calosa
8ba97b8a74 Fix attackcost & blockcost
thanks zeth
2016-08-04 09:50:09 +08:00
Anthony Calosa
e7f5442a64 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 09:29:45 +08:00
Rolzad73
066dd866b1 - reverting debuggable attribute removal 2016-08-03 20:36:34 -04:00
Anthony Calosa
fa0722a9e2 Merge pull request #828 from kevlahnota/master
some card corrections
2016-08-04 05:50:00 +08:00
Anthony Calosa
5f276f6b22 blockcost and attackcost
counter{1%1} -> value
2016-08-04 05:46:23 +08:00
Anthony Calosa
c45b5751af cantattack
change some cards since -cantattack overrides cantattack. If there is an
effect that makes creatures can't attack, you can just activate the
ability to remove -cantattack...
2016-08-04 05:41:22 +08:00
Rolzad73
161802cf9d minor Android tweaks
- removed ads reference no longer used in manifest
- removed redundant android:debuggable attribute
- cleared EGL debug warning log spamming issue #581
2016-08-03 16:01:43 -04:00
Anthony Calosa
0679832b04 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 03:20:24 +08:00
Anthony Calosa
b20d6f8820 Merge pull request #827 from kevlahnota/master
TokenAndAbility for AACloner & AACopier
2016-08-04 03:17:26 +08:00
Anthony Calosa
52fb40d543 AACloner & AACopier TokenAndAbility
if the token has andAbility, the cloner/copier also has that andAbility
also...
2016-08-04 02:12:59 +08:00
Anthony Calosa
067279d2e8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 02:02:12 +08:00
Anthony Calosa
a0bbed6c6c Merge pull request #826 from kevlahnota/master
fix crash when copying tokens
2016-08-04 00:41:31 +08:00
Anthony Calosa
9371125eb0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-04 00:40:01 +08:00
Anthony Calosa
0a0f6cdce9 fix crash
wrong parenthesis
2016-08-04 00:36:49 +08:00
Rolzad73
fc350be3a1 Update README.md 2016-08-03 12:36:25 -04:00
Anthony Calosa
be731a99c0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-03 23:09:13 +08:00
Anthony Calosa
c65fd1d7ae Merge pull request #825 from kevlahnota/master
corrections
2016-08-03 23:06:45 +08:00
Anthony Calosa
be899159f3 correction 2016-08-03 23:03:32 +08:00
Anthony Calosa
2400e6578b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-03 22:34:05 +08:00
Anthony Calosa
1aac2b8e75 Update AllAbilities.cpp
Try to fix IOS/MAC compilation
2016-08-03 21:23:38 +08:00
Anthony Calosa
c7581220b8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-03 20:40:12 +08:00
Anthony Calosa
f3968215e0 Merge pull request #824 from kevlahnota/master
andAbility on ATokenCreator, Extend AAFlip
2016-08-03 18:46:46 +08:00
Anthony Calosa
56a8011b78 revert 2016-08-03 18:44:41 +08:00
Anthony Calosa
adccae7937 switched places 2016-08-03 18:11:29 +08:00
Anthony Calosa
1c63c1937a Update some cards 2016-08-03 16:28:49 +08:00
Anthony Calosa
4753f7bb51 andAbility on ATokenCreator, Extend AAFlip, 2016-08-03 16:10:53 +08:00
Anthony Calosa
d7fec7d10a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-02 12:34:06 +08:00
Anthony Calosa
3c90a29b1e Merge pull request #823 from kevlahnota/master
Border size and color, Copier/Token Indicator
2016-08-01 23:17:12 +08:00
Anthony Calosa
98de361bf4 change comment
enable the indicator at all modes...
2016-08-01 22:34:28 +08:00
Anthony Calosa
c1df10e064 Minor Proportioning 2016-08-01 22:17:53 +08:00
Anthony Calosa
3743e0bc03 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-01 21:40:22 +08:00
Anthony Calosa
12e6a4d0ae Merge pull request #822 from kevlahnota/master
Some Corrections
2016-08-01 15:32:07 +08:00
Anthony Calosa
969511953a vector count of abilities
remove unused ones
2016-08-01 14:45:57 +08:00
Anthony Calosa
223e2e04b0 Correction 2016-08-01 11:44:07 +08:00
Anthony Calosa
0b0368ffcc Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-01 08:23:16 +08:00
Anthony Calosa
9e4684b524 Merge pull request #821 from kevlahnota/master
Fix transforms for non-permanent
2016-08-01 06:52:38 +08:00
Anthony Calosa
d825c7e4ea parenthesis 2016-08-01 04:49:04 +08:00
Anthony Calosa
c38c996773 Revised "putinplay" in castcard 2016-08-01 04:43:54 +08:00
Anthony Calosa
71a9ef00ee Support transforms for nonpermanent
fix startled awake to persistent nightmare
2016-08-01 03:52:10 +08:00
Anthony Calosa
89a30ae5ee Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-08-01 03:02:01 +08:00
zethfoxster
94bd0e057b Merge pull request #39 from WagicProject/master
getting master
2016-07-31 10:46:46 -04:00
Anthony Calosa
0efc6338bb Merge pull request #820 from kevlahnota/master
Fix Cloner
2016-07-31 21:38:10 +08:00
Anthony Calosa
3b98da1d86 Fix Cloner ability 2016-07-31 18:46:07 +08:00
Anthony Calosa
6927c68811 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 18:06:12 +08:00
Anthony Calosa
f0909ba3a0 Merge pull request #819 from kevlahnota/master
minor fix
2016-07-31 13:30:15 +08:00
Anthony Calosa
2f7d2873f7 @at to @each 2016-07-31 13:28:55 +08:00
Anthony Calosa
7a6b6aa335 Change copier copy 2016-07-31 13:24:18 +08:00
Anthony Calosa
2861ef0c73 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 13:13:26 +08:00
Anthony Calosa
059fc06f3a Merge pull request #818 from kevlahnota/master
Fix Chandra, Flamecaller & Cryptolith Rite
2016-07-31 08:20:09 +08:00
Anthony Calosa
a971576de0 Fix Chandra, Cryptolith Rite 2016-07-31 08:16:25 +08:00
Anthony Calosa
a4e059e3ec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 08:14:28 +08:00
Anthony Calosa
07408b7bc3 Merge pull request #817 from kevlahnota/master
Added EMA & Revert Stormtide Leviathan code
2016-07-31 08:09:09 +08:00
Anthony Calosa
9722f7b71e Added Eternal Masters 2016-07-31 08:06:53 +08:00
Anthony Calosa
45d8413d59 Revert Stormtide Leviathan code 2016-07-31 07:58:26 +08:00
Anthony Calosa
5c400457a9 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-31 07:32:08 +08:00
zethfoxster
3e9ee5890f Merge pull request #816 from zethfoxster/master
add some handling of reveal to avoid a crash in demo for AI.
2016-07-30 10:51:26 -04:00
zethfoxster
1acdb40498 add some handling of reveal to avoid a crash in demo for AI. 2016-07-30 10:50:31 -04:00
zethfoxster
1dc0b00133 Merge pull request #815 from zethfoxster/master
same applies for scry
2016-07-30 10:20:48 -04:00
zethfoxster
f2208389bd same applies for scry 2016-07-30 10:20:19 -04:00
zethfoxster
ab92c3e15b Merge pull request #814 from zethfoxster/master
pushing to master
2016-07-30 10:14:54 -04:00
zethfoxster
018e35295a fixed a crash in revealing, not sure why I thought it was a good idea to test testdestroy something that I just removed from the game. if anyone can find another crash with it, let me know which card causes it. 2016-07-30 10:13:58 -04:00
zethfoxster
2c9e90eee0 Merge pull request #38 from WagicProject/master
getting master
2016-07-30 08:29:45 -04:00
Anthony Calosa
847f21f7dc Merge pull request #813 from kevlahnota/master
Centered Power/Toughness
2016-07-30 15:05:57 +08:00
Anthony Calosa
b90dfbe3b0 Centered P/T inside P/T box 2016-07-30 15:04:34 +08:00
Anthony Calosa
c230794c82 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-30 15:03:08 +08:00
Anthony Calosa
7f83aa7253 Merge pull request #812 from kevlahnota/master
small adjustment
2016-07-30 12:14:24 +08:00
Anthony Calosa
1039815017 small adjustment
meld card have a little space between. reduce render big display.
2016-07-30 10:21:39 +08:00
Anthony Calosa
2c43eac80d Merge pull request #811 from kevlahnota/master
change enstack & scale
2016-07-30 09:18:44 +08:00
Anthony Calosa
4aa6ad3203 small scale 2016-07-30 08:13:30 +08:00
Anthony Calosa
730b05ad1b change enstack attackers
their x position is the same in their "default" horizontal stack, so
when attacking it always start at left side, not in the middle. Please
report if you have bugs...
2016-07-30 07:07:35 +08:00
Anthony Calosa
5a7b2c5029 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-30 07:02:49 +08:00
zethfoxster
7ae551de9d Merge pull request #37 from WagicProject/master
getting master
2016-07-29 17:44:56 -04:00
Anthony Calosa
96dd3faef0 Merge pull request #810 from kevlahnota/master
Meld card size
2016-07-30 03:49:06 +08:00
Anthony Calosa
ffdc8cd9ff meld card size 2016-07-30 03:05:24 +08:00
Anthony Calosa
8256ac3bee Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-30 01:41:43 +08:00
Anthony Calosa
037ab83519 Merge pull request #809 from kevlahnota/master
Border corrections
2016-07-30 00:10:28 +08:00
Anthony Calosa
a56e77310d Border Corrections
Removed other border render, and use the one in cardgui::drawcard...
2016-07-29 23:10:01 +08:00
Anthony Calosa
5350fb7f5d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 18:47:51 +08:00
Anthony Calosa
9161f89057 Merge pull request #808 from kevlahnota/master
alphabeta border & scale
2016-07-29 18:40:38 +08:00
Anthony Calosa
1d2abeb20b Minor Border changes
Also added copier values if it has copied a token or not...
2016-07-29 18:37:03 +08:00
Anthony Calosa
833c21192a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 18:30:20 +08:00
Anthony Calosa
86168e454f Merge pull request #807 from kevlahnota/master
Add test and Fix unused variable error
2016-07-29 08:11:05 +08:00
Anthony Calosa
a20c2ce29a Unused variable 2016-07-29 07:30:20 +08:00
Anthony Calosa
874b27c56d Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-29 07:00:46 +08:00
Anthony Calosa
a7dc44e4e1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 07:00:07 +08:00
zethfoxster
047d08882e Merge pull request #806 from zethfoxster/master
pushing to master
2016-07-28 18:55:03 -04:00
zethfoxster
52df1ad963 the fix for the sacrifice trigger was a ton easier than expected.
treat it like a spell. 
the card after contains all the info we need to determine if it should trigger.
2016-07-28 18:48:47 -04:00
Anthony Calosa
c2cec37928 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-29 06:36:51 +08:00
Anthony Calosa
239a186b36 Update _tests.txt 2016-07-28 21:36:21 +08:00
Anthony Calosa
5aeb2ebc05 Create TirelessGraf.txt 2016-07-28 21:35:43 +08:00
zethfoxster
a7e87aaae5 Merge pull request #36 from WagicProject/master
Getting master
2016-07-28 09:11:55 -04:00
zethfoxster
eb545eca57 Merge pull request #804 from zethfoxster/master
Merge pull request #35 from WagicProject/master
2016-07-28 08:02:00 -04:00
Anthony Calosa
44ab1827bf Merge pull request #803 from kevlahnota/master
Update test and Corrected Graf Mole
2016-07-28 19:39:05 +08:00
Anthony Calosa
96b4f024b4 Update test and Corrected Graf Mole 2016-07-28 19:34:50 +08:00
Anthony Calosa
b070035770 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 19:28:05 +08:00
Anthony Calosa
1b0c3d8c00 Merge pull request #802 from kevlahnota/master
Attempt to fix my mess
2016-07-28 19:25:42 +08:00
Anthony Calosa
2e71cb08d0 I hope this is correct 2016-07-28 19:24:01 +08:00
Anthony Calosa
3da5d12bee Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 17:31:51 +08:00
Anthony Calosa
e8019bbb92 Merge pull request #801 from kevlahnota/master
Fix Compilation and add Tireless Tracker Test
2016-07-28 17:09:34 +08:00
Anthony Calosa
30dab27202 Fix Compilation 2016-07-28 16:38:16 +08:00
Anthony Calosa
cc7077d783 Fix compilation and add Tireless Tracker test 2016-07-28 16:37:38 +08:00
Anthony Calosa
fda7e9f39d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 11:20:40 +08:00
zethfoxster
e178533493 Merge pull request #35 from WagicProject/master
getting master
2016-07-27 23:04:19 -04:00
zethfoxster
e3ad9296bc Merge pull request #800 from zethfoxster/master
getting master
2016-07-27 23:03:37 -04:00
Anthony Calosa
01042a62ae Merge pull request #799 from kevlahnota/master
revert
2016-07-28 10:30:49 +08:00
Anthony Calosa
7bd940ddb3 Revert "revised legendary"
This reverts commit 193d7accb4.
2016-07-28 10:28:54 +08:00
Anthony Calosa
f168702aad Revert "moved sac event"
This reverts commit 2a33c0c375.
2016-07-28 10:28:27 +08:00
Anthony Calosa
2a33c0c375 moved sac event 2016-07-28 10:26:25 +08:00
zethfoxster
eea240d7f2 changing some of the logic to the previous fixes, we want to avoid using code that looks for specific card names.
currently we have kamiflip as the only defined flip type as it is treated differently from the others. 
but we have room for more if needed now
doublefaced=kamiflip
sets the flip type of a card to the kamiflip style cards. since this is defined on cardprimitive level now, we might be able to do something different from the flipping animation. who knows.

commented out the forcing token triggers, it bypass targetchooser check. still working on a fix for this coming soon.
2016-07-27 20:03:25 -04:00
zethfoxster
afb98a374c updated codes for changes 2016-07-27 19:58:32 -04:00
Anthony Calosa
ed0d28eaf6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 07:02:36 +08:00
Anthony Calosa
50345101e5 Merge pull request #798 from kevlahnota/master
Revised Legendary
2016-07-28 06:44:14 +08:00
zethfoxster
c0e4010c88 Merge pull request #34 from WagicProject/master
getting master
2016-07-27 18:42:54 -04:00
Anthony Calosa
193d7accb4 revised legendary 2016-07-28 06:42:47 +08:00
Anthony Calosa
a9be34c627 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-28 06:33:30 +08:00
Anthony Calosa
0e14226968 Merge pull request #797 from kevlahnota/master
Alpha-Beta Small-Inner Border
2016-07-27 18:13:11 +08:00
Anthony Calosa
068b03a0bb Alpha-Beta small inner border 2016-07-27 17:12:11 +08:00
Anthony Calosa
b99f9ae752 alpha beta small border 2016-07-27 17:10:26 +08:00
Anthony Calosa
3519871f80 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 17:07:24 +08:00
Anthony Calosa
e9db853f28 Merge pull request #796 from kevlahnota/master
Fix Flip/Transform Cards, Fix Copier
2016-07-27 16:07:05 +08:00
Anthony Calosa
a6fdd89e1d Fix Copier 2016-07-27 15:19:11 +08:00
Anthony Calosa
b8bfe7acc1 Fix Flip/Transform Cards
If the card is a copier or a token, it cannot be transformed since it's
not a double face card. Also the copied card must be the "active" part
of a double faced card. Flip cards (kamigawa block) is not restricted by
this since its a single sided card. If the transformed card is cda, take
any damage into account (PT bonus is already in effect for cda)..
2016-07-27 14:39:39 +08:00
Anthony Calosa
dd5d5589ff Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 12:41:38 +08:00
zethfoxster
7d460e093c Merge pull request #795 from zethfoxster/master
pushing to master
2016-07-26 22:47:07 -04:00
zethfoxster
54e86915b0 Merge pull request #33 from WagicProject/master
getting master
2016-07-26 22:46:06 -04:00
Anthony Calosa
ab2effd776 Merge pull request #794 from kevlahnota/master
Event for token sacrifice
2016-07-27 09:19:16 +08:00
zethfoxster
4f0da67a83 fixed a condition where scry core wasnt triggering its after effect 2016-07-26 19:35:10 -04:00
Anthony Calosa
014ca36a4a force event for token sacrifice 2016-07-27 07:11:30 +08:00
Anthony Calosa
2971e64182 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 07:11:10 +08:00
Anthony Calosa
d7737c13ff Merge pull request #793 from kevlahnota/master
Fix CDA vs Flip/Transforms
2016-07-27 07:07:47 +08:00
Anthony Calosa
eebcc9c925 Fix CDAACTIVE & transformed card colors
cdaactive has its own computation, so exclude it on flip/transform cards
ability
2016-07-27 06:31:03 +08:00
Anthony Calosa
0c90b39a96 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-27 02:57:42 +08:00
Anthony Calosa
4f3f96337f Merge pull request #792 from kevlahnota/master
Fix Legendary (Mirror Gallery) & Enters Tapped cards
2016-07-27 02:34:56 +08:00
Anthony Calosa
e855ca72aa Fix Mirror Gallery & enters "tapped" cards
If Mirror Gallery leaves play, you must check for legendary status.
Fix some cards that enters tapped.
2016-07-27 01:44:18 +08:00
Anthony Calosa
8ff47bf8e2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-26 23:18:35 +08:00
Anthony Calosa
9d75f69a79 Merge pull request #791 from kevlahnota/master
granted flashback
2016-07-26 11:21:28 +08:00
Anthony Calosa
ae33977e10 Add Snapcaster Mage Ability
tempflashback - flashback using manacost
2016-07-26 09:56:13 +08:00
Anthony Calosa
07b5f35b98 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-26 09:39:47 +08:00
Anthony Calosa
c4acf006dd Merge pull request #790 from kevlahnota/master
Clue tokens
2016-07-26 09:27:24 +08:00
Anthony Calosa
12b80307a7 Update Living_Death.txt
Use Living Death and Clone
2016-07-26 08:51:46 +08:00
Anthony Calosa
43fd399d10 Update _tests.txt 2016-07-26 07:46:18 +08:00
Anthony Calosa
cc5d8940bf Clue tokens 2016-07-26 07:43:13 +08:00
Anthony Calosa
09ed1ab683 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-25 10:42:49 +08:00
Anthony Calosa
26c85fd18a added Eldritch Moon 2016-07-25 06:32:49 +08:00
Anthony Calosa
894615bee6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-25 05:15:38 +08:00
zethfoxster
aeed094be0 Merge pull request #789 from zethfoxster/master
big whoops here, this would be a disastrous change.
2016-07-24 11:12:45 -04:00
zethfoxster
61068ee166 big whoops here, this would be a disastrous change. 2016-07-24 11:12:13 -04:00
zethfoxster
bdce25cb8c Merge pull request #788 from zethfoxster/master
pushing to master
2016-07-24 11:09:18 -04:00
zethfoxster
6a71bf5653 Merge pull request #32 from WagicProject/master
getting master
2016-07-24 11:08:51 -04:00
zethfoxster
3007ddc093 added oplifetotal...or readded, i swear this was already in a long time ago when I added lifetotal as a variable. either way. 2016-07-24 11:08:08 -04:00
Anthony Calosa
4495e1649f Merge pull request #787 from kevlahnota/master
Little border adjustments
2016-07-24 21:19:57 +08:00
Anthony Calosa
f960cdea9b A little border adjustment
no more very thin borders on awards and in game...
2016-07-24 20:25:20 +08:00
Anthony Calosa
b70b2a65bc Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-24 20:20:31 +08:00
Anthony Calosa
4a73e90da8 remove test
temporarily
2016-07-24 20:19:58 +08:00
Anthony Calosa
fc59bef156 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-24 19:41:58 +08:00
zethfoxster
512f4ca4e4 Merge pull request #786 from zethfoxster/master
pushing to master
2016-07-24 07:33:17 -04:00
zethfoxster
f254ca57c6 Merge pull request #31 from WagicProject/master
getting master
2016-07-24 07:32:06 -04:00
Anthony Calosa
5e35dac1da Update Living_Death.txt 2016-07-24 17:51:26 +08:00
Anthony Calosa
44cbd408ce Update _tests.txt 2016-07-24 14:25:08 +08:00
Anthony Calosa
6fbe9de1a8 Create Living_Death.txt 2016-07-24 14:24:11 +08:00
Anthony Calosa
3b1410f913 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-24 14:21:15 +08:00
Anthony Calosa
f9265923a9 Merge pull request #784 from kevlahnota/master
Border Adjustment & Added repeat depleter/ingest cards
2016-07-24 13:29:26 +08:00
Anthony Calosa
3282848631 Normalized Big Quad Border
Hopefully all Big Quads have identical border sizes: In Game, Deck
Editor Carousel and Trophies .
2016-07-24 13:12:40 +08:00
Anthony Calosa
f142363bfa smaller scaled big quad and forced border
Ingame big quads are scaled smaller
2016-07-24 12:40:41 +08:00
Anthony Calosa
c0e9800179 added scalpelexis, sphinx's tutelage, grindstone, primal surge 2016-07-24 12:31:16 +08:00
Anthony Calosa
97308ca31c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-24 11:24:02 +08:00
zethfoxster
02992954c2 Merge pull request #30 from WagicProject/master
getting master
2016-07-23 09:19:12 -04:00
Anthony Calosa
78d4f178a3 Merge pull request #783 from kevlahnota/master
Fix Flying vs Moat (multiples of them). Fixes issue #526
2016-07-23 10:16:47 +08:00
Anthony Calosa
fe577d9dd0 fix flying and multiple moat in play
putrid imp that gains temporary flying cant attack if the opponent has
multiple moat in play, this should fix it.
2016-07-23 09:45:12 +08:00
Anthony Calosa
007010067b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-23 09:06:56 +08:00
zethfoxster
bc2d8dab31 corrected my logic for emerge, originally I thought the cost was the same as the original cost, while coding i noticed it can have a completely different cost than the real manacost.
moved the extra cost check for "offerings" to a location before canafford in alternative reacttoclick, the reason for this is that the 2 offering cost we have handle the can afford calls, and even cast the card in the dopay. not placing this before it causes the card to not react to click if there is a different manacost attached to the emerge/kill 
test codes below.
mana={g}{g}{g}
other={emerge}(r}{4} name(emerge)

mana={6}
other={k(giant|mybattlefield)}

fixed memleaks in killoffering code.

note to devs, remember to make diff costs a variable that you can safe_delete, it creates a manacost object that will become a leak otherwise.
do not use it directly as a function.
source->controller()->getManaPool()->canAfford(source->getManaCost()->Diff(target->getManaCost()))
this will leave a memleak every single time ai checks this cost, or a player accesses the cost even if you cant pay it.
2016-07-22 19:10:06 -04:00
zethfoxster
296f8645fb Merge pull request #782 from zethfoxster/master
pushing to master
2016-07-22 18:05:35 -04:00
zethfoxster
2d76c8ff0d Merge pull request #29 from WagicProject/master
getting master
2016-07-22 18:05:16 -04:00
zethfoxster
0a3d9f9876 flipped the logic of the 2 deck editor menu buttons left and right, it was a nightmare making an ai deck with the tiny buttons to navigate. having my finger slip slightly off the button made it travel the opposite direction from the button, which was confusing and felt very buggy. 2016-07-22 17:46:52 -04:00
Anthony Calosa
2a1d0b19ce Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-22 21:35:23 +08:00
Anthony Calosa
a99c57ab1a Merge pull request #780 from kevlahnota/master
OK quad and COMBATTOUGHNESS for attackers/blockers
2016-07-22 16:34:15 +08:00
Anthony Calosa
6832049ccc reserve size 2016-07-22 16:00:29 +08:00
Anthony Calosa
6d72753216 OK quad and COMBATTOUGHNESS for attackers/blockers
support doubled res for OK quad, AI should consider toughness as power
if it has COMBATTOUGHNESS ability
2016-07-22 15:38:38 +08:00
Anthony Calosa
b6b3898536 Merge pull request #10 from WagicProject/master
pull from master
2016-07-22 14:20:39 +08:00
Anthony Calosa
99922d38e2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-22 14:15:50 +08:00
zethfoxster
161623a8d2 Merge pull request #779 from zethfoxster/master
pushing to master
2016-07-21 22:31:17 -04:00
zethfoxster
155a7a6582 Merge pull request #28 from WagicProject/master
getting master
2016-07-21 22:29:58 -04:00
zethfoxster
6aafe9dee0 added lifegain and oplifegain variable used the same as lifelost, but stores the value of life gained this turn. 2016-07-21 21:11:15 -04:00
zethfoxster
680c9d64cb Merge pull request #778 from zethfoxster/master
getting master
2016-07-21 20:47:28 -04:00
zethfoxster
ca395492d5 added meld(cardname)
added meldfrom(cardname|cardname) helper class.

auto={0}:target(arbor colossus|mybattlefield) meld(Arc Runner)
auto=meldfrom(arbor elf|Arbor Colossus)
2016-07-21 20:46:53 -04:00
Anthony Calosa
ea920d352f Merge pull request #777 from kevlahnota/master
Award images
2016-07-21 15:50:58 -05:00
Anthony Calosa
0c0031455b Add files via upload 2016-07-21 15:49:32 -05:00
Anthony Calosa
a8a9893ce4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-22 04:22:34 +08:00
Anthony Calosa
5143743661 unlocked images 2016-07-21 22:58:27 +08:00
Anthony Calosa
88a42b25cc Add files via upload 2016-07-21 02:39:51 -05:00
Anthony Calosa
b371bf6efa Merge pull request #776 from kevlahnota/master
psp fix 3
2016-07-21 02:37:47 -05:00
Anthony Calosa
3bc7ed6f8c Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-21 15:36:22 +08:00
Anthony Calosa
f996510969 psp fix 3 2016-07-21 15:36:16 +08:00
Anthony Calosa
58fd119636 Add files via upload 2016-07-21 02:36:16 -05:00
Anthony Calosa
f275792604 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-21 15:23:17 +08:00
zethfoxster
9f8ead5e4e added other={cost}
other={emerge}
2016-07-20 20:06:18 -04:00
zethfoxster
a35ccbbe5b Merge pull request #775 from zethfoxster/master
pushing to master
2016-07-20 19:01:10 -04:00
zethfoxster
9a60a8838f Merge pull request #27 from WagicProject/master
getting master
2016-07-20 19:00:08 -04:00
zethfoxster
bb9e02da6b fixed a debug assert i introduced. 2016-07-20 18:58:29 -04:00
Anthony Calosa
0fd0c5ecc1 Merge pull request #774 from kevlahnota/master
psp fix 2
2016-07-20 17:36:02 -05:00
Anthony Calosa
c89961ebf0 Add files via upload 2016-07-20 17:35:03 -05:00
Anthony Calosa
0f81e82206 psp fix 2 2016-07-21 06:34:14 +08:00
Anthony Calosa
7c7c8c4f34 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-21 06:02:56 +08:00
xawotihs
3d7362aa9d Merge branch 'master' of https://github.com/WagicProject/wagic 2016-07-20 22:16:23 +01:00
Anthony Calosa
f3061a2526 Merge pull request #773 from kevlahnota/master
Semicolon
2016-07-20 11:40:24 -05:00
Anthony Calosa
2657af1aef semicolon 2016-07-21 00:38:01 +08:00
Anthony Calosa
dd03ed4b30 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-21 00:37:50 +08:00
Anthony Calosa
64c6b05963 Merge pull request #772 from kevlahnota/master
try to fix psp
2016-07-20 19:19:56 +08:00
Anthony Calosa
05017b0236 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-20 19:17:36 +08:00
Anthony Calosa
efd9cce4ef try to fix psp platform 2016-07-20 19:16:48 +08:00
Anthony Calosa
144c78fa4b Add files via upload 2016-07-20 19:12:06 +08:00
Anthony Calosa
3147aa539c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-20 09:42:16 +08:00
zethfoxster
ad4532932b Merge pull request #771 from zethfoxster/master
pushing to master
2016-07-19 20:44:40 -04:00
zethfoxster
ffac3462af Merge pull request #26 from WagicProject/master
Merge pull request #770 from zethfoxster/master
2016-07-19 20:44:06 -04:00
zethfoxster
7c163592b5 removed the changes I made to selectAbility and created a new function which handles sending an ability and card to have AI do the ability of that card.
found a selectability call after blockers that was the cause of a race condition debug assert, but most importantly, the reason AI would sometimes block a creature, then immediately decide not to block. causing it to sometimes take preventable damage, and sometime cause AI to stack a ton of blockers on a single card even tho it did not have a chance to actually kill the creature.
this is still a thing, but wont happen so grossly incorrect now.
2016-07-19 20:16:22 -04:00
xawotihs
a6211e371e Revert usage of ant release and remove the DEBUG define in the NDK makefile to remove the testsuite 2016-07-19 22:24:26 +01:00
Xawotihs
775085eca1 Uses now *ant release* to build the APK 2016-07-19 21:30:08 +01:00
xawotihs
b3d580cada Changed Android app manifest to be not debuggable. 2016-07-19 21:03:24 +01:00
Anthony Calosa
37987ddb57 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-19 10:47:53 +08:00
zethfoxster
a56ab4f561 Merge pull request #770 from zethfoxster/master
pushing to master
2016-07-18 22:30:53 -04:00
zethfoxster
6f649bd680 Merge pull request #25 from WagicProject/master
getting master
2016-07-18 22:30:30 -04:00
zethfoxster
6316577ec7 taught AI basic attack and block cost.
added functionality to send specific abilities to AI "selectAbility" to have it find mana, targets, and use a selected ability at our command.
2016-07-18 22:03:16 -04:00
Anthony Calosa
61cd74fcd0 revert psp cache 2016-07-19 09:52:18 +08:00
zethfoxster
37fd0ebbd2 readded the "fakebar" size adjustments based on string lengths.
in debug there is a strange line drawn sometimes on screen, like the buttons on main screen, this is not present in release builds, I'm guessing its some kind of debug related thing with JGE and quads.
2016-07-18 19:02:03 -04:00
zethfoxster
8e987a6718 Merge pull request #769 from zethfoxster/master
pushing to master
2016-07-18 17:24:15 -04:00
zethfoxster
520be9dbe8 Merge pull request #24 from WagicProject/master
getting master
2016-07-18 17:23:54 -04:00
zethfoxster
322e6f7edf Merge pull request #768 from kevlahnota/master
Some changes on Deck Editor & Others
2016-07-18 17:22:16 -04:00
Anthony Calosa
b6eea6fe2e Some Changes to Deck Editor and Others
Some Deck Editor changes
2016-07-19 04:33:23 +08:00
Anthony Calosa
dc84c50ea8 add deck editor graphics 2016-07-19 03:32:22 +08:00
Anthony Calosa
07d7df7271 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 23:33:26 +08:00
Anthony Calosa
5b9f3c70dc Merge pull request #767 from kevlahnota/master
minor changes
2016-07-18 14:26:31 +08:00
Anthony Calosa
bd36590084 offquad for offset bg 2016-07-18 13:52:28 +08:00
Anthony Calosa
4e64ff4ff9 center menu title 2016-07-18 13:51:49 +08:00
Anthony Calosa
2dd882a7a5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 13:51:19 +08:00
Anthony Calosa
fe4c102c7d Merge pull request #766 from kevlahnota/master
psp cache
2016-07-18 12:47:01 +08:00
Anthony Calosa
1380bc9940 psp cache 2016-07-18 12:44:19 +08:00
Anthony Calosa
5cc549ad3a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 11:11:51 +08:00
Anthony Calosa
75395f6622 Merge pull request #765 from kevlahnota/master
Fix Deck Menu layer, Change Main Menu Layout, Fix Crash cdaactive on tokens
2016-07-18 11:04:51 +08:00
Anthony Calosa
c9576e260e fix blinking menu item 2016-07-18 11:04:14 +08:00
Anthony Calosa
362d692879 cleanup 2016-07-18 10:53:07 +08:00
Anthony Calosa
acbaa69305 use previous "phaseinfo" as fakebar 2016-07-18 10:38:47 +08:00
Anthony Calosa
592a48c725 add fakebar 2016-07-18 10:38:47 +08:00
zethfoxster
bfaaf7d893 travis int order 2016-07-17 22:37:32 -04:00
zethfoxster
9e73dc9c00 add support for repeater deplete cards.
Scalpelexis
Sphinx's Tutelage
Grindstone
normally I aim for much bigger card groups, but this was requested by one of the only 2 active members we have on the forum.
I'll have the card code for these cards ready when I code eldrich moon set.

to use, use it like any normal depelte except add
name
color
to the front, 
name deplete:4 targetsZone(player)
this will repeat this until the player depletes cards that dont have atleast 2 with the same name.
color deplete:2 target(player)
this will continue to deplete until the player depletes a set of cards that dont share a color with each other lands not included when checking colors.
enjoy.
2016-07-17 22:24:53 -04:00
Anthony Calosa
d37aac0c71 added fakebar.png 2016-07-18 10:15:22 +08:00
Anthony Calosa
8314d4c9ae update GameStateMenu
as Zeth suggested
2016-07-18 09:24:28 +08:00
Anthony Calosa
d860954c32 fix crash with cdaactive and token
cdaactive is forcedalive, if the token dies, forcedestroy it, token/s go
to garbage
2016-07-18 07:32:02 +08:00
Anthony Calosa
0b4b085095 fix layer order 2016-07-18 07:28:31 +08:00
Anthony Calosa
c0334d0c94 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-18 06:07:38 +08:00
zethfoxster
6acd897e16 Merge pull request #23 from WagicProject/master
getting master
2016-07-17 10:39:10 -04:00
Anthony Calosa
2adfc55339 Merge pull request #763 from kevlahnota/master
stats to the right
2016-07-17 20:07:28 +08:00
Anthony Calosa
208b4f68b5 added statsholder 2016-07-17 19:05:00 +08:00
Anthony Calosa
33fd704a00 move stats to the right in deck menu 2016-07-17 19:03:55 +08:00
Anthony Calosa
6d8ece6822 change avatar holder bg color 2016-07-17 19:02:45 +08:00
Anthony Calosa
6b5cbd5f11 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 17:35:36 +08:00
Anthony Calosa
ea6017511b Merge pull request #762 from kevlahnota/master
large icons for Android
2016-07-17 15:39:58 +08:00
Anthony Calosa
2477b8a3ea large icons for Android 2016-07-17 15:39:10 +08:00
Anthony Calosa
cdd1075384 Merge pull request #761 from kevlahnota/master
phaseinfo & backdropframe & backdrop
2016-07-17 15:22:58 +08:00
Anthony Calosa
c61c17f19c increased cache 2016-07-17 15:05:53 +08:00
Anthony Calosa
774b79f07e seperated backdrop and backdropframe 2016-07-17 14:44:37 +08:00
Anthony Calosa
002172281b added backdrop frame 2016-07-17 14:42:16 +08:00
zethfoxster
4e9d4bfaf6 minor changes to ai 2016-07-17 02:19:58 -04:00
Anthony Calosa
894e9f244f added phaseinfo graphic 2016-07-17 14:13:57 +08:00
Anthony Calosa
189b45ab9b new backdrop 2016-07-17 14:12:47 +08:00
Anthony Calosa
b0912de788 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-17 14:11:54 +08:00
Anthony Calosa
f435946f66 seperated backdrop and phase info graphic 2016-07-17 14:11:49 +08:00
Anthony Calosa
64d91ccaab Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 12:52:12 +08:00
Anthony Calosa
e97fbb2784 Update DeckImporter.java 2016-07-17 11:47:06 +08:00
zethfoxster
0029e0ed43 Merge pull request #22 from WagicProject/master
getting master
2016-07-16 23:13:59 -04:00
Anthony Calosa
088f235f29 Merge pull request #760 from kevlahnota/master
revert build.xml
2016-07-17 08:55:34 +08:00
Anthony Calosa
dd5aa90498 revert build.xml 2016-07-17 08:54:26 +08:00
Anthony Calosa
c866e5dd45 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 08:54:01 +08:00
Anthony Calosa
6e8f74af15 Merge pull request #759 from kevlahnota/master
centered unlock awards and double res shop
2016-07-17 08:36:18 +08:00
Anthony Calosa
d70fd8c208 test build number 2016-07-17 08:35:14 +08:00
Anthony Calosa
9551c9bed4 upped build number
don't know if we can compute travis build number minus the last build of
this
2016-07-17 08:02:04 +08:00
Anthony Calosa
06740564f8 centered unlock awards and double res shop
400x100 base scale for the xxx_unlocked.png
2016-07-17 07:42:46 +08:00
Anthony Calosa
ef94c31d42 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-17 06:28:17 +08:00
zethfoxster
093b370903 Merge pull request #758 from zethfoxster/master
stupid case for travis
2016-07-16 16:31:56 -04:00
zethfoxster
542845667a stupid case for travis 2016-07-16 15:59:45 -04:00
zethfoxster
8ce08bc4f4 Merge pull request #757 from zethfoxster/master
more fixes
2016-07-16 14:47:12 -04:00
zethfoxster
69158d55c1 more fixes 2016-07-16 14:46:40 -04:00
zethfoxster
d9a794e186 Merge pull request #756 from zethfoxster/master
pushing to master
2016-07-16 14:44:16 -04:00
zethfoxster
6cc146c0a5 Merge pull request #21 from WagicProject/master
getting master
2016-07-16 14:43:45 -04:00
Anthony Calosa
b490328a45 Merge pull request #755 from kevlahnota/master
backdrop & taskboard
2016-07-16 22:08:13 +08:00
zethfoxster
30df5226df Merge pull request #20 from WagicProject/master
getting master
2016-07-16 09:39:26 -04:00
Anthony Calosa
c8369ce316 replaced backdrop and taskboard 2016-07-16 21:30:09 +08:00
Anthony Calosa
ffb7e5d573 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-16 21:00:14 +08:00
Anthony Calosa
3d41531a84 Merge pull request #754 from kevlahnota/master
support doubled res for awards
2016-07-16 19:50:20 +08:00
Anthony Calosa
f0fa6986d7 support double res award
the 203.f height and 268.f is reserved for small award images, if you
want double res, make the award in scale of 171x192 (example 342x384)
2016-07-16 14:49:57 +08:00
Anthony Calosa
d908606527 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-16 13:30:55 +08:00
Anthony Calosa
886a26aa20 Merge pull request #753 from kevlahnota/master
First set of Graphic Changes ... use default theme
2016-07-16 10:19:37 +08:00
Anthony Calosa
bc77ff45cd Create readme.txt 2016-07-16 09:44:42 +08:00
Anthony Calosa
c1fb884dcd moved old themes 2016-07-16 09:38:20 +08:00
Anthony Calosa
26992828f0 Add files via upload 2016-07-16 09:36:22 +08:00
Anthony Calosa
07670c6bc5 Create readme.txt 2016-07-16 09:32:15 +08:00
Anthony Calosa
b2bc6b7740 remove old theme 2016-07-16 09:25:21 +08:00
Anthony Calosa
c617ede243 First set of Graphic changes
TODO: generate a graph/stats on deck menu to the right, update other
graphics, move detailed info on the right of deck menu...
2016-07-16 09:16:07 +08:00
Anthony Calosa
0d7600d62c revert wallpapers 2016-07-16 09:08:38 +08:00
Anthony Calosa
7a0ef10f9f add new graphics 2016-07-16 09:06:38 +08:00
zethfoxster
2fc52c9abd changed suspend to use castcard. 2016-07-14 21:25:04 -04:00
zethfoxster
9a56817bf8 fixed a bug I introduced 2016-07-14 20:44:21 -04:00
zethfoxster
e81346f881 more work on cascade, I think I figured out what was causing a weird crash. 2016-07-14 20:28:19 -04:00
zethfoxster
01fd8fa406 recoded cascade, the logic was incorrect. also the ability was coded incorrectly. ALL the cards get exiled, then placed on the bottom, the card that cost less is also exiled then MAY be cast otherwise its placed in the library bottom with the rest.
I also now tell AI to ALWAYS use cast card if available. as the effects are always better.
2016-07-13 23:57:30 -04:00
Anthony Calosa
f09e0db311 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-14 10:51:23 +08:00
zethfoxster
5dc72e88fe Merge pull request #19 from WagicProject/master
getting master
2016-07-13 20:08:23 -04:00
Anthony Calosa
169e2b8477 change path again 2016-07-14 01:13:43 +08:00
Anthony Calosa
9fe5ec6068 removed old path 2016-07-14 00:59:46 +08:00
Anthony Calosa
d4e0ca3f03 try to fix build 2016-07-14 00:57:50 +08:00
Anthony Calosa
7690a27e60 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-13 18:50:51 +08:00
Anthony Calosa
748d9ef65d Merge pull request #752 from kevlahnota/master
menubar
2016-07-13 15:25:18 +08:00
Anthony Calosa
d88db28da8 menubar graphic 2016-07-13 14:27:33 +08:00
Anthony Calosa
e95b9f57fa menubar 2016-07-13 14:25:57 +08:00
Anthony Calosa
6c14aa49ea Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-13 13:50:18 +08:00
Anthony Calosa
1859fc87ae Merge pull request #751 from kevlahnota/master
adjust simple menu & textscroller
2016-07-13 13:11:39 +08:00
Anthony Calosa
6c9d2e5db7 tooltip graphic 2016-07-13 13:09:34 +08:00
Anthony Calosa
d6d147187d add tooltip on textscroller 2016-07-13 13:07:29 +08:00
Anthony Calosa
ab75c1d5e2 adjust simple menu
adjust simple menu and fix some cards
2016-07-13 11:43:00 +08:00
Anthony Calosa
992178eb9a Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-12 21:40:16 +08:00
Anthony Calosa
f61ce2884a Merge pull request #9 from WagicProject/master
pull
2016-07-12 21:40:03 +08:00
Anthony Calosa
21db8852d6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-12 21:34:30 +08:00
zethfoxster
2900c1f914 Merge pull request #750 from zethfoxster/master
Pushing fixes
2016-07-12 09:01:04 -04:00
zethfoxster
8dd7bd8912 Merge pull request #18 from WagicProject/master
Getting master
2016-07-12 09:00:25 -04:00
Anthony Calosa
c6f1784d9d Merge pull request #749 from kevlahnota/master
small adjustment
2016-07-12 19:27:57 +08:00
Anthony Calosa
684cb086cc rounded 2016-07-12 17:51:48 +08:00
Anthony Calosa
d2d8b06d97 lowered value 2016-07-12 17:44:57 +08:00
Anthony Calosa
4d346e0ca7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-12 17:43:47 +08:00
Anthony Calosa
a6cbd10f3b Merge pull request #748 from kevlahnota/master
Update some items
2016-07-12 16:34:16 +08:00
Anthony Calosa
416a49d87f Update some items 2016-07-12 15:49:43 +08:00
zethfoxster
f438548e5c teaching ai to select X on the menu again. 2016-07-11 23:46:03 -04:00
zethfoxster
cc75fc42db fixed a memleak that triggered with cards like vise, we were leaving this funtion without deleting an event that was not being sent. 2016-07-11 19:32:57 -04:00
zethfoxster
66e01b12f8 Merge pull request #17 from WagicProject/master
getting master
2016-07-11 18:53:15 -04:00
Anthony Calosa
b3045726fb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-12 06:22:49 +08:00
Anthony Calosa
9b2b541e4d Merge pull request #747 from kevlahnota/master
try to fix failed logic here
2016-07-12 05:30:58 +08:00
Anthony Calosa
2d763d106d try to fix failed logic here 2016-07-12 02:27:06 +08:00
Anthony Calosa
37d2feeaa5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-11 20:01:38 +08:00
Anthony Calosa
66a33cd56e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-11 19:56:57 +08:00
Anthony Calosa
ae07844a71 a little bit smaller 2016-07-11 19:56:39 +08:00
Anthony Calosa
e00484775e Merge pull request #745 from kevlahnota/master
Add Missing Devoid Cards and change Simple Menu
2016-07-11 19:54:37 +08:00
Anthony Calosa
ed871db1f3 use regular images in grid deck view
i did search for psp-2000 and it has 64mb ram vs psp-1000 32mb ram. use
lowres images for psp to be safe.
2016-07-11 19:16:47 +08:00
Anthony Calosa
3c4f3146c4 fix cards that move on top of library
seems when you search your library, after you put it on top, it shuffles
also the chosen card.
2016-07-11 18:39:21 +08:00
Anthony Calosa
5cde230723 Fix Crash when importing deck
removed "sideboard"
2016-07-11 16:35:57 +08:00
Anthony Calosa
6d4a068453 SImple Menu 2016-07-11 13:54:08 +08:00
Anthony Calosa
248e8e6beb Added some missing Devoid cards 2016-07-11 10:49:43 +08:00
Anthony Calosa
4db11ba324 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-11 08:43:52 +08:00
Anthony Calosa
a97f862641 Merge pull request #744 from kevlahnota/master
Add support for reducing hybrid costs
2016-07-11 08:33:15 +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
a72fb6f01a Merge pull request #8 from WagicProject/master
pull from master
2016-07-11 07:47:58 +08:00
zethfoxster
53766b99c9 Merge pull request #743 from zethfoxster/master
pushing to master
2016-07-10 14:05:51 -04:00
zethfoxster
1b54cf56e0 auto close graveyard when delving and we have exiled enough to pay for the card. 2016-07-10 14:04:27 -04:00
zethfoxster
05a553ffdc Merge pull request #16 from WagicProject/master
getting master
2016-07-10 13:46:43 -04:00
Anthony Calosa
d6ea80843f Merge pull request #742 from kevlahnota/master
Updated Primitives, Corrected Names, Updated Unsupported
2016-07-10 18:08:00 +08:00
Anthony Calosa
8c2ce43053 Cleaned Unsupported 2016-07-10 17:04:04 +08:00
Anthony Calosa
34b33798a7 Corrected some card names 2016-07-10 16:44:39 +08:00
Anthony Calosa
adbef081d0 Update primitives
forcedalive now means forcedalive even when the cards is not in play.
Cloudshift ability is move to exile and move to your battlefield, blink
cannot be used since it moves to exile and then moves to owner
battlefield...
2016-07-10 15:42:36 +08:00
Anthony Calosa
5eb3a86467 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-10 08:59:10 +08:00
Anthony Calosa
bef2b34faa Merge pull request #7 from WagicProject/master
pull changes from master
2016-07-10 08:57:20 +08:00
zethfoxster
7516b44804 Merge pull request #741 from zethfoxster/master
pushing to master
2016-07-09 20:22:52 -04:00
zethfoxster
8b70f5a114 added isochron and spell binder 2016-07-09 20:21:40 -04:00
zethfoxster
c4581a8889 added imprintedcard as a usable name for castcard 2016-07-09 20:20:55 -04:00
zethfoxster
fdde5b7fe9 ok round 3 2016-07-09 18:57:01 -04:00
zethfoxster
d1bc246a35 Merge pull request #740 from zethfoxster/master
Master
2016-07-09 18:30:16 -04:00
zethfox
262779b515 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 18:28:08 -04:00
zethfox
78e4407c71 Revert "edge case fix, the issue arises from castcard but I'm fixing it at a higher level since init to zone should always have a valid "player 1" in its first constructor."
This reverts commit d247c53136.
2016-07-09 18:21:52 -04:00
zethfoxster
d247c53136 edge case fix, the issue arises from castcard but I'm fixing it at a higher level since init to zone should always have a valid "player 1" in its first constructor. 2016-07-09 17:55:08 -04:00
zethfoxster
bca9381903 Merge pull request #739 from zethfoxster/master
unused variables.
2016-07-09 13:13:36 -04:00
zethfoxster
a8cbdafe6e unused variables. 2016-07-09 13:12:58 -04:00
zethfoxster
e595f141c1 Merge pull request #738 from zethfoxster/master
pushing to master
2016-07-09 13:09:03 -04:00
zethfoxster
4aa43de54d Merge pull request #15 from WagicProject/master
getting master
2016-07-09 13:06:46 -04:00
zethfoxster
2e92838364 fixed an issue with dredge, where dredge is offered even though theres only one dredger on cards that draw multiple. 2016-07-09 11:38:25 -04:00
Anthony Calosa
283cb64a01 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 21:20:31 +08:00
zethfoxster
517fd2d4f4 Merge pull request #737 from zethfoxster/master
merging to master
2016-07-09 09:11:33 -04:00
zethfoxster
3467c976a9 Merge pull request #14 from WagicProject/master
getting master
2016-07-09 08:54:13 -04:00
Anthony Calosa
f3166406ec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 19:56:14 +08:00
Anthony Calosa
b5b930dddb Merge pull request #736 from kevlahnota/master
Add moveto(previousbattlefield) test
2016-07-09 17:31:37 +08:00
Anthony Calosa
11c10f526a Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-09 16:51:11 +08:00
Anthony Calosa
cf362f1a6a Update _tests.txt 2016-07-09 16:50:45 +08:00
Anthony Calosa
3b2ea8ea98 Create previousbattlefield.txt 2016-07-09 16:50:07 +08:00
zethfoxster
f82bc39473 ok found the massive draw, it was trenisphere. the card lords every single card in the game a mana modifier. affinity normally didnt see these issues cause the cards effected are just either in your hand or the source themselves. but when trin was put in play it would cause 120 cards to have to update thier cost, which can not be done in acceptible cpu time. anyways, this should solve the issue.
that card is a desaster, please do not add any more code to support it, though with it in its current state im wondering why its not in supported and is placed in borderline.
2016-07-09 01:24:55 -04:00
zethfoxster
b5976035e3 actually i changed my mind, instead lets update affinity after events are processed, that should take into account cards untapping,moving, ect.... 2016-07-09 00:58:19 -04:00
zethfoxster
14f65c55b5 going to try only updating affinity() when cards move from anywhere to anywhere to help minimize the calls to this function. this atleast allows me to debug albeit slowly the follow issue ive been working to fix. not sure when this was introduced but it was not happening when i first coded this function. manacost->copy() did not slow the game to a crawl.
anyways, trinisphere and any card containing 
other={H(land[basic]|mybattlefield)}{1} name(Pay /1/ and Return a Basic Land to Hand)

cost such as this with a CD tc.
2016-07-09 00:48:08 -04:00
zethfoxster
ee91e0698d corrected some logic with computenewcost.
there is a bug im working on with newaffinity and cards that contain targetchoosers with CD tcs. 

experimental change also added with lords. im making the abilities grants by lord forcedalive until the lord is removed from game.
some instances of forcedalive in master primitives did not contain abilities which resolved, meaning they would contenue even though the source had left play.
2016-07-09 00:11:21 -04:00
Anthony Calosa
aa23537354 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-09 06:50:31 +08:00
zethfoxster
242c7b623f Merge pull request #13 from WagicProject/master
getting master
2016-07-08 17:54:14 -04:00
zethfoxster
c0c52e57df what a dumb typo. surprised it was in the engine that way for so long. 2016-07-08 17:48:27 -04:00
Anthony Calosa
dff938e802 Merge pull request #732 from kevlahnota/master
"previousbattlefield" for mover
2016-07-09 04:33:41 +08:00
Anthony Calosa
847e9dffc2 revised 2016-07-08 22:57:47 +08:00
Anthony Calosa
10d81bd47a try to fix segmentation fault 2016-07-08 18:46:07 +08:00
Anthony Calosa
3aa64697d2 "previousbattlefield" for mover 2016-07-08 17:39:47 +08:00
Anthony Calosa
fecaf64eec Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-08 17:30:51 +08:00
Anthony Calosa
20cb8e4ead Merge pull request #731 from kevlahnota/master
Softcoded some cards alias
2016-07-08 16:20:33 +08:00
Anthony Calosa
cb6e5a5e54 Update changes 2016-07-08 15:47:01 +08:00
Anthony Calosa
366de00950 Softcoded some card alias 2016-07-08 15:32:13 +08:00
Anthony Calosa
f80b7a32c1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-08 12:48:55 +08:00
Anthony Calosa
67f3d956f4 Merge pull request #730 from kevlahnota/master
Updated Primitives
2016-07-08 11:47:37 +08:00
Anthony Calosa
607301b35d Update _tests.txt
added test for lifetap vs shocklands
2016-07-08 10:19:29 +08:00
Anthony Calosa
9f5c3e9942 Create lifetap2.txt 2016-07-08 10:18:00 +08:00
Anthony Calosa
d34ecff3aa Updated Primitives
for cards that use tap(noevent)
2016-07-08 10:02:54 +08:00
zethfoxster
0ff7e54ff4 this is a good enough fix as waste is colorless which is artifact, and all we do is barrow the kbitmask from land. 2016-07-07 20:47:25 -04:00
Anthony Calosa
c4e508a090 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-08 08:37:09 +08:00
zethfoxster
58f15184b8 Merge pull request #729 from zethfoxster/master
pushing to master
2016-07-07 20:17:16 -04:00
zethfoxster
61d22eb498 added a modifier for "tap" for cards that say "enters the battlefield tapped", they are supposed to be tapped when put in play, which mean they should not trigger @tapped(.
for cards with the line or options "do/pay MANA or this card enters the battlefield tapped"
simply change it to tap(noevent)
it will simulate the card being placed into play already tapped.
2016-07-07 19:02:41 -04:00
zethfoxster
34d10bba3c Merge pull request #12 from WagicProject/master
getting master
2016-07-07 18:14:06 -04:00
Anthony Calosa
5ba8cc3439 Merge pull request #727 from kevlahnota/master
Sorted Primitives and Cleanup Tabs
2016-07-07 14:02:33 +08:00
Anthony Calosa
4da7f77089 Cleanup tabs 2016-07-07 13:25:36 +08:00
Anthony Calosa
c544206437 Sorted Primitives 2016-07-07 13:10:30 +08:00
Anthony Calosa
7a65a7da1e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-07 12:18:54 +08:00
zethfoxster
014a153e49 Merge pull request #726 from zethfoxster/master
push to master
2016-07-06 23:07:23 -04:00
zethfoxster
066c40d9c1 close library, exile, or graveyard after we "move" cards from it. 2016-07-06 22:04:59 -04:00
Anthony Calosa
5f7f4a23aa Merge pull request #6 from WagicProject/master
pull from master
2016-07-07 09:19:21 +08:00
Anthony Calosa
e39dee6e1d Revert "Zeth Fixes"
This reverts commit 78d3828f1e.
2016-07-07 09:16:03 +08:00
Anthony Calosa
cf71f84e49 Revert "Sorted Primitives"
This reverts commit 2f4c00c602.
2016-07-07 09:15:57 +08:00
zethfoxster
8265253388 fixed a issue with dredge where it was entering the stack even tho dredging itself is a replacement effect. 2016-07-06 20:26:18 -04:00
zethfoxster
b1293b70cf Merge pull request #725 from zethfoxster/master
push to wagicproject
2016-07-06 19:40:38 -04:00
zethfoxster
7b8b197a35 another fix 2016-07-06 19:08:41 -04:00
zethfoxster
867e1b8731 fixes 2016-07-06 18:24:45 -04:00
zethfoxster
5cdcf47994 merged my changes to the base 2016-07-06 18:08:33 -04:00
zethfoxster
a500920bb2 Merge pull request #11 from WagicProject/master
got it
2016-07-06 17:57:38 -04:00
zethfoxster
a748e0337d trying to get my commit in 2016-07-06 17:56:17 -04:00
Anthony Calosa
2f4c00c602 Sorted Primitives 2016-07-06 16:09:54 +08:00
Anthony Calosa
78d3828f1e Zeth Fixes
Memleaks and others
2016-07-06 16:05:29 +08:00
Anthony Calosa
4505f51fbd Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-06 13:13:40 +08:00
zethfoxster
2ca7b2310b trying to manuelly add changes 2016-07-06 00:43:11 -04:00
zethfoxster
861366dd71 Fixed the memleaks caused by computeNewCost, moved them to gameobserver where affinity takes place, removed repeative code that was in game observer, moved the game observer components into computenewcost, removed the calls for "new mana" in all alternative play type that were added with this function. 2016-07-06 00:02:15 -04:00
Anthony Calosa
4cada08cbe Merge pull request #723 from kevlahnota/master
Deckstats Mana Rendering and Others
2016-07-06 09:09:32 +08:00
Anthony Calosa
1d80d97d22 Shackled highlight border 2016-07-06 07:55:10 +08:00
Anthony Calosa
935849142c replaced alias with shackler 2016-07-06 06:37:27 +08:00
zethfoxster
4e048f775d Merge pull request #8 from WagicProject/master
getting master
2016-07-05 18:37:14 -04:00
Anthony Calosa
f45adb5b9e removed alias 1111 2016-07-06 06:28:42 +08:00
Anthony Calosa
d4cc7ca232 removed alias that display chosen color 2016-07-06 06:21:45 +08:00
Anthony Calosa
51d06d8234 removed alias for overload 2016-07-06 05:23:25 +08:00
Anthony Calosa
16f7ae54b8 Fix Deck Mana Symbol Rendering
deckmanaColors was increased to 7, made this >=6 so it's compatible with
old deck stats
2016-07-06 04:26:01 +08:00
Anthony Calosa
e15734d17e White border for Deckmaster Set 2016-07-06 04:24:07 +08:00
Anthony Calosa
2cb773dd48 Added Yisan and Zameck 2016-07-06 04:23:46 +08:00
Anthony Calosa
09672ce89b Added Delver of Secrets & Tasigur 2016-07-05 23:33:55 +08:00
Anthony Calosa
c476262288 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 17:21:59 +08:00
Anthony Calosa
84c73bb11f Merge pull request #722 from kevlahnota/master
Added some missing reveal cards
2016-07-05 17:09:50 +08:00
Anthony Calosa
f8b5519ced Added some reveal cards 2016-07-05 15:13:19 +08:00
Anthony Calosa
01b7f36750 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 11:50:50 +08:00
Anthony Calosa
759c5222ac Merge pull request #721 from kevlahnota/master
Added C15 and MMA
2016-07-05 10:55:05 +08:00
Anthony Calosa
9847edbce1 Added MMA 2016-07-05 10:07:07 +08:00
Anthony Calosa
19789b6d90 Added Commander 2015 set 2016-07-05 08:22:43 +08:00
Anthony Calosa
7b2ba7f3b1 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 08:20:13 +08:00
Anthony Calosa
9a5ed11c83 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-05 06:34:36 +08:00
Anthony Calosa
3fc8b6fc5c Merge pull request #720 from kevlahnota/master
Add missing cards that uses producecolor
2016-07-05 06:27:19 +08:00
zethfoxster
c018e3dcc2 fixed a ton of memleaks, narrowed down the memleaks to just the computeNewCost function.
still working on a fix for this.
2016-07-04 15:13:35 -04:00
zethfoxster
2b8f1b350c added bonus events for eldrazi and werewolves 2016-07-04 11:18:07 -04:00
zethfoxster
806c82c30c Merge pull request #7 from WagicProject/master
getting master
2016-07-04 10:46:36 -04:00
zethfoxster
76f1591b58 removed WParsedInt "morethanfour", "plusone","plustwo","plusthree"
added 2 things
first plus/plusend, minus/minusend
written many ways damage:type:*:myhandminus2minusend
would deal damage equal to the cards in my hand -2
damage:type:creature:mybattlefieldplustype:creature:opponentbattlefieldplusend
damage equal to the number of creatures in my battlefield plus the number of creatures in opponents battlefield.

now there are special cases where we need to know the value BEFORE applying multipliers. life: is one of them. I added "math/mathend"

auto=@each opponent upkeep:target(opponent) life:-mathtype:*:myhandminustype:*:opponenthandminusendmathend opponent
in the example above, without "math" the "-" would be used for the first section of the minus parsed int, instead of being applied as a multiplier for the total of the number.

this is extremely flexible, and can contain any Wparsed int in both parts, you can add or subtract and use the differences between to values as the value of the parsedInt.
2016-07-04 10:43:07 -04:00
Xawotihs
2a5fc931b6 Should fix pull request Travis error 2016-07-04 16:09:46 +02:00
Anthony Calosa
a392e631d0 Update cards that has both tap and sacrifice 2016-07-04 21:30:42 +08:00
Anthony Calosa
f3da8f7353 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-04 21:07:58 +08:00
Anthony Calosa
fda4d43678 added missing cards Mirari's Wake and the likes 2016-07-04 19:55:19 +08:00
Anthony Calosa
a09868c397 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-04 19:54:32 +08:00
zethfoxster
fdddee415f Merge pull request #6 from WagicProject/master
getting master
2016-07-04 07:04:41 -04:00
Anthony Calosa
d239048817 Added V15 2016-07-04 18:58:41 +08:00
Anthony Calosa
88e146f4ba Added CMA 2016-07-04 18:56:07 +08:00
Anthony Calosa
a709a7fec0 Merge pull request #719 from kevlahnota/master
Fixed Madness, Removed Duplicates, Updated Unsupported, Sorted Primitives & Updated Premium Deck Series
2016-07-04 14:32:18 +08:00
Anthony Calosa
8d5d7bdf8d Update changelog 2016-07-04 14:30:10 +08:00
Anthony Calosa
ffe3317228 Updated and Cleaned Unsupported 2016-07-04 13:28:14 +08:00
Anthony Calosa
71adcb338d Fixed Madness moveto(ownergraveyard) and Remove Duplicates 2016-07-04 12:06:29 +08:00
Anthony Calosa
62b46f6ef5 remove Duplicate 2016-07-04 11:16:12 +08:00
Anthony Calosa
65149ece6c Sorted Primitivs
7-14-2016
2016-07-04 10:34:33 +08:00
Anthony Calosa
b0318f6939 Updated Premium Series 2016-07-04 10:27:08 +08:00
Anthony Calosa
b98fe6bda5 Merge pull request #5 from WagicProject/master
pull new changes from zeth
2016-07-04 10:12:16 +08:00
Anthony Calosa
6e6274a2dd Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-04 09:52:48 +08:00
zethfoxster
52988f154b Merge pull request #717 from zethfoxster/master
Fails but I have no idea why
2016-07-03 21:49:40 -04:00
zethfoxster
b590ea8caa Merge pull request #5 from WagicProject/master
getting master
2016-07-03 21:38:54 -04:00
Anthony Calosa
3c7570aab9 Merge pull request #715 from kevlahnota/master
Updated Sets
2016-07-04 06:18:59 +08:00
Anthony Calosa
3b8c92f5c2 Updated Planechase, Archenemy, Chronicles, Commander 2016-07-04 06:16:57 +08:00
Anthony Calosa
164cf79613 added MM2 2016-07-04 05:37:11 +08:00
zethfoxster
a216a6989b more fixes 2016-07-03 17:07:22 -04:00
zethfoxster
050bf5f73c updated test for new X rules. 2016-07-03 15:24:05 -04:00
Anthony Calosa
8ff94669f2 added C14 2016-07-03 19:39:18 +08:00
zethfoxster
775f9eb6b3 unused variable 2016-07-02 23:44:14 -04:00
zethfoxster
aeff6b60e9 forgot to remove this. 2016-07-02 23:20:51 -04:00
zethfoxster
94989a1109 Merge pull request #4 from WagicProject/master
get master
2016-07-02 23:07:40 -04:00
Anthony Calosa
e1c6c4e6b6 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-07-03 10:46:11 +08:00
Anthony Calosa
48bd49cf2f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-03 10:45:26 +08:00
zethfoxster
385a48bb43 fixed a bug where {t}{s(creature|mybattlefield)} or similar cost were not allowed to select the source to pay for the cost.
as long as the cost are not similar, the source is a valid target.
{s}{s(creature|mybattlefield)}
or
{t}{t(creature)}
or when the card states specifically that the source is not valid such as 
"{t},sacrifice another creature you control:draw a card"
2016-07-02 22:39:45 -04:00
Anthony Calosa
ad2b9a3640 Added Zendikar vs Eldrazi 2016-07-03 09:22:41 +08:00
Anthony Calosa
df249895e6 Added C13 2016-07-03 09:19:43 +08:00
zethfoxster
c7005ef933 cards for commit 2016-07-02 21:08:24 -04:00
zethfoxster
2489be93a3 added setting the value of X as you cast a spell with X.
this does not cover abilities yet.
2016-07-02 13:38:07 -04:00
zethfoxster
fa916c4fab Merge pull request #3 from WagicProject/master
updating from master
2016-07-02 09:08:13 -04:00
Anthony Calosa
a8fcb909fe Added Deckmasters 2016-07-02 20:41:59 +08:00
Anthony Calosa
1262c5e8ff Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-02 20:20:18 +08:00
Anthony Calosa
6edc3bcd02 Merge pull request #714 from kevlahnota/master
Updated Masters, Beginners, Duels and Vault Sets
2016-07-02 19:52:24 +08:00
Anthony Calosa
4e9e709816 Updated Vaults Block 2016-07-02 18:57:52 +08:00
Anthony Calosa
d24bc0cf94 Added V14 2016-07-02 18:57:24 +08:00
Anthony Calosa
a4bb0f40cc Added From the Vault Legends 2016-07-02 18:42:32 +08:00
Anthony Calosa
37d7693e3c Added Elspeth vs Kiora 2016-07-02 18:28:56 +08:00
Anthony Calosa
9fd1c4bb0a Added Speed vs Cunning 2016-07-02 18:21:28 +08:00
Anthony Calosa
9561cea8f9 Added Jace vs Vraska 2016-07-02 18:17:51 +08:00
Anthony Calosa
cfdfe6e567 Updated Duel Decks 2016-07-02 18:06:53 +08:00
Anthony Calosa
c3736f8dd8 Added Heroes vs Monsters 2016-07-02 18:03:40 +08:00
Anthony Calosa
6232c2e894 Added Sorin vs Tibalt 2016-07-02 17:54:54 +08:00
Anthony Calosa
a2cce876db Updated Beatdown and Battle Royale 2016-07-02 16:46:09 +08:00
Anthony Calosa
d3791e1316 Updated Un-Serious Sets 2016-07-02 09:49:34 +08:00
Anthony Calosa
9cbbdc422f Updated Beginner Sets 2016-07-02 09:40:04 +08:00
zethfoxster
f76c28fa64 convoke
other={convoke} name(Convoke)
delve
other={delve}
they might be able to be added directly to the real manacost.

added an ability that grants an ability while the source remains tapped
grant ability grantend...

added dethrone
abilities=dethrone

added support of multitargeting to extra cost, it acts the same as normal multitargeting, repeats dopay() the effects for each.
2016-07-01 21:29:51 -04:00
Anthony Calosa
cabc3e2441 Updated Masters Block 2016-07-02 09:12:43 +08:00
Anthony Calosa
f208e755c2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-02 07:32:27 +08:00
zethfoxster
9841ce32ae Merge pull request #2 from WagicProject/master
get master
2016-07-01 17:01:15 -04:00
Anthony Calosa
4f6456635e Merge pull request #713 from kevlahnota/master
Cleaned and Sorted all Core and Expansion Sets
2016-07-01 22:44:52 +08:00
Anthony Calosa
6dc69ded22 parse "total" cards in set infor 2016-07-01 22:09:08 +08:00
Anthony Calosa
6ce67a95a2 transformed cards as tokens
so they cannot be bought in the deck editor
2016-07-01 22:03:01 +08:00
Anthony Calosa
6cc943d15d Update Shadows over Innistrad Meta 2016-07-01 21:25:42 +08:00
Anthony Calosa
b23314b408 Updated Battle for Zendikar Block 2016-07-01 21:21:48 +08:00
Anthony Calosa
9c32e4d66a Updated Khans of Tarkir Block 2016-07-01 21:16:09 +08:00
Anthony Calosa
1b9ddabcab Updated Theros Block 2016-07-01 20:59:04 +08:00
Anthony Calosa
6259333a70 Updated Return to Ravnica Block 2016-07-01 20:46:18 +08:00
Anthony Calosa
bedb28c073 Update Innistrad Block 2016-07-01 20:29:32 +08:00
Anthony Calosa
65d93267a9 Updated Scars of Mirrodin Block 2016-07-01 19:37:16 +08:00
Anthony Calosa
6ee041b374 Updated Zendikar Block 2016-07-01 19:29:08 +08:00
Anthony Calosa
c46a6d3440 Updated Shards of Alara Block 2016-07-01 19:16:59 +08:00
Anthony Calosa
92fc016f20 Updated Shadowmoor Block 2016-07-01 19:05:39 +08:00
Anthony Calosa
8983ee5239 Updated Lorwyn Block 2016-07-01 19:00:16 +08:00
Anthony Calosa
45291b4f05 Updated Time Spiral Block 2016-07-01 18:52:35 +08:00
Anthony Calosa
6cfbdf2f30 Updated Ice Age Block 2016-07-01 18:12:21 +08:00
Anthony Calosa
44613dc416 token 2016-07-01 17:46:46 +08:00
Anthony Calosa
1f95ff0fe7 Updated Ravnica Block 2016-07-01 17:45:02 +08:00
Anthony Calosa
a939021304 Updated Kamigawa Block 2016-07-01 17:24:32 +08:00
Anthony Calosa
fc88d9b248 Updated Mirrodin Block 2016-07-01 15:45:26 +08:00
Anthony Calosa
46e268e4e3 Updated Onslaught Block 2016-07-01 15:33:09 +08:00
Anthony Calosa
f9f8ccc088 Updated Odyssey Block 2016-07-01 15:16:28 +08:00
Anthony Calosa
78c8e64e81 Updated Invasion Block 2016-07-01 10:14:57 +08:00
Anthony Calosa
ba54bd43aa Update Masque Block 2016-07-01 10:03:57 +08:00
Anthony Calosa
f61542ea6b Updated Urza's Block 2016-07-01 09:54:24 +08:00
Anthony Calosa
21b162b192 Updated Rath Cycle 2016-07-01 09:41:27 +08:00
Anthony Calosa
91e7af4867 Updated Mirage Block 2016-07-01 07:40:58 +08:00
Anthony Calosa
89968bf449 Updated Early Sets 2016-07-01 07:29:36 +08:00
Anthony Calosa
7f2f68ec58 Update all Core Sets 2016-07-01 07:05:47 +08:00
zethfoxster
a5ebfd56e1 Merge pull request #1 from WagicProject/master
trying to update fork to have changes from master
2016-06-30 19:03:06 -04:00
Anthony Calosa
19cb8e3301 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-01 04:53:05 +08:00
Anthony Calosa
a2014be118 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-07-01 03:40:53 +08:00
Anthony Calosa
3cde9a654b Merge pull request #712 from kevlahnota/master
Soulbond Pair Indicator
2016-07-01 03:40:06 +08:00
Anthony Calosa
2f277171d1 Soulbond Pair Indicator
Border Indicator for Paired Cards
2016-07-01 03:05:27 +08:00
Anthony Calosa
43dba06074 Merge pull request #711 from kevlahnota/master
Sorted Primitives
2016-07-01 03:04:27 +08:00
Anthony Calosa
c0737c40a7 Update Changes 2016-07-01 01:01:45 +08:00
Anthony Calosa
beb2eb99fb Sorted Primitives
I sorted this programmatically so the other comments are removed except
for AUTO_DEFINE
2016-06-30 23:04:35 +08:00
Anthony Calosa
62a52745df Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-30 21:36:53 +08:00
Anthony Calosa
25e156297b Merge pull request #710 from kevlahnota/master
Add Vedalken Shackles Ability
2016-06-30 16:59:25 +08:00
Anthony Calosa
fd2aa5d046 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-30 16:21:30 +08:00
Anthony Calosa
547a9fcc17 Add Support for Vedlaken Shackles and the likes
the alias 50120 is there to prevent untap  during untap phase and the
canuntap restriction will trigger if it's possible to untap ie tha card
doesn't have doesnotuntap,, or frozen or is tapped.
2016-06-30 16:18:39 +08:00
Anthony Calosa
90ea36d0fe Update CHANGELOG.md 2016-06-30 15:15:50 +08:00
Anthony Calosa
c3467f7204 Merge pull request #709 from kevlahnota/master
Fix Cascade, Crash fix on lastController and some corrections
2016-06-30 15:10:06 +08:00
Anthony Calosa
e6aafbc8a6 lastController defined when creating copies of itself 2016-06-30 14:06:21 +08:00
Anthony Calosa
76bb777f4d Fix crash when lastController is null 2016-06-30 12:19:58 +08:00
Anthony Calosa
39f6867ab0 Fix Cascade 2016-06-30 09:26:00 +08:00
Anthony Calosa
fbaef2f103 some corrections 2016-06-30 09:21:13 +08:00
Anthony Calosa
db19fa507e Merge pull request #708 from kevlahnota/master
Try to fix IOS Builds
2016-06-29 15:11:14 +08:00
Anthony Calosa
27fd1942d0 Try to Fix IOS Build 2016-06-29 15:03:36 +08:00
Anthony Calosa
975df3625d Corrections 2016-06-29 15:03:24 +08:00
Anthony Calosa
92a37e1e44 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-29 13:09:46 +08:00
Anthony Calosa
cd33754a3c Merge pull request #707 from kevlahnota/master
Updated Primitives and Hide Highlight Border
2016-06-29 12:17:43 +08:00
Anthony Calosa
69d92bc0ea Unused Variable
MTGRules.cpp:1361:11: error: unused variable ‘player’
[-Werror=unused-variable]
2016-06-29 11:38:51 +08:00
Anthony Calosa
6d09c12f93 Try to fix compilation 2016-06-29 11:08:55 +08:00
Anthony Calosa
ba0f4dbcf5 Update changes 2016-06-29 10:54:44 +08:00
Anthony Calosa
e1bf3b4b82 Updated Primitives
Updated cards that use reveal keywords, Updated Borderline and
Unsupported
2016-06-29 10:45:35 +08:00
Anthony Calosa
d647309587 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-29 09:57:00 +08:00
Anthony Calosa
140ee7b183 Hide Highlight Border
When revealing cards, Hide Highlight Border
2016-06-29 08:59:58 +08:00
zethfoxster
745eaf8a17 the following adds 965 cards primitives, I did not alphabetically sort these and can not justify alphabetical sorting as it has no effect on the game engine. 2016-06-28 20:58:52 -04:00
Anthony Calosa
b16e70c363 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-29 08:26:31 +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
0a4da47492 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-27 15:34:49 +08:00
Anthony Calosa
9439b347c9 Merge pull request #705 from kevlahnota/master
CardID Indicator, Add Missing Tokens, Support Importing dck for Android
2016-06-27 09:04:16 +08:00
Anthony Calosa
e24eb30c98 Update Changelog 2016-06-27 09:02:43 +08:00
Anthony Calosa
f53573261e missing tokens 2016-06-27 08:44:13 +08:00
Anthony Calosa
d5b8337121 support importing forge decks 2016-06-26 19:26:52 +08:00
Anthony Calosa
b816facf44 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-26 07:57:52 +08:00
Anthony Calosa
a6a5cf8755 Card Id Indicator
Indicates Card Id, Useful for cards/tokens to determine their correct Id
in the primitives. Its much easier to fix missing images. Update your
modrules.xml
2016-06-26 07:56:07 +08:00
Anthony Calosa
83f7ed56fa Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-26 06:00:07 +08:00
Anthony Calosa
e88edd11af Merge pull request #4 from WagicProject/master
pull 4
2016-06-25 21:20:24 +08:00
Anthony Calosa
0b1be02c38 Update CHANGELOG.md
up to latest commit 6/23/16
2016-06-25 20:52:17 +08:00
Anthony Calosa
b98b8b6f2e Update CHANGELOG.md 2016-06-25 20:32:42 +08:00
Anthony Calosa
154358efd4 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-23 21:14:09 +08:00
Anthony Calosa
63c710047b Merge pull request #704 from kevlahnota/master
Fix  producecolor:color
2016-06-23 18:22:57 +08:00
Anthony Calosa
d0f4eeff1f Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-23 17:44:58 +08: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
7c9d52abbf Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-23 15:50:58 +08:00
Anthony Calosa
cf6eccf565 Update _cards.dat 2016-06-23 05:30:40 +08:00
Anthony Calosa
1499baf8d9 Merge pull request #703 from kevlahnota/master
Change Basic Land Rarity for Modern sets
2016-06-22 20:56:46 +08:00
Anthony Calosa
37a0e95675 Rarity for Basic Lands
Changed to L rarity
2016-06-22 20:39:00 +08:00
Anthony Calosa
fd62705fd7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-22 17:36:39 +08:00
Anthony Calosa
dc5fc2b544 add "files" path
try to fix saving profiles on forcemounted path. Transfer your wagic/res to /Android/data/net.wagic.app/files
2016-06-22 17:00:30 +08:00
Anthony Calosa
70165a8c62 Merge pull request #702 from kevlahnota/master
BFZ, OGW, SOI _cards.dat
2016-06-22 09:14:32 +08:00
Anthony Calosa
68f888baf0 Update _cards.dat 2016-06-22 08:52:12 +08:00
Anthony Calosa
3a8bc599ee Update _cards.dat 2016-06-22 08:51:26 +08:00
Anthony Calosa
9d79021678 Update _cards.dat 2016-06-22 08:28:42 +08:00
Anthony Calosa
7d339ccc23 add soi tokens 2016-06-22 07:04:06 +08:00
Anthony Calosa
3dd839c8bf add plant token 2016-06-21 21:31:51 +08:00
Anthony Calosa
7db5b6fbda added bfz tokens 2016-06-21 21:27:22 +08:00
Anthony Calosa
1b7d199744 Create _cards.dat 2016-06-21 18:37:29 +08:00
Anthony Calosa
6bac099369 Create _cards.dat 2016-06-21 18:34:54 +08:00
Anthony Calosa
d5cc1b970f Create _cards.dat 2016-06-21 18:29:02 +08:00
Anthony Calosa
06f8fb0406 Merge pull request #3 from WagicProject/master
Pull
2016-06-21 18:25:02 +08:00
Anthony Calosa
7b6de7bbd8 Update StorageOptions.java
forcemount if you have forcemount file
2016-06-20 03:03:35 +08:00
zethfoxster
503159ff6f adding hints that seemed to have disappeared 2016-06-19 09:25:41 -04:00
Anthony Calosa
c22c674de1 Merge pull request #701 from kevlahnota/master
Some Fix
2016-06-18 22:36:52 +08:00
Anthony Calosa
de3ce6f676 add description 2016-06-18 21:58:24 +08:00
Anthony Calosa
cd34c4ebdf Modified test
Replenish + other enchantments
2016-06-18 21:55:14 +08:00
Anthony Calosa
ba0cab3743 Revert test 2016-06-18 21:21:08 +08:00
Anthony Calosa
a73030ac9b Overlooked this
Should be fine now, reverted the test
2016-06-18 21:20:30 +08:00
Anthony Calosa
f57bba22cc Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-18 20:22:55 +08:00
Anthony Calosa
e315cad0f5 Revert to previous 2016-06-18 20:22:50 +08:00
Anthony Calosa
3f40a6db4b Update Replenish.txt 2016-06-18 20:06:36 +08:00
Anthony Calosa
eb99680986 Modified 2016-06-18 19:55:58 +08:00
Anthony Calosa
2aa4f2da2d Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-18 12:41:29 +08:00
Anthony Calosa
a48568526b Update _tests.txt 2016-06-18 12:39:20 +08:00
Anthony Calosa
7247abd5f1 Create Show_and_Tell.txt 2016-06-18 12:38:30 +08:00
Anthony Calosa
bae2502d8f Create Replenish.txt 2016-06-18 12:37:52 +08:00
Anthony Calosa
cd645b33b2 Fix for Aura's that are put into play 2016-06-18 12:31:23 +08:00
Anthony Calosa
07ad69c08f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-18 09:12:02 +08:00
Anthony Calosa
6bc7de3370 Minor Fix 2016-06-18 09:11:57 +08:00
Anthony Calosa
f3ca247865 Merge pull request #699 from kevlahnota/master
Force Mounting 2
2016-06-17 17:47:43 +08:00
Anthony Calosa
0167cf052d Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-17 17:03:52 +08:00
Anthony Calosa
9a3b3013a3 Update SDLActivity.java 2016-06-17 17:03:37 +08:00
Anthony Calosa
0f9bbc1561 Update DeckImporter.java 2016-06-17 17:00:44 +08:00
Anthony Calosa
3ef6b3a76a Force Mounting 2
If you have root then most likely you have write access to secondary storage. If not then use the app-specific folder. You may create the folder via built-in file manager > Android/data/net.wagic.app/files/Wagic/Res
2016-06-17 16:58:15 +08:00
Anthony Calosa
3c7ccddfcc Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-17 07:48:15 +08:00
Anthony Calosa
42019917ce Merge pull request #698 from kevlahnota/master
Common color
2016-06-16 19:17:29 +08:00
Anthony Calosa
68b632857d Most Common Color 2016-06-16 18:14:48 +08:00
Anthony Calosa
eaf7b72dc7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-16 17:30:07 +08:00
Anthony Calosa
ff9cc83ef0 Merge pull request #697 from kevlahnota/master
Import Deck Options
2016-06-16 12:14:09 +08:00
Anthony Calosa
4e3dffad98 Import deck options 2016-06-16 11:37:25 +08:00
Anthony Calosa
7662d974b9 Deck Importer 2016-06-16 11:36:23 +08:00
Anthony Calosa
a78bdc4912 Force Mounting
Force mounting sdcard0 and sdcard1 if possible for kitkat and above
2016-06-16 11:31:20 +08:00
Anthony Calosa
6b84de3ccd Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-16 11:29:28 +08:00
Anthony Calosa
fda537635e Merge pull request #696 from kevlahnota/master
Imprint Class
2016-06-16 10:18:01 +08:00
Anthony Calosa
c633ceb695 Current Imprinted card only 2016-06-16 09:48:20 +08:00
Anthony Calosa
a4c536740e Revised Imprint 2016-06-16 09:14:37 +08:00
Anthony Calosa
923ebbc3c8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-16 07:15:35 +08:00
Anthony Calosa
9d79a85b96 Imprint Class 2016-06-16 07:15:24 +08:00
Anthony Calosa
7b972142ba Merge pull request #695 from kevlahnota/master
Block Cost Rule
2016-06-15 23:09:56 +08:00
Anthony Calosa
b38275123a Block Cost Rule
Update rules folder
2016-06-15 22:26:55 +08:00
Anthony Calosa
a2249a7392 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-15 19:08:51 +08:00
Anthony Calosa
c0a6fd2288 Merge pull request #694 from kevlahnota/master
Some changes
2016-06-14 21:31:28 +08:00
Anthony Calosa
149af25d22 fix unused variable error 2016-06-14 20:50:31 +08:00
Anthony Calosa
b33ae0c92f Revised 2016-06-14 19:40:28 +08:00
Anthony Calosa
1f54c7933b Attack Cost Rule
Update your rules folder
2016-06-14 19:40:02 +08:00
Anthony Calosa
26346f5a42 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-14 19:18:33 +08:00
Anthony Calosa
dbf78e2bae Split Cant pay life and Cant sacrifice 2016-06-14 10:06:37 +08:00
Anthony Calosa
9c9da27938 Merge pull request #693 from kevlahnota/master
Fix possible attacker
2016-06-13 20:52:22 +08:00
Anthony Calosa
41e97134ef Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-13 19:40:02 +08:00
Anthony Calosa
97186361a1 Corrections
Fix if you have a defender that can attack, it ,must be a possible
attacker.
2016-06-13 19:39:26 +08:00
Anthony Calosa
2db6635d73 Merge pull request #692 from kevlahnota/master
Some Corrections
2016-06-13 15:57:44 +08:00
Anthony Calosa
9ac1540cdc Corrections 2016-06-13 15:27:33 +08:00
Anthony Calosa
70c0957248 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-12 10:38:55 +08:00
Anthony Calosa
c045811350 Merge pull request #690 from kevlahnota/master
Refactor & Devotion
2016-06-11 22:15:45 +08:00
Anthony Calosa
70bc60104f try to fix compilation
../projects/mtg/include/AllAbilities.h:706: error: suggest explicit
braces to avoid ambiguous 'else'
2016-06-11 21:44:33 +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
4e3543ace7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-11 20:32:24 +08:00
Anthony Calosa
1924ab09da Merge pull request #688 from kevlahnota/master
Fix leak
2016-06-10 14:03:30 +08:00
Anthony Calosa
a74e543429 Fix leak 2016-06-10 13:25:24 +08:00
Anthony Calosa
00f67a57cf Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-10 11:43:52 +08:00
Anthony Calosa
2244e62897 Merge pull request #687 from kevlahnota/master
Combat Toughness
2016-06-10 07:45:17 +08:00
Anthony Calosa
1569353779 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-10 07:05:42 +08:00
Anthony Calosa
40bb9e2c37 Combat Toughness
Assign combat damage equal to its tougness...
Doran, the Siege Tower
2016-06-10 07:05:29 +08:00
Anthony Calosa
c87e2b99d7 Update _tests.txt 2016-06-10 07:04:26 +08:00
Anthony Calosa
4934699ecd Create Doran.txt 2016-06-10 07:03:47 +08:00
Anthony Calosa
c85f3aa7f7 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-10 07:02:30 +08:00
Anthony Calosa
7ea2086ec9 Merge pull request #686 from kevlahnota/master
Removed Unhinged & Unglued from Unsupported
2016-06-10 01:33:14 +08:00
Anthony Calosa
480e0ce9fa removed unhinged, unglued cards 2016-06-10 01:22:53 +08:00
Anthony Calosa
fe14fd0a58 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-09 21:58:48 +08:00
Anthony Calosa
e02e835053 copied abilities 2016-06-09 21:58:22 +08:00
Anthony Calosa
26d88e15c6 Merge pull request #685 from kevlahnota/master
Imprint
2016-06-09 21:05:47 +08:00
Anthony Calosa
5a9c13da86 Merge branch 'master' of https://github.com/kevlahnota/wagic 2016-06-09 20:06:50 +08:00
Anthony Calosa
3ee341cc4e Clone
Fix for issue #448
2016-06-09 20:06:39 +08:00
Anthony Calosa
b9f6a5ab0e Update _tests.txt
test for Clone vs Thistledown Liege
2016-06-09 20:06:09 +08:00
Anthony Calosa
ea03350ab9 Create clone4.txt
Test for issue #448
2016-06-09 20:05:04 +08:00
Anthony Calosa
06fdf3f0a5 Imprint
todo others...
2016-06-09 15:35:59 +08:00
Anthony Calosa
76e7827ebf Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-08 21:57:30 +08:00
Anthony Calosa
6c6f1f23ee Merge pull request #684 from kevlahnota/master
Madness
2016-06-08 11:06:20 +08:00
Anthony Calosa
8c47b666c5 Madness
Added Madness
2016-06-08 10:45:19 +08:00
Anthony Calosa
bad1fc9e09 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-08 08:36:54 +08:00
Anthony Calosa
e4817038c3 Merge pull request #683 from kevlahnota/master
Fix Damage Render
2016-06-07 19:02:03 +08:00
Anthony Calosa
d8e28dad7f Fix damage render 2016-06-07 18:20:30 +08:00
Anthony Calosa
2c7921479a Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-07 17:22:15 +08:00
Anthony Calosa
22a0f945b6 Merge pull request #681 from kevlahnota/master
Couldn't find a way to reduce kicker & multikicker without crashing. Returning to previous will get the bug that you can't activate any ability if you paid a kicker with the options "Choice Offer" or manually. Copying the kicker from put into play fixes it.
2016-06-06 18:16:28 +08:00
Anthony Calosa
1faf2e0694 Cleanup 2016-06-06 17:01:21 +08:00
Anthony Calosa
0376d094cc Apex Hawks is 2/2 Flyer
So it enters with two +1/+1 making it a 4/4 Flyer...
2016-06-06 11:19:30 +08:00
Anthony Calosa
873db7ef27 Revised Kicker 2016-06-06 11:16:32 +08:00
Anthony Calosa
ecd4de48eb Apex Hawks is a 2/2 Flyer
![Apex
Hawks](http://gatherer.wizards.com/Handlers/Image.ashx?multiverseid=382214&type=card)
2016-06-06 11:11:45 +08:00
Anthony Calosa
fb132173bd Kicker
TODO: Auto kicker and Affinity in Kicker....
2016-06-05 20:34:39 +08:00
Anthony Calosa
7ae8434ba3 Correction 2016-06-05 20:32:33 +08:00
Anthony Calosa
edf33d85b0 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-05 19:29:39 +08:00
Anthony Calosa
2ae0a651b8 Cloner/Copier produces same tokens as the copied cards 2016-06-05 17:58:49 +08:00
Anthony Calosa
a4c7da6e20 Merge pull request #680 from kevlahnota/master
Morph, Overload and PayZero costs changes
2016-06-05 14:34:04 +08:00
Anthony Calosa
fbfc712d4c Morph 2016-06-05 13:57:57 +08:00
Anthony Calosa
5196424fbe Overload and PayZero are affected by cost increaser 2016-06-05 13:15:30 +08:00
Anthony Calosa
cd83cfdc87 Removed
Forced Castcard, Suspend and other without paying manacost using these
must be recomputed for costs...
2016-06-05 13:01:55 +08:00
Anthony Calosa
52de1e7b02 Trinisphere
TODO: Morph and Kicker... Morph can be done but how to implement the
increased total cost with kicker? multi kicker? manual kicker??? Count
the mana pool if you can pay the cost+kicker if less than 3 increase
it???
2016-06-05 12:39:11 +08:00
Anthony Calosa
acfdab7dbb Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-05 11:07:15 +08:00
Anthony Calosa
c7731a1bb2 Merge pull request #679 from kevlahnota/master
Updated Missing/Unsupported Cards
2016-06-05 10:54:36 +08:00
Anthony Calosa
f3c31697c8 Updated unsupported , missing
includes missing cards from primitives (borderline, crappy, other cards)
2016-06-05 10:46:54 +08:00
Anthony Calosa
7b6d14779f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-05 05:49:14 +08:00
Anthony Calosa
233cc24c9a Merge pull request #678 from kevlahnota/master
Affinity affects other costs
2016-06-04 23:32:53 +08:00
Anthony Calosa
87515de57f Affinity affects other costs
Affinity should affect other costs such as flashback, buyback,  to cast
since its also a cost reducer...
2016-06-04 21:50:49 +08:00
Anthony Calosa
719a8b3420 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-04 21:34:42 +08:00
Anthony Calosa
6726166d2b Revert
there are cards that can be cast from lbrary
2016-06-04 12:09:48 +08:00
Anthony Calosa
ecc5720007 Merge pull request #677 from kevlahnota/master
Add Sphere of Resistance test
2016-06-04 08:49:43 +08:00
Anthony Calosa
1400f33f64 Update _tests.txt 2016-06-04 08:48:19 +08:00
Anthony Calosa
edb1374c32 Create Sphere_of_Resistance.txt 2016-06-04 08:47:06 +08:00
Anthony Calosa
f1c21dc9a2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-04 08:34:13 +08:00
Anthony Calosa
680ad99c9f Merge pull request #676 from kevlahnota/master
Cost Increaser & Reducer Fix
2016-06-04 00:08:08 +08:00
Anthony Calosa
375589c73d Fix unused variable
AllAbilities.cpp:4172:23: error: unused variable ‘_target’
[-Werror=unused-variable]
2016-06-03 23:28:04 +08:00
Anthony Calosa
ce8e117b0b Fix Cost Increaser, Cost Reducer
Should fix most of them.  TODO: Trinisphere and Morph...
2016-06-03 22:32:10 +08:00
Anthony Calosa
4e12de1629 Merge pull request #2 from WagicProject/master
pull
2016-06-03 21:01:33 +08:00
Anthony Calosa
bd76d40518 Merge pull request #674 from kevlahnota/master
Add Cascade cards
2016-06-03 15:39:17 +08:00
Anthony Calosa
723516f56c Cascade cards 2016-06-03 15:37:17 +08:00
Anthony Calosa
771755c96b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-03 13:23:04 +08:00
Anthony Calosa
0026153a2c Update GameObserver.cpp 2016-06-03 13:21:31 +08:00
Anthony Calosa
f7e0deafca Merge pull request #673 from kevlahnota/master
Fix Cant life change and Seperated Cascade from Depleter class.
2016-06-03 12:19:25 +08:00
Anthony Calosa
be53c68d28 unused variable
AllAbilities.cpp:275:17: error: unused variable ‘counter’
[-Werror=unused-variable]
2016-06-03 11:36:40 +08:00
Anthony Calosa
62fa9acc9f Cascade Class
seperate cascade and fix cant life change :)
2016-06-03 10:40:38 +08:00
Anthony Calosa
0493c4063f Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-03 06:11:47 +08:00
xawotihs
956d0a736d Should fix Macosx build 2016-06-02 20:57:09 +02:00
Anthony Calosa
52dfe654b5 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-02 21:25:58 +08:00
Anthony Calosa
5437bbaf2e Merge pull request #672 from kevlahnota/master
Cascade
2016-06-02 21:11:53 +08:00
Anthony Calosa
f4c17aaf45 Cascade 2016-06-02 20:39:21 +08:00
Anthony Calosa
20e365ea9c Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2016-06-02 20:36:00 +08:00
Anthony Calosa
b407701d94 Merge pull request #671 from kevlahnota/master
Cant life change
2016-06-02 12:51:29 +08:00
Anthony Calosa
ed6755496f parenthesis
try to fix psp build
2016-06-02 12:13:23 +08:00
Anthony Calosa
4530115506 whitespace 2016-06-02 09:13:39 +08:00
Anthony Calosa
aabb905313 Cant life change 2016-06-02 09:10:30 +08:00
Anthony Calosa
aaf2d271bc Merge pull request #1 from WagicProject/master
added abilities= keyword "devoid"
2016-06-02 08:50:37 +08:00
zethfoxster
1369a08863 added abilities= keyword "devoid"
abilities=haste,flying,devoid
would make a flying haste colorless creature.
2016-06-01 18:47:19 -04:00
Anthony Calosa
ac9dfd570a minor skip phase
if there is no possible attacker then skip phase
2016-06-01 18:04:15 +08:00
Anthony Calosa
5cd5f4b38e Fix crash for Deck Menu
Old save with stats should work 👍
2016-06-01 18:03:04 +08:00
Anthony Calosa
57c7796424 Add "Snow" Cards 2016-06-01 12:53:33 +08:00
Anthony Calosa
dd6c1c3d01 Merge branch 'master' of https://github.com/WagicProject/wagic 2016-06-01 10:00:04 +08:00
Anthony Calosa
712fc26d56 Update test
colorless mana changes
2016-06-01 09:55:50 +08:00
Anthony Calosa
fd89d51f84 tidying up 2016-06-01 09:32:28 +08:00
Anthony Calosa
9e50187740 re add the comparison 2016-06-01 09:26:58 +08:00
Anthony Calosa
a36b47e500 try to fix psp compilation
travis error:
../projects/mtg/src/ManaCost.cpp:263:23: error: unused variable
‘counterCheck’ [-Werror=unused-variable]
2016-06-01 09:14:47 +08:00
Anthony Calosa
a454c3e564 Snow
Mana produced by snow permanent
2016-06-01 08:31:19 +08:00
zethfoxster
26b30cb20d ok sorry about the confusion, so the issue was with {1}{c} and how its handled. we only need to replace the adding of colorless in the manapool, the old colorless is still very very valid and should be left in place as is.
{1} can be paid with anything
{c} is a mana supertype, it pays for diamond and colorless. 
however all card such as "sol ring" now add diamond instead of old colorless.

reverted waste to {c}, but moved it under counters to avoid crashes. parse for a counter if its not a counter than parse {c} otherwise we would end up with case where it was parsing {c} instead of building counters or vice versa.
2016-05-31 18:41:36 -04:00
zethfoxster
7639e18c39 whoops heres the other half. tested with following arbor elf test card
[card]
name=Arbor Elf
auto={0}:add{1}
auto={0}:add{r}
auto={0}:name(waste) add{waste}
auto={waste}:life:1
auto={3}:damage:1
auto={1}{waste}:moveto(mybattlefield) target(<2>*|mylibrary)
text={T}: Untap target Forest.
mana={0}
type=Creature
subtype=Elf Druid
power=12
toughness=12
[/card]
2016-05-30 17:46:51 -04:00
zethfoxster
80d0ee4dc3 defining "colorless" waste land mana. 2016-05-30 17:45:21 -04:00
zethfoxster
8a6b4a49f5 deckstats crash when "unlock cards" is used #668 2016-05-30 01:04:55 -04:00
Anthony Calosa
00adb20dc7 super rare loop in ai combos and fix #667
thanks zeth
2016-05-30 01:17:53 +08:00
Anthony Calosa
22d4cbbd1e add "colorless" manacost
The symbol {C} will be used going forward to represent one colorless
mana. The numerical and variable mana symbols ({1}, {2}, and so on,
including {X}) will still be used, but only to represent costs that can
be paid with any type of mana.

example card: To cast Spatial Contortion, you pay two mana: one generic
(that's the {1}) and one colorless (that's the {C}). The generic mana
cost can be paid with any type of mana—that means any color or
colorless. But the {C} is different. That can be paid only with
colorless mana.
2016-05-30 01:16:19 +08:00
Anthony Calosa
1d81c12150 count valid targets any creature 2016-05-29 20:04:51 +08:00
Anthony Calosa
0fed1ba1ab count valid targets
count creature/s that are valid target/s
2016-05-29 19:38:00 +08:00
Anthony Calosa
c472a0215d Bug Fix
Fix send to library as a cost and add support for moving a card to
graveyard as a cost(cards like Void Attendant from Battle for Zendikar)
2016-05-29 17:56:33 +08:00
Anthony Calosa
506adf63c9 fix type
Ajani Steadfast forcefield for play and planeswalker only..
2016-05-29 14:41:31 +08:00
Anthony Calosa
d4715ddc81 ajani steadfast
ajani steadfast emblem
2016-05-29 14:31:29 +08:00
Anthony Calosa
d7fd36ddeb Indicator
Green border indicator for pay zero, can play from exile or can play
from graveyard cards...
2016-05-29 14:29:34 +08:00
Anthony Calosa
e45290e834 Ral Zarek
Fix Loyalty Counter
2016-05-29 12:14:56 +08:00
Xawotihs
e0cf5aa602 Reversed android and Qt apt stuff 2016-05-28 20:18:41 +02:00
Xawotihs
555cf9016f Moved -qq options 2016-05-28 19:47:33 +02:00
Xawotihs
d6ab2e15bf Removed comment 2016-05-28 19:15:21 +02:00
Xawotihs
95cec88742 Replaced Qt ppa 2016-05-28 19:13:45 +02:00
Anthony Calosa
18430dca25 Fix summoning sickness
Cards like control magic (using alias=1194) always resets the summoning sickness, commenting this solves the problem...
2016-05-28 13:47:03 +08:00
Anthony Calosa
8a374f53bc Update appveyor.yml
try to fix appveyor
2016-05-27 10:59:31 +08:00
Anthony Calosa
7a34543004 Nasty memleak crashing devices and its fix. #664
thanks zethfox
2016-05-26 09:42:17 +08:00
Rolzad73
9568fe7d4d Merge pull request #1 from WagicProject/master
Update fork with original
2016-04-14 11:36:57 -04:00
Anthony Calosa
f5d00ddbef Merge pull request #661 from kevlahnota/master
changed alias
2015-11-13 06:48:18 +08:00
Anthony Calosa
cccc21c035 changed alias 2015-11-13 05:45:17 +08:00
Anthony Calosa
090f365cee Merge pull request #660 from kevlahnota/master
Overload Cost
2015-11-10 12:57: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
c6e76d78a2 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-08 21:33:38 +08:00
Anthony Calosa
0d480a67d8 Merge pull request #659 from kevlahnota/master
commented to restart build...
2015-11-08 20:59:03 +08:00
Anthony Calosa
4f9f84fc6a comment unsupported 2015-11-08 20:56:31 +08:00
Anthony Calosa
0f725a02db Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-08 20:56:10 +08:00
Anthony Calosa
71fdbb6564 Merge pull request #658 from kevlahnota/master
produce mana for lands you/opponent could produce
2015-11-08 19:15:28 +08:00
Anthony Calosa
a22991758f mana producer for lands you/opponent could produce
reflecting pool, exotic orchard...
2015-11-08 18:18:33 +08:00
Anthony Calosa
3404eb708d Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-07 21:06:40 +08:00
Anthony Calosa
c9439efcf8 Merge pull request #657 from kevlahnota/master
Aluren & Omniscience
2015-11-07 19:40:53 +08:00
Anthony Calosa
6f4cf9e941 Aluren & Omniscience
MayAbility + resolve instead of
MenuAbility + addtogame for dredge???
2015-11-07 19:16:31 +08:00
Anthony Calosa
c99216c053 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-07 19:13:36 +08:00
Anthony Calosa
e592c331f9 Merge pull request #656 from kevlahnota/master
Manacost Changes, Anyzone for CDA, PayZero Cost
2015-11-07 14:41:25 +08:00
Anthony Calosa
efdc4071da comment 2015-11-07 10:45:54 +08:00
Anthony Calosa
e35c9f6087 AI plays zerocast cards, Update Rules folder!
Its basic pay zero for now...
Omniscience is possible :)
2015-11-07 09:59:30 +08:00
Anthony Calosa
71390046f5 anyzone for cdaactive
should handle most of them except sewer nemesis, chameleon colossus
2015-11-06 19:47:30 +08:00
Anthony Calosa
1c8852a7a2 Manacost Changes
todo: kicker (other possible additional costs?) and change rule keyword
to payzerorule...
2015-11-05 23:25:39 +08:00
Anthony Calosa
536a0e429a AI considers playing from exile and graveyard 2015-11-05 07:17:58 +08:00
Anthony Calosa
4f54e30e0e Libraryeater and Canplayfromexile
extend canplayfromgraveyard with canplayfromexile
libraryeater for undead alchemist
2015-11-05 07:16:49 +08:00
Anthony Calosa
525453d677 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-05 07:13:09 +08:00
Anthony Calosa
6fb4dbdc7b Merge pull request #655 from kevlahnota/master
chooseacolor indicator, increased/reduced cost affects retrace,buyback,flashback
cast in graveyard that have spelltarget types "target=" fix
2015-11-04 07:06:47 +08:00
Anthony Calosa
60ba4e3eeb altercost should affect retrace, flashback, buyback costs 2015-11-04 06:41:59 +08:00
Anthony Calosa
58b032627e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-02 12:21:40 +08:00
Anthony Calosa
7ffab1a821 moved activated copy cards to borderline
the default function of copy function triggers abilities as it comes
onto the battlefield, but these cards are already inplay with their copy
abilities and the enters the battlefield abilities of the copied cards
must not trigger.
2015-11-02 12:21:35 +08:00
Anthony Calosa
7303c7c253 chooseacolor indicator on some cards
alias = 0000 plus chooseacolor ability...
2015-11-02 00:15:58 +08:00
Anthony Calosa
4557748c29 Merge pull request #654 from kevlahnota/master
bug fix
2015-11-02 00:10:02 +08:00
Anthony Calosa
d3cb13cfd8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-11-01 22:36:21 +08:00
Anthony Calosa
1bd3b7743b bug fix 2015-11-01 21:59:54 +08:00
Anthony Calosa
591f7205ed Merge pull request #653 from kevlahnota/master
Exile Zone, Altercost and Hand modifier
2015-10-31 15:46:21 +08:00
Anthony Calosa
3a9b4f3491 parenthesis... 2015-10-31 15:23:39 +08:00
Anthony Calosa
896b12c16b werror init on psp compilation 2015-10-31 15:01:29 +08:00
Anthony Calosa
ba7355a831 moved rebound cards to borderline
until castcard supports increased cost due to altercost...
2015-10-31 11:38:35 +08:00
Anthony Calosa
c580d89c94 Altercost, Exile Zone & Handsize Modifier 2015-10-31 10:59:37 +08:00
Anthony Calosa
8793feb9ba Altercost
Altercost alter cards to be cast...
Removed Trinisphere temporarily...
2015-10-30 07:11:16 +08:00
Anthony Calosa
40db1180df pay zero
todo: all zones
2015-10-29 06:38:59 +08:00
Anthony Calosa
d2f3e2cd60 Castcard, Rebound and other fixes 2015-10-27 19:44:22 +08:00
Anthony Calosa
56fc735b36 Parenthesis
Try to fix PSP compilation
2015-10-27 07:05:57 +08:00
Anthony Calosa
bd5449a9a2 updated old tests
the new exile zone is utilized in comparing the number of cards it
has(since its enabled and viewable, the value is now counted)
2015-10-27 06:35:22 +08:00
Anthony Calosa
4853c8d314 Exile Corrections
Todo: Update tests to include exile card count...
2015-10-27 01:03:24 +08:00
Anthony Calosa
cdf94b281f exile zone
enabled exile zones for both players
2015-10-26 19:14:50 +08:00
Anthony Calosa
8eeaa40cec Merge branch 'master' of https://github.com/kevlahnota/wagic 2015-10-26 06:52:15 +08:00
Anthony Calosa
cf0f9d43fa exile zone
player only, todo opponent and ability activation for exile
2015-10-26 06:50:19 +08:00
Anthony Calosa
0594822872 added card equipped event 2015-10-25 17:55:45 +08:00
Anthony Calosa
46d1e2e703 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-25 12:04:32 +08:00
Anthony Calosa
dd14ee7156 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-23 18:40:08 +08:00
Anthony Calosa
bab0d40c87 Merge pull request #652 from kevlahnota/master
Puresteel Paladin support
2015-10-23 17:07:24 +08:00
Anthony Calosa
378a54fb62 puresteel paladin support
rehook and newhook for equipments inplay...
retarget and newtarget don't support stonehewer basic because the card
is refreshed and stone hewer basic creates equipment/s as tokens...
2015-10-23 15:25:30 +08:00
Anthony Calosa
2d5d367ee6 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-22 19:22:13 +08:00
Anthony Calosa
638c721d32 Merge pull request #651 from kevlahnota/master
added trigger keyword/s to parse current opponent and current controller correctly
2015-10-22 18:20:13 +08:00
Anthony Calosa
f464623d17 curiosity...
2/1/2007 You draw one card each time the enchanted creature damages the
opponent. This is not one card per point of damage.
2/1/2007 If put on your opponent's creature, you do not draw a card when
that creature damages you. The creature has to damage your opponent in
order to have this work.
2/1/2007 Drawing a card is optional. If you forget, you can't go back
later and do it, even if it is something you normally do.
9/22/2011 "You" refers to the controller of Curiosity, which may be
different from the controller of the enchanted creature."An opponent"
refers to an opponent of Curiosity's controller.
9/22/2011 Any damage dealt by the enchanted creature to an opponent will
cause Curiosity to trigger, not just combat damage.
9/22/2011 Curiosity doesn't trigger if the enchanted creature deals
damage to a planeswalker controlled by an opponent.
2015-10-22 17:33:45 +08:00
Anthony Calosa
fe86514fb8 updated primitives @damageof/@damagefoeof 2015-10-22 14:20:52 +08:00
Anthony Calosa
704f7f4494 TrDamaged changes
@damaged/combatdamaged/noncombatdamaged(who) -> static version
@damageof/combatdamageof/noncombatdamageof(player) -> current controller
of the card
@damagefoeof/combatdamagefoeof/noncombatdamagefoeof(player) -> current
opponent of the card

combat/noncombat damaged - done...
TODO: @damaged cards
2015-10-21 22:03:21 +08:00
Anthony Calosa
3b0cd389e5 TrLifeGained changes
@lifed/lifeloss(who) -> static version
@lifeof/lifelostof(player) -> current controller of the card
@lifefoeof/lifelostfoeof(player) -> current opponent of the card
2015-10-21 12:25:08 +08:00
Anthony Calosa
21eea225af TrcardDrawn changes
@drawn(who) -> static version
@drawof(player) -> current controller of the card
@drawfoeof(player) -> current opponent of the card
2015-10-21 10:16:19 +08:00
Anthony Calosa
743c2a6a5e Update _tests.txt 2015-10-21 10:08:55 +08:00
Anthony Calosa
abcb511a57 Create ExchangeController.txt
the current trigger check is static... fix is on the way :)
2015-10-21 10:07:31 +08:00
Anthony Calosa
3669bab210 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-21 10:02:44 +08:00
Anthony Calosa
88b9f83d79 Merge pull request #650 from kevlahnota/master
Persist & Undying ability revised
2015-10-20 22:58:57 +08:00
Anthony Calosa
2178018b18 Persist and Undying goes to the stack 2015-10-20 21:56:49 +08:00
Anthony Calosa
ae4d245232 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-20 19:14:55 +08:00
Anthony Calosa
509b21153f Merge pull request #649 from kevlahnota/master
Persist/Undying Fix, Raid support
2015-10-20 12:02:47 +08:00
Anthony Calosa
7810c65862 added Raid support
thisturn(creature[attacking]|mybattlefield)~morethan~0 only triggers
once... use raid keyword... if raid then blah...
2015-10-20 11:09:57 +08:00
Anthony Calosa
9f8d2b2d46 take 2 2015-10-19 21:48:59 +08:00
Anthony Calosa
3bcb2985f9 try to fix compile error on psp 2015-10-19 20:15:51 +08:00
Anthony Calosa
0d8b2f4a01 persist/undying fix
persist/undying wont trigger when there is a replacement effect for
cards that goes to graveyard like leyline of the void. support  for
anafenza the foremost.
2015-10-19 19:43:07 +08:00
Anthony Calosa
b060c4205c targetter, targetted reset 2015-10-19 11:10:49 +08:00
Anthony Calosa
f90775153c Revert "TrcardDrawn, TrDamaged, TrLifeGained"
This reverts commit c7535e38dc.
2015-10-19 10:19:14 +08:00
Anthony Calosa
17a2d9b4d8 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-19 07:13:28 +08:00
Anthony Calosa
14a68d6ed4 Merge pull request #648 from kevlahnota/master
protection from colored spells & forced menuicons for PSP
2015-10-19 00:11:59 +08:00
Anthony Calosa
c7535e38dc TrcardDrawn, TrDamaged, TrLifeGained
Added trigger restriction for "@trigger(player)
restriction{opponenttrigger/controllertrigger}"

Restriction for:
@drawn
@damaged(combat and noncombat)
@lifed/lifeloss

Why?

When using @drawn trigger like Underworld Dreams
auto=@drawn(opponent):life:-1 opponent

If you take control of Underworld Dreams from an opponent, the
targetchooser for "opponent" is not updated and you are still the
opponent of Underworld Dreams even you take control of it(It is right if
you are the chosen opponent from cards like Black Vise, The Rack, etc...
The chosen opponent never changes. But cards that don't define a chosen
player an "opponent" like Underworld Dreams when an exchanged control
happens, the opponent of the card is the opponent of the one who
controls the card). :P

The new correct code for Underworld Dreams:
auto=@drawn(player) restriction{opponenttrigger}:life:-1 opponent
2015-10-18 22:38:41 +08:00
Anthony Calosa
8c4fabb89a menuicons forced for PSP build 2015-10-18 15:55:10 +08:00
Anthony Calosa
1ad1bf7942 protection from colored spells 2015-10-18 00:20:32 +08:00
Anthony Calosa
4e115a2326 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-17 22:41:54 +08:00
Anthony Calosa
6900e60df0 Merge pull request #646 from kevlahnota/master
Fix issue #473, #784
2015-10-17 21:37:23 +08:00
Anthony Calosa
61881ad656 Fix issue #473 and #784
It seems when a zonechange event from inplay to inplay (player or
opponent), the card->view item values is recalculated... so it destroys
the GUI like missing card image, or moving it far off the screen... To
reproduce, cast Splinter Twin to Conquering Manticore and gain control
the same creature about 2 or 3 times...
2015-10-17 19:44:21 +08:00
Anthony Calosa
d1e64a410b Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-17 16:38:54 +08:00
Anthony Calosa
5e5de03055 Merge pull request #645 from kevlahnota/master
revert guiplay, castcard(putinplay) correction and modified AAcopier
2015-10-17 09:26:58 +08:00
Anthony Calosa
f4bdfa43ca Copied Morphed card 2015-10-16 18:50:05 +08:00
Anthony Calosa
5ede956e7f Reverted GuiPlay
reverted stacking issue
2015-10-16 18:19:42 +08:00
Anthony Calosa
1cd27210ac Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-16 18:19:05 +08:00
Anthony Calosa
2819ec01af token is excluded...
for ABlink
2015-10-16 17:02:37 +08:00
Anthony Calosa
ca113497b2 Merge pull request #644 from kevlahnota/master
Bug Fix: Planeswalker Rule, Populate & ABlink return to play ability for Aura cards
2015-10-15 20:01:00 +08:00
Anthony Calosa
15725c0302 bug fix populate absolute value
forgot to add abs when adding negative bonuses...
2015-10-15 18:03:26 +08:00
Anthony Calosa
851bd88de6 Fix Planeswalker Rule & ABlink 2015-10-15 12:23:32 +08:00
Anthony Calosa
a207936231 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-15 12:22:47 +08:00
Anthony Calosa
9cb40e41fa Merge pull request #643 from kevlahnota/master
Bug Fix: legend rule, profile stat on main menu and aura curse update on player target
2015-10-14 23:24:41 +08:00
Anthony Calosa
0f0bdd7d13 Fix Aura Curse
Aura Curse that targets a player should update its position after
casting.
2015-10-14 22:14:13 +08:00
Anthony Calosa
297206b054 Fix update profile stat after buying cards
profile stats on the upper left of main menu should update after buying
some cards :)
2015-10-14 21:33:12 +08:00
Anthony Calosa
626f0677f7 Fix profile status on upper left of main menu
The profile status on the upper left of main menu should update now when
changing user profiles...:)
2015-10-14 21:26:22 +08:00
Anthony Calosa
7b5b25d113 Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-14 20:04:35 +08:00
Anthony Calosa
3635137906 fix legend rule
704.5k If a player controls two or more legendary permanents with the
same name, that player
chooses one of them, and the rest are put into their owners’ graveyards.
This is called the
“legend rule.”

bury is destroy without regenerate, so when two legends of the same name
has indestructible, bury will have no effect... I changed it to put into
owners graveyard instead using mover...
2015-10-14 20:04:29 +08:00
Anthony Calosa
7ea02a316e Merge pull request #642 from kevlahnota/master
urza lands fix, polished action stack & static mana display
2015-10-13 21:19:47 +08:00
Anthony Calosa
9a66b0c6e4 some fix and polished static mana and action stack
I moved the target quad near the source card and moved the action string
forward so there is no overlapping of action string and the target quad
if the action string is too long...
2015-10-13 19:27:25 +08:00
Anthony Calosa
8fe5000ce1 polished action stack 2015-10-12 19:54:03 +08:00
Anthony Calosa
82fac5f80e Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-12 13:02:57 +08:00
Anthony Calosa
94620504da fix urza lands
the alias is used for checking of "urzatron". revised this because when
using if then else in the activation makes the mana ability goes to the
stack
2015-10-12 13:00:05 +08:00
Anthony Calosa
59cab65fcf Merge pull request #641 from kevlahnota/master
Fix crash bug, support doubled res texture for background, avatars, menutitle
2015-10-12 06:46:53 +08:00
Anthony Calosa
c7b9e6f9b8 fix avatar scaling on guicombat, border on combat 2015-10-11 23:04:28 +08:00
Anthony Calosa
4c86cae7fe disabled wood & gold texture, backdrop size 480x272
blending of wood and/or gold texture on some resolutions(mobile,
tablets, etc) draws line which can be distracting. The backdrop is now
full size of PSP resolution (480x272, 2x res can be loaded like 960x544)
2015-10-11 14:29:36 +08:00
Anthony Calosa
6376596e49 increase battlefield "hot area" size, opponent phase ring uses darker glyph vs human 2015-10-10 20:54:41 +08:00
Anthony Calosa
91053965be Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-10 20:52:37 +08:00
Xawotihs
4f9ee17ff9 Everywhere 2015-10-10 14:35:53 +02:00
Xawotihs
2461b39fb7 Update android SDK to 24.3.4 to try fixing travis 2015-10-10 14:35:22 +02:00
Anthony Calosa
ff7634a8ac Merge remote-tracking branch 'refs/remotes/WagicProject/master' 2015-10-10 20:30:19 +08:00
Xawotihs
6c41ae8e8e Update android build tools to 23.0.1 to try fixing travis 2015-10-10 14:19:22 +02:00
Anthony Calosa
52803cf57c fix crash bug when buying a card pack
This fixes the shop crashing the game when you buy a card packs in the
shop. The targeting indicator looks at the stack so it needs to be
enabled only when you're in the "game"...
2015-10-10 04:59:22 +08:00
Anthony Calosa
03f5ba430c resized
doubled res... you need to replace this with a higher detailed icons...
2015-10-09 21:46:25 +08:00
Anthony Calosa
91e317a497 added placeholder for large icons 2015-10-09 21:17:46 +08:00
Anthony Calosa
a0b4d0f348 added scaling of background 2015-10-09 21:06:58 +08:00
Anthony Calosa
674f4d5062 transformed Planeswalker
When a Planeswalker transforms into a creature, it should be inline on
the battlefield positions along with other creatures.
2015-10-08 11:24:04 +08:00
Anthony Calosa
5cc2f5b645 border p/t 2015-10-08 09:51:52 +08:00
Anthony Calosa
3ca8aefad7 fix bug where walls that can attack activated vs moat in play 2015-10-07 20:59:17 +08:00
Anthony Calosa
1d1b663f55 menutitle scaling
can load 2x res...
2015-10-07 18:10:00 +08:00
Anthony Calosa
6a64b09452 replaced fillroundrect border 2015-10-07 18:08:00 +08:00
Anthony Calosa
c2c9e180ea code cleanup 2015-10-07 11:06:59 +08:00
Anthony Calosa
fb89183767 support scaling of avatar texture - multiples of 35x50
default was 35x50 avatar texture, if using 3x  (105x150), it will scale
it :)
2015-10-07 10:57:08 +08:00
Anthony Calosa
45b570b6f7 border highlighter 2015-10-07 10:53:11 +08:00
Anthony Calosa
8e8e5d8da8 Merge remote-tracking branch 'WagicProject/master' 2015-10-06 10:57:26 +08:00
Anthony Calosa
f59a7872b3 Merge pull request #640 from kevlahnota/master
fix alpha/transparency on rendered border
2015-10-06 10:53:49 +08:00
Anthony Calosa
022c6fccf5 Merge remote-tracking branch 'WagicProject/master' 2015-10-06 10:52:08 +08:00
Anthony Calosa
b750cf1f33 fix alpha/transparency on rendered border 2015-10-06 10:47:08 +08:00
Anthony Calosa
5495d772ea Merge pull request #639 from kevlahnota/master
Visual Targeting Indicator, Borders
2015-10-06 01:21:29 +08:00
Anthony Calosa
664589c642 Visual Targeting Indicator, Borders 2015-10-05 22:03:30 +08:00
Anthony Calosa
6e9c965279 Merge remote-tracking branch 'WagicProject/master' 2015-10-03 21:50:02 +08:00
Anthony Calosa
87e9ed8191 Merge pull request #638 from kevlahnota/master
reverted build
2015-10-03 21:43:01 +08:00
Anthony Calosa
a5a0aa859a reverted build 2015-10-03 21:39:54 +08:00
Anthony Calosa
78693685d8 Merge pull request #637 from kevlahnota/master
revised producemana, added producecolor
2015-10-03 11:27:28 +08:00
Anthony Calosa
f39d4a688a build number 2015-10-03 08:54:18 +08:00
Anthony Calosa
0c30a4ba53 High Tide fix 2015-10-03 08:15:05 +08:00
Anthony Calosa
7db8b89b89 Merge remote-tracking branch 'WagicProject/master' 2015-10-03 07:37:04 +08:00
Anthony Calosa
ec4a9ead74 revised produceextra, added producecolor
producecolor:color look for the mana color when engaged
produceextra:selectmana acts like tappedformana(mytgt) so the ability
must be on the source
produceextra:{color}  ability on the otherhand, the ability must be on
the target
2015-10-03 07:36:52 +08:00
Anthony Calosa
d31f112967 Merge pull request #636 from kevlahnota/master
LKI for power,  toughness and basic abilities,  produceextra ability, stack and life check, reduceto ability
2015-10-02 01:12:38 +08:00
Anthony Calosa
4098c306e2 removed unused variable. 2015-10-01 22:56:42 +08:00
Anthony Calosa
ddee2c08e2 added stack check, modified life check
if activating ability, playing a land or casting sorcery spell at
sorcery level(timing restriction), if the stack is not empty, don't
allow it. Modified the life state check, if any of the players would
lose the game, allow the gamestateeffects to check... added
reduceto:value for ali from cairo...
2015-10-01 22:25:26 +08:00
Anthony Calosa
e1c02c8bf5 produceextra, lki(last known information) for power, toughness and basic abilities 2015-09-30 23:45:54 +08:00
Anthony Calosa
956d21d431 Merge remote-tracking branch 'WagicProject/master' 2015-09-29 22:29:08 +08:00
Anthony Calosa
8b3f474bca Merge pull request #635 from kevlahnota/master
Fix Recover Cards, Cloner, Copier, and Preliminary support for Madness, added converge keyword
2015-09-29 21:29:38 +08:00
Anthony Calosa
8eddcfb639 added converge keyword
converge returns the number of colors spent when casting the spell.
example you pay {2}{W}{W}{R}{B}, converge returns 3, white, black and
red colors spent with...
2015-09-29 15:09:29 +08:00
Anthony Calosa
9b79602134 Moved modifiedbAbi block 2015-09-29 14:31:31 +08:00
Anthony Calosa
0bab560e89 Fix Cloner and Copier abilities 2015-09-29 10:42:29 +08:00
Anthony Calosa
6458b46437 Merge remote-tracking branch 'WagicProject/master' 2015-09-28 21:27:48 +08:00
Anthony Calosa
021343ca02 fix for recover cards, preliminary support for madness 2015-09-28 21:27:27 +08:00
Anthony Calosa
86a5890c36 Merge pull request #634 from kevlahnota/master
life indicators and fix init of vars
2015-09-27 10:12:57 +08:00
Anthony Calosa
04e53f2002 increase the players life indicator(scale to 1.3f), fix init vars
increase the life indicator for players to 1.3f, life indicator for
players changes color according to its value. fix init for vars(should
fix gravecardtypes for tarmogoyf and pbasiclandtypes )
2015-09-27 09:52:35 +08:00
Anthony Calosa
5dccd4b05f Merge remote-tracking branch 'WagicProject/master' 2015-09-27 08:56:31 +08:00
xawotihs
9e77899535 Adds missing breaking macosx compilation without boost 2015-09-26 09:44:11 +02:00
Xawotihs
4185923d04 Replaced C++ types by C ones 2015-09-25 21:46:37 +02:00
Xawotihs
a19ccb6b49 Should fix g++ compilation issue 2015-09-25 21:01:09 +02:00
xawotihs
5ae9d42480 Fixed compilation issue with clang 2015-09-25 20:21:10 +02:00
xawotihs
f282a3346c Merge branch 'no-boost' of https://github.com/WagicProject/wagic into no-boost 2015-09-25 20:04:42 +02:00
Anthony Calosa
ac8881a097 Merge pull request #633 from kevlahnota/master
Ingest and other card fixes...
2015-09-25 19:26:48 +08:00
Anthony Calosa
41daa83e3e Merge remote-tracking branch 'WagicProject/master' 2015-09-25 17:39:48 +08:00
Anthony Calosa
2869460a7f Fixed some card primitives, added support for "other" parsing power, toughness and converted cost, added Ingest
Ingest -> topcard of library to exile
Usage ingest:value
ingest:20 will send the top 20 cards of library to exile
2015-09-25 17:39:35 +08:00
xawotihs
0f168922d8 Fixed compilation issue of config without Qt 2015-09-24 23:47:16 +02:00
xawotihs
b8b5362ba5 Removed dependency on boost when Qt is used. 2015-09-24 23:20:52 +02:00
Anthony Calosa
b4e0f2c991 Merge pull request #632 from kevlahnota/master
Added bypass for notatarget(it should bypass protection and shroud), extend castcard to support putinplay for aura(since aura must have target chooser when put into play by other means), added state based action for aura with invalid targets(ex. local enchantments that enchant creature, then the creature it enchants loses creature types like man lands ... mutavault.)
2015-09-24 19:55:13 +08:00
Anthony Calosa
201b6d9cfa bypassTC turn off 2015-09-24 14:45:26 +08:00
Anthony Calosa
a6ec3e0a68 added type check on aura if the card it enchant is legal 2015-09-24 14:14:00 +08:00
Anthony Calosa
64578787a0 NULL check 2015-09-24 12:14:58 +08:00
Anthony Calosa
d068388e7f added aura targets for castcard putinplay
the special putinplay keyword for castcard is used for aura so we can
"retarget" their intended targets but without casting them instead they
are put onto the battlefield and the ability is not targetted 👍

303.4c If an Aura is enchanting an illegal object or player as defined
by its enchant ability and other
applicable effects, the object it was attached to no longer exists, or
the player it was attached to
has left the game, the Aura is put into its owner’s graveyard. (This is
a state-based action. See
rule 704.)

303.4f If an Aura is entering the battlefield under a player’s control
by any means other than by
resolving as an Aura spell, and the effect putting it onto the
battlefield doesn’t specify the object
or player the Aura will enchant, that player chooses what it will
enchant as the Aura enters the
battlefield. The player must choose a legal object or player according
to the Aura’s enchant
ability and any other applicable effects.
2015-09-24 09:53:10 +08:00
Anthony Calosa
606d18aa6e bypassTC on playertarget 2015-09-24 06:24:17 +08:00
Anthony Calosa
106bcec7cf bypass targetchooser 2015-09-24 06:02:46 +08:00
Anthony Calosa
179e973b4e typo 2015-09-23 21:44:29 +08:00
Anthony Calosa
2223cd4f30 modified castcard to support put into play
for reanimated aura
2015-09-23 21:36:05 +08:00
Anthony Calosa
7db5345f9a attempt to fix "notatarget"
notatarget must be allowed to target untargettable cards.
2015-09-23 12:14:47 +08:00
Anthony Calosa
df659f648e Merge remote-tracking branch 'WagicProject/master' 2015-09-22 21:18:02 +08:00
Anthony Calosa
d7fd079ec4 Merge pull request #631 from kevlahnota/master
Auraward,  unattach event and statebased action for protection from quality
2015-09-22 20:29:28 +08:00
Anthony Calosa
800172f93e Update _tests.txt 2015-09-22 19:49:20 +08:00
Anthony Calosa
2fbfdbcb03 lowercase 2015-09-22 19:48:13 +08:00
Anthony Calosa
ae59e75be1 Create pledge_protection.txt 2015-09-22 19:46:18 +08:00
Anthony Calosa
f01268ef76 Merge remote-tracking branch 'WagicProject/master' 2015-09-22 17:12:00 +08:00
Anthony Calosa
4b9f94c9ae added auraward, added event for unattach, added statebased check for protection from quality
auraward -> an exception for protection from quality used for aura, like
flickering ward
added event for unattach
added state based check for protection from quality.
702.16c A permanent or player with protection can’t be enchanted by
Auras that have the stated
quality. Such Auras attached to the permanent or player with protection
will be put into their
owners’ graveyards as a state-based action.

702.16d A permanent with protection can’t be equipped by Equipment that
have the stated quality
or fortified by Fortifications that have the stated quality. Such
Equipment or Fortifications
become unattached from that permanent as a state-based action, but
remain on the battlefield.
2015-09-22 17:11:40 +08:00
Anthony Calosa
33868eef88 fix typo 2015-09-22 08:18:24 +08:00
Anthony Calosa
11bd885fb4 Merge remote-tracking branch 'WagicProject/master' 2015-09-22 08:14:36 +08:00
Anthony Calosa
0e73168803 Merge pull request #630 from kevlahnota/master
Added ORI cards, Removed Workarounds, Added support for Can't Gain life... spellmastery keyword is used for alternative cost so cards with spellmastery can be cast as though it had flash (substance)...
2015-09-22 07:55:13 +08:00
Anthony Calosa
1eeb42a88d fixed lavinia of the tenth 2015-09-22 07:08:27 +08:00
Anthony Calosa
9ad852558c Merge remote-tracking branch 'WagicProject/master' 2015-09-22 06:55:36 +08:00
Anthony Calosa
227a262e01 added ORI cards :)
revised the keyword:
myname -> returns the number for each instance of the card name you
control.
allmyname -> returns the number for each instance of the card name in
play.
2015-09-22 06:53:55 +08:00
Anthony Calosa
0abd368ccc I think Akroan Conscriptor is supported 2015-09-21 21:38:23 +08:00
Anthony Calosa
f757dcab74 update invigorate and wall of shards
if players can't gain life, you cannot pay costs that have an opponent
gain life also...
2015-09-21 21:25:41 +08:00
Anthony Calosa
28f758e421 Removed Workarounds, Added support for Can't Gain life...
spellmastery - can play as though had flash used in conjunction for
alternative cost.
nolifegain, nolifegainopponent - cannot gain life.
2015-09-21 15:22:28 +08:00
Anthony Calosa
6fba81d7c8 Merge pull request #629 from kevlahnota/master
added M15 cards :)
2015-09-21 13:59:27 +08:00
Anthony Calosa
8543977a2f Merge branch 'master' of https://github.com/kevlahnota/wagic 2015-09-21 12:00:50 +08:00
Anthony Calosa
7b3da0e2c2 added M15 cards :)
added M15 cards and support for cards that use startinglife
keyword(Resolute Archangel)
2015-09-21 12:00:34 +08:00
Anthony Calosa
b16b37e757 Merge remote-tracking branch 'WagicProject/master' 2015-09-21 12:00:24 +08:00
Anthony Calosa
726b087d0d Create _cards.dat 2015-09-21 12:00:02 +08:00
Anthony Calosa
c3fb08da59 Merge pull request #628 from kevlahnota/master
Reverted Random, Disable Indicators on Gametype that is not Classic
2015-09-20 22:48:46 +08:00
Anthony Calosa
725a285e7f Reverted Random 2015-09-20 22:28:08 +08:00
Anthony Calosa
9bf329bd17 I just found this out....
Make the indicator for classic game type. Maybe there is another way to
produce cards by using the function from castcard...
2015-09-20 19:53:49 +08:00
Anthony Calosa
0517a73bfe Merge remote-tracking branch 'WagicProject/master' 2015-09-20 17:37:43 +08:00
Anthony Calosa
a432f5cc3a Merge pull request #627 from kevlahnota/master
PT colors, Token and Cloner Indicators
2015-09-20 15:28:54 +08:00
Anthony Calosa
72b119d622 fix bad lines 2015-09-20 15:25:01 +08:00
Anthony Calosa
18f09ab2ef %c to %s 2015-09-20 14:26:40 +08:00
Anthony Calosa
5985c518f6 buff.c_str() 2015-09-20 14:17:43 +08:00
Anthony Calosa
0dc4dbe642 Merge remote-tracking branch 'WagicProject/master' 2015-09-20 13:19:15 +08:00
Anthony Calosa
0e90426cff Support for Silumgar Assassin, Minor PT color and Token, Clone Indicators
When a creature is damaged and has critical life, PT turns to
red(critical life is 2 and below), if a card has a powered down status
like from -1/-1 counter, the PT turns to thistle, if powered up above 4,
the PT turns into yellow, default is white. legendary eldrazi pt is
violet. Token Indicator is T, and C for cards with copy abilities(so we
can differentiate them from originals), TC for both token and copy cat
cards.
2015-09-20 13:19:03 +08:00
Anthony Calosa
900d045cf0 Merge pull request #626 from kevlahnota/master
PT Switch like Layer 7e and Token Indicator
2015-09-20 00:04:25 +08:00
Anthony Calosa
e9c4d70126 Update _tests.txt 2015-09-19 23:31:18 +08:00
Anthony Calosa
5c93d3e7c4 Create PTswitch.txt 2015-09-19 23:30:11 +08:00
Anthony Calosa
c372ffa111 Switching PT, Token Indicator
Added Switching PT like Layer 7e, Token Indicator for cloned Cards
2015-09-19 23:25:33 +08:00
Anthony Calosa
8e15ad7ed0 Merge remote-tracking branch 'WagicProject/master' 2015-09-19 23:21:22 +08:00
Anthony Calosa
a6f3fb19c8 Merge pull request #624 from kevlahnota/master
Token Cloning fix and colored PT
2015-09-19 15:29:40 +08:00
Anthony Calosa
64c6d19ae7 lowest is 0, typo... 2015-09-19 13:28:14 +08:00
Anthony Calosa
c9d9d3d4d3 Random
I have a profile with 100+ decks and it seems with the previous code,
the random deck seems not random.
2015-09-19 13:05:16 +08:00
Anthony Calosa
e25b78953c other indicators must be somewhere else 2015-09-19 10:29:02 +08:00
Anthony Calosa
81f0c916f5 readjustment 2015-09-19 08:04:26 +08:00
Anthony Calosa
ef690f6438 update pt colors 2015-09-19 07:50:04 +08:00
Anthony Calosa
11124205e5 basic color code on PT
if a creature was damaged or has a negative toughness bonus, the pt
changes to crimson red, if the creature was not damaged and has power
buff, the color changes to spring green, normal was default white.
2015-09-18 20:16:28 +08:00
Anthony Calosa
6cd0474eca Bug Fix on Cloning Tokens 2015-09-18 19:56:02 +08:00
Anthony Calosa
bd89710478 Merge remote-tracking branch 'WagicProject/master' 2015-09-18 11:45:29 +08:00
Anthony Calosa
fc54822b97 Merge pull request #623 from kevlahnota/master
CDA and X manacost on stack
2015-09-18 06:10:24 +08:00
Anthony Calosa
13bb6dbe93 Update Token.cpp
Fix typo
2015-09-18 06:03:53 +08:00
Anthony Calosa
8c9a98e3e9 Update _tests.txt 2015-09-18 05:31:13 +08:00
Anthony Calosa
7ce05fb4fc CDA test # 2 2015-09-18 05:27:48 +08:00
Anthony Calosa
53153b237c CDA test # 1
Testing layer 7a, 7b and 7c :)
2015-09-17 22:50:21 +08:00
Anthony Calosa
478dea6af4 Tidy up a little... 2015-09-17 21:30:55 +08:00
Anthony Calosa
e097d38347 Updated CDA cards 2015-09-17 18:39:33 +08:00
Anthony Calosa
6cba14181d support "other" in type:* parsing
if a card with a cleric subtype has an autoline like this:
othertype:cleric:battlefield, means that the targetchooser excludes that
card, only the other "cleric" are counted.
2015-09-17 11:16:29 +08:00
Anthony Calosa
76c48a8c4e Merge pull request #1 from WagicProject/master
Merged from WagicProject:master
2015-09-17 05:52:33 +08:00
Anthony Calosa
425b51de08 Fix for token cloning
Some tokens when cloned produces miscalculated PT(Using foreach,
aslongas and others that needs CDA). This should fix the issue. TODO:
add tests and updated mtg.txt ...
2015-09-16 20:36:58 +08:00
Anthony Calosa
8e057379ce Finally Fixed... :)
The issue last commit was the toughness is refreshed and the damage is
not reflected. This commit fixes the bug. Yey...
2015-09-16 10:45:43 +08:00
Anthony Calosa
db649ddc96 Added Update on CDA
This controls whether to update Power and Toughness if we are setting
base PT or not. If we are setting base PT update the CDA but it will not
be applied since we have an effect that sets PT to a default base. If
there are no effect that sets base PT, apply it on CDA using
current/updated PT. The buffs are not affected. Yeah...
2015-09-16 09:34:32 +08:00
Anthony Calosa
6aab17d0b3 CDA complete
This fixes the bug I introduced lst time. The damage was not taking into
account, but this time the damage reflects...
TODO/TOFOLLOW: update test and update all cards that uses CDA :)
2015-09-16 06:42:02 +08:00
Xawotihs
fdfb8e0c34 Should fix package upload 2015-09-15 07:58:24 +02:00
Anthony Calosa
72aaa18a35 CDA
CDA works by using "cdaactive" keyword on PT changes. Instead of
granting bonus, we modify the orig power and toughness since they are
dynamic PT. cdaactive are for cards like maro, tarmogoyf, etc. To
Follow/To Do: Additional Tests and other bug fix
2015-09-15 06:35:07 +08:00
xawotihs
07e1c139ba Restored .travis file back to its original state 2015-09-14 23:55:33 +02:00
xawotihs
7df76697e1 Added iOS package upload after successfull build 2015-09-14 23:50:19 +02:00
xawotihs
743b260813 Adds control file 2015-09-13 23:50:21 +02:00
xawotihs
24187b8413 Enable usage of iOS resources from both xcode and theos makefile. Creates iOS package. 2015-09-13 20:54:25 +02:00
xawotihs
acfd0bf104 Merge branch 'master' into iOS-Build 2015-09-13 18:42:31 +02:00
Anthony Calosa
59792b3456 X in manacost is always 0 except on the stack 2015-09-12 19:58:09 +08:00
Anthony Calosa
fb9b0b8166 Added Konda's Banner 2015-09-12 19:37:35 +08:00
Anthony Calosa
11d68c0e27 Separated PT Modifiers, Fixed Changeling, Modified Counter as a cost
CDA Todo
2015-09-12 12:03:52 +08:00
Xawotihs
8b287cca0c Merge pull request #621 from kevlahnota/master
fixed Miscalculated PT, added Offering
2015-09-11 10:02:43 +02:00
Anthony Calosa
38145957af Update _tests.txt 2015-09-11 11:09:02 +08:00
Anthony Calosa
69bdac52c7 Create PT_M15_errata2.txt
Additional test
2015-09-11 11:07:48 +08:00
Anthony Calosa
10d7690ca6 Update PT_M15_errata.txt 2015-09-11 11:05:52 +08:00
Anthony Calosa
b33a999458 Finally PT Calculation is fixed :)
I didn't take into account that the new bonus must be calculated on the
event the effect was destroyed... silly me... 🉑
2015-09-11 10:53:36 +08:00
Anthony Calosa
d3a7ff7e11 reinitialize counters on destroy 2015-09-10 06:04:43 +08:00
Anthony Calosa
c1e9fad271 added basepower and basetoughness
added these two so if we want to access original power and toughness, we
can point to origpower and origtoughness respectively.
2015-09-10 05:26:09 +08:00
Anthony Calosa
9d668342be PT should work fine now... 2015-09-10 00:26:20 +08:00
Anthony Calosa
62dd54c886 Base Power/Toughness Template as of M15
208.4. Effects that set a creature’s power and/or toughness to specific
values may refer to that creature’s
“base power,” “base toughness,” or “base power and toughness.” Other
continuous effects may
further modify the creature’s power and toughness. See rule 613,
“Interaction of Continuous
Effects.”
2015-09-09 22:18:13 +08:00
Anthony Calosa
93ed2b3bff added test 2015-09-09 22:17:37 +08:00
Anthony Calosa
acb0aa0532 Merge remote-tracking branch 'WagicProject/master' 2015-09-08 19:19:31 +08:00
Anthony Calosa
ef707e6d5d added basic offering support
usage tap lands to produce mana then sacrifice an offering... example
you have Guttersnipe in play, it has a mana cost of {2}{R}, and you have
Patron of the Akki in hand that costs {4}{R}{R}. You need to produce
{2}{R} mana first before casting Patron of the Akki, then choose
Guttersnipe as an offering.
2015-09-08 12:26:03 +08:00
Xawotihs
56413c372f Merge pull request #619 from kevlahnota/master
added support for cards like leyline of the void, rest in peace, etc...
2015-09-07 20:09:36 +02:00
Anthony Calosa
a57e919e44 commented out unused variable... 2015-09-07 19:53:16 +08:00
Anthony Calosa
5bdb80db35 added DTK cards :) 2015-09-07 19:52:53 +08:00
Anthony Calosa
3f63997694 morethanfourcards for cards like black vise 2015-09-07 13:40:28 +08:00
Anthony Calosa
022a15a5e9 added epic cards, fixed maxcast bug
maxcast(*)0 - checks for the current action player of that turn, but
when you passes the turn to the opponent, you can cast instant or cards
with flash instead because you are not the current player, it mustcheck
the controller of the card with play restriction if he can play it or
not whether it your turn or the opponents turn.
2015-09-07 10:09:34 +08:00
xawotihs
a6c331042a Removed minizip directory, moved ZipArchive, updated xcode project and iOS makefile 2015-09-06 21:12:15 +02:00
Xawotihs
17f5d8f0c2 Fixed reachability include path 2015-09-05 09:21:42 +02:00
Anthony Calosa
45b880ef76 updated test 2015-09-05 07:23:35 +08:00
Anthony Calosa
da34530d98 added test for Gravebane Zombie 2015-09-05 07:20:28 +08:00
Anthony Calosa
bcb75dac65 updated test 2015-09-05 06:50:33 +08:00
Anthony Calosa
74bba5263a added test for leyline of the void and rest in peace and darksteel colossus 2015-09-05 06:44:10 +08:00
Anthony Calosa
7878252692 support for Rest in Peace
tokens are not cards...
a little dirty...
2015-09-04 23:45:16 +08:00
Anthony Calosa
7af6b31cca Merge remote-tracking branch 'WagicProject/master' 2015-09-04 23:41:37 +08:00
Anthony Calosa
11a9766ba0 adds support for darksteel colossus, gravebane zombie 2015-09-04 16:47:11 +08:00
Anthony Calosa
5175f439a0 add support for yawgmoth's agenda and other similar cards 2015-09-04 12:05:19 +08:00
Anthony Calosa
cbb603818a correction for untap cost
602.5a comprehensive rule as of  6/1/2014
2015-09-04 12:04:17 +08:00
xawotihs
7020121274 Merge branch 'master' into iOS-build 2015-09-04 00:04:59 +02:00
xawotihs
54f7030d68 Moved reachability files 2015-09-04 00:03:47 +02:00
Xawotihs
b9e23fcf95 Merge pull request #618 from kevlahnota/master
Life state check and multicolor attribute
2015-09-03 20:33:01 +02:00
Anthony Calosa
42d0480f77 refactored lifestate check 2015-09-03 20:12:09 +08:00
Anthony Calosa
886eaa4002 Update _tests.txt 2015-09-03 20:10:19 +08:00
Anthony Calosa
fd02e9ab22 Rename projects/mtg/bin/Res/test/bugs/exquisite_blood_i953.txt to projects/mtg/bin/Res/test/exquisite_blood_i953.txt 2015-09-03 20:07:31 +08:00
Anthony Calosa
9fb460c176 life state check on trigger
life state check when players gain or lose life
bugs\exquisite_blood_i953.txt will stop looping
as long as the conditions are met on the check
2015-09-03 07:01:45 +08:00
Anthony Calosa
cbb753ae75 Merge remote-tracking branch 'WagicProject/master' 2015-09-03 06:57:42 +08:00
Anthony Calosa
b2b54b7c5b attribute -multicolor will return single colored cards
use iscolorless to find colorless... :)
2015-08-31 22:03:41 +08:00
Anthony Calosa
29ac95362d multicolor correction
not multicolored is single colored or monocolored not colorless...
colorless has no color...
2015-08-31 19:06:51 +08:00
Xawotihs
9d2d6addb1 Merge pull request #617 from kevlahnota/master
additional test for sac event
2015-08-31 10:45:05 +02:00
Anthony Calosa
7c3f15f79b updated some cards
reflects the changes i made earlier, you can see the steps while running
them in test mode... mortician beetle, thraximundar and savra queen of
the golgari.
2015-08-31 07:51:12 +08:00
Xawotihs
c8e4ec14f0 Update Wagic_Version.h 2015-08-30 23:39:13 +02:00
Xawotihs
e1793fe276 Removed error on unknown warning option 2015-08-30 22:39:44 +02:00
Anthony Calosa
a7bb43278f fix bad lines 2015-08-31 01:51:36 +08:00
Xawotihs
58b5e99979 Fixed typo 2015-08-30 18:17:41 +02:00
Anthony Calosa
915befbb3a update savra 2015-08-30 23:59:05 +08:00
Xawotihs
4cf3f1bcd5 Should fix relative paths 2015-08-30 17:55:02 +02:00
xawotihs
bfeeaeabfb replaced .travis.yml for easier test and added the iOS makefile 2015-08-30 17:27:19 +02:00
Anthony Calosa
410f2d4e69 updated tests 2015-08-30 23:04:50 +08:00
Anthony Calosa
474ad5c0fe additional test for sacrificed event 2015-08-30 23:04:42 +08:00
Anthony Calosa
c2b359ceed Update _tests.txt
Added PTInstant test
2015-08-29 09:42:18 +08:00
Anthony Calosa
5af7de61d0 Added test for power toughness modifier
soul warden must be sent to graveyard due to last gasp before tundra wolves resolves and put onto the battlefield.
2015-08-29 09:35:51 +08:00
Anthony Calosa
7436bf9e64 added ORI _cards.dat 2015-08-27 11:07:18 +08:00
Anthony Calosa
588f7fe2fb remove token workaround 2015-08-26 23:40:30 +08:00
Xawotihs
30f5a49988 Merge pull request #614 from kevlahnota/master
added FRF
2015-08-24 17:56:32 +02:00
Anthony Calosa
2998e95a3b tokenizer should work now for cloning ability
Populate(Put a token onto the battlefield that's a copy of a creature
token you control.)
2015-08-24 22:39:54 +08:00
Anthony Calosa
ac29367ff8 update _tests.txt 2015-08-24 10:05:05 +08:00
Anthony Calosa
dbd7f82eab added tokenizer test 2015-08-24 10:03:34 +08:00
xawotihs
e28dd11b63 Merge branch 'master' into iOS-Build 2015-08-23 22:35:54 +02:00
xawotihs
907274f9bd Fixed cross-compiling with theos 2015-08-23 21:23:55 +02:00
Anthony Calosa
176b74489e added parallel lives
support token doubler... :)
2015-08-23 21:56:23 +08:00
Anthony Calosa
f940f8e303 some corrections
added Induce Paranoia, Draining Whelk
2015-08-22 23:40:31 +08:00
Anthony Calosa
2679213121 added FRF 2015-08-21 17:38:15 +08:00
Anthony Calosa
59c0cf467f serum powder code
serum powder second ability...
Any time you could mulligan and Serum Powder is in your hand, you may
exile all the cards from your hand, then draw that many cards.
2015-08-20 23:11:44 +08:00
Anthony Calosa
5a2637856f Merge remote-tracking branch 'WagicProject/master' 2015-08-20 23:09:12 +08:00
Anthony Calosa
26ecb199d3 Merge remote-tracking branch 'WagicProject/master' 2015-08-20 23:00:56 +08:00
Xawotihs
62d42fb61f Removed local check of mac branch 2015-08-17 23:53:11 +02:00
Xawotihs
19c96e496b More debug 2015-08-17 23:03:53 +02:00
Xawotihs
e982ba50be Removed a suspicous $ from the mac script 2015-08-17 22:27:39 +02:00
Xawotihs
27ad956034 More debug of the mac script 2015-08-17 21:57:29 +02:00
Xawotihs
8c6f694645 Replaced suspicious test 2015-08-16 21:11:41 +02:00
Xawotihs
8ce85636d9 More debug 2015-08-16 20:52:10 +02:00
Xawotihs
07683480b4 build => release => tag => build ... 2015-08-16 18:41:36 +02:00
Xawotihs
7d8fdbfd58 Restored branch removal and added some debug 2015-08-16 18:24:57 +02:00
Xawotihs
2a1cb03484 OMG what a stupid typo 2015-08-16 18:02:22 +02:00
Anthony Calosa
baa90fb605 added Ral Zarek 2015-08-16 14:57:34 +08:00
Anthony Calosa
1b67b736df Merge remote-tracking branch 'WagicProject/master' 2015-08-16 14:29:44 +08:00
Anthony Calosa
e6514a8b33 added gravecrawler
gravecrawler is supported :)
2015-08-16 14:17:26 +08:00
Xawotihs
636b07b350 Try to fix macosx branch deletion 2015-08-15 23:29:47 +02:00
Xawotihs
4b5478530c Merge pull request #612 from kevlahnota/master
Support of "formidable" abilities, added JOU, THS, M14 and fixed various cards.
2015-08-15 21:00:12 +02:00
Anthony Calosa
4a721a7e18 added KTK cards 2015-08-15 23:41:31 +08:00
Anthony Calosa
2470629afd Merge remote-tracking branch 'WagicProject/master' 2015-08-15 22:23:00 +08:00
Anthony Calosa
ccdd16bbc7 Used proper constant 2015-08-15 19:13:48 +08:00
Anthony Calosa
9cf6e621ab Removes viewing of tokens (rarity with T) on Spoiler 2015-08-15 14:51:26 +08:00
Anthony Calosa
94a97a3032 give credits
thanks KF1 and Tacoghandi
2015-08-15 08:18:35 +08:00
Anthony Calosa
f4ef7b9851 added M14 cards 2015-08-15 08:17:21 +08:00
Anthony Calosa
c2be7dd025 Fix M14 card dat 2015-08-15 08:07:36 +08:00
Anthony Calosa
b51dfc7733 added THS cards 2015-08-14 13:19:05 +08:00
Anthony Calosa
9999820a8f added missing cards from theros block 2015-08-13 23:19:20 +08:00
Anthony Calosa
10bc8283ed added JOU cards 2015-08-12 22:40:24 +08:00
Anthony Calosa
66f3ba5a7b removed id collision
avatar token already defined below ajani goldmane
2015-08-12 21:38:19 +08:00
Anthony Calosa
07f0175c5e fix bad line 2015-08-12 21:33:46 +08:00
Anthony Calosa
7376ac382f added missing copy cards 2015-08-12 20:53:30 +08:00
Anthony Calosa
3646219da4 Added missing devotion cards 2015-08-12 20:46:23 +08:00
Anthony Calosa
bfbc073593 added cards 2015-08-12 20:23:46 +08:00
Anthony Calosa
307be96fd6 Added Formidable cards 2015-08-12 20:16:07 +08:00
Anthony Calosa
22f4f21619 Added missing sets 2015-08-12 18:20:03 +08:00
Anthony Calosa
1738e216d0 Delete JOU 2015-08-12 18:05:45 +08:00
Anthony Calosa
567650357f Create JOU 2015-08-12 18:03:46 +08:00
Anthony Calosa
32de6ac124 Minor primitives correction
corrected some typo and added some cards
2015-08-12 17:32:42 +08:00
Anthony Calosa
60f3c87de1 Count Total Power of Creatures you control
example usage:  auto={4}{G}:4/4
restriction{compare(powertotalinplay)~morethan~7}
2015-08-10 22:44:27 +08:00
Xawotihs
d9561118bc Update appveyor.yml
Skip building macosx environment on windows
2015-07-20 22:32:25 +02:00
Xawotihs
228e5342fb Merge pull request #609 from WagicProject/CI-fixes
Ci fixes
2015-07-11 23:47:44 +02:00
Xawotihs
8574154071 Update .travis.yml 2015-07-11 21:58:30 +02:00
Xawotihs
80379ecde5 Update .travis.yml 2015-07-11 21:52:20 +02:00
Xawotihs
31b8ad248f Update .travis.yml
Fixed references to SDK package
2015-07-11 20:03:37 +02:00
Xawotihs
2d02f97f7f Update .travis.yml
Updated android SDK to 24.3.3
2015-07-11 18:51:11 +02:00
Xawotihs
6a37b5e461 Update .travis.yml
And a last one.
2015-07-11 18:36:34 +02:00
Xawotihs
38ed60bf63 Update .travis.yml
Add some \ to try fixing the script
2015-07-11 18:27:23 +02:00
Xawotihs
e664ecfaf5 Update .travis.yml
Updated android build tools to 22.0.1
2015-07-11 18:05:39 +02:00
Xawotihs
e2814c04f4 Merge pull request #607 from WagicProject/coverage
Adds test code coverage support
2014-12-31 13:57:14 +01:00
Xawotihs
8c2836b0c2 Update README.md
Added coverage status
2014-12-29 15:04:00 +01:00
Xawotihs
fcfab4c756 Update .travis.yml
Removed traces
2014-12-27 13:43:38 +01:00
Xawotihs
ddd59c489a Update .travis.yml
trying to fix gcov root
2014-12-27 12:17:03 +01:00
xawotihs
db922a0e77 Activated perf logs with qt console config 2014-12-27 11:47:54 +01:00
Xawotihs
793c4d1d7d Update .travis.yml
Added some traces
2014-12-27 10:39:16 +01:00
Xawotihs
24eab33b6d Update .travis.yml
updating coveralls options
2014-12-27 02:07:38 +01:00
Xawotihs
4985323ad9 Update .travis.yml
Tweaked coveralls config
2014-12-27 01:29:58 +01:00
Xawotihs
9fc551982b Update .travis.yml
Updated android sdk version
2014-12-26 21:23:11 +01:00
xawotihs
8ee67b5af8 Adds coverage support 2014-12-21 22:49:47 +01:00
xawotihs
78ad22479c Added changelog file 2014-12-09 22:18:51 +01:00
Xawotihs
2041aa45f0 Reactivated PSP build 2014-12-08 20:52:04 +01:00
xawotihs
c8b0ce9669 added sudo to install python packages on macosx 2014-12-08 00:10:48 +01:00
xawotihs
11eb6de57e Changed token and redirect push output 2014-12-07 23:33:46 +01:00
xawotihs
c451234bd5 Moved definition of origin 2014-12-07 22:47:04 +01:00
xawotihs
b56862fcf8 Added python dependencies, replaced token and removed "x" option in shell scripts 2014-12-07 22:26:39 +01:00
xawotihs
21a6da91ca Added git remote URL as HTTPS 2014-12-07 21:48:50 +01:00
xawotihs
410108a005 Added email and name to enable git commit 2014-12-07 21:06:53 +01:00
xawotihs
51d5b166a6 Deactivated PSP build and refactored build conditions 2014-12-07 20:29:27 +01:00
xawotihs
1f77243881 Fixed mac build script 2014-12-07 19:48:53 +01:00
xawotihs
f63afb2dd6 Merge branch 'mac-build' 2014-12-07 17:55:25 +01:00
xawotihs
dbe1c6e2ae Moved mac travis file outside of script and update oauth token 2014-12-07 17:26:32 +01:00
xawotihs
6a37425a38 Changed number of processes to 4 2014-12-07 16:48:57 +01:00
xawotihs
02efa4745f Fixed access to mac script and added mac branch to the list of branch authorized to upload binaries 2014-12-07 16:39:15 +01:00
xawotihs
e78754bcd5 Fixed mac script call 2014-12-07 16:24:39 +01:00
xawotihs
16dcf3cc5e - Moved scripts in tools directory
- Added a Mac cross-compiling script
2014-12-07 16:02:56 +01:00
xawotihs
03d168f972 Added MacOS bundle creation in Qt .pro file 2014-12-06 15:13:45 +01:00
Xawotihs
6f6c8b0eb6 Merge pull request #606 from kevlahnota/master
Fix for guild_keywords Devotion, added some "Chroma" cards
2014-12-05 07:47:37 +01:00
Anthony Calosa
fa14219e12 Fix for Devotion, added some "Chroma" cards 2014-12-05 10:18:05 +08:00
Xawotihs
15cd86fad1 Add traces at the end of the upload 2014-12-04 22:51:38 +01:00
Xawotihs
56ccebb720 Merge pull request #605 from kevlahnota/master
added guild keywords, added specific life cost
2014-12-03 07:37:55 +01:00
Anthony Calosa
8ef3789970 reverted sacred foundry 2014-12-03 07:54:13 +08:00
Anthony Calosa
ed7769c373 Revert "update sacred_foundry_i275.txt"
This reverts commit 5745006c35.
2014-12-03 07:47:00 +08:00
Anthony Calosa
5745006c35 update sacred_foundry_i275.txt 2014-12-02 19:19:05 +08:00
Anthony Calosa
16b243c52a Added bng cards to the main primitives. Removed bngGods.txt 2014-12-02 10:39:53 +08:00
Anthony Calosa
bc91eaf5ca updated card primitives that supports specific life cost 2014-11-29 07:10:02 +08:00
Anthony Calosa
6962d1e888 added cards, needs more testing before merging with the main primitives 2014-11-29 06:58:33 +08:00
Anthony Calosa
4d1e8dfb36 Update bngGods.txt
9/15/2013 	The type-changing ability that can make the God not be a creature functions only on the battlefield. It’s always a creature card in other zones, regardless of your devotion to its color.
2014-11-28 15:31:24 +08:00
Anthony Calosa
6ff6f95044 added Xenagos, God of Revels and Phenax, God of Deception for test purpose. 2014-11-28 14:34:37 +08:00
Anthony Calosa
5369983b35 Added BNG set 2014-11-28 14:19:04 +08:00
Anthony Calosa
46a8041c48 Added guild keyword gruul test for Xenagos, God of Revels. You must have Born of the gods set (BNG) 2014-11-28 14:00:58 +08:00
Anthony Calosa
84185a7c78 Added specific life cost test for griselbrand. Pls read note. 2014-11-28 13:35:13 +08:00
Anthony Calosa
4f41248978 Added specific life cost. if we use {l}{l}{l} to pay 3 life, and you have 2 life, you cannot afford to pay the cost but instead the game allows it. if we use specific life cost like: {l:3}, the restriction works. 2014-11-27 14:38:55 +08:00
Anthony Calosa
92d52a78be Update ExtraCost.cpp 2014-11-27 14:33:43 +08:00
Anthony Calosa
a76594046b Update ExtraCost.h 2014-11-27 14:31:25 +08:00
kevlahnota
2214ec66f1 Update AllAbilities.h
keywords for the "gods", "azorius" returns value of devotion to blue and white. ex. auto=azorius/dimir ueot
2014-11-27 11:31:19 +08:00
xawotihs
b8da46ac18 Fixed phonon support. 2014-11-23 16:27:18 +01:00
xawotihs
d656730d3a Fixed phonon support 2014-11-23 16:24:36 +01:00
xawotihs
2f230e4b38 Added buyback.txt to the list of automatic tests 2014-11-23 16:23:18 +01:00
xawotihs
494f64acbd Merge branch 'apollovy-master' 2014-11-23 14:32:02 +01:00
xawotihs
50978200d4 Merge branch 'master' of https://github.com/apollovy/wagic into apollovy-master 2014-11-23 14:30:17 +01:00
xawotihs
a38e1daec7 Updated Android build tools to 21.1.1 2014-11-23 12:44:22 +01:00
Yuriy A. Apollov
57a26b4583 Add test for buyback case. 2014-11-18 06:58:38 +03:00
Yuriy A. Apollov
c018c8fcd1 Fix buyback payed once stayed forever. 2014-11-18 06:51:40 +03:00
xawotihs
3ba4aca8bc Fixed stupid bug in python release creation 2014-08-25 22:16:12 +02:00
xawotihs
870f6e3b58 Fixed python typo 2014-08-25 00:27:40 +02:00
xawotihs
83e0869548 Updated python upload code to re-create new release 'latest-master' for each master commit 2014-08-25 00:02:46 +02:00
xawotihs
90b08db038 Updated travis to use python uploading script 2014-08-24 19:45:18 +02:00
xawotihs
c888e143a1 Fixed python typo 2014-08-24 18:46:42 +02:00
xawotihs
4e727bc164 Fixed python typo 2014-08-24 18:23:08 +02:00
xawotihs
b37afadb01 Fixed typo. 2014-08-24 17:59:04 +02:00
xawotihs
2c2744f6fb Fixed python issue 2014-08-24 17:40:05 +02:00
xawotihs
db2b2fa3b5 Replaced \ by / 2014-08-24 17:07:00 +02:00
xawotihs
0127f7aab9 Tries to activate automatic artifact deployment to github release from appveyor 2014-08-24 16:07:26 +02:00
Xawotihs
ce41791fa4 Remove broken comments 2014-08-23 09:36:46 +02:00
Xawotihs
ec4be4f6b1 Uses real python path 2014-08-23 00:53:33 +02:00
Xawotihs
f82d89b3db Removed empty environment section 2014-08-23 00:47:30 +02:00
xawotihs
202175f2a7 First appveyor script and python windows package build file 2014-08-22 23:26:03 +02:00
xawotihs
d7628b3eb2 Fixed console with Qtmultimedia 2014-08-03 12:20:45 +02:00
Xawotihs
7560db571c Trying without HTTPS to speed up SDK update 2014-08-03 11:43:55 +02:00
Xawotihs
775143355d Add lib pulse-dev 2014-08-03 01:51:41 +02:00
Xawotihs
846ba30821 Tries to fix android sdk update issue 2014-08-03 01:34:53 +02:00
Xawotihs
ad88592229 Replaced pulse-dev with pulseaudio 2014-08-02 23:44:40 +02:00
Xawotihs
6b90956af1 Adding pulse 2014-08-02 23:35:25 +02:00
Xawotihs
26e905a36e Update Androi build tools to 20.0.0 2014-08-02 23:16:22 +02:00
xawotihs
1a9ff38f0c Merge branch 'qtMultimedia' of https://github.com/WagicProject/wagic into qtMultimedia 2014-08-02 21:07:12 +02:00
xawotihs
8b22d032cd Fixed QT version needed for pixelRatio API 2014-08-02 21:05:55 +02:00
Xawotihs
8d58baf4a3 adding qtmultimedia in apt-get 2014-08-02 19:38:11 +02:00
Xawotihs
a447a0c9af Trying with --all 2014-08-02 19:22:38 +02:00
xawotihs
555fb3ae93 Updated Qt building scripts to use qt5 qmake and no fmod 2014-08-02 18:54:28 +02:00
Xawotihs
7053531a4d Added qmake qt5 configuration 2014-08-02 18:37:53 +02:00
Xawotihs
7d4e5177b9 Reordered actions from install to before_install 2014-08-02 18:15:45 +02:00
Xawotihs
06f30eca3a Upgraded travis to use qt5 2014-08-02 17:50:45 +02:00
xawotihs
ac5c14b977 Fixed QtMultimedia port, replaced QSoundEffect by QMediaPlayer as all codecs were not supported by first class. 2014-08-02 17:12:19 +02:00
xawotihs
c3d810bd3b Merge branch 'master' into qtMultimedia 2014-08-02 16:16:19 +02:00
xawotihs
1e24f25c18 Fixed repository against Qt5.3.1 2014-08-02 15:56:52 +02:00
xawotihs
28db884498 Cleaned up cross-compiling travis stuff 2014-07-26 19:45:59 +02:00
xawotihs
36ecc1ffef Cleaned up cross-compiling travis stuff 2014-07-26 19:38:14 +02:00
Xawotihs
9ec6803a02 Merge pull request #602 from WagicProject/feature/ios-update-xcode5.1
Feature/ios update xcode5.1
2014-07-24 23:08:39 +02:00
xawotihs
e87996a7f2 Deactivate window cross-compiling build 2014-07-23 23:20:54 +02:00
xawotihs
f2a5273029 Activating logs on android issue 2014-07-23 22:22:06 +02:00
xawotihs
9bc750da9a Upgrade Android SDK to r23.0.2 2014-07-23 22:05:02 +02:00
Xawotihs
539c5bd18a Trying to fix android build 2014-07-23 20:53:25 +02:00
Xawotihs
bdc1ada090 Update README.md
Added build status on AppVeyor
2014-07-23 00:17:07 +02:00
Michael Nguyen
2efc24a1ce Merge branch 'develop' into feature/ios-update-xcode5.1 2014-04-13 11:50:16 -07:00
Michael Nguyen
63561e6122 update Xcode build preferences as recommended by XCode. 2014-04-13 11:39:40 -07:00
Michael Nguyen
d2390b1227 updated project file for iOS to work with current codebase
- added missing source/headers (GameView.h, CarouselView.h, etc )
- removed dependency on admob static library
- removed CardEffect.h and CardEffect.cpp from project reference
- removed -no_implicit_dylibs flag (apparently no longer supported)
- added -fno-objc-arc (turns off ARC compilation for entire project)
- added -DTIXML_USE_STL
2014-04-13 08:34:21 -07:00
Michael Nguyen
d0799ea3f2 updating to latest code from master
Merge branch 'master' into develop
2014-04-13 08:26:53 -07:00
Xawotihs
44cbfbb1fb Merge pull request #601 from ZobyTwo/cleanup_3
Remove dead code and fix circular initialization
2014-03-13 20:20:12 +01:00
Tobias Loose
b078dd1f6a Fix android makefile 2014-03-11 17:31:25 +01:00
Tobias Loose
225dd23753 Fix makefile 2014-03-11 17:19:05 +01:00
Rolzad73
51b4755242 Update README.md
Added sample play-through video link
2014-02-05 23:39:57 -05:00
Tobias Loose
8f233b3027 Avoid circular initialization 2014-02-03 19:44:51 +01:00
Tobias Loose
197540763e Remove unused Effects.h/.cpp and class Effect
There was an empty vector of effect* in PlayGuiObject.
2014-02-03 13:52:40 +01:00
xawotihs
5d7667dc01 Cleaned Phonon vs QtMultimedia config 2014-01-31 21:53:27 +01:00
xawotihs
18383579e9 Fixed android compilation 2014-01-27 06:31:23 +01:00
xawotihs
03d4f8ffa1 Added Qt Multimedia support in order to replace Phonon. Currently does not work on Mac. 2014-01-26 23:56:15 +01:00
xawotihs
30d92eb68c Should fix issue #497 with the broken freezing the game. 2014-01-18 22:50:16 +01:00
xawotihs
6e6a0fd5c2 OMG I so hate shells 2014-01-18 16:00:14 +01:00
xawotihs
cd4a980182 More debug 2014-01-18 15:26:09 +01:00
xawotihs
aad54fd98d Adds debug in build script 2014-01-18 14:57:23 +01:00
xawotihs
6b7a49506c Should fix the stringifying issue 2014-01-18 14:23:26 +01:00
xawotihs
7ecf67c176 And again 2014-01-18 13:37:43 +01:00
xawotihs
77aeb2d0ac Fixed release name 2014-01-18 13:29:50 +01:00
xawotihs
7a9f989104 Adds some URL error log 2014-01-18 12:46:27 +01:00
xawotihs
ae06bebd24 Merge branch 'github_downloader' 2014-01-18 12:11:08 +01:00
xawotihs
042fb7b376 Tries to fix Android compilation 2014-01-18 11:18:27 +01:00
xawotihs
c3583ade01 Updated resource name and URL for android project 2014-01-17 23:25:48 +01:00
xawotihs
f97d9805dd Removed build number in released filename and added computation of resource URL based on release name. 2014-01-17 21:50:10 +01:00
xawotihs
1d33de59a9 Fixed compilation issue 2014-01-12 22:56:53 +01:00
xawotihs
0c4b09891b Removed hardcoded testing values and used 32 bits file size instead of 64 bits. 2014-01-12 22:40:45 +01:00
xawotihs
25955303e7 Adds a Downloader component to JGE able to download and cache files. 2014-01-12 22:16:35 +01:00
Rolzad73
27b75eecb0 Merge pull request #600 from WagicProject/android_build_update
update android build tools version
2014-01-09 12:33:11 -08:00
Rolzad73
e40921cf13 update android build tools version 2014-01-09 14:57:06 -05:00
Rolzad73
083cebcc7e updated credits text 2014-01-09 14:46:58 -05:00
Rolzad73
a722736335 Merge pull request #599 from WagicProject/android_travis_explicit
Attempt to make android tools fetching for TravisCI explicit and futureproof
2014-01-08 08:40:47 -08:00
Rolzad73
c483c20c81 attempt to make android tools fetching for TravisCI explicit and futureproof 2014-01-08 11:14:47 -05:00
Dmitry Panin
dec1caa43c Revert "Fixed issue with multiple basic abilities in TargetChooser"
This reverts commit d9816c7ad0.
2014-01-04 18:40:59 -08:00
Dmitry Panin
9526e22118 Fixed grave pact 2014-01-04 18:14:15 -08:00
Dmitry Panin
d9816c7ad0 Fixed issue with multiple basic abilities in TargetChooser
E.g. card create[trample;haste] wasn't handled properly
2014-01-04 18:13:22 -08:00
Dmitry Panin
8e327a27df Fixed formatting 2014-01-04 18:13:22 -08:00
xawotihs
43fe67d7d8 Adds executioners_swing tests in _tests.txt 2013-12-31 18:38:30 +01:00
Xawotihs
a63991bb4e Merge pull request #598 from bjornsnoen/master
Damager keyword
2013-12-31 09:11:20 -08:00
xawotihs
b09db0c60f Removed c++11 warning. 2013-12-22 21:26:06 +01:00
Bjørn Snoen
928ca3497a More code compliance. New tests. 2013-12-21 19:31:32 +01:00
Bjørn Snoen
60219411f6 Coding style compliance 2013-12-21 14:33:44 +01:00
Bjørn Snoen
642f5bb515 Fixed indentation mistakes 2013-12-21 11:18:18 +01:00
Bjørn Snoen
20e878a102 Made damager keyword work. Fixed Executioner's Swing in mtg.txt 2013-12-21 11:05:15 +01:00
xawotihs
da31371d86 Include c++11 threading 2013-12-20 18:39:02 +01:00
xawotihs
0df408793a Tries to fix android sdk installation in Travis 2013-12-20 14:09:30 +01:00
xawotihs
9630bcd56b Removed file wrongly added. 2013-12-20 12:37:25 +01:00
xawotihs
3c38e21b25 Merge branch 'master' into Qt5.2_macx 2013-12-20 11:14:10 +01:00
xawotihs
caec886e22 Fixed issues found by XCode. 2013-12-20 00:24:08 +01:00
Dmitry Panin
927f8955e9 Merge pull request #596 from bjornsnoen/master
Fix a rarity mistake and a grammatical error
2013-12-19 02:44:38 -08:00
Bjørn Snoen
d4e0296d2b Fixed wrong rarity on millstone in M14 2013-12-18 09:37:20 +01:00
Bjørn Snoen
8eb664f93d Fixed grammatical then/than error. 2013-12-18 05:50:30 +01:00
xawotihs
b180c3d1a7 Fixed Qt5 mingw32 build 2013-12-16 22:11:28 +01:00
Dmitry Panin
db9f18a644 Added _cards.dat for M14 (taken from forum) 2013-12-15 22:39:08 +04:00
xawotihs
95805ea387 Fixed QT mingw cross compile with QT4.8 2013-12-15 00:26:04 +01:00
xawotihs
4765890d0a Fixed mouse input with retina display 2013-12-14 23:46:23 +01:00
Xawotihs
2e13f29945 Update README.md 2013-12-14 19:13:26 +01:00
xawotihs
22b1c3b5d8 Fixed zip permission while rezipping PSP package 2013-12-14 14:40:26 +01:00
xawotihs
c7bae65697 Fixed core unzip 2013-12-14 13:18:11 +01:00
xawotihs
2381f0306c Fixed paths 2013-12-14 12:06:51 +01:00
xawotihs
b12e15e4ff Tries to arrange a bit the PSP binary package to make it more usual for users. 2013-12-14 11:55:12 +01:00
xawotihs
9e21751e12 Fixed windows build upload 2013-12-13 22:54:40 +01:00
xawotihs
db60c38eda Added windows build 2013-12-13 23:07:17 +01:00
xawotihs
1a4327a2e6 Fixed mingw32 build linking 2013-12-13 21:54:43 +01:00
xawotihs
88095c67b8 Fixed mingw32 compilation 2013-12-13 21:27:40 +01:00
xawotihs
ec34380668 Fixed mingw gcc package name 2013-12-13 00:12:32 +01:00
xawotihs
89dcd6c71d Added some windows cross compiling of the Qt flavor. 2013-12-12 17:54:43 -05:00
Dmitry Panin
fd3cf574cf Remove previous tag "latest-master" before uploading new one 2013-12-12 21:08:39 +04:00
Dmitry Panin
f21452feec Fixed some Cards:
Rune-Tail, Kitsune Ascendant
Shifting Sky
Flourishing Defenses (thanks to Shadowfireomega)
2013-12-12 20:11:35 +04:00
Dmitry Panin
0f85471216 Enabled automatic releases for each commit in master 2013-12-12 02:20:14 +04:00
Tobias Loose
5d92553017 Fix bug where the phase wheel got out of sync
The phase wheel messures phases within another unit and not
mtg phases. It is important to map between those
2013-12-11 01:53:05 +01:00
xawotihs
f0e6d820c7 Fixed GuiPhaseBar logics. 2013-12-10 22:23:28 +01:00
xawotihs
545fc21260 Merge branch 'more_easing' of https://github.com/ZobyTwo/wagic into ZobyTwo-more_easing 2013-12-10 20:35:47 +01:00
Xawotihs
8b68568106 Merge pull request #585 from bjornsnoen/master
Added Avatar Tokens created by Ajani Goldmane.
2013-12-10 11:12:33 -08:00
xawotihs
739a5d9e2b Removed env traces and change the secure token as it was exposed. 2013-12-09 22:39:25 +01:00
Tobias Loose
4c627f74b6 Add easing to GuiPhaseBar, simplify math a bit. 2013-12-09 22:20:43 +01:00
Tobias Loose
1e610ff653 Add InQuadEasing and OutQuadEasing and make tasklists...
easing more natural
2013-12-09 22:20:43 +01:00
Tobias Loose
5d6557a49f Add easing to task list and fix a bug where
opening the task list a second time was not possible
2013-12-09 22:20:43 +01:00
xawotihs
7528329a58 Add more debug in travis script 2013-12-09 21:54:55 +01:00
xawotihs
c62597dce5 Add some debugging to Travis script 2013-12-09 21:43:26 +01:00
Xawotihs
d8dfcdba67 Merge pull request #583 from ZobyTwo/deck_viewer_1
Cleanup, usability fixes and source code documentation for DeckView.h and GridDeckView.h
2013-12-09 11:51:40 -08:00
Bjørn Snoen
7b5f00260b Added Avatar Tokens created by Ajani Goldmane. 2013-12-09 16:55:31 +01:00
Tobias Loose
f9dc551942 Fix logic error in grid view 2013-12-08 23:05:06 +01:00
Tobias Loose
718ceca919 Do not allow that the selection moves outside in grid view. 2013-12-08 22:43:03 +01:00
xawotihs
89fb76a8e7 Updated scripts to remove any modified artifacts from Res directory.
Not doing it causes side effects on the testsuite.
2013-12-08 12:16:25 +01:00
Tobias Loose
1cc65ab611 Enable rotating over multiple filters, add src code doc 2013-12-08 12:03:13 +01:00
xawotihs
3b22354ad9 Fixed testsuite 2013-12-08 11:36:18 +01:00
Tobias Loose
2b9977a334 Rename methods for consistency and add source code doc
to DeckView.h
2013-12-08 10:48:15 +01:00
Tobias Loose
12c5f31562 Add a buttonMode to grid view to enable it on pointerless devices. 2013-12-08 09:11:44 +01:00
xawotihs
8cfd887375 Fixed upload script 2013-12-08 01:10:29 +01:00
xawotihs
292bf7b1d2 Merge branch 'ci_upload_binaries' 2013-12-08 00:33:42 +01:00
xawotihs
4041fe690b Create a release and parse its ID using jq. 2013-12-08 00:16:52 +01:00
xawotihs
cb73e2b90d Merge branch 'master' into ci_upload_binaries
Fixed Windows compilation.
2013-12-07 22:08:54 +01:00
ZobyTwo
a1fa36a934 Merge pull request #578 from ZobyTwo/deck_viewer_1
Reset positions and filters when reopening the editor. These changes are trivial so I will merge them.
2013-12-07 11:53:16 -08:00
Tobias Loose
bdd0e6c042 Reset positions and filters when reopening the editor 2013-12-07 20:47:50 +01:00
xawotihs
ee217e94a8 Fixed carousel pull request with Visual Studio. 2013-12-07 20:29:42 +01:00
xawotihs
38e19f7d35 Removed mingw32-qt
Merged SDL and QT .pro files
Removed glu dependency in corewrapper and JGfx to enable mingw cross compilation.
2013-12-07 18:57:57 +01:00
xawotihs
0bbfd00d15 Tries to install mingw32-qt on Travis 2013-12-07 18:31:02 +01:00
Tobias Loose
aaceb3c038 Remove unused declaration 2013-12-07 13:33:16 +01:00
Tobias Loose
5efa7e10bd Remove test debug output. Fix HUD fading. 2013-12-07 13:01:14 +01:00
Tobias Loose
14c164364e Cleanups and state reduction.
This mainly moves datamembers around and tries to avoid caching of
results of calculations when the calculations are cheap.
2013-12-07 12:58:20 +01:00
Tobias Loose
4514725aba Make the eased value a reference and add source code doc to Easing.h
This allows to apply multiple easings to the same variable.
2013-12-07 10:05:26 +01:00
Tobias Loose
2b0f50bb88 Remove redundancy and make control flow a bit simpler 2013-12-07 09:04:24 +01:00
xawotihs
a65fc0c0f0 Merge branch 'master' into ci_upload_binaries
sudo pip installation of pyjavaproperties
2013-12-06 22:52:32 +01:00
xawotihs
99db363253 Uses pip to install pyjavaproperties 2013-12-06 22:41:09 +01:00
xawotihs
c25dfec67e Fixed python module installation 2013-12-06 22:17:19 +01:00
xawotihs
dd7210d187 Install pyjavaproperties in travis. 2013-12-06 21:59:29 +01:00
xawotihs
904b7a6d86 Build and upload core resource package 2013-12-06 21:21:01 +01:00
Tobias Loose
31b353c5ec Use easing within the carousel view sliding 2013-12-06 21:04:21 +01:00
Tobias Loose
0d350af1b6 Use easing within the carousel views scrolling
It is visible if you scroll more than one card
2013-12-06 20:51:18 +01:00
xawotihs
3bc9c93bab Build and upload PSP binary archive. 2013-12-06 20:40:02 +01:00
Tobias Loose
2002bb4e16 Fix crash that occured when opening the editor a second time 2013-12-06 20:13:30 +01:00
Tobias Loose
7e9c4ddbdd Fix logic error in optimization introduced in last commit 2013-12-06 19:53:38 +01:00
Tobias Loose
12b71de63c Render small cards as thumbnails 2013-12-06 19:51:42 +01:00
Tobias Loose
15011961f4 Do only prefetch cards if resource management is threaded 2013-12-06 16:43:09 +01:00
xawotihs
b851103711 Commented out the release creation and refered an existing release instead. 2013-12-06 00:47:24 +01:00
xawotihs
67b8af8d15 Merge branch 'ci_upload_binaries' of https://github.com/WagicProject/wagic into ci_upload_binaries 2013-12-06 00:41:16 +01:00
xawotihs
8100e390b1 I'm starting to understand the stuff, the upload only works with a releaseId... 2013-12-06 00:10:36 +01:00
Tobias Loose
72e6876001 Remove temporary and binary files 2013-12-05 23:57:03 +01:00
Tobias Loose
96aeaffa1b Style and logic error. 2013-12-05 23:33:43 +01:00
xawotihs
74faa35b91 Removed useless local file copy before upload. 2013-12-05 23:27:40 +01:00
Tobias Loose
8bb58ca3b1 Put boilerplate code into easing base class 2013-12-05 23:27:28 +01:00
Tobias Loose
93d1a637b6 Style guide 2013-12-05 23:22:50 +01:00
xawotihs
30e86ffcd8 Update script to handle better variables. 2013-12-05 23:09:06 +01:00
Tobias Loose
cbe6c0c842 Parameterize animations in grid deck view 2013-12-05 23:06:32 +01:00
Tobias Loose
77eb7f2777 Add missing header 2013-12-05 23:06:32 +01:00
Tobias Loose
077ab10c05 Rename Button to ButtonPressed 2013-12-05 23:06:32 +01:00
Tobias Loose
1194463349 Let the deck view base class handle buttons 2013-12-05 23:06:32 +01:00
Tobias Loose
8de50532f2 Put easing code into Easing.h. Add easing to sliding 2013-12-05 23:06:31 +01:00
Tobias Loose
334454655d Add Easing code to make scrolling in grid view more fluid 2013-12-05 23:06:31 +01:00
Tobias Loose
d8d52e185d Add another missing include 2013-12-05 23:06:31 +01:00
Tobias Loose
9f1d225259 Add additional source files to various build systems 2013-12-05 23:06:30 +01:00
Tobias Loose
0c72bfd4c4 Make deck views toggleable 2013-12-05 23:06:30 +01:00
Tobias Loose
55e0366f19 Move griddeckview implementation into source file 2013-12-05 23:06:30 +01:00
Tobias Loose
667b95f2b8 Refactor gamestatedeckviewer and add a grid view suited...
for bigger screens.
2013-12-05 23:06:30 +01:00
Tobias Loose
e90f6fe224 Whitespaces and add button to toggle griv/scrolling view 2013-12-05 23:06:30 +01:00
Tobias Loose
2289fffb8d Do not ftbfs when in release mode (-weror, -wunused-.. combination) 2013-12-05 23:06:30 +01:00
xawotihs
826403a512 Fixed upload shell script 2013-12-05 22:44:02 +01:00
xawotihs
35fec3d9a0 Made upload-binaries executable 2013-12-05 22:05:31 +01:00
xawotihs
e9eb86488e Redirect ant update errors to a file and push correct upload-binaries.sh 2013-12-05 21:43:29 +01:00
xawotihs
ae97abbf96 Activates an automatic pre-release and binary upload from Travis. 2013-12-05 21:21:08 +01:00
Xawotihs
a8391112b0 Merge pull request #576 from ZobyTwo/directories_1
Do not specify the system directory in JGE
2013-12-04 13:07:05 -08:00
Rolzad73
4257592568 Updated output of info about Android APIs 2013-12-04 12:58:22 -05:00
Tobias Loose
657479e0e4 Do not specify the system directory in JGE 2013-12-04 11:58:36 +01:00
Dmitry Panin
9e969881fd Added output of info about Android APIs 2013-12-04 12:04:54 +04:00
Dmitry Panin
2b434a7182 Merge pull request #575 from WagicProject/android_travis_sdk_downgrade
Changed Travis build file to use Android API 10 and Android build tools 18.1.1
2013-12-04 00:02:49 -08:00
Rolz73
d2e41f98c3 Changed Travis build file to use Android API 10 and Android build tools 18.1.1 2013-12-03 02:36:11 -05:00
Xawotihs
318fc98a39 Merge pull request #574 from WagicProject/feature/play-from-grave
Feature/play from grave
2013-12-02 12:34:52 -08:00
Dmitry Panin
b7a4b7f6b9 Fixing Yawgmoth's will 2013-12-02 21:26:55 +04:00
Dmitry Panin
ed03fb744d Added [Yawgmoth's Will] 2013-12-02 13:42:31 +04:00
Dmitry Panin
02be213d1e Test for keyword "CanPlayFromGraveyard"
Also added card [Crucible of Worlds] as example of it.
2013-12-02 04:36:58 +04:00
Dmitry Panin
0d4db9ee54 Fixed bug in alternative cost when playing lands 2013-12-02 04:33:39 +04:00
Dmitry Panin
ae927576c5 Draft of new feature: canplayfromgraveyard
this will allow playing cards from graveyard
examples: tbd
2013-12-02 04:20:04 +04:00
Dmitry Panin
f08ddac77b Fixed formatting 2013-12-02 04:16:25 +04:00
Dmitry Panin
9effa7c975 Slightly changed formatting while investigating src 2013-12-01 01:01:57 +04:00
Dmitry Panin
a70259b5ba Fixed: Assembly-Worker didn't appear as creature type
For artifact creatures the parent type TYPE_ARTIFACT was used
and therefore that creature's subtype wasn't added in full list.
2013-12-01 00:59:16 +04:00
xawotihs
bf0a0a1580 Build the graphics version in release instead of debug. 2013-11-30 19:32:55 +01:00
xawotihs
eb8b22b2d5 Merge branch 'master' of https://github.com/WagicProject/wagic 2013-11-30 12:21:43 +01:00
xawotihs
4095676b6b Fixed memory leak introduced in #555 2013-11-29 22:07:45 +01:00
xawotihs
bedd1e8da8 Merge branch 'valgrind' of https://github.com/ZobyTwo/wagic into ZobyTwo-valgrind 2013-11-29 19:41:46 +01:00
xawotihs
965d4f6d45 Fixes Windows project 2013-11-29 19:31:23 +01:00
Tobias Loose
0db2925e7a Fix initialization orders 2013-11-29 18:44:30 +01:00
Tobias Loose
031f2dbffb Fix Valgrind warnings appearing during the test suit. 2013-11-29 18:21:53 +01:00
Tobias Loose
dbece750f8 Use tabs instead of spaces if the file uses tabs 2013-11-29 13:51:13 +01:00
Tobias Loose
6699902c24 Add TIXML_USE_STL to android builds 2013-11-29 13:34:44 +01:00
Tobias Loose
e8407caa2a Add TIXML_USE_STL compiler flag to psp makefile to make headers compatible 2013-11-29 13:34:35 +01:00
Tobias Loose
69c6745f53 Make getMenuText() return string. 2013-11-29 13:33:33 +01:00
Tobias Loose
6f083389c2 Speedup MTGAllCards::countByType a bit 2013-11-29 11:51:58 +01:00
Tobias Loose
9ee44ca091 Substitute more char arrays with strings 2013-11-29 11:51:22 +01:00
Tobias Loose
3f0dd987f0 Remove bool CardInstance::hasSubtype(const char * _subtype)
There exists bool CardInstance::hasSubtype(const string& _subtype) and the
const char* version converts _subtype into string deeper in the call
hierarchy anyway. So both methods did the same.
2013-11-29 11:43:59 +01:00
Tobias Loose
672b0be7bd Fix a few string bugs add StartsWith for strings 2013-11-29 11:38:49 +01:00
Tobias Loose
9d5a83d588 Replace more strcmp with std::string::compare or std::string::operator==.
This commit also enables TinyXML STL support.
2013-11-28 16:42:29 +01:00
Tobias Loose
5d0d130587 Make MTGGameZone::countByType use string instead of char*
and replace strcmp with std::string operator== calls.
2013-11-28 16:42:29 +01:00
Tobias Loose
c85d857604 Replace constness cast 2013-11-28 16:42:29 +01:00
Tobias Loose
f68568cc1e Replace strcmp with c++ equivalent when comparing std::strings. 2013-11-28 16:42:29 +01:00
Dmitry Panin
89206b3a6b Added testing that QT GUI build is successfull 2013-11-28 16:44:12 +04:00
Michael Nguyen
a8cff5ed8e Merge branch 'master' into develop 2013-11-28 02:19:41 -08:00
xawotihs
dc118c64b8 Fixed compilation on Mac 2013-11-27 23:04:46 +01:00
xawotihs
a43854420d Fixed compilation issue on Windows 2013-11-27 20:33:59 +01:00
xawotihs
a695323bc7 Merge pull request #564 from ZobyTwo/cleanup_1
Add a few namespaces and fix header guards.
2013-11-25 15:42:18 -08:00
xawotihs
02a65ecd82 Merge branch 'cleanup_1' of https://github.com/ZobyTwo/wagic into ZobyTwo-cleanup_1 2013-11-26 00:17:48 +01:00
xawotihs
9ff087ecde Merge pull request #570 from WagicProject/android-travis-ci
Android travis ci
2013-11-25 14:31:15 -08:00
xawotihs
47685f4892 Added installation of 32 bits libs to make Android SDK work. 2013-11-25 22:42:09 +01:00
xawotihs
7aaebdc661 Merge branch 'android_build_fix' into android-travis-ci 2013-11-25 21:23:58 +01:00
Rolzad73
8aa0b8cea0 reverting sdk.buildtools change 2013-11-25 13:41:07 -05:00
Rolzad73
fac44c4b48 - updated AndroidManifest.xml to match desired API values.
- removed CardEffect.cpp reference from Android.mk build file.
- added sdk.buildtools=18.1.1 line to default.properties and project.properties
- updated .gitignore
2013-11-25 11:54:19 -05:00
Dmitry Panin
9889186eab Added missing "echo" statement 2013-11-25 13:41:29 +04:00
xawotihs
73f9319b92 Activates Android build from Travis 2013-11-25 05:27:31 +01:00
xawotihs
fd6bc95539 Merge pull request #562 from citiral/master
Updated deckmenu.cpp to properly render deck description and summary
2013-11-24 10:28:05 -08:00
Tobias Loose
0bb211a581 Remove unused global variables from DeckStats.cpp and add proper...
member variable initialization.
2013-11-24 09:18:34 +01:00
Tobias Loose
e0428ac7b0 Avoid more conflicts. We could now do unit builds...
and make the linker put every data element and function into its own section.
On linktime, we can output every discarded section and get a list of dead
code (for that build).
2013-11-23 17:04:24 +01:00
Tobias Loose
3e94de985f Add more include guards 2013-11-23 16:25:14 +01:00
Tobias Loose
9f0b70d1c9 Put constans into extra namespace as kBackToMainMenuID...
collides with itself. GameStateAwards::kBackToMainMenuID and
GameStateOptions::kBackToMainMenuID define those with different
values.
2013-11-23 16:18:45 +01:00
Tobias Loose
1e8fc81aa3 Add/fix broken include guards 2013-11-23 16:09:11 +01:00
Tobias Loose
352e3c2daa Remove makros and add undefs to avoid clashing names
FRAND and Clamp were not used and Clamp collided when doing unit builds.
SQUARE(x) is longer than x*x and if x is an expression it gets evaluated
twice.
2013-11-23 16:03:04 +01:00
Dmitry Panin
678a4734bb Merge pull request #560 from ZobyTwo/dead_code
Remove some dead code
2013-11-22 00:09:40 -08:00
Dmitry Panin
052e3abdb8 Small fix in match_and ( [-color1; -color2] was handled incorrectly ) 2013-11-22 01:03:07 +04:00
citiral
73c2d17080 Updated deckmenu.cpp to properly render deck description and summary
Deck description and statistics were being drawn as black text, this made it invisible as it was rendered over a black background. I made it change the color to white before drawing, so its shown as its suposed to be.(Did the default text color change?)
2013-11-21 20:38:41 +01:00
Dmitry Panin
ffbb228d2d Fixed wrong activation cost in dragon hatchling 2013-11-21 14:25:01 +04:00
Dmitry Panin
306765c6b6 Merge pull request #561 from ZobyTwo/valgrind
Fix some valgrind memcheck warnings. However there remains one...

... within the threaded texture cache. Once it is resized, some textures
in GetQuad(...) (WCachedResource.cpp:102/103) have uninitialized widths/heights.
2013-11-21 01:58:49 -08:00
Tobias Loose
3cee80e3bc Delete another unused file (GuiMessageBox.cpp) 2013-11-20 14:01:59 +01:00
Tobias Loose
8209716fc9 Remove unused file 2013-11-20 13:53:15 +01:00
Tobias Loose
e76c57d747 Fix some valgrind memcheck warnings. However there remains one...
... within the threaded texture cache. Once it is resized, some textures
in GetQuad(...) (WCachedResource.cpp:102/103) have uninitialized widths/heights.
2013-11-20 12:56:33 +01:00
Tobias Loose
9c282aeb56 Remove CardEffect.o from Makefile 2013-11-20 12:02:33 +01:00
Tobias Loose
bbc310dec7 Remove some dead code 2013-11-20 11:43:27 +01:00
Dmitry Panin
a37af1776a Merge pull request #557 from ZobyTwo/defines
Defines/Typos
2013-11-20 02:34:32 -08:00
Tobias Loose
35697a65b4 Use style guide 2013-11-20 11:13:35 +01:00
Tobias Loose
6bed1666be Merge branch 'master' into defines 2013-11-20 11:06:41 +01:00
Tobias Loose
f021866368 Merge remote-tracking branch 'wp/master' 2013-11-20 11:06:28 +01:00
xawotihs
d7e527166c Merge branch 'show-output-only-for-failing-tests' 2013-11-19 11:14:41 +01:00
Dmitry Panin
071a487100 Fixed compilation error 2013-11-19 11:06:31 +04:00
Dmitry Panin
f370899a8a Thread-safe version of OutputCapturer 2013-11-19 03:58:43 +04:00
Dmitry Panin
331e126787 Added info about total number of tests 2013-11-19 02:57:42 +04:00
Dmitry Panin
6c41e5c92c Added option (#define CAPTURE_STDERR)
if set then the DebugTrace calls only for failing tests are shown
2013-11-19 02:41:30 +04:00
Tobias Loose
82e3ab3977 Merge branch 'cleanup' into defines
Merge cleanup codings style commit as i accidentally used that branch as
the base.
2013-11-17 21:06:56 +01:00
Tobias Loose
f2314ca673 Use proposed coding style 2013-11-17 21:05:07 +01:00
Tobias Loose
94c3ac9ad9 Fix FTBFS 2013-11-17 21:02:08 +01:00
Tobias Loose
5419d87e4e Get rid of two more define groups. 2013-11-17 20:22:03 +01:00
Tobias Loose
e1213d1c1f Remove variables flagged for removal (via conditional TODO comment)
x and y is provided by PlayGuiObject::Pos.
2013-11-17 19:50:17 +01:00
Tobias Loose
446ed20758 Fix typo ActionLayer::receiveEventPlus(...)
This method is rarely used, however it returned 0 after adding stuff.
It now returns the sum.
2013-11-17 19:39:46 +01:00
Tobias Loose
7a48c5e087 Fix some cppcheck warnings (mostly style and postfix vs prefix iteration) 2013-11-17 19:36:24 +01:00
Tobias Loose
3ca2f1c1ed Replace defines in Damage.h with enums. 2013-11-17 17:12:58 +01:00
Tobias Loose
146872797b ActionElement.h: Replace defines, remove superfluous ";"
Defines do not follow scope rules, but enums do. Enum classes
even utilize strong type checking (but i am not sure about compiler
support for c++11 on all target platforms).
2013-11-17 16:08:29 +01:00
Tobias Loose
c6dc51c7d3 Simplify Damage::resolve a bit 2013-11-17 15:37:56 +01:00
Dmitry Panin
0ef92d154a Merge pull request #555 from WagicProject/fix-cranial-plating
Fix cranial plating
2013-11-16 13:58:56 -08:00
Dmitry Panin
2835bdf767 Fixed issue with Cranial Plating.
Issue
	attach then equip: plating will give bonus to both creatures
Fix
	Changed "attach" to "retarget target(creature|mybattlefield)"
	as this doesnot admit this bug
	Attach should become deprecated in future
2013-11-17 01:49:51 +04:00
Dmitry Panin
afc903e31b Added different names for attach and equip
+ moved implementation of AEquip to .cpp
2013-11-17 00:44:37 +04:00
Dmitry Panin
6294bb1eed Added Master of Waves 2013-11-16 23:54:37 +04:00
xawotihs
9f16b2208d Removes the error, it was perfectly detected by Travis CI. 2013-11-09 20:15:00 +01:00
xawotihs
0a765b702b Introducing an error to check if Travis reports correctly a compile
error with the script.
2013-11-09 20:01:57 +01:00
xawotihs
82de6f2840 Fixes stupid typo. 2013-11-09 19:51:47 +01:00
xawotihs
90652fa73d Fixed PSP build and integrates it with Travis CI 2013-11-09 19:40:01 +01:00
Rolzad73
e8c73aaf9d Merge pull request #1 from WagicProject/android_cleanup
Android cleanup
2013-11-07 13:15:41 -08:00
Rolzad73
f95094a429 removing commented lines I had intended to delete outright 2013-11-07 15:56:43 -05:00
Rolzad73
7a57de6608 removed ads on Android version 2013-11-07 15:49:53 -05:00
Rolzad73
14c2d522c2 removed Android gen dir 2013-11-07 15:04:37 -05:00
Dmitry Panin
6bf2147d94 From the Vault: Twenty
// imported accidental commit from svn repo
2013-11-06 12:56:54 +04:00
xawotihs
fea5b04a77 Fixed compilation on Windows. 2013-10-31 23:48:19 +01:00
xawotihs
ea98b769a7 Merge branch 'develop'
Activates full testsuite run in Travis CI. Travis will complain as soon as at least one testcase does not pass successfully after a new commit.
2013-10-30 23:10:03 +01:00
xawotihs
017f6dd1ed Deactivated part of the traces outputted by the testsuite to make Travis
happy.
2013-10-30 22:58:04 +01:00
xawotihs
784d127a6e I think I got it ... messy / not appearing at the end of folders in the
travis linux where it appears fine on mine :(
2013-10-30 22:28:09 +01:00
xawotihs
f6c47b85e3 More debug 2013-10-30 22:02:43 +01:00
xawotihs
dac31994b6 Adding traces for important directories. 2013-10-30 21:44:23 +01:00
xawotihs
74280aef1d Added some traces in the primitives and sets loading. 2013-10-30 20:50:34 +01:00
xawotihs
8013d09e4f Reactivated wagic console in travis CI 2013-10-30 20:30:33 +01:00
Dmitry Panin
6bbe290762 Fixed bug with syncopate to consume all the mana available
Now pay[[{x}]] is not supported because of this.
use "pay[[{value:storedx}]]" instead
2013-10-30 12:39:08 +04:00
xawotihs
57c9940244 Deactivated testsuite from travis, resources are not loaded correctly. 2013-10-30 00:38:34 +01:00
xawotihs
db1c552321 Tries to work around crash of the testsuite in Travis. 2013-10-30 00:20:58 +01:00
xawotihs
f08f0ad3b9 Merge branch 'master' of https://github.com/WagicProject/wagic
Conflicts:
	JGE/include/JTypes.h
2013-10-29 23:36:07 +01:00
xawotihs
a3a1bc2b79 Created a dedicate console Qt based wagic application and run it in the
travis file.
2013-10-29 22:38:37 +01:00
Dmitry Panin
9037699281 Added missing test for syncopate + 2 tests for spell_rupture 2013-10-29 19:49:31 +04:00
Michael Nguyen
8d66f82179 Merge branch 'release/wagic-v0.19.2' 2013-10-28 16:19:28 -07:00
Michael Nguyen
eeb4a4e755 updated version number to 0.19.2, changed min target to API 10 vs API 9 as recommended by Android 2013-10-28 16:19:01 -07:00
Michael Nguyen
38725aaeac Merge commit '82171773fe89cd582e62a52fdadb152040fc0fd5' into develop 2013-10-28 15:37:35 -07:00
Michael Nguyen
ed474d6b5d Merge commit '224c94e89089317fac33aacb9319ab250301c98e' into develop 2013-10-28 15:37:24 -07:00
Michael Nguyen
b17d9d3f85 Merge branch 'master' of github.com:WagicProject/wagic 2013-10-28 15:35:45 -07:00
Michael Nguyen
c5190a62cd Merge branch 'develop' 2013-10-28 15:35:18 -07:00
Michael Nguyen
89472eeccd tidied up gitignore file for XCode 2013-10-28 15:29:51 -07:00
Michael Nguyen
2b4404f352 Merge branch 'feature/update-for-iOS6' into develop 2013-10-28 15:21:33 -07:00
Michael Nguyen
84ca7457b5 updaed for iOS6 2013-10-28 15:20:35 -07:00
Michael Nguyen
4eb1fd35e0 changed the default location for the sdcard. Instead of using a fixed value of "/sdcard/Wagic/Res" it now uses Environment.getExternalStorageDirectory().getPath() + "/Wagic/Res" 2013-10-28 15:20:11 -07:00
Michael Nguyen
362cc1b4c2 updated project to rotate and display correctly in iOS6+
removed all references to adwhirl for iOS.
2013-10-28 15:14:17 -07:00
xawotihs
82171773fe revert travis config file while the X dependency is not sorted. 2013-10-28 00:07:55 +01:00
Unknown
224c94e890 Included some testsuite into qtmain and updated travis file to try to use it. 2013-10-27 23:06:29 +01:00
Dmitry Panin
7a7bc70773 Update README.md 2013-10-27 13:36:23 +03:00
Dmitry Panin
1401fef37e Simple support for CI at travis
- now compilataion on Linux (using qmake and make) is checked
2013-10-27 14:30:34 +04:00
Dmitry Panin
cf50b7d403 Fizzle unless pay x (thanks to excessum)
- saves source card in storedSourceCard for ATransform
- adds support for WParsedInt in pay as "pay[[{value:WParsedInt}]]":

name=Spell Rupture
target=*|stack
auto=if cantargetcard(*|opponentstack) then transforms((,newability[pay[[{value:power:highest:creature:opponentbattlefield}]] name(pay {value} mana) donothing?fizzle])) forever
text=Counter target spell unless its controller pays {X}, where X is the greatest power among creatures you control.
mana={1}{U}
type=Instant

- adds support for {x} in *some* “pay” abilities (Syncopate):

name=Syncopate
target=*|stack
auto=transforms((,newability[pay[[{x}]] name(pay {value} mana) donothing?fizzleto(exile)])) forever
text=Counter target spell unless its controller pays {X}. If that spell is countered this way, exile it instead of putting it into  its owner's graveyard.
mana={X}{U}
type=Instant

- support of "name(pay {value} mana)" in pay abilities to show actual number to pay (see example above)
2013-10-27 13:47:00 +04:00
Dmitry Panin
b8b6153cc5 Reworked AVanishing (fixed bugs + more fair implementation) 2013-10-27 13:42:48 +04:00
Dmitry Panin
461eedd626 Fixed bug with preventing Melira from putting +1/+1 counters on creatures you control 2013-10-27 13:42:48 +04:00
xawotihs
f0977ebc04 Update README.md 2013-10-26 12:12:58 +02:00
xawotihs
e38f42d854 Create README.md 2013-10-26 11:50:40 +02:00
xawotihs
4ac376b5f2 Ignored non-source extensions 2013-10-24 21:53:46 +02:00
Xawotihs@gmail.com
1f0485ff8e Support for running the testsuite in command line programs for continuous integration.
Here is a small example inspired from SDLmain.c:

g_launcher = new JGameLauncher();
InitGame();
MTGCollection()->loadFolder("sets/primitives/");
MTGCollection()->loadFolder("sets/", "_cards.dat");
options.reloadProfile();
TestSuite testSuite("test/_tests.txt");
int result = testSuite.run();
DestroyGame();
delete g_launcher;
return result;
2013-10-23 22:08:30 +00: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
b5794ad328 Small fixes (misstype, formatting, target p2) 2013-10-18 06:38:15 +00:00
pankdm
38b4213f9c Refactored formatting for easier reading of the code 2013-10-18 06:38:03 +00:00
pankdm
f1a9f0d162 Fixed Grave Pact, butcher of malikir and some other cards
"Whenever creature you control dies" --
it's @movedTo(creature|  graveyard) from(mybattlefield)
NOT  @movedTo(creature|mygraveyard) from(  battlefield)
2013-10-18 06:37:53 +00:00
pankdm
e62feddaf4 Added Probe 2013-10-18 06:37:43 +00:00
pankdm
5c3eb2c405 Changed the owner of ManaCost in LifeorManaCost to itself 2013-10-18 06:37:31 +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
pankdm
d5b089f86b Small fixes to _cards.dat 2013-10-18 06:36:56 +00:00
pankdm
1d3c4bcd69 Added _cards.dat file for Theros 2013-10-18 06:36:46 +00:00
pankdm
9d2a2454b2 Fixed: exile was not meaning both exiles
and revised Crypt Incursion
2013-10-18 06:35:52 +00:00
pankdm
173f787fac Revise cards that deals damage and gain life
This cards created multiple instances of life gain and damage,
which caused wrong behaviour with for example Ajani's Pridemate
2013-10-18 06:35:02 +00:00
pankdm
0ac6057ee9 Fixed Balduvan conjurer (added land restriction) 2013-10-18 06:34:51 +00:00
pankdm
8b16074647 Fixed memory leak in menuability (thanks to excessum) 2013-10-18 06:34:42 +00:00
pankdm
62dad30f6b Revised Bloodigift demon (now it targets players) 2013-10-18 06:34:32 +00:00
pankdm
43ba9aa13d Fixed parsing of "if(ifnot) ... then may ... " 2013-10-18 06:34:23 +00:00
pankdm
ea217fdba1 Fixed [card] 2013-10-18 06:34:14 +00:00
pankdm
eea88cdeb5 Tests for new "fizzleto" keyword 2013-10-08 23:18:56 +00:00
pankdm
0c6d77daa0 Refactored FizzleToZone
Get rid of common code
Better naming of zone (where we put spell after countering)
More generic syntax: fizzleto(X) where X in [hand, exile, librarytop]
which will give more flexibility later
2013-10-08 23:18:42 +00:00
pankdm
4341e23210 Added Increasing Ambitions 2013-10-08 23:18:32 +00:00
pankdm
80be19db86 Added missing type=Artifact Creature to Trisk token 2013-10-08 23:18:19 +00:00
pankdm
1da9f5a4af Fixed time sieve 2013-10-08 23:18:08 +00:00
pankdm
fa5aedfe64 Fixed Triskelavus
(tokens didn't have ping ability after death of Trisk)
2013-10-08 23:17:57 +00:00
pankdm
17fdedb648 Draft of the "fizzle to zone"
(credit goes to excessum)
2013-10-08 23:17:43 +00:00
pankdm
da7c336dc2 Removed debug code that was added by mistake 2013-10-01 14:49:31 +00:00
pankdm
be76c8a4f1 Fixed issue with cantbeblockerof and cantbeblockedby vs protection 2013-10-01 14:47:39 +00:00
Xawotihs@gmail.com
490752e9da - Removed dependencies on Boost/string in mtg sources
- Removes dependencies on Boost/shared_ptr in mtg sources only for WP8 for the moment
- Various compilation fixes on WP8
2013-09-30 21:25:17 +00:00
pankdm
7894ca3ace Refactored ABlink: extracted common code as method "returnCardIntoPlay" 2013-09-27 19:25:28 +00:00
pankdm
d4268f18af Fixed Mortus Strider 2013-09-27 18:54:01 +00:00
pankdm
3761684816 Fixed blinking (until EOT) of creature with X in cost 2013-09-26 14:17:39 +00:00
pankdm
f10eb609d7 Added:
Belltower Sphinx
	Spellstutter Sprite

Thanks to Tacoghandi and dber for providing the code
2013-09-24 16:44:19 +00:00
pankdm
00ebc8c8eb Fixed issue with blinking creature that has X in cost 2013-09-23 20:27:52 +00:00
pankdm
36cfe84445 Revised Door of Destinies 2013-09-23 20:02:26 +00:00
pankdm
54d1126c58 Small fix in TestSuite
"Update" should pass "dt" since the last update, not since the beginning the game.
2013-09-23 19:44:03 +00:00
pankdm
11f541a627 Fixed:
Edge of autumn
	Mirrorworks

	Clone of the card now have the same image as original
	Issue with cloning and trigger "nontoken * enters"

	Blitzkrig rules
	Hermit druid rules
2013-09-23 19:40:12 +00:00
pankdm
93ebca3041 Forgot to remove Wildfire from unsupported 2013-09-20 16:39:23 +00:00
pankdm
ce7689c8c6 Added:
Wildfire

Fixed:
	Stitch in Time -- missing flipend at end
	Raging Ravine -- can't have trigger inside second transofrm
	Prey Upon -- can be cast only on opponents creature
	Mesmeric Fiend -- target(player) --> target(opponent)
	Caribou Range -- ability should be on ench
2013-09-20 16:18:56 +00:00
pankdm
de8309a7c2 Small fixes for:
Gravecrawler
Riot Control
Teysa, Envoy of Ghosts
Vengevine
Izzet Staticaster
Batwing Brume
2013-09-19 16:02:34 +00:00
pankdm
ec11bf917d Fixed slight bugs with formatting in primitives files
This appeared in several places (usually unsupported and mtg):
Churning Eddy
Izzet Staticaster
Kjeldoran Pride
Storage Matrix 
Torch Song

This had multiline values under "text=" or "auto=":
Debt to the Deathless
Smelt-Ward Gatekeepers
Sunspire Gatekeepers
Teysa, Envoy of Ghosts
Ubul Sar Gatekeepers
2013-09-18 07:00:29 +00:00
pankdm
8626451977 Fixed uninitialized value
Due to this, activated abilities with {X} in cost sometimes were having X=0 when playing
(This appeared only in Debug mode)
2013-09-16 20:18:36 +00:00
pankdm
4aa5dec51a Fixed some warnings
+ added compile flags to mute some warnings that don't have an obvious fix
2013-09-16 17:42:07 +00:00
pankdm
3c3fcfc655 Fixed typo in Rising Waters 2013-09-15 18:51:42 +00:00
wagic.the.homebrew@gmail.com
bd25b12fb2 Fix for issue 962 (Hexproof) by Dmitri 2013-09-15 02:57:29 +00:00
wagic.the.homebrew@gmail.com
7b8189bd13 Fixing tests that got broken in r4842 2013-09-15 02:47:09 +00:00
omegablast2002@yahoo.com
a2d020b2ae updated 2013-07-07 18:56:20 +00:00
omegablast2002@yahoo.com
20eda1560b psp fix 2013-06-19 21:57:08 +00:00
omegablast2002@yahoo.com
7917a70b1b forgot to reset the opponents miracle on beforebegins. i knew i had coded the miracle to be player independent :P 2013-06-19 13:33:24 +00:00
omegablast2002@yahoo.com
2fa3f468b4 added menutext overriding to transforms.
castcard-> is now the copied spell x.
2013-06-19 11:46:09 +00:00
omegablast2002@yahoo.com
1851f3c7a6 added Blitzkrieg gamemode created by tacoghandi. for those that like playing at top speed :) 2013-06-19 02:03:34 +00:00
anthonycalosa@gmail.com
45711bb504 Added 204 New Cards as of R4840 changes:
Aeon Chronicler
AEther Barrier
All Hallow's Eve
Azorius AEthermage
Banishing Stroke
Basilica Guards
Basilica Screecher
Batwing Brume
Benalish Commander
Blessings of Nature
Blind Obedience
Bog-Strider Ash
Callow Jushi
Jaraku the Interloper
Carrion Thrash
Chain of Acid
Chain of Smog
Chalice of the Void
Chandra Ablaze
Cloven Casting
Controvert
Convolute
Cradle of Vitality
Crypt Ghast
Crystal Shard
Cursecatcher
Customs Depot
Cut the Tethers
Darigaaz, the Igniter
Dawnglow Infusion
Daze
Death Charmer
Decaying Soil
Decree of Silence
Detritivore
Devastation Tide
Diluvian Primordial
Disrupt
Disruptive Pitmage
Disruptive Student
Dovescape
Drainpipe Vermin
Drowner Initiate
Dual Casting
Echo Mage
Elephant Grass
Embersmith
Equilibrium
Erayo, Soratami Ascendant
Erayo's Essence
Erratic Portal
Firespout
Flay
Flight Spellbomb
Force Spike
Force Void
Fork
Freyalise's Charm
Furnace Celebration
Ghost-Lit Warder
Ghostly Prison
Goblin Vandal
Grim Harvest
Grizzled Wolverine
Hasran Ogress
Hematite Talisman
Hesitation
Horizon Spellbomb
Icefall
In the Eye of Chaos
Inheritance
Insidious Bookworms
Intimidator Initiate
Invert the Skies
Isolation Cell
Izzet Guildmage
Jeweled Torque
Judge's Familiar
Kalastria Highborn
Kazuul, Tyrant of the Cliffs
Kingpin's Pet
Knight of Obligation
Knowledge Exploitation
Krovikan Rot
Lapis Lazuli Talisman
Leshrac's Sigil
Leyline of Lightning
Lifesmith
Lightning Axe
Lightning Cloud
Lightning Rift
Lunar Mystic
Maelstrom Archangel
Magnetic Mountain
Malachite Talisman
Mana Leak
Mana Tithe
Masked Admirers
Megatherium
Memory Plunder
Merfolk Seer
Militia's Pride
Mind's Eye
Mindclaw Shaman
Mindleech Mass
Mindstatic
Minion Reflector
Mirari
Mirrorworks
Miscalculation
Mischievous Quanar
Moonhold
Mudslide
Myrsmith
Mystic Remora
Nacre Talisman
Nether Traitor
Nether Void
Nivix Guildmage
Nihil Spellbomb
Nurturer Initiate
Off Balance
Offering to Asha
Onyx Talisman
Origin Spellbomb
Panic Spellbomb
Patron Wizard
Pedantic Learning
Phyrexian Tyranny
Plague Fiend
Pontiff of Blight
Propaganda
Punishing Fire
Purraj of Urborg
Pyrewild Shaman
Reborn Hero
Reforge the Soul
Reiterate
Resize
Revenge of the Hunted
Reverberate
Rhystic Deluge
Rhystic Shield
Rhystic Study
Riftmarked Knight
Riku of Two Reflections
Rishadan Brigand
Rishadan Cutpurse
Rishadan Footpad
Rootwater Thief
Runeboggle
Sage's Dousing
Searing Meditation
Second Guess
Seer's Sundial
Sigil of the New Dawn
Sigil Tracer
Silent-Blade Oni
Sludge Strider
Smolder Initiate
Soratami Savant
Soul Charmer
Soul Net
Spawnsire of Ulamog
Spell Contortion
Spell Pierce
Spell Snip
Spelltithe Enforcer
Sphinx of Lost Truths
Spiketail Drake
Spiketail Drakeling
Spiketail Hatchling
Spirit Cairn
Sudden Spoiling
Sunforger
Sunken Field
Sun's Bounty
Surgespanner
Syndic of Tithes
Syndicate Enforcer
Tablet of Epityr
Tears of Rage
Telekinetic Bonds
Temporal Mastery
Terminus
Thelon's Curse
Thrull Wizard
Thunderblade Charge
Thunderous Wrath
Torrent of Souls
Toshiro Umezawa
Treasury Thrull
Twincast
Undergrowth
Unnerving Assault
Urza's Chalice
Uyo, Silent Prophet
Vanishment
Vectis Dominator
Veiling Oddity
Vigorous Charge
Vodalian Mage
Voidmage Apprentice
Windborn Muse
Wizard Replica
Wrexial, the Risen Deep

96 Revised/Fixed Cards as of R4840 changes:
Apothecary Initiate
Artisan of Kozilek
Auspicious Ancestor
Azorius Herald
Blood Crypt
Boros Fury-Shield
Breeding Pool
Chaotic Backlash
Choking Tethers
Countersquall
Crackleburr
Crosis, the Purger
Crypt Champion
Crystal Rod
Death Pulse
Deathforge Shaman
Dirge of Dread
Disciple of the Vault
Divine Congregation
Dromar, the Banisher
Dryad's Caress
Esper Sojourners
Eye of Ugin
Flash Conscription
Frenzied Goblin
Gempalm Incinerator
Gempalm Polluter
Godless Shrine
Grixis Sojourners
Gruul Scrapper
Haazda Snare Squad
Hallowed Fountain
Hellkite Charger
Honden of Night's Reach
Iron Star
Ivory Cup
Jovial Evil
Jugan, the Rising Star
Jund Sojourners
Knight of the Mists
Krosan Tusker
Legion's Initiative
Llanowar Sentinel
Lorthos, the Tidemaker
Mind Knives
Mindstab
Naya Sojourners
Nemesis Trap
Numot, the Devastator
Obzedat, Ghost Council
Offalsnout
Ogre Savant
Order of the Golden Cricket
Oros, the Avenger
Overgrown Tomb
Patagia Viper
Plaxmanta
Price of Progress
Primal Boost
Psionic Sliver
Renewed Faith
Ribbons of Night
Rith, the Awakener
Rolling Spoil
Rubblebelt Maaka
Rupture Spire
Samurai of the Pale Curtain
Seance
Seed Spark
Shrieking Grotesque
Slice and Dice
Solar Blast
Splinter Twin
Steam Vents
Steamcore Weird
Stomping Ground
Stone Catapult
Sunfire Balm
Temple Garden
Tendrils of Agony
Teneb, the Harvester
The Fallen
The Hive
Throne of Bone
Tin Street Hooligan
Trade Caravan
Transguild Promenade
Treva, the Renewer
Viashino Firstblade
Vigor Mortis
Vorosh, the Hunter
Watery Grave
Wellspring
Wing Shards
Wing Storm
Wooden Sphere
2013-06-18 02:17:52 +00:00
omegablast2002@yahoo.com
f1d88611cb updated test to adjust for new legendary rules 2013-06-18 01:42:49 +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
anthonycalosa@gmail.com
ece78395f4 Update SOK for Erayo, Soratami Ascendant 2013-06-13 13:37:25 +00:00
anthonycalosa@gmail.com
95bbe06c7e added swipe on Story Mode. So if playing a duel on story mode, you can cancel with swipe down. 2013-06-13 04:34:20 +00:00
anthonycalosa@gmail.com
b3f81e95bb Update WWK for Kazuul, Tyrant of the Cliffs 2013-06-13 04:28:14 +00:00
anthonycalosa@gmail.com
3c63b152a6 Update PLC for Riftmarked Knight token 2013-06-11 06:42:55 +00:00
Xawotihs@gmail.com
26ab65860e Fixed a gazillion of warnings occuring when compiling Wagic with Clang with Werror. 2013-06-09 21:16:39 +00:00
rolzad73@gmail.com
7990540096 fixed music resource adding from resource zip to nested folder on Android platorm. Fixed issue 776 2013-06-03 02:15:12 +00:00
punkeduard@gmail.com
1442b73029 Fixed some cards from DGM and Crackleburr 2013-06-03 01:17:56 +00:00
anthonycalosa@gmail.com
fee9ee756c typo fix Obzedat's Aid 2013-06-02 13:24:30 +00:00
rolzad73@gmail.com
a400cabfc7 - code foramtting only mostly of whitespace for readability of a few Android files 2013-06-01 16:02:10 +00:00
anthonycalosa@gmail.com
8a7d5f4490 added Auriok Replica, Austere Command 2013-05-22 02:14:11 +00:00
anthonycalosa@gmail.com
b0a1e670ba fix Overload. 2013-05-20 16:54:14 +00:00
anthonycalosa@gmail.com
b5906a4299 revised Martyr of Sands 2013-05-20 14:01:46 +00:00
anthonycalosa@gmail.com
b7324280aa added Prowl cards.
Auntie's Snitch
Earwig Squad
Latchkey Faerie
Morsel Theft
Notorius Throng
Stinkdrinker Bandit


Revised cards:

Denying Wind
Extract
Jester's Cap
Sadistic Sacrament
Supreme Inquisitor
2013-05-20 07:19:18 +00:00
anthonycalosa@gmail.com
f0de00086b added Prowl support.
example usage:
other={1}{B} name(Prowl)
otherrestriction=prowl
2013-05-20 02:59:18 +00:00
omegablast2002@yahoo.com
a055044281 added miracle ability.
i choose to use other cost instead of creating a brand new cost type.

otherrestriction determines if the card is the miracle for the turn.

[card]
name=Devastation Tide
auto=all(*[-land]) moveto(ownerhand)
other={1}{u} name(Miracle)
otherrestriction=miracle
text=Return all nonland permanents to their owners' hands. -- Miracle {1}{U} (You may cast this card for its miracle cost when you draw it if it's the first card you drew this turn.)
mana={3}{U}{U}
type=Sorcery
[/card]
2013-05-19 01:48:51 +00:00
anthonycalosa@gmail.com
4b167c3776 added Abyssal Gatekeeper, Akki Blizzard-Herder, Archmage Ascension, Runeflare Trap 2013-05-18 16:30:14 +00:00
anthonycalosa@gmail.com
cf74c3480e added drawCounter. Returns the number of cards drawn this turn (excludes pre-game draw).
pdrewcount - player draw count
odrewcount - opponent draw count
2013-05-18 15:31:12 +00:00
anthonycalosa@gmail.com
ba5debad05 added AEther Burst. revised code for An-Havva Inn, Kindle, Mind Burst, Vitalizing Cascade, Wall of Tombstones 2013-05-17 03:30:40 +00:00
anthonycalosa@gmail.com
4f915b38c8 added basic support for "X plus one", "X plus two" & "X plus three".
example:

[card]
name=AEther Burst
target=<plusonetype:AEther Burst:graveyard>creature|battlefield
auto=moveto(ownerhand)
text=Return up to X target creatures to their owners' hands, where X is one plus the number of cards named AEther Burst in all graveyards as you cast AEther Burst.
mana={1}{U}
type=Instant
[/card] 

[card]
name=Vitalizing Cascade
auto=life:Xplusthree
text=You gain X plus 3 life.
mana={X}{G}{W}
type=Instant
[/card]
2013-05-17 02:09:48 +00:00
anthonycalosa@gmail.com
c286aa02a6 added Vibrating Sphere, Vish Kal, Blood Arbiter, Vodalian Mystic, Wurmskin Forger 2013-05-17 00:48:11 +00:00
anthonycalosa@gmail.com
3171c62089 added Tsabo's Decree, Tunnel Ignus, Urza's Guilt 2013-05-16 00:39:12 +00:00
anthonycalosa@gmail.com
819ddd0496 added Thran Foundry, Treacherous Vampire, Tremble, Truce 2013-05-15 02:30:14 +00:00
anthonycalosa@gmail.com
c15d0ec523 added Thought Lash, Thoughtcutter Agent, Thoughts of Ruin 2013-05-15 02:01:29 +00:00
anthonycalosa@gmail.com
5da2033d74 added Tectonic Break, Temporary Truce, Tephraderm, Terraformer 2013-05-15 01:29:20 +00:00
anthonycalosa@gmail.com
f449ec5fdd added Sway of Illusion, Swirling Spriggan 2013-05-14 13:30:40 +00:00
anthonycalosa@gmail.com
ee310b7bb3 added Student of Elements // Tobita, Master of Winds 2013-05-14 04:26:48 +00:00
anthonycalosa@gmail.com
b50eaf83a1 added Stonecloaker, Stonehewer Giant 2013-05-14 03:52:37 +00:00
anthonycalosa@gmail.com
79fca90db9 added Sigil of Distinction, Spectral Searchlight, Spell Burst 2013-05-14 03:31:17 +00:00
anthonycalosa@gmail.com
d8b77bf796 Added Sickening Shoal.
Updated codes for Nourishing Shoal and Blazing Shoal.
2013-05-14 02:33:36 +00:00
anthonycalosa@gmail.com
fa07242370 added GTC unsupported cards 2013-05-14 01:30:48 +00:00
anthonycalosa@gmail.com
6626b52e3a added DGM unsupported cards 2013-05-14 00:46:21 +00:00
anthonycalosa@gmail.com
86d748bc43 minor corrections 2013-05-14 00:45:05 +00:00
rolzad73@gmail.com
4f8d5b3300 globalized version number for Android project. 2013-05-13 02:18:27 +00:00
rolzad73@gmail.com
0908c76434 -Added Android release keystore (both passwords are 'password')
- updated ant.properties to reference new release keystore
2013-05-12 19:47:12 +00:00
anthonycalosa@gmail.com
1edd1546a2 Martyr of sands removed from unsupported.txt 2013-05-12 00:40:34 +00:00
anthonycalosa@gmail.com
c2abc6e4a8 added Debt to the Deathless 2013-05-12 00:14:20 +00:00
anthonycalosa@gmail.com
7905ed1533 updated code for False Cure and Transcendence. added Martyr of Sands to borderline. 2013-05-12 00:03:11 +00:00
omegablast2002@yahoo.com
f6f75ca660 psp comp fix, I was not able to test it though as i am not set up to comp psp builds anymore. 2013-05-11 00:48:21 +00:00
omegablast2002@yahoo.com
9f6a728150 i run the set names through translation now when filtering by sets.
what this means is that if a player so choose, they can list the sets 3 letter code in the en.txt as follows
BOK=betrayers of kamikawa
it will now list the names either as the 3 letter code if thier is no entry, or as whatever you call it in the lang->en.txt file.
2013-05-09 01:53:01 +00:00
omegablast2002@yahoo.com
54021a7f75 removed the remaining trademarked names. for future reference: we are not allowed to add the set names directly to card.dats. WOTC trademarks the names of sets months before they are released. 2013-05-09 00:49:56 +00:00
omegablast2002@yahoo.com
9f89353b4b reverted the adding of trademarked names to card.dat, as sad as it is we have to follow the laws. 2013-05-09 00:39:51 +00:00
wagic.the.homebrew@gmail.com
9fa9e1eb81 undo my changes with libhgetools.a, it seems something's wrong on my end, as my computer interprets u32 as unsigned long instead of unsigned int 2013-05-08 12:37:16 +00:00
omegablast2002@yahoo.com
e54d212418 thanks MarSprite for adding the missing set names to the card.dats missing them. 2013-05-08 01:57:06 +00:00
anthonycalosa@gmail.com
07fdf735f5 added "twice" and "thrice" variables.
example usage:

auto=life:thriceX
auto=@damaged(player):life:twicethatmuch
auto=life:twicetype:creature:mybattlefield

so to code cards like Debt to the Deathless

[card]
name=Debt to the Deathless
auto=@lifeloss(opponent):life:thatmuch controller
auto=life:-twiceX opponent
text=Each opponent loses two times X life. You gain life equal to the life lost this way.
mana={X}{W}{W}{B}{B}
type=Sorcery
[/card]
2013-05-07 07:27:45 +00:00
omegablast2002@yahoo.com
a7e9fe6699 spanish translation stuff, thanks atriel 2013-05-06 23:21:29 +00:00
punkeduard@gmail.com
f3df94b319 Fixed some dragons maze cards 2013-05-06 17:26:54 +00:00
wagic.the.homebrew@gmail.com
aa51083b2b update hge compiled lib 2013-05-06 06:01:19 +00:00
wagic.the.homebrew@gmail.com
0c8f1e1573 Increase version number to 0.19.0. I did it manually, not sure how to run the build scripts :/ 2013-05-06 05:10:19 +00:00
anthonycalosa@gmail.com
386fc08e3a Added Reap Intellect :) 2013-05-05 23:25:12 +00:00
wagic.the.homebrew@gmail.com
a40c677f1e Adding test for i953 2013-05-05 13:52:42 +00:00
wagic.the.homebrew@gmail.com
38a203aac8 Reverted the "more than 50 elements in the stack" fix for Exquisite Blood + Sanguine Bond, as this created more issues than it fixed. I'll open a ticket for the Exquisite blood bug 2013-05-05 13:49:51 +00:00
wagic.the.homebrew@gmail.com
2349908f66 Refactored the "fast test", "slow test" bits of the test suite to make the intent clear, and prevent the first test slowness from being broken again. I've kept the fast_test value to 6 (it was originally 3) as Zethfox mentioned weird race conditions when it is set to 6. 2013-05-05 11:56:35 +00:00
omegablast2002@yahoo.com
30d3b52a9e Izzet Staticaster added 2013-05-04 17:58:55 +00:00
omegablast2002@yahoo.com
107874d88e restricted the creation of clones from progenator mimic to check if the clone is a token before making more. 2013-05-04 17:41:10 +00:00
omegablast2002@yahoo.com
f0a6770948 added progenitor mimic and morgue burst 2013-05-04 08:55:00 +00:00
omegablast2002@yahoo.com
14c605f2a6 garruk and rakdos returns fixed 2013-05-03 03:36:07 +00:00
omegablast2002@yahoo.com
8dcd261258 couple card fixes, moved dryad arbor to the end of primitives because it was associating creature and forest in the subtypes and super types list. 2013-05-03 03:33:59 +00:00
omegablast2002@yahoo.com
537f994ae4 added spike jester 2013-05-02 22:12:20 +00:00
omegablast2002@yahoo.com
6403f75769 bad line fixes 2013-05-02 02:33:12 +00:00
omegablast2002@yahoo.com
e076e64d97 changes to fix a bug, previous entries of the same name already exist causing the first oocurence to be used. 2013-05-02 01:57:29 +00:00
omegablast2002@yahoo.com
8deb0537a8 corrected names 2013-05-01 22:54:12 +00:00
omegablast2002@yahoo.com
83ef3aa08c fixed a crash with flip cards. how does the test for this pass? 2013-05-01 00:02:42 +00:00
omegablast2002@yahoo.com
305bdb386b t2 Selesnya deck 2013-04-30 06:27:18 +00:00
omegablast2002@yahoo.com
ad855ce8d1 token fixes for dgm 2013-04-29 02:25:47 +00:00
omegablast2002@yahoo.com
150c28ae72 token fixes for dgm 2013-04-29 02:25:28 +00:00
punkeduard@gmail.com
2a25db403d Fixes to dragon's maze cards 2013-04-28 17:26:10 +00:00
omegablast2002@yahoo.com
80501edc2a format fix 2013-04-28 12:55:49 +00:00
omegablast2002@yahoo.com
d7c1868de3 added corrected and checked the cards for dragon maze, thanks kf1! 2013-04-28 01:03:24 +00:00
omegablast2002@yahoo.com
7b11ede1d5 added dragon maze dat 2013-04-28 01:02:03 +00:00
omegablast2002@yahoo.com
e8ee356892 fix for issue 913. 2013-04-24 13:29:54 +00:00
omegablast2002@yahoo.com
dd68023249 new deck 2013-04-23 23:20:16 +00:00
omegablast2002@yahoo.com
96adbabea8 fixed a crash that could be reproduced demo->classic->best of 3->endless demo 2013-04-21 02:20:22 +00:00
omegablast2002@yahoo.com
89ae87cc3d opps, just a fix 2013-04-11 10:39:16 +00:00
omegablast2002@yahoo.com
8c80efbe2a replaced simon again with a medium thickness version of the same thing. 2013-04-10 22:50:03 +00:00
omegablast2002@yahoo.com
9ffe7349e2 added a hint that allows you to override how ai views a cards effects.
#HINT:good(icy prison)
ai will act as though the effects of this card are now good, choosing to cast it on it's own creatures.

#HINT:bad(ancestral recall)
ai will now use this card targeting the opponent. 
good in cases where you are trying to mill the opponent

the effects in wagic have gotten so complex that ai simply has no idea what some cards should target. this helps in most of the cases.
2013-04-10 02:38:52 +00:00
omegablast2002@yahoo.com
f9410f695a added excessum to the deck builder credits. 2013-04-08 02:20:00 +00:00
omegablast2002@yahoo.com
7c8d3cedbd added 2 more decks from our deck builder excessum 2013-04-08 02:13:46 +00:00
omegablast2002@yahoo.com
49b6b028c5 fixed a bug with alwaysattack hint, if there was an attack readied it would undo it by clicking it the second time. 2013-04-07 17:30:48 +00:00
omegablast2002@yahoo.com
1bea0736a5 replaced backdrops pieces, task board, deck menu and deck editor with graphics from kevlahnota's mtg theme. to get the mtg look you will still have to download his theme, however these pieces i felt were so polished that they made the original wagic default theme look slapped together. 2013-04-07 14:41:44 +00:00
omegablast2002@yahoo.com
1c61ebddae added a shuffle to optimizedhand to avoid drawing the same hand over and over when its optimized.
adjusted normal difficulty to include 2 lands, 2 spells under 3 mana.

adjusted hard difficulty to always include 2 lands, the rest are randomly drawn. this prevents ai from being mana screwed on opening hand.
2013-04-07 01:07:00 +00:00
omegablast2002@yahoo.com
6727c1af52 added HINT:alwaysattackwith(targetchooser) and HINT:alwaysblockwith(targetchooser) 2013-04-07 00:56:44 +00:00
omegablast2002@yahoo.com
ce656adeba new simon font. they are a little fatter then i would personally like but they look great on full screen. thanks Atriel for the new simon! 2013-04-07 00:33:27 +00:00
omegablast2002@yahoo.com
2a7bcb2170 ifdef on simon font to up the res of simon.
you will need to rename your old simon font to pspsimon
only english is effected.
2013-04-07 00:32:11 +00:00
anthonycalosa@gmail.com
5789d0cae4 added Shred Memory, Shyft, Simplify 2013-04-05 11:41:35 +00:00
omegablast2002@yahoo.com
80e36c2b92 readjusted the carddisplays for libarary and graveyard for both players to move them off the top of the avatars. you can now click thier respective button to close them when in a targetchooser action.
also readded a piece of code i commented out, it does nothing but the compiler saids it expected something there.
2013-03-30 17:09:50 +00:00
omegablast2002@yahoo.com
c9360eb005 added the first 18 decks by our very talented deck builder excessum! i've had a chance to play against these before they got the combohint vamp up, i imagine now they're almost unstoppable. enjoy! make sure to thank excessum on the forum if you enjoy them as much as i have. 2013-03-29 20:23:32 +00:00
omegablast2002@yahoo.com
734b142879 the fix originally only targeted too many triggers unresolved on the stack, moving the other 2 out of the check as it actually causes new bugs to include them in the skip. 2013-03-28 00:05:39 +00:00
omegablast2002@yahoo.com
bfb88f1bb5 increased the res of f3 font to 1024 x 1024. renamed old to pspf3 these will be the new f3 fonts using much higher res on everything but psp. 2013-03-27 23:31:38 +00:00
omegablast2002@yahoo.com
802c970ec3 #ifdef psp for the increase res font f3 which is by far the worst looking font on higher res devices. 2013-03-27 23:29:18 +00:00
omegablast2002@yahoo.com
b38d6c6bc5 applying the patch for torny mode not awarding credits at end of torny. 2013-03-27 22:58:51 +00:00
Xawotihs@gmail.com
701ca64e8a Display IP address of game host before connection is established and handles disconnection of peer. 2013-03-26 22:32:29 +00:00
omegablast2002@yahoo.com
810c3967d6 after much testing and corrections, our user Holgern from the forums has completely recreated and reworked the gauntlet mode originally coded for ai vs ai into a completely new way to play wagic, you can choose the number of matchs, various modes, and other wonderful additions. Don't take my word for it, try all the fun new stuff out yourself!
THANK YOU Holgern!
2013-03-26 02:10:45 +00:00
omegablast2002@yahoo.com
c994886ca8 polished the actionstack rendering a little. draw only as much black square as we need to render so we dont make a massive black square for nothing. 2013-03-23 20:53:33 +00:00
Xawotihs@gmail.com
2c0e0c7251 Removed the link between the font textures resolution and the size of the characters displayed. That allows to use very high resolution fonts similarly to card pictures... 2013-03-23 17:21:17 +00:00
omegablast2002@yahoo.com
b6a4197d88 fix for a bug i introduced. 2013-03-23 06:21:01 +00:00
omegablast2002@yahoo.com
e2f4dd7095 if its a land you should consider playing it. 2013-03-22 01:35:45 +00:00
omegablast2002@yahoo.com
0578ebde80 minor fixes for combo system. 2013-03-22 00:53:42 +00:00
omegablast2002@yahoo.com
9b44d627a3 changed ai eff return on token creation. over 50 tokens on my battlefield return 0.
changed an inefficient check on phaseskip.
2013-03-21 01:28:56 +00:00
omegablast2002@yahoo.com
8b626b378f that was not supposed to be in that last commit. someone please teach me to revert just a file without having to do a rain dance. 2013-03-16 21:50:21 +00:00
omegablast2002@yahoo.com
b436550150 ai simple combo system is finally fully working.
added ai hint dontblockwith(targetchooser)
2013-03-16 21:35:10 +00:00
anthonycalosa@gmail.com
c2132ab97f morthan typo 2013-03-15 23:51:04 +00:00
omegablast2002@yahoo.com
22640130dc fixes from the bugs section on the forum 2013-03-15 22:52:02 +00:00
omegablast2002@yahoo.com
90a0f5c86f as per mtg rules, the effects of unpaid upkeep cost should only happen if the from id was upkeep. ie:skipped phases. 2013-03-15 21:49:35 +00:00
omegablast2002@yahoo.com
3cb0a6c091 psp compilation fix 2013-03-15 21:42:24 +00:00
anthonycalosa@gmail.com
1818a8be82 corrected some typos 2013-03-15 15:13:02 +00:00
omegablast2002@yahoo.com
9c0ce5f7bf more changes to fix the combo system. 2013-03-15 02:08:03 +00:00
omegablast2002@yahoo.com
31ee6d2b90 trying to figure out why ai is cast cards that belong to a combo outside of a combo even though it is told to skip these cards. 2013-03-15 01:44:31 +00:00
omegablast2002@yahoo.com
d4ff6d1453 spanish translation stuff 2013-03-14 22:22:18 +00:00
omegablast2002@yahoo.com
a7aeb7efe5 fix for a bug in combohint. ai will now rarely want to use a card outside of a combo if it is to be held for a combo 2013-03-13 01:11:58 +00:00
omegablast2002@yahoo.com
cd54ad7012 correction 2013-03-07 03:35:35 +00:00
omegablast2002@yahoo.com
04dce1ad50 ai vs ai matchs will play with optimizedhands. 2013-03-01 23:10:16 +00:00
omegablast2002@yahoo.com
ef18f376b1 ifdef(psp) on cache hit miss handling. 2013-02-26 23:22:49 +00:00
anthonycalosa@gmail.com
f9bd6e1c44 Added:
Scuttlemutt
Shieldmage Elder
Shields of Velis Vel
Show and Tell

Borderline:
Scapeshift

Fix:
Talara's Battalion - changed restrictions= to restriction=
2013-02-22 13:22:00 +00:00
anthonycalosa@gmail.com
e8f8aae43f fix kjeldoran home guard and bloodlord of vaasgoth 2013-02-22 07:41:06 +00:00
omegablast2002@yahoo.com
b4d4515e01 set init baka timer fastmode to a safer float. 2013-02-21 22:59:59 +00:00
omegablast2002@yahoo.com
9a52ae28a2 several changes here,
first, i added a timer to hide the big card after 5 secs or until a movement is registered. 

2nd, removed the advancing of phases with flick up.

3rd added a flick left to "show/hide hand"

4th, fixed an error in the logic of "getDifficulty" part of the reason optimizedhand was not working.

finally, unrefactored the checks of optimized hand, it was FAR to difficult to see what was actually happening the way it was coded.

optimizedhand is finally working again, 
toggledifficulty and optimizedhand will again trigger and greatly improve ai vs player matches
2013-02-21 00:48:39 +00:00
anthonycalosa@gmail.com
2330e6a613 fix all similar cards like Duress to have a "look" ability. 2013-02-20 09:04:09 +00:00
anthonycalosa@gmail.com
620c5595d9 Fix various typos reported on the forum. 2013-02-20 04:05:16 +00:00
omegablast2002@yahoo.com
a5ea3275cd i introduced a bug a couple revs back. dyslexia got me. 2013-02-16 21:07:13 +00:00
anthonycalosa@gmail.com
bf677b7bdd Added:
Jilt
Jugan, the Rising Star
Laquatus's Creativity
Mogg Infestation
Prahv, Spires of Order
Quest for the Holy Relic
Razing Snidd

Fix:
Gerrard Capashen - first ability is targeted
Spiraling Embers - removed "(" and ")" and revised
Sword of War and Peace - revised
Venser's Journal - revised
Vicious Shadows - ability is targeted
2013-02-16 09:46:18 +00:00
anthonycalosa@gmail.com
026600c084 Added:
Careful Consideration
Haunting Hymn
Might of Old Krosa
Return to Dust
Sulfurous Blast

Fix:
Liliana of the Dark Realms - missing add, thanks Tacoghandi
2013-02-16 05:59:50 +00:00
anthonycalosa@gmail.com
a1a16fce57 Added Flux, Freyalise Supplicant, Hag Hedge-Mage, Harsh Mercy 2013-02-15 10:55:41 +00:00
omegablast2002@yahoo.com
defb8e32c6 corrected the mana not removing from pool correctly bug, sorry about that. 2013-02-13 23:33:05 +00:00
omegablast2002@yahoo.com
8aef74e32a pestilence shouldn't care about protections of any kind. 2013-02-12 23:09:24 +00:00
anthonycalosa@gmail.com
fbc1b14dca Added:
Mark of Sakiko
Sakiko, Mother of Summer
Sakura-Tribe Springcaller
Shizuko, Caller of Autumn
Upwelling
2013-02-12 13:08:17 +00:00
omegablast2002@yahoo.com
e24f269c36 just a format 2013-02-10 14:34:13 +00:00
omegablast2002@yahoo.com
3c15357c38 added poolsave(COLOR) its an ability that works only on permanents in play.
opponentpoolsave(
mypoolsave(
ex:Upwelling


added a tag for mana, doesntempty
add{g}{g}{g} doesntempty
what this does is make THAT mana remain in the pool until end of turn.
ex:
Sakura-Tribe Springcaller
2013-02-09 06:48:16 +00:00
omegablast2002@yahoo.com
2b4c3a51aa removed a condiational that was limiting blink ability. i left the portion commented out just incase i put it there becuase of a bug. but as far as i can see it doesn't seem to cause an issue to remove it. 2013-02-09 02:37:22 +00:00
omegablast2002@yahoo.com
f0405342be commited the spanish translation files that the spanish wagic group have worked so hard at producing a full almost 100% translation of wagic into spanish.
thank you to the translators involved in making it happen.
http://wololo.net/forum/viewtopic.php?f=24&t=16761
for more info and spanish card images.
2013-02-09 02:09:02 +00:00
omegablast2002@yahoo.com
d2f14897a6 fixed a loop that can occur in multitarget where the maxs targets are set with a variable word and ends up resulting in a return of maxtargets = 0 which inturn locks ai in a loop, i imagine layers also. 2013-02-08 00:34:45 +00:00
dan.solomatin@googlemail.com
8b7c0e6b83 Fixed Righteous Indignation. 2013-02-07 23:14:59 +00:00
anthonycalosa@gmail.com
f7116a84b4 Added Slavering Nulls, Slum Reaper, Smallpox, Snakeform 2013-02-07 14:33:52 +00:00
anthonycalosa@gmail.com
dff6302773 Added Skyship Weatherlight 2013-02-07 11:44:52 +00:00
anthonycalosa@gmail.com
b88b217c46 Added Domestication, Duergar Hedge-Mage, Ertai's Trickery 2013-02-07 11:33:07 +00:00
dan.solomatin@googlemail.com
13c10ec856 Added 4 cards based on revision4692.
Duct Crawler
Screeching Griffin
Shrewd Hatchling
Spin Engine

Optimized the code of 11 cards based on the same revision:

Boldwyr Intimidator
Bower Passage
Brassclaw Orcs
Gibbering Hyenas
Goblin Mutant
Hunted Ghoul
Ironclaw Buzzardiers
Ironclaw Orcs
Orcish Veteran
Orgg
Sabertooth Alley Cat
2013-02-07 11:00:15 +00:00
omegablast2002@yahoo.com
54780d3ef0 fixed a typo in cantbeblockerof , forgot a letter :X 2013-02-06 23:52:09 +00:00
dan.solomatin@googlemail.com
cea9f0d8ae Added more info to Decimate to clear out its current overpoweredness. 2013-02-06 18:02:14 +00:00
dan.solomatin@googlemail.com
3daa0eec7d Moved Decimate from unsupported.txt to crappy.txt.
The Wagic version of Decimate would be like 50$, while the real version is currently 2$ max.
2013-02-06 17:50:47 +00:00
dan.solomatin@googlemail.com
101dd163a3 Fixed small typo in Consuming Ferocity's code. 2013-02-06 10:18:01 +00:00
dan.solomatin@googlemail.com
c33ae31895 Moved Decimate from to unsupported.txt.
Decimate should only be castable if there are 4 legal targets for it.
If treated like it is in the current way of coding, the card is more then overpowered and thus shouldn't even be moved to crappy.txt!
2013-02-06 09:11:43 +00:00
omegablast2002@yahoo.com
cbe6028a52 opps, i need to slow down my happy trigger finger before i hit commit. 2013-02-06 02:55:27 +00:00
omegablast2002@yahoo.com
e424c3ab27 fixed a bug with lords not removing altercost correctly when the source is phased.
added 
cantbeblockerof(this)<--this = the card who owns the ability.
cantbeblockerof(targetchooser) <--the target cant block anything targetable by this targetchooser.
spin engine and similar will use cantbeblockerof(this).
others were done with a workaround, which i hope will be updated soon.
2013-02-06 02:45:40 +00:00
anthonycalosa@gmail.com
1d06a74fd9 added:
Death Cloud
Decimate
Destructive Force
Din of the Fireherd
2013-02-05 13:27:56 +00:00
anthonycalosa@gmail.com
81294a0d2b Added:
Azorius Ploy
Barter in Blood
Consuming Ferocity
Corpse Harvester
Corrupted Resolve
Cruel Ultimatum
Cyclopean Tomb

Borderline:
Consume Strength

Fixes:
Contagion Engine - can select targets once but add counters twice
Emblems missing forever tag

Moved Drain Life - we can now limit black using {X:black}
2013-02-05 10:43:03 +00:00
anthonycalosa@gmail.com
ae8893617f Shifting sliver evasion doesn't work with creatures with protection from color 2013-02-05 04:02:26 +00:00
anthonycalosa@gmail.com
38895dfcd3 @each myupkeep -> @each my upkeep
fix recurring nightmare cost, Snow hound cost.
2013-02-04 14:08:05 +00:00
omegablast2002@yahoo.com
90c0b42a07 changed the defaults of the testsuite game constructor to set the default timerlimit to 6
the other threads were running test suite at 0 which was causing race condition fails in test suite, i incremented by 1 until the normally passing test no longer failed, test effected were proliferate and mortician beetle both passing test in normal mode, failing in hyperspeed. test suite takes only 30 secs more to run but we can't sacrifice actual results for speed.

the commented out section is not even taken into account after first test is run.
2013-02-04 05:09:52 +00:00
omegablast2002@yahoo.com
7e16b50fd3 just giving credit 2013-02-04 02:49:52 +00:00
Xawotihs@gmail.com
5a9b7eefc0 Fixed PSP compilation by stubbing the socket implementation. Somebody with a PSP, please replace this code with a real implementation. 2013-02-03 21:41:31 +00:00
Xawotihs@gmail.com
5c25189aef Added code to let user specify the server address.
Updated SimplePad to include dot and fixed problem with digits.
2013-02-03 19:21:43 +00:00
anthonycalosa@gmail.com
452ae08593 Cleanup my mess... 2013-02-03 15:57:48 +00:00
omegablast2002@yahoo.com
b85f2240a7 fix for @sacrificed crash and not triggering to cost. 2013-02-03 15:31:06 +00:00
anthonycalosa@gmail.com
6928df6819 Added Sedris, the Traitor King 2013-02-03 13:45:56 +00:00
anthonycalosa@gmail.com
6fa633f822 tests:
-----------
Mortician_Beetle.txt
Savra_Queen_of_the_Golgari.txt

added:
-----------
Saprazzan Breaker
Savra, Queen of the Golgari

borderline:
-----------
Ogre Marauder

crappy:
-----------
Barbarian Bully
Skullscorch
2013-02-03 11:21:12 +00:00
omegablast2002@yahoo.com
2b9fdc41dc added 2 new restrictions for use in triggers and abilities
ownerscontrol
opponentscontrol

ownerscontrol returns 1 if the owner has the card in thier battlefield. 0 otherwise. vice versa.
this should make it easier to add cards which should be treated differently depending on who controls them.
2013-02-02 18:42:39 +00:00
anthonycalosa@gmail.com
ef4a8c6d84 Moved rune of protection to crappy.
Revised Pursuit of Knowledge
Added Samite Elder
2013-02-02 14:24:07 +00:00
anthonycalosa@gmail.com
44fa0e9015 added:
Reap
Rebel Informer
Repopulate
Rix Maadi Guildmage
Rocket Launcher
Roots of Life
Rotting Giant
Rune of Protection: Artifacts
Rune of Protection: Black
Rune of Protection: Blue
Rune of Protection: Green
Rune of Protection: Lands
Rune of Protection: Red
Rune of Protection: White
Sadistic Augermage

borderline:
Rakdos Augermage
2013-02-02 10:50:16 +00:00
omegablast2002@yahoo.com
a8ebaee527 added a check to avoid skipping a gameState update if there are more than 50 items left to resolve in the stack, let run a gameStates check and see if we havent already won.
Exquisite Blood + Sanguine Bond example of the kinds of loops this fixes.
2013-02-02 05:43:46 +00:00
anthonycalosa@gmail.com
cca8f1ce4e minor cleanup spaces 2013-02-02 03:49:53 +00:00
anthonycalosa@gmail.com
a8c6da03a8 Added - Prismatic Lace, Quickchange
Borderline - Govern the Guildless
Fixed - Prismwake Merrow
2013-02-02 02:23:05 +00:00
omegablast2002@yahoo.com
6a1591d72b reverted the newtarget/retarget fix, it didn't fix the issue and created new ones. 2013-02-01 18:54:07 +00:00
anthonycalosa@gmail.com
fa5e3ad9b4 Softcoded Reminisce
Added Prismatic Lace in Borderline
2013-02-01 14:34:30 +00:00
anthonycalosa@gmail.com
0095dcceb5 Added Predatory Advantage, Priest of Yawgmoth & Pursuit of Knowledge 2013-02-01 14:04:17 +00:00
omegablast2002@yahoo.com
6c86c276d2 missed a file last commit. 2013-02-01 04:35:40 +00:00
omegablast2002@yahoo.com
0bd769d3c0 added engine code to do a putinzone without sending events.
equipping no longer retriggers a copier.
retarget and newtarget no long send the events due to refreshing the cards.
2013-02-01 04:21:08 +00:00
anthonycalosa@gmail.com
94955088c8 Moved Gerrard's Verdict, Lurking Evil to crappy.
Added Rix Maadi, Dungeon Palace
Added Rotting Rats
Added Stronghold Rats
2013-02-01 03:15:39 +00:00
anthonycalosa@gmail.com
7de5cfbd37 Fixed Possessed Portal since you cant discard a card unless you have one permanent to sacrifice, replace 0/0 with donothing
Moved Maralen of the Mornsong to borderline since the effect is not draw replacement but players cant draw anything (there isn't any stated "would draw"), maybe we can have CANTDRAW ability in the future.
2013-02-01 02:20:27 +00:00
anthonycalosa@gmail.com
ea0a3efc38 Added Possessed Portal. 2013-01-31 14:37:29 +00:00
anthonycalosa@gmail.com
6e7c57151c Added Piston Sledge, fixed Grifter's Blade 2013-01-31 13:52:50 +00:00
omegablast2002@yahoo.com
2ef93bc722 readded the rest of the stuff that anthony commited that the svn ate during my commit. 2013-01-31 11:33:30 +00:00
anthonycalosa@gmail.com
21897f2f63 removed workaround, and revised code to simian spirit guide and elvish spirit guide. 2013-01-31 11:09:20 +00:00
anthonycalosa@gmail.com
de16c53534 Re commitied my previous cards in primitives/mtg.txt
I dont know why my previous commit has been removed but its all working. I included tests for the cards in this commit. All test suite passes. please update your FUT/_cards.dat because i change the name of oriss to its original name.

--------------------------------------
[card]
primitive=Oriss, Samite Guardian
id=136210
rarity=R
[/card]
2013-01-31 09:00:25 +00:00
omegablast2002@yahoo.com
a83e029ca6 master transmuter can now be the card returned 2013-01-31 06:55:12 +00:00
omegablast2002@yahoo.com
aadd0c56b2 fixed a couple easy issues 2013-01-31 06:45:50 +00:00
anthonycalosa@gmail.com
29c50becf0 Added Pain Magnification 2013-01-30 15:51:07 +00:00
anthonycalosa@gmail.com
dffecf7ee0 Added Nim Devourer
Added Nourishing Shoal
Added Oak Street Innkeeper
Added Opal Avenger
-----------------
Revised Oriss, Samite Guardian - ability must be targeted
-----------------
fixed Blazing Shoal alternate cost
fixed Contaminated Ground trigger
2013-01-30 14:46:57 +00:00
omegablast2002@yahoo.com
eab782c32f this was accidental, i was just about to toy with a may pay( ability. 2013-01-30 04:22:01 +00:00
omegablast2002@yahoo.com
1b689adf05 forgot a ( in the replacement for donothing 2013-01-30 04:01:57 +00:00
omegablast2002@yahoo.com
c078af5f24 fix for crash from not having a playerTarget when ability$! is used on targetedPlayer by an instant. 2013-01-30 03:51:16 +00:00
anthonycalosa@gmail.com
d07951fbdf Added Nemesis Trap, Nicol Bolas, Planeswalker 2013-01-30 03:25:22 +00:00
omegablast2002@yahoo.com
415e8dbcb2 updated cards using 0/0 as a fake ability into donothing 2013-01-30 02:40:49 +00:00
omegablast2002@yahoo.com
f8800b8bbd added an ability keyword that resolves to do nothing.
"donothing"
this is to avoid using powerandtoughness 0/0 ability to mean "do nothing"

old code
[card]
name=Inquisition
target=player
auto=target(*|targetedpersonshand) 0/0
auto=foreach(*[white]|targetedpersonshand) damage:1 targetedplayer
text=Target player reveals his or her hand. Inquisition deals damage to that player equal to the number of white cards in his or her hand.
mana={2}{B}
type=Sorcery
[/card]

new code
[card]
name=Inquisition
target=player
auto=target(*|targetedpersonshand) donothing
auto=foreach(*[white]|targetedpersonshand) damage:1 targetedplayer
text=Target player reveals his or her hand. Inquisition deals damage to that player equal to the number of white cards in his or her hand.
mana={2}{B}
type=Sorcery
[/card]
2013-01-30 02:38:25 +00:00
omegablast2002@yahoo.com
b7a2c000be corrected typo in lurking evil.
just for future notice this card should be moved to crappy.
whenever an ability has
blah blah:effect
that means, {cost}:effect
if you can not do it with supported cost in engine, do not add it as
{0}:effect && effect
this is a workaround we stopped using a very very long time ago.
the ability of losing life is not treated the same as "paying" life. same as any other cost.

the issue arose several times while i have added support, and due to a workaround, my support would be flawed, at first i would try to munipulate what i coded to allow for the workarounds to continue working. 
that was the past, i long since stopped doing that, if a card is a workaround, and it breaks, i remove it completely.
2013-01-30 00:36:09 +00:00
Xawotihs@gmail.com
12620e5d22 Just tested network game Linux desktop vs Android tablet ... works fine :) 2013-01-29 21:05:24 +00:00
anthonycalosa@gmail.com
0a8c846f9a added:
Mangara's Equity
Maralen of the Mornsong
Mercenary Informer
Mind Swords
Monkey Cage
Myr Battlesphere
Mystic Snake
Necropolis
2013-01-29 15:35:16 +00:00
omegablast2002@yahoo.com
c7e1dfb72f added rules to hermit 2013-01-29 00:57:38 +00:00
Xawotihs@gmail.com
47cfc5bdeb Reverted TestSuiteAI.cpp from previous commit 2013-01-28 22:40:56 +00:00
Xawotihs@gmail.com
73131c8064 Removed unused variables 2013-01-28 22:37:01 +00:00
Xawotihs@gmail.com
48d45f2a65 Added missing .h and fixed the boost sleep, it works fine on linux now. 2013-01-28 22:26:13 +00:00
Xawotihs@gmail.com
faff7724d6 Added a function to get the current IP address 2013-01-28 22:03:26 +00:00
anthonycalosa@gmail.com
f1fa655306 added cards:
------------
Lore Broker
Lorthos, the Tidemaker
Luminarch Ascension
Lurking Evil
Magus of the Jar
Makeshift Mannequin
Malfegor
Manaforge Cinder
Memory Jar

fixed:
------------
Geist of Saint Traft token, it says @combat ends exile the token.
2013-01-28 12:56:32 +00:00
anthonycalosa@gmail.com
313598fab0 fixed sublime archangel 2013-01-28 06:58:53 +00:00
anthonycalosa@gmail.com
da186a6225 revised living death and living end 2013-01-28 06:06:13 +00:00
omegablast2002@yahoo.com
3ac3836538 added the stack to countValidTargets() 2013-01-28 05:04:34 +00:00
omegablast2002@yahoo.com
2b9cae8950 added functionality to may and choice ability so that it can check a "restriction{}" like a activated ability with cost, that can keep a menu option from appearing if the restriction is not met
auto=choice damage:1 target(creature) restriction{type(creature[blue])~morethan~1}

this choice menu will only appear is there is more than one blue creature inplay
2013-01-28 03:49:24 +00:00
anthonycalosa@gmail.com
a32a58f621 Added Cards:
------------
Laquatus's Champion
Lich's Tomb
Liege of the Tangle
Living Death
Living End,
Locust Miser
Lodestone Bauble

Fixes: Flakenrath Aristocrat, Sublime Archangel
2013-01-28 01:39:30 +00:00
omegablast2002@yahoo.com
eaf4d94a2e this part didnt commit in last rev, it fixes the mana display.
the progress is removed on this though, so you might not notice it until next release when you do a fresh install.
any new decks for both player or ai will show the mana symbols after a match is completed.
2013-01-27 19:35:52 +00:00
omegablast2002@yahoo.com
dac14020a2 fixed stats resetting and decks being marked as new.
this should also allow for the ai difficulty tools to work correctly again. mana symbols displayed again, mini info, and everything related to the stats.
2013-01-27 18:52:12 +00:00
wagic.the.homebrew@gmail.com
5fa1cc915b A "fix" for Android compilation. Feel free to replace if something better is available 2013-01-27 09:36:43 +00:00
omegablast2002@yahoo.com
2fcd031a7d corrected a crash from NULL pointer cause by ability$! not having the "lastcontroller" set. 2013-01-27 04:25:09 +00:00
omegablast2002@yahoo.com
822c3bc9c8 2013-01-27 02:56:23 +00:00
omegablast2002@yahoo.com
b7c13825c5 2013-01-27 02:55:35 +00:00
omegablast2002@yahoo.com
534d87e3bd fixed evolve hoepfully for the final time. 2013-01-27 02:54:03 +00:00
anthonycalosa@gmail.com
c1c6296c9c modified _tests.txt 2013-01-27 02:29:53 +00:00
anthonycalosa@gmail.com
79d9ad865e moved the evolve test outside the main test suite 2013-01-27 02:13:35 +00:00
wagic.the.homebrew@gmail.com
d8da70361a - Fix an android warning (false instead of null in GuiCombat)
- removed unnecessary "if" in some parts of MTGRules.cpp
2013-01-27 02:09:10 +00:00
anthonycalosa@gmail.com
f6e95af995 Added generic test for Evolve mechanic. I intentionally reverese the order of creature so that the evolve come in play with no counters before hand, then attack with utvara hellkite to see if it will trigger evolve. 2013-01-27 01:24:44 +00:00
anthonycalosa@gmail.com
892c7d34c0 fixed Firemane Avenger, added Knollspine Dragon 2013-01-27 00:13:10 +00:00
Xawotihs@gmail.com
975445d3d5 #ifdef out on Windows a fix for Linux 2013-01-26 22:35:57 +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
5b0f5bd90f fixed compilation for psp, ambiguous else warning. 2013-01-26 18:50:28 +00:00
omegablast2002@yahoo.com
3443c8d075 corrected a goof up i made in evolve, i should have been comparing the events card controller to source controller to determine "under your control" 2013-01-26 16:52:34 +00:00
Xawotihs@gmail.com
f45c8e1d41 Just won my first Wagic network game :)
In details:
- I removed my player swap idea, it caused tons of issues with randoms
- instead I simply keep both peer on the exact same game and added one single parameter allowing to configure the view on the game. So, each peer is rendering the same game (gameObserver class) from a different player point of view (DuelLayers and related classes).
- a lot of gui stuff are missing to prevent user forbidden interactions but it works fine on Windows
2013-01-26 16:42:16 +00:00
omegablast2002@yahoo.com
db0f401ba5 moved the triggering of forced lure block to eventblockerschoosen. this corrects issues where lure wasnt applying the abilities like flanking correctly on cards which were forced to block. 2013-01-26 16:23:22 +00:00
anthonycalosa@gmail.com
f59b8db91f Added test for Alluring Scent -> card that grants lure ability. the following are to test if forcing a block from lure, trigger events of a block. I don't know if the problem is lure or the flanking ability. the correct result is every creature must survive. flanking makes the walls power to 0. 2013-01-26 13:12:16 +00:00
anthonycalosa@gmail.com
ed77b40a29 added cards
--------------

Hurloon Shaman
Ignorant Bliss
Ill-Gotten Gains
Impatience
Innocent Blood
Jace's Archivist
Jin-Gitaxias, Core Augur
Kangee, Aerie Keeper
Keldon Battlewagon
Windfall

---------------
fixed Blazing Archon
2013-01-26 09:14:26 +00:00
Xawotihs@gmail.com
365fe10765 Fixed another dumb warning reported in the forum and added a nice assert for synchronization issues during network game. So, don't try it if you're not ready to get crashes in the face. 2013-01-26 08:07:31 +00:00
Xawotihs@gmail.com
da2098368b Added dumb cast for dumb compilators 2013-01-25 23:45:58 +00:00
Xawotihs@gmail.com
2ba5eb0022 Cleaned up Network code (hope that fixes the PSP compilation problems)
Added random seed logging
2013-01-25 21:47:16 +00:00
omegablast2002@yahoo.com
4bf419fbaf corrected evolve triggering from cards moving from inplay to inplay. 2013-01-25 19:56:26 +00:00
anthonycalosa@gmail.com
84950ad1f8 Added test for taunting elf. 2013-01-25 14:51:48 +00:00
omegablast2002@yahoo.com
0db78c0444 force a lure block when the players decide they want to skip the action, a lurer MUST be blocked if the defending creature can block it. this action can not be skipped. 2013-01-25 14:25:26 +00:00
anthonycalosa@gmail.com
f1032c64b5 changed add:{mana} to add{mana} 2013-01-25 02:19:29 +00:00
punkeduard@gmail.com
78797356ea Fixes on Markov Warlord, Skarrg Guildmage 2013-01-25 01:53:03 +00:00
anthonycalosa@gmail.com
2c00d99563 fixed card ability
-------------------
Dwell on the Past
Krosan Reclamation
Loaming Shaman
Memory's Journey
Stream of Consciousness
2013-01-25 01:29:05 +00:00
omegablast2002@yahoo.com
798258798c corrected an issue where ai was able to ignore lure ability 2013-01-24 21:04:23 +00:00
anthonycalosa@gmail.com
fccedcaaab added cards
--------------
Grand Abolisher
Hamletback Goliath
Hanabi Blast
Harmonic Sliver
Heed the Mists
Hellkite Charger
Hired Giant
Homeward Path
Hunter's Insight

---------------
fixed Arboria
fixed Hunters' Feast
fixed Zhang Liao, Hero of Hefei
2013-01-24 17:55:41 +00:00
anthonycalosa@gmail.com
80cdd56971 Added GTC Cards 192/249 (including reprints) refactored all names, ability texts, all codes. also include some fixes on other cards :)
--------------------------------------------------------------------

AEtherize
Adaptive Snapjaw
Aerial Maneuver
Agoraphobia
Alms Beast
Alpha Authority
Angelic Edict
Angelic Skirmisher
Armored Transport
Arrows of Justice
Assemble the Legion
Aurelia, the Warleader
Biomass Mutation
Biovisionary
Bomber Corps
Boros Charm
Boros Elite
Boros Guildgate
Boros Keyrune
Boros Reckoner
Burning-Tree Emissary
Burst of Strength
Cartel Aristocrat
Clinging Anemones
Cloudfin Raptor
Coerced Confession
Corpse Blockade
Court Street Denizen
Crackling Perimeter
Crocanura
Crowned Ceratok
Daring Skyjek
Death's Approach
Deathcult Rogue
Deathpact Angel
Debtor's Pulpit
Devour Flesh
Dimir Guildgate
Dimir Keyrune
Dinrova Horror
Disciple of the Old Ways
Drakewing Krasis
Duskmantle Guildmage
Dutiful Thrull
Dying Wish
Elusive Krasis
Enter the Infinite
Executioner's Swing
Experiment One
Fathom Mage
Firefist Striker
Firemane Avenger
Five-Alarm Fire
Forced Adaptation
Fortress Cyclops
Foundry Champion
Foundry Street Denizen
Frilled Oculus
Furious Resistance
Gateway Shade
Ghor-Clan Rampager
Giant Adephage
Gideon, Champion of Justice
Gift of Orzhova
Glaring Spotlight
Greenside Watcher
Gridlock
Grisly Spectacle
Ground Assault
Gruul Charm
Gruul Guildgate
Gruul Keyrune
Gruul Ragebeast
Guildscorn Ward
Gutter Skulk
Gyre Sage
Hellkite Tyrant
Hellraiser Goblin
High Priest of Penance
Hindervines
Hold the Gates
Holy Mantle
Homing Lightning
Horror of the Dim
Hydroform
Illness in the Ranks
Immortal Servitude
Incursion Specialist
Ivy Lane Denizen
Keymaster Rogue
Killing Glare
Knight Watch
Legion Loyalist
Leyline Phantom
Luminate Primordial
Martial Glory
Massive Raid
Master Biomancer
Merciless Eviction
Merfolk of the Depths
Metropolis Sprite
Millennial Gargoyle
Miming Slime
Mindeye Drake
Molten Primordial
Mortus Strider
Mugging
Murder Investigation
Nav Squad Commandos
Nimbus Swimmer
Obzedat, Ghost Council
Ogre Slumlord
One Thousand Lashes
Ordruun Veteran
Orzhov Guildgate
Orzhov Keyrune
Pit Fight
Predator's Rapport
Primal Visitation
Prime Speaker Zegana
Psychic Strike
Purge the Profane
Rapid Hybridization
Razortip Whip
Realmwright
Riot Gear
Rubblebelt Raiders
Rubblehulk
Ruination Wurm
Rust Scarab
Sage's Row Denizen
Sapphire Drake
Scab-Clan Charger
Scatter Arc
Scorchwalker
Sepulchral Primordial
Serene Remembrance
Shadow Alley Denizen
Shambleshark
Shattering Blow
Shielded Passage
Simic Fluxmage
Simic Guildgate
Simic Keyrune
Skarrg Goliath
Skarrg Guildmage
Skinbrand Goblin
Skyblinder Staff
Skygames
Slate Street Ruffian
Slaughterhorn
Smog Elemental
Spark Trooper
Spire Tracer
Sunhome Guildmage
Sylvan Primordial
Tin Street Market
Totally Lost
Tower Defense
Towering Thunderfist
Truefire Paladin
Urban Evolution
Urbis Protector
Verdant Haven
Viashino Shanktail
Vizkopa Guildmage
Warmind Infantry
Wasteland Viper
Way of the Thief
Wight of Precinct Six
Wildwood Rebirth
Wojek Halberdiers
Wrecking Ogre
Zarichi Tiger
Zhur-Taa Swine

TODO:merge unsupported cards from GTC (but will wait for zeth)
2013-01-24 03:57:02 +00:00
anthonycalosa@gmail.com
ba682e4802 Added:
Gaea's Blessing
Garza's Assassin
Gauntlet of Power
Gerrard's Verdict
Gigantiform
Glory of Warfare
Goblin Brawler
Smite

Fixes:
Opalescence
Thelonite Monk
2013-01-23 03:11:13 +00:00
anthonycalosa@gmail.com
db0dae7f8d Added GTC dat files, all ID, names and rarity are 100% accurate from gatherer. :) (exception change Æ to AE) 2013-01-23 02:07:40 +00:00
Xawotihs@gmail.com
9db8478dfe Created a NetworkGameObserver class able to extend the serialization code of GameObserver to synchronize and forward game actions on the network
Fixes in GameObserver serialization/deserialization code
Fixes in JNetwork and JSocket on windows
Various code cleanup (currentGamePhase access in particular)
Updated GUI code to re-enable a basic network GUI
Activated threaded tests on Windows. It uses 4 threads by default.
2013-01-22 22:39:49 +00:00
anthonycalosa@gmail.com
ada0a1555d cleanup remaining space in add_{mana} 2013-01-22 06:03:45 +00:00
anthonycalosa@gmail.com
782a8305fe Removed all spaces in auto line : Add_{mana} 2013-01-22 05:52:14 +00:00
anthonycalosa@gmail.com
f04dfac4b5 fixed Eiganjo Castle, Nezumi Shortfang, Shimian Specter 2013-01-22 03:34:10 +00:00
anthonycalosa@gmail.com
0b4ebc6e51 fix drana, banshee and added fleshbag marauder, fortune thief, fractured loyalty, frantic search, fungus elemental 2013-01-21 15:26:41 +00:00
anthonycalosa@gmail.com
cae9ff79d6 3rd Part: Dredge & Others
added 19 other cards from unsupported
-------------------------------------
Deus of Calamity
Diaochan, Artful Beauty
Dralnu's Pet
Dreams of the Dead
Due Respect
Ebon Praetor
Ego Erasure
Elemental Mastery
Erhnam Djinn
Essence Vortex
Exhume
False Cure
False Memories
Fanning the Flames
Feast of Worms
Festival of the Guildpact
Fight to the Death
Figure of Destiny
Final Punishment

added 16 dredge & cards with "draw" replacement
-----------------------------------------------
Dakmor Salvage
Darkblast
Golgari Brownscale
Golgari Grave-Troll
Golgari Thug
Grave-Shell Scarab
Greater Mossdog
Life from the Loam
Moldervine Cloak
Necroplasm
Nightmare Void
Obstinate Familiar
Plagiarize
Shambling Shell
Stinkweed Imp
Thought Reflection
2013-01-21 04:54:59 +00:00
anthonycalosa@gmail.com
32d06d1148 change damagecount as damage counter to actual damage received for "normal case" damage, this fixes odcount and pdcount int values. 2013-01-21 01:24:19 +00:00
omegablast2002@yahoo.com
1b7b1e2cf1 add dredge rule. 2013-01-20 20:13:32 +00:00
omegablast2002@yahoo.com
ca3dc49d71 added basic card draw replacement,
auto=replacedraw choice damage:2

auto=replacedraw choice draw:2 noreplace

notice noreplace exempts the draw from sending a draw event. draw events and drawn events are seperate events.

added dredge and it's rules.

[card]
name=Dakmor Salvage
auto=tap
auto={t}:add{b}
dredge=dredge(2)
text=Dakmor Salvage enters the battlefield tapped. -- {T}: Add {B} to your mana pool. -- Dredge 2 (If you would draw a card, instead you may put exactly two cards from the top of your library into your graveyard. If you do, return this card from your graveyard to your hand. Otherwise, draw a card.)
type=Land
[/card]
2013-01-20 20:13:07 +00:00
punkeduard@gmail.com
0709aaefb8 Added from the vaults: realms, after research concluded the official abbreviation is V12 and the others FTV sets should remain the same, this set is just reprints supported 13/15 total 2013-01-19 19:49:36 +00:00
anthonycalosa@gmail.com
69af807510 added City of Solitude, Detonate, Dosan the Falling Leaf, Harsh Justice.
added restriction for Reset, fixed Seedtime, fixed Wild Defiance, fixed Abundant Growth (thanks excessum)
2013-01-19 08:46:10 +00:00
omegablast2002@yahoo.com
a9352a3b69 opened all possible restrictions to be checked as a intvalue of 1, inline with anthonys change a couple revs back.
this(variable:restriction{casted a spell})
2013-01-19 02:06:46 +00:00
anthonycalosa@gmail.com
e67084afb9 Added restriction "during my turn", "during opponent turn".
Added variable "controllerturn", "opponentturn" -> returns integer value if its your turn then 1 if not then 0.

ex. use

restriction=during my turn
otherrestriction=during opponent turn
auto=this(variable{controllerturn}) lord(creature|mybattlefield) 8/0
auto=this(variable{opponentturn}) lord(creature|mybattlefield) 0/8
2013-01-18 04:41:24 +00:00
anthonycalosa@gmail.com
fda7166752 2nd Part:
Added entwine cards and other cards as of SVN r4587.

Entwine Cards
----------------------
Incite War
Journey of Discovery
Promise of Power
Roar of the Kha
Rude Awakening
Savage Beating
Solar Tide
Stir the Pride
Temporal Cascade
Tooth and Nail
Wail of the Nim

Cards from Unsupported
----------------------
Circle of Protection: Shadow
Circle of Solace
Cloudstone Curio
Coalition Relic
Commando Raid
Copy Artifact
Cornered Market
Crack the Earth
Crag Saurian
Crescendo of War
Crypt Champion
Curfew
Dance of the Dead


I don't have an exact amount of cards supported in the latest SVN because there are a lot of cards in my local copy to be tested before commiting.

OT: I think overload card can be done if the target card and store it for use until the spell resolves. ex:

[card]
name=Blustersquall
other={3}{U} name(Overload)
auto=if paid(alternative) then tap all(creature)
auto=ifnot paid(alternative) then tap all(mytarget)
text=Tap target creature you don't control. -- Overload {3}{U} (You may cast this spell for its overload cost. If you do, change its text by replacing all instances of "target" with "each.")
mana={U}{target(creature|opponentbattlefield)}
type=Instant
[/card]
2013-01-17 02:52:02 +00:00
anthonycalosa@gmail.com
5f90d1ee9f added keyword phandcount - player hand count
added keyword ohandcount - opponent hand count
2013-01-16 12:08:46 +00:00
omegablast2002@yahoo.com
a26f872ff3 add restriction for checking what alternative cost was paid. combined with if/ifnot ability becomes a very powerful tool.
paid(blah)
auto=if paid(alternative) then damage:3 target(creature)
auto=if paid(alternative) then life:10 target(player)
auto=ifnot paid(alternative) then damage:3 controller
auto=ifnot paid(alternative) then life:4 opponent

it can be used any place a restriction can be used. 
rearranged the constants for the payment type keywords to match the order we int the alternatePayment array on a card, added keywords for the remaining payment types, 

    "notpaid",
    "paidmana",
the 2 above pretain to paying the real manacost of a card
it checks the mana={1} cost line and is not joined to the other types.

    "kicker", 
    "alternative", 
    "buyback", 
    "flashback", 
    "retrace", 
    "facedown",
    "suspended"

note: all test pass in this revision.
2013-01-15 02:11:05 +00:00
anthonycalosa@gmail.com
9201860744 Added Oracle of Nectars gain life test. I have 2 tests failed, gain X life and ai proliferation. It seems there is an issue on my maxglee profile(the one i have with lots of deck, i mean a lot). Now I changed my profile to default profile(the one with a demo deck), restarted and run the tests a couple of times and my tests are all succesful 100%. 2013-01-15 01:59:48 +00:00
omegablast2002@yahoo.com
a608de3b73 corrected stasis test to follow the new coding which actually works :)
corrected steelclad_serpent2 test missing choice 0 and p2.

ai proliferate test was not failing for me. it was sucessful on each run.

note 100% pass on this rev.
2013-01-14 23:39:08 +00:00
anthonycalosa@gmail.com
0a8a88f817 fixed kudzu, master of etherium, nevinyrrals disk tests. 3 failed tests remains (phase problems which i really don't know why it fails). all other tests are succesful. 2013-01-14 17:40:07 +00:00
anthonycalosa@gmail.com
e1d2bf56c5 fixed hanna's custody shroud test.(i just changed the rack and black vise to rackling and viseling...gotta get some sleep...:(..) 2013-01-14 17:00:52 +00:00
anthonycalosa@gmail.com
98ea63485d updated kudzu, kudzu2 test. change all(mytgt) to all(trigger) for kudzu. now for kudzu_i168.txt i don't quite understand what is the expected output for this so i leave it unchanged. 2013-01-14 16:46:17 +00:00
anthonycalosa@gmail.com
598ffb1f9b Fixed rampant growth & orcish lumberjack tests (missing choice 0) 2013-01-14 16:03:11 +00:00
anthonycalosa@gmail.com
c3586126a5 Fixed Gamble and Gamble test(it failed because the command has a missing choose 0). Soft coded Insolence, Mana Short, Sacrifice and Touch of Vitae. Changed Rot Wulf to Rot Wolf.
TODO: there are several test that needs updating prior to changes in card primitives (the ones that failed 11 are left).
2013-01-14 15:26:00 +00:00
wagic.the.homebrew@gmail.com
cbcc5a57ca Fixing Gamble (I am aware that this makes the card less close to the rules in theory, but now the test passes. Let's not break some parts of a card when we fix other parts, please).
It is possible revision 4519 introduced other similar issues in other cards, but that revision was so big that I didn't want to revert it entirely
2013-01-14 12:37:53 +00:00
wagic.the.homebrew@gmail.com
9b47a64fd9 reverting r4569. This fixes Flare, and potentially other cards using the same mechanism 2013-01-14 12:14:19 +00:00
wagic.the.homebrew@gmail.com
83c0ee2c28 Fixed "Animate Artifact" tests 2013-01-14 11:26:22 +00:00
wagic.the.homebrew@gmail.com
4be2c39566 Fixed Test for Black Vise 2013-01-14 11:19:04 +00:00
wagic.the.homebrew@gmail.com
1f8e1179cc Fix for issue 930 (Farmstead can be used more than once per turn) 2013-01-14 11:10:01 +00:00
wagic.the.homebrew@gmail.com
2d11392e47 Fixed famrstead test. Sadly, this doesn't fix the card 2013-01-14 08:06:12 +00:00
anthonycalosa@gmail.com
0fcfb43d3a Softcoded Storm Seeker, Traumatize, Venomous Dragonfly 2013-01-14 03:23:33 +00:00
anthonycalosa@gmail.com
2a1f29aebc Fixed remaining transform cards to creatures that uses */* 2013-01-13 15:58:06 +00:00
anthonycalosa@gmail.com
e7dd2e02d6 Fixed some cards that transforms into creature (must use setpower and settoughness, if not the effects are like +1/+1). TODO.... 2013-01-13 14:31:15 +00:00
anthonycalosa@gmail.com
da15bb7427 Fixed Rot Wolf, Revised @next upkeep card draw. 2013-01-13 13:59:24 +00:00
anthonycalosa@gmail.com
6410e25bcc Added check for Ali from Cairo, if you are dealt damage to reduce your life less than 1 from your life total, and you gain life greater than 1, it will not set your life to 1. 2013-01-12 14:44:26 +00:00
anthonycalosa@gmail.com
14e0093eaf Added 16 cards from unsupported.txt
------------------------------------

Abeyance
Agadeem Occultist
Ali from Cairo
Antagonism
Aphetto Dredging
Aquitect's Will
Aura Barbs
Beseech the Queen
Blazing Shoal
Blind Seer
Budoka Gardener
Dokai, Weaver of Life
Builder's Bane
Burrenton Forge-Tender
Cauldron Dance
Cephalid Constable
2013-01-12 14:30:55 +00:00
anthonycalosa@gmail.com
3b08a05421 Fixed all cards that transform cards into new color as an additional color. Added Indigo Faerie. 2013-01-12 14:04:48 +00:00
punkeduard@gmail.com
f74e2019cc Fixed some AVR cards reported on the forums 2013-01-12 04:55:01 +00:00
punkeduard@gmail.com
93c9f12eff Added Dwarven Hold, fixed typo in Curse of the Nightly Hunt, removed sxtra blank space 2013-01-12 04:28:00 +00:00
anthonycalosa@gmail.com
80a3e37961 removed unnecesary spaces in primitives/mtg.txt. 2013-01-11 17:21:10 +00:00
anthonycalosa@gmail.com
4e9dc2c3b1 Added Wurm Token for Garruk, Primal Hunter because it produces 2 different tokens. Change Glory and Zombie Boa chooseacolor to activatechooseacolor. 2013-01-11 12:55:57 +00:00
anthonycalosa@gmail.com
b78c8084be Card Fixes:
------------

Dragon Broodmother - change token id to source card token id
Kjeldoran Javelineer - revised code
Malignant Growth - Growth counter damage
Marsh Crocodile - revised code
Mindslash Sliver - revised code
Phyrexian Etchings - revised code
Psychic Vortex - revised code
Sheltering Ancient - dynamicability<!agecountersoneone!>
Wall of Shards - revised code

updated ARB/_cards.dat (pls. update your ARB set folder)
2013-01-11 07:43:29 +00:00
anthonycalosa@gmail.com
8119f3bc05 fixes includes some card id of tokens be change to display image in game. please update your sets folder and images.
Card Fixes:
--------------

Ajani Goldmane - moved token id to dat file
Army of the Damned - change token id to source token id
Black Vise -  can choose opponent
Chromium - upcost sacrifice
Elephant Resurgence - change token id to source token id
Melancholy - upcost sacrifice
Midnight Ritual - change token id to source token id
Polar Kraken - fix upcost
Rackling - soft coded
Skeletonize - must target beforehand and fix token color & id
Storm World - fix. can't use foreach..<4 because X is 4 minus the cards
Tatsumasa, the Dragon's Fang - revised workaround
Terastodon - change token id to source token id
Tetravus - change token id to source token id
The Rack - soft coded
Thirst - upcost sacrifice
Tombstone Stairwell - revised ability, removed tombspawn primitive
Varchild's War-Riders - fix cumulative upcost
Venser, the Sojourner - fix loyalty counters
Vexing Sphinx - upcost sacrifice
Vraska the Unseen - moved token id
Wall of Shards - fix cumulative upcost
Waylay - generic token coded
Wheel of Torture - fix. can't use foreach..<3 because X is 3 minus the cards

updated necessary dat files for the token ids.
2013-01-10 17:36:22 +00:00
anthonycalosa@gmail.com
0e4994c22c Added 6 Legendary Dragons
-------------------------
Crosis, the Purger
Dromar, the Banisher
Numot, the Devastator
Rith, the Awakener
Treva, the Renewer
Vorosh, the Hunter

Fixed 2 Legendary Dragons
-------------------------
Oros, the Avenger
Teneb, the Harvester


If we have like UEOP ( until end of phase| until end of step ) keyword this will be perfect, but for now I use oneshot. :)
2013-01-10 07:44:55 +00:00
anthonycalosa@gmail.com
c6117fdfb3 Revised Goblin Clearcutter, Manamorphose, Orcish Lumberjack and Terrarion ability. 2013-01-09 11:44:44 +00:00
anthonycalosa@gmail.com
1ff10ed4c7 Added Blinding Powder, Heartseeker and Leonin Bola.
Fixed Finest Hour missing ability, Fire Dragon and Godo, Bandit Warlord typo
2013-01-09 08:05:40 +00:00
anthonycalosa@gmail.com
d83415ed3b fixed Umezawa Jitte menu ability, Centaur Glade token typo, Ghitu-Fire eater missing player target and Flame Elemental dynamic ability typo. 2013-01-09 03:32:11 +00:00
anthonycalosa@gmail.com
e69e002c1a Revised code for Atalya, Samite Master, Crimson Hellkite and Crypt Rats to use {X:color}
Cleaned Manacost.cpp

My observation so far when paying X in activated abilities, when X doesn't work, I press escape to get in the main menu and play another game(test again), then X activated ability will work. I really don't know where to start/look for the cause of it.
2013-01-08 13:26:42 +00:00
anthonycalosa@gmail.com
e5b56cfffb Added 16 cards
---------------
Lure Cards:
Alluring Scent
Bloodscent
Elvish Bard
Gift of the Deity
Golgari Decoy
Lure
Mortipede
Nemesis Mask
Prized Unicorn
Seton's Desire
Shinen of Life's Roar
Stone-Tongue Basilisk
Taunting Challenge
Taunting Elf
---------------
No Legend Cards:
Brothers Yamazaki
Mirror Gallery
2013-01-08 04:01:25 +00:00
anthonycalosa@gmail.com
eeb5a4235b Angel of Serenity - fix ability (like mesmeric fiend, blinked cards return to owners hand if source leaves play)
Angel's Tomb - added may

Archaeomancer - added check

Cathedral of War - removed space

Defang - revised code

Dismal Failure - revised code

Gallows at Willow Hill - removed extra activation cost

Ghostly Flicker - target fix

Hidden Retreat - fix targeted card ability
2013-01-08 03:35:36 +00:00
omegablast2002@yahoo.com
2aed88a44f fixed the simplemenu scrolling bug, the scrolling will no longer jump to the final selection you made when scrolling down and up. 2013-01-07 21:33:59 +00:00
anthonycalosa@gmail.com
b007190d98 updated CHK dat file. 2013-01-07 09:29:43 +00:00
anthonycalosa@gmail.com
510a8c4222 added nolegend ability. this doesn't remove legend rule, it only makes a card thas has nolegend ability excluded from check. 2013-01-07 06:46:56 +00:00
Xawotihs@gmail.com
e2be750780 Adding boost random support and system libs 2013-01-06 19:44:18 +00:00
Xawotihs@gmail.com
38ebdde6ed Adding boost uuid support 2013-01-06 17:53:29 +00:00
Xawotihs@gmail.com
579a651e3d Adding boost weak pointer support 2013-01-06 17:49:55 +00:00
punkeduard@gmail.com
a95a2c4dc2 fixed tribute to hunger, far wandering 2013-01-06 17:32:50 +00:00
punkeduard@gmail.com
edb3295af0 Updated crappy, borderline and mtg to include/fix some cards related to chosen discard 2013-01-06 17:08:21 +00:00
anthonycalosa@gmail.com
3b07ad6b7f Merge RTR card primitives to mtg.txt
187 cards merged:

Abrupt Decay
Aerial Predation
Angel of Serenity
Annihilating Fire
Aquus Steed
Archon of the Triumvirate
Archweaver
Armada Wurm
Armory Guard
Ash Zealot
Assassin's Strike
Auger Spree
Avenging Arrow
Axebane Guardian
Axebane Stag
Azorius Arrester
Azorius Charm
Azorius Guildgate
Azorius Justiciar
Azorius Keyrune
Azor's Elocutors
Batterhorn
Bazaar Krovod
Bellows Lizard
Blistercoil Weird
Bloodfray Giant
Brushstrider
Call of the Conclave
Carnival Hellsteed
Catacomb Slug
Centaur Healer
Centaur's Herald
Chaos Imps
Chorus of Might
Chromatic Lantern
Chronic Flooding
Civic Saber
Cobblebrute
Codex Shredder
Collective Blessing
Common Bond
Concordia Pegasus
Coursers' Accord
Crosstown Courier
Cryptborn Horror
Daggerdrome Imp
Dark Revenant
Dead Reveler
Deadbridge Goliath
Deathrite Shaman
Death's Presence
Detention Sphere
Deviant Glee
Doorkeeper
Dramatic Rescue
Dreadbore
Dreg Mangler
Drudge Beetle
Druid's Deliverance
Dryad Militant
Essence Backlash
Ethereal Armor
Explosive Impact
Eyes in the Skies
Faerie Impostor
Fall of the Gavel
Fencing Ace
Frostburn Weird
Gatecreeper Vine
Gobbling Ooze
Goblin Electromancer
Goblin Rally
Golgari Charm
Golgari Guildgate
Golgari Keyrune
Golgari Longlegs
Gore-House Chainwalker
Grim Roustabout
Grove of the Guardian
Growing Ranks
Guttersnipe
Hellhole Flailer
Horncaller's Chant
Hover Barrier
Hussar Patrol
Hypersonic Dragon
Inaction Injunction
Isperia, Supreme Judge
Isperia's Skywatch
Izzet Guildgate
Izzet Keyrune
Jarad, Golgari Lich Lord
Jarad's Orders
Keening Apparition
Knightly Valor
Korozda Guildmage
Korozda Monitor
Launch Party
Lobber Crew
Lotleth Troll
Lyev Skyknight
Mana Bloom
Martial Law
Mercurial Chemister
Minotaur Aggressor
Necropolis Regent
New Prahv Guildmage
Niv-Mizzet, Dracogenius
Ogre Jailbreaker
Pack Rat
Perilous Shadow
Phantom General
Precinct Captain
Psychic Spiral
Pursuit of Flight
Pyroconvergence
Racecourse Fury
Rakdos Cackler
Rakdos Charm
Rakdos Guildgate
Rakdos Keyrune
Rakdos Ragemutt
Rakdos Ringleader
Rakdos Shred-Freak
Rakdos's Return
Righteous Authority
Risen Sanctuary
Rogue's Passage
Rootborn Defenses
Rubbleback Rhino
Runewing
Savage Surge
Search Warrant
Security Blockade
Selesnya Charm
Selesnya Guildgate
Selesnya Keyrune
Selesnya Sentry
Seller of Songbirds
Sewer Shambler
Shrieking Affliction
Skull Rend
Skyline Predator
Skymark Roc
Slime Molding
Slitherhead
Sluiceway Scorpion
Soul Tithe
Soulsworn Spirit
Spawn of Rix Maadi
Sphinx's Revelation
Splatter Thug
Stab Wound
Stealer of Secrets
Stonefare Crocodile
Street Sweeper
Sundering Growth
Sunspire Griffin
Supreme Verdict
Survey the Wreckage
Swift Justice
Tavern Swindler
Tenement Crasher
Terrus Wurm
Thoughtflare
Thrill-Kill Assassin
Towering Indrik
Trained Caracal
Transguild Promenade
Treasured Find
Trestle Troll
Trostani, Selesnya's Voice
Trostani's Judgment
Ultimate Price
Underworld Connections
Urban Burgeoning
Utvara Hellkite
Vassal Soul
Viashino Racketeer
Vitu-Ghazi Guildmage
Voidwielder
Volatile Rig
Vraska the Unseen
Wayfaring Temple
Wild Beastmaster
Worldspine Wurm
Zanikev Locust
2013-01-06 16:41:52 +00:00
anthonycalosa@gmail.com
5c0a69ea54 Merge AVR, M13, PC2 card primitives to MTG.txt
284 cards merged:

Abundant Growth
Aggravate
Ajani, Caller of the Pride
Ajani's Sunstriker
Alchemist's Apprentice
Alchemist's Refuge
Amass the Components
Angel of Glory's Rise
Angel's Tomb
Angelic Armaments
Appetite for Brains
Arcane Melee
Archaeomancer
Archwing Dragon
Arctic Aven
Attended Knight
Avacyn, Angel of Hope
Baleful Strix
Banners Raised
Battle Hymn
Battleflight Eagle
Beetleback Chief
Bladed Bracers
Blood Artist
Blood Reckoning
Bloodflow Connoisseur
Bloodhunter Bat
Bond Beetle
Boundless Realms
Bower Passage
Brindle Shoat
Bruna, Light of Alabaster
Builder's Blessing
Butcher Ghoul
Call to Serve
Captain of the Mists
Captain's Call
Cathars' Crusade
Cathedral of War
Cathedral Sanctifier
Chandra's Fury
Chronomaton
Cleaver Riot
Cloudshift
Commander's Authority
Human Token
Conjurer's Closet
Corpse Traders
Cower in Fear
Craterhoof Behemoth
Craterize
Crimson Muckwader
Crippling Blight
Crippling Chill
Crusader of Odric
Cursebreak
Dangerous Wager
Deadeye Navigator
Death Wind
Defang
Defy Death
Demonic Rising
Demonic Taskmaster
Demonlord of Ashmouth
Desolate Lighthouse
Devout Chaplain
Diabolic Revelation
Diregraf Escort
Disciple of Bolas
Downpour
Dragon Hatchling
Dragonlair Spider
Dread Slaver
Dreadwaters
Dreampod Druid
Driver of the Dead
Druid's Familiar
Druids' Repository
Duskmantle Prowler
Duty-Bound Dead
Eaten by Spiders
Elderscale Wurm
Elgaud Shieldmate
Emancipation Angel
Encrust
Essence Harvest
Evernight Shade
Exquisite Blood
Faerie Invaders
Faith's Reward
Falkenrath Exterminator
Farbog Explorer
Favorable Winds
Fervent Cathar
Fettergeist
Firewing Phoenix
Flames of the Firebrand
Flinthoof Boar
Fungal Sprouting
Gallows at Willow Hill
Spirit Token
Galvanic Alchemist
Geist Snatch
Geist Trappers
Ghostform
Ghostly Flicker
Ghostly Touch
Ghoulflesh
Goblin Battle Jester
Goldnight Commander
Goldnight Redeemer
Grave Exchange
Griffin Protector
Griselbrand
Grounded
Gryff Vanguard
Guardian Lions
Guise of Fire
Hanweir Lancer
Harbor Bandit
Harvester of Souls
Haunted Guardian
Havengul Skaab
Havengul Vampire
Healer of the Pride
Heirs of Stromkirk
Hellion Crucible
Herald of War
Holy Justiciar
Homicidal Seclusion
Hound of Griselbrand
Howlgeist
Human Frailty
Hunted Ghoul
Hydrosurge
Illusory Angel
Into the Void
Jace's Phantasm
Kessig Malcontents
Knight of Glory
Knight of Infamy
Krenko, Mob Boss
Krenko's Command
Krond the Dawn-Clad
Kruin Striker
Latch Seeker
Leap of Faith
Lightning Mauler
Lightning Prowess
Liliana of the Dark Realms
Liliana's Shade
Maalfeld Twins
Mad Prophet
Magmaquake
Malicious Intent
Mark of the Vampire
Marrow Bats
Mass Appeal
Mass Mutiny
Master of the Pearl Trident
Mental Agony
Midnight Duelist
Midvast Protector
Mind Sculpt
Mist Raven
Moonlight Geist
Moonsilver Spear
Moorland Inquisitor
Murder
Mwonvuli Beast Tracker
Narstad Scrapper
Natural End
Nearheath Pilgrim
Necrobite
Nefarox, Overlord of Grixis
Nephalia Smuggler
Nettle Swine
Nightshade Peddler
Otherworld Atlas
Pathbreaker Wurm
Pillar of Flame
Polluted Dead
Predator's Gambit
Preyseizer Dragon
Primal Huntbeast
Prized Elephant
Public Execution
Raging Poltergeist
Ranger's Path
Reckless Brute
Renegade Demon
Restoration Angel
Riders of Gavony
Righteous Blow
Ring of Evos Isle
Ring of Kalonia
Ring of Thune
Ring of Valkas
Ring of Xathrid
Riot Ringleader
Roaring Primadox
Rotcrown Ghoul
Rummaging Goblin
Rush of Blood
Sai of the Shinobi
Sakashima's Student
Sands of Delirium
Scalding Devil
Scrapskin Drake
Scroll of Avacyn
Scroll of Griselbrand
Searchlight Geist
Searing Spear
Sentinel Spider
Seraph of Dawn
Seraph Sanctuary
Serpent's Gift
Servant of Nefarox
Sheltering Word
Show of Valor
Silverblade Paladin
Slayers' Stronghold
Slumbering Dragon
Smelt
Snare the Skies
Somberwald Vigilante
Soul of the Harvest
Soulcage Fiend
Spectral Gateguards
Spectral Prison
Spiked Baloth
Spirit Away
Staff of Nin
Stern Mentor
Stonewright
Sublime Archangel
Talrand, Sky Summoner
Talrand's Invocation
Tamiyo, the Moon Sage
Tandem Lookout
Terrifying Presence
Thatcher Revolt
Thraben Valiant
Thragtusk
Thundermaw Hellkite
Tibalt, the Fiend-Blooded
Timberland Guide
Timberpack Wolf
Tormentor's Trident
Touch of the Eternal
Trading Post
Treacherous Pit-Dweller
Tricks of the Trade
Triumph of Cruelty
Triumph of Ferocity
Trusted Forcemage
Ulvenwald Tracker
Uncanny Speed
Undead Executioner
Unhallowed Pact
Veilborn Ghoul
Vela the Night-Clad
Vessel of Endless Rest
Vigilante Justice
Vile Rebirth
Voice of the Provinces
Void Stalker
Vorstclaw
Wandering Wolf
War Falcon
Warclamp Mastiff
Watercourser
Wild Defiance
Wild Guess
Wingcrafter
Wolfir Avenger
Wolfir Silverheart
Worldfire
Xathrid Gorgon
Yeva, Nature's Herald
Yeva's Forcemage
Yew Spirit
Zealous Conscripts
Zealous Strike
2013-01-06 09:30:29 +00:00
anthonycalosa@gmail.com
747eec8692 Chill of Foreboding type change to sorcery
Scourge of the Nobilis ability fix 1/0
2013-01-05 15:36:31 +00:00
omegablast2002@yahoo.com
972e2b1ec2 added abilities=lure
"all creatures able to block blah must do so."
2013-01-05 05:01:31 +00:00
omegablast2002@yahoo.com
4960969640 added {unattach} cost
this can also be used for "equipped creature has unattach and blah" cards using 
auto=teach(creature) {unattach}:blah

also corrected a long standing guiupdating issue. a long long time ago a replace was removed from GuiPlay::Update in hopes to increase performance no amount of performance increase is worth having cards not updating thier position after an event recieve happens. this means curse will finally go to the correctly choosen players battlefield, equipment will no longer just linger after its target dies, auras won't stay on battlefield after a card is exiled. ect. no preformance decrease noticed, if anyone else notices one let me know.
2013-01-05 03:05:53 +00:00
omegablast2002@yahoo.com
2fa626b80e adding more strings to translation 2013-01-05 00:38:12 +00:00
Xawotihs@gmail.com
1049f90aa2 Fixed simultaneous access to the card DB. 2013-01-02 16:15:52 +00:00
omegablast2002@yahoo.com
a3017c215f corrected the translation of the phase names string in guiphasebar 2013-01-01 02:00:34 +00:00
omegablast2002@yahoo.com
ad50ce1d48 added a few items to translate on card gui. names and text should now correctly translate in trophy room and shop. 2012-12-31 16:17:38 +00:00
anthonycalosa@gmail.com
153203fba6 adjust alignment 2012-12-29 14:31:28 +00:00
anthonycalosa@gmail.com
780afb6e0c added missing damagecount reset for opponent. this should fix odcount this turn value 2012-12-29 14:25:49 +00:00
anthonycalosa@gmail.com
0ebb151a66 fix some flip cards:
Ichiga, Who Topples Oaks
Cunning Bandit
Garruk the Veil-Cursed
Homura's Essence
Rune-Tail's Essence
Rampaging Werewolf
2012-12-29 09:14:45 +00:00
anthonycalosa@gmail.com
0b1a88e3d7 Added unsupported cards from PC2, M13, RTR. 2012-12-29 03:21:51 +00:00
anthonycalosa@gmail.com
1ad4948594 Updated unsupported.txt, added unsupported cards from AVR.txt. 2012-12-29 01:20:23 +00:00
anthonycalosa@gmail.com
227cfc93f1 fix rarities for CMD, M11, ME4, PD2 2012-12-28 17:47:08 +00:00
anthonycalosa@gmail.com
d9ec37e096 RTR rarities correction 2012-12-28 17:00:02 +00:00
anthonycalosa@gmail.com
fd1becf59c added RTR dat 2012-12-28 16:51:25 +00:00
anthonycalosa@gmail.com
b3195d6111 Added RTR primitives, fix rarities in M12/_cards.dat, fix primitives/PC2.txt 2012-12-28 16:45:18 +00:00
anthonycalosa@gmail.com
755a43bb2a fix AVR, M13 codes and added some cards 2012-12-28 15:52:28 +00:00
anthonycalosa@gmail.com
08a7df0f19 fix M13/_cards.dat and fix M13 codes 2012-12-28 15:08:21 +00:00
anthonycalosa@gmail.com
02a7a7670a fix NPH/_cards.dat 2012-12-28 14:28:19 +00:00
anthonycalosa@gmail.com
2aae7d2c17 fix MBS/_cards.dat 2012-12-28 14:17:07 +00:00
anthonycalosa@gmail.com
35d32ff8fe fix AVR/_cards.dat and ISD/_cards.dat 2012-12-28 13:51:43 +00:00
anthonycalosa@gmail.com
05b775f50e Fix ISD/_cards.dat
change Séance to Seance
2012-12-28 13:38:23 +00:00
anthonycalosa@gmail.com
76efffb295 fix DKA/_cards.dat 2012-12-28 12:40:57 +00:00
anthonycalosa@gmail.com
fa5da87a98 revised primitives/mtg.txt.
-kevlahnota
Issue: 914,920,921
2012-12-28 10:00:23 +00:00
omegablast2002@yahoo.com
238cd124ae corrected the spelling of evolve. thanks kf1 2012-12-27 21:07:20 +00:00
Xawotihs@gmail.com
123a6aa21f Fixed remote hash retrieval 2012-12-26 18:14:27 +00:00
omegablast2002@yahoo.com
651d0b4623 added gatecrash "evole" mechanic.
auto=evole
2012-12-24 16:19:32 +00:00
omegablast2002@yahoo.com
2b4df1cc68 corrected helix pennicle to include a set of extra brackets wrapping the restriction. 2012-11-27 02:47:04 +00:00
omegablast2002@yahoo.com
4ad4689603 allowing restriction to also search for
restriction{{ }} incases where we will have squiqqly brackets in a tc.

this corrects the bug where helix pennicle restricted trigger was not triggering.
2012-11-27 02:45:01 +00:00
omegablast2002@yahoo.com
a87377b25a fixed an error in the reseting of setToughness, kind of a dumb error on my part because i was originally the coder :P
a creatures life and toughness are tied together, if you do not change both then the creature lives on.
2012-11-27 01:53:41 +00:00
omegablast2002@yahoo.com
ca446adf75 fixed a bug in sacrificed trigger. 2012-11-25 05:00:42 +00:00
omegablast2002@yahoo.com
92a8ccebd8 added a new tag to transforms(( keyword ... uynt ...meaning until your(the sources controller) next turn.
this should allow players to code cards with the detain ability of rtr correctly, as well as a handful of similar cards in the unsupported text.

detain is coded 
auto={1}{t}:target(creature|opponentBattlefield) transforms((Detained,newability[cantattack],newability[cantblock],newability[noactivatedability])) uynt

enjoy
2012-11-10 05:08:23 +00:00
punkeduard@gmail.com
8ac44677b8 Removed wild defiance, druids repository, abundant growth 2012-10-07 05:55:40 +00:00
punkeduard@gmail.com
a60a8af2b0 Primitives bug fixes 2012-09-24 02:49:32 +00:00
punkeduard@gmail.com
e809190a82 Added izzet vs golgari duel decks, updates some primitives and bug fixing in cards 2012-09-22 15:55:27 +00:00
punkeduard@gmail.com
901abd688a Fixed Yeva, Nature's Herald and Yeva's forcemage 2012-09-03 00:24:13 +00:00
omegablast2002@yahoo.com
ad055ad0b7 missed this file 2012-08-26 08:10:15 +00:00
omegablast2002@yahoo.com
3b447135fb fixed soulbond and testsuite issue, fixed crash from combohint not being int'ed to some AIStats(which are considered "human" 2012-08-26 08:08:36 +00:00
wagic.the.homebrew@gmail.com
7583e61510 remove non ascii characters from ZipFS 2012-08-26 06:07:48 +00:00
wagic.the.homebrew@gmail.com
8035d0f3fc Remove non ascii characters from WFont 2012-08-26 06:06:32 +00:00
omegablast2002@yahoo.com
38cdec5126 corrected a issue with "eachother" tag in adyanmic class...the damager should be the target to take into account triggers and deathtouch...thanks dopple. 2012-08-25 00:38:59 +00:00
omegablast2002@yahoo.com
78f5b11919 removed ABasilik class, this ability is completely soft codable now. 2012-08-25 00:27:22 +00:00
omegablast2002@yahoo.com
f5403b0e03 softcoded the final basilisk.... 2012-08-25 00:25:29 +00:00
omegablast2002@yahoo.com
a42c6b00a8 changed farmstead to softcode. 2012-08-25 00:07:47 +00:00
omegablast2002@yahoo.com
68f76fbaff removed farmstead hardcode, this card can now be soft coded 2012-08-25 00:07:10 +00:00
omegablast2002@yahoo.com
14695e7e5b removed kudzu hardcode, that card can be done with soft code...corrected frostbeast, it was incorrectly ignoring walls...it should destroy all even walls. 2012-08-24 23:59:35 +00:00
omegablast2002@yahoo.com
63ea7f88e2 soft coded kudzu. 2012-08-24 23:52:17 +00:00
omegablast2002@yahoo.com
0b89f0571e corrected elder cather code. 2012-08-24 23:43:15 +00:00
omegablast2002@yahoo.com
0f5754c75a many reported issue tracker bugs fixed. 2012-08-24 01:32:06 +00:00
omegablast2002@yahoo.com
101582e37e increased life delta bonus to 10k, it seems the general consensus is people think it is bugged becuase they dont gain over 500 points from it. after seeing multiple people reporting it I think it would be best to increase the bonus just to avoid confusion. 2012-08-24 00:24:26 +00:00
omegablast2002@yahoo.com
fffe739ec1 setting Tc->targetter to Null on countByCanTarget() the functions that call this don't care about protection, it is used to find a number of objects which are considered valid even with protections to the source. thanks Dopple for finding this bug. 2012-08-23 23:24:55 +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
rolzad73@gmail.com
6d4e677711 * Stopped Android version from completely destroying/recreating SDLActivity when the device is locked.
Fixes multiple identical issue entries in tracker:
issue 696 (was marked fixed then restarted)
issue 876, issue 886, issue 894
2012-08-19 16:19:56 +00:00
punkeduard@gmail.com
4c74ae06fd Fixes on AVR, M13, mtg, bug reports on the forums, another try on the rings 2012-08-11 04:00:22 +00:00
punkeduard@gmail.com
db2d3b895e Bug fixes for m13 reported in the forums
mark of the vampire, dragon hatchling, Ranger's Path
2012-08-05 22:05:00 +00:00
punkeduard@gmail.com
51a6ac54f4 Several bug fixes, this cards are not working 100% correcly: will be removed if not fixed soon Ulvenwald Tracker,Wild Defiance, Thatcher Revolt, Spectral Prison, Druids' Repository, Abundant Growth 2012-08-05 20:26:40 +00:00
punkeduard@gmail.com
1454550a7b Thraben Heretic, Fyndhorn Pollen, knight of glory card code fixes 2012-07-26 02:30:59 +00:00
omegablast2002@yahoo.com
c85d07f890 tweaks to ai use of cast order, we had instance where "land" would get an over-ride and not cast. 2012-07-25 12:10:25 +00:00
punkeduard@gmail.com
23e4002a9a reverted the rings 2012-07-25 03:11:07 +00:00
punkeduard@gmail.com
e38582a89a Fixes to the five rings, mana cost knight of glory 2012-07-25 02:29:38 +00:00
omegablast2002@yahoo.com
cf5a6f9059 fix to my fix, commited the wrong version of it :) 2012-07-24 11:02:29 +00:00
omegablast2002@yahoo.com
bbf1de5134 fix for may menus not stacking if multi cards with may effects come into play at the same time.
although I tested this fix, it will require extremely indepth testing which I can not do alone to ensure that doing this does not screw up something else.
I think however that we are safe, becuase we test the same condition under test destroy and gameobserver update without any negitive recourse.
2012-07-23 22:44:02 +00:00
omegablast2002@yahoo.com
ecdc1481b0 added grade crappy to M13, pc2, avr, to exclude them from 99% support, until they are corrected, verified, and completely working, then combined with MTG.txt where they belong. already started receiving bug reports for cards in these. 2012-07-21 19:49:09 +00:00
punkeduard@gmail.com
b3d28744c4 Bug fixes in cards from avr and m13
hellion crubicle, Archwing Dragon, Defy Death, Otherworld Atlas
2012-07-21 18:14:31 +00:00
omegablast2002@yahoo.com
6172a0ade6 the rules txt change for soulbond. 2012-07-16 15:00:32 +00:00
omegablast2002@yahoo.com
0dbcd86b89 this commit adds AVRs new ability soulbond.
it requires an update to your mtg rules txt...
the coding is as follows

[card]
name=Arbor Elf
mana={g}
auto=soulbond 1/3
auto=soulbond {t}:add{g}
abilities=soulbond
type=Creature
subtype=Elf Druid
power=1
toughness=1
[/card]

auto=soulbond *any ability supported by wagic*
abilities=soulbond

the above arbor elf gives itself and its soulbond creature a 1/3 bonus and the ability to tap for green mana.
2012-07-16 14:59:46 +00:00
omegablast2002@yahoo.com
7024d195fa never got around to commiting this deck, have a couple others also. this deck show cases ai's ability to counterspell. 2012-07-15 23:12:01 +00:00
punkeduard@gmail.com
591b1535a6 Fixed Agility, Chlorophant. Fixed typos in Auriok Windwalker, Akki Underminer, Brass Squire, Cabal Slaver, Kor Outfitter,Pillar Tombs of Aku in 'battefield', added burning vengeance. 2012-07-14 16:44:19 +00:00
punkeduard@gmail.com
e29f95cb6c Added Avacyn Restored, Wagic 13 and Plancechase 2 primitives, each in separate text files, TODO merge into mtg, test more extensive and fix bugs. 2012-07-14 16:24:36 +00:00
punkeduard@gmail.com
973a835181 Adding Wagic 13 and Planechase 2 Folders and _cards.dat to the sets 2012-07-14 16:06:02 +00:00
Xawotihs@gmail.com
a8492b7c5a Fixed compilation with mingwin 2012-06-01 23:36:18 +00:00
Xawotihs@gmail.com
6dafc098cb and again 2012-05-20 14:18:24 +00:00
Xawotihs@gmail.com
f87a81f7ea Fixed meego changelog 2012-05-20 14:08:57 +00:00
Xawotihs@gmail.com
e14ec67a84 Updated meego changelog 2012-05-19 20:52:00 +00:00
Xawotihs@gmail.com
4540499b38 and again 2012-05-19 19:40:32 +00:00
Xawotihs@gmail.com
c10b5ce220 and again 2012-05-19 19:35:23 +00:00
Xawotihs@gmail.com
298231add1 and again 2012-05-19 19:30:20 +00:00
Xawotihs@gmail.com
113e5ba2b4 Fixed format of the maemo changelog 2012-05-19 19:25:35 +00:00
Xawotihs@gmail.com
f9795661b8 Updated maemo changelog 2012-05-19 19:20:02 +00:00
Xawotihs@gmail.com
a5195409c4 Added automatic generation of maemo and meego debian changelog based on the new version tools 2012-05-14 21:41:21 +00:00
Xawotihs@gmail.com
d37f44724b Revert previous commit, it does not do what I want. 2012-05-13 20:34:56 +00:00
Xawotihs@gmail.com
0d5e8e39c5 Activated revision property 2012-05-13 19:53:37 +00:00
techdragon.nguyen@gmail.com
e2a0fef600 * updated release version to 0.18.6
* updated build tools to have core files zip naming scheme be based on version information contained in build.number.properties
* added new python library to allow reading java property files, remember to add the library to your PYTHONPATH before executing the python script otherwise the script will fail.

`
2012-05-07 05:09:12 +00:00
omegablast2002@yahoo.com
baf4b3b8da correction for the removal of main types when building a CD for share!types! targetchooser. 2012-05-06 18:21:24 +00:00
omegablast2002@yahoo.com
71183d23b6 cosmetic bug fix issue854
adjusted the calculation of x for enstack attackers to avoid drawing cards on top of the phase wheel out outside of the red box. adjusted the red box length for uniformity.
the previous calculation only drew cards to the middle of the screen and after about 15 attackers it pushed cards out of the red box, over on top of the phase wheel making it impossible to click or touch requiring alternative methods to advance to damage phase or reduction of the amount of attackers.

the new calculation draws attackers at the start of the red box keeping the enstack a cardwidth and a half from the edge of the screen on both sides instead instacking massive amounts of attackers tighter inside the red box, much how we handle battlefield enstack...attacking with more then 40 creatures no longer pushes attackers off screen.
2012-05-06 09:14:45 +00:00
omegablast2002@yahoo.com
fcf3685800 removed boon reflection, a life gain trigger that resolves to gain life...is not equal to "gain twice as much" it much makes it infinite. 2012-05-05 21:24:17 +00:00
omegablast2002@yahoo.com
0503be97ba added a check for uppercase x in manacost, when i added specific cost comparing value == "x" instead of 'x' fudged up some of the x cards which had x in caps. thanks for catching kevlahnota! 2012-05-05 15:23:28 +00:00
omegablast2002@yahoo.com
7b140987cf more card code fixes from the forum reports now... 2012-05-05 11:39:54 +00:00
omegablast2002@yahoo.com
7169df14c8 several card code fixes from the issues reports. 2012-05-05 11:25:10 +00:00
omegablast2002@yahoo.com
0c9bf6938b Sensei Golden-Tail corrected, thanks kevlahnota 2012-05-02 13:06:43 +00:00
omegablast2002@yahoo.com
30b7133862 updated venser. 2012-05-02 13:01:10 +00:00
omegablast2002@yahoo.com
e67e2e669c fix for emblems not sticking, and phasealter not testDestroying. 2012-05-02 12:58:39 +00:00
omegablast2002@yahoo.com
ec7a8d219f updated test to match new card code. 2012-05-02 12:19:20 +00:00
omegablast2002@yahoo.com
b0ab33be82 fix for flip cards changing name after a transforms ability...
I remember adding that patchwork fix a long time ago, not sure if whatever it fixed was even really an issue or just a overprotective line i added. either way if it was an issue, addType is what should re-add the name, not transformer ability.
2012-05-01 15:52:16 +00:00
omegablast2002@yahoo.com
50059e0b89 fix for eachother dynamicability 2012-04-30 12:51:11 +00:00
punkeduard@gmail.com
76a2b94ace Added name and corrected lands rarity 2012-04-30 03:08:44 +00:00
punkeduard@gmail.com
592915eece Added metadata, corrected AVR lands rarity 2012-04-30 00:09:42 +00:00
punkeduard@gmail.com
ff336c431d Added two sets folders and their _cards.dat
AVR Avacyn Restored
VVK Venser vs Koth
2012-04-29 17:33:35 +00:00
omegablast2002@yahoo.com
0a7c21abef Bloodhusk Ritualist cost was wrong 2012-04-29 14:02:46 +00:00
omegablast2002@yahoo.com
6687c1408f akki underminer code change 2012-04-27 20:08:36 +00:00
omegablast2002@yahoo.com
5d73feaaf3 various card code optimizations based on kevlahnota versions, thanks kevlahnota! 2012-04-27 19:45:07 +00:00
omegablast2002@yahoo.com
5a85c9f330 a series of card code bugs fixed, thanks dopple 2012-04-27 13:20:07 +00:00
omegablast2002@yahoo.com
bd4baff4a5 updated Painful Quandary and corrected black cat 2012-04-26 19:39:00 +00:00
omegablast2002@yahoo.com
fcc55bee8c fixed "bad line" errors 2012-04-26 11:45:10 +00:00
omegablast2002@yahoo.com
8441870bed eternity vessal text= added 2012-04-26 10:59:48 +00:00
omegablast2002@yahoo.com
3485132449 many many card code fixes report on forum...no more "sleep coding" doc!!!! 2012-04-26 10:38:20 +00:00
techdragon.nguyen@gmail.com
28901491ac update to build.xml to allow incrementing of major, minor and point releases 2012-04-24 18:07:29 +00:00
1759 changed files with 537761 additions and 191105 deletions

243
.gitignore vendored Normal file
View File

@@ -0,0 +1,243 @@
#################
## Eclipse
#################
*.pydevproject
.project
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
#################
## Visual Studio
#################
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
# User-specific files
*.suo
*.user
*.sln.docstates
# Build results
[Dd]ebug/
[Rr]elease/
x64/
build/
[Bb]in/
[Oo]bj/
# MSTest test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlog
*.tlh
*.tmp
*.tmp_proj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.log
*.scc
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
*.cachefile
# Visual Studio profiler
*.psess
*.vsp
*.vspx
# Guidance Automation Toolkit
*.gpState
# ReSharper is a .NET coding add-in
_ReSharper*/
*.[Rr]e[Ss]harper
# TeamCity is a build add-in
_TeamCity*
# DotCover is a Code Coverage Tool
*.dotCover
# NCrunch
*.ncrunch*
.*crunch*.local.xml
# Installshield output folder
[Ee]xpress/
# DocProject is a documentation generator add-in
DocProject/buildhelp/
DocProject/Help/*.HxT
DocProject/Help/*.HxC
DocProject/Help/*.hhc
DocProject/Help/*.hhk
DocProject/Help/*.hhp
DocProject/Help/Html2
DocProject/Help/html
# Click-Once directory
publish/
# Publish Web Output
*.Publish.xml
*.pubxml
# NuGet Packages Directory
## TODO: If you have NuGet Package Restore enabled, uncomment the next line
#packages/
# Windows Azure Build Output
csx
*.build.csdef
# Windows Store app package directory
AppPackages/
# Others
sql/
*.Cache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
*.[Pp]ublish.xml
*.pfx
*.publishsettings
# RIA/Silverlight projects
Generated_Code/
# Backup & report files from converting an old project file to a newer
# Visual Studio version. Backup files are not needed, because we have git ;-)
_UpgradeReport_Files/
Backup*/
UpgradeLog*.XML
UpgradeLog*.htm
# SQL Server files
App_Data/*.mdf
App_Data/*.ldf
#############
## Windows detritus
#############
# Windows image file caches
Thumbs.db
ehthumbs.db
# Folder config file
Desktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Mac crap
.DS_Store
#############
## Python
#############
*.py[co]
# Packages
*.egg
*.egg-info
dist/
build/
eggs/
parts/
var/
sdist/
develop-eggs/
.installed.cfg
# Installer logs
pip-log.txt
# Unit test / coverage reports
.coverage
.tox
#Translations
*.mo
#Mr Developer
.mr.developer.cfg
#for XCode and MacOS
## Mac OS X
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
xcuserdata/
# Generated files
*.o
*.pyc
#Python modules
MANIFEST
dist/
build/
# Backup files
*~.nib

69
.travis.yml Normal file
View File

@@ -0,0 +1,69 @@
language: cpp
dist: xenial
branches:
except:
- latest-master
before_install:
- export BUILD_PSP=YES
- export BUILD_ANDROID=YES
- export BUILD_Qt=YES
- export BUILD_MAC=NO
# Only building on Mac when not handling pull request
# - if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then
# export BUILD_MAC=YES;
# fi
- sudo apt-get update -qq
# Building for PSP here
- if [ "$BUILD_PSP" == "YES" ]; then
export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk" &&
export PSPSDK="$PSPDEV/psp/sdk" &&
export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin" &&
wget --no-check-certificate -O sdk.lzma http://downloads.sourceforge.net/project/minpspw/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma;
fi
# Building for Qt here
- if [ "$BUILD_Qt" == "YES" ]; then
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial universe" &&
sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu xenial main" &&
sudo apt-get -qq update &&
sudo apt-get -qq install qt5-qmake qtbase5-dev qtdeclarative5-dev qttools5-dev qtmultimedia5-dev libqt5opengl5 libqt5opengl5-dev pulseaudio libpulse-dev &&
export QMAKE="qmake -qt=qt5";
fi
# Building for Android here
- if [ "$BUILD_ANDROID" == "YES" ]; then
export ANDROID="android-sdk-linux/tools/android" &&
if [ `uname -m` = x86_64 ]; then
sudo dpkg --add-architecture i386 && sudo apt-get update &&
sudo apt-get install -qq --force-yes libgd2-xpm-dev libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1 jq ant; fi &&
wget https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip -nv &&
wget http://dl.google.com/android/android-sdk_r24.4.1-linux.tgz -nv;
fi
install:
- if [ "$BUILD_PSP" == "YES" ]; then
tar -x --xz -f sdk.lzma;
fi
- if [ "$BUILD_ANDROID" == "YES" ]; then
unzip android-ndk-r22-linux-x86_64.zip &&
tar -zxf android-sdk_r24.4.1-linux.tgz &&
$ANDROID list sdk --extended -a &&
echo yes | $ANDROID update sdk -a -t tools,platform-tools,build-tools-23.0.1,android-23 --no-ui --force --no-https;
sudo apt-get install openjdk-8-jdk;
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64;
export PATH=$JAVA_HOME/bin:$PATH;
fi
- sudo pip install --upgrade pip
- sudo pip install setuptools-rust
- sudo pip install pyOpenSSL
- sudo pip install pyjavaproperties
- sudo pip install github3.py
- sudo pip install cpp-coveralls
script: "tools/travis-script.sh"
after_success:
- coveralls -b . -e JGE/src -e JGE/include -i projects/mtg/include -i projects/mtg/src --gcov-options '\-lp'
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l core.zip -r Wagic-core.zip -b $TRAVIS_BRANCH
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/Android/bin/Wagic-debug.apk -r Wagic-android.apk -b $TRAVIS_BRANCH
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l projects/mtg/psprelease.zip -r Wagic-psp.zip -b $TRAVIS_BRANCH
- python tools/upload-binaries.py -t $GH_TOKEN -s $TRAVIS_COMMIT -l qt-gui-build/linuxqtrelease.zip -r Wagic-linux-QT.zip -b $TRAVIS_BRANCH

View File

@@ -71,7 +71,7 @@ namespace boost {
};
template<typename InputT, typename FindResultT>
bool check_find_result(InputT& Input, FindResultT& FindResult)
bool check_find_result(InputT&, FindResultT& FindResult)
{
typedef BOOST_STRING_TYPENAME
range_const_iterator<InputT>::type input_iterator_type;

84
Boost/boost/random.hpp Normal file
View File

@@ -0,0 +1,84 @@
/* boost random.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org/libs/random for documentation.
*
* $Id: random.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2000-02-18 portability fixes (thanks to Beman Dawes)
* 2000-02-21 shuffle_output, inversive_congruential_schrage,
* generator_iterator, uniform_smallint
* 2000-02-23 generic modulus arithmetic helper, removed *_schrage classes,
* implemented Streamable and EqualityComparable concepts for
* generators, added Bernoulli distribution and Box-Muller
* transform
* 2000-03-01 cauchy, lognormal, triangle distributions; fixed
* uniform_smallint; renamed gaussian to normal distribution
* 2000-03-05 implemented iterator syntax for distribution functions
* 2000-04-21 removed some optimizations for better BCC/MSVC compatibility
* 2000-05-10 adapted to BCC and MSVC
* 2000-06-13 incorporated review results
* 2000-07-06 moved basic templates from namespace detail to random
* 2000-09-23 warning removals and int64 fixes (Ed Brey)
* 2000-09-24 added lagged_fibonacci generator (Matthias Troyer)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_HPP
#define BOOST_RANDOM_HPP
// generators
#include <boost/random/linear_congruential.hpp>
#include <boost/random/additive_combine.hpp>
#include <boost/random/inversive_congruential.hpp>
#include <boost/random/shuffle_output.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/lagged_fibonacci.hpp>
#include <boost/random/ranlux.hpp>
#include <boost/random/linear_feedback_shift.hpp>
#include <boost/random/xor_combine.hpp>
#include <boost/random/discard_block.hpp>
#include <boost/random/subtract_with_carry.hpp>
#include <boost/random/variate_generator.hpp>
namespace boost {
/**
* The specialization taus88 was suggested in
*
* @blockquote
* "Maximally Equidistributed Combined Tausworthe Generators",
* Pierre L'Ecuyer, Mathematics of Computation, Volume 65,
* Number 213, January 1996, Pages 203-213
* @endblockquote
*/
typedef random::xor_combine<random::xor_combine<random::linear_feedback_shift<uint32_t, 32, 31, 13, 12, 0>, 0,
random::linear_feedback_shift<uint32_t, 32, 29, 2, 4, 0>, 0, 0>, 0,
random::linear_feedback_shift<uint32_t, 32, 28, 3, 17, 0>, 0, 0> taus88;
} // namespace boost
// misc
#include <boost/random/random_number_generator.hpp>
// distributions
#include <boost/random/uniform_smallint.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/uniform_real.hpp>
#include <boost/random/triangle_distribution.hpp>
#include <boost/random/bernoulli_distribution.hpp>
#include <boost/random/cauchy_distribution.hpp>
#include <boost/random/exponential_distribution.hpp>
#include <boost/random/geometric_distribution.hpp>
#include <boost/random/normal_distribution.hpp>
#include <boost/random/lognormal_distribution.hpp>
#include <boost/random/poisson_distribution.hpp>
#include <boost/random/gamma_distribution.hpp>
#include <boost/random/binomial_distribution.hpp>
#include <boost/random/uniform_on_sphere.hpp>
#endif // BOOST_RANDOM_HPP

View File

@@ -0,0 +1,234 @@
/* boost random/additive_combine.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: additive_combine.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_ADDITIVE_COMBINE_HPP
#define BOOST_RANDOM_ADDITIVE_COMBINE_HPP
#include <iostream>
#include <algorithm> // for std::min and std::max
#include <boost/config.hpp>
#include <boost/cstdint.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/linear_congruential.hpp>
namespace boost {
namespace random {
/**
* An instantiation of class template \additive_combine model a
* \pseudo_random_number_generator. It combines two multiplicative
* \linear_congruential number generators, i.e. those with @c c = 0.
* It is described in
*
* @blockquote
* "Efficient and Portable Combined Random Number Generators", Pierre L'Ecuyer,
* Communications of the ACM, Vol. 31, No. 6, June 1988, pp. 742-749, 774
* @endblockquote
*
* The template parameters MLCG1 and MLCG2 shall denote two different
* \linear_congruential number generators, each with c = 0. Each invocation
* returns a random number X(n) := (MLCG1(n) - MLCG2(n)) mod (m1 - 1), where
* m1 denotes the modulus of MLCG1.
*
* The template parameter @c val is the validation value checked by validation.
*/
template<class MLCG1, class MLCG2,
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
typename MLCG1::result_type
#else
int32_t
#endif
val>
class additive_combine
{
public:
typedef MLCG1 first_base;
typedef MLCG2 second_base;
typedef typename MLCG1::result_type result_type;
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
static const bool has_fixed_range = true;
static const result_type min_value = 1;
static const result_type max_value = MLCG1::max_value-1;
#else
enum { has_fixed_range = false };
#endif
/**
* Returns: The smallest value that the generator can produce
*/
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 1; }
/**
* Returns: The largest value that the generator can produce
*/
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (_mlcg1.max)()-1; }
/**
* Constructs an \additive_combine generator using the
* default constructors of the two base generators.
*/
additive_combine() : _mlcg1(), _mlcg2() { }
/**
* Constructs an \additive_combine generator, using aseed as
* the constructor argument for both base generators.
*/
explicit additive_combine(result_type aseed)
: _mlcg1(aseed), _mlcg2(aseed) { }
/**
* Constructs an \additive_combine generator, using
* @c seed1 and @c seed2 as the constructor argument to
* the first and second base generators, respectively.
*/
additive_combine(typename MLCG1::result_type seed1,
typename MLCG2::result_type seed2)
: _mlcg1(seed1), _mlcg2(seed2) { }
/**
* Contructs an \additive_combine generator with
* values from the range defined by the input iterators first
* and last. first will be modified to point to the element
* after the last one used.
*
* Throws: @c std::invalid_argument if the input range is too small.
*
* Exception Safety: Basic
*/
template<class It> additive_combine(It& first, It last)
: _mlcg1(first, last), _mlcg2(first, last) { }
/**
* Seeds an \additive_combine generator using the default
* seeds of the two base generators.
*/
void seed()
{
_mlcg1.seed();
_mlcg2.seed();
}
/**
* Seeds an \additive_combine generator, using @c aseed as the
* seed for both base generators.
*/
void seed(result_type aseed)
{
_mlcg1.seed(aseed);
_mlcg2.seed(aseed);
}
/**
* Seeds an \additive_combine generator, using @c seed1 and @c seed2 as
* the seeds to the first and second base generators, respectively.
*/
void seed(typename MLCG1::result_type seed1,
typename MLCG2::result_type seed2)
{
_mlcg1.seed(seed1);
_mlcg2.seed(seed2);
}
/**
* Seeds an \additive_combine generator with
* values from the range defined by the input iterators first
* and last. first will be modified to point to the element
* after the last one used.
*
* Throws: @c std::invalid_argument if the input range is too small.
*
* Exception Safety: Basic
*/
template<class It> void seed(It& first, It last)
{
_mlcg1.seed(first, last);
_mlcg2.seed(first, last);
}
/**
* Returns: the next value of the generator
*/
result_type operator()() {
result_type z = _mlcg1() - _mlcg2();
if(z < 1)
z += MLCG1::modulus-1;
return z;
}
static bool validation(result_type x) { return val == x; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
/**
* Writes the state of an \additive_combine generator to a @c
* std::ostream. The textual representation of an \additive_combine
* generator is the textual representation of the first base
* generator followed by the textual representation of the
* second base generator.
*/
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const additive_combine& r)
{ os << r._mlcg1 << " " << r._mlcg2; return os; }
/**
* Reads the state of an \additive_combine generator from a
* @c std::istream.
*/
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, additive_combine& r)
{ is >> r._mlcg1 >> std::ws >> r._mlcg2; return is; }
#endif
/**
* Returns: true iff the two \additive_combine generators will
* produce the same sequence of values.
*/
friend bool operator==(const additive_combine& x, const additive_combine& y)
{ return x._mlcg1 == y._mlcg1 && x._mlcg2 == y._mlcg2; }
/**
* Returns: true iff the two \additive_combine generators will
* produce different sequences of values.
*/
friend bool operator!=(const additive_combine& x, const additive_combine& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const additive_combine& rhs) const
{ return _mlcg1 == rhs._mlcg1 && _mlcg2 == rhs._mlcg2; }
bool operator!=(const additive_combine& rhs) const
{ return !(*this == rhs); }
#endif
private:
MLCG1 _mlcg1;
MLCG2 _mlcg2;
};
} // namespace random
/**
* The specialization \ecuyer1988 was suggested in
*
* @blockquote
* "Efficient and Portable Combined Random Number Generators", Pierre L'Ecuyer,
* Communications of the ACM, Vol. 31, No. 6, June 1988, pp. 742-749, 774
* @endblockquote
*/
typedef random::additive_combine<
random::linear_congruential<int32_t, 40014, 0, 2147483563, 0>,
random::linear_congruential<int32_t, 40692, 0, 2147483399, 0>,
2060321752> ecuyer1988;
} // namespace boost
#endif // BOOST_RANDOM_ADDITIVE_COMBINE_HPP

View File

@@ -0,0 +1,109 @@
/* boost random/bernoulli_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: bernoulli_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_BERNOULLI_DISTRIBUTION_HPP
#define BOOST_RANDOM_BERNOULLI_DISTRIBUTION_HPP
#include <cassert>
#include <iostream>
#include <boost/random/detail/config.hpp>
namespace boost {
/**
* Instantiations of class template \bernoulli_distribution model a
* \random_distribution. Such a random distribution produces bool values
* distributed with probabilities P(true) = p and P(false) = 1-p. p is
* the parameter of the distribution.
*/
template<class RealType = double>
class bernoulli_distribution
{
public:
// In principle, this could work with both integer and floating-point
// types. Generating floating-point random numbers in the first
// place is probably more expensive, so use integer as input.
typedef int input_type;
typedef bool result_type;
/**
* Constructs a \bernoulli_distribution object.
* p is the parameter of the distribution.
*
* Requires: 0 <= p <= 1
*/
explicit bernoulli_distribution(const RealType& p_arg = RealType(0.5))
: _p(p_arg)
{
assert(_p >= 0);
assert(_p <= 1);
}
// compiler-generated copy ctor and assignment operator are fine
/**
* Returns: The "p" parameter of the distribution.
*/
RealType p() const { return _p; }
/**
* Effects: Subsequent uses of the distribution do not depend
* on values produced by any engine prior to invoking reset.
*/
void reset() { }
/**
* Returns: a random variate distributed according to the
* \bernoulli_distribution.
*/
template<class Engine>
result_type operator()(Engine& eng)
{
if(_p == RealType(0))
return false;
else
return RealType(eng() - (eng.min)()) <= _p * RealType((eng.max)()-(eng.min)());
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
/**
* Writes the parameters of the distribution to a @c std::ostream.
*/
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const bernoulli_distribution& bd)
{
os << bd._p;
return os;
}
/**
* Reads the parameters of the distribution from a @c std::istream.
*/
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, bernoulli_distribution& bd)
{
is >> std::ws >> bd._p;
return is;
}
#endif
private:
RealType _p;
};
} // namespace boost
#endif // BOOST_RANDOM_BERNOULLI_DISTRIBUTION_HPP

View File

@@ -0,0 +1,111 @@
/* boost random/binomial_distribution.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: binomial_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_BINOMIAL_DISTRIBUTION_HPP
#define BOOST_RANDOM_BINOMIAL_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <cassert>
#include <boost/random/detail/config.hpp>
#include <boost/random/bernoulli_distribution.hpp>
namespace boost {
/**
* The binomial distribution is an integer valued distribution with
* two parameters, @c t and @c p. The values of the distribution
* are within the range [0,t].
*
* The probability that the distribution produces a value k is
* \f${t \choose k}p^k(1-p)^{t-k}\f$.
*/
template<class IntType = int, class RealType = double>
class binomial_distribution
{
public:
typedef typename bernoulli_distribution<RealType>::input_type input_type;
typedef IntType result_type;
/**
* Construct an @c binomial_distribution object. @c t and @c p
* are the parameters of the distribution.
*
* Requires: t >=0 && 0 <= p <= 1
*/
explicit binomial_distribution(IntType t = 1,
const RealType& p = RealType(0.5))
: _bernoulli(p), _t(t)
{
assert(_t >= 0);
assert(RealType(0) <= p && p <= RealType(1));
}
// compiler-generated copy ctor and assignment operator are fine
/** Returns: the @c t parameter of the distribution */
IntType t() const { return _t; }
/** Returns: the @c p parameter of the distribution */
RealType p() const { return _bernoulli.p(); }
/**
* Effects: Subsequent uses of the distribution do not depend
* on values produced by any engine prior to invoking reset.
*/
void reset() { }
/**
* Returns: a random variate distributed according to the
* binomial distribution.
*/
template<class Engine>
result_type operator()(Engine& eng)
{
// TODO: This is O(_t), but it should be O(log(_t)) for large _t
result_type n = 0;
for(IntType i = 0; i < _t; ++i)
if(_bernoulli(eng))
++n;
return n;
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
/**
* Writes the parameters of the distribution to a @c std::ostream.
*/
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const binomial_distribution& bd)
{
os << bd._bernoulli << " " << bd._t;
return os;
}
/**
* Reads the parameters of the distribution from a @c std::istream.
*/
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, binomial_distribution& bd)
{
is >> std::ws >> bd._bernoulli >> std::ws >> bd._t;
return is;
}
#endif
private:
bernoulli_distribution<RealType> _bernoulli;
IntType _t;
};
} // namespace boost
#endif // BOOST_RANDOM_BINOMIAL_DISTRIBUTION_HPP

View File

@@ -0,0 +1,121 @@
/* boost random/cauchy_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: cauchy_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_CAUCHY_DISTRIBUTION_HPP
#define BOOST_RANDOM_CAUCHY_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <iostream>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
namespace boost {
#if defined(__GNUC__) && (__GNUC__ < 3)
// Special gcc workaround: gcc 2.95.x ignores using-declarations
// in template classes (confirmed by gcc author Martin v. Loewis)
using std::tan;
#endif
// Cauchy distribution:
/**
* The cauchy distribution is a continuous distribution with two
* parameters, sigma and median.
*
* It has \f$p(x) = \frac{\sigma}{\pi(\sigma^2 + (x-m)^2)}\f$
*/
template<class RealType = double>
class cauchy_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
/**
* Constructs a \cauchy_distribution with the paramters @c median
* and @c sigma.
*/
explicit cauchy_distribution(result_type median_arg = result_type(0),
result_type sigma_arg = result_type(1))
: _median(median_arg), _sigma(sigma_arg) { }
// compiler-generated copy ctor and assignment operator are fine
/**
* Returns: the "median" parameter of the distribution
*/
result_type median() const { return _median; }
/**
* Returns: the "sigma" parameter of the distribution
*/
result_type sigma() const { return _sigma; }
/**
* Effects: Subsequent uses of the distribution do not depend
* on values produced by any engine prior to invoking reset.
*/
void reset() { }
/**
* Returns: A random variate distributed according to the
* cauchy distribution.
*/
template<class Engine>
result_type operator()(Engine& eng)
{
// Can we have a boost::mathconst please?
const result_type pi = result_type(3.14159265358979323846);
#ifndef BOOST_NO_STDC_NAMESPACE
using std::tan;
#endif
return _median + _sigma * tan(pi*(eng()-result_type(0.5)));
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
/**
* Writes the parameters of the distribution to a @c std::ostream.
*/
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const cauchy_distribution& cd)
{
os << cd._median << " " << cd._sigma;
return os;
}
/**
* Reads the parameters of the distribution from a @c std::istream.
*/
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, cauchy_distribution& cd)
{
is >> std::ws >> cd._median >> std::ws >> cd._sigma;
return is;
}
#endif
private:
result_type _median, _sigma;
};
} // namespace boost
#endif // BOOST_RANDOM_CAUCHY_DISTRIBUTION_HPP

View File

@@ -0,0 +1,42 @@
/* boost random auto_link.hpp header file
*
* Copyright Steven Watanabe 2010
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* $Id: auto_link.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*/
#ifndef BOOST_RANDOM_DETAIL_AUTO_LINK_HPP
#define BOOST_RANDOM_DETAIL_AUTO_LINK_HPP
#include <boost/config.hpp>
#ifdef BOOST_HAS_DECLSPEC
#if defined(BOOST_ALL_DYN_LINK) || defined(BOOST_RANDOM_DYN_LINK)
#if defined(BOOST_RANDOM_SOURCE)
#define BOOST_RANDOM_DECL __declspec(dllexport)
#else
#define BOOST_RANDOM_DECL __declspec(dllimport)
#endif
#endif
#endif
#ifndef BOOST_RANDOM_DECL
#define BOOST_RANDOM_DECL
#endif
#if !defined(BOOST_RANDOM_NO_LIB) && !defined(BOOST_ALL_NO_LIB) && !defined(BOOST_RANDOM_SOURCE)
#define BOOST_LIB_NAME boost_random
#if defined(BOOST_RANDOM_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)
#define BOOST_DYN_LINK
#endif
#include <boost/config/auto_link.hpp>
#endif
#endif

View File

@@ -0,0 +1,18 @@
/* boost random/detail/config.hpp header file
*
* Copyright Steven Watanabe 2009
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: config.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $
*/
#include <boost/config.hpp>
#if (defined(BOOST_NO_OPERATORS_IN_NAMESPACE) || defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)) \
&& !defined(BOOST_MSVC)
#define BOOST_RANDOM_NO_STREAM_OPERATORS
#endif

View File

@@ -0,0 +1,363 @@
/* boost random/detail/const_mod.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: const_mod.hpp 58649 2010-01-02 21:23:17Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_CONST_MOD_HPP
#define BOOST_RANDOM_CONST_MOD_HPP
#include <cassert>
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/integer_traits.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/random/detail/disable_warnings.hpp>
namespace boost {
namespace random {
/*
* Some random number generators require modular arithmetic. Put
* everything we need here.
* IntType must be an integral type.
*/
namespace detail {
template<bool is_signed>
struct do_add
{ };
template<>
struct do_add<true>
{
template<class IntType>
static IntType add(IntType m, IntType x, IntType c)
{
if (x < m - c)
return x + c;
else
return x - (m-c);
}
};
template<>
struct do_add<false>
{
template<class IntType>
static IntType add(IntType, IntType, IntType)
{
// difficult
assert(!"const_mod::add with c too large");
return 0;
}
};
} // namespace detail
#if !(defined(__BORLANDC__) && (__BORLANDC__ == 0x560))
template<class IntType, IntType m>
class const_mod
{
public:
static IntType add(IntType x, IntType c)
{
if(c == 0)
return x;
else if(c <= traits::const_max - m) // i.e. m+c < max
return add_small(x, c);
else
return detail::do_add<traits::is_signed>::add(m, x, c);
}
static IntType mult(IntType a, IntType x)
{
if(a == 1)
return x;
else if(m <= traits::const_max/a) // i.e. a*m <= max
return mult_small(a, x);
else if(traits::is_signed && (m%a < m/a))
return mult_schrage(a, x);
else {
// difficult
assert(!"const_mod::mult with a too large");
return 0;
}
}
static IntType mult_add(IntType a, IntType x, IntType c)
{
if(m <= (traits::const_max-c)/a) // i.e. a*m+c <= max
return (a*x+c) % m;
else
return add(mult(a, x), c);
}
static IntType invert(IntType x)
{ return x == 0 ? 0 : invert_euclidian(x); }
private:
typedef integer_traits<IntType> traits;
const_mod(); // don't instantiate
static IntType add_small(IntType x, IntType c)
{
x += c;
if(x >= m)
x -= m;
return x;
}
static IntType mult_small(IntType a, IntType x)
{
return a*x % m;
}
static IntType mult_schrage(IntType a, IntType value)
{
const IntType q = m / a;
const IntType r = m % a;
assert(r < q); // check that overflow cannot happen
value = a*(value%q) - r*(value/q);
// An optimizer bug in the SGI MIPSpro 7.3.1.x compiler requires this
// convoluted formulation of the loop (Synge Todo)
for(;;) {
if (value > 0)
break;
value += m;
}
return value;
}
// invert c in the finite field (mod m) (m must be prime)
static IntType invert_euclidian(IntType c)
{
// we are interested in the gcd factor for c, because this is our inverse
BOOST_STATIC_ASSERT(m > 0);
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3003))
assert(boost::integer_traits<IntType>::is_signed);
#elif !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS)
BOOST_STATIC_ASSERT(boost::integer_traits<IntType>::is_signed);
#endif
assert(c > 0);
IntType l1 = 0;
IntType l2 = 1;
IntType n = c;
IntType p = m;
for(;;) {
IntType q = p / n;
l1 -= q * l2; // this requires a signed IntType!
p -= q * n;
if(p == 0)
return (l2 < 1 ? l2 + m : l2);
IntType q2 = n / p;
l2 -= q2 * l1;
n -= q2 * p;
if(n == 0)
return (l1 < 1 ? l1 + m : l1);
}
}
};
// The modulus is exactly the word size: rely on machine overflow handling.
// Due to a GCC bug, we cannot partially specialize in the presence of
// template value parameters.
template<>
class const_mod<unsigned int, 0>
{
typedef unsigned int IntType;
public:
static IntType add(IntType x, IntType c) { return x+c; }
static IntType mult(IntType a, IntType x) { return a*x; }
static IntType mult_add(IntType a, IntType x, IntType c) { return a*x+c; }
// m is not prime, thus invert is not useful
private: // don't instantiate
const_mod();
};
template<>
class const_mod<unsigned long, 0>
{
typedef unsigned long IntType;
public:
static IntType add(IntType x, IntType c) { return x+c; }
static IntType mult(IntType a, IntType x) { return a*x; }
static IntType mult_add(IntType a, IntType x, IntType c) { return a*x+c; }
// m is not prime, thus invert is not useful
private: // don't instantiate
const_mod();
};
// the modulus is some power of 2: rely partly on machine overflow handling
// we only specialize for rand48 at the moment
#ifndef BOOST_NO_INT64_T
template<>
class const_mod<uint64_t, uint64_t(1) << 48>
{
typedef uint64_t IntType;
public:
static IntType add(IntType x, IntType c) { return c == 0 ? x : mod(x+c); }
static IntType mult(IntType a, IntType x) { return mod(a*x); }
static IntType mult_add(IntType a, IntType x, IntType c)
{ return mod(a*x+c); }
static IntType mod(IntType x) { return x &= ((uint64_t(1) << 48)-1); }
// m is not prime, thus invert is not useful
private: // don't instantiate
const_mod();
};
#endif /* !BOOST_NO_INT64_T */
#else
//
// for some reason Borland C++ Builder 6 has problems with
// the full specialisations of const_mod, define a generic version
// instead, the compiler will optimise away the const-if statements:
//
template<class IntType, IntType m>
class const_mod
{
public:
static IntType add(IntType x, IntType c)
{
if(0 == m)
{
return x+c;
}
else
{
if(c == 0)
return x;
else if(c <= traits::const_max - m) // i.e. m+c < max
return add_small(x, c);
else
return detail::do_add<traits::is_signed>::add(m, x, c);
}
}
static IntType mult(IntType a, IntType x)
{
if(x == 0)
{
return a*x;
}
else
{
if(a == 1)
return x;
else if(m <= traits::const_max/a) // i.e. a*m <= max
return mult_small(a, x);
else if(traits::is_signed && (m%a < m/a))
return mult_schrage(a, x);
else {
// difficult
assert(!"const_mod::mult with a too large");
return 0;
}
}
}
static IntType mult_add(IntType a, IntType x, IntType c)
{
if(m == 0)
{
return a*x+c;
}
else
{
if(m <= (traits::const_max-c)/a) // i.e. a*m+c <= max
return (a*x+c) % m;
else
return add(mult(a, x), c);
}
}
static IntType invert(IntType x)
{ return x == 0 ? 0 : invert_euclidian(x); }
private:
typedef integer_traits<IntType> traits;
const_mod(); // don't instantiate
static IntType add_small(IntType x, IntType c)
{
x += c;
if(x >= m)
x -= m;
return x;
}
static IntType mult_small(IntType a, IntType x)
{
return a*x % m;
}
static IntType mult_schrage(IntType a, IntType value)
{
const IntType q = m / a;
const IntType r = m % a;
assert(r < q); // check that overflow cannot happen
value = a*(value%q) - r*(value/q);
while(value <= 0)
value += m;
return value;
}
// invert c in the finite field (mod m) (m must be prime)
static IntType invert_euclidian(IntType c)
{
// we are interested in the gcd factor for c, because this is our inverse
BOOST_STATIC_ASSERT(m > 0);
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(boost::integer_traits<IntType>::is_signed);
#endif
assert(c > 0);
IntType l1 = 0;
IntType l2 = 1;
IntType n = c;
IntType p = m;
for(;;) {
IntType q = p / n;
l1 -= q * l2; // this requires a signed IntType!
p -= q * n;
if(p == 0)
return (l2 < 1 ? l2 + m : l2);
IntType q2 = n / p;
l2 -= q2 * l1;
n -= q2 * p;
if(n == 0)
return (l1 < 1 ? l1 + m : l1);
}
}
};
#endif
} // namespace random
} // namespace boost
#include <boost/random/detail/enable_warnings.hpp>
#endif // BOOST_RANDOM_CONST_MOD_HPP

View File

@@ -0,0 +1,23 @@
/* boost random/detail/disable_warnings.hpp header file
*
* Copyright Steven Watanabe 2009
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: disable_warnings.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
*/
// No #include guard. This header is intended to be included multiple times.
#include <boost/config.hpp>
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4512)
#pragma warning(disable:4127)
#pragma warning(disable:4724)
#endif

View File

@@ -0,0 +1,18 @@
/* boost random/detail/enable_warnings.hpp header file
*
* Copyright Steven Watanabe 2009
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: enable_warnings.hpp 58649 2010-01-02 21:23:17Z steven_watanabe $
*
*/
// No #include guard. This header is intended to be included multiple times.
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif

View File

@@ -0,0 +1,45 @@
/* boost random/detail/iterator_mixin.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* Revision history
*/
#ifndef BOOST_ITERATOR_MIXIN_HPP
#define BOOST_ITERATOR_MIXIN_HPP
#include <boost/operators.hpp>
namespace boost {
// must be in boost namespace, otherwise the inline friend trick fails
template<class Generator, class ResultType>
class generator_iterator_mixin_adapter
: incrementable<Generator>, equality_comparable<Generator>
{
public:
typedef std::input_iterator_tag iterator_category;
typedef ResultType value_type;
typedef std::ptrdiff_t difference_type;
typedef const value_type * pointer;
typedef const value_type & reference;
Generator& operator++() { v = cast()(); return cast(); }
const value_type& operator*() const { return v; }
protected:
// instantiate from derived classes only
generator_iterator_mixin_adapter() { }
void iterator_init() { operator++(); }
private:
Generator & cast() { return static_cast<Generator&>(*this); }
value_type v;
};
} // namespace boost
#endif // BOOST_ITERATOR_MIXIN_HPP

View File

@@ -0,0 +1,100 @@
/* boost random/detail/uniform_int_float.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: pass_through_engine.hpp 58649 2010-01-02 21:23:17Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_DETAIL_PASS_THROUGH_ENGINE_HPP
#define BOOST_RANDOM_DETAIL_PASS_THROUGH_ENGINE_HPP
#include <boost/config.hpp>
#include <boost/random/detail/ptr_helper.hpp>
#include <boost/random/detail/disable_warnings.hpp>
namespace boost {
namespace random {
namespace detail {
template<class UniformRandomNumberGenerator>
class pass_through_engine
{
private:
typedef ptr_helper<UniformRandomNumberGenerator> helper_type;
public:
typedef typename helper_type::value_type base_type;
typedef typename base_type::result_type result_type;
explicit pass_through_engine(UniformRandomNumberGenerator rng)
// make argument an rvalue to avoid matching Generator& constructor
: _rng(static_cast<typename helper_type::rvalue_type>(rng))
{ }
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (base().min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (base().max)(); }
base_type& base() { return helper_type::ref(_rng); }
const base_type& base() const { return helper_type::ref(_rng); }
result_type operator()() { return base()(); }
private:
UniformRandomNumberGenerator _rng;
};
#ifndef BOOST_NO_STD_LOCALE
template<class UniformRandomNumberGenerator, class CharT, class Traits>
std::basic_ostream<CharT,Traits>&
operator<<(
std::basic_ostream<CharT,Traits>& os
, const pass_through_engine<UniformRandomNumberGenerator>& ud
)
{
return os << ud.base();
}
template<class UniformRandomNumberGenerator, class CharT, class Traits>
std::basic_istream<CharT,Traits>&
operator>>(
std::basic_istream<CharT,Traits>& is
, const pass_through_engine<UniformRandomNumberGenerator>& ud
)
{
return is >> ud.base();
}
#else // no new streams
template<class UniformRandomNumberGenerator>
inline std::ostream&
operator<<(std::ostream& os,
const pass_through_engine<UniformRandomNumberGenerator>& ud)
{
return os << ud.base();
}
template<class UniformRandomNumberGenerator>
inline std::istream&
operator>>(std::istream& is,
const pass_through_engine<UniformRandomNumberGenerator>& ud)
{
return is >> ud.base();
}
#endif
} // namespace detail
} // namespace random
} // namespace boost
#include <boost/random/detail/enable_warnings.hpp>
#endif // BOOST_RANDOM_DETAIL_PASS_THROUGH_ENGINE_HPP

View File

@@ -0,0 +1,94 @@
/* boost random/detail/ptr_helper.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: ptr_helper.hpp 24096 2004-07-27 03:43:34Z dgregor $
*
*/
#ifndef BOOST_RANDOM_DETAIL_PTR_HELPER_HPP
#define BOOST_RANDOM_DETAIL_PTR_HELPER_HPP
#include <boost/config.hpp>
namespace boost {
namespace random {
namespace detail {
// type_traits could help here, but I don't want to depend on type_traits.
template<class T>
struct ptr_helper
{
typedef T value_type;
typedef T& reference_type;
typedef const T& rvalue_type;
static reference_type ref(T& r) { return r; }
static const T& ref(const T& r) { return r; }
};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template<class T>
struct ptr_helper<T&>
{
typedef T value_type;
typedef T& reference_type;
typedef T& rvalue_type;
static reference_type ref(T& r) { return r; }
static const T& ref(const T& r) { return r; }
};
template<class T>
struct ptr_helper<T*>
{
typedef T value_type;
typedef T& reference_type;
typedef T* rvalue_type;
static reference_type ref(T * p) { return *p; }
static const T& ref(const T * p) { return *p; }
};
#endif
} // namespace detail
} // namespace random
} // namespace boost
//
// BOOST_RANDOM_PTR_HELPER_SPEC --
//
// Helper macro for broken compilers defines specializations of
// ptr_helper.
//
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# define BOOST_RANDOM_PTR_HELPER_SPEC(T) \
namespace boost { namespace random { namespace detail { \
template<> \
struct ptr_helper<T&> \
{ \
typedef T value_type; \
typedef T& reference_type; \
typedef T& rvalue_type; \
static reference_type ref(T& r) { return r; } \
static const T& ref(const T& r) { return r; } \
}; \
\
template<> \
struct ptr_helper<T*> \
{ \
typedef T value_type; \
typedef T& reference_type; \
typedef T* rvalue_type; \
static reference_type ref(T * p) { return *p; } \
static const T& ref(const T * p) { return *p; } \
}; \
}}}
#else
# define BOOST_RANDOM_PTR_HELPER_SPEC(T)
#endif
#endif // BOOST_RANDOM_DETAIL_PTR_HELPER_HPP

View File

@@ -0,0 +1,89 @@
/* boost random/detail/seed.hpp header file
*
* Copyright Steven Watanabe 2009
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: seed.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*/
#ifndef BOOST_RANDOM_DETAIL_SEED_HPP
#define BOOST_RANDOM_DETAIL_SEED_HPP
#include <boost/config.hpp>
// Sun seems to have trouble with the use of SFINAE for the
// templated constructor. So does Borland.
#if !defined(BOOST_NO_SFINAE) && !defined(__SUNPRO_CC) && !defined(__BORLANDC__)
#include <boost/utility/enable_if.hpp>
#include <boost/type_traits/is_arithmetic.hpp>
namespace boost {
namespace random {
namespace detail {
template<class T>
struct disable_seed : boost::disable_if<boost::is_arithmetic<T> > {};
template<class Engine, class T>
struct disable_constructor : disable_seed<T> {};
template<class Engine>
struct disable_constructor<Engine, Engine> {};
#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \
template<class Generator> \
explicit Self(Generator& gen, typename ::boost::random::detail::disable_constructor<Self, Generator>::type* = 0)
#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \
template<class Generator> \
void seed(Generator& gen, typename ::boost::random::detail::disable_seed<Generator>::type* = 0)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \
explicit Self(const T& x)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \
void seed(const T& x)
}
}
}
#else
#include <boost/type_traits/is_arithmetic.hpp>
#include <boost/mpl/bool.hpp>
#define BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(Self, Generator, gen) \
Self(Self& other) { *this = other; } \
Self(const Self& other) { *this = other; } \
template<class Generator> \
explicit Self(Generator& gen) { \
boost_random_constructor_impl(gen, ::boost::is_arithmetic<Generator>());\
} \
template<class Generator> \
void boost_random_constructor_impl(Generator& gen, ::boost::mpl::false_)
#define BOOST_RANDOM_DETAIL_GENERATOR_SEED(Self, Generator, gen) \
template<class Generator> \
void seed(Generator& gen) { \
boost_random_seed_impl(gen, ::boost::is_arithmetic<Generator>());\
}\
template<class Generator>\
void boost_random_seed_impl(Generator& gen, ::boost::mpl::false_)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(Self, T, x) \
explicit Self(const T& x) { boost_random_constructor_impl(x, ::boost::mpl::true_()); }\
void boost_random_constructor_impl(const T& x, ::boost::mpl::true_)
#define BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(Self, T, x) \
void seed(const T& x) { boost_random_seed_impl(x, ::boost::mpl::true_()); }\
void boost_random_seed_impl(const T& x, ::boost::mpl::true_)
#endif
#endif

View File

@@ -0,0 +1,89 @@
/* boost random/detail/signed_unsigned_tools.hpp header file
*
* Copyright Jens Maurer 2006
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*/
#ifndef BOOST_RANDOM_DETAIL_SIGNED_UNSIGNED_TOOLS
#define BOOST_RANDOM_DETAIL_SIGNED_UNSIGNED_TOOLS
#include <boost/limits.hpp>
#include <boost/config.hpp>
#include <boost/type_traits/make_unsigned.hpp>
namespace boost {
namespace random {
namespace detail {
/*
* Compute x - y, we know that x >= y, return an unsigned value.
*/
template<class T, bool sgn = std::numeric_limits<T>::is_signed>
struct subtract { };
template<class T>
struct subtract<T, /* signed */ false>
{
typedef T result_type;
result_type operator()(T x, T y) { return x - y; }
};
template<class T>
struct subtract<T, /* signed */ true>
{
typedef typename make_unsigned<T>::type result_type;
result_type operator()(T x, T y)
{
if (y >= 0) // because x >= y, it follows that x >= 0, too
return result_type(x) - result_type(y);
if (x >= 0) // y < 0
// avoid the nasty two's complement case for y == min()
return result_type(x) + result_type(-(y+1)) + 1;
// both x and y are negative: no signed overflow
return result_type(x - y);
}
};
/*
* Compute x + y, x is unsigned, result fits in type of "y".
*/
template<class T1, class T2, bool sgn = std::numeric_limits<T2>::is_signed>
struct add { };
template<class T1, class T2>
struct add<T1, T2, /* signed */ false>
{
typedef T2 result_type;
result_type operator()(T1 x, T2 y) { return T2(x) + y; }
};
template<class T1, class T2>
struct add<T1, T2, /* signed */ true>
{
typedef T2 result_type;
result_type operator()(T1 x, T2 y)
{
if (y >= 0)
return T2(x) + y;
// y < 0
if (x >= T1(-(y+1))) // result >= 0 after subtraction
// avoid the nasty two's complement edge case for y == min()
return T2(x - T1(-(y+1)) - 1);
// abs(x) < abs(y), thus T2 able to represent x
return T2(x) + y;
}
};
} // namespace detail
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_DETAIL_SIGNED_UNSIGNED_TOOLS

View File

@@ -0,0 +1,85 @@
/* boost random/detail/uniform_int_float.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: uniform_int_float.hpp 52492 2009-04-19 14:55:57Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP
#define BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP
#include <boost/config.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/uniform_01.hpp>
namespace boost {
namespace random {
namespace detail {
template<class UniformRandomNumberGenerator, class IntType = unsigned long>
class uniform_int_float
{
public:
typedef UniformRandomNumberGenerator base_type;
typedef IntType result_type;
uniform_int_float(base_type rng, IntType min_arg = 0, IntType max_arg = 0xffffffff)
: _rng(rng), _min(min_arg), _max(max_arg)
{
init();
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; }
base_type& base() { return _rng.base(); }
const base_type& base() const { return _rng.base(); }
result_type operator()()
{
return static_cast<IntType>(_rng() * _range) + _min;
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_int_float& ud)
{
os << ud._min << " " << ud._max;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, uniform_int_float& ud)
{
is >> std::ws >> ud._min >> std::ws >> ud._max;
ud.init();
return is;
}
#endif
private:
void init()
{
_range = static_cast<base_result>(_max-_min)+1;
}
typedef typename base_type::result_type base_result;
uniform_01<base_type> _rng;
result_type _min, _max;
base_result _range;
};
} // namespace detail
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_DETAIL_UNIFORM_INT_FLOAT_HPP

View File

@@ -0,0 +1,132 @@
/* boost random/discard_block.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: discard_block.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-03-02 created
*/
#ifndef BOOST_RANDOM_DISCARD_BLOCK_HPP
#define BOOST_RANDOM_DISCARD_BLOCK_HPP
#include <iostream>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
namespace boost {
namespace random {
/**
* The class template \discard_block is a model of
* \pseudo_random_number_generator. It modifies
* another generator by discarding parts of its output.
* Out of every block of @c r results, the first @c p
* will be returned and the rest discarded.
*
* Requires: 0 < p <= r
*/
template<class UniformRandomNumberGenerator, unsigned int p, unsigned int r>
class discard_block
{
public:
typedef UniformRandomNumberGenerator base_type;
typedef typename base_type::result_type result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(unsigned int, total_block = p);
BOOST_STATIC_CONSTANT(unsigned int, returned_block = r);
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(total_block >= returned_block);
#endif
discard_block() : _rng(), _n(0) { }
explicit discard_block(const base_type & rng) : _rng(rng), _n(0) { }
template<class T> explicit discard_block(T s) : _rng(s), _n(0) {}
template<class It> discard_block(It& first, It last)
: _rng(first, last), _n(0) { }
void seed() { _rng.seed(); _n = 0; }
template<class T> void seed(T s) { _rng.seed(s); _n = 0; }
template<class It> void seed(It& first, It last)
{ _n = 0; _rng.seed(first, last); }
const base_type& base() const { return _rng; }
result_type operator()()
{
if(_n >= returned_block) {
// discard values of random number generator
for( ; _n < total_block; ++_n)
_rng();
_n = 0;
}
++_n;
return _rng();
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (_rng.min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (_rng.max)(); }
static bool validation(result_type x) { return true; } // dummy
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const discard_block& s)
{
os << s._rng << " " << s._n << " ";
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, discard_block& s)
{
is >> s._rng >> std::ws >> s._n >> std::ws;
return is;
}
#endif
friend bool operator==(const discard_block& x, const discard_block& y)
{ return x._rng == y._rng && x._n == y._n; }
friend bool operator!=(const discard_block& x, const discard_block& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const discard_block& rhs) const
{ return _rng == rhs._rng && _n == rhs._n; }
bool operator!=(const discard_block& rhs) const
{ return !(*this == rhs); }
#endif
private:
base_type _rng;
unsigned int _n;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class UniformRandomNumberGenerator, unsigned int p, unsigned int r>
const bool discard_block<UniformRandomNumberGenerator, p, r>::has_fixed_range;
template<class UniformRandomNumberGenerator, unsigned int p, unsigned int r>
const unsigned int discard_block<UniformRandomNumberGenerator, p, r>::total_block;
template<class UniformRandomNumberGenerator, unsigned int p, unsigned int r>
const unsigned int discard_block<UniformRandomNumberGenerator, p, r>::returned_block;
#endif
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_DISCARD_BLOCK_HPP

View File

@@ -0,0 +1,86 @@
/* boost random/exponential_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: exponential_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
#define BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <cassert>
#include <iostream>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
namespace boost {
/**
* The exponential distribution has a single parameter lambda.
*
* It has \f$p(x) = \lambda e^{-\lambda x}\f$
*/
template<class RealType = double>
class exponential_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) && !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300)
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
explicit exponential_distribution(result_type lambda_arg = result_type(1))
: _lambda(lambda_arg) { assert(_lambda > result_type(0)); }
// compiler-generated copy ctor and assignment operator are fine
result_type lambda() const { return _lambda; }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng)
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::log;
#endif
return -result_type(1) / _lambda * log(result_type(1)-eng());
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const exponential_distribution& ed)
{
os << ed._lambda;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, exponential_distribution& ed)
{
is >> std::ws >> ed._lambda;
return is;
}
#endif
private:
result_type _lambda;
};
} // namespace boost
#endif // BOOST_RANDOM_EXPONENTIAL_DISTRIBUTION_HPP

View File

@@ -0,0 +1,143 @@
/* boost random/gamma_distribution.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: gamma_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_GAMMA_DISTRIBUTION_HPP
#define BOOST_RANDOM_GAMMA_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <cassert>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/exponential_distribution.hpp>
namespace boost {
// The algorithm is taken from Knuth
/**
* The gamma distribution is a continuous distribution with a single
* parameter alpha.
*
* It has \f$p(x) = x^{\alpha-1}\frac{e^{-x}}{\Gamma(\alpha)}\f$.
*/
template<class RealType = double>
class gamma_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
explicit gamma_distribution(const result_type& alpha_arg = result_type(1))
: _exp(result_type(1)), _alpha(alpha_arg)
{
assert(_alpha > result_type(0));
init();
}
// compiler-generated copy ctor and assignment operator are fine
RealType alpha() const { return _alpha; }
void reset() { _exp.reset(); }
template<class Engine>
result_type operator()(Engine& eng)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::tan; using std::sqrt; using std::exp; using std::log;
using std::pow;
#endif
if(_alpha == result_type(1)) {
return _exp(eng);
} else if(_alpha > result_type(1)) {
// Can we have a boost::mathconst please?
const result_type pi = result_type(3.14159265358979323846);
for(;;) {
result_type y = tan(pi * eng());
result_type x = sqrt(result_type(2)*_alpha-result_type(1))*y
+ _alpha-result_type(1);
if(x <= result_type(0))
continue;
if(eng() >
(result_type(1)+y*y) * exp((_alpha-result_type(1))
*log(x/(_alpha-result_type(1)))
- sqrt(result_type(2)*_alpha
-result_type(1))*y))
continue;
return x;
}
} else /* alpha < 1.0 */ {
for(;;) {
result_type u = eng();
result_type y = _exp(eng);
result_type x, q;
if(u < _p) {
x = exp(-y/_alpha);
q = _p*exp(-x);
} else {
x = result_type(1)+y;
q = _p + (result_type(1)-_p) * pow(x, _alpha-result_type(1));
}
if(u >= q)
continue;
return x;
}
}
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const gamma_distribution& gd)
{
os << gd._alpha;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, gamma_distribution& gd)
{
is >> std::ws >> gd._alpha;
gd.init();
return is;
}
#endif
private:
/// \cond hide_private_members
void init()
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::exp;
#endif
_p = exp(result_type(1)) / (_alpha + exp(result_type(1)));
}
/// \endcond
exponential_distribution<RealType> _exp;
result_type _alpha;
// some data precomputed from the parameters
result_type _p;
};
} // namespace boost
#endif // BOOST_RANDOM_GAMMA_DISTRIBUTION_HPP

View File

@@ -0,0 +1,118 @@
/* boost random/geometric_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: geometric_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_GEOMETRIC_DISTRIBUTION_HPP
#define BOOST_RANDOM_GEOMETRIC_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp> // std::log
#include <cassert>
#include <iostream>
#include <boost/random/detail/config.hpp>
#include <boost/random/uniform_01.hpp>
namespace boost {
#if defined(__GNUC__) && (__GNUC__ < 3)
// Special gcc workaround: gcc 2.95.x ignores using-declarations
// in template classes (confirmed by gcc author Martin v. Loewis)
using std::log;
#endif
/**
* An instantiation of the class template @c geometric_distribution models
* a \random_distribution. The distribution produces positive
* integers which are the number of bernoulli trials
* with probability @c p required to get one that fails.
*
* For the geometric distribution, \f$p(i) = (1-p) p^{i-1}\f$.
*/
template<class IntType = int, class RealType = double>
class geometric_distribution
{
public:
typedef RealType input_type;
typedef IntType result_type;
/**
* Contructs a new geometric_distribution with the paramter @c p.
*
* Requires: 0 < p < 1
*/
explicit geometric_distribution(const RealType& p = RealType(0.5))
: _p(p)
{
assert(RealType(0) < _p && _p < RealType(1));
init();
}
// compiler-generated copy ctor and assignment operator are fine
/**
* Returns: the distribution parameter @c p
*/
RealType p() const { return _p; }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng)
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::log;
using std::floor;
#endif
return IntType(floor(log(RealType(1)-eng()) / _log_p)) + IntType(1);
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const geometric_distribution& gd)
{
os << gd._p;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, geometric_distribution& gd)
{
is >> std::ws >> gd._p;
gd.init();
return is;
}
#endif
private:
/// \cond hide_private_functions
void init()
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::log;
#endif
_log_p = log(_p);
}
/// \endcond
RealType _p;
RealType _log_p;
};
} // namespace boost
#endif // BOOST_RANDOM_GEOMETRIC_DISTRIBUTION_HPP

View File

@@ -0,0 +1,173 @@
/* boost random/inversive_congruential.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: inversive_congruential.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_INVERSIVE_CONGRUENTIAL_HPP
#define BOOST_RANDOM_INVERSIVE_CONGRUENTIAL_HPP
#include <iostream>
#include <cassert>
#include <stdexcept>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/const_mod.hpp>
namespace boost {
namespace random {
// Eichenauer and Lehn 1986
/**
* Instantiations of class template @c inversive_congruential model a
* \pseudo_random_number_generator. It uses the inversive congruential
* algorithm (ICG) described in
*
* @blockquote
* "Inversive pseudorandom number generators: concepts, results and links",
* Peter Hellekalek, In: "Proceedings of the 1995 Winter Simulation
* Conference", C. Alexopoulos, K. Kang, W.R. Lilegdon, and D. Goldsman
* (editors), 1995, pp. 255-262. ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps
* @endblockquote
*
* The output sequence is defined by x(n+1) = (a*inv(x(n)) - b) (mod p),
* where x(0), a, b, and the prime number p are parameters of the generator.
* The expression inv(k) denotes the multiplicative inverse of k in the
* field of integer numbers modulo p, with inv(0) := 0.
*
* The template parameter IntType shall denote a signed integral type large
* enough to hold p; a, b, and p are the parameters of the generators. The
* template parameter val is the validation value checked by validation.
*
* @xmlnote
* The implementation currently uses the Euclidian Algorithm to compute
* the multiplicative inverse. Therefore, the inversive generators are about
* 10-20 times slower than the others (see section"performance"). However,
* the paper talks of only 3x slowdown, so the Euclidian Algorithm is probably
* not optimal for calculating the multiplicative inverse.
* @endxmlnote
*/
template<class IntType, IntType a, IntType b, IntType p, IntType val>
class inversive_congruential
{
public:
typedef IntType result_type;
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
static const bool has_fixed_range = true;
static const result_type min_value = (b == 0 ? 1 : 0);
static const result_type max_value = p-1;
#else
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
#endif
BOOST_STATIC_CONSTANT(result_type, multiplier = a);
BOOST_STATIC_CONSTANT(result_type, increment = b);
BOOST_STATIC_CONSTANT(result_type, modulus = p);
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return b == 0 ? 1 : 0; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return p-1; }
/**
* Constructs an inversive_congruential generator with
* @c y0 as the initial state.
*/
explicit inversive_congruential(IntType y0 = 1) : value(y0)
{
BOOST_STATIC_ASSERT(b >= 0);
BOOST_STATIC_ASSERT(p > 1);
BOOST_STATIC_ASSERT(a >= 1);
if(b == 0)
assert(y0 > 0);
}
template<class It> inversive_congruential(It& first, It last)
{ seed(first, last); }
/** Changes the current state to y0. */
void seed(IntType y0 = 1) { value = y0; if(b == 0) assert(y0 > 0); }
template<class It> void seed(It& first, It last)
{
if(first == last)
throw std::invalid_argument("inversive_congruential::seed");
value = *first++;
}
IntType operator()()
{
typedef const_mod<IntType, p> do_mod;
value = do_mod::mult_add(a, do_mod::invert(value), b);
return value;
}
static bool validation(result_type x) { return val == x; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, inversive_congruential x)
{ os << x.value; return os; }
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, inversive_congruential& x)
{ is >> x.value; return is; }
#endif
friend bool operator==(inversive_congruential x, inversive_congruential y)
{ return x.value == y.value; }
friend bool operator!=(inversive_congruential x, inversive_congruential y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(inversive_congruential rhs) const
{ return value == rhs.value; }
bool operator!=(inversive_congruential rhs) const
{ return !(*this == rhs); }
#endif
private:
IntType value;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class IntType, IntType a, IntType b, IntType p, IntType val>
const bool inversive_congruential<IntType, a, b, p, val>::has_fixed_range;
template<class IntType, IntType a, IntType b, IntType p, IntType val>
const typename inversive_congruential<IntType, a, b, p, val>::result_type inversive_congruential<IntType, a, b, p, val>::min_value;
template<class IntType, IntType a, IntType b, IntType p, IntType val>
const typename inversive_congruential<IntType, a, b, p, val>::result_type inversive_congruential<IntType, a, b, p, val>::max_value;
template<class IntType, IntType a, IntType b, IntType p, IntType val>
const typename inversive_congruential<IntType, a, b, p, val>::result_type inversive_congruential<IntType, a, b, p, val>::multiplier;
template<class IntType, IntType a, IntType b, IntType p, IntType val>
const typename inversive_congruential<IntType, a, b, p, val>::result_type inversive_congruential<IntType, a, b, p, val>::increment;
template<class IntType, IntType a, IntType b, IntType p, IntType val>
const typename inversive_congruential<IntType, a, b, p, val>::result_type inversive_congruential<IntType, a, b, p, val>::modulus;
#endif
} // namespace random
/**
* The specialization hellekalek1995 was suggested in
*
* @blockquote
* "Inversive pseudorandom number generators: concepts, results and links",
* Peter Hellekalek, In: "Proceedings of the 1995 Winter Simulation
* Conference", C. Alexopoulos, K. Kang, W.R. Lilegdon, and D. Goldsman
* (editors), 1995, pp. 255-262. ftp://random.mat.sbg.ac.at/pub/data/wsc95.ps
* @endblockquote
*/
typedef random::inversive_congruential<int32_t, 9102, 2147483647-36884165,
2147483647, 0> hellekalek1995;
} // namespace boost
#endif // BOOST_RANDOM_INVERSIVE_CONGRUENTIAL_HPP

View File

@@ -0,0 +1,605 @@
/* boost random/lagged_fibonacci.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: lagged_fibonacci.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_LAGGED_FIBONACCI_HPP
#define BOOST_RANDOM_LAGGED_FIBONACCI_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <iostream>
#include <algorithm> // std::max
#include <iterator>
#include <boost/config/no_tr1/cmath.hpp> // std::pow
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/cstdint.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/seed.hpp>
#include <boost/random/detail/pass_through_engine.hpp>
namespace boost {
namespace random {
#if BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) && BOOST_MSVC > 1300
# define BOOST_RANDOM_EXTRACT_LF
#endif
#if defined(__APPLE_CC__) && defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ <= 3)
# define BOOST_RANDOM_EXTRACT_LF
#endif
# ifdef BOOST_RANDOM_EXTRACT_LF
namespace detail
{
template<class IStream, class F, class RealType>
IStream&
extract_lagged_fibonacci_01(
IStream& is
, F const& f
, unsigned int& i
, RealType* x
, RealType modulus)
{
is >> i >> std::ws;
for(unsigned int i = 0; i < f.long_lag; ++i)
{
RealType value;
is >> value >> std::ws;
x[i] = value / modulus;
}
return is;
}
template<class IStream, class F, class UIntType>
IStream&
extract_lagged_fibonacci(
IStream& is
, F const& f
, unsigned int& i
, UIntType* x)
{
is >> i >> std::ws;
for(unsigned int i = 0; i < f.long_lag; ++i)
is >> x[i] >> std::ws;
return is;
}
}
# endif
/**
* Instantiations of class template \lagged_fibonacci model a
* \pseudo_random_number_generator. It uses a lagged Fibonacci
* algorithm with two lags @c p and @c q:
* x(i) = x(i-p) + x(i-q) (mod 2<sup>w</sup>) with p > q.
*/
template<class UIntType, int w, unsigned int p, unsigned int q,
UIntType val = 0>
class lagged_fibonacci
{
public:
typedef UIntType result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(unsigned int, long_lag = p);
BOOST_STATIC_CONSTANT(unsigned int, short_lag = q);
/**
* Returns: the smallest value that the generator can produce
*/
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; }
/**
* Returns: the largest value that the generator can produce
*/
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return wordmask; }
/**
* Creates a new @c lagged_fibonacci generator and calls @c seed()
*/
lagged_fibonacci() { init_wordmask(); seed(); }
/**
* Creates a new @c lagged_fibonacci generator and calls @c seed(value)
*/
explicit lagged_fibonacci(uint32_t value) { init_wordmask(); seed(value); }
/**
* Creates a new @c lagged_fibonacci generator and calls @c seed(first, last)
*/
template<class It> lagged_fibonacci(It& first, It last)
{ init_wordmask(); seed(first, last); }
// compiler-generated copy ctor and assignment operator are fine
private:
/// \cond hide_private_members
void init_wordmask()
{
wordmask = 0;
for(int j = 0; j < w; ++j)
wordmask |= (1u << j);
}
/// \endcond
public:
/**
* Sets the state of the generator to values produced by
* a \minstd_rand generator.
*/
void seed(uint32_t value = 331u)
{
minstd_rand0 gen(value);
for(unsigned int j = 0; j < long_lag; ++j)
x[j] = gen() & wordmask;
i = long_lag;
}
/**
* Sets the state of the generator to values from the iterator
* range [first, last). If there are not enough elements in the
* range [first, last) throws @c std::invalid_argument.
*/
template<class It>
void seed(It& first, It last)
{
// word size could be smaller than the seed values
unsigned int j;
for(j = 0; j < long_lag && first != last; ++j, ++first)
x[j] = *first & wordmask;
i = long_lag;
if(first == last && j < long_lag)
throw std::invalid_argument("lagged_fibonacci::seed");
}
/**
* Returns: the next value of the generator
*/
result_type operator()()
{
if(i >= long_lag)
fill();
return x[i++];
}
static bool validation(result_type x)
{
return x == val;
}
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const lagged_fibonacci& f)
{
os << f.i << " ";
for(unsigned int i = 0; i < f.long_lag; ++i)
os << f.x[i] << " ";
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is, lagged_fibonacci& f)
{
# ifdef BOOST_RANDOM_EXTRACT_LF
return detail::extract_lagged_fibonacci(is, f, f.i, f.x);
# else
is >> f.i >> std::ws;
for(unsigned int i = 0; i < f.long_lag; ++i)
is >> f.x[i] >> std::ws;
return is;
# endif
}
#endif
friend bool operator==(const lagged_fibonacci& x, const lagged_fibonacci& y)
{ return x.i == y.i && std::equal(x.x, x.x+long_lag, y.x); }
friend bool operator!=(const lagged_fibonacci& x,
const lagged_fibonacci& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const lagged_fibonacci& rhs) const
{ return i == rhs.i && std::equal(x, x+long_lag, rhs.x); }
bool operator!=(const lagged_fibonacci& rhs) const
{ return !(*this == rhs); }
#endif
private:
/// \cond hide_private_members
void fill();
/// \endcond
UIntType wordmask;
unsigned int i;
UIntType x[long_lag];
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class UIntType, int w, unsigned int p, unsigned int q, UIntType val>
const bool lagged_fibonacci<UIntType, w, p, q, val>::has_fixed_range;
template<class UIntType, int w, unsigned int p, unsigned int q, UIntType val>
const unsigned int lagged_fibonacci<UIntType, w, p, q, val>::long_lag;
template<class UIntType, int w, unsigned int p, unsigned int q, UIntType val>
const unsigned int lagged_fibonacci<UIntType, w, p, q, val>::short_lag;
#endif
/// \cond hide_private_members
template<class UIntType, int w, unsigned int p, unsigned int q, UIntType val>
void lagged_fibonacci<UIntType, w, p, q, val>::fill()
{
// two loops to avoid costly modulo operations
{ // extra scope for MSVC brokenness w.r.t. for scope
for(unsigned int j = 0; j < short_lag; ++j)
x[j] = (x[j] + x[j+(long_lag-short_lag)]) & wordmask;
}
for(unsigned int j = short_lag; j < long_lag; ++j)
x[j] = (x[j] + x[j-short_lag]) & wordmask;
i = 0;
}
// lagged Fibonacci generator for the range [0..1)
// contributed by Matthias Troyer
// for p=55, q=24 originally by G. J. Mitchell and D. P. Moore 1958
template<class T, unsigned int p, unsigned int q>
struct fibonacci_validation
{
BOOST_STATIC_CONSTANT(bool, is_specialized = false);
static T value() { return 0; }
static T tolerance() { return 0; }
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class T, unsigned int p, unsigned int q>
const bool fibonacci_validation<T, p, q>::is_specialized;
#endif
#define BOOST_RANDOM_FIBONACCI_VAL(T,P,Q,V,E) \
template<> \
struct fibonacci_validation<T, P, Q> \
{ \
BOOST_STATIC_CONSTANT(bool, is_specialized = true); \
static T value() { return V; } \
static T tolerance() \
{ return (std::max)(E, static_cast<T>(5*std::numeric_limits<T>::epsilon())); } \
};
// (The extra static_cast<T> in the std::max call above is actually
// unnecessary except for HP aCC 1.30, which claims that
// numeric_limits<double>::epsilon() doesn't actually return a double.)
BOOST_RANDOM_FIBONACCI_VAL(double, 607, 273, 0.4293817707235914, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 1279, 418, 0.9421630240437659, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 2281, 1252, 0.1768114046909004, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 3217, 576, 0.1956232694868209, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 4423, 2098, 0.9499762202147172, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 9689, 5502, 0.05737836943695162, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 19937, 9842, 0.5076528587449834, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 23209, 13470, 0.5414473810619185, 1e-14)
BOOST_RANDOM_FIBONACCI_VAL(double, 44497,21034, 0.254135073399297, 1e-14)
#undef BOOST_RANDOM_FIBONACCI_VAL
/// \endcond
/**
* Instantiations of class template @c lagged_fibonacci_01 model a
* \pseudo_random_number_generator. It uses a lagged Fibonacci
* algorithm with two lags @c p and @c q, evaluated in floating-point
* arithmetic: x(i) = x(i-p) + x(i-q) (mod 1) with p > q. See
*
* @blockquote
* "Uniform random number generators for supercomputers", Richard Brent,
* Proc. of Fifth Australian Supercomputer Conference, Melbourne,
* Dec. 1992, pp. 704-706.
* @endblockquote
*
* @xmlnote
* The quality of the generator crucially depends on the choice
* of the parameters. User code should employ one of the sensibly
* parameterized generators such as \lagged_fibonacci607 instead.
* @endxmlnote
*
* The generator requires considerable amounts of memory for the storage
* of its state array. For example, \lagged_fibonacci607 requires about
* 4856 bytes and \lagged_fibonacci44497 requires about 350 KBytes.
*/
template<class RealType, int w, unsigned int p, unsigned int q>
class lagged_fibonacci_01
{
public:
typedef RealType result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(unsigned int, long_lag = p);
BOOST_STATIC_CONSTANT(unsigned int, short_lag = q);
/** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(). */
lagged_fibonacci_01() { init_modulus(); seed(); }
/** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(value). */
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(lagged_fibonacci_01, uint32_t, value)
{ init_modulus(); seed(value); }
/** Constructs a @c lagged_fibonacci_01 generator and calls @c seed(gen). */
BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(lagged_fibonacci_01, Generator, gen)
{ init_modulus(); seed(gen); }
template<class It> lagged_fibonacci_01(It& first, It last)
{ init_modulus(); seed(first, last); }
// compiler-generated copy ctor and assignment operator are fine
private:
/// \cond hide_private_members
void init_modulus()
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::pow;
#endif
_modulus = pow(RealType(2), word_size);
}
/// \endcond
public:
/** Calls seed(331u). */
void seed() { seed(331u); }
/**
* Constructs a \minstd_rand0 generator with the constructor parameter
* value and calls seed with it. Distinct seeds in the range
* [1, 2147483647) will produce generators with different states. Other
* seeds will be equivalent to some seed within this range. See
* \linear_congruential for details.
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(lagged_fibonacci_01, uint32_t, value)
{
minstd_rand0 intgen(value);
seed(intgen);
}
/**
* Sets the state of this @c lagged_fibonacci_01 to the values returned
* by p invocations of \uniform_01<code>\<RealType\>()(gen)</code>.
*
* Complexity: Exactly p invocations of gen.
*/
BOOST_RANDOM_DETAIL_GENERATOR_SEED(lagged_fibonacci, Generator, gen)
{
// use pass-by-reference, but wrap argument in pass_through_engine
typedef detail::pass_through_engine<Generator&> ref_gen;
uniform_01<ref_gen, RealType> gen01 =
uniform_01<ref_gen, RealType>(ref_gen(gen));
// I could have used std::generate_n, but it takes "gen" by value
for(unsigned int j = 0; j < long_lag; ++j)
x[j] = gen01();
i = long_lag;
}
template<class It>
void seed(It& first, It last)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::fmod;
using std::pow;
#endif
unsigned long mask = ~((~0u) << (w%32)); // now lowest w bits set
RealType two32 = pow(RealType(2), 32);
unsigned int j;
for(j = 0; j < long_lag && first != last; ++j) {
x[j] = RealType(0);
for(int k = 0; k < w/32 && first != last; ++k, ++first)
x[j] += *first / pow(two32,k+1);
if(first != last && mask != 0) {
x[j] += fmod((*first & mask) / _modulus, RealType(1));
++first;
}
}
i = long_lag;
if(first == last && j < long_lag)
throw std::invalid_argument("lagged_fibonacci_01::seed");
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(0); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(1); }
result_type operator()()
{
if(i >= long_lag)
fill();
return x[i++];
}
static bool validation(result_type x)
{
result_type v = fibonacci_validation<result_type, p, q>::value();
result_type epsilon = fibonacci_validation<result_type, p, q>::tolerance();
// std::abs is a source of trouble: sometimes, it's not overloaded
// for double, plus the usual namespace std noncompliance -> avoid it
// using std::abs;
// return abs(x - v) < 5 * epsilon
return x > v - epsilon && x < v + epsilon;
}
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const lagged_fibonacci_01&f)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::pow;
#endif
os << f.i << " ";
std::ios_base::fmtflags oldflags = os.flags(os.dec | os.fixed | os.left);
for(unsigned int i = 0; i < f.long_lag; ++i)
os << f.x[i] * f._modulus << " ";
os.flags(oldflags);
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT, Traits>&
operator>>(std::basic_istream<CharT, Traits>& is, lagged_fibonacci_01& f)
{
# ifdef BOOST_RANDOM_EXTRACT_LF
return detail::extract_lagged_fibonacci_01(is, f, f.i, f.x, f._modulus);
# else
is >> f.i >> std::ws;
for(unsigned int i = 0; i < f.long_lag; ++i) {
typename lagged_fibonacci_01::result_type value;
is >> value >> std::ws;
f.x[i] = value / f._modulus;
}
return is;
# endif
}
#endif
friend bool operator==(const lagged_fibonacci_01& x,
const lagged_fibonacci_01& y)
{ return x.i == y.i && std::equal(x.x, x.x+long_lag, y.x); }
friend bool operator!=(const lagged_fibonacci_01& x,
const lagged_fibonacci_01& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const lagged_fibonacci_01& rhs) const
{ return i == rhs.i && std::equal(x, x+long_lag, rhs.x); }
bool operator!=(const lagged_fibonacci_01& rhs) const
{ return !(*this == rhs); }
#endif
private:
/// \cond hide_private_members
void fill();
/// \endcond
unsigned int i;
RealType x[long_lag];
RealType _modulus;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class RealType, int w, unsigned int p, unsigned int q>
const bool lagged_fibonacci_01<RealType, w, p, q>::has_fixed_range;
template<class RealType, int w, unsigned int p, unsigned int q>
const unsigned int lagged_fibonacci_01<RealType, w, p, q>::long_lag;
template<class RealType, int w, unsigned int p, unsigned int q>
const unsigned int lagged_fibonacci_01<RealType, w, p, q>::short_lag;
template<class RealType, int w, unsigned int p, unsigned int q>
const int lagged_fibonacci_01<RealType,w,p,q>::word_size;
#endif
/// \cond hide_private_members
template<class RealType, int w, unsigned int p, unsigned int q>
void lagged_fibonacci_01<RealType, w, p, q>::fill()
{
// two loops to avoid costly modulo operations
{ // extra scope for MSVC brokenness w.r.t. for scope
for(unsigned int j = 0; j < short_lag; ++j) {
RealType t = x[j] + x[j+(long_lag-short_lag)];
if(t >= RealType(1))
t -= RealType(1);
x[j] = t;
}
}
for(unsigned int j = short_lag; j < long_lag; ++j) {
RealType t = x[j] + x[j-short_lag];
if(t >= RealType(1))
t -= RealType(1);
x[j] = t;
}
i = 0;
}
/// \endcond
} // namespace random
#ifdef BOOST_RANDOM_DOXYGEN
namespace detail {
/**
* The specializations lagged_fibonacci607 ... lagged_fibonacci44497
* use well tested lags.
*
* See
*
* @blockquote
* "On the Periods of Generalized Fibonacci Recurrences", Richard P. Brent
* Computer Sciences Laboratory Australian National University, December 1992
* @endblockquote
*
* The lags used here can be found in
*
* @blockquote
* "Uniform random number generators for supercomputers", Richard Brent,
* Proc. of Fifth Australian Supercomputer Conference, Melbourne,
* Dec. 1992, pp. 704-706.
* @endblockquote
*/
struct lagged_fibonacci_doc {};
}
#endif
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 607, 273> lagged_fibonacci607;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 1279, 418> lagged_fibonacci1279;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 2281, 1252> lagged_fibonacci2281;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 3217, 576> lagged_fibonacci3217;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 4423, 2098> lagged_fibonacci4423;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 9689, 5502> lagged_fibonacci9689;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 19937, 9842> lagged_fibonacci19937;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 23209, 13470> lagged_fibonacci23209;
/**
* @copydoc boost::detail::lagged_fibonacci_doc
*/
typedef random::lagged_fibonacci_01<double, 48, 44497, 21034> lagged_fibonacci44497;
// It is possible to partially specialize uniform_01<> on lagged_fibonacci_01<>
// to help the compiler generate efficient code. For GCC, this seems useless,
// because GCC optimizes (x-0)/(1-0) to (x-0). This is good enough for now.
} // namespace boost
#endif // BOOST_RANDOM_LAGGED_FIBONACCI_HPP

View File

@@ -0,0 +1,403 @@
/* boost random/linear_congruential.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: linear_congruential.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP
#define BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP
#include <iostream>
#include <cassert>
#include <stdexcept>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/const_mod.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/random/detail/disable_warnings.hpp>
namespace boost {
namespace random {
/**
* Instantiations of class template linear_congruential model a
* \pseudo_random_number_generator. Linear congruential pseudo-random
* number generators are described in:
*
* "Mathematical methods in large-scale computing units", D. H. Lehmer,
* Proc. 2nd Symposium on Large-Scale Digital Calculating Machines,
* Harvard University Press, 1951, pp. 141-146
*
* Let x(n) denote the sequence of numbers returned by some pseudo-random
* number generator. Then for the linear congruential generator,
* x(n+1) := (a * x(n) + c) mod m. Parameters for the generator are
* x(0), a, c, m. The template parameter IntType shall denote an integral
* type. It must be large enough to hold values a, c, and m. The template
* parameters a and c must be smaller than m.
*
* Note: The quality of the generator crucially depends on the choice of
* the parameters. User code should use one of the sensibly parameterized
* generators such as minstd_rand instead.
*/
template<class IntType, IntType a, IntType c, IntType m, IntType val>
class linear_congruential
{
public:
typedef IntType result_type;
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
static const bool has_fixed_range = true;
static const result_type min_value = ( c == 0 ? 1 : 0 );
static const result_type max_value = m-1;
#else
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
#endif
BOOST_STATIC_CONSTANT(IntType, multiplier = a);
BOOST_STATIC_CONSTANT(IntType, increment = c);
BOOST_STATIC_CONSTANT(IntType, modulus = m);
// MSVC 6 and possibly others crash when encountering complicated integral
// constant expressions. Avoid the check for now.
// BOOST_STATIC_ASSERT(m == 0 || a < m);
// BOOST_STATIC_ASSERT(m == 0 || c < m);
/**
* Constructs a linear_congruential generator, seeding it with @c x0.
*/
explicit linear_congruential(IntType x0 = 1)
{
seed(x0);
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
#endif
}
/**
* Constructs a @c linear_congruential generator and seeds it
* with values taken from the itrator range [first, last)
* and adjusts first to point to the element after the last one
* used. If there are not enough elements, throws @c std::invalid_argument.
*
* first and last must be input iterators.
*/
template<class It>
linear_congruential(It& first, It last)
{
seed(first, last);
}
// compiler-generated copy constructor and assignment operator are fine
/**
* If c mod m is zero and x0 mod m is zero, changes the current value of
* the generator to 1. Otherwise, changes it to x0 mod m. If c is zero,
* distinct seeds in the range [1,m) will leave the generator in distinct
* states. If c is not zero, the range is [0,m).
*/
void seed(IntType x0 = 1)
{
// wrap _x if it doesn't fit in the destination
if(modulus == 0) {
_x = x0;
} else {
_x = x0 % modulus;
}
// handle negative seeds
if(_x <= 0 && _x != 0) {
_x += modulus;
}
// adjust to the correct range
if(increment == 0 && _x == 0) {
_x = 1;
}
assert(_x >= (min)());
assert(_x <= (max)());
}
/**
* seeds a @c linear_congruential generator with values taken
* from the itrator range [first, last) and adjusts @c first to
* point to the element after the last one used. If there are
* not enough elements, throws @c std::invalid_argument.
*
* @c first and @c last must be input iterators.
*/
template<class It>
void seed(It& first, It last)
{
if(first == last)
throw std::invalid_argument("linear_congruential::seed");
seed(*first++);
}
/**
* Returns the smallest value that the @c linear_congruential generator
* can produce.
*/
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return c == 0 ? 1 : 0; }
/**
* Returns the largest value that the @c linear_congruential generator
* can produce.
*/
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return modulus-1; }
/** Returns the next value of the @c linear_congruential generator. */
IntType operator()()
{
_x = const_mod<IntType, m>::mult_add(a, _x, c);
return _x;
}
static bool validation(IntType x) { return val == x; }
#ifdef BOOST_NO_OPERATORS_IN_NAMESPACE
// Use a member function; Streamable concept not supported.
bool operator==(const linear_congruential& rhs) const
{ return _x == rhs._x; }
bool operator!=(const linear_congruential& rhs) const
{ return !(*this == rhs); }
#else
friend bool operator==(const linear_congruential& x,
const linear_congruential& y)
{ return x._x == y._x; }
friend bool operator!=(const linear_congruential& x,
const linear_congruential& y)
{ return !(x == y); }
#if !defined(BOOST_RANDOM_NO_STREAM_OPERATORS) && !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const linear_congruential& lcg)
{
return os << lcg._x;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
linear_congruential& lcg)
{
return is >> lcg._x;
}
private:
#endif
#endif
IntType _x;
};
// probably needs the "no native streams" caveat for STLPort
#if !defined(__SGI_STL_PORT) && BOOST_WORKAROUND(__GNUC__, == 2)
template<class IntType, IntType a, IntType c, IntType m, IntType val>
std::ostream&
operator<<(std::ostream& os,
const linear_congruential<IntType,a,c,m,val>& lcg)
{
return os << lcg._x;
}
template<class IntType, IntType a, IntType c, IntType m, IntType val>
std::istream&
operator>>(std::istream& is,
linear_congruential<IntType,a,c,m,val>& lcg)
{
return is >> lcg._x;
}
#elif defined(BOOST_RANDOM_NO_STREAM_OPERATORS) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x551))
template<class CharT, class Traits, class IntType, IntType a, IntType c, IntType m, IntType val>
std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const linear_congruential<IntType,a,c,m,val>& lcg)
{
return os << lcg._x;
}
template<class CharT, class Traits, class IntType, IntType a, IntType c, IntType m, IntType val>
std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is,
linear_congruential<IntType,a,c,m,val>& lcg)
{
return is >> lcg._x;
}
#endif
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class IntType, IntType a, IntType c, IntType m, IntType val>
const bool linear_congruential<IntType, a, c, m, val>::has_fixed_range;
template<class IntType, IntType a, IntType c, IntType m, IntType val>
const typename linear_congruential<IntType, a, c, m, val>::result_type linear_congruential<IntType, a, c, m, val>::min_value;
template<class IntType, IntType a, IntType c, IntType m, IntType val>
const typename linear_congruential<IntType, a, c, m, val>::result_type linear_congruential<IntType, a, c, m, val>::max_value;
template<class IntType, IntType a, IntType c, IntType m, IntType val>
const IntType linear_congruential<IntType,a,c,m,val>::modulus;
#endif
} // namespace random
// validation values from the publications
/**
* The specialization \minstd_rand0 was originally suggested in
*
* @blockquote
* A pseudo-random number generator for the System/360, P.A. Lewis,
* A.S. Goodman, J.M. Miller, IBM Systems Journal, Vol. 8, No. 2,
* 1969, pp. 136-146
* @endblockquote
*
* It is examined more closely together with \minstd_rand in
*
* @blockquote
* "Random Number Generators: Good ones are hard to find",
* Stephen K. Park and Keith W. Miller, Communications of
* the ACM, Vol. 31, No. 10, October 1988, pp. 1192-1201
* @endblockquote
*/
typedef random::linear_congruential<int32_t, 16807, 0, 2147483647,
1043618065> minstd_rand0;
/** The specialization \minstd_rand was suggested in
*
* @blockquote
* "Random Number Generators: Good ones are hard to find",
* Stephen K. Park and Keith W. Miller, Communications of
* the ACM, Vol. 31, No. 10, October 1988, pp. 1192-1201
* @endblockquote
*/
typedef random::linear_congruential<int32_t, 48271, 0, 2147483647,
399268537> minstd_rand;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
/** Class @c rand48 models a \pseudo_random_number_generator. It uses
* the linear congruential algorithm with the parameters a = 0x5DEECE66D,
* c = 0xB, m = 2**48. It delivers identical results to the @c lrand48()
* function available on some systems (assuming lcong48 has not been called).
*
* It is only available on systems where @c uint64_t is provided as an
* integral type, so that for example static in-class constants and/or
* enum definitions with large @c uint64_t numbers work.
*/
class rand48
{
public:
typedef int32_t result_type;
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
static const bool has_fixed_range = true;
static const int32_t min_value = 0;
static const int32_t max_value = integer_traits<int32_t>::const_max;
#else
enum { has_fixed_range = false };
#endif
/**
* Returns the smallest value that the generator can produce
*/
int32_t min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; }
/**
* Returns the largest value that the generator can produce
*/
int32_t max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return std::numeric_limits<int32_t>::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
#ifdef BOOST_RANDOM_DOXYGEN
/**
* If T is an integral type smaller than int46_t, constructs
* a \rand48 generator with x(0) := (x0 << 16) | 0x330e. Otherwise
* constructs a \rand48 generator with x(0) = x0.
*/
template<class T> explicit rand48(T x0 = 1);
#else
rand48() : lcf(cnv(static_cast<int32_t>(1))) {}
template<class T> explicit rand48(T x0) : lcf(cnv(x0)) { }
#endif
template<class It> rand48(It& first, It last) : lcf(first, last) { }
// compiler-generated copy ctor and assignment operator are fine
#ifdef BOOST_RANDOM_DOXYGEN
/**
* If T is an integral type smaller than int46_t, changes
* the current value x(n) of the generator to (x0 << 16) | 0x330e.
* Otherwise changes the current value x(n) to x0.
*/
template<class T> void seed(T x0 = 1);
#else
void seed() { seed(static_cast<int32_t>(1)); }
template<class T> void seed(T x0) { lcf.seed(cnv(x0)); }
#endif
template<class It> void seed(It& first, It last) { lcf.seed(first,last); }
/**
* Returns the next value of the generator.
*/
int32_t operator()() { return static_cast<int32_t>(lcf() >> 17); }
// by experiment from lrand48()
static bool validation(int32_t x) { return x == 1993516219; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT,class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const rand48& r)
{ os << r.lcf; return os; }
template<class CharT,class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, rand48& r)
{ is >> r.lcf; return is; }
#endif
friend bool operator==(const rand48& x, const rand48& y)
{ return x.lcf == y.lcf; }
friend bool operator!=(const rand48& x, const rand48& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const rand48& rhs) const
{ return lcf == rhs.lcf; }
bool operator!=(const rand48& rhs) const
{ return !(*this == rhs); }
#endif
private:
/// \cond hide_private_members
random::linear_congruential<uint64_t,
uint64_t(0xDEECE66DUL) | (uint64_t(0x5) << 32), // xxxxULL is not portable
0xB, uint64_t(1)<<48, /* unknown */ 0> lcf;
template<class T>
static uint64_t cnv(T x)
{
if(sizeof(T) < sizeof(uint64_t)) {
return (static_cast<uint64_t>(x) << 16) | 0x330e;
} else {
return(static_cast<uint64_t>(x));
}
}
static uint64_t cnv(float x) { return(static_cast<uint64_t>(x)); }
static uint64_t cnv(double x) { return(static_cast<uint64_t>(x)); }
static uint64_t cnv(long double x) { return(static_cast<uint64_t>(x)); }
/// \endcond
};
#endif /* !BOOST_NO_INT64_T && !BOOST_NO_INTEGRAL_INT64_T */
} // namespace boost
#include <boost/random/detail/enable_warnings.hpp>
#endif // BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP

View File

@@ -0,0 +1,160 @@
/* boost random/tausworthe.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: linear_feedback_shift.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_LINEAR_FEEDBACK_SHIFT_HPP
#define BOOST_RANDOM_LINEAR_FEEDBACK_SHIFT_HPP
#include <iostream>
#include <cassert>
#include <stdexcept>
#include <boost/config.hpp>
#include <boost/static_assert.hpp>
#include <boost/limits.hpp>
#include <boost/random/detail/config.hpp>
namespace boost {
namespace random {
/**
* Instatiation of @c linear_feedback_shift model a
* \pseudo_random_number_generator. It was originally
* proposed in
*
* @blockquote
* "Random numbers generated by linear recurrence modulo two.",
* Tausworthe, R. C.(1965), Mathematics of Computation 19, 201-209.
* @endblockquote
*/
template<class UIntType, int w, int k, int q, int s, UIntType val>
class linear_feedback_shift
{
public:
typedef UIntType result_type;
// avoid the warning trouble when using (1<<w) on 32 bit machines
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(int, exponent1 = k);
BOOST_STATIC_CONSTANT(int, exponent2 = q);
BOOST_STATIC_CONSTANT(int, step_size = s);
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return wordmask; }
// MSVC 6 and possibly others crash when encountering complicated integral
// constant expressions. Avoid the checks for now.
// BOOST_STATIC_ASSERT(w > 0);
// BOOST_STATIC_ASSERT(q > 0);
// BOOST_STATIC_ASSERT(k < w);
// BOOST_STATIC_ASSERT(0 < 2*q && 2*q < k);
// BOOST_STATIC_ASSERT(0 < s && s <= k-q);
explicit linear_feedback_shift(UIntType s0 = 341) : wordmask(0)
{
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(std::numeric_limits<UIntType>::is_integer);
BOOST_STATIC_ASSERT(!std::numeric_limits<UIntType>::is_signed);
#endif
// avoid "left shift count >= with of type" warning
for(int i = 0; i < w; ++i)
wordmask |= (1u << i);
seed(s0);
}
template<class It> linear_feedback_shift(It& first, It last) : wordmask(0)
{
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(std::numeric_limits<UIntType>::is_integer);
BOOST_STATIC_ASSERT(!std::numeric_limits<UIntType>::is_signed);
#endif
// avoid "left shift count >= with of type" warning
for(int i = 0; i < w; ++i)
wordmask |= (1u << i);
seed(first, last);
}
void seed(UIntType s0 = 341) {
if(s0 < (1 << (w-k))) {
s0 += 1 << (w-k);
}
value = s0;
}
template<class It> void seed(It& first, It last)
{
if(first == last)
throw std::invalid_argument("linear_feedback_shift::seed");
value = *first++;
assert(value >= (1 << (w-k)));
}
result_type operator()()
{
const UIntType b = (((value << q) ^ value) & wordmask) >> (k-s);
const UIntType mask = ( (~static_cast<UIntType>(0)) << (w-k) ) & wordmask;
value = ((value & mask) << s) ^ b;
return value;
}
static bool validation(result_type x) { return val == x; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, linear_feedback_shift x)
{ os << x.value; return os; }
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, linear_feedback_shift& x)
{ is >> x.value; return is; }
#endif
friend bool operator==(linear_feedback_shift x, linear_feedback_shift y)
{ return x.value == y.value; }
friend bool operator!=(linear_feedback_shift x, linear_feedback_shift y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(linear_feedback_shift rhs) const
{ return value == rhs.value; }
bool operator!=(linear_feedback_shift rhs) const
{ return !(*this == rhs); }
#endif
private:
UIntType wordmask; // avoid "left shift count >= width of type" warnings
UIntType value;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class UIntType, int w, int k, int q, int s, UIntType val>
const bool linear_feedback_shift<UIntType, w, k, q, s, val>::has_fixed_range;
template<class UIntType, int w, int k, int q, int s, UIntType val>
const int linear_feedback_shift<UIntType, w, k, q, s, val>::word_size;
template<class UIntType, int w, int k, int q, int s, UIntType val>
const int linear_feedback_shift<UIntType, w, k, q, s, val>::exponent1;
template<class UIntType, int w, int k, int q, int s, UIntType val>
const int linear_feedback_shift<UIntType, w, k, q, s, val>::exponent2;
template<class UIntType, int w, int k, int q, int s, UIntType val>
const int linear_feedback_shift<UIntType, w, k, q, s, val>::step_size;
#endif
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_LINEAR_FEEDBACK_SHIFT_HPP

View File

@@ -0,0 +1,129 @@
/* boost random/lognormal_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: lognormal_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_LOGNORMAL_DISTRIBUTION_HPP
#define BOOST_RANDOM_LOGNORMAL_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp> // std::exp, std::sqrt
#include <cassert>
#include <iostream>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/normal_distribution.hpp>
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
using ::log;
using ::sqrt;
}
#endif
namespace boost {
#if defined(__GNUC__) && (__GNUC__ < 3)
// Special gcc workaround: gcc 2.95.x ignores using-declarations
// in template classes (confirmed by gcc author Martin v. Loewis)
using std::sqrt;
using std::exp;
#endif
/**
* Instantiations of class template lognormal_distribution model a
* \random_distribution. Such a distribution produces random numbers
* with \f$p(x) = \frac{1}{x \sigma_N \sqrt{2\pi}} e^{\frac{-\left(\log(x)-\mu_N\right)^2}{2\sigma_N^2}}\f$
* for x > 0, where \f$\mu_N = \log\left(\frac{\mu^2}{\sqrt{\sigma^2 + \mu^2}}\right)\f$ and
* \f$\sigma_N = \sqrt{\log\left(1 + \frac{\sigma^2}{\mu^2}\right)}\f$.
*/
template<class RealType = double>
class lognormal_distribution
{
public:
typedef typename normal_distribution<RealType>::input_type input_type;
typedef RealType result_type;
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
/**
* Constructs a lognormal_distribution. @c mean and @c sigma are the
* mean and standard deviation of the lognormal distribution.
*/
explicit lognormal_distribution(result_type mean_arg = result_type(1),
result_type sigma_arg = result_type(1))
: _mean(mean_arg), _sigma(sigma_arg)
{
assert(_mean > result_type(0));
init();
}
// compiler-generated copy ctor and assignment operator are fine
RealType mean() const { return _mean; }
RealType sigma() const { return _sigma; }
void reset() { _normal.reset(); }
template<class Engine>
result_type operator()(Engine& eng)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::exp;
#endif
return exp(_normal(eng) * _nsigma + _nmean);
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const lognormal_distribution& ld)
{
os << ld._normal << " " << ld._mean << " " << ld._sigma;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, lognormal_distribution& ld)
{
is >> std::ws >> ld._normal >> std::ws >> ld._mean >> std::ws >> ld._sigma;
ld.init();
return is;
}
#endif
private:
/// \cond hide_private_members
void init()
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::exp; using std::log; using std::sqrt;
#endif
_nmean = log(_mean*_mean/sqrt(_sigma*_sigma + _mean*_mean));
_nsigma = sqrt(log(_sigma*_sigma/_mean/_mean+result_type(1)));
}
/// \endcond
RealType _mean, _sigma;
RealType _nmean, _nsigma;
normal_distribution<result_type> _normal;
};
} // namespace boost
#endif // BOOST_RANDOM_LOGNORMAL_DISTRIBUTION_HPP

View File

@@ -0,0 +1,367 @@
/* boost random/mersenne_twister.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: mersenne_twister.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_MERSENNE_TWISTER_HPP
#define BOOST_RANDOM_MERSENNE_TWISTER_HPP
#include <iostream>
#include <algorithm> // std::copy
#include <stdexcept>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/integer_traits.hpp>
#include <boost/cstdint.hpp>
#include <boost/random/linear_congruential.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/ptr_helper.hpp>
#include <boost/random/detail/seed.hpp>
namespace boost {
namespace random {
/**
* Instantiations of class template mersenne_twister model a
* \pseudo_random_number_generator. It uses the algorithm described in
*
* @blockquote
* "Mersenne Twister: A 623-dimensionally equidistributed uniform
* pseudo-random number generator", Makoto Matsumoto and Takuji Nishimura,
* ACM Transactions on Modeling and Computer Simulation: Special Issue on
* Uniform Random Number Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
* @endblockquote
*
* @xmlnote
* The boost variant has been implemented from scratch and does not
* derive from or use mt19937.c provided on the above WWW site. However, it
* was verified that both produce identical output.
* @endxmlnote
*
* The seeding from an integer was changed in April 2005 to address a
* <a href="http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html">weakness</a>.
*
* The quality of the generator crucially depends on the choice of the
* parameters. User code should employ one of the sensibly parameterized
* generators such as \mt19937 instead.
*
* The generator requires considerable amounts of memory for the storage of
* its state array. For example, \mt11213b requires about 1408 bytes and
* \mt19937 requires about 2496 bytes.
*/
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
class mersenne_twister
{
public:
typedef UIntType result_type;
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(int, state_size = n);
BOOST_STATIC_CONSTANT(int, shift_size = m);
BOOST_STATIC_CONSTANT(int, mask_bits = r);
BOOST_STATIC_CONSTANT(UIntType, parameter_a = a);
BOOST_STATIC_CONSTANT(int, output_u = u);
BOOST_STATIC_CONSTANT(int, output_s = s);
BOOST_STATIC_CONSTANT(UIntType, output_b = b);
BOOST_STATIC_CONSTANT(int, output_t = t);
BOOST_STATIC_CONSTANT(UIntType, output_c = c);
BOOST_STATIC_CONSTANT(int, output_l = l);
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
/**
* Constructs a @c mersenne_twister and calls @c seed().
*/
mersenne_twister() { seed(); }
/**
* Constructs a @c mersenne_twister and calls @c seed(value).
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(mersenne_twister, UIntType, value)
{ seed(value); }
template<class It> mersenne_twister(It& first, It last) { seed(first,last); }
/**
* Constructs a mersenne_twister and calls @c seed(gen).
*
* @xmlnote
* The copy constructor will always be preferred over
* the templated constructor.
* @endxmlnote
*/
BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(mersenne_twister, Generator, gen)
{ seed(gen); }
// compiler-generated copy ctor and assignment operator are fine
/** Calls @c seed(result_type(5489)). */
void seed() { seed(UIntType(5489)); }
/**
* Sets the state x(0) to v mod 2w. Then, iteratively,
* sets x(i) to (i + 1812433253 * (x(i-1) xor (x(i-1) rshift w-2))) mod 2<sup>w</sup>
* for i = 1 .. n-1. x(n) is the first value to be returned by operator().
*/
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(mersenne_twister, UIntType, value)
{
// New seeding algorithm from
// http://www.math.sci.hiroshima-u.ac.jp/~m-mat/MT/MT2002/emt19937ar.html
// In the previous versions, MSBs of the seed affected only MSBs of the
// state x[].
const UIntType mask = ~0u;
x[0] = value & mask;
for (i = 1; i < n; i++) {
// See Knuth "The Art of Computer Programming" Vol. 2, 3rd ed., page 106
x[i] = (1812433253UL * (x[i-1] ^ (x[i-1] >> (w-2))) + i) & mask;
}
}
/**
* Sets the state of this mersenne_twister to the values
* returned by n invocations of gen.
*
* Complexity: Exactly n invocations of gen.
*/
BOOST_RANDOM_DETAIL_GENERATOR_SEED(mersenne_twister, Generator, gen)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(!std::numeric_limits<result_type>::is_signed);
#endif
// I could have used std::generate_n, but it takes "gen" by value
for(int j = 0; j < n; j++)
x[j] = gen();
i = n;
}
template<class It>
void seed(It& first, It last)
{
int j;
for(j = 0; j < n && first != last; ++j, ++first)
x[j] = *first;
i = n;
if(first == last && j < n)
throw std::invalid_argument("mersenne_twister::seed");
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return 0; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
// avoid "left shift count >= with of type" warning
result_type res = 0;
for(int j = 0; j < w; ++j)
res |= (1u << j);
return res;
}
result_type operator()();
static bool validation(result_type v) { return val == v; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const mersenne_twister& mt)
{
for(int j = 0; j < mt.state_size; ++j)
os << mt.compute(j) << " ";
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, mersenne_twister& mt)
{
for(int j = 0; j < mt.state_size; ++j)
is >> mt.x[j] >> std::ws;
// MSVC (up to 7.1) and Borland (up to 5.64) don't handle the template
// value parameter "n" available from the class template scope, so use
// the static constant with the same value
mt.i = mt.state_size;
return is;
}
#endif
friend bool operator==(const mersenne_twister& x, const mersenne_twister& y)
{
for(int j = 0; j < state_size; ++j)
if(x.compute(j) != y.compute(j))
return false;
return true;
}
friend bool operator!=(const mersenne_twister& x, const mersenne_twister& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const mersenne_twister& rhs) const
{
for(int j = 0; j < state_size; ++j)
if(compute(j) != rhs.compute(j))
return false;
return true;
}
bool operator!=(const mersenne_twister& rhs) const
{ return !(*this == rhs); }
#endif
private:
/// \cond hide_private_members
// returns x(i-n+index), where index is in 0..n-1
UIntType compute(unsigned int index) const
{
// equivalent to (i-n+index) % 2n, but doesn't produce negative numbers
return x[ (i + n + index) % (2*n) ];
}
void twist(int block);
/// \endcond
// state representation: next output is o(x(i))
// x[0] ... x[k] x[k+1] ... x[n-1] x[n] ... x[2*n-1] represents
// x(i-k) ... x(i) x(i+1) ... x(i-k+n-1) x(i-k-n) ... x[i(i-k-1)]
// The goal is to always have x(i-n) ... x(i-1) available for
// operator== and save/restore.
UIntType x[2*n];
int i;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const bool mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::has_fixed_range;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const int mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::state_size;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const int mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::shift_size;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const int mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::mask_bits;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const UIntType mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::parameter_a;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const int mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::output_u;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const int mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::output_s;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const UIntType mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::output_b;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const int mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::output_t;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const UIntType mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::output_c;
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
const int mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::output_l;
#endif
/// \cond hide_private_members
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
void mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::twist(int block)
{
const UIntType upper_mask = (~0u) << r;
const UIntType lower_mask = ~upper_mask;
if(block == 0) {
for(int j = n; j < 2*n; j++) {
UIntType y = (x[j-n] & upper_mask) | (x[j-(n-1)] & lower_mask);
x[j] = x[j-(n-m)] ^ (y >> 1) ^ (y&1 ? a : 0);
}
} else if (block == 1) {
// split loop to avoid costly modulo operations
{ // extra scope for MSVC brokenness w.r.t. for scope
for(int j = 0; j < n-m; j++) {
UIntType y = (x[j+n] & upper_mask) | (x[j+n+1] & lower_mask);
x[j] = x[j+n+m] ^ (y >> 1) ^ (y&1 ? a : 0);
}
}
for(int j = n-m; j < n-1; j++) {
UIntType y = (x[j+n] & upper_mask) | (x[j+n+1] & lower_mask);
x[j] = x[j-(n-m)] ^ (y >> 1) ^ (y&1 ? a : 0);
}
// last iteration
UIntType y = (x[2*n-1] & upper_mask) | (x[0] & lower_mask);
x[n-1] = x[m-1] ^ (y >> 1) ^ (y&1 ? a : 0);
i = 0;
}
}
/// \endcond
template<class UIntType, int w, int n, int m, int r, UIntType a, int u,
int s, UIntType b, int t, UIntType c, int l, UIntType val>
inline typename mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::result_type
mersenne_twister<UIntType,w,n,m,r,a,u,s,b,t,c,l,val>::operator()()
{
if(i == n)
twist(0);
else if(i >= 2*n)
twist(1);
// Step 4
UIntType z = x[i];
++i;
z ^= (z >> u);
z ^= ((z << s) & b);
z ^= ((z << t) & c);
z ^= (z >> l);
return z;
}
} // namespace random
/**
* The specializations \mt11213b and \mt19937 are from
*
* @blockquote
* "Mersenne Twister: A 623-dimensionally equidistributed
* uniform pseudo-random number generator", Makoto Matsumoto
* and Takuji Nishimura, ACM Transactions on Modeling and
* Computer Simulation: Special Issue on Uniform Random Number
* Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
* @endblockquote
*/
typedef random::mersenne_twister<uint32_t,32,351,175,19,0xccab8ee7,11,
7,0x31b6ab00,15,0xffe50000,17, 0xa37d3c92> mt11213b;
/**
* The specializations \mt11213b and \mt19937 are from
*
* @blockquote
* "Mersenne Twister: A 623-dimensionally equidistributed
* uniform pseudo-random number generator", Makoto Matsumoto
* and Takuji Nishimura, ACM Transactions on Modeling and
* Computer Simulation: Special Issue on Uniform Random Number
* Generation, Vol. 8, No. 1, January 1998, pp. 3-30.
* @endblockquote
*/
typedef random::mersenne_twister<uint32_t,32,624,397,31,0x9908b0df,11,
7,0x9d2c5680,15,0xefc60000,18, 3346425566U> mt19937;
} // namespace boost
BOOST_RANDOM_PTR_HELPER_SPEC(boost::mt19937)
#endif // BOOST_RANDOM_MERSENNE_TWISTER_HPP

View File

@@ -0,0 +1,131 @@
/* boost random/normal_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: normal_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_NORMAL_DISTRIBUTION_HPP
#define BOOST_RANDOM_NORMAL_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <cassert>
#include <iostream>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
namespace boost {
/**
* Instantiations of class template normal_distribution model a
* \random_distribution. Such a distribution produces random numbers
* @c x distributed with probability density function
* \f$p(x) = \frac{1}{\sqrt{2\pi\sigma}} e^{-\frac{(x-\mu)^2}{2\sigma^2}}\f$,
* where mean and sigma are the parameters of the distribution.
*/
// deterministic Box-Muller method, uses trigonometric functions
template<class RealType = double>
class normal_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) && !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300)
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
/**
* Constructs a normal_distribution object. @c mean and @c sigma are
* the parameters for the distribution.
*
* Requires: sigma > 0
*/
explicit normal_distribution(const result_type& mean_arg = result_type(0),
const result_type& sigma_arg = result_type(1))
: _mean(mean_arg), _sigma(sigma_arg), _valid(false)
{
assert(_sigma >= result_type(0));
}
// compiler-generated copy constructor is NOT fine, need to purge cache
normal_distribution(const normal_distribution& other)
: _mean(other._mean), _sigma(other._sigma), _valid(false)
{
}
// compiler-generated copy ctor and assignment operator are fine
/**
* Returns: The "mean" parameter of the distribution.
*/
RealType mean() const { return _mean; }
/**
* Returns: The "sigma" parameter of the distribution.
*/
RealType sigma() const { return _sigma; }
void reset() { _valid = false; }
template<class Engine>
result_type operator()(Engine& eng)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::sqrt; using std::log; using std::sin; using std::cos;
#endif
if(!_valid) {
_r1 = eng();
_r2 = eng();
_cached_rho = sqrt(-result_type(2) * log(result_type(1)-_r2));
_valid = true;
} else {
_valid = false;
}
// Can we have a boost::mathconst please?
const result_type pi = result_type(3.14159265358979323846);
return _cached_rho * (_valid ?
cos(result_type(2)*pi*_r1) :
sin(result_type(2)*pi*_r1))
* _sigma + _mean;
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const normal_distribution& nd)
{
os << nd._mean << " " << nd._sigma << " "
<< nd._valid << " " << nd._cached_rho << " " << nd._r1;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, normal_distribution& nd)
{
is >> std::ws >> nd._mean >> std::ws >> nd._sigma
>> std::ws >> nd._valid >> std::ws >> nd._cached_rho
>> std::ws >> nd._r1;
return is;
}
#endif
private:
result_type _mean, _sigma;
result_type _r1, _r2, _cached_rho;
bool _valid;
};
} // namespace boost
#endif // BOOST_RANDOM_NORMAL_DISTRIBUTION_HPP

View File

@@ -0,0 +1,116 @@
/* boost random/poisson_distribution.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: poisson_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_POISSON_DISTRIBUTION_HPP
#define BOOST_RANDOM_POISSON_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <cassert>
#include <iostream>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
namespace boost {
// Knuth
/**
* An instantiation of the class template @c poisson_distribution is a
* model of \random_distribution. The poisson distribution has
* \f$p(i) = \frac{e^{-\lambda}\lambda^i}{i!}\f$
*/
template<class IntType = int, class RealType = double>
class poisson_distribution
{
public:
typedef RealType input_type;
typedef IntType result_type;
/**
* Constructs a @c poisson_distribution with the parameter @c mean.
*
* Requires: mean > 0
*/
explicit poisson_distribution(const RealType& mean_arg = RealType(1))
: _mean(mean_arg)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
assert(_mean > RealType(0));
init();
}
// compiler-generated copy ctor and assignment operator are fine
/**
* Returns: the "mean" parameter of the distribution.
*/
RealType mean() const { return _mean; }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng)
{
// TODO: This is O(_mean), but it should be O(log(_mean)) for large _mean
RealType product = RealType(1);
for(result_type m = 0; ; ++m) {
product *= eng();
if(product <= _exp_mean)
return m;
}
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const poisson_distribution& pd)
{
os << pd._mean;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, poisson_distribution& pd)
{
is >> std::ws >> pd._mean;
pd.init();
return is;
}
#endif
private:
/// \cond hide_private_members
void init()
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::exp;
#endif
_exp_mean = exp(-_mean);
}
/// \endcond
RealType _mean;
// some precomputed data from the parameters
RealType _exp_mean;
};
} // namespace boost
#endif // BOOST_RANDOM_POISSON_DISTRIBUTION_HPP

View File

@@ -0,0 +1,71 @@
/* boost random/random_number_generator.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: random_number_generator.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_RANDOM_NUMBER_GENERATOR_HPP
#define BOOST_RANDOM_RANDOM_NUMBER_GENERATOR_HPP
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
namespace boost {
/**
* Instantiations of class template random_number_generator model a
* RandomNumberGenerator (std:25.2.11 [lib.alg.random.shuffle]). On
* each invocation, it returns a uniformly distributed integer in
* the range [0..n).
*
* The template parameter IntType shall denote some integer-like value type.
*/
template<class UniformRandomNumberGenerator, class IntType = long>
class random_number_generator
{
public:
typedef UniformRandomNumberGenerator base_type;
typedef IntType argument_type;
typedef IntType result_type;
/**
* Constructs a random_number_generator functor with the given
* \uniform_random_number_generator as the underlying source of
* random numbers.
*/
random_number_generator(base_type& rng) : _rng(rng)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(std::numeric_limits<result_type>::is_integer);
#endif
}
// compiler-generated copy ctor is fine
// assignment is disallowed because there is a reference member
/**
* Returns a value in the range [0, n)
*/
result_type operator()(argument_type n)
{
typedef uniform_int<IntType> dist_type;
return variate_generator<base_type&, dist_type>(_rng, dist_type(0, n-1))();
}
private:
base_type& _rng;
};
} // namespace boost
#endif // BOOST_RANDOM_RANDOM_NUMBER_GENERATOR_HPP

View File

@@ -0,0 +1,81 @@
/* boost random/ranlux.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: ranlux.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 created
*/
#ifndef BOOST_RANDOM_RANLUX_HPP
#define BOOST_RANDOM_RANLUX_HPP
#include <boost/config.hpp>
#include <boost/random/subtract_with_carry.hpp>
#include <boost/random/discard_block.hpp>
namespace boost {
namespace random {
typedef subtract_with_carry<int, (1<<24), 10, 24, 0> ranlux_base;
typedef subtract_with_carry_01<float, 24, 10, 24> ranlux_base_01;
typedef subtract_with_carry_01<double, 48, 10, 24> ranlux64_base_01;
}
namespace random {
namespace detail {
/**
* The ranlux family of generators are described in
*
* @blockquote
* "A portable high-quality random number generator for lattice field theory
* calculations", M. Luescher, Computer Physics Communications, 79 (1994)
* pp 100-110.
* @endblockquote
*
* The levels are given in
*
* @blockquote
* "RANLUX: A Fortran implementation ofthe high-quality
* pseudorandom number generator of Luescher", F. James,
* Computer Physics Communications 79 (1994) 111-114
* @endblockquote
*/
class ranlux_documentation {};
}
}
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux_base, 223, 24> ranlux3;
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux_base, 389, 24> ranlux4;
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux_base_01, 223, 24> ranlux3_01;
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux_base_01, 389, 24> ranlux4_01;
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux64_base_01, 223, 24> ranlux64_3_01;
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux64_base_01, 389, 24> ranlux64_4_01;
#if !defined(BOOST_NO_INT64_T) && !defined(BOOST_NO_INTEGRAL_INT64_T)
namespace random {
typedef random::subtract_with_carry<int64_t, (int64_t(1)<<48), 10, 24, 0> ranlux64_base;
}
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux64_base, 223, 24> ranlux64_3;
/** @copydoc boost::random::detail::ranlux_documentation */
typedef random::discard_block<random::ranlux64_base, 389, 24> ranlux64_4;
#endif /* !BOOST_NO_INT64_T && !BOOST_NO_INTEGRAL_INT64_T */
} // namespace boost
#endif // BOOST_RANDOM_LINEAR_CONGRUENTIAL_HPP

View File

@@ -0,0 +1,234 @@
/* boost random/shuffle_output.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: shuffle_output.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
#define BOOST_RANDOM_SHUFFLE_OUTPUT_HPP
#include <iostream>
#include <algorithm> // std::copy
#include <cassert>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp>
#include <boost/random/linear_congruential.hpp>
namespace boost {
namespace random {
/**
* Instatiations of class template shuffle_output model a
* \pseudo_random_number_generator. It mixes the output
* of some (usually \linear_congruential) \uniform_random_number_generator
* to get better statistical properties.
* The algorithm is described in
*
* @blockquote
* "Improving a poor random number generator", Carter Bays
* and S.D. Durham, ACM Transactions on Mathematical Software,
* Vol 2, No. 1, March 1976, pp. 59-64.
* http://doi.acm.org/10.1145/355666.355670
* @endblockquote
*
* The output of the base generator is buffered in an array of
* length k. Every output X(n) has a second role: It gives an
* index into the array where X(n+1) will be retrieved. Used
* array elements are replaced with fresh output from the base
* generator.
*
* Template parameters are the base generator and the array
* length k, which should be around 100. The template parameter
* val is the validation value checked by validation.
*/
template<class UniformRandomNumberGenerator, int k,
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
typename UniformRandomNumberGenerator::result_type
#else
uint32_t
#endif
val = 0>
class shuffle_output
{
public:
typedef UniformRandomNumberGenerator base_type;
typedef typename base_type::result_type result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, buffer_size = k);
/**
* Constructs a @c shuffle_output generator by invoking the
* default constructor of the base generator.
*
* Complexity: Exactly k+1 invocations of the base generator.
*/
shuffle_output() : _rng() { init(); }
#if defined(BOOST_MSVC) && _MSC_VER < 1300
// MSVC does not implicitly generate the copy constructor here
shuffle_output(const shuffle_output & x)
: _rng(x._rng), y(x.y) { std::copy(x.v, x.v+k, v); }
#endif
/**
* Constructs a shuffle_output generator by invoking the one-argument
* constructor of the base generator with the parameter seed.
*
* Complexity: Exactly k+1 invocations of the base generator.
*/
template<class T>
explicit shuffle_output(T s) : _rng(s) { init(); }
/**
* Constructs a shuffle_output generator by using a copy
* of the provided generator.
*
* Precondition: The template argument UniformRandomNumberGenerator
* shall denote a CopyConstructible type.
*
* Complexity: Exactly k+1 invocations of the base generator.
*/
explicit shuffle_output(const base_type & rng) : _rng(rng) { init(); }
template<class It> shuffle_output(It& first, It last)
: _rng(first, last) { init(); }
void seed() { _rng.seed(); init(); }
/**
* Invokes the one-argument seed method of the base generator
* with the parameter seed and re-initializes the internal buffer array.
*
* Complexity: Exactly k+1 invocations of the base generator.
*/
template<class T>
void seed(T s) { _rng.seed(s); init(); }
template<class It> void seed(It& first, It last)
{
_rng.seed(first, last);
init();
}
const base_type& base() const { return _rng; }
result_type operator()() {
// calculating the range every time may seem wasteful. However, this
// makes the information locally available for the optimizer.
result_type range = (max)()-(min)()+1;
int j = k*(y-(min)())/range;
// assert(0 <= j && j < k);
y = v[j];
v[j] = _rng();
return y;
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (_rng.min)(); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (_rng.max)(); }
static bool validation(result_type x) { return val == x; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const shuffle_output& s)
{
os << s._rng << " " << s.y << " ";
for(int i = 0; i < s.buffer_size; ++i)
os << s.v[i] << " ";
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, shuffle_output& s)
{
is >> s._rng >> std::ws >> s.y >> std::ws;
for(int i = 0; i < s.buffer_size; ++i)
is >> s.v[i] >> std::ws;
return is;
}
#endif
friend bool operator==(const shuffle_output& x, const shuffle_output& y)
{ return x._rng == y._rng && x.y == y.y && std::equal(x.v, x.v+k, y.v); }
friend bool operator!=(const shuffle_output& x, const shuffle_output& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const shuffle_output& rhs) const
{ return _rng == rhs._rng && y == rhs.y && std::equal(v, v+k, rhs.v); }
bool operator!=(const shuffle_output& rhs) const
{ return !(*this == rhs); }
#endif
private:
void init()
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(std::numeric_limits<result_type>::is_integer);
#endif
result_type range = (max)()-(min)();
assert(range > 0); // otherwise there would be little choice
if(static_cast<unsigned long>(k * range) <
static_cast<unsigned long>(range)) // not a sufficient condition
// likely overflow with bucket number computation
assert(!"overflow will occur");
// we cannot use std::generate, because it uses pass-by-value for _rng
for(result_type * p = v; p != v+k; ++p)
*p = _rng();
y = _rng();
}
base_type _rng;
result_type v[k];
result_type y;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class UniformRandomNumberGenerator, int k,
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
typename UniformRandomNumberGenerator::result_type
#else
uint32_t
#endif
val>
const bool shuffle_output<UniformRandomNumberGenerator, k, val>::has_fixed_range;
template<class UniformRandomNumberGenerator, int k,
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
typename UniformRandomNumberGenerator::result_type
#else
uint32_t
#endif
val>
const int shuffle_output<UniformRandomNumberGenerator, k, val>::buffer_size;
#endif
} // namespace random
// validation by experiment from Harry Erwin's generator.h (private e-mail)
/**
* According to Harry Erwin (private e-mail), the specialization
* @c kreutzer1986 was suggested in:
*
* @blockquote
* "System Simulation: Programming Styles and Languages (International
* Computer Science Series)", Wolfgang Kreutzer, Addison-Wesley, December 1986.
* @endblockquote
*/
typedef random::shuffle_output<
random::linear_congruential<uint32_t, 1366, 150889, 714025, 0>,
97, 139726> kreutzer1986;
} // namespace boost
#endif // BOOST_RANDOM_SHUFFLE_OUTPUT_HPP

View File

@@ -0,0 +1,465 @@
/* boost random/subtract_with_carry.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: subtract_with_carry.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2002-03-02 created
*/
#ifndef BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
#define BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <iostream>
#include <algorithm> // std::equal
#include <stdexcept>
#include <boost/config/no_tr1/cmath.hpp> // std::pow
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/cstdint.hpp>
#include <boost/static_assert.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/seed.hpp>
#include <boost/random/linear_congruential.hpp>
namespace boost {
namespace random {
#if BOOST_WORKAROUND(_MSC_FULL_VER, BOOST_TESTED_AT(13102292)) && BOOST_MSVC > 1300
# define BOOST_RANDOM_EXTRACT_SWC_01
#endif
#if defined(__APPLE_CC__) && defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ <= 3)
# define BOOST_RANDOM_EXTRACT_SWC_01
#endif
# ifdef BOOST_RANDOM_EXTRACT_SWC_01
namespace detail
{
template <class IStream, class SubtractWithCarry, class RealType>
void extract_subtract_with_carry_01(
IStream& is
, SubtractWithCarry& f
, RealType& carry
, RealType* x
, RealType modulus)
{
RealType value;
for(unsigned int j = 0; j < f.long_lag; ++j) {
is >> value >> std::ws;
x[j] = value / modulus;
}
is >> value >> std::ws;
carry = value / modulus;
}
}
# endif
/**
* Instantiations of @c subtract_with_carry model a
* \pseudo_random_number_generator. The algorithm is
* described in
*
* @blockquote
* "A New Class of Random Number Generators", George
* Marsaglia and Arif Zaman, Annals of Applied Probability,
* Volume 1, Number 3 (1991), 462-480.
* @endblockquote
*/
template<class IntType, IntType m, unsigned int s, unsigned int r,
IntType val>
class subtract_with_carry
{
public:
typedef IntType result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = true);
BOOST_STATIC_CONSTANT(result_type, min_value = 0);
BOOST_STATIC_CONSTANT(result_type, max_value = m-1);
BOOST_STATIC_CONSTANT(result_type, modulus = m);
BOOST_STATIC_CONSTANT(unsigned int, long_lag = r);
BOOST_STATIC_CONSTANT(unsigned int, short_lag = s);
subtract_with_carry() {
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(std::numeric_limits<result_type>::is_signed);
BOOST_STATIC_ASSERT(std::numeric_limits<result_type>::is_integer);
#endif
seed();
}
BOOST_RANDOM_DETAIL_ARITHMETIC_CONSTRUCTOR(subtract_with_carry, uint32_t, value)
{ seed(value); }
BOOST_RANDOM_DETAIL_GENERATOR_CONSTRUCTOR(subtract_with_carry, Generator, gen)
{ seed(gen); }
template<class It> subtract_with_carry(It& first, It last) { seed(first,last); }
// compiler-generated copy ctor and assignment operator are fine
void seed() { seed(19780503u); }
BOOST_RANDOM_DETAIL_ARITHMETIC_SEED(subtract_with_carry, uint32_t, value)
{
random::linear_congruential<int32_t, 40014, 0, 2147483563, 0> intgen(value);
seed(intgen);
}
// For GCC, moving this function out-of-line prevents inlining, which may
// reduce overall object code size. However, MSVC does not grok
// out-of-line template member functions.
BOOST_RANDOM_DETAIL_GENERATOR_SEED(subtract_with_carry, Generator, gen)
{
// I could have used std::generate_n, but it takes "gen" by value
for(unsigned int j = 0; j < long_lag; ++j)
x[j] = gen() % modulus;
carry = (x[long_lag-1] == 0);
k = 0;
}
template<class It>
void seed(It& first, It last)
{
unsigned int j;
for(j = 0; j < long_lag && first != last; ++j, ++first)
x[j] = *first % modulus;
if(first == last && j < long_lag)
throw std::invalid_argument("subtract_with_carry::seed");
carry = (x[long_lag-1] == 0);
k = 0;
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return min_value; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return max_value; }
result_type operator()()
{
int short_index = k - short_lag;
if(short_index < 0)
short_index += long_lag;
IntType delta;
if (x[short_index] >= x[k] + carry) {
// x(n) >= 0
delta = x[short_index] - (x[k] + carry);
carry = 0;
} else {
// x(n) < 0
delta = modulus - x[k] - carry + x[short_index];
carry = 1;
}
x[k] = delta;
++k;
if(k >= long_lag)
k = 0;
return delta;
}
public:
static bool validation(result_type x) { return x == val; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const subtract_with_carry& f)
{
for(unsigned int j = 0; j < f.long_lag; ++j)
os << f.compute(j) << " ";
os << f.carry << " ";
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, subtract_with_carry& f)
{
for(unsigned int j = 0; j < f.long_lag; ++j)
is >> f.x[j] >> std::ws;
is >> f.carry >> std::ws;
f.k = 0;
return is;
}
#endif
friend bool operator==(const subtract_with_carry& x, const subtract_with_carry& y)
{
for(unsigned int j = 0; j < r; ++j)
if(x.compute(j) != y.compute(j))
return false;
return true;
}
friend bool operator!=(const subtract_with_carry& x, const subtract_with_carry& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const subtract_with_carry& rhs) const
{
for(unsigned int j = 0; j < r; ++j)
if(compute(j) != rhs.compute(j))
return false;
return true;
}
bool operator!=(const subtract_with_carry& rhs) const
{ return !(*this == rhs); }
#endif
private:
/// \cond hide_private_members
// returns x(i-r+index), where index is in 0..r-1
IntType compute(unsigned int index) const
{
return x[(k+index) % long_lag];
}
/// \endcond
// state representation; next output (state) is x(i)
// x[0] ... x[k] x[k+1] ... x[long_lag-1] represents
// x(i-k) ... x(i) x(i+1) ... x(i-k+long_lag-1)
// speed: base: 20-25 nsec
// ranlux_4: 230 nsec, ranlux_7: 430 nsec, ranlux_14: 810 nsec
// This state representation makes operator== and save/restore more
// difficult, because we've already computed "too much" and thus
// have to undo some steps to get at x(i-r) etc.
// state representation: next output (state) is x(i)
// x[0] ... x[k] x[k+1] ... x[long_lag-1] represents
// x(i-k) ... x(i) x(i-long_lag+1) ... x(i-k-1)
// speed: base 28 nsec
// ranlux_4: 370 nsec, ranlux_7: 688 nsec, ranlux_14: 1343 nsec
IntType x[long_lag];
unsigned int k;
int carry;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
const bool subtract_with_carry<IntType, m, s, r, val>::has_fixed_range;
template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
const IntType subtract_with_carry<IntType, m, s, r, val>::min_value;
template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
const IntType subtract_with_carry<IntType, m, s, r, val>::max_value;
template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
const IntType subtract_with_carry<IntType, m, s, r, val>::modulus;
template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
const unsigned int subtract_with_carry<IntType, m, s, r, val>::long_lag;
template<class IntType, IntType m, unsigned int s, unsigned int r, IntType val>
const unsigned int subtract_with_carry<IntType, m, s, r, val>::short_lag;
#endif
// use a floating-point representation to produce values in [0..1)
/** @copydoc boost::random::subtract_with_carry */
template<class RealType, int w, unsigned int s, unsigned int r, int val=0>
class subtract_with_carry_01
{
public:
typedef RealType result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, word_size = w);
BOOST_STATIC_CONSTANT(unsigned int, long_lag = r);
BOOST_STATIC_CONSTANT(unsigned int, short_lag = s);
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(!std::numeric_limits<result_type>::is_integer);
#endif
subtract_with_carry_01() { init_modulus(); seed(); }
explicit subtract_with_carry_01(uint32_t value)
{ init_modulus(); seed(value); }
template<class It> subtract_with_carry_01(It& first, It last)
{ init_modulus(); seed(first,last); }
private:
/// \cond hide_private_members
void init_modulus()
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::pow;
#endif
_modulus = pow(RealType(2), word_size);
}
/// \endcond hide_private_members
public:
// compiler-generated copy ctor and assignment operator are fine
void seed(uint32_t value = 19780503u)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::fmod;
#endif
random::linear_congruential<int32_t, 40014, 0, 2147483563, 0> gen(value);
unsigned long array[(w+31)/32 * long_lag];
for(unsigned int j = 0; j < sizeof(array)/sizeof(unsigned long); ++j)
array[j] = gen();
unsigned long * start = array;
seed(start, array + sizeof(array)/sizeof(unsigned long));
}
template<class It>
void seed(It& first, It last)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::fmod;
using std::pow;
#endif
unsigned long mask = ~((~0u) << (w%32)); // now lowest (w%32) bits set
RealType two32 = pow(RealType(2), 32);
unsigned int j;
for(j = 0; j < long_lag && first != last; ++j) {
x[j] = RealType(0);
for(int i = 0; i < w/32 && first != last; ++i, ++first)
x[j] += *first / pow(two32,i+1);
if(first != last && mask != 0) {
x[j] += fmod((*first & mask) / _modulus, RealType(1));
++first;
}
}
if(first == last && j < long_lag)
throw std::invalid_argument("subtract_with_carry_01::seed");
carry = (x[long_lag-1] ? 0 : 1 / _modulus);
k = 0;
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(0); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(1); }
result_type operator()()
{
int short_index = k - short_lag;
if(short_index < 0)
short_index += long_lag;
RealType delta = x[short_index] - x[k] - carry;
if(delta < 0) {
delta += RealType(1);
carry = RealType(1)/_modulus;
} else {
carry = 0;
}
x[k] = delta;
++k;
if(k >= long_lag)
k = 0;
return delta;
}
static bool validation(result_type x)
{ return x == val/pow(RealType(2), word_size); }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os,
const subtract_with_carry_01& f)
{
#ifndef BOOST_NO_STDC_NAMESPACE
// allow for Koenig lookup
using std::pow;
#endif
std::ios_base::fmtflags oldflags = os.flags(os.dec | os.fixed | os.left);
for(unsigned int j = 0; j < f.long_lag; ++j)
os << (f.compute(j) * f._modulus) << " ";
os << (f.carry * f._modulus);
os.flags(oldflags);
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, subtract_with_carry_01& f)
{
# ifdef BOOST_RANDOM_EXTRACT_SWC_01
detail::extract_subtract_with_carry_01(is, f, f.carry, f.x, f._modulus);
# else
// MSVC (up to 7.1) and Borland (up to 5.64) don't handle the template type
// parameter "RealType" available from the class template scope, so use
// the member typedef
typename subtract_with_carry_01::result_type value;
for(unsigned int j = 0; j < long_lag; ++j) {
is >> value >> std::ws;
f.x[j] = value / f._modulus;
}
is >> value >> std::ws;
f.carry = value / f._modulus;
# endif
f.k = 0;
return is;
}
#endif
friend bool operator==(const subtract_with_carry_01& x,
const subtract_with_carry_01& y)
{
for(unsigned int j = 0; j < r; ++j)
if(x.compute(j) != y.compute(j))
return false;
return true;
}
friend bool operator!=(const subtract_with_carry_01& x,
const subtract_with_carry_01& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const subtract_with_carry_01& rhs) const
{
for(unsigned int j = 0; j < r; ++j)
if(compute(j) != rhs.compute(j))
return false;
return true;
}
bool operator!=(const subtract_with_carry_01& rhs) const
{ return !(*this == rhs); }
#endif
private:
/// \cond hide_private_members
RealType compute(unsigned int index) const;
/// \endcond
unsigned int k;
RealType carry;
RealType x[long_lag];
RealType _modulus;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class RealType, int w, unsigned int s, unsigned int r, int val>
const bool subtract_with_carry_01<RealType, w, s, r, val>::has_fixed_range;
template<class RealType, int w, unsigned int s, unsigned int r, int val>
const int subtract_with_carry_01<RealType, w, s, r, val>::word_size;
template<class RealType, int w, unsigned int s, unsigned int r, int val>
const unsigned int subtract_with_carry_01<RealType, w, s, r, val>::long_lag;
template<class RealType, int w, unsigned int s, unsigned int r, int val>
const unsigned int subtract_with_carry_01<RealType, w, s, r, val>::short_lag;
#endif
/// \cond hide_private_members
template<class RealType, int w, unsigned int s, unsigned int r, int val>
RealType subtract_with_carry_01<RealType, w, s, r, val>::compute(unsigned int index) const
{
return x[(k+index) % long_lag];
}
/// \endcond
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_SUBTRACT_WITH_CARRY_HPP

View File

@@ -0,0 +1,118 @@
/* boost random/triangle_distribution.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: triangle_distribution.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_TRIANGLE_DISTRIBUTION_HPP
#define BOOST_RANDOM_TRIANGLE_DISTRIBUTION_HPP
#include <boost/config/no_tr1/cmath.hpp>
#include <cassert>
#include <boost/random/detail/config.hpp>
#include <boost/random/uniform_01.hpp>
namespace boost {
/**
* Instantiations of @c triangle_distribution model a \random_distribution.
* A @c triangle_distribution has three parameters, @c a, @c b, and @c c,
* which are the smallest, the most probable and the largest values of
* the distribution respectively.
*/
template<class RealType = double>
class triangle_distribution
{
public:
typedef RealType input_type;
typedef RealType result_type;
/**
* Constructs a @c triangle_distribution with the parameters
* @c a, @c b, and @c c.
*
* Preconditions: a <= b <= c.
*/
explicit triangle_distribution(result_type a_arg = result_type(0),
result_type b_arg = result_type(0.5),
result_type c_arg = result_type(1))
: _a(a_arg), _b(b_arg), _c(c_arg)
{
assert(_a <= _b && _b <= _c);
init();
}
// compiler-generated copy ctor and assignment operator are fine
/** Returns the @c a parameter of the distribution */
result_type a() const { return _a; }
/** Returns the @c b parameter of the distribution */
result_type b() const { return _b; }
/** Returns the @c c parameter of the distribution */
result_type c() const { return _c; }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng)
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::sqrt;
#endif
result_type u = eng();
if( u <= q1 )
return _a + p1*sqrt(u);
else
return _c - d3*sqrt(d2*u-d1);
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const triangle_distribution& td)
{
os << td._a << " " << td._b << " " << td._c;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, triangle_distribution& td)
{
is >> std::ws >> td._a >> std::ws >> td._b >> std::ws >> td._c;
td.init();
return is;
}
#endif
private:
/// \cond hide_private_members
void init()
{
#ifndef BOOST_NO_STDC_NAMESPACE
using std::sqrt;
#endif
d1 = _b - _a;
d2 = _c - _a;
d3 = sqrt(_c - _b);
q1 = d1 / d2;
p1 = sqrt(d1 * d2);
}
/// \endcond
result_type _a, _b, _c;
result_type d1, d2, d3, q1, p1;
};
} // namespace boost
#endif // BOOST_RANDOM_TRIANGLE_DISTRIBUTION_HPP

View File

@@ -0,0 +1,273 @@
/* boost random/uniform_01.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: uniform_01.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_UNIFORM_01_HPP
#define BOOST_RANDOM_UNIFORM_01_HPP
#include <iostream>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/pass_through_engine.hpp>
#include <boost/random/detail/disable_warnings.hpp>
namespace boost {
#ifdef BOOST_RANDOM_DOXYGEN
/**
* The distribution function uniform_01 models a \random_distribution.
* On each invocation, it returns a random floating-point value
* uniformly distributed in the range [0..1).
*
* The template parameter RealType shall denote a float-like value type
* with support for binary operators +, -, and /.
*
* Note: The current implementation is buggy, because it may not fill
* all of the mantissa with random bits. I'm unsure how to fill a
* (to-be-invented) @c boost::bigfloat class with random bits efficiently.
* It's probably time for a traits class.
*/
template<class RealType = double>
class uniform_01
{
public:
typedef RealType input_type;
typedef RealType result_type;
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const;
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const;
void reset();
template<class Engine>
result_type operator()(Engine& eng);
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const new_uniform_01&)
{
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, new_uniform_01&)
{
return is;
}
#endif
};
#else
namespace detail {
template<class RealType>
class new_uniform_01
{
public:
typedef RealType input_type;
typedef RealType result_type;
// compiler-generated copy ctor and copy assignment are fine
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(0); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(1); }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng) {
for (;;) {
typedef typename Engine::result_type base_result;
result_type factor = result_type(1) /
(result_type((eng.max)()-(eng.min)()) +
result_type(std::numeric_limits<base_result>::is_integer ? 1 : 0));
result_type result = result_type(eng() - (eng.min)()) * factor;
if (result < result_type(1))
return result;
}
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const new_uniform_01&)
{
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, new_uniform_01&)
{
return is;
}
#endif
};
template<class UniformRandomNumberGenerator, class RealType>
class backward_compatible_uniform_01
{
typedef boost::random::detail::ptr_helper<UniformRandomNumberGenerator> traits;
typedef boost::random::detail::pass_through_engine<UniformRandomNumberGenerator> internal_engine_type;
public:
typedef UniformRandomNumberGenerator base_type;
typedef RealType result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) && !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300)
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
explicit backward_compatible_uniform_01(typename traits::rvalue_type rng)
: _rng(rng),
_factor(result_type(1) /
(result_type((_rng.max)()-(_rng.min)()) +
result_type(std::numeric_limits<base_result>::is_integer ? 1 : 0)))
{
}
// compiler-generated copy ctor and copy assignment are fine
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(0); }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return result_type(1); }
typename traits::value_type& base() { return _rng.base(); }
const typename traits::value_type& base() const { return _rng.base(); }
void reset() { }
result_type operator()() {
for (;;) {
result_type result = result_type(_rng() - (_rng.min)()) * _factor;
if (result < result_type(1))
return result;
}
}
#if !defined(BOOST_NO_OPERATORS_IN_NAMESPACE) && !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const backward_compatible_uniform_01& u)
{
os << u._rng;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, backward_compatible_uniform_01& u)
{
is >> u._rng;
return is;
}
#endif
private:
typedef typename internal_engine_type::result_type base_result;
internal_engine_type _rng;
result_type _factor;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class UniformRandomNumberGenerator, class RealType>
const bool backward_compatible_uniform_01<UniformRandomNumberGenerator, RealType>::has_fixed_range;
#endif
template<class UniformRandomNumberGenerator>
struct select_uniform_01
{
template<class RealType>
struct apply
{
typedef backward_compatible_uniform_01<UniformRandomNumberGenerator, RealType> type;
};
};
template<>
struct select_uniform_01<float>
{
template<class RealType>
struct apply
{
typedef new_uniform_01<float> type;
};
};
template<>
struct select_uniform_01<double>
{
template<class RealType>
struct apply
{
typedef new_uniform_01<double> type;
};
};
template<>
struct select_uniform_01<long double>
{
template<class RealType>
struct apply
{
typedef new_uniform_01<long double> type;
};
};
}
// Because it is so commonly used: uniform distribution on the real [0..1)
// range. This allows for specializations to avoid a costly int -> float
// conversion plus float multiplication
template<class UniformRandomNumberGenerator = double, class RealType = double>
class uniform_01
: public detail::select_uniform_01<UniformRandomNumberGenerator>::BOOST_NESTED_TEMPLATE apply<RealType>::type
{
typedef typename detail::select_uniform_01<UniformRandomNumberGenerator>::BOOST_NESTED_TEMPLATE apply<RealType>::type impl_type;
typedef boost::random::detail::ptr_helper<UniformRandomNumberGenerator> traits;
public:
uniform_01() {}
explicit uniform_01(typename traits::rvalue_type rng)
: impl_type(rng)
{
}
#if !defined(BOOST_NO_OPERATORS_IN_NAMESPACE) && !defined(BOOST_NO_MEMBER_TEMPLATE_FRIENDS)
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_01& u)
{
os << static_cast<const impl_type&>(u);
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, uniform_01& u)
{
is >> static_cast<impl_type&>(u);
return is;
}
#endif
};
#endif
} // namespace boost
#include <boost/random/detail/enable_warnings.hpp>
#endif // BOOST_RANDOM_UNIFORM_01_HPP

View File

@@ -0,0 +1,300 @@
/* boost random/uniform_int.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: uniform_int.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-04-08 added min<max assertion (N. Becker)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_UNIFORM_INT_HPP
#define BOOST_RANDOM_UNIFORM_INT_HPP
#include <cassert>
#include <iostream>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/detail/signed_unsigned_tools.hpp>
#include <boost/type_traits/make_unsigned.hpp>
namespace boost {
/**
* The distribution function uniform_int models a \random_distribution.
* On each invocation, it returns a random integer value uniformly
* distributed in the set of integer numbers {min, min+1, min+2, ..., max}.
*
* The template parameter IntType shall denote an integer-like value type.
*/
template<class IntType = int>
class uniform_int
{
public:
typedef IntType input_type;
typedef IntType result_type;
/// \cond hide_private_members
typedef typename make_unsigned<result_type>::type range_type;
/// \endcond
/**
* Constructs a uniform_int object. @c min and @c max are
* the parameters of the distribution.
*
* Requires: min <= max
*/
explicit uniform_int(IntType min_arg = 0, IntType max_arg = 9)
: _min(min_arg), _max(max_arg)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
#endif
assert(min_arg <= max_arg);
init();
}
/**
* Returns: The "min" parameter of the distribution
*/
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; }
/**
* Returns: The "max" parameter of the distribution
*/
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; }
void reset() { }
// can't have member function templates out-of-line due to MSVC bugs
template<class Engine>
result_type operator()(Engine& eng)
{
return generate(eng, _min, _max, _range);
}
template<class Engine>
result_type operator()(Engine& eng, result_type n)
{
assert(n > 0);
if (n == 1)
{
return 0;
}
return generate(eng, 0, n - 1, n - 1);
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_int& ud)
{
os << ud._min << " " << ud._max;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, uniform_int& ud)
{
is >> std::ws >> ud._min >> std::ws >> ud._max;
ud.init();
return is;
}
#endif
private:
#ifdef BOOST_MSVC
#pragma warning(push)
// disable division by zero warning, since we can't
// actually divide by zero.
#pragma warning(disable:4723)
#endif
/// \cond hide_private_members
template<class Engine>
static result_type generate(Engine& eng, result_type min_value, result_type /*max_value*/, range_type range)
{
typedef typename Engine::result_type base_result;
// ranges are always unsigned
typedef typename make_unsigned<base_result>::type base_unsigned;
const base_result bmin = (eng.min)();
const base_unsigned brange =
random::detail::subtract<base_result>()((eng.max)(), (eng.min)());
if(range == 0) {
return min_value;
} else if(brange == range) {
// this will probably never happen in real life
// basically nothing to do; just take care we don't overflow / underflow
base_unsigned v = random::detail::subtract<base_result>()(eng(), bmin);
return random::detail::add<base_unsigned, result_type>()(v, min_value);
} else if(brange < range) {
// use rejection method to handle things like 0..3 --> 0..4
for(;;) {
// concatenate several invocations of the base RNG
// take extra care to avoid overflows
// limit == floor((range+1)/(brange+1))
// Therefore limit*(brange+1) <= range+1
range_type limit;
if(range == (std::numeric_limits<range_type>::max)()) {
limit = range/(range_type(brange)+1);
if(range % (range_type(brange)+1) == range_type(brange))
++limit;
} else {
limit = (range+1)/(range_type(brange)+1);
}
// We consider "result" as expressed to base (brange+1):
// For every power of (brange+1), we determine a random factor
range_type result = range_type(0);
range_type mult = range_type(1);
// loop invariants:
// result < mult
// mult <= range
while(mult <= limit) {
// Postcondition: result <= range, thus no overflow
//
// limit*(brange+1)<=range+1 def. of limit (1)
// eng()-bmin<=brange eng() post. (2)
// and mult<=limit. loop condition (3)
// Therefore mult*(eng()-bmin+1)<=range+1 by (1),(2),(3) (4)
// Therefore mult*(eng()-bmin)+mult<=range+1 rearranging (4) (5)
// result<mult loop invariant (6)
// Therefore result+mult*(eng()-bmin)<range+1 by (5), (6) (7)
//
// Postcondition: result < mult*(brange+1)
//
// result<mult loop invariant (1)
// eng()-bmin<=brange eng() post. (2)
// Therefore result+mult*(eng()-bmin) <
// mult+mult*(eng()-bmin) by (1) (3)
// Therefore result+(eng()-bmin)*mult <
// mult+mult*brange by (2), (3) (4)
// Therefore result+(eng()-bmin)*mult <
// mult*(brange+1) by (4)
result += static_cast<range_type>(random::detail::subtract<base_result>()(eng(), bmin) * mult);
// equivalent to (mult * (brange+1)) == range+1, but avoids overflow.
if(mult * range_type(brange) == range - mult + 1) {
// The destination range is an integer power of
// the generator's range.
return(result);
}
// Postcondition: mult <= range
//
// limit*(brange+1)<=range+1 def. of limit (1)
// mult<=limit loop condition (2)
// Therefore mult*(brange+1)<=range+1 by (1), (2) (3)
// mult*(brange+1)!=range+1 preceding if (4)
// Therefore mult*(brange+1)<range+1 by (3), (4) (5)
//
// Postcondition: result < mult
//
// See the second postcondition on the change to result.
mult *= range_type(brange)+range_type(1);
}
// loop postcondition: range/mult < brange+1
//
// mult > limit loop condition (1)
// Suppose range/mult >= brange+1 Assumption (2)
// range >= mult*(brange+1) by (2) (3)
// range+1 > mult*(brange+1) by (3) (4)
// range+1 > (limit+1)*(brange+1) by (1), (4) (5)
// (range+1)/(brange+1) > limit+1 by (5) (6)
// limit < floor((range+1)/(brange+1)) by (6) (7)
// limit==floor((range+1)/(brange+1)) def. of limit (8)
// not (2) reductio (9)
//
// loop postcondition: (range/mult)*mult+(mult-1) >= range
//
// (range/mult)*mult + range%mult == range identity (1)
// range%mult < mult def. of % (2)
// (range/mult)*mult+mult > range by (1), (2) (3)
// (range/mult)*mult+(mult-1) >= range by (3) (4)
//
// Note that the maximum value of result at this point is (mult-1),
// so after this final step, we generate numbers that can be
// at least as large as range. We have to really careful to avoid
// overflow in this final addition and in the rejection. Anything
// that overflows is larger than range and can thus be rejected.
// range/mult < brange+1 -> no endless loop
range_type result_increment = uniform_int<range_type>(0, range/mult)(eng);
if((std::numeric_limits<range_type>::max)() / mult < result_increment) {
// The multiplcation would overflow. Reject immediately.
continue;
}
result_increment *= mult;
// unsigned integers are guaranteed to wrap on overflow.
result += result_increment;
if(result < result_increment) {
// The addition overflowed. Reject.
continue;
}
if(result > range) {
// Too big. Reject.
continue;
}
return random::detail::add<range_type, result_type>()(result, min_value);
}
} else { // brange > range
base_unsigned bucket_size;
// it's safe to add 1 to range, as long as we cast it first,
// because we know that it is less than brange. However,
// we do need to be careful not to cause overflow by adding 1
// to brange.
if(brange == (std::numeric_limits<base_unsigned>::max)()) {
bucket_size = brange / (static_cast<base_unsigned>(range)+1);
if(brange % (static_cast<base_unsigned>(range)+1) == static_cast<base_unsigned>(range)) {
++bucket_size;
}
} else {
bucket_size = (brange+1) / (static_cast<base_unsigned>(range)+1);
}
for(;;) {
base_unsigned result =
random::detail::subtract<base_result>()(eng(), bmin);
result /= bucket_size;
// result and range are non-negative, and result is possibly larger
// than range, so the cast is safe
if(result <= static_cast<base_unsigned>(range))
return random::detail::add<base_unsigned, result_type>()(result, min_value);
}
}
}
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
void init()
{
_range = random::detail::subtract<result_type>()(_max, _min);
}
/// \endcond
// The result_type may be signed or unsigned, but the _range is always
// unsigned.
result_type _min, _max;
range_type _range;
};
} // namespace boost
#endif // BOOST_RANDOM_UNIFORM_INT_HPP

View File

@@ -0,0 +1,101 @@
/* boost random/uniform_on_sphere.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: uniform_on_sphere.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_UNIFORM_ON_SPHERE_HPP
#define BOOST_RANDOM_UNIFORM_ON_SPHERE_HPP
#include <vector>
#include <algorithm> // std::transform
#include <functional> // std::bind2nd, std::divides
#include <boost/random/detail/config.hpp>
#include <boost/random/normal_distribution.hpp>
namespace boost {
/**
* Instantiations of class template uniform_on_sphere model a
* \random_distribution. Such a distribution produces random
* numbers uniformly distributed on the unit sphere of arbitrary
* dimension @c dim. The @c Cont template parameter must be a STL-like
* container type with begin and end operations returning non-const
* ForwardIterators of type @c Cont::iterator. Each invocation of the
* @c UniformRandomNumberGenerator shall result in a floating-point
* value in the range [0,1).
*/
template<class RealType = double, class Cont = std::vector<RealType> >
class uniform_on_sphere
{
public:
typedef RealType input_type;
typedef Cont result_type;
/**
* Constructs a @c uniform_on_sphere distribution.
* @c dim is the dimension of the sphere.
*/
explicit uniform_on_sphere(int dim = 2) : _container(dim), _dim(dim) { }
// compiler-generated copy ctor and assignment operator are fine
void reset() { _normal.reset(); }
template<class Engine>
const result_type & operator()(Engine& eng)
{
RealType sqsum = 0;
for(typename Cont::iterator it = _container.begin();
it != _container.end();
++it) {
RealType val = _normal(eng);
*it = val;
sqsum += val * val;
}
#ifndef BOOST_NO_STDC_NAMESPACE
using std::sqrt;
#endif
// for all i: result[i] /= sqrt(sqsum)
std::transform(_container.begin(), _container.end(), _container.begin(),
std::bind2nd(std::divides<RealType>(), sqrt(sqsum)));
return _container;
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_on_sphere& sd)
{
os << sd._dim;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, uniform_on_sphere& sd)
{
is >> std::ws >> sd._dim;
sd._container.resize(sd._dim);
return is;
}
#endif
private:
normal_distribution<RealType> _normal;
result_type _container;
int _dim;
};
} // namespace boost
#endif // BOOST_RANDOM_UNIFORM_ON_SPHERE_HPP

View File

@@ -0,0 +1,108 @@
/* boost random/uniform_real.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: uniform_real.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-04-08 added min<max assertion (N. Becker)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_UNIFORM_REAL_HPP
#define BOOST_RANDOM_UNIFORM_REAL_HPP
#include <cassert>
#include <iostream>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
namespace boost {
/**
* The distribution function uniform_real models a random distribution.
* On each invocation, it returns a random floating-point value uniformly
* distributed in the range [min..max). The value is computed using
* std::numeric_limits<RealType>::digits random binary digits, i.e.
* the mantissa of the floating-point value is completely filled with
* random bits.
*
* Note: The current implementation is buggy, because it may not fill
* all of the mantissa with random bits.
*/
template<class RealType = double>
class uniform_real
{
public:
typedef RealType input_type;
typedef RealType result_type;
/**
* Constructs a uniform_real object. @c min and @c max are the
* parameters of the distribution.
*
* Requires: min <= max
*/
explicit uniform_real(RealType min_arg = RealType(0),
RealType max_arg = RealType(1))
: _min(min_arg), _max(max_arg)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
BOOST_STATIC_ASSERT(!std::numeric_limits<RealType>::is_integer);
#endif
assert(min_arg <= max_arg);
}
// compiler-generated copy ctor and assignment operator are fine
/**
* Returns: The "min" parameter of the distribution
*/
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; }
/**
* Returns: The "max" parameter of the distribution
*/
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng) {
result_type numerator = static_cast<result_type>(eng() - eng.min BOOST_PREVENT_MACRO_SUBSTITUTION());
result_type divisor = static_cast<result_type>(eng.max BOOST_PREVENT_MACRO_SUBSTITUTION() - eng.min BOOST_PREVENT_MACRO_SUBSTITUTION());
assert(divisor > 0);
assert(numerator >= 0 && numerator <= divisor);
return numerator / divisor * (_max - _min) + _min;
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_real& ud)
{
os << ud._min << " " << ud._max;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, uniform_real& ud)
{
is >> std::ws >> ud._min >> std::ws >> ud._max;
return is;
}
#endif
private:
RealType _min, _max;
};
} // namespace boost
#endif // BOOST_RANDOM_UNIFORM_REAL_HPP

View File

@@ -0,0 +1,158 @@
/* boost random/uniform_smallint.hpp header file
*
* Copyright Jens Maurer 2000-2001
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: uniform_smallint.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
* Revision history
* 2001-04-08 added min<max assertion (N. Becker)
* 2001-02-18 moved to individual header files
*/
#ifndef BOOST_RANDOM_UNIFORM_SMALLINT_HPP
#define BOOST_RANDOM_UNIFORM_SMALLINT_HPP
#include <cassert>
#include <iostream>
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/random/detail/config.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/detail/workaround.hpp>
namespace boost {
// uniform integer distribution on a small range [min, max]
/**
* The distribution function uniform_smallint models a \random_distribution.
* On each invocation, it returns a random integer value uniformly distributed
* in the set of integer numbers {min, min+1, min+2, ..., max}. It assumes
* that the desired range (max-min+1) is small compared to the range of the
* underlying source of random numbers and thus makes no attempt to limit
* quantization errors.
*
* Let r<sub>out</sub>=(max-min+1) the desired range of integer numbers, and
* let r<sub>base</sub> be the range of the underlying source of random
* numbers. Then, for the uniform distribution, the theoretical probability
* for any number i in the range r<sub>out</sub> will be p<sub>out</sub>(i) =
* 1/r<sub>out</sub>. Likewise, assume a uniform distribution on r<sub>base</sub> for
* the underlying source of random numbers, i.e. p<sub>base</sub>(i) =
* 1/r<sub>base</sub>. Let p<sub>out_s</sub>(i) denote the random
* distribution generated by @c uniform_smallint. Then the sum over all
* i in r<sub>out</sub> of (p<sub>out_s</sub>(i)/p<sub>out</sub>(i) - 1)<sup>2</sup>
* shall not exceed r<sub>out</sub>/r<sub>base</sub><sup>2</sup>
* (r<sub>base</sub> mod r<sub>out</sub>)(r<sub>out</sub> -
* r<sub>base</sub> mod r<sub>out</sub>).
*
* The template parameter IntType shall denote an integer-like value type.
*
* Note: The property above is the square sum of the relative differences
* in probabilities between the desired uniform distribution
* p<sub>out</sub>(i) and the generated distribution p<sub>out_s</sub>(i).
* The property can be fulfilled with the calculation
* (base_rng mod r<sub>out</sub>), as follows: Let r = r<sub>base</sub> mod
* r<sub>out</sub>. The base distribution on r<sub>base</sub> is folded onto the
* range r<sub>out</sub>. The numbers i < r have assigned (r<sub>base</sub>
* div r<sub>out</sub>)+1 numbers of the base distribution, the rest has
* only (r<sub>base</sub> div r<sub>out</sub>). Therefore,
* p<sub>out_s</sub>(i) = ((r<sub>base</sub> div r<sub>out</sub>)+1) /
* r<sub>base</sub> for i < r and p<sub>out_s</sub>(i) = (r<sub>base</sub>
* div r<sub>out</sub>)/r<sub>base</sub> otherwise. Substituting this in the
* above sum formula leads to the desired result.
*
* Note: The upper bound for (r<sub>base</sub> mod r<sub>out</sub>)
* (r<sub>out</sub> - r<sub>base</sub> mod r<sub>out</sub>) is
* r<sub>out</sub><sup>2</sup>/4. Regarding the upper bound for the
* square sum of the relative quantization error of
* r<sub>out</sub><sup>3</sup>/(4*r<sub>base</sub><sup>2</sup>), it
* seems wise to either choose r<sub>base</sub> so that r<sub>base</sub> >
* 10*r<sub>out</sub><sup>2</sup> or ensure that r<sub>base</sub> is
* divisible by r<sub>out</sub>.
*/
template<class IntType = int>
class uniform_smallint
{
public:
typedef IntType input_type;
typedef IntType result_type;
/**
* Constructs a @c uniform_smallint. @c min and @c max are the
* lower and upper bounds of the output range, respectively.
*/
explicit uniform_smallint(IntType min_arg = 0, IntType max_arg = 9)
: _min(min_arg), _max(max_arg)
{
#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
BOOST_STATIC_ASSERT(std::numeric_limits<IntType>::is_integer);
#endif
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _min; }
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return _max; }
void reset() { }
template<class Engine>
result_type operator()(Engine& eng)
{
typedef typename Engine::result_type base_result;
base_result _range = static_cast<base_result>(_max-_min)+1;
base_result _factor = 1;
// LCGs get bad when only taking the low bits.
// (probably put this logic into a partial template specialization)
// Check how many low bits we can ignore before we get too much
// quantization error.
base_result r_base = (eng.max)() - (eng.min)();
if(r_base == (std::numeric_limits<base_result>::max)()) {
_factor = 2;
r_base /= 2;
}
r_base += 1;
if(r_base % _range == 0) {
// No quantization effects, good
_factor = r_base / _range;
} else {
// carefully avoid overflow; pessimizing here
for( ; r_base/_range/32 >= _range; _factor *= 2)
r_base /= 2;
}
return static_cast<result_type>(((eng() - (eng.min)()) / _factor) % _range + _min);
}
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const uniform_smallint& ud)
{
os << ud._min << " " << ud._max;
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, uniform_smallint& ud)
{
is >> std::ws >> ud._min >> std::ws >> ud._max;
return is;
}
#endif
private:
result_type _min;
result_type _max;
};
} // namespace boost
#endif // BOOST_RANDOM_UNIFORM_SMALLINT_HPP

View File

@@ -0,0 +1,220 @@
/* boost random/variate_generator.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: variate_generator.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_RANDOM_GENERATOR_HPP
#define BOOST_RANDOM_RANDOM_GENERATOR_HPP
#include <boost/config.hpp>
// implementation details
#include <boost/detail/workaround.hpp>
#include <boost/random/uniform_01.hpp>
#include <boost/random/detail/pass_through_engine.hpp>
#include <boost/random/detail/uniform_int_float.hpp>
#include <boost/random/detail/ptr_helper.hpp>
// Borland C++ 5.6.0 has problems using its numeric_limits traits as
// template parameters
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
#include <boost/type_traits/is_integral.hpp>
#endif
#include <boost/random/detail/disable_warnings.hpp>
namespace boost {
/// \cond hide_private_members
namespace random {
namespace detail {
template<bool have_int, bool want_int>
struct engine_helper;
// for consistency, always have two levels of decorations
template<>
struct engine_helper<true, true>
{
template<class Engine, class DistInputType>
struct impl
{
typedef pass_through_engine<Engine> type;
};
};
template<>
struct engine_helper<false, false>
{
template<class Engine, class DistInputType>
struct impl
{
typedef uniform_01<Engine, DistInputType> type;
};
};
template<>
struct engine_helper<true, false>
{
template<class Engine, class DistInputType>
struct impl
{
typedef uniform_01<Engine, DistInputType> type;
};
};
template<>
struct engine_helper<false, true>
{
template<class Engine, class DistInputType>
struct impl
{
typedef uniform_int_float<Engine, unsigned long> type;
};
};
} // namespace detail
} // namespace random
///\endcond
/**
* A random variate generator is used to join a random number
* generator together with a random number distribution.
* Boost.Random provides a vast choice of \generators as well
* as \distributions.
*
* Instantations of class template @c variate_generator model
* a \number_generator.
*
* The argument for the template parameter Engine shall be of
* the form U, U&, or U*, where U models a
* \uniform_random_number_generator. Then, the member
* engine_value_type names U (not the pointer or reference to U).
*
* Specializations of @c variate_generator satisfy the
* requirements of CopyConstructible. They also satisfy the
* requirements of Assignable unless the template parameter
* Engine is of the form U&.
*
* The complexity of all functions specified in this section
* is constant. No function described in this section except
* the constructor throws an exception.
*/
template<class Engine, class Distribution>
class variate_generator
{
private:
typedef random::detail::pass_through_engine<Engine> decorated_engine;
public:
typedef typename decorated_engine::base_type engine_value_type;
typedef Engine engine_type;
typedef Distribution distribution_type;
typedef typename Distribution::result_type result_type;
/**
* Constructs a @c variate_generator object with the associated
* \uniform_random_number_generator eng and the associated
* \random_distribution d.
*
* Throws: If and what the copy constructor of Engine or
* Distribution throws.
*/
variate_generator(Engine e, Distribution d)
: _eng(decorated_engine(e)), _dist(d) { }
/**
* Returns: distribution()(e)
*
* Notes: The sequence of numbers produced by the
* \uniform_random_number_generator e, s<sub>e</sub>, is
* obtained from the sequence of numbers produced by the
* associated \uniform_random_number_generator eng, s<sub>eng</sub>,
* as follows: Consider the values of @c numeric_limits<T>::is_integer
* for @c T both @c Distribution::input_type and
* @c engine_value_type::result_type. If the values for both types are
* true, then se is identical to s<sub>eng</sub>. Otherwise, if the
* values for both types are false, then the numbers in s<sub>eng</sub>
* are divided by engine().max()-engine().min() to obtain the numbers
* in s<sub>e</sub>. Otherwise, if the value for
* @c engine_value_type::result_type is true and the value for
* @c Distribution::input_type is false, then the numbers in s<sub>eng</sub>
* are divided by engine().max()-engine().min()+1 to obtain the numbers in
* s<sub>e</sub>. Otherwise, the mapping from s<sub>eng</sub> to
* s<sub>e</sub> is implementation-defined. In all cases, an
* implicit conversion from @c engine_value_type::result_type to
* @c Distribution::input_type is performed. If such a conversion does
* not exist, the program is ill-formed.
*/
result_type operator()() { return _dist(_eng); }
/**
* Returns: distribution()(e, value).
* For the semantics of e, see the description of operator()().
*/
template<class T>
result_type operator()(T value) { return _dist(_eng, value); }
/**
* Returns: A reference to the associated uniform random number generator.
*/
engine_value_type& engine() { return _eng.base().base(); }
/**
* Returns: A reference to the associated uniform random number generator.
*/
const engine_value_type& engine() const { return _eng.base().base(); }
/**
* Returns: A reference to the associated random distribution.
*/
distribution_type& distribution() { return _dist; }
/**
* Returns: A reference to the associated random distribution.
*/
const distribution_type& distribution() const { return _dist; }
/**
* Precondition: distribution().min() is well-formed
*
* Returns: distribution().min()
*/
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (distribution().min)(); }
/**
* Precondition: distribution().max() is well-formed
*
* Returns: distribution().max()
*/
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return (distribution().max)(); }
private:
#if BOOST_WORKAROUND(__BORLANDC__, <= 0x564)
typedef typename random::detail::engine_helper<
::boost::is_integral<typename decorated_engine::result_type>::value,
::boost::is_integral<typename Distribution::input_type>::value
>::BOOST_NESTED_TEMPLATE impl<decorated_engine, typename Distribution::input_type>::type internal_engine_type;
#else
enum {
have_int = std::numeric_limits<typename decorated_engine::result_type>::is_integer,
want_int = std::numeric_limits<typename Distribution::input_type>::is_integer
};
typedef typename random::detail::engine_helper<have_int, want_int>::BOOST_NESTED_TEMPLATE impl<decorated_engine, typename Distribution::input_type>::type internal_engine_type;
#endif
internal_engine_type _eng;
distribution_type _dist;
};
} // namespace boost
#include <boost/random/detail/disable_warnings.hpp>
#endif // BOOST_RANDOM_RANDOM_GENERATOR_HPP

View File

@@ -0,0 +1,184 @@
/* boost random/xor_combine.hpp header file
*
* Copyright Jens Maurer 2002
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* See http://www.boost.org for most recent version including documentation.
*
* $Id: xor_combine.hpp 60755 2010-03-22 00:45:06Z steven_watanabe $
*
*/
#ifndef BOOST_RANDOM_XOR_COMBINE_HPP
#define BOOST_RANDOM_XOR_COMBINE_HPP
#include <iostream>
#include <cassert>
#include <algorithm> // for std::min and std::max
#include <boost/config.hpp>
#include <boost/limits.hpp>
#include <boost/static_assert.hpp>
#include <boost/cstdint.hpp> // uint32_t
#include <boost/random/detail/config.hpp>
namespace boost {
namespace random {
/// \cond hide_private_members
#ifndef BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS
#define BOOST_RANDOM_VAL_TYPE typename URNG1::result_type
#else
#define BOOST_RANDOM_VAL_TYPE uint32_t
#endif
/// \endcond
/**
* Instantiations of @c xor_combine model a \pseudo_random_number_generator.
* To produce its output it invokes each of the base generators, shifts
* their results and xors them together.
*/
template<class URNG1, int s1, class URNG2, int s2
#ifndef BOOST_RANDOM_DOXYGEN
, BOOST_RANDOM_VAL_TYPE val = 0
#endif
>
class xor_combine
{
public:
typedef URNG1 base1_type;
typedef URNG2 base2_type;
typedef typename base1_type::result_type result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
BOOST_STATIC_CONSTANT(int, shift1 = s1);
BOOST_STATIC_CONSTANT(int, shift2 = s2);
/**
* Constructors a @c xor_combine by default constructing
* both base generators.
*/
xor_combine() : _rng1(), _rng2()
{ }
/**
* Constructs a @c xor_combine by copying two base generators.
*/
xor_combine(const base1_type & rng1, const base2_type & rng2)
: _rng1(rng1), _rng2(rng2) { }
/**
* Constructs a @c xor_combine, seeding both base generators
* with @c v.
*/
xor_combine(const result_type & v)
: _rng1(v), _rng2(v) { }
/**
* Constructs a @c xor_combine, seeding both base generators
* with values from the iterator range [first, last) and changes
* first to point to the element after the last one used. If there
* are not enough elements in the range to seed both generators,
* throws @c std::invalid_argument.
*/
template<class It> xor_combine(It& first, It last)
: _rng1(first, last), _rng2( /* advanced by other call */ first, last) { }
/**
* Calls @c seed() for both base generators.
*/
void seed() { _rng1.seed(); _rng2.seed(); }
/**
* @c seeds both base generators with @c v.
*/
void seed(const result_type & v) { _rng1.seed(v); _rng2.seed(v); }
/**
* seeds both base generators with values from the iterator
* range [first, last) and changes first to point to the element
* after the last one used. If there are not enough elements in
* the range to seed both generators, throws @c std::invalid_argument.
*/
template<class It> void seed(It& first, It last)
{
_rng1.seed(first, last);
_rng2.seed(first, last);
}
/** Returns the first base generator. */
const base1_type& base1() { return _rng1; }
/** Returns the second base generator. */
const base2_type& base2() { return _rng2; }
/** Returns the next value of the generator. */
result_type operator()()
{
// MSVC fails BOOST_STATIC_ASSERT with std::numeric_limits at class scope
#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) && !(defined(BOOST_MSVC) && BOOST_MSVC <= 1300)
BOOST_STATIC_ASSERT(std::numeric_limits<typename base1_type::result_type>::is_integer);
BOOST_STATIC_ASSERT(std::numeric_limits<typename base2_type::result_type>::is_integer);
BOOST_STATIC_ASSERT(std::numeric_limits<typename base1_type::result_type>::digits >= std::numeric_limits<typename base2_type::result_type>::digits);
#endif
return (_rng1() << s1) ^ (_rng2() << s2);
}
/**
* Returns the smallest value that the generator can produce.
*/
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const { return std::min BOOST_PREVENT_MACRO_SUBSTITUTION((_rng1.min)(), (_rng2.min)()); }
/**
* Returns the largest value that the generator can produce.
*/
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const { return std::max BOOST_PREVENT_MACRO_SUBSTITUTION((_rng1.min)(), (_rng2.max)()); }
static bool validation(result_type x) { return val == x; }
#ifndef BOOST_NO_OPERATORS_IN_NAMESPACE
#ifndef BOOST_RANDOM_NO_STREAM_OPERATORS
template<class CharT, class Traits>
friend std::basic_ostream<CharT,Traits>&
operator<<(std::basic_ostream<CharT,Traits>& os, const xor_combine& s)
{
os << s._rng1 << " " << s._rng2 << " ";
return os;
}
template<class CharT, class Traits>
friend std::basic_istream<CharT,Traits>&
operator>>(std::basic_istream<CharT,Traits>& is, xor_combine& s)
{
is >> s._rng1 >> std::ws >> s._rng2 >> std::ws;
return is;
}
#endif
friend bool operator==(const xor_combine& x, const xor_combine& y)
{ return x._rng1 == y._rng1 && x._rng2 == y._rng2; }
friend bool operator!=(const xor_combine& x, const xor_combine& y)
{ return !(x == y); }
#else
// Use a member function; Streamable concept not supported.
bool operator==(const xor_combine& rhs) const
{ return _rng1 == rhs._rng1 && _rng2 == rhs._rng2; }
bool operator!=(const xor_combine& rhs) const
{ return !(*this == rhs); }
#endif
private:
base1_type _rng1;
base2_type _rng2;
};
#ifndef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
// A definition is required even for integral static constants
template<class URNG1, int s1, class URNG2, int s2, BOOST_RANDOM_VAL_TYPE val>
const bool xor_combine<URNG1, s1, URNG2, s2, val>::has_fixed_range;
template<class URNG1, int s1, class URNG2, int s2, BOOST_RANDOM_VAL_TYPE val>
const int xor_combine<URNG1, s1, URNG2, s2, val>::shift1;
template<class URNG1, int s1, class URNG2, int s2, BOOST_RANDOM_VAL_TYPE val>
const int xor_combine<URNG1, s1, URNG2, s2, val>::shift2;
#endif
#undef BOOST_RANDOM_VAL_TYPE
} // namespace random
} // namespace boost
#endif // BOOST_RANDOM_XOR_COMBINE_HPP

View File

@@ -20,7 +20,7 @@ namespace boost {
enum xtime_clock_types
{
TIME_UTC=1
TIME_UTC_=1
// TIME_TAI,
// TIME_MONOTONIC,
// TIME_PROCESS,
@@ -68,7 +68,7 @@ inline xtime get_xtime(boost::system_time const& abs_time)
inline int xtime_get(struct xtime* xtp, int clock_type)
{
if (clock_type == TIME_UTC)
if (clock_type == TIME_UTC_)
{
*xtp=get_xtime(get_system_time());
return clock_type;

View File

@@ -0,0 +1,125 @@
// Boost name_generator.hpp header file ----------------------------------------------//
// Copyright 2010 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UUID_NAME_GENERATOR_HPP
#define BOOST_UUID_NAME_GENERATOR_HPP
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/sha1.hpp>
#include <boost/assert.hpp>
#include <string>
#include <cstring> // for strlen, wcslen
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
using ::strlen;
using ::wcslen;
} //namespace std
#endif //BOOST_NO_STDC_NAMESPACE
namespace boost {
namespace uuids {
// generate a name-based uuid
// TODO: add in common namesspace uuids
class name_generator {
public:
typedef uuid result_type;
explicit name_generator(uuid const& namespace_uuid)
: namespace_uuid(namespace_uuid)
{}
uuid operator()(const char* name) {
reset();
process_characters(name, std::strlen(name));
return sha_to_uuid();
}
uuid operator()(const wchar_t* name) {
reset();
process_characters(name, std::wcslen(name));
return sha_to_uuid();
}
template <typename ch, typename char_traits, typename alloc>
uuid operator()(std::basic_string<ch, char_traits, alloc> const& name) {
reset();
process_characters(name.c_str(), name.length());
return sha_to_uuid();
}
uuid operator()(void const* buffer, std::size_t byte_count) {
reset();
sha.process_bytes(buffer, byte_count);
return sha_to_uuid();
};
private:
// we convert all characters to uint32_t so that each
// character is 4 bytes reguardless of sizeof(char) or
// sizeof(wchar_t). We want the name string on any
// platform / compiler to generate the same uuid
// except for char
template <typename char_type>
void process_characters(char_type const*const characters, size_t count) {
BOOST_ASSERT(sizeof(uint32_t) >= sizeof(char_type));
for (size_t i=0; i<count; i++) {
uint32_t c = characters[i];
sha.process_byte( (c >> 0) && 0xFF );
sha.process_byte( (c >> 8) && 0xFF );
sha.process_byte( (c >> 16) && 0xFF );
sha.process_byte( (c >> 24) && 0xFF );
}
}
void process_characters(char const*const characters, size_t count) {
sha.process_bytes(characters, count);
}
void reset()
{
sha.reset();
sha.process_bytes(namespace_uuid.begin(), namespace_uuid.size());
}
uuid sha_to_uuid()
{
unsigned int digest[5];
sha.get_digest(digest);
uuid u;
for (int i=0; i<4; ++i) {
*(u.begin() + i*4+0) = ((digest[i] >> 24) & 0xFF);
*(u.begin() + i*4+1) = ((digest[i] >> 16) & 0xFF);
*(u.begin() + i*4+2) = ((digest[i] >> 8) & 0xFF);
*(u.begin() + i*4+3) = ((digest[i] >> 0) & 0xFF);
}
// set variant
// must be 0b10xxxxxx
*(u.begin()+8) &= 0xBF;
*(u.begin()+8) |= 0x80;
// set version
// must be 0b0101xxxx
*(u.begin()+6) &= 0x5F; //0b01011111
*(u.begin()+6) |= 0x50; //0b01010000
return u;
}
private:
uuid namespace_uuid;
detail::sha1 sha;
};
}} // namespace boost::uuids
#endif // BOOST_UUID_NAME_GENERATOR_HPP

View File

@@ -0,0 +1,34 @@
// Boost nil_generator.hpp header file ----------------------------------------------//
// Copyright 2010 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UUID_NIL_GENERATOR_HPP
#define BOOST_UUID_NIL_GENERATOR_HPP
#include <boost/uuid/uuid.hpp>
namespace boost {
namespace uuids {
// generate a nil uuid
struct nil_generator {
typedef uuid result_type;
uuid operator()() const {
// initialize to all zeros
uuid u = {{0}};
return u;
}
};
inline uuid nil_uuid() {
return nil_generator()();
}
}} // namespace boost::uuids
#endif // BOOST_UUID_NIL_GENERATOR_HPP

View File

@@ -0,0 +1,118 @@
// Boost random_generator.hpp header file ----------------------------------------------//
// Copyright 2010 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UUID_RANDOM_GENERATOR_HPP
#define BOOST_UUID_RANDOM_GENERATOR_HPP
#include <boost/uuid/uuid.hpp>
#include <boost/uuid/seed_rng.hpp>
#include <boost/random/uniform_int.hpp>
#include <boost/random/variate_generator.hpp>
#include <boost/random/mersenne_twister.hpp>
#include <boost/assert.hpp>
#include <boost/shared_ptr.hpp>
#include <limits>
namespace boost {
namespace uuids {
// generate a random-based uuid
template <typename UniformRandomNumberGenerator>
class basic_random_generator {
private:
typedef uniform_int<unsigned long> distribution_type;
typedef variate_generator<UniformRandomNumberGenerator*, distribution_type> generator_type;
struct null_deleter
{
void operator()(void const *) const {}
};
public:
typedef uuid result_type;
// default constructor creates the random number generator
basic_random_generator()
: pURNG(new UniformRandomNumberGenerator)
, generator
( pURNG.get()
, distribution_type
( (std::numeric_limits<unsigned long>::min)()
, (std::numeric_limits<unsigned long>::max)()
)
)
{
// seed the random number generator
detail::seed(*pURNG);
}
// keep a reference to a random number generator
// don't seed a given random number generator
explicit basic_random_generator(UniformRandomNumberGenerator& gen)
: pURNG(&gen, null_deleter())
, generator
( pURNG.get()
, distribution_type
( (std::numeric_limits<unsigned long>::min)()
, (std::numeric_limits<unsigned long>::max)()
)
)
{}
// keep a pointer to a random number generator
// don't seed a given random number generator
explicit basic_random_generator(UniformRandomNumberGenerator* pGen)
: pURNG(pGen, null_deleter())
, generator
( pURNG.get()
, distribution_type
( (std::numeric_limits<unsigned long>::min)()
, (std::numeric_limits<unsigned long>::max)()
)
)
{
BOOST_ASSERT(pURNG);
}
uuid operator()()
{
uuid u;
int i=0;
unsigned long random_value = generator();
for (uuid::iterator it=u.begin(); it!=u.end(); ++it, ++i) {
if (i==sizeof(unsigned long)) {
random_value = generator();
i = 0;
}
*it = ((random_value >> (i*8)) & 0xFF);
}
// set variant
// must be 0b10xxxxxx
*(u.begin()+8) &= 0xBF;
*(u.begin()+8) |= 0x80;
// set version
// must be 0b0100xxxx
*(u.begin()+6) &= 0x4F; //0b01001111
*(u.begin()+6) |= 0x40; //0b01000000
return u;
}
private:
shared_ptr<UniformRandomNumberGenerator> pURNG;
generator_type generator;
};
typedef basic_random_generator<mt19937> random_generator;
}} // namespace boost::uuids
#endif //BOOST_UUID_RANDOM_GENERATOR_HPP

View File

@@ -0,0 +1,262 @@
// Boost seed_rng.hpp header file ----------------------------------------------//
// Copyright 2007 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Revision History
// 09 Nov 2007 - Initial Revision
// 25 Feb 2008 - moved to namespace boost::uuids::detail
// 28 Nov 2009 - disabled deprecated warnings for MSVC
// seed_rng models a UniformRandomNumberGenerator (see Boost.Random).
// Random number generators are hard to seed well. This is intended to provide
// good seed values for random number generators.
// It creates random numbers from a sha1 hash of data from a variary of sources,
// all of which are standard function calls. It produces random numbers slowly.
// Peter Dimov provided the details of sha1_random_digest_().
// see http://archives.free.net.ph/message/20070507.175609.4c4f503a.en.html
#ifndef BOOST_UUID_SEED_RNG_HPP
#define BOOST_UUID_SEED_RNG_HPP
#include <boost/config.hpp>
#include <cstring> // for memcpy
#include <limits>
#include <memory.h>
#include <ctime> // for time_t, time, clock_t, clock
#include <cstdlib> // for rand
#include <cstdio> // for FILE, fopen, fread, fclose
#include <boost/uuid/sha1.hpp>
//#include <boost/nondet_random.hpp> //forward declare boost::random_device
// can't use boost::generator_iterator since boost::random number seed(Iter&, Iter)
// functions need a last iterator
//#include <boost/generator_iterator.hpp>
# include <boost/iterator/iterator_facade.hpp>
#if defined(_MSC_VER)
#pragma warning(push) // Save warning settings.
#pragma warning(disable : 4996) // Disable deprecated std::fopen
#endif
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
using ::memcpy;
using ::time_t;
using ::time;
using ::clock_t;
using ::clock;
using ::rand;
using ::FILE;
using ::fopen;
using ::fread;
using ::fclose;
} //namespace std
#endif
// forward declare random number generators
namespace boost {
class random_device;
} //namespace boost
namespace boost {
namespace uuids {
namespace detail {
// should this be part of Boost.Random?
class seed_rng
{
public:
typedef unsigned int result_type;
BOOST_STATIC_CONSTANT(bool, has_fixed_range = false);
//BOOST_STATIC_CONSTANT(unsigned int, min_value = 0);
//BOOST_STATIC_CONSTANT(unsigned int, max_value = UINT_MAX);
public:
// note: rd_ intentionally left uninitialized
seed_rng()
: rd_index_(5)
, random_(std::fopen( "/dev/urandom", "rb" ))
{}
~seed_rng()
{
if (random_) {
std::fclose(random_);
}
}
result_type min BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return (std::numeric_limits<result_type>::min)();
}
result_type max BOOST_PREVENT_MACRO_SUBSTITUTION () const
{
return (std::numeric_limits<result_type>::max)();
}
result_type operator()()
{
if (rd_index_ >= 5) {
//get new digest
sha1_random_digest_();
rd_index_ = 0;
}
return rd_[rd_index_++];
}
private:
static unsigned int * sha1_random_digest_state_()
{
// intentionally left uninitialized
static unsigned int state[ 5 ];
return state;
}
void sha1_random_digest_()
{
boost::uuids::detail::sha1 sha;
unsigned int * ps = sha1_random_digest_state_();
unsigned int state[ 5 ];
std::memcpy( state, ps, sizeof( state ) ); // harmless data race
sha.process_bytes( (unsigned char const*)state, sizeof( state ) );
sha.process_bytes( (unsigned char const*)&ps, sizeof( ps ) );
{
std::time_t tm = std::time( 0 );
sha.process_bytes( (unsigned char const*)&tm, sizeof( tm ) );
}
{
std::clock_t ck = std::clock();
sha.process_bytes( (unsigned char const*)&ck, sizeof( ck ) );
}
{
unsigned int rn[] = { std::rand(), std::rand(), std::rand() };
sha.process_bytes( (unsigned char const*)rn, sizeof( rn ) );
}
{
// intentionally left uninitialized
unsigned char buffer[ 20 ];
if(random_)
{
std::fread( buffer, 1, 20, random_ );
}
// using an uninitialized buffer[] if fopen fails
// intentional, we rely on its contents being random
sha.process_bytes( buffer, sizeof( buffer ) );
}
{
// *p is intentionally left uninitialized
unsigned int * p = new unsigned int;
sha.process_bytes( (unsigned char const*)p, sizeof( *p ) );
sha.process_bytes( (unsigned char const*)&p, sizeof( p ) );
delete p;
}
sha.process_bytes( (unsigned char const*)rd_, sizeof( rd_ ) );
unsigned int digest[ 5 ];
sha.get_digest( digest );
for( int i = 0; i < 5; ++i )
{
// harmless data race
ps[ i ] ^= digest[ i ];
rd_[ i ] ^= digest[ i ];
}
}
private:
unsigned int rd_[5];
int rd_index_;
std::FILE * random_;
private: // make seed_rng noncopyable
seed_rng(seed_rng const&);
seed_rng& operator=(seed_rng const&);
};
// almost a copy of boost::generator_iterator
// but default constructor sets m_g to NULL
template <class Generator>
class generator_iterator
: public iterator_facade<
generator_iterator<Generator>
, typename Generator::result_type
, single_pass_traversal_tag
, typename Generator::result_type const&
>
{
typedef iterator_facade<
generator_iterator<Generator>
, typename Generator::result_type
, single_pass_traversal_tag
, typename Generator::result_type const&
> super_t;
public:
generator_iterator() : m_g(NULL) {}
generator_iterator(Generator* g) : m_g(g), m_value((*m_g)()) {}
void increment()
{
m_value = (*m_g)();
}
const typename Generator::result_type&
dereference() const
{
return m_value;
}
bool equal(generator_iterator const& y) const
{
return this->m_g == y.m_g && this->m_value == y.m_value;
}
private:
Generator* m_g;
typename Generator::result_type m_value;
};
// seed() seeds a random number generator with good seed values
template <typename UniformRandomNumberGenerator>
inline void seed(UniformRandomNumberGenerator& rng)
{
seed_rng seed_gen;
generator_iterator<seed_rng> begin(&seed_gen);
generator_iterator<seed_rng> end;
rng.seed(begin, end);
}
// random_device does not / can not be seeded
template <>
inline void seed<boost::random_device>(boost::random_device&) {}
// random_device does not / can not be seeded
template <>
inline void seed<seed_rng>(seed_rng&) {}
}}} //namespace boost::uuids::detail
#if defined(_MSC_VER)
#pragma warning(pop) // Restore warnings to previous state.
#endif
#endif

208
Boost/boost/uuid/sha1.hpp Normal file
View File

@@ -0,0 +1,208 @@
// boost/uuid/sha1.hpp header file ----------------------------------------------//
// Copyright 2007 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Revision History
// 29 May 2007 - Initial Revision
// 25 Feb 2008 - moved to namespace boost::uuids::detail
// This is a byte oriented implementation
// Note: this implementation does not handle message longer than
// 2^32 bytes.
#ifndef BOOST_UUID_SHA1_H
#define BOOST_UUID_SHA1_H
#include <boost/static_assert.hpp>
#include <cstddef>
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
using ::size_t;
} // namespace std
#endif
namespace boost {
namespace uuids {
namespace detail {
BOOST_STATIC_ASSERT(sizeof(unsigned char)*8 == 8);
BOOST_STATIC_ASSERT(sizeof(unsigned int)*8 == 32);
inline unsigned int left_rotate(unsigned int x, std::size_t n)
{
return (x<<n) ^ (x>> (32-n));
}
class sha1
{
public:
typedef unsigned int(&digest_type)[5];
public:
sha1();
void reset();
void process_byte(unsigned char byte);
void process_block(void const* bytes_begin, void const* bytes_end);
void process_bytes(void const* buffer, std::size_t byte_count);
void get_digest(digest_type digest);
private:
void process_block();
private:
unsigned int h_[5];
unsigned char block_[64];
std::size_t block_byte_index_;
std::size_t byte_count_;
};
inline sha1::sha1()
{
reset();
}
inline void sha1::reset()
{
h_[0] = 0x67452301;
h_[1] = 0xEFCDAB89;
h_[2] = 0x98BADCFE;
h_[3] = 0x10325476;
h_[4] = 0xC3D2E1F0;
block_byte_index_ = 0;
byte_count_ = 0;
}
inline void sha1::process_byte(unsigned char byte)
{
block_[block_byte_index_++] = byte;
++byte_count_;
if (block_byte_index_ == 64) {
block_byte_index_ = 0;
process_block();
}
}
inline void sha1::process_block(void const* bytes_begin, void const* bytes_end)
{
unsigned char const* begin = static_cast<unsigned char const*>(bytes_begin);
unsigned char const* end = static_cast<unsigned char const*>(bytes_end);
for(; begin != end; ++begin) {
process_byte(*begin);
}
}
inline void sha1::process_bytes(void const* buffer, std::size_t byte_count)
{
unsigned char const* b = static_cast<unsigned char const*>(buffer);
process_block(b, b+byte_count);
}
inline void sha1::process_block()
{
unsigned int w[80];
for (std::size_t i=0; i<16; ++i) {
w[i] = (block_[i*4 + 0] << 24);
w[i] |= (block_[i*4 + 1] << 16);
w[i] |= (block_[i*4 + 2] << 8);
w[i] |= (block_[i*4 + 3]);
}
for (std::size_t i=16; i<80; ++i) {
w[i] = left_rotate((w[i-3] ^ w[i-8] ^ w[i-14] ^ w[i-16]), 1);
}
unsigned int a = h_[0];
unsigned int b = h_[1];
unsigned int c = h_[2];
unsigned int d = h_[3];
unsigned int e = h_[4];
for (std::size_t i=0; i<80; ++i) {
unsigned int f;
unsigned int k;
if (i<20) {
f = (b & c) | (~b & d);
k = 0x5A827999;
} else if (i<40) {
f = b ^ c ^ d;
k = 0x6ED9EBA1;
} else if (i<60) {
f = (b & c) | (b & d) | (c & d);
k = 0x8F1BBCDC;
} else {
f = b ^ c ^ d;
k = 0xCA62C1D6;
}
unsigned temp = left_rotate(a, 5) + f + e + k + w[i];
e = d;
d = c;
c = left_rotate(b, 30);
b = a;
a = temp;
}
h_[0] += a;
h_[1] += b;
h_[2] += c;
h_[3] += d;
h_[4] += e;
}
inline void sha1::get_digest(digest_type digest)
{
std::size_t bit_count = byte_count_*8;
// append the bit '1' to the message
process_byte(0x80);
// append k bits '0', where k is the minimum number >= 0
// such that the resulting message length is congruent to 56 (mod 64)
// check if there is enough space for padding and bit_count
if (block_byte_index_ > 56) {
// finish this block
while (block_byte_index_ != 0) {
process_byte(0);
}
// one more block
while (block_byte_index_ < 56) {
process_byte(0);
}
} else {
while (block_byte_index_ < 56) {
process_byte(0);
}
}
// append length of message (before pre-processing)
// as a 64-bit big-endian integer
process_byte(0);
process_byte(0);
process_byte(0);
process_byte(0);
process_byte( static_cast<unsigned char>((bit_count>>24) & 0xFF));
process_byte( static_cast<unsigned char>((bit_count>>16) & 0xFF));
process_byte( static_cast<unsigned char>((bit_count>>8 ) & 0xFF));
process_byte( static_cast<unsigned char>((bit_count) & 0xFF));
// get final digest
digest[0] = h_[0];
digest[1] = h_[1];
digest[2] = h_[2];
digest[3] = h_[3];
digest[4] = h_[4];
}
}}} // namespace boost::uuids::detail
#endif

View File

@@ -0,0 +1,184 @@
// Boost string_generator.hpp header file ----------------------------------------------//
// Copyright 2010 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_UUID_STRING_GENERATOR_HPP
#define BOOST_UUID_STRING_GENERATOR_HPP
#include <boost/uuid/uuid.hpp>
#include <string>
#include <cstring> // for strlen, wcslen
#include <iterator>
#include <algorithm> // for find
#include <stdexcept>
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
using ::strlen;
using ::wcslen;
} //namespace std
#endif //BOOST_NO_STDC_NAMESPACE
namespace boost {
namespace uuids {
// generate a uuid from a string
// lexical_cast works fine using uuid_io.hpp
// but this generator should accept more forms
// and be more efficient
// would like to accept the following forms:
// 0123456789abcdef0123456789abcdef
// 01234567-89ab-cdef-0123456789abcdef
// {01234567-89ab-cdef-0123456789abcdef}
// {0123456789abcdef0123456789abcdef}
// others?
struct string_generator {
typedef uuid result_type;
template <typename ch, typename char_traits, typename alloc>
uuid operator()(std::basic_string<ch, char_traits, alloc> const& s) const {
return operator()(s.begin(), s.end());
};
uuid operator()(char const*const s) const {
return operator()(s, s+std::strlen(s));
}
uuid operator()(wchar_t const*const s) const {
return operator()(s, s+std::wcslen(s));
}
template <typename CharIterator>
uuid operator()(CharIterator begin, CharIterator end) const
{
typedef typename std::iterator_traits<CharIterator>::value_type char_type;
// check open brace
char_type c = get_next_char(begin, end);
bool has_open_brace = is_open_brace(c);
char_type open_brace_char = c;
if (has_open_brace) {
c = get_next_char(begin, end);
}
bool has_dashes = false;
uuid u;
int i=0;
for (uuid::iterator it_byte=u.begin(); it_byte!=u.end(); ++it_byte, ++i) {
if (it_byte != u.begin()) {
c = get_next_char(begin, end);
}
if (i == 4) {
has_dashes = is_dash(c);
if (has_dashes) {
c = get_next_char(begin, end);
}
}
if (has_dashes) {
if (i == 6 || i == 8 || i == 10) {
if (is_dash(c)) {
c = get_next_char(begin, end);
} else {
throw_invalid();
}
}
}
*it_byte = get_value(c);
c = get_next_char(begin, end);
*it_byte <<= 4;
*it_byte |= get_value(c);
}
// check close brace
if (has_open_brace) {
c = get_next_char(begin, end);
check_close_brace(c, open_brace_char);
}
return u;
}
private:
template <typename CharIterator>
typename std::iterator_traits<CharIterator>::value_type
get_next_char(CharIterator& begin, CharIterator end) const {
if (begin == end) {
throw_invalid();
}
return *begin++;
}
unsigned char get_value(char c) const {
static char const*const digits_begin = "0123456789abcdefABCDEF";
static char const*const digits_end = digits_begin + 22;
static unsigned char const values[] =
{ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,10,11,12,13,14,15
, static_cast<unsigned char>(-1) };
char const* d = std::find(digits_begin, digits_end, c);
return values[d - digits_begin];
}
unsigned char get_value(wchar_t c) const {
static wchar_t const*const digits_begin = L"0123456789abcdefABCDEF";
static wchar_t const*const digits_end = digits_begin + 22;
static unsigned char const values[] =
{ 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,10,11,12,13,14,15
, static_cast<unsigned char>(-1) };
wchar_t const* d = std::find(digits_begin, digits_end, c);
return values[d - digits_begin];
}
bool is_dash(char c) const {
return c == '-';
}
bool is_dash(wchar_t c) const {
return c == L'-';
}
// return closing brace
bool is_open_brace(char c) const {
return (c == '{');
}
bool is_open_brace(wchar_t c) const {
return (c == L'{');
}
void check_close_brace(char c, char open_brace) const {
if (open_brace == '{' && c == '}') {
//great
} else {
throw_invalid();
}
}
void check_close_brace(wchar_t c, wchar_t open_brace) const {
if (open_brace == L'{' && c == L'}') {
// great
} else {
throw_invalid();
}
}
void throw_invalid() const {
throw std::runtime_error("invalid uuid string");
}
};
}} // namespace boost::uuids
#endif //BOOST_UUID_STRING_GENERATOR_HPP

221
Boost/boost/uuid/uuid.hpp Normal file
View File

@@ -0,0 +1,221 @@
// Boost uuid.hpp header file ----------------------------------------------//
// Copyright 2006 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Revision History
// 06 Feb 2006 - Initial Revision
// 09 Nov 2006 - fixed variant and version bits for v4 guids
// 13 Nov 2006 - added serialization
// 17 Nov 2006 - added name-based guid creation
// 20 Nov 2006 - add fixes for gcc (from Tim Blechmann)
// 07 Mar 2007 - converted to header only
// 10 May 2007 - removed need for Boost.Thread
// - added better seed - thanks Peter Dimov
// - removed null()
// - replaced byte_count() and output_bytes() with size() and begin() and end()
// 11 May 2007 - fixed guid(ByteInputIterator first, ByteInputIterator last)
// - optimized operator>>
// 14 May 2007 - converted from guid to uuid
// 29 May 2007 - uses new implementation of sha1
// 01 Jun 2007 - removed using namespace directives
// 09 Nov 2007 - moved implementation to uuid.ipp file
// 12 Nov 2007 - moved serialize code to uuid_serialize.hpp file
// 25 Feb 2008 - moved to namespace boost::uuids
// 19 Mar 2009 - changed to a POD, reorganized files
// 28 Nov 2009 - disabled deprecated warnings for MSVC
// 30 Nov 2009 - used BOOST_STATIC_CONSTANT
// 02 Dec 2009 - removed BOOST_STATIC_CONSTANT - not all compilers like it
#ifndef BOOST_UUID_HPP
#define BOOST_UUID_HPP
#include <boost/config.hpp>
#include <stddef.h>
#include <boost/cstdint.hpp>
#include <algorithm>
#include <boost/config.hpp> // for static assert
#ifndef BOOST_UUID_NO_TYPE_TRAITS
#include <boost/type_traits/is_pod.hpp>
#include <boost/type_traits/integral_constant.hpp>
#endif
#if defined(_MSC_VER)
#pragma warning(push) // Save warning settings.
#pragma warning(disable : 4996) // Disable deprecated std::swap_ranges, std::equal
#endif
#ifdef BOOST_NO_STDC_NAMESPACE
namespace std {
using ::size_t;
using ::ptrdiff_t;
} //namespace std
#endif //BOOST_NO_STDC_NAMESPACE
namespace boost {
namespace uuids {
struct uuid
{
public:
typedef uint8_t value_type;
typedef uint8_t& reference;
typedef uint8_t const& const_reference;
typedef uint8_t* iterator;
typedef uint8_t const* const_iterator;
typedef std::size_t size_type;
typedef std::ptrdiff_t difference_type;
// This does not work on some compilers
// They seem to want the variable definec in
// a cpp file
//BOOST_STATIC_CONSTANT(size_type, static_size = 16);
static size_type static_size() { return 16; }
public:
iterator begin() { return data; } /* throw() */
const_iterator begin() const { return data; } /* throw() */
iterator end() { return data+size(); } /* throw() */
const_iterator end() const { return data+size(); } /* throw() */
size_type size() const { return static_size(); } /* throw() */
bool is_nil() const /* throw() */
{
for(size_t i=0; i<static_size(); i++) {
if (data[i] != 0U) {
return false;
}
}
return true;
}
enum variant_type
{
variant_ncs, // NCS backward compatibility
variant_rfc_4122, // defined in RFC 4122 document
variant_microsoft, // Microsoft Corporation backward compatibility
variant_future // future definition
};
variant_type variant() const /* throw() */
{
// variant is stored in octet 7
// which is index 8, since indexes count backwards
unsigned char octet7 = data[8]; // octet 7 is array index 8
if ( (octet7 & 0x80) == 0x00 ) { // 0b0xxxxxxx
return variant_ncs;
} else if ( (octet7 & 0xC0) == 0x80 ) { // 0b10xxxxxx
return variant_rfc_4122;
} else if ( (octet7 & 0xE0) == 0xC0 ) { // 0b110xxxxx
return variant_microsoft;
} else {
//assert( (octet7 & 0xE0) == 0xE0 ) // 0b111xxxx
return variant_future;
}
}
enum version_type
{
version_unknown = -1,
version_time_based = 1,
version_dce_security = 2,
version_name_based_md5 = 3,
version_random_number_based = 4,
version_name_based_sha1 = 5
};
version_type version() const /* throw() */
{
//version is stored in octet 9
// which is index 6, since indexes count backwards
unsigned char octet9 = data[6];
if ( (octet9 & 0xF0) == 0x10 ) {
return version_time_based;
} else if ( (octet9 & 0xF0) == 0x20 ) {
return version_dce_security;
} else if ( (octet9 & 0xF0) == 0x30 ) {
return version_name_based_md5;
} else if ( (octet9 & 0xF0) == 0x40 ) {
return version_random_number_based;
} else if ( (octet9 & 0xF0) == 0x50 ) {
return version_name_based_sha1;
} else {
return version_unknown;
}
}
// note: linear complexity
void swap(uuid& rhs) /* throw() */
{
std::swap_ranges(begin(), end(), rhs.begin());
}
public:
// or should it be array<uint8_t, 16>
uint8_t data[16];
};
inline bool operator==(uuid const& lhs, uuid const& rhs) /* throw() */
{
return std::equal(lhs.begin(), lhs.end(), rhs.begin());
}
inline bool operator!=(uuid const& lhs, uuid const& rhs) /* throw() */
{
return !(lhs == rhs);
}
inline bool operator<(uuid const& lhs, uuid const& rhs) /* throw() */
{
return std::lexicographical_compare(lhs.begin(), lhs.end(), rhs.begin(), rhs.end());
}
inline bool operator>(uuid const& lhs, uuid const& rhs) /* throw() */
{
return rhs < lhs;
}
inline bool operator<=(uuid const& lhs, uuid const& rhs) /* throw() */
{
return !(rhs < lhs);
}
inline bool operator>=(uuid const& lhs, uuid const& rhs) /* throw() */
{
return !(lhs < rhs);
}
inline void swap(uuid& lhs, uuid& rhs) /* throw() */
{
lhs.swap(rhs);
}
// This is equivalent to boost::hash_range(u.begin(), u.end());
inline std::size_t hash_value(uuid const& u) /* throw() */
{
std::size_t seed = 0;
for(uuid::const_iterator i=u.begin(); i != u.end(); ++i)
{
seed ^= static_cast<std::size_t>(*i) + 0x9e3779b9 + (seed << 6) + (seed >> 2);
}
return seed;
}
}} //namespace boost::uuids
#ifndef BOOST_UUID_NO_TYPE_TRAITS
// type traits specializations
namespace boost {
template <>
struct is_pod<uuids::uuid> : true_type {};
} // namespace boost
#endif
#if defined(_MSC_VER)
#pragma warning(pop) // Restore warnings to previous state.
#endif
#endif // BOOST_UUID_HPP

View File

@@ -0,0 +1,19 @@
// Boost uuid_generators.hpp header file ----------------------------------------------//
// Copyright 2006 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Revision History
// 06 Feb 2006 - Initial Revision
#ifndef BOOST_UUID_GENERATORS_HPP
#define BOOST_UUID_GENERATORS_HPP
#include <boost/uuid/nil_generator.hpp>
#include <boost/uuid/string_generator.hpp>
#include <boost/uuid/name_generator.hpp>
#include <boost/uuid/random_generator.hpp>
#endif //BOOST_UUID_GENERATORS_HPP

View File

@@ -0,0 +1,198 @@
// Boost uuid_io.hpp header file ----------------------------------------------//
// Copyright 2009 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Revision History
// 20 Mar 2009 - Initial Revision
// 28 Nov 2009 - disabled deprecated warnings for MSVC
#ifndef BOOST_UUID_IO_HPP
#define BOOST_UUID_IO_HPP
#include <boost/uuid/uuid.hpp>
#include <ios>
#include <ostream>
#include <istream>
#include <boost/io/ios_state.hpp>
#include <locale>
#include <algorithm>
#if defined(_MSC_VER)
#pragma warning(push) // Save warning settings.
#pragma warning(disable : 4996) // Disable deprecated std::ctype<char>::widen, std::copy
#endif
namespace boost {
namespace uuids {
template <typename ch, typename char_traits>
std::basic_ostream<ch, char_traits>& operator<<(std::basic_ostream<ch, char_traits> &os, uuid const& u)
{
io::ios_flags_saver flags_saver(os);
io::basic_ios_fill_saver<ch, char_traits> fill_saver(os);
const typename std::basic_ostream<ch, char_traits>::sentry ok(os);
if (ok) {
const std::streamsize width = os.width(0);
const std::streamsize uuid_width = 36;
const std::ios_base::fmtflags flags = os.flags();
const typename std::basic_ios<ch, char_traits>::char_type fill = os.fill();
if (flags & (std::ios_base::right | std::ios_base::internal)) {
for (std::streamsize i=uuid_width; i<width; i++) {
os << fill;
}
}
os << std::hex;
os.fill(os.widen('0'));
std::size_t i=0;
for (uuid::const_iterator i_data = u.begin(); i_data!=u.end(); ++i_data, ++i) {
os.width(2);
os << static_cast<unsigned int>(*i_data);
if (i == 3 || i == 5 || i == 7 || i == 9) {
os << os.widen('-');
}
}
if (flags & std::ios_base::left) {
for (std::streamsize i=uuid_width; i<width; i++) {
os << fill;
}
}
os.width(0); //used the width so reset it
}
return os;
}
template <typename ch, typename char_traits>
std::basic_istream<ch, char_traits>& operator>>(std::basic_istream<ch, char_traits> &is, uuid &u)
{
const typename std::basic_istream<ch, char_traits>::sentry ok(is);
if (ok) {
unsigned char data[16];
typedef std::ctype<ch> ctype_t;
ctype_t const& ctype = std::use_facet<ctype_t>(is.getloc());
ch xdigits[16];
{
char szdigits[] = "0123456789ABCDEF";
ctype.widen(szdigits, szdigits+16, xdigits);
}
ch*const xdigits_end = xdigits+16;
ch c;
for (std::size_t i=0; i<u.size() && is; ++i) {
is >> c;
c = ctype.toupper(c);
ch* f = std::find(xdigits, xdigits_end, c);
if (f == xdigits_end) {
is.setstate(std::ios_base::failbit);
break;
}
unsigned char byte = static_cast<unsigned char>(std::distance(&xdigits[0], f));
is >> c;
c = ctype.toupper(c);
f = std::find(xdigits, xdigits_end, c);
if (f == xdigits_end) {
is.setstate(std::ios_base::failbit);
break;
}
byte <<= 4;
byte |= static_cast<unsigned char>(std::distance(&xdigits[0], f));
data[i] = byte;
if (is) {
if (i == 3 || i == 5 || i == 7 || i == 9) {
is >> c;
if (c != is.widen('-')) is.setstate(std::ios_base::failbit);
}
}
}
if (is) {
std::copy(data, data+16, u.begin());
}
}
return is;
}
namespace detail {
inline char to_char(size_t i) {
if (i <= 9) {
return static_cast<char>('0' + i);
} else {
return static_cast<char>('a' + (i-10));
}
}
inline wchar_t to_wchar(size_t i) {
if (i <= 9) {
return static_cast<wchar_t>(L'0' + i);
} else {
return static_cast<wchar_t>(L'a' + (i-10));
}
}
} // namespace detail
inline std::string to_string(uuid const& u)
{
std::string result;
result.reserve(36);
std::size_t i=0;
for (uuid::const_iterator it_data = u.begin(); it_data!=u.end(); ++it_data, ++i) {
const size_t hi = ((*it_data) >> 4) & 0x0F;
result += detail::to_char(hi);
const size_t lo = (*it_data) & 0x0F;
result += detail::to_char(lo);
if (i == 3 || i == 5 || i == 7 || i == 9) {
result += '-';
}
}
return result;
}
#ifndef BOOST_NO_STD_WSTRING
inline std::wstring to_wstring(uuid const& u)
{
std::wstring result;
result.reserve(36);
std::size_t i=0;
for (uuid::const_iterator it_data = u.begin(); it_data!=u.end(); ++it_data, ++i) {
const size_t hi = ((*it_data) >> 4) & 0x0F;
result += detail::to_wchar(hi);
const size_t lo = (*it_data) & 0x0F;
result += detail::to_wchar(lo);
if (i == 3 || i == 5 || i == 7 || i == 9) {
result += L'-';
}
}
return result;
}
#endif
}} //namespace boost::uuids
#if defined(_MSC_VER)
#pragma warning(pop) // Restore warnings to previous state.
#endif
#endif // BOOST_UUID_IO_HPP

View File

@@ -0,0 +1,20 @@
// Boost uuid_serialize.hpp header file ----------------------------------------------//
// Copyright 2007 Andy Tompkins.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// Revision History
// 12 Nov 2007 - Initial Revision
// 25 Feb 2008 - moved to namespace boost::uuids::detail
#ifndef BOOST_UUID_SERIALIZE_HPP
#define BOOST_UUID_SERIALIZE_HPP
#include <boost/uuid/uuid.hpp>
#include <boost/serialization/level.hpp>
BOOST_CLASS_IMPLEMENTATION(boost::uuids::uuid, boost::serialization::primitive_type)
#endif // BOOST_UUID_SERIALIZE_HPP

18
Boost/boost/weak_ptr.hpp Normal file
View File

@@ -0,0 +1,18 @@
#ifndef BOOST_WEAK_PTR_HPP_INCLUDED
#define BOOST_WEAK_PTR_HPP_INCLUDED
//
// weak_ptr.hpp
//
// Copyright (c) 2001, 2002, 2003 Peter Dimov
//
// Distributed under the Boost Software License, Version 1.0.
// See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt
//
// See http://www.boost.org/libs/smart_ptr/weak_ptr.htm for documentation.
//
#include <boost/smart_ptr/weak_ptr.hpp>
#endif // #ifndef BOOST_WEAK_PTR_HPP_INCLUDED

Binary file not shown.

Binary file not shown.

View File

@@ -350,7 +350,7 @@ namespace boost
cond.timed_wait(lock, xt);
# endif
xtime cur;
xtime_get(&cur, TIME_UTC);
xtime_get(&cur, TIME_UTC_);
if (xtime_cmp(xt, cur) <= 0)
return;
}
@@ -365,7 +365,7 @@ namespace boost
BOOST_VERIFY(!pthread_yield());
# else
xtime xt;
xtime_get(&xt, TIME_UTC);
xtime_get(&xt, TIME_UTC_);
sleep(xt);
# endif
}

View File

@@ -20,8 +20,8 @@ const int NANOSECONDS_PER_MICROSECOND = 1000;
inline void to_time(int milliseconds, boost::xtime& xt)
{
int res = 0;
res = boost::xtime_get(&xt, boost::TIME_UTC);
BOOST_ASSERT(res == boost::TIME_UTC);
res = boost::xtime_get(&xt, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_);
xt.sec += (milliseconds / MILLISECONDS_PER_SECOND);
xt.nsec += ((milliseconds % MILLISECONDS_PER_SECOND) *
@@ -57,8 +57,8 @@ inline void to_timespec_duration(const boost::xtime& xt, timespec& ts)
{
boost::xtime cur;
int res = 0;
res = boost::xtime_get(&cur, boost::TIME_UTC);
BOOST_ASSERT(res == boost::TIME_UTC);
res = boost::xtime_get(&cur, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
{
@@ -88,8 +88,8 @@ inline void to_duration(boost::xtime xt, int& milliseconds)
{
boost::xtime cur;
int res = 0;
res = boost::xtime_get(&cur, boost::TIME_UTC);
BOOST_ASSERT(res == boost::TIME_UTC);
res = boost::xtime_get(&cur, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
milliseconds = 0;
@@ -110,8 +110,8 @@ inline void to_microduration(boost::xtime xt, int& microseconds)
{
boost::xtime cur;
int res = 0;
res = boost::xtime_get(&cur, boost::TIME_UTC);
BOOST_ASSERT(res == boost::TIME_UTC);
res = boost::xtime_get(&cur, boost::TIME_UTC_);
BOOST_ASSERT(res == boost::TIME_UTC_);
if (boost::xtime_cmp(xt, cur) <= 0)
microseconds = 0;

1768
CHANGELOG.md Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -77,6 +77,13 @@ SDL_AtomicTryLock(SDL_SpinLock *lock)
: "=&r" (result) : "r" (1), "r" (lock) : "cc", "memory");
return (result == 0);
#elif defined(__GNUC__) && (defined(__i386__) || defined(__x86_64__))
int result;
__asm__ __volatile__(
"lock ; xchgl %0, (%1)\n"
: "=r" (result) : "r" (lock), "0" (1) : "cc", "memory");
return (result == 0);
#else
/* Need CPU instructions for spinlock here! */
__need_spinlock_implementation__

View File

@@ -474,7 +474,7 @@
#ifndef PNG_VERSION_INFO_ONLY
/* include the compression library's header */
#include "zlib.h"
#include "../include/zlib.h"
#endif
/* include all user configurable info, including optional assembler routines */

View File

@@ -73,7 +73,7 @@
<Optimization>MaxSpeed</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SDL_CONFIG;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>
@@ -101,7 +101,7 @@
<ClCompile>
<Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SDL_CONFIG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<PrecompiledHeader>
@@ -129,7 +129,7 @@
<Optimization>Full</Optimization>
<InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
<AdditionalIncludeDirectories>src/zipFS;Dependencies/SDL/include;Dependencies/include;$(JGEEXTRAS);../Boost;../projects/mtg/include;include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>SDL_CONFIG;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>TIXML_USE_STL; SDL_CONFIG;WIN32;NDEBUG;_LIB;_SECURE_SCL=0;_HAS_ITERATOR_DEBBUGING=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<StringPooling>true</StringPooling>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking>

View File

@@ -31,6 +31,8 @@ HGE_OBJS = src/hge/hgecolor.o src/hge/hgeparticle.o \
CXXFLAGS = -W -Wall -Werror -Wno-unused
CXXFLAGS += -DTIXML_USE_STL
CXXFLAGS += -Wno-deprecated-declarations -Wno-sign-compare
ifdef DEBUG
CXXFLAGS += -ggdb3
@@ -81,8 +83,8 @@ ifeq ($(TARGET_ARCHITECTURE),linux)
OBJS = $(GENERIC_OBJS) $(LINUX_OBJS)
TARGET_LIB = libjge.a
TARGET_HGE = libhgetools.a
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I../Boost -Isrc/zipFS -Iinclude/
CXXFLAGS += -DLINUX $(FMOD)
INCDIR = $(shell freetype-config --cflags 2> /dev/null) -I/usr/X11/include -I/usr/include/boost -Isrc/zipFS -Iinclude/
CXXFLAGS += -DLINUX -DNETWORK_SUPPORT $(FMOD)
CXXFLAGS += $(INCDIR)
LIBDIR = lib/linux
endif

View File

@@ -4,6 +4,8 @@
// dirty, but I get OS header includes this way
#include "JGE.h"
#include "OutputCapturer.h"
#include <ostream>
#include <iostream>
#include <iomanip>
@@ -16,9 +18,9 @@ using namespace std;
template <class T>
std::string ToHex(T* pointer)
{
std::ostringstream stream;
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
return stream.str();
std::ostringstream stream;
stream << hex << showbase << setfill('0') << setw(8) << (uint64_t) pointer;
return stream.str();
}
#ifdef LINUX
@@ -29,26 +31,37 @@ std::string ToHex(T* pointer)
#if defined (WIN32) || defined (LINUX)
#ifdef QT_CONFIG
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
qDebug(stream.str().c_str()); \
}
#elif defined (ANDROID)
#include <android/log.h>
#ifdef CAPTURE_STDERR
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString; \
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
OutputCapturer::add(stream.str()); \
}
#else // CAPTURE_STDERR
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString; \
qDebug("%s", stream.str().c_str()); \
}
#endif // CAPTURE_STDERR
#elif defined (ANDROID)
#include <android/log.h>
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString; \
__android_log_write(ANDROID_LOG_DEBUG, "Wagic", stream.str().c_str());\
}
#else
#define DebugTrace(inString) \
{ \
std::ostringstream stream; \
stream << inString << std::endl; \
OutputDebugString(stream.str().c_str()); \
OutputDebugStringA(stream.str().c_str()); \
}
#endif // QT_CONFIG
#endif // Win32, Linux
@@ -58,7 +71,7 @@ std::string ToHex(T* pointer)
#ifndef DebugTrace
#define DebugTrace(inString) \
{ \
std::cerr << inString << std::endl; \
std::cerr << inString << std::endl; \
}
#endif //DEBUG
#endif

128
JGE/include/Downloader.h Normal file
View File

@@ -0,0 +1,128 @@
#ifndef DOWNLOADER_H
#define DOWNLOADER_H
//-------------------------------------------------------------------------------------
//
// This class handles download of remote resources (any kind of file)
// All the resources are stored locally in the userPath
// For every resources, the downloader verifies if the resource was modifed
// on the server before downloading the update. The Downloader maintains a catalogue
// of resource downloaded to be able to check if they need to be updated.
//
// The interface can be used completly synchronously by the application and some
// context or message loop is needed in the implementation of this interface
//
// Note that the Downloader could in theory by implemented on top of JNetwork.
//
//-------------------------------------------------------------------------------------
#include <string>
#include <ostream>
#include <istream>
#include <fstream>
#include <map>
#include "Threading.h"
#ifdef QT_CONFIG
#include <QObject>
#include <QNetworkRequest>
#include <QNetworkReply>
#include <QNetworkAccessManager>
#endif
using namespace std;
class DownloadRequest
#ifdef QT_CONFIG
: public QObject
#endif
{
#ifdef QT_CONFIG
Q_OBJECT
private slots:
#endif
void fileDownloaded();
void downloadProgress(qint64 bytesReceived, qint64 bytesTotal);
#ifdef QT_CONFIG
signals:
void percentChanged(int percent);
void statusChanged(int);
#endif
public:
typedef enum {
NOT_PRESENT,
DOWNLOADING,
DOWNLOADED,
DOWNLOAD_ERROR
} DownloadStatus;
protected:
string mLocalPath;
string mRemoteResourceURL;
// previous one is the original, next one can change after redirection
string mRequestedRemoteResourceURL;
string mETag;
DownloadStatus mDownloadStatus;
bool mUpgradeAvailable;
size_t mTotalSize;
size_t mCurrentSize;
ofstream mFile;
#ifdef QT_CONFIG
QNetworkReply* mNetworkReply;
static QNetworkAccessManager networkAccessManager;
#endif
public:
DownloadRequest(string localPath="",
string remoteResourceURL="",
string ETag = "",
DownloadStatus downloadStatus=NOT_PRESENT,
size_t totalSize = 0,
size_t currentSize = 0);
~DownloadRequest();
static bool NetworkIsAccessible();
string getTempLocalPath() const { return (mLocalPath+".tmp"); };
string getLocalPath() const { return mLocalPath; };
string getRemoteResource() const { return mRemoteResourceURL; };
string getETag() const { return mETag; };
void startGet();
void startHead();
DownloadStatus getDownloadStatus() const { return mDownloadStatus; };
bool upgradeAvailable() const { return mUpgradeAvailable; };
void getSizes(size_t& totalSize, size_t&currentSize) {
totalSize = mTotalSize;
currentSize = mCurrentSize;
};
friend ostream& operator<<(ostream& out, const DownloadRequest& d);
friend istream& operator>>(istream&, DownloadRequest&);
friend class Downloader;
};
class Downloader
{
protected:
Downloader(string globalRemoteURL="", string localCacheRecords="");
virtual ~Downloader();
static Downloader* mInstance;
string mGlobalRemoteURL;
string mLocalCacheRecords;
boost::mutex mMutex;
map<string, DownloadRequest*> mRequestMap;
public:
static Downloader* GetInstance();
static void Release();
void Update();
DownloadRequest* Get(string localPath, string remoteResourceURL="");
friend ostream& operator<<(ostream& out, const Downloader& d);
friend istream& operator>>(istream&, Downloader&);
};
#endif // DOWNLOADER_H

View File

@@ -297,7 +297,6 @@ public:
private:
float mTimer;
float mFrameTime;
JAnimator* mAnimator;
vector<JAnimatorObject *> mObjects;
};

View File

@@ -37,7 +37,6 @@ private:
float mTexY;
float mTexWidth;
float mTexHeight;
JTexture* mTexture;
JQuad* mQuad;

View File

@@ -128,6 +128,7 @@ public:
bool readIntoString(const string & FilePath, string & target);
bool openForWrite(ofstream & File, const string & FilePath, ios_base::openmode mode = ios_base::out );
bool Rename(string from, string to);
bool Remove(string aFile);
//Returns true if strFilename exists somewhere in the fileSystem
bool FileExists(const string& strFilename);
@@ -163,4 +164,4 @@ protected:
#endif
#endif

View File

@@ -44,6 +44,17 @@ typedef WPARAM LocalKeySym;
#include <X11/keysym.h>
typedef KeySym LocalKeySym;
#define LOCAL_KEY_NONE XK_VoidSymbol
#undef Status
#undef Bool
#undef None
#undef CursorShape
#undef KeyPress
#undef KeyRelease
#undef FocusIn
#undef FocusOut
#undef FontChange
#undef Unsorted
#undef GrayScale
#elif defined(ANDROID) // This is temporary until we understand how to send real key events from Java
typedef long unsigned int LocalKeySym;
@@ -383,6 +394,7 @@ class JGE
void SetJNIEnv(JNIEnv * env, jclass cls);
void sendJNICommand(std::string command);
std::string getFileSystemLocation();
std::string getFileUserFolderPath();
#endif
protected:

View File

@@ -30,6 +30,7 @@ const int kInfoMenuID = -200;
const int kRandomPlayerMenuID = -11;
const int kRandomAIPlayerMenuID = -12;
const int kEvilTwinMenuID = -14;
const int kCommanderMenuID = -33;
class JGuiListener
{
@@ -61,7 +62,7 @@ public:
virtual bool ButtonPressed(); // action button pressed, return false to ignore
// Used for mouse support so that the GUI engine can found out which Object was selected
virtual bool getTopLeft(float& top, float& left)
virtual bool getTopLeft(float&, float&)
{
return false;
}
@@ -104,7 +105,7 @@ public:
int mCount;
JGuiController(JGE* jge, int id, JGuiListener* listener);
~JGuiController();
virtual ~JGuiController();
virtual void Render();
virtual void Update(float dt);

View File

@@ -172,13 +172,12 @@ private:
float mHeight;
float mScale;
float mTextureScale;
float mRotation;
float mTracking;
float mSpacing;
PIXEL_TYPE mColor;
int mBlend;
int mBase;
};

View File

@@ -13,34 +13,42 @@ class JSocket;
#include <sstream>
#include "Threading.h"
typedef void(*processCmd)(istream&, ostream&);
typedef void(*processCmd)(void*, stringstream&, stringstream&);
class JNetwork {
private:
private:
boost::thread *mpWorkerThread;
struct CommandStruc{
void* object;
string command;
processCmd processCommand;
};
string serverIP;
int connected_to_ap;
JSocket* socket;
boost::mutex sendMutex;
boost::mutex receiveMutex;
stringstream received;
stringstream toSend;
static map<string, processCmd> sCommandMap;
static map<string, CommandStruc> sCommandMap;
public:
JNetwork();
~JNetwork();
string serverIP;
void Update();
void getServerIp(string& aString);
int connect(string serverIP = "");
int connect(const string& serverIP = "");
bool isConnected();
bool isServer() { return serverIP == ""; };
static void ThreadProc(void* param);
#if !defined (WIN32) && !defined (LINUX)
static int connect_to_apctl(int config);
#endif
bool sendCommand(string command);
static void registerCommand(string command, processCmd processCommand, processCmd processResponse);
private:
boost::thread *mpWorkerThread;
bool sendCommand(const string& command, const string& payload = "", const string& suffix = "Request");
static void registerCommand(string command, void* object, processCmd processRequest, processCmd processResponse);
};
#endif

View File

@@ -578,7 +578,7 @@ private:
#if (!defined PSP)
GLuint mCurrentTex;
#if (defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)
#if ((defined GL_ES_VERSION_2_0) || (defined GL_VERSION_2_0) || (defined WIN32)) && (!defined CONSOLE_CONFIG)
// MVP matrix
ESMatrix theMvpMatrix;
@@ -598,8 +598,6 @@ private:
GLint prog2_positionLoc;
GLint prog2_texCoordLoc;
GLint prog2_colorLoc;
// MVP matrix
ESMatrix prog2_mvpMatrix;
// Uniform locations
GLint prog2_mvpLoc;
@@ -612,13 +610,11 @@ private:
int mCurrentTextureFormat;
#endif
#ifdef PSP
bool mVsync;
int mTexCounter;
#endif
int mSwizzle;
int mTexCounter;
int mCurrentTextureFilter;
int mCurrTexBlendSrc;

View File

@@ -5,6 +5,8 @@
#include "Threading.h"
using namespace std;
#define SERVER_PORT 5001
class JSocket{
public:
typedef enum {
@@ -19,10 +21,11 @@ public:
} SOCKET_STATE;
// Server creation
JSocket(string ipAddr);
// Client creation
JSocket(string ipAddr);
// Server creation
JSocket();
~JSocket();
JSocket* Accept();
@@ -32,6 +35,8 @@ public:
void Disconnect();
private:
// socket state
SOCKET_STATE state;
// socket creation when server accepts a connection
JSocket(int fd);
// convert the socket into non-blocking state
@@ -39,11 +44,9 @@ private:
// socket handle
#ifdef WIN32
SOCKET mfd;
#elif LINUX
#elif LINUX || PSP
int mfd;
#endif
// socket state
SOCKET_STATE state;
};
#endif

View File

@@ -23,29 +23,32 @@
#include "SLES/OpenSLES_Android.h"
#elif defined USE_PHONON
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#else
#ifdef WIN32
#include <windows.h>
#include <phonon/AudioOutput>
#include <phonon/MediaObject>
#elif (defined QT_CONFIG)
#include "QMediaPlayer"
#include "QMediaPlaylist"
#include "QSoundEffect"
#elif defined WIN32
#include <windows.h>
#define WITH_FMOD
#elif defined (PSP)
#include <pspgu.h>
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <time.h>
#include <string.h>
#include <pspaudiolib.h>
#include <psprtc.h>
#include <pspgu.h>
#include <pspkernel.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspctrl.h>
#include <time.h>
#include <string.h>
#include <pspaudiolib.h>
#include <psprtc.h>
#include "JAudio.h"
#include "JMP3.h"
#include "JAudio.h"
#include "JMP3.h"
#endif
#ifdef WITH_FMOD
#include "../Dependencies/include/fmod.h"
#endif
#include "../Dependencies/include/fmod.h"
#endif
//------------------------------------------------------------------------------------------------
@@ -68,7 +71,7 @@ public:
#ifdef USE_PHONON
Phonon::AudioOutput* mOutput;
Phonon::MediaObject* mMediaObject;
public slots:
public slots:
void seekAtTheBegining();
#elif defined (PSP)
JMP3* mTrack;
@@ -83,6 +86,10 @@ public:
SLPlayItf playInterface;
SLSeekItf seekInterface;
SLVolumeItf musicVolumeInterface;
#elif (defined QT_CONFIG)
QMediaPlaylist* playlist;
QMediaPlayer* player;
string fullpath;
#else
void* mTrack;
#endif //WITH_FMOD
@@ -93,13 +100,15 @@ public:
//------------------------------------------------------------------------------------------------
class JSample
{
public:
public:
JSample();
~JSample();
unsigned long fileSize();
#if defined (PSP)
#if (defined QT_CONFIG) && (!defined USE_PHONON)
QMediaPlayer* effect;
void* mSample;
#elif defined (PSP)
WAVDATA *mSample;
#elif defined (IOS)
std::string filename;
@@ -134,126 +143,130 @@ class JSoundSystem
public:
//////////////////////////////////////////////////////////////////////////
/// Get the singleton instance
///
//////////////////////////////////////////////////////////////////////////
static JSoundSystem* GetInstance();
//////////////////////////////////////////////////////////////////////////
/// Get the singleton instance
///
//////////////////////////////////////////////////////////////////////////
static JSoundSystem* GetInstance();
static void Destroy();
static void Destroy();
//////////////////////////////////////////////////////////////////////////
/// Load music.
///
/// @note MP3 is the only supported format for the moment.
///
/// @param filename - Name of the music file.
///
//////////////////////////////////////////////////////////////////////////
JMusic *LoadMusic(const char *fileName);
//////////////////////////////////////////////////////////////////////////
/// Load music.
///
/// @note MP3 is the only supported format for the moment.
///
/// @param filename - Name of the music file.
///
//////////////////////////////////////////////////////////////////////////
JMusic *LoadMusic(const char *fileName);
//////////////////////////////////////////////////////////////////////////
/// Delete music from memory.
///
/// @param music - Music to be deleted.
///
//////////////////////////////////////////////////////////////////////////
//void FreeMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Delete music from memory.
///
/// @param music - Music to be deleted.
///
//////////////////////////////////////////////////////////////////////////
//void FreeMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Play music.
///
/// @param music - Music to be played.
/// @param looping - Play the music in a loop.
///
//////////////////////////////////////////////////////////////////////////
void PlayMusic(JMusic *music, bool looping = false);
//////////////////////////////////////////////////////////////////////////
/// Play music.
///
/// @param music - Music to be played.
/// @param looping - Play the music in a loop.
///
//////////////////////////////////////////////////////////////////////////
void PlayMusic(JMusic *music, bool looping = false);
//////////////////////////////////////////////////////////////////////////
/// Stop playing.
///
/// @param music - Music to be stopped.
///
//////////////////////////////////////////////////////////////////////////
void StopMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Stop playing.
///
/// @param music - Music to be stopped.
///
//////////////////////////////////////////////////////////////////////////
void StopMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Resume playing.
///
/// @param music - Music to be resumed.
///
//////////////////////////////////////////////////////////////////////////
void ResumeMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Resume playing.
///
/// @param music - Music to be resumed.
///
//////////////////////////////////////////////////////////////////////////
void ResumeMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Pause playing.
///
/// @param music - Music to be paused.
///
//////////////////////////////////////////////////////////////////////////
void PauseMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Pause playing.
///
/// @param music - Music to be paused.
///
//////////////////////////////////////////////////////////////////////////
void PauseMusic(JMusic *music);
//////////////////////////////////////////////////////////////////////////
/// Load sound effect.
///
/// @note WAV sound effect only.
///
/// @param fileName - Sound effect for loading.
///
//////////////////////////////////////////////////////////////////////////
JSample *LoadSample(const char *fileName);
//////////////////////////////////////////////////////////////////////////
/// Load sound effect.
///
/// @note WAV sound effect only.
///
/// @param fileName - Sound effect for loading.
///
//////////////////////////////////////////////////////////////////////////
JSample *LoadSample(const char *fileName);
//////////////////////////////////////////////////////////////////////////
/// Delete sound effect from memory.
///
/// @param sample - Sound to be deleted.
///
//////////////////////////////////////////////////////////////////////////
//void FreeSample(JSample *sample);
//////////////////////////////////////////////////////////////////////////
/// Delete sound effect from memory.
///
/// @param sample - Sound to be deleted.
///
//////////////////////////////////////////////////////////////////////////
//void FreeSample(JSample *sample);
//////////////////////////////////////////////////////////////////////////
/// Play sound effect.
///
/// @param sample - Sound for playing.
///
//////////////////////////////////////////////////////////////////////////
void PlaySample(JSample *sample);
//////////////////////////////////////////////////////////////////////////
/// Play sound effect.
///
/// @param sample - Sound for playing.
///
//////////////////////////////////////////////////////////////////////////
void PlaySample(JSample *sample);
//////////////////////////////////////////////////////////////////////////
/// Set volume for audio playback.
///
/// @param volume - New volume.
///
//////////////////////////////////////////////////////////////////////////
void SetVolume(int volume);
//////////////////////////////////////////////////////////////////////////
/// Set volume for audio playback.
///
/// @param volume - New volume.
///
//////////////////////////////////////////////////////////////////////////
void SetVolume(int volume);
void SetMusicVolume(int volume);
void SetMusicVolume(int volume);
void SetSfxVolume(int volume);
void SetSfxVolume(int volume);
int mChannel;
int mChannel;
protected:
JSoundSystem();
~JSoundSystem();
JSoundSystem();
~JSoundSystem();
void InitSoundSystem();
void DestroySoundSystem();
void InitSoundSystem();
void DestroySoundSystem();
private:
JMusic *mCurrentMusic;
#if (defined PSP || defined ANDROID)
JMusic *mCurrentMusic;
JSample *mCurrentSample;
#endif
int mVolume;
int mMusicVolume;
int mSampleVolume;
int mVolume;
#ifndef IOS
int mMusicVolume;
#endif
int mSampleVolume;
static JSoundSystem* mInstance;
static JSoundSystem* mInstance;
};
#endif

View File

@@ -18,12 +18,11 @@ using namespace std;
#define MID_POINT_THRESHOLD 1.0f
//////////////////////////////////////////////////////////////////////////
/// Position of a single dot on screen.
///
//////////////////////////////////////////////////////////////////////////
class Point
class JPoint
{
public:
@@ -34,13 +33,13 @@ public:
/// @param _y - Y position.
///
//////////////////////////////////////////////////////////////////////////
Point(float _x, float _y) { x = _x; y = _y; }
JPoint(float _x, float _y) { x = _x; y = _y; }
//////////////////////////////////////////////////////////////////////////
/// Constructor, set position to default (0.0f, 0.0f)
///
//////////////////////////////////////////////////////////////////////////
Point() { x = 0.0f; y = 0.0f; }
JPoint() { x = 0.0f; y = 0.0f; }
float x; ///< X position.
float y; ///< Y position.
@@ -95,7 +94,7 @@ public:
/// @param pt - Control point.
///
//////////////////////////////////////////////////////////////////////////
void AddControlPoint(const Point &pt);
void AddControlPoint(const JPoint &pt);
//////////////////////////////////////////////////////////////////////////
/// Get a control point of the spline.
@@ -105,7 +104,7 @@ public:
/// @return Control point.
///
//////////////////////////////////////////////////////////////////////////
void GetControlPoint(Point &point, int index);
void GetControlPoint(JPoint &point, int index);
//////////////////////////////////////////////////////////////////////////
/// Work out all pixels of the spline.
@@ -128,7 +127,7 @@ public:
/// @return Position of the desire point.
///
//////////////////////////////////////////////////////////////////////////
void PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3);
void PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3);
//////////////////////////////////////////////////////////////////////////
/// Get a number of pixels for this spline.
@@ -146,7 +145,7 @@ public:
/// @return Position of the desire point.
///
//////////////////////////////////////////////////////////////////////////
void GetPixel(Point &point, int index);
void GetPixel(JPoint &point, int index);
//////////////////////////////////////////////////////////////////////////
/// Render the spline to screen.
@@ -156,8 +155,8 @@ public:
private:
vector<Point> mMidPoints;
vector<Point> mPixels;
vector<JPoint> mMidPoints;
vector<JPoint> mPixels;
int mCount;
};

View File

@@ -39,10 +39,10 @@
#define MAX_CHANNEL 128
enum {
JGE_ERR_CANT_OPEN_FILE = -1,
JGE_ERR_PNG = -2,
JGE_ERR_MALLOC_FAILED = -4,
JGE_ERR_GENERIC = -5,
JGE_ERR_CANT_OPEN_FILE = -1,
JGE_ERR_PNG = -2,
JGE_ERR_MALLOC_FAILED = -4,
JGE_ERR_GENERIC = -5,
};
#ifdef PSP
@@ -75,45 +75,76 @@ enum {
#define SCREEN_HEIGHT_F 272.0f
#ifdef CONSOLE_CONFIG
#define DEFAULT_BLEND 0
#define BLEND_OPTION_ADD 0
#define BLEND_OPTION_BLEND 0
#define BLEND_ZERO 0
#define BLEND_ONE 0
#define BLEND_SRC_COLOR 0
#define BLEND_ONE_MINUS_SRC_COLOR 0
#define BLEND_SRC_ALPHA 0
#define BLEND_ONE_MINUS_SRC_ALPHA 0
#define BLEND_DST_ALPHA 0
#define BLEND_ONE_MINUS_DST_ALPHA 0
#define BLEND_DST_COLOR 0
#define BLEND_ONE_MINUS_DST_COLOR 0
#define BLEND_SRC_ALPHA_SATURATE 0
#define GU_PSM_5551 0
#else
#ifdef WIN32
// #define DEFAULT_BLEND BLEND_DEFAULT
// #define BLEND_OPTION_ADD BLEND_COLORADD
// #define BLEND_OPTION_BLEND (BLEND_COLORADD | BLEND_ALPHABLEND | BLEND_NOZWRITE)
#else
#define DEFAULT_BLEND GU_TFX_MODULATE
#define BLEND_OPTION_ADD GU_TFX_ADD
#define BLEND_OPTION_BLEND GU_TFX_BLEND
#define DEFAULT_BLEND GU_TFX_MODULATE
#define BLEND_OPTION_ADD GU_TFX_ADD
#define BLEND_OPTION_BLEND GU_TFX_BLEND
#endif
#endif // CONSOLE_CONFIG
#if (defined WIN32) && (!defined LINUX)
#include <windows.h>
#endif
#if defined(LINUX) || defined(IOS) || defined (ANDROID)
typedef uint8_t byte;
typedef uint32_t DWORD;
typedef uint8_t BYTE;
#if defined(LINUX) && (!defined WIN32) || defined(IOS) || defined (ANDROID)
typedef uint8_t byte;
typedef uint32_t DWORD;
typedef uint8_t BYTE;
#ifndef IOS
typedef bool BOOL;
typedef bool BOOL;
#endif
#endif
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
#define PIXEL_TYPE DWORD
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#ifndef PSP
#define TEXTURE_FORMAT 0
#endif //PSP
#ifndef CONSOLE_CONFIG
#ifndef QT_CONFIG
#if defined (IOS)
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <OpenGLES/ES1/gl.h>
# import <OpenGLES/ES1/glext.h>
#import <OpenGLES/ES2/gl.h>
#import <OpenGLES/ES2/glext.h>
#import <OpenGLES/ES1/gl.h>
#import <OpenGLES/ES1/glext.h>
#elif defined (ANDROID)
#include <GLES/gl.h>
#include <GLES/glext.h>
#elif defined (WIN32) || defined (LINUX)
#include <GL/gl.h>
#include <GL/glu.h>
#include <GLES/gl.h>
#include <GLES/glext.h>
#elif defined (WIN32) || defined (LINUX)
#include <GL/gl.h>
#include <GL/glu.h>
#endif
#else
# include <QtOpenGL>
#include <QtOpenGL>
#endif
#if (defined FORCE_GLES)
@@ -127,152 +158,115 @@ enum {
#endif
#if defined (PSP)
#ifndef ABGR8888
#define ABGR8888
#endif
#ifndef ABGR8888
#define ABGR8888
#endif
#if defined (ABGR8888)
#define PIXEL_TYPE u32
#ifndef ARGB
#define ARGB(a, r, g, b) (PIXEL_TYPE)((a << 24) | (b << 16) | (g << 8) | r) // macro to assemble pixels in correct format
#endif
#define MAKE_COLOR(a, c) (a << 24 | c)
#define MASK_ALPHA 0xFF000000 // masks for accessing individual pixels
#define MASK_BLUE 0x00FF0000
#define MASK_GREEN 0x0000FF00
#define MASK_RED 0x000000FF
#if defined (ABGR8888)
#ifndef ARGB
#define ARGB(a, r, g, b) (PIXEL_TYPE)((a << 24) | (b << 16) | (g << 8) | r) // macro to assemble pixels in correct format
#endif
#define MAKE_COLOR(a, c) (a << 24 | c)
#define MASK_ALPHA 0xFF000000 // masks for accessing individual pixels
#define MASK_BLUE 0x00FF0000
#define MASK_GREEN 0x0000FF00
#define MASK_RED 0x000000FF
#define PIXEL_SIZE 4
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_8888
#define PIXEL_SIZE 4
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_8888
#define BUFFER_FORMAT GU_PSM_8888
#define TEXTURE_FORMAT GU_PSM_8888
#define TEXTURE_COLOR_FORMAT GU_COLOR_8888
#define BUFFER_FORMAT GU_PSM_8888
#define TEXTURE_FORMAT GU_PSM_8888
#define TEXTURE_COLOR_FORMAT GU_COLOR_8888
#elif defined (ABGR5551)
#elif defined (ABGR5551)
#ifndef ARGB
#define ARGB(a, r, g, b) ((r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15))
#endif
#define MAKE_COLOR(a, c) (((a>>7)<<15) | c)
#define MASK_ALPHA 0x8000
#define MASK_BLUE 0x7C00
#define MASK_GREEN 0x03E0
#define MASK_RED 0x001F
#define PIXEL_TYPE u16
#define PIXEL_SIZE 2
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_5551
#ifndef ARGB
#define ARGB(a, r, g, b) ((r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15))
#endif
#define MAKE_COLOR(a, c) (((a>>7)<<15) | c)
#define MASK_ALPHA 0x8000
#define MASK_BLUE 0x7C00
#define MASK_GREEN 0x03E0
#define MASK_RED 0x001F
#define PIXEL_TYPE u16
#define PIXEL_SIZE 2
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_5551
#define BUFFER_FORMAT GU_PSM_8888
#define TEXTURE_FORMAT GU_PSM_5551
#define TEXTURE_COLOR_FORMAT GU_COLOR_5551
#define BUFFER_FORMAT GU_PSM_8888
#define TEXTURE_FORMAT GU_PSM_5551
#define TEXTURE_COLOR_FORMAT GU_COLOR_5551
#elif defined (ABGR4444)
#ifndef ARGB
#define ARGB(a, r, g, b) ((r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12))
#endif
#define MAKE_COLOR(a, c) (((a>>4)<<12) | c)
#define MASK_ALPHA 0xF000
#define MASK_BLUE 0x0F00
#define MASK_GREEN 0x00F0
#define MASK_RED 0x000F
#define PIXEL_TYPE u16
#define PIXEL_SIZE 2
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_4444
#elif defined (ABGR4444)
#ifndef ARGB
#define ARGB(a, r, g, b) ((r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12))
#endif
#define MAKE_COLOR(a, c) (((a>>4)<<12) | c)
#define MASK_ALPHA 0xF000
#define MASK_BLUE 0x0F00
#define MASK_GREEN 0x00F0
#define MASK_RED 0x000F
#define PIXEL_TYPE u16
#define PIXEL_SIZE 2
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_4444
#define BUFFER_FORMAT GU_PSM_4444
#define TEXTURE_FORMAT GU_PSM_4444
#define TEXTURE_COLOR_FORMAT GU_COLOR_4444
#define BUFFER_FORMAT GU_PSM_4444
#define TEXTURE_FORMAT GU_PSM_4444
#define TEXTURE_COLOR_FORMAT GU_COLOR_4444
#endif
#endif
#define FRAME_BUFFER_WIDTH 512
#define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE
#define FRAME_BUFFER_WIDTH 512
#define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE
#define SLICE_SIZE_F 64.0f
typedef unsigned int DWORD;
#define SLICE_SIZE_F 64.0f
typedef unsigned int DWORD;
#define BLEND_ZERO 0x1000
#define BLEND_ONE 0x1002
#define BLEND_SRC_COLOR GU_SRC_COLOR
#define BLEND_ONE_MINUS_SRC_COLOR GU_ONE_MINUS_SRC_COLOR
#define BLEND_SRC_ALPHA GU_SRC_ALPHA
#define BLEND_ONE_MINUS_SRC_ALPHA GU_ONE_MINUS_SRC_ALPHA
#define BLEND_DST_ALPHA GU_DST_ALPHA
#define BLEND_ONE_MINUS_DST_ALPHA GU_ONE_MINUS_DST_ALPHA
#define BLEND_DST_COLOR GU_DST_COLOR
#define BLEND_ONE_MINUS_DST_COLOR GU_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE BLEND_ONE
#define BLEND_ZERO 0x1000
#define BLEND_ONE 0x1002
#define BLEND_SRC_COLOR GU_SRC_COLOR
#define BLEND_ONE_MINUS_SRC_COLOR GU_ONE_MINUS_SRC_COLOR
#define BLEND_SRC_ALPHA GU_SRC_ALPHA
#define BLEND_ONE_MINUS_SRC_ALPHA GU_ONE_MINUS_SRC_ALPHA
#define BLEND_DST_ALPHA GU_DST_ALPHA
#define BLEND_ONE_MINUS_DST_ALPHA GU_ONE_MINUS_DST_ALPHA
#define BLEND_DST_COLOR GU_DST_COLOR
#define BLEND_ONE_MINUS_DST_COLOR GU_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE BLEND_ONE
typedef struct
{
ScePspFVector2 texture;
ScePspFVector3 pos;
} PSPVertex3D;
typedef struct
{
ScePspFVector2 texture;
ScePspFVector3 pos;
} PSPVertex3D;
#else //non PSP
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
#define BLEND_ZERO GL_ZERO
#define BLEND_ONE GL_ONE
#define BLEND_SRC_COLOR GL_SRC_COLOR
#define BLEND_ONE_MINUS_SRC_COLOR GL_ONE_MINUS_SRC_COLOR
#define BLEND_SRC_ALPHA GL_SRC_ALPHA
#define BLEND_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
#define BLEND_DST_ALPHA GL_DST_ALPHA
#define BLEND_ONE_MINUS_DST_ALPHA GL_ONE_MINUS_DST_ALPHA
#define BLEND_DST_COLOR GL_DST_COLOR
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
#define BLEND_ZERO GL_ZERO
#define BLEND_ONE GL_ONE
#define BLEND_SRC_COLOR GL_SRC_COLOR
#define BLEND_ONE_MINUS_SRC_COLOR GL_ONE_MINUS_SRC_COLOR
#define BLEND_SRC_ALPHA GL_SRC_ALPHA
#define BLEND_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
#define BLEND_DST_ALPHA GL_DST_ALPHA
#define BLEND_ONE_MINUS_DST_ALPHA GL_ONE_MINUS_DST_ALPHA
#define BLEND_DST_COLOR GL_DST_COLOR
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
#define ARGB(a, r, g, b) (((a) << 24) | ((r) << 16) | ((g) << 8) | (b))
#define RGBA(r, g, b, a) (((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#define TEXTURE_FORMAT 0
#define GU_PSM_8888 0
#define GU_PSM_5551 0
#define GU_PSM_4444 0
#define GU_PSM_5650 0
#define PIXEL_TYPE DWORD
#endif
typedef enum Buttons
{
JGE_BTN_NONE = 0, // No button pressed
JGE_BTN_QUIT, // Home on PSP
JGE_BTN_MENU, // Start on PSP
JGE_BTN_CTRL, // Select
JGE_BTN_POWER, // Hold
JGE_BTN_SOUND, // Music note
JGE_BTN_RIGHT,
JGE_BTN_LEFT,
JGE_BTN_UP,
JGE_BTN_DOWN,
JGE_BTN_OK, // Circle in Japan, Cross in Europe
JGE_BTN_CANCEL, // Triangle
JGE_BTN_PRI, // Square (primary)
JGE_BTN_SEC, // Cross or Circle (secondary)
JGE_BTN_PREV, // Left trigger
JGE_BTN_NEXT, // Right trigger
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
} JButton;
#else
typedef uint32_t GLuint;
typedef float GLfloat;
#endif //CONSOLE_CONFIG
//------------------------------------------------------------------------------------------------
struct Vertex
@@ -357,7 +351,7 @@ public:
int mFilter;
#if defined (PSP)
#if defined (PSP)
int mTextureFormat;
int mTexId;
bool mInVideoRAM;
@@ -542,5 +536,28 @@ public:
};
typedef enum Buttons
{
JGE_BTN_NONE = 0, // No button pressed
JGE_BTN_QUIT, // Home on PSP
JGE_BTN_MENU, // Start on PSP
JGE_BTN_CTRL, // Select
JGE_BTN_POWER, // Hold
JGE_BTN_SOUND, // Music note
JGE_BTN_RIGHT,
JGE_BTN_LEFT,
JGE_BTN_UP,
JGE_BTN_DOWN,
JGE_BTN_OK, // Circle in Japan, Cross in Europe
JGE_BTN_CANCEL, // Triangle
JGE_BTN_PRI, // Square (primary)
JGE_BTN_SEC, // Cross or Circle (secondary)
JGE_BTN_PREV, // Left trigger
JGE_BTN_NEXT, // Right trigger
JGE_BTN_FULLSCREEN, // Switch to fullscreen (obviously, PC only)
JGE_BTN_MAX = JGE_BTN_FULLSCREEN + 1
} JButton;
#endif

View File

@@ -0,0 +1,23 @@
#ifndef OUTPUTCAPTURER_H
#define OUTPUTCAPTURER_H
#if defined(QT_CONFIG)
#include <Qt>
#include <string>
#include <sstream>
#include "Threading.h"
class OutputCapturer
{
private:
static std::ostringstream stream;
static boost::mutex mMutex;
public:
static void add(const std::string& s);
static void debugAndClear();
static void clear();
};
#endif
#endif // OUTPUTCAPTURER_H

View File

@@ -1,7 +1,7 @@
#ifndef THREADING_H
#define THREADING_H
#if !defined(PSP) && !defined(QT_CONFIG)
#if !defined(PSP) && !defined(QT_CONFIG) && !(__cplusplus > 199711L)
#include <boost/date_time.hpp>
#ifdef WIN32
@@ -14,7 +14,7 @@
#endif
#include <boost/thread/mutex.hpp>
#elif !defined(QT_CONFIG)
#elif defined(PSP)
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
@@ -26,7 +26,7 @@
namespace boost
{
/**
** PSP specific variant of a boost mutex & scoped_lock
** PSP specific variant of a boost mutex & scoped_lock
*/
template <class Mutex>
@@ -60,7 +60,7 @@ namespace boost
{
sceKernelDeleteSema(mID);
}
void lock()
{
int result = sceKernelWaitSema(mID, 1, 0);
@@ -142,7 +142,7 @@ namespace boost
}
}
int mID;
int mThreadID;
volatile int mRecursionCount;
@@ -164,7 +164,7 @@ namespace boost
/**
** Emulating boost::thread configuration glue, with some shortcuts
** Emulating boost::thread configuration glue, with some shortcuts
** This detail namespace is a distillation of boost's thread.hpp, thread_data.hpp.
*/
namespace detail
@@ -212,13 +212,13 @@ namespace boost
**
** The intent of its usage is this form only:
** mWorkerThread = boost::thread(ThreadProc, this);
** where ThreadProc is a static member function of the 'this' class,eg:
** static void FOO::ThreadProc(void* inParam)
** {
** FOO* instance = reinterpret_cast<FOO*>(inParam);
** // now you have class instance data available...
** }
**
** where ThreadProc is a static member function of the 'this' class,eg:
** static void FOO::ThreadProc(void* inParam)
** {
** FOO* instance = reinterpret_cast<FOO*>(inParam);
** // now you have class instance data available...
** }
**
** Any other variant of a thread proc with more than one param is unimplemented.
*/
class thread
@@ -227,7 +227,7 @@ namespace boost
** Helper class for sceKernelStartThread, which passes args by value, not by reference
** We use this struct to wrap any pointers that we want to pass to the worker thread.
*/
struct CallbackData
struct CallbackData
{
CallbackData(detail::thread_data_ptr inThreadInfo)
: mThreadInfo(inThreadInfo)
@@ -307,15 +307,12 @@ namespace boost
}
}
#elif defined(QT_CONFIG)
#elif defined(QT_CONFIG) && (__cplusplus <= 199711L)
#include <QMutex>
#include <QThread>
#include <QSharedPointer>
#include <boost/bind.hpp>
#include <boost/shared_ptr.hpp>
#include "../include/DebugRoutines.h"
#include "../include/JLogger.h"
namespace boost
@@ -421,23 +418,25 @@ namespace boost
virtual void run() = 0;
};
typedef boost::shared_ptr<detail::thread_data_base> thread_data_ptr;
template<typename F>
typedef QSharedPointer<detail::thread_data_base> thread_data_ptr;
template<typename F, typename A1>
class thread_data : public detail::thread_data_base
{
public:
thread_data(F f_) : f(f_)
thread_data(F f_, A1 a1_) : f(f_), a1(a1_)
{
}
void run()
{
f();
f(a1);
}
private:
F f;
A1 a1;
void operator=(thread_data&);
thread_data(thread_data&);
@@ -494,7 +493,7 @@ namespace boost
}
template <class F,class A1>
thread(F f, A1 a1) : mThreadInfo(make_thread_info(boost::bind(boost::type<void>(), f, a1)))
thread(F f, A1 a1) : mThreadInfo(make_thread_info(f, a1))
{
mpThread = new threadImpl(mThreadInfo);
LOG("Calling start func");
@@ -511,10 +510,10 @@ namespace boost
}
private:
template<typename F>
static inline detail::thread_data_ptr make_thread_info(F f)
template<typename F, typename A1>
static inline detail::thread_data_ptr make_thread_info(F f, A1 a1)
{
return detail::thread_data_ptr(new detail::thread_data<F>(f));
return detail::thread_data_ptr(new detail::thread_data<F, A1>(f, a1));
}
detail::thread_data_ptr mThreadInfo;
@@ -538,6 +537,80 @@ namespace boost
}
}
#elif (__cplusplus > 199711L)
#include <thread>
#include <mutex>
namespace boost
{
typedef std::thread thread;
template <class Mutex>
struct unique_lock
{
unique_lock(Mutex& inMutex) : mMutex(&inMutex)
{
mMutex->lock();
}
~unique_lock()
{
mMutex->unlock();
}
Mutex* mMutex;
};
class mutex
{
public:
typedef unique_lock<mutex> scoped_lock;
mutex()
: mQMutex()
{
}
~mutex()
{
}
void lock()
{
mQMutex.lock();
}
void unlock()
{
mQMutex.unlock();
}
std::mutex mQMutex;
private:
mutex(mutex const&);
mutex& operator=(mutex const&);
};
namespace posix_time
{
typedef unsigned int milliseconds;
}
/**
** boost's platform neutral sleep call.
*/
namespace this_thread
{
inline void sleep(boost::posix_time::milliseconds const& time)
{
std::this_thread::sleep_for(std::chrono::milliseconds(time));
}
}
}
#endif
#endif // THREADING_H

View File

@@ -3,15 +3,6 @@
#include <math.h>
/*************************** Macros and constants ***************************/
// returns a number ranging from -1.0 to 1.0
#define FRAND (((float)rand()-(float)rand())/RAND_MAX)
#define Clamp(x, min, max) x = (x<min ? min : x<max ? x : max);
#define SQUARE(x) (x)*(x)
struct Vector3D
{
Vector3D(float x, float y, float z) : x(x), y(y), z(z) {}
@@ -63,7 +54,7 @@ struct Vector3D
float Length()
{
float length = (float)sqrt(SQUARE(x) + SQUARE(y) + SQUARE(z));
float length = sqrt(x*x + y*y + z*z);
return (length != 0.0f) ? length : 1.0f;
}

View File

@@ -23,6 +23,19 @@
#include <QDBusInterface>
#endif //Q_WS_MAEMO_5
class WagicWrapper
{
public:
WagicWrapper();
virtual ~WagicWrapper();
private:
JGE* m_engine;
JApp* m_app;
JGameLauncher* m_launcher;
};
#ifdef QT_WIDGET
class WagicCore : public QGLWidget
#else
@@ -35,6 +48,7 @@ private:
#else
typedef QDeclarativeItem super;
#endif //QT_WIDGET
void initApp();
public:
Q_OBJECT
@@ -47,7 +61,7 @@ public:
public:
explicit WagicCore(super *parent = 0);
virtual ~WagicCore();
void initApp();
static int runTestSuite();
Q_INVOKABLE void doOK() {
doAndEnqueue(JGE_BTN_OK);
@@ -73,7 +87,7 @@ public:
Q_INVOKABLE qint64 getTick() {
return g_startTimer.elapsed();
};
Q_INVOKABLE void doScroll(int x, int y, int magnitude) {
Q_INVOKABLE void doScroll(int x, int y, int) {
m_engine->Scroll(x, y);
};
int getNominalHeight(){ return SCREEN_HEIGHT;};
@@ -122,6 +136,20 @@ signals:
private slots:
private:
int lastPosx(){
#if QT_VERSION >= 0x050100
return m_lastPos.x()*devicePixelRatio();
#else
return m_lastPos.x();
#endif
}
int lastPosy(){
#if QT_VERSION >= 0x050100
return m_lastPos.y()*devicePixelRatio();
#else
return m_lastPos.y();
#endif
}
void timerEvent( QTimerEvent* );
void doAndEnqueue(JButton action) {
m_engine->HoldKey_NoRepeat(action);
@@ -140,6 +168,7 @@ private:
int m_timerId;
bool m_active;
QRect m_viewPort;
QPoint m_lastPos;
#ifdef QT_WIDGET
#if (defined Q_WS_MAEMO_5) || (defined MEEGO_EDITION_HARMATTAN) || (defined Q_WS_ANDROID)
int mMouseDownX;

BIN
JGE/lib/linux/libhgetools.a Normal file

Binary file not shown.

BIN
JGE/lib/linux/libjge.a Normal file

Binary file not shown.

298
JGE/src/Downloader.cpp Normal file
View File

@@ -0,0 +1,298 @@
#include "DebugRoutines.h"
#include "JFileSystem.h"
#include "Downloader.h"
#define RECORDS_DEFAULT_FILE "cache/records.txt"
#ifdef QT_CONFIG
QNetworkAccessManager DownloadRequest::networkAccessManager;
#endif
DownloadRequest::DownloadRequest(string localPath,
string remoteResourceURL,
string ETag,
DownloadStatus downloadStatus,
size_t totalSize,
size_t currentSize):
mLocalPath(localPath),
mRemoteResourceURL(remoteResourceURL),
mRequestedRemoteResourceURL(remoteResourceURL),
mETag(ETag),
mDownloadStatus(downloadStatus),
mUpgradeAvailable(false),
mTotalSize(totalSize),
mCurrentSize(currentSize)
{
}
DownloadRequest::~DownloadRequest()
{
}
void DownloadRequest::startHead()
{
#ifdef QT_CONFIG
QNetworkRequest request(QUrl(QString(mRequestedRemoteResourceURL.c_str())));
request.setRawHeader("If-None-Match", mETag.c_str());
mNetworkReply = networkAccessManager.head(request);
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
#endif
}
void DownloadRequest::startGet()
{
#ifdef QT_CONFIG
mNetworkReply = networkAccessManager.get(QNetworkRequest(QUrl(QString(mRequestedRemoteResourceURL.c_str()))));
#endif
mFile.close();
JFileSystem::GetInstance()->Remove(getTempLocalPath());
JFileSystem::GetInstance()->openForWrite(mFile, getTempLocalPath());
#ifdef QT_CONFIG
connect(mNetworkReply, SIGNAL(downloadProgress(qint64, qint64)),
SLOT(downloadProgress(qint64, qint64)));
connect(mNetworkReply, SIGNAL(finished()), SLOT(fileDownloaded()));
#endif
}
void DownloadRequest::fileDownloaded()
{
do {
QByteArray eTagByteArray = mNetworkReply->rawHeader("ETag");
if(!eTagByteArray.isEmpty()) {
string oldETag = mETag;
mETag = QString(eTagByteArray).toStdString();
if(oldETag!="" && oldETag != mETag)
mUpgradeAvailable = true;
}
// let's check some error
if(mNetworkReply->error() != QNetworkReply::NoError) {
DebugTrace(mNetworkReply->errorString().toStdString());
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
mFile.close();
JFileSystem::GetInstance()->Remove(getTempLocalPath());
break;
}
// check if we're getting redirected
QVariant redirectionTarget = mNetworkReply->attribute(QNetworkRequest::RedirectionTargetAttribute);
if (!redirectionTarget.isNull()) {
QUrl newUrl = QUrl(mRequestedRemoteResourceURL.c_str()).resolved(redirectionTarget.toUrl());
DebugTrace(string("Redirect to ")+ newUrl.toString().toStdString());
mRequestedRemoteResourceURL = newUrl.toString().toStdString();
mNetworkReply->deleteLater();
if(mFile.is_open())
startGet();
else
startHead();
return;
}
if(mFile.is_open())
{
QByteArray byteArray = mNetworkReply->readAll();
mFile.write(byteArray.constData(), byteArray.size());
mFile.close();
if(!JFileSystem::GetInstance()->Rename(getTempLocalPath(), mLocalPath)) {
mDownloadStatus = DownloadRequest::DOWNLOAD_ERROR;
break;
}
}
mDownloadStatus = DownloadRequest::DOWNLOADED;
} while(0);
Downloader::GetInstance()->Update();
mNetworkReply->deleteLater();
emit statusChanged((int)mDownloadStatus);
}
void DownloadRequest::downloadProgress(qint64 bytesReceived, qint64 bytesTotal)
{
QByteArray byteArray = mNetworkReply->readAll();
mFile.write(byteArray.constData(), byteArray.size());
mCurrentSize = bytesReceived;
mTotalSize = bytesTotal;
int percent = 0;
if(bytesTotal)
percent = (bytesReceived/bytesTotal)*100;
emit percentChanged(percent);
}
Downloader* Downloader::mInstance = 0;
Downloader::Downloader(string globalRemoteURL, string localcacheRecords):
mGlobalRemoteURL(globalRemoteURL),
mLocalCacheRecords(localcacheRecords)
{
JFileSystem::GetInstance()->MakeDir("cache");
izfstream downloadRecords;
if(mLocalCacheRecords.empty())
mLocalCacheRecords = RECORDS_DEFAULT_FILE;
if(JFileSystem::GetInstance()->openForRead(downloadRecords, mLocalCacheRecords))
{// File exists, let's read it.
downloadRecords >> (*this);
}
JFileSystem::GetInstance()->CloseFile();
}
Downloader::~Downloader()
{
map<string, DownloadRequest*>::iterator ite;
for(ite = mRequestMap.begin(); ite != mRequestMap.end(); ite++)
{
delete (*ite).second;
}
mRequestMap.erase(mRequestMap.begin(), mRequestMap.end());
}
Downloader* Downloader::GetInstance()
{
if(!mInstance)
{
mInstance = new Downloader();
}
return mInstance;
}
void Downloader::Release()
{
if(mInstance)
{
delete mInstance;
mInstance = 0;
}
}
bool DownloadRequest::NetworkIsAccessible()
{
bool result = false;
#ifdef QT_CONFIG
networkAccessManager.setNetworkAccessible(QNetworkAccessManager::Accessible);
result = networkAccessManager.networkAccessible();
#endif
return result;
}
DownloadRequest* Downloader::Get(string localPath, string remoteResourceURL)
{
map<string, DownloadRequest*>::iterator ite = mRequestMap.find(localPath);
if(ite == mRequestMap.end())
{ // request does not exist, let's create it
DownloadRequest* request = new DownloadRequest(localPath, remoteResourceURL);
std::pair<std::map<string,DownloadRequest*>::iterator,bool> ret;
ret = mRequestMap.insert ( std::pair<string,DownloadRequest*>(localPath, request) );
if (ret.second==false) {
DebugTrace("Downloader::Get Error inserting request in Map");
return 0;
}
ite = ret.first;
}
// Now, we can check the server
if((*ite).second->getDownloadStatus() == DownloadRequest::NOT_PRESENT ||
(*ite).second->upgradeAvailable())
{ // File is not here or an update is available, let's get it
(*ite).second->startGet();
(*ite).second->mDownloadStatus = DownloadRequest::DOWNLOADING;
}
else if ((*ite).second->getDownloadStatus() == DownloadRequest::DOWNLOADED)
{ // File is here, let's check if there is some update without blocking the playback
(*ite).second->startHead();
}
return (*ite).second;
}
void Downloader::Update()
{
ofstream downloadRecords;
if(JFileSystem::GetInstance()->openForWrite(downloadRecords, mLocalCacheRecords))
{
downloadRecords << (*this);
}
downloadRecords.close();
}
ostream& operator<<(ostream& out, const DownloadRequest& d)
{
// HEAD request fails, so this line erase cache record after upgrade check :(
// if(d.getDownloadStatus() == DownloadRequest::DOWNLOADED)
{
out << "localPath=" << d.mLocalPath << endl;
out << "remoteResource=" << d.mRemoteResourceURL << endl;
out << "ETag=" << d.mETag << endl;
out << "upgradeAvailable=" << d.mUpgradeAvailable <<endl;
}
return out;
}
istream& operator>>(istream& in, DownloadRequest& d)
{
string s;
while(std::getline(in, s))
{
size_t limiter = s.find("=");
string areaS;
if (limiter != string::npos)
{
areaS = s.substr(0, limiter);
if (areaS.compare("localPath") == 0)
{
d.mLocalPath = s.substr(limiter + 1);
}
else if (areaS.compare("remoteResource") == 0)
{
d.mRemoteResourceURL = s.substr(limiter + 1);
d.mRequestedRemoteResourceURL = d.mRemoteResourceURL;
}
else if (areaS.compare("ETag") == 0)
{
d.mETag = s.substr(limiter + 1);
d.mDownloadStatus = DownloadRequest::DOWNLOADED;
}
else if (areaS.compare("upgradeAvailable") == 0)
{
d.mUpgradeAvailable = (bool)atoi(s.substr(limiter + 1).c_str());
break;
}
}
}
return in;
}
ostream& operator<<(ostream& out, const Downloader& d)
{
map<string, DownloadRequest*>::const_iterator ite;
for(ite = d.mRequestMap.begin(); ite != d.mRequestMap.end(); ite++)
{
out << (*(*ite).second) << endl;
}
return out;
}
istream& operator>>(istream& in, Downloader& d)
{
while(!in.eof())
{
DownloadRequest* downloadRequest = new DownloadRequest();
in >> (*downloadRequest);
if(!downloadRequest->getLocalPath().empty() &&
!downloadRequest->getRemoteResource().empty() &&
!downloadRequest->getETag().empty()) {
d.mRequestMap[downloadRequest->getLocalPath()] = downloadRequest;
} else {
delete downloadRequest;
}
}
return in;
}

View File

@@ -67,7 +67,7 @@ bool JAnimator::Load(const char* scriptFile)
element = script->ToElement();
printf("---- Loading %s:%s\n", element->Value(), element->Attribute("name"));
const char *type[] =
string type[] =
{
"ANIMATION_TYPE_LOOPING",
"ANIMATION_TYPE_ONCE_AND_STAY",
@@ -78,7 +78,7 @@ bool JAnimator::Load(const char* scriptFile)
const char* aniType = element->Attribute("type");
for (int i=0;i<5;i++)
if (strcmp(type[i], aniType)==0)
if (type[i] == aniType)
{
SetAnimationType(i);
break;
@@ -108,7 +108,7 @@ bool JAnimator::Load(const char* scriptFile)
element = param->ToElement();
if (element != NULL)
{
if (strcmp(element->Value(), "settings")==0)
if (element->ValueStr() == "settings")
{
const char* quadName = element->Attribute("quad");
JQuad* quad = mResource->GetQuad(quadName);

View File

@@ -16,9 +16,14 @@ User folder is the only one that is really needed to guarantee both read and wri
The content that users should not be touching.
*/
#if defined(ANDROID)
#include "../../include/PrecompiledHeader.h"
#endif
#if defined (ANDROID)
#include "PrecompiledHeader.h"
#endif //ANDROID
#if defined (LINUX)
#include "../../projects/mtg/include/PrecompiledHeader.h"
#endif //LINUX
#ifdef WIN32
#pragma warning(disable : 4786)
@@ -34,6 +39,16 @@ The content that users should not be touching.
#include "../include/JLogger.h"
#include <dirent.h>
#ifdef QT_CONFIG
#include <QDir>
#endif
/*
#ifdef IOS
#include <Foundation/Foundation.h>
#endif
*/
JFileSystem* JFileSystem::mInstance = NULL;
JZipCache::JZipCache()
@@ -116,16 +131,24 @@ JFileSystem::JFileSystem(const string & _userPath, const string & _systemPath)
systemPath = [[documentsDirectory stringByAppendingString: @"/Res/"] cStringUsingEncoding:1];
#elif defined (ANDROID)
userPath = JGE::GetInstance()->getFileSystemLocation();
systemPath = "";
userPath = JGE::GetInstance()->getFileUserFolderPath();
systemPath = JGE::GetInstance()->getFileSystemLocation();
DebugTrace("User path " << userPath);
DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath);
#elif defined (QT_CONFIG)
QDir sysDir(RESDIR);
QDir dir(QDir::homePath());
dir.mkdir(USERDIR);
dir.cd(USERDIR);
userPath = QDir::toNativeSeparators(dir.absolutePath()).toStdString();
systemPath = "";
systemPath = QDir::toNativeSeparators(sysDir.absolutePath()).toStdString();
DebugTrace("User path " << userPath);
DebugTrace("System path " << systemPath);
DebugTrace("Current path " << QDir::currentPath().toStdString());
#else
//Find the Res.txt file and matching Res folders for backwards compatibility
ifstream mfile("Res.txt");
@@ -237,14 +260,15 @@ void JFileSystem::clearZipCache()
bool JFileSystem::AttachZipFile(const string &zipfile, char *password /* = NULL */)
{
if (mZipAvailable && mZipFile != NULL)
#ifndef WIN32
if (mZipAvailable && mZipFile.is_open())
{
if (mZipFileName != zipfile)
DetachZipFile(); // close the previous zip file
else
return true;
}
#endif
mZipFileName = zipfile;
mPassword = password;
@@ -302,11 +326,15 @@ bool JFileSystem::readIntoString(const string & FilePath, string & target)
int fileSize = GetFileSize(file);
#ifndef __MINGW32__
try {
#endif
target.resize((std::string::size_type) fileSize);
#ifndef __MINGW32__
} catch (bad_alloc&) {
return false;
}
#endif
if (fileSize)
@@ -320,6 +348,36 @@ bool JFileSystem::openForWrite(ofstream & File, const string & FilePath, ios_bas
{
string filename = mUserFSPath;
filename.append(FilePath);
#if defined(ANDROID)
DebugTrace("ANDROID");
std::vector<string> dirs;
string path = filename.substr( 0, filename.find_last_of( '/' ) + 1 );
// put it into list
dirs.push_back(path);
//make list of directories that need to be created
do
{
path = path.substr( 0, path.find_last_of( '/', path.size() - 2 ) + 1 );
dirs.push_back(path);
} while (path.compare(mUserFSPath) != 0);
// remove mUserFSPath from list
dirs.pop_back();
// create missing directories
for (std::vector<string>::reverse_iterator it = dirs.rbegin(); it != dirs.rend(); ++it)
{
if(!DirExists(*it))
{
MAKEDIR((*it).c_str());
}
}
#endif
File.open(filename.c_str(), mode);
if (File)
@@ -512,7 +570,13 @@ bool JFileSystem::Rename(string _from, string _to)
string from = mUserFSPath + _from;
string to = mUserFSPath + _to;
std::remove(to.c_str());
return rename(from.c_str(), to.c_str()) ? true: false;
return (rename(from.c_str(), to.c_str()) == 0);
}
bool JFileSystem::Remove(string aFile)
{
string toRemove = mUserFSPath + aFile;
return (std::remove(toRemove.c_str()) == 0);
}
int JFileSystem::GetFileSize(izfstream & file)

View File

@@ -249,6 +249,7 @@ u32 JGE::BindKey(LocalKeySym sym, JButton button)
u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
{
for (keycodes_it it = keyBinds.begin(); it != keyBinds.end(); )
{
if (sym == it->first && button == it->second)
{
keycodes_it er = it;
@@ -256,7 +257,8 @@ u32 JGE::UnbindKey(LocalKeySym sym, JButton button)
keyBinds.erase(er);
}
else ++it;
return keyBinds.size();
}
return keyBinds.size();
}
u32 JGE::UnbindKey(LocalKeySym sym)
@@ -591,6 +593,8 @@ void JGE::SendCommand(string command)
sendJNICommand(command);
#elif defined (IOS)
SendCommand(command, "");
#else
cerr << command;
#endif
}
@@ -602,6 +606,8 @@ void JGE::SendCommand(std::string command, std::string parameter)
[delegate handleWEngineCommand:[NSString stringWithCString: command.c_str() encoding: NSUTF8StringEncoding]
withParameter: [NSString stringWithCString: parameter.c_str() encoding:NSUTF8StringEncoding]];
#else
cerr << command << " " << parameter;
#endif
}
@@ -613,6 +619,8 @@ void JGE::SendCommand(std::string command, float& x, float& y, float& width, flo
#elif IOS
wagicAppDelegate *delegate = [[UIApplication sharedApplication] delegate];
[delegate handleWEngineCommand: [NSString stringWithCString: command.c_str() encoding: NSUTF8StringEncoding] withUIParameters: x yCoordinate: y width: width height: height];
#else
cerr << command << " " << x << " " << y << " " << width << " " << height;
#endif
}
@@ -656,12 +664,11 @@ JNIEnv * JGE::getJNIEnv()
string JGE::getFileSystemLocation()
{
char result[512];
JNIEnv * env = getJNIEnv();
if (env == NULL)
{
DebugTrace("An Error Occurred in getting the JNI Environment whie trying to get the system folder location. Defaulting to /mnt/sdcard/net.wagic.app/Wagic");
return "/mnt/sdcard/Wagic";
return "/mnt/sdcard/Wagic/Res";
};
jclass jniClass = env->FindClass("org/libsdl/app/SDLActivity");
@@ -670,7 +677,36 @@ string JGE::getFileSystemLocation()
if (methodId == 0)
{
DebugTrace("An Error Occurred in getting the JNI methodID for getSystemFolderPath. Defaulting to /mnt/sdcard/Wagic");
return "/mnt/sdcard/Wagic";
return "/mnt/sdcard/Wagic/Res";
};
jstring systemPath = (jstring) env->CallStaticObjectMethod(jniClass, methodId);
// Now convert the Java String to C++ char array
const char* cstr = env->GetStringUTFChars(systemPath, 0);
string retVal (cstr);
env->ReleaseStringUTFChars(systemPath, cstr);
env->DeleteLocalRef(systemPath);
return retVal;
}
string JGE::getFileUserFolderPath()
{
JNIEnv * env = getJNIEnv();
if (env == NULL)
{
DebugTrace("An Error Occurred in getting the JNI Environment whie trying to get the system folder location. Defaulting to /mnt/sdcard/net.wagic.app/Wagic");
return "/mnt/sdcard/Wagic/User";
};
jclass jniClass = env->FindClass("org/libsdl/app/SDLActivity");
jmethodID methodId = env->GetStaticMethodID( jniClass, "getUserFolderPath", "()Ljava/lang/String;");
if (methodId == 0)
{
DebugTrace("An Error Occurred in getting the JNI methodID for getSystemFolderPath. Defaulting to /mnt/sdcard/Wagic");
return "/mnt/sdcard/Wagic/User";
};
jstring systemPath = (jstring) env->CallStaticObjectMethod(jniClass, methodId);

506
JGE/src/JGfx-fake.cpp Normal file
View File

@@ -0,0 +1,506 @@
//-------------------------------------------------------------------------------------
//
// JGE++ is a hardware accelerated 2D game SDK for PSP/Windows.
#include "../../include/JGE.h"
#include "../../include/JRenderer.h"
#include "../../include/JResourceManager.h"
#include "../../include/JFileSystem.h"
#include "../../include/JAssert.h"
JQuad::JQuad(JTexture *tex, float x, float y, float width, float height)
:mTex(tex), mX(x), mY(y), mWidth(width), mHeight(height)
{
JASSERT(tex != NULL);
JRenderer::GetInstance()->TransferTextureToGLContext(*tex);
mHotSpotX = 0.0f;
mHotSpotY = 0.0f;
//mBlend = BLEND_DEFAULT;
for (int i=0;i<4;i++)
mColor[i].color = 0xFFFFFFFF;
mHFlipped = false;
mVFlipped = false;
SetTextureRect(x, y, width, height);
}
void JQuad::SetTextureRect(float x, float y, float w, float h)
{
mX = x;
mY = y;
mWidth = w;
mHeight = h;
if(mTex)
{
mTX0 = x/mTex->mTexWidth;
mTY0 = y/mTex->mTexHeight;
mTX1 = (x+w)/mTex->mTexWidth;
mTY1 = (y+h)/mTex->mTexHeight;
}
}
void JQuad::GetTextureRect(float *x, float *y, float *w, float *h)
{
*x=mX; *y=mY; *w=mWidth; *h=mHeight;
}
void JQuad::SetColor(PIXEL_TYPE color)
{
for (int i=0;i<4;i++)
mColor[i].color = color;
}
void JQuad::SetHotSpot(float x, float y)
{
mHotSpotX = x;
mHotSpotY = y;
}
//////////////////////////////////////////////////////////////////////////
JTexture::JTexture() : mWidth(0), mHeight(0), mBuffer(NULL)
{
mTexId = -1;
}
JTexture::~JTexture()
{
if (mBuffer)
{
delete [] mBuffer;
mBuffer = NULL;
}
}
void JTexture::UpdateBits(int x, int y, int width, int height, PIXEL_TYPE* bits)
{
JRenderer::GetInstance()->BindTexture(this);
}
//////////////////////////////////////////////////////////////////////////
JRenderer* JRenderer::mInstance = NULL;
bool JRenderer::m3DEnabled = false;
void JRenderer::Set3DFlag(bool flag) { m3DEnabled = flag; }
JRenderer* JRenderer::GetInstance()
{
if (mInstance == NULL)
{
mInstance = new JRenderer();
JASSERT(mInstance != NULL);
mInstance->InitRenderer();
}
return mInstance;
}
void JRenderer::Destroy()
{
if (mInstance)
{
mInstance->DestroyRenderer();
delete mInstance;
mInstance = NULL;
}
}
JRenderer::JRenderer() : mActualWidth(SCREEN_WIDTH_F), mActualHeight(SCREEN_HEIGHT_F)
{
}
JRenderer::~JRenderer()
{
}
void JRenderer::InitRenderer()
{
mCurrentTextureFilter = TEX_FILTER_NONE;
mImageFilter = NULL;
mCurrTexBlendSrc = BLEND_SRC_ALPHA;
mCurrTexBlendDest = BLEND_ONE_MINUS_SRC_ALPHA;
// mLineWidth = 1.0f;
mCurrentTex = -1;
mFOV = 75.0f;
#ifdef USING_MATH_TABLE
for (int i=0;i<360;i++)
{
mSinTable[i] = sinf(i*DEG2RAD);
mCosTable[i] = cosf(i*DEG2RAD);
}
#endif
mCurrentRenderMode = MODE_UNKNOWN;
}
void JRenderer::DestroyRenderer()
{
}
void JRenderer::BeginScene()
{
}
void JRenderer::EndScene()
{
}
void JRenderer::BindTexture(JTexture *tex)
{
}
void JRenderer::EnableTextureFilter(bool flag)
{
if (flag)
mCurrentTextureFilter = TEX_FILTER_LINEAR;
else
mCurrentTextureFilter = TEX_FILTER_NEAREST;
mCurrentTex = -1;
}
void Swap(float *a, float *b)
{
float n=*a;
*a = *b;
*b = n;
}
void JRenderer::RenderQuad(JQuad* quad, float xo, float yo, float angle, float xScale, float yScale)
{
//yo = SCREEN_HEIGHT-yo-1;//-(quad->mHeight);
float width = quad->mWidth;
float height = quad->mHeight;
float x = -quad->mHotSpotX;
float y = quad->mHotSpotY;
Vector2D pt[4];
pt[3] = Vector2D(x, y);
pt[2] = Vector2D(x+width, y);
pt[1] = Vector2D(x+width, y-height);
pt[0] = Vector2D(x, y-height);
Vector2D uv[4];
uv[0] = Vector2D(quad->mTX0, quad->mTY1);
uv[1] = Vector2D(quad->mTX1, quad->mTY1);
uv[2] = Vector2D(quad->mTX1, quad->mTY0);
uv[3] = Vector2D(quad->mTX0, quad->mTY0);
if (quad->mHFlipped)
{
Swap(&uv[0].x, &uv[1].x);
Swap(&uv[2].x, &uv[3].x);
}
if (quad->mVFlipped)
{
Swap(&uv[0].y, &uv[2].y);
Swap(&uv[1].y, &uv[3].y);
}
BindTexture(quad->mTex);
yo = SCREEN_HEIGHT_F - yo;
}
void JRenderer::RenderQuad(JQuad* quad, VertexColor* pt)
{
for (int i=0;i<4;i++)
{
pt[i].y = SCREEN_HEIGHT_F - pt[i].y;
quad->mColor[i].color = pt[i].color;
}
Vector2D uv[4];
uv[0] = Vector2D(quad->mTX0, quad->mTY1);
uv[1] = Vector2D(quad->mTX1, quad->mTY1);
uv[2] = Vector2D(quad->mTX1, quad->mTY0);
uv[3] = Vector2D(quad->mTX0, quad->mTY0);
BindTexture(quad->mTex);
}
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE color)
{
y = SCREEN_HEIGHT_F - y - height;
JColor col;
col.color = color;
}
void JRenderer::DrawRect(float x, float y, float width, float height, PIXEL_TYPE color)
{
y = SCREEN_HEIGHT_F - y - height;
JColor col;
col.color = color;
}
void JRenderer::FillRect(float x, float y, float width, float height, PIXEL_TYPE* colors)
{
JColor col[4];
for (int i=0;i<4;i++)
col[i].color = colors[i];
FillRect(x, y, width, height, col);
}
void JRenderer::FillRect(float x, float y, float width, float height, JColor* colors)
{
y = SCREEN_HEIGHT_F - y - height;
}
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, PIXEL_TYPE color)
{
// glLineWidth (mLineWidth);
JColor col;
col.color = color;
}
void JRenderer::Plot(float x, float y, PIXEL_TYPE color)
{
}
void JRenderer::PlotArray(float *x, float *y, int count, PIXEL_TYPE color)
{
}
void JRenderer::ScreenShot(const char* filename __attribute__((unused)))
{
}
void JRenderer::TransferTextureToGLContext(JTexture& inTexture)
{
}
JTexture* JRenderer::CreateTexture(int width, int height, int mode __attribute__((unused)))
{
JTexture *tex = new JTexture();
return tex;
}
JTexture* JRenderer::LoadTexture(const char* filename, int mode, int textureFormat)
{
JTexture *tex = new JTexture();
return tex;
}
void JRenderer::EnableVSync(bool flag __attribute__((unused)))
{
// if (flag)
// hge->System_SetState(HGE_FPS, 60); // HGEFPS_VSYNC
// else
// hge->System_SetState(HGE_FPS, HGEFPS_UNLIMITED);
}
void JRenderer::ClearScreen(PIXEL_TYPE color)
{
}
void JRenderer::SetTexBlend(int src, int dest)
{
}
void JRenderer::SetTexBlendSrc(int src)
{
}
void JRenderer::SetTexBlendDest(int dest)
{
}
void JRenderer::Enable2D()
{
}
void JRenderer::Enable3D()
{ /* NOT USED
if (!m3DEnabled)
return;
if (mCurrentRenderMode == MODE_3D)
return;
mCurrentRenderMode = MODE_3D;
glViewport (0, 0, (GLsizei)SCREEN_WIDTH, (GLsizei)SCREEN_HEIGHT); // Reset The Current Viewport
glMatrixMode (GL_PROJECTION); // Select The Projection Matrix
glLoadIdentity (); // Reset The Projection Matrix
gluPerspective (mFOV, (GLfloat)SCREEN_WIDTH/(GLfloat)SCREEN_HEIGHT, // Calculate The Aspect Ratio Of The Window
0.5f, 1000.0f);
glMatrixMode (GL_MODELVIEW); // Select The Modelview Matrix
glLoadIdentity (); // Reset The Modelview Matrix
glEnable (GL_DEPTH_TEST); */
}
void JRenderer::SetClip(int, int, int, int)
{// NOT USED
//glScissor(x, y, width, height);
}
void JRenderer::LoadIdentity()
{// NOT USED
//glLoadIdentity();
}
void JRenderer::Translate(float, float, float)
{// NOT USED
//glTranslatef(x, y, z);
}
void JRenderer::RotateX(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 1.0f, 0.0f, 0.0f);
}
void JRenderer::RotateY(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 0.0f, 1.0f, 0.0f);
}
void JRenderer::RotateZ(float)
{// NOT USED
//glRotatef(angle*RAD2DEG, 0.0f, 0.0f, 1.0f);
}
void JRenderer::PushMatrix()
{// NOT USED
//glPushMatrix();
}
void JRenderer::PopMatrix()
{// NOT USED
//glPopMatrix();
}
void JRenderer::RenderTriangles(JTexture* texture, Vertex3D *vertices, int start, int count)
{
}
void JRenderer::SetFOV(float fov)
{
mFOV = fov;
}
void JRenderer::FillPolygon(float* x, float* y, int count, PIXEL_TYPE color)
{
}
void JRenderer::DrawPolygon(float* x, float* y, int count, PIXEL_TYPE color)
{
}
void JRenderer::DrawLine(float x1, float y1, float x2, float y2, float lineWidth, PIXEL_TYPE color)
{
float dy=y2-y1;
float dx=x2-x1;
if(dy==0 && dx==0)
return;
float l=(float)hypot(dx,dy);
float x[4];
float y[4];
x[0]=x1+lineWidth*(y2-y1)/l;
y[0]=y1-lineWidth*(x2-x1)/l;
x[1]=x1-lineWidth*(y2-y1)/l;
y[1]=y1+lineWidth*(x2-x1)/l;
x[2]=x2-lineWidth*(y2-y1)/l;
y[2]=y2+lineWidth*(x2-x1)/l;
x[3]=x2+lineWidth*(y2-y1)/l;
y[3]=y2-lineWidth*(x2-x1)/l;
FillPolygon(x, y, 4, color);
}
void JRenderer::DrawCircle(float x, float y, float radius, PIXEL_TYPE color)
{
}
void JRenderer::FillCircle(float x, float y, float radius, PIXEL_TYPE color)
{
}
void JRenderer::DrawPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
{
}
void JRenderer::FillPolygon(float x, float y, float size, int count, float startingAngle, PIXEL_TYPE color)
{
}
void JRenderer::SetImageFilter(JImageFilter* imageFilter)
{
mImageFilter = imageFilter;
}
void JRenderer::DrawRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
{
}
void JRenderer::FillRoundRect(float x, float y, float w, float h, float radius, PIXEL_TYPE color)
{
}

View File

@@ -197,7 +197,7 @@ bool JGuiController::CheckUserInput(JButton key)
mObjects[mCurr]->Entering();
}
mEngine->LeftClickedProcessed();
mEngine->ResetInput();
mEngine->ResetInput();
return true;
}
mEngine->LeftClickedProcessed();

View File

@@ -49,12 +49,13 @@ JLBFont::JLBFont(const char *fontname, int lineheight, bool useVideoRAM)
sprintf(filename, "%s.png", fontname);
mTexture = mRenderer->LoadTexture(filename, useVideoRAM);
mTextureScale = (float) lineheight/ (mTexture->mHeight/16);
if (mTexture == NULL) return;
if (mTexture == NULL) return;
mHeight = (float) lineheight;
mQuad = new JQuad(mTexture, 0.0f, 0.0f, 16.0f, mHeight);
mQuad = new JQuad(mTexture, 0.0f, 0.0f, 16.0f/mTextureScale, mHeight/mTextureScale);
float a, b, c;
@@ -158,7 +159,7 @@ void JLBFont::DrawString(const char *string, float x, float y, int align, float
index = (*p - 32)+mBase;
float charWidth = mCharWidth[index];
float charWidth = mCharWidth[index]*mTextureScale;
float delta = (charWidth + mTracking) * mScale;
float xPos = mXPos[index];
if (leftOffset)
@@ -194,8 +195,8 @@ void JLBFont::DrawString(const char *string, float x, float y, int align, float
charWidth = (delta/mScale) - mTracking;
}
}
mQuad->SetTextureRect(xPos, mYPos[index], charWidth , mHeight);
mRenderer->RenderQuad(mQuad, dx, dy, mRotation, mScale, mScale);
mQuad->SetTextureRect(xPos, mYPos[index], charWidth/mTextureScale, mHeight/mTextureScale);
mRenderer->RenderQuad(mQuad, dx, dy, mRotation, mScale*mTextureScale, mScale*mTextureScale);
dx += delta;
p++;
}
@@ -235,7 +236,7 @@ float JLBFont::GetStringWidth(const char *string) const
ch = *p - 32;
p++;
if (ch < 0) continue;
len += mCharWidth[ch+mBase] + mTracking;
len += (mCharWidth[ch+mBase]*mTextureScale) + mTracking;
}
len -= mTracking;
return len*mScale;

View File

@@ -257,6 +257,8 @@ void JMD2Model::CalculateNormal(float *p1, float *p2, float *p3)
#else
// FIXME
#endif
#else
cerr << p1 << " " << p2 << " " << p3 << endl;
#endif
}

View File

@@ -33,15 +33,43 @@
#include <sstream>
#include "../include/JSocket.h"
map<string, processCmd> JNetwork::sCommandMap;
map<string, JNetwork::CommandStruc> JNetwork::sCommandMap;
bool JNetwork::isConnected(){
if (connected_to_ap !=1) return false;
if (connected_to_ap !=1 || !socket) return false;
return socket->isConnected();
}
void JNetwork::getServerIp(string& aString)
{
#ifdef WIN32
char ac[80];
if (gethostname(ac, sizeof(ac)) == SOCKET_ERROR) {
DebugTrace("Error " << WSAGetLastError() <<
" when getting local host name.\n");
return;
}
DebugTrace( "Host name is " << ac << ".\n");
struct hostent *phe = gethostbyname(ac);
if (phe == 0) {
DebugTrace("Yow! Bad host lookup.\n");
return;
}
for (int i = 0; phe->h_addr_list[i] != 0; ++i) {
struct in_addr addr;
memcpy(&addr, phe->h_addr_list[i], sizeof(struct in_addr));
aString = inet_ntoa(addr);
}
#else
aString = "No clue";
#endif
}
JNetwork::JNetwork()
: mpWorkerThread(NULL)
: mpWorkerThread(NULL), socket(0)
{
#if (defined WIN32) || (defined LINUX)
connected_to_ap = 1;
@@ -62,30 +90,68 @@ JNetwork::~JNetwork()
delete socket;
}
bool JNetwork::sendCommand(string xString)
bool JNetwork::sendCommand(const string& xString, const string& payload, const string& suffix)
{
string aString = xString;
string aString;
boost::mutex::scoped_lock l(sendMutex);
if(!socket) {
DebugTrace("sendCommand failed: no sockeet");
DebugTrace("sendCommand failed: no socket");
return false;
}
aString = aString + "Command";
aString = xString + suffix;
if(sCommandMap.find(aString) == sCommandMap.end()) {
DebugTrace("sendCommand failed: command not registered");
return false;
}
aString = aString + "\n";
aString = "<" + aString + ">" + "\n" + payload + "\n" + "<" + aString + "/>";
toSend << aString;
return true;
}
void JNetwork::registerCommand(string command, processCmd processCommand, processCmd processResponse)
void JNetwork::registerCommand(string command, void* object, processCmd processCommand, processCmd processResponse)
{
sCommandMap[command + "Command"] = processCommand;
sCommandMap[command + "Response"] = processResponse;
CommandStruc struc;
struc.object = object;
struc.command = command;
struc.processCommand = processCommand;
sCommandMap[command + "Request"] = struc;
struc.processCommand = processResponse;
sCommandMap[command + "Response"] = struc;
}
void JNetwork::Update()
{
boost::mutex::scoped_lock r(receiveMutex);
// Checking for some command to execute
size_t begin_start_tag = received.str().find("<");
size_t end_start_tag = received.str().find(">");
string command = received.str().substr(begin_start_tag+1, end_start_tag-(begin_start_tag+1));
size_t begin_end_tag = received.str().find(command + "/>");
size_t end_end_tag = received.str().find("/>");
if(begin_start_tag != string::npos && begin_end_tag != string::npos )
{
map<string, CommandStruc>::iterator ite = sCommandMap.find(command);
if(ite != sCommandMap.end())
{
DebugTrace("begin of command received : " + received.str() );
DebugTrace("begin of command toSend : " + toSend.str() );
processCmd theMethod = (ite)->second.processCommand;
stringstream input(received.str().substr(end_start_tag+1, (begin_end_tag-1)-(end_start_tag+1)));
stringstream output;
theMethod((ite)->second.object, input, output);
string aString = received.str().substr(end_end_tag+2, string::npos);
received.str(aString);
if(output.str().size())
sendCommand((ite)->second.command, output.str(), "Response");
DebugTrace("end of command received : "<< received.str() );
DebugTrace("end of command toSend : "<< toSend.str() );
}
}
}
void JNetwork::ThreadProc(void* param)
@@ -105,71 +171,33 @@ void JNetwork::ThreadProc(void* param)
}
while(pSocket && pSocket->isConnected()) {
char buff[1024];
char buff[4096];
{
boost::mutex::scoped_lock l(pThis->receiveMutex);
int len = pSocket->Read(buff, sizeof(buff));
if(len) {
if(len > 0) {
boost::mutex::scoped_lock l(pThis->receiveMutex);
DebugTrace("receiving " << len << " bytes : " << buff);
pThis->received << buff;
}
// Checking for some command to execute
size_t found = pThis->received.str().find("Command");
if(found != string::npos)
{
map<string, processCmd>::iterator ite = sCommandMap.find((pThis->received.str()).substr(0, found) + "Command");
if(ite != sCommandMap.end())
{
DebugTrace("begin of command received : "<< pThis->received.str() );
DebugTrace("begin of command toSend : "<< pThis->toSend.str() );
boost::mutex::scoped_lock l(pThis->sendMutex);
pThis->toSend << pThis->received.str().substr(0, found) + "Response ";
pThis->received.str("");
processCmd theMethod = (ite)->second;
theMethod(pThis->received, pThis->toSend);
DebugTrace("end of command received : "<< pThis->received.str() );
DebugTrace("end of command toSend : "<< pThis->toSend.str() );
}
}
// Checking for some response to execute
found = pThis->received.str().find("Response");
if(found != string::npos)
{
map<string, processCmd>::iterator ite = sCommandMap.find((pThis->received.str()).substr(0, found) + "Response");
if(ite != sCommandMap.end())
{
DebugTrace("begin of response received : "<< pThis->received.str() );
DebugTrace("begin of response toSend : "<< pThis->toSend.str() );
boost::mutex::scoped_lock l(pThis->sendMutex);
string aString;
pThis->received >> aString;
processCmd theMethod = (ite)->second;
theMethod(pThis->received, pThis->toSend);
pThis->received.str("");
DebugTrace("end of response received : "<< pThis->received.str() );
DebugTrace("end of response toSend : "<< pThis->toSend.str() );
}
pThis->received.str(pThis->received.str() + buff);
DebugTrace("received " << pThis->received.str().size() << " bytes : " << pThis->received.str());
}
}
boost::mutex::scoped_lock l(pThis->sendMutex);
if(!pThis->toSend.str().empty())
{
DebugTrace("sending " << pThis->toSend.str().size() << " bytes : " << pThis->toSend.str());
pSocket->Write((char*)pThis->toSend.str().c_str(), pThis->toSend.str().size()+1);
pThis->toSend.str("");
}
{
boost::mutex::scoped_lock l(pThis->sendMutex);
if(!pThis->toSend.str().empty())
{
DebugTrace("sending " << pThis->toSend.str().size() << " bytes : " << pThis->toSend.str());
pSocket->Write((char*)pThis->toSend.str().c_str(), pThis->toSend.str().size()+1);
pThis->toSend.str("");
}
}
boost::this_thread::sleep(boost::posix_time::milliseconds(1));
}
DebugTrace("Quitting Thread");
}
#if defined (WIN32) || defined (LINUX)
int JNetwork::connect(string ip)
int JNetwork::connect(const string& ip)
{
if (mpWorkerThread) return 0;
serverIP = ip;
@@ -179,7 +207,7 @@ int JNetwork::connect(string ip)
#else
int JNetwork::connect(string serverIP){
int JNetwork::connect(const string& serverIP){
#ifdef NETWORK_SUPPORT
int err;
char buffer[4096];

View File

@@ -75,10 +75,10 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
int count;
while (filePtr < size)
{
while (filePtr < size)
{
filePtr = ReadLine(tmpLine, buffer, filePtr, size);
{
{
if ((tmpLine[0] == '#') || (strlen(tmpLine) < 3))
{
@@ -89,19 +89,19 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
if (count == 4)
{
if (strcmp(s1, "vn") == 0)
if (string("vn") == s1)
normalList.push_back(vert);
else if (strcmp(s1, "vt") == 0)
else if (string("vt") == s1)
texList.push_back(vert);
else if (strcmp(s1, "v") == 0)
else if (string("v") == s1)
vertList.push_back(vert);
}
else if (count == 3)
{
if (strcmp(s1, "vt") == 0)
if (string("vt") == s1)
texList.push_back(vert);
}
}
else if (tmpLine[0] == 'f')
{
@@ -211,7 +211,7 @@ bool JOBJModel::Load(const char *modelName, const char *textureName)
if (textureName != NULL)
mTexture = JRenderer::GetInstance()->LoadTexture(textureName);
return true;
return true;
}

View File

@@ -90,7 +90,7 @@ bool JParticleEffect::Load(const char* filename)
// FIELD_COUNT
// };
const char* lifeValues[] =
const string lifeValues[] =
{
"speed",
"size",
@@ -104,7 +104,7 @@ bool JParticleEffect::Load(const char* filename)
"gravity"
};
const char* typeNames[] =
const string typeNames[] =
{
"POINT",
"AREA",
@@ -113,7 +113,7 @@ bool JParticleEffect::Load(const char* filename)
"CIRCLE"
};
const char* modeNames[] =
const string modeNames[] =
{
"REPEAT",
"ONCE",
@@ -149,32 +149,32 @@ bool JParticleEffect::Load(const char* filename)
{
element = param->ToElement();
if (strcmp(element->Attribute("name"), "settings")==0)
if (string("settings") == element->Attribute("name"))
{
if (strcmp(element->Attribute("blend"), "NORMAL")==0)
if (string("NORMAL") == element->Attribute("blend"))
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE_MINUS_SRC_ALPHA);
else if (strcmp(element->Attribute("blend"), "ADDITIVE")==0)
else if (string("ADDITIVE") == element->Attribute("blend"))
mParticleEmitters[mEmitterCount]->SetBlending(BLEND_SRC_ALPHA, BLEND_ONE);
for (unsigned int i=0;i<sizeof(modeNames)/sizeof(char*);i++)
{
if (strcmp(element->Attribute("mode"), modeNames[i])==0)
if (modeNames[i] == element->Attribute("mode"))
{
mParticleEmitters[mEmitterCount]->mEmitterMode = i;
#if defined (_DEBUG)
printf("emitter mode:%s\n", modeNames[i]);
printf("emitter mode:%s\n", modeNames[i].c_str());
#endif
break;
}
}
for (unsigned i=0;i<sizeof(typeNames)/sizeof(char*);i++)
{
if (strcmp(element->Attribute("type"), typeNames[i])==0)
if (typeNames[i] == element->Attribute("type"))
{
mParticleEmitters[mEmitterCount]->mType = i;
#if defined (_DEBUG)
printf("emitter type:%s\n", typeNames[i]);
printf("emitter type:%s\n", typeNames[i].c_str());
#endif
break;
}
@@ -213,7 +213,7 @@ bool JParticleEffect::Load(const char* filename)
}
}
else if (strcmp(element->Attribute("name"), "quantity")==0)
else if (string("quantity") == element->Attribute("name"))
{
for (key = param->FirstChild(); key; key = key->NextSibling())
{
@@ -227,7 +227,7 @@ bool JParticleEffect::Load(const char* filename)
}
}
else if (strcmp(element->Attribute("name"), "lifex")==0)
else if (string("lifex") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -236,7 +236,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mLifeMax= value;
}
}
else if (strcmp(element->Attribute("name"), "anglex")==0)
else if (string("anglex") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -245,7 +245,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mAngleMax= value*DEG2RAD;
}
}
else if (strcmp(element->Attribute("name"), "speedx")==0)
else if (string("speedx") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -254,7 +254,7 @@ bool JParticleEffect::Load(const char* filename)
mParticleEmitters[mEmitterCount]->mSpeedMax= value;
}
}
else if (strcmp(element->Attribute("name"), "sizex")==0)
else if (string("sizex") == element->Attribute("name"))
{
if (element->QueryFloatAttribute("base", &baseValue) == TIXML_SUCCESS &&
element->QueryFloatAttribute("max", &value) == TIXML_SUCCESS)
@@ -267,7 +267,7 @@ bool JParticleEffect::Load(const char* filename)
{
for (int i=0;i<FIELD_COUNT;i++)
{
if (strcmp(element->Attribute("name"), lifeValues[i])==0)
if (lifeValues[i] == element->Attribute("name"))
{
for (key = param->FirstChild(); key; key = key->NextSibling())
{

View File

@@ -16,7 +16,7 @@
#include "../include/JLBFont.h"
#include "tinyxml/tinyxml.h"
#if defined (_DEBUG) && defined (WIN32)
#if defined (_DEBUG) && defined (WIN32) && (!defined LINUX)
#include "crtdbg.h"
#define NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
#else
@@ -119,11 +119,11 @@ bool JResourceManager::LoadResource(const string& resourceName)
element = node->ToElement();
if (element != NULL)
{
if (strcmp(element->Value(), "texture")==0)
if (element->ValueStr() == "texture")
{
CreateTexture(element->Attribute("name"));
}
else if (strcmp(element->Value(), "quad")==0)
else if (element->ValueStr() == "quad")
{
string quadName = element->Attribute("name");
string textureName = element->Attribute("texture");
@@ -170,7 +170,7 @@ bool JResourceManager::LoadResource(const string& resourceName)
GetQuad(id)->SetHotSpot(hotspotX, hotspotY);
}
}
else if (strcmp(element->Value(), "font")==0)
else if (element->ValueStr() == "font")
{
}

View File

@@ -1,4 +1,3 @@
#if 0
// need a complete rewrite to comply to the new interface
#ifdef NETWORK_SUPPORT
@@ -21,23 +20,21 @@
#endif
#include "../include/JGE.h"
#include "../include/JSocket.h"
JSocket * JSocket::mInstance = NULL;
#define SERVER_PORT 20666
int JSocket::connected = 0;
void JSocket::init(){
JSocket::JSocket(){
#ifdef NETWORK_SUPPORT
sceUtilityLoadNetModule(1);
sceUtilityLoadNetModule(3);
#endif
}
JSocket::JSocket(){
init();
JSocket::JSocket(string ipAddr)
{
}
JSocket::JSocket(int fd)
{
}
JSocket::~JSocket(){
@@ -48,7 +45,27 @@ JSocket::~JSocket(){
#endif
}
void JSocket::Disconnect()
{
}
JSocket* JSocket::Accept()
{
return 0;
}
int JSocket::Read(char* buff, int size)
{
return 0;
}
int JSocket::Write(char* buff, int size)
{
return 0;
}
#if 0
int JSocket::make_socket(uint16_t port)
{
int sock = -1;

View File

@@ -71,7 +71,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
element->QueryFloatAttribute("x", &xx);
element->QueryFloatAttribute("y", &yy);
Point pt(xx*xscale, yy*yscale);
JPoint pt(xx*xscale, yy*yscale);
AddControlPoint(pt);
}
@@ -84,7 +84,7 @@ bool JSpline::Load(const char *filename, float xscale, float yscale)
void JSpline::PointOnCurve(Point &out, float t, const Point &p0, const Point &p1, const Point &p2, const Point &p3)
void JSpline::PointOnCurve(JPoint &out, float t, const JPoint &p0, const JPoint &p1, const JPoint &p2, const JPoint &p3)
{
float t2 = t * t;
float t3 = t2 * t;
@@ -113,8 +113,8 @@ void JSpline::GeneratePixels()
x = mMidPoints[1].x;
y = mMidPoints[1].y;
Point newPt(x, y);
Point extraPt;
JPoint newPt(x, y);
JPoint extraPt;
mPixels.push_back(newPt);
@@ -151,13 +151,13 @@ void JSpline::GeneratePixels()
}
void JSpline::AddControlPoint(const Point &pt)
void JSpline::AddControlPoint(const JPoint &pt)
{
mMidPoints.push_back(pt);
}
void JSpline::GetControlPoint(Point &point, int index)
void JSpline::GetControlPoint(JPoint &point, int index)
{
if (index < (int)mMidPoints.size())
{
@@ -167,7 +167,7 @@ void JSpline::GetControlPoint(Point &point, int index)
}
void JSpline::GetPixel(Point &point, int index)
void JSpline::GetPixel(JPoint &point, int index)
{
if (index < (int)mPixels.size())
{

Some files were not shown because too many files have changed in this diff Show More