Merge branch 'master' into auto_releases

This commit is contained in:
xawotihs
2014-12-04 00:07:12 +01:00
18 changed files with 2463 additions and 79 deletions

View File

@@ -44,9 +44,10 @@ install:
tar --absolute-names -jxf android-ndk-r9-linux-x86_64.tar.bz2 &&
tar -zxf android-sdk_r23.0.2-linux.tgz &&
$ANDROID list sdk --extended -a &&
echo yes | $ANDROID update sdk --filter tools,platform-tools,build-tools-20.0.0,android-10 --no-ui --force --no-https;
echo yes | $ANDROID update sdk --filter tools,platform-tools,build-tools-21.1.1,android-10 --no-ui --force --no-https;
fi
- sudo pip install pyjavaproperties
- sudo pip install github3.py
script: ./travis-script.sh
matrix:

View File

@@ -105,9 +105,8 @@ public:
~JSample();
unsigned long fileSize();
#if (defined QT_CONFIG)
#if (defined QT_CONFIG) && (!defined USE_PHONON)
QMediaPlayer* effect;
// QSoundEffect effect;
void* mSample;
#elif defined (PSP)
WAVDATA *mSample;

View File

@@ -42,16 +42,16 @@ int JMusic::getPlayTime(){
JMusic::~JMusic()
{
#ifdef QT_CONFIG
if(player)
delete player;
if(playlist)
delete playlist;
#elif defined USE_PHONON
#if defined USE_PHONON
if(mOutput)
delete mOutput;
if(mMediaObject)
delete mMediaObject;
#elif defined QT_CONFIG
if(player)
delete player;
if(playlist)
delete playlist;
#elif defined WITH_FMOD
JSoundSystem::GetInstance()->StopMusic(this);
if (mTrack) FSOUND_Sample_Free(mTrack);
@@ -76,7 +76,7 @@ JSample::JSample()
JSample::~JSample()
{
#ifdef QT_CONFIG
#if (defined QT_CONFIG) && (!defined USE_PHONON)
if(effect)
delete effect;
#elif USE_PHONON
@@ -155,7 +155,7 @@ void JSoundSystem::DestroySoundSystem()
JMusic *JSoundSystem::LoadMusic(const char *fileName)
{
JMusic* music = NULL;
#ifdef QT_CONFIG
#if (defined QT_CONFIG) && (!defined USE_PHONON)
music = new JMusic();
if (music)
{
@@ -202,7 +202,7 @@ JMusic *JSoundSystem::LoadMusic(const char *fileName)
void JSoundSystem::PlayMusic(JMusic *music, bool looping)
{
#ifdef QT_CONFIG
#if (defined QT_CONFIG) && (!defined USE_PHONON)
if(music && music->player && music->playlist)
{
if(looping)
@@ -242,7 +242,7 @@ void JSoundSystem::PlayMusic(JMusic *music, bool looping)
void JSoundSystem::StopMusic(JMusic *music)
{
#ifdef QT_CONFIG
#if (defined QT_CONFIG) && (!defined USE_PHONON)
if (music && music->player && music->playlist)
{
music->player->stop();
@@ -299,7 +299,7 @@ void JSoundSystem::SetSfxVolume(int volume){
JSample *JSoundSystem::LoadSample(const char *fileName)
{
JSample* sample = NULL;
#ifdef QT_CONFIG
#if (defined QT_CONFIG) && (!defined USE_PHONON)
sample = new JSample();
if (sample)
{
@@ -347,7 +347,7 @@ JSample *JSoundSystem::LoadSample(const char *fileName)
void JSoundSystem::PlaySample(JSample *sample)
{
#ifdef QT_CONFIG
#if (defined QT_CONFIG) && (!defined USE_PHONON)
if(sample)
{
sample->effect->play();

68
appveyor.yml Normal file
View File

@@ -0,0 +1,68 @@
# Notes:
# - Minimal appveyor.yml file is an empty file. All sections are optional.
# - Indent each level of configuration with 2 spaces. Do not use tabs!
# - All section names are case-sensitive.
# - Section names should be unique on each level.
#---------------------------------#
# environment configuration #
#---------------------------------#
environment:
GH_TOKEN:
secure: dYnBDQkiY5oVjIlswzBX9BJigNtBGXgGlp1tK3XbHzrDEDrs2vaKD5m+Oz5OSz1C
# scripts that run after cloning repository
install:
- ps: (new-object net.webclient).DownloadFile('https://raw.github.com/pypa/pip/master/contrib/get-pip.py', 'C:/get-pip.py')
- "C:/Python27/python.exe C:/get-pip.py"
- "C:/Python27/Scripts/pip.exe install pyjavaproperties"
- "C:/Python27/Scripts/pip.exe install github3.py"
#---------------------------------#
# build configuration #
#---------------------------------#
# build Configuration, i.e. Debug, Release, etc.
configuration: Release
build:
project: projects/mtg/mtg_vs2010.sln # path to Visual Studio solution or project
#---------------------------------#
# tests configuration #
#---------------------------------#
# to disable automatic tests
test: off
#---------------------------------#
# artifacts configuration #
#---------------------------------#
artifacts:
# pushing windows package
- path: projects\mtg\bin\Wagic-windows*.zip
#---------------------------------#
# deployment configuration #
#---------------------------------#
# scripts to run before deployment
before_deploy:
- cd projects/mtg/bin
- "C:/Python27/python.exe createWindowsZip.py"
- cd ../../..
# scripts to run after deployment
after_deploy:
# to run your custom scripts instead of provider deployments
deploy_script:
- "C:/Python27/python.exe upload-binaries.py -t %GH_TOKEN% -s %APPVEYOR_REPO_COMMIT% -l projects/mtg/bin/Wagic-windows.zip -r Wagic-windows.zip -b %APPVEYOR_REPO_BRANCH%"
# to disable deployment
#deploy: off

View File

@@ -30,8 +30,8 @@ def createResZipFile(filename):
zip_file.close()
if rename:
os.rename('settings/options.txt', 'settings/options.orig.txt')
os.rename('player/options.txt', 'player/options.orig.txt')
os.rename('settings/options.txt', 'settings/options.orig.txt')
os.rename('player/options.txt', 'player/options.orig.txt')
def getFilename():
p = Properties();
@@ -44,16 +44,18 @@ def getFilename():
def createStandardResFile():
print "Creating Standard Resource File"
filename = getFilename() + '.zip'
def createStandardResFile(filename):
print('Creating Standard Resource File')
if not filename:
filename = getFilename() + '.zip'
createResZipFile( filename )
print >> sys.stderr, 'Created Resource Package for Standard Distribution: {0}'.format( filename)
def createIosResFile():
print 'Preparing Resource Package for iOS'
def createIosResFile(filename):
print('Preparing Resource Package for iOS')
utilities = ZipUtilities()
filename = getFilename() + '_iOS.zip'
if not filename:
filename = getFilename() + '_iOS.zip'
#createResZipFile( filename )
zip_file = zipfile.ZipFile(filename, 'a', zipfile.ZIP_STORED)
zip_file.write("../../iOS/Res/rules/modrules.xml", "rules/modrules.xml", zipfile.ZIP_STORED)
@@ -78,10 +80,10 @@ class ZipUtilities:
if file != '.svn':
full_path = os.path.join(folder, file)
if os.path.isfile(full_path):
print 'File added: ' + str(full_path)
print('File added: ' + str(full_path))
zip_file.write(full_path)
elif os.path.isdir(full_path):
print 'Entering folder: ' + str(full_path)
print('Entering folder: ' + str(full_path))
self.addFolderToZip(zip_file, full_path)
@@ -90,16 +92,17 @@ def main():
parser = OptionParser()
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
parser.add_option("-n", "--name", help="NAME: specify resource file name", metavar="NAME", dest="name")
(options, args) = parser.parse_args()
if (options.platform):
if (options.platform == "ios"):
createIosResFile()
else:
createStandardResFile()
if (options.platform == "ios"):
createIosResFile(options.name)
else:
createStandardResFile(options.name)
else:
createStandardResFile()
createStandardResFile(options.name)
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,846 @@
[meta]
author=Wagic Team
name=Born of the Gods
year=2014
block=Theros
[/meta]
[card]
primitive=Acolyte's Reward
id=378373
rarity=U
[/card]
[card]
primitive=Aerie Worshippers
id=378402
rarity=U
[/card]
[card]
primitive=Akroan Conscriptor
id=378459
rarity=U
[/card]
[card]
primitive=Akroan Phalanx
id=378374
rarity=U
[/card]
[card]
primitive=Akroan Skyguard
id=378375
rarity=C
[/card]
[card]
primitive=Arbiter of the Ideal
id=378403
rarity=R
[/card]
[card]
primitive=Archetype of Aggression
id=378460
rarity=U
[/card]
[card]
primitive=Archetype of Courage
id=378376
rarity=U
[/card]
[card]
primitive=Archetype of Endurance
id=378488
rarity=U
[/card]
[card]
primitive=Archetype of Finality
id=378430
rarity=U
[/card]
[card]
primitive=Archetype of Imagination
id=378404
rarity=U
[/card]
[card]
primitive=Ashiok's Adept
id=378431
rarity=U
[/card]
[card]
primitive=Aspect of Hydra
id=378489
rarity=C
[/card]
[card]
primitive=Asphyxiate
id=378432
rarity=C
[/card]
[card]
primitive=Astral Cornucopia
id=378529
rarity=R
[/card]
[card]
primitive=Bile Blight
id=378433
rarity=U
[/card]
[card]
primitive=Black Oak of Odunos
id=378434
rarity=U
[/card]
[card]
primitive=Bolt of Keranos
id=378461
rarity=C
[/card]
[card]
primitive=Brimaz, King of Oreskos
id=378377
rarity=M
[/card]
[card]
primitive=Champion of Stray Souls
id=378435
rarity=M
[/card]
[card]
primitive=Charging Badger
id=378490
rarity=C
[/card]
[card]
primitive=Chorus of the Tides
id=378405
rarity=C
[/card]
[card]
primitive=Chromanticore
id=378516
rarity=M
[/card]
[card]
primitive=Claim of Erebos
id=378436
rarity=C
[/card]
[card]
primitive=Courser of Kruphix
id=378491
rarity=R
[/card]
[card]
primitive=Crypsis
id=378406
rarity=C
[/card]
[card]
primitive=Culling Mark
id=378492
rarity=C
[/card]
[card]
primitive=Cyclops of One-Eyed Pass
id=378462
rarity=C
[/card]
[card]
primitive=Dawn to Dusk
id=378378
rarity=U
[/card]
[card]
primitive=Deepwater Hypnotist
id=378407
rarity=C
[/card]
[card]
primitive=Divination
id=378408
rarity=C
[/card]
[card]
primitive=Drown in Sorrow
id=378437
rarity=U
[/card]
[card]
primitive=Eater of Hope
id=378438
rarity=R
[/card]
[card]
primitive=Eidolon of Countless Battles
id=378379
rarity=R
[/card]
[card]
primitive=Elite Skirmisher
id=378380
rarity=C
[/card]
[card]
primitive=Ephara, God of the Polis
id=378517
rarity=M
[/card]
[card]
primitive=Ephara's Enlightenment
id=378518
rarity=U
[/card]
[card]
primitive=Ephara's Radiance
id=378381
rarity=C
[/card]
[card]
primitive=Epiphany Storm
id=378463
rarity=C
[/card]
[card]
primitive=Eternity Snare
id=378409
rarity=U
[/card]
[card]
primitive=Evanescent Intellect
id=378410
rarity=C
[/card]
[card]
primitive=Everflame Eidolon
id=378464
rarity=U
[/card]
[card]
primitive=Excoriate
id=378382
rarity=C
[/card]
[card]
primitive=Eye Gouge
id=378439
rarity=C
[/card]
[card]
primitive=Fall of the Hammer
id=378465
rarity=C
[/card]
[card]
primitive=Fanatic of Xenagos
id=378519
rarity=U
[/card]
[card]
primitive=Fate Unraveler
id=378440
rarity=R
[/card]
[card]
primitive=Fated Conflagration
id=378466
rarity=R
[/card]
[card]
primitive=Fated Infatuation
id=378411
rarity=R
[/card]
[card]
primitive=Fated Intervention
id=378493
rarity=R
[/card]
[card]
primitive=Fated Retribution
id=378383
rarity=R
[/card]
[card]
primitive=Fated Return
id=378441
rarity=R
[/card]
[card]
primitive=Fearsome Temper
id=378467
rarity=C
[/card]
[card]
primitive=Felhide Brawler
id=378442
rarity=C
[/card]
[card]
primitive=Felhide Spiritbinder
id=378468
rarity=R
[/card]
[card]
primitive=Flame-Wreathed Phoenix
id=378469
rarity=M
[/card]
[card]
primitive=Flitterstep Eidolon
id=378412
rarity=U
[/card]
[card]
primitive=Floodtide Serpent
id=378413
rarity=C
[/card]
[card]
primitive=Forgestoker Dragon
id=378470
rarity=R
[/card]
[card]
primitive=Forlorn Pseudamma
id=378443
rarity=U
[/card]
[card]
primitive=Forsaken Drifters
id=378444
rarity=U
[/card]
[card]
primitive=Ghostblade Eidolon
id=378384
rarity=U
[/card]
[card]
primitive=Gild
id=378445
rarity=R
[/card]
[card]
primitive=Gold
id=-378445
rarity=T
[/card]
[card]
primitive=Glimpse the Sun God
id=378385
rarity=U
[/card]
[card]
primitive=God-Favored General
id=378386
rarity=U
[/card]
[card]
primitive=Gorgon's Head
id=378530
rarity=U
[/card]
[card]
primitive=Graverobber Spider
id=378494
rarity=U
[/card]
[card]
primitive=Great Hart
id=378387
rarity=C
[/card]
[card]
primitive=Griffin Dreamfinder
id=378388
rarity=C
[/card]
[card]
primitive=Grisly Transformation
id=378446
rarity=C
[/card]
[card]
primitive=Herald of Torment
id=378447
rarity=R
[/card]
[card]
primitive=Hero of Iroas
id=378389
rarity=R
[/card]
[card]
primitive=Hero of Leina Tower
id=378495
rarity=R
[/card]
[card]
primitive=Heroes' Podium
id=378531
rarity=R
[/card]
[card]
primitive=Hold at Bay
id=378390
rarity=C
[/card]
[card]
primitive=Hunter's Prowess
id=378496
rarity=R
[/card]
[card]
primitive=Impetuous Sunchaser
id=378471
rarity=C
[/card]
[card]
primitive=Karametra, God of Harvests
id=378520
rarity=M
[/card]
[card]
primitive=Karametra's Favor
id=378497
rarity=C
[/card]
[card]
primitive=Kiora, the Crashing Wave
id=378521
rarity=M
[/card]
[card]
primitive=Kiora's Prevention
id=37852101
rarity=T
[/card]
[card]
primitive=Kiora's Kraken
id=-378521
rarity=T
[/card]
[card]
primitive=Kiora's Follower
id=378522
rarity=U
[/card]
[card]
primitive=Kragma Butcher
id=378472
rarity=C
[/card]
[card]
primitive=Kraken of the Straits
id=378414
rarity=U
[/card]
[card]
primitive=Lightning Volley
id=378473
rarity=U
[/card]
[card]
primitive=Loyal Pegasus
id=378391
rarity=C
[/card]
[card]
primitive=Marshmist Titan
id=378448
rarity=C
[/card]
[card]
primitive=Meletis Astronomer
id=378415
rarity=U
[/card]
[card]
primitive=Mindreaver
id=378416
rarity=R
[/card]
[card]
primitive=Mischief and Mayhem
id=378498
rarity=U
[/card]
[card]
primitive=Mogis, God of Slaughter
id=378523
rarity=M
[/card]
[card]
primitive=Mortal's Ardor
id=378392
rarity=C
[/card]
[card]
primitive=Mortal's Resolve
id=378499
rarity=C
[/card]
[card]
primitive=Necrobite
id=378449
rarity=C
[/card]
[card]
primitive=Nessian Demolok
id=378500
rarity=U
[/card]
[card]
primitive=Nessian Wilds Ravager
id=378501
rarity=R
[/card]
[card]
primitive=Noble Quarry
id=378502
rarity=U
[/card]
[card]
primitive=Nullify
id=378417
rarity=C
[/card]
[card]
primitive=Nyxborn Eidolon
id=378450
rarity=C
[/card]
[card]
primitive=Nyxborn Rollicker
id=378474
rarity=C
[/card]
[card]
primitive=Nyxborn Shieldmate
id=378393
rarity=C
[/card]
[card]
primitive=Nyxborn Triton
id=378418
rarity=C
[/card]
[card]
primitive=Nyxborn Wolf
id=378503
rarity=C
[/card]
[card]
primitive=Odunos River Trawler
id=378451
rarity=U
[/card]
[card]
primitive=Oracle of Bones
id=378475
rarity=R
[/card]
[card]
primitive=Oracle's Insight
id=378419
rarity=U
[/card]
[card]
primitive=Oreskos Sun Guide
id=378394
rarity=C
[/card]
[card]
primitive=Ornitharch
id=378395
rarity=U
[/card]
[card]
primitive=Pain Seer
id=378452
rarity=R
[/card]
[card]
primitive=Peregrination
id=378504
rarity=U
[/card]
[card]
primitive=Perplexing Chimera
id=378420
rarity=R
[/card]
[card]
primitive=Pharagax Giant
id=378476
rarity=C
[/card]
[card]
primitive=Phenax, God of Deception
id=378524
rarity=M
[/card]
[card]
primitive=Pheres-Band Raiders
id=378505
rarity=U
[/card]
[card]
primitive=Pheres-Band Tromper
id=378506
rarity=C
[/card]
[card]
primitive=Pillar of War
id=378532
rarity=U
[/card]
[card]
primitive=Pinnacle of Rage
id=378477
rarity=U
[/card]
[card]
primitive=Plea for Guidance
id=378396
rarity=R
[/card]
[card]
primitive=Ragemonger
id=378525
rarity=U
[/card]
[card]
primitive=Raised by Wolves
id=378507
rarity=U
[/card]
[card]
primitive=Reap what is Sown
id=378526
rarity=U
[/card]
[card]
primitive=Reckless Reveler
id=378478
rarity=C
[/card]
[card]
primitive=Retraction Helix
id=378421
rarity=C
[/card]
[card]
primitive=Revoke Existence
id=378397
rarity=C
[/card]
[card]
primitive=Rise to the Challenge
id=378479
rarity=C
[/card]
[card]
primitive=Sanguimancy
id=378453
rarity=U
[/card]
[card]
primitive=Satyr Firedancer
id=378480
rarity=R
[/card]
[card]
primitive=Satyr Nyx-Smith
id=378481
rarity=U
[/card]
[card]
primitive=Satyr Wayfinder
id=378508
rarity=C
[/card]
[card]
primitive=Scourge of Skola Vale
id=378509
rarity=R
[/card]
[card]
primitive=Scouring Sands
id=378482
rarity=C
[/card]
[card]
primitive=Searing Blood
id=378483
rarity=U
[/card]
[card]
primitive=Servant of Tymaret
id=378454
rarity=C
[/card]
[card]
primitive=Setessan Oathsworn
id=378510
rarity=C
[/card]
[card]
primitive=Setessan Starbreaker
id=378511
rarity=C
[/card]
[card]
primitive=Shrike Harpy
id=378455
rarity=U
[/card]
[card]
primitive=Silent Sentinel
id=378398
rarity=R
[/card]
[card]
primitive=Siren of the Fanged Coast
id=378422
rarity=U
[/card]
[card]
primitive=Siren of the Silent Song
id=378527
rarity=U
[/card]
[card]
primitive=Siren Song Lyre
id=378533
rarity=U
[/card]
[card]
primitive=Skyreaping
id=378512
rarity=U
[/card]
[card]
primitive=Snake of the Golden Grove
id=378513
rarity=C
[/card]
[card]
primitive=Sphinx's Disciple
id=378423
rarity=C
[/card]
[card]
primitive=Spirit of the Labyrinth
id=378399
rarity=R
[/card]
[card]
primitive=Spiteful Returned
id=378456
rarity=U
[/card]
[card]
primitive=Springleaf Drum
id=378534
rarity=U
[/card]
[card]
primitive=Stormcaller of Keranos
id=378484
rarity=U
[/card]
[card]
primitive=Stratus Walk
id=378424
rarity=C
[/card]
[card]
primitive=Sudden Storm
id=378425
rarity=C
[/card]
[card]
primitive=Sunbond
id=378400
rarity=U
[/card]
[card]
primitive=Swordwise Centaur
id=378514
rarity=C
[/card]
[card]
primitive=Temple of Enlightenment
id=378535
rarity=R
[/card]
[card]
primitive=Temple of Malice
id=378536
rarity=R
[/card]
[card]
primitive=Temple of Plenty
id=378537
rarity=R
[/card]
[card]
primitive=Thassa's Rebuff
id=378426
rarity=U
[/card]
[card]
primitive=Thunder Brute
id=378485
rarity=U
[/card]
[card]
primitive=Thunderous Might
id=378486
rarity=U
[/card]
[card]
primitive=Tromokratis
id=378427
rarity=R
[/card]
[card]
primitive=Unravel the AEther
id=378515
rarity=U
[/card]
[card]
primitive=Vanguard of Brimaz
id=378401
rarity=U
[/card]
[card]
primitive=Vortex Elemental
id=378428
rarity=U
[/card]
[card]
primitive=Warchanter of Mogis
id=378457
rarity=C
[/card]
[card]
primitive=Weight of the Underworld
id=378458
rarity=C
[/card]
[card]
primitive=Whelming Wave
id=378429
rarity=R
[/card]
[card]
primitive=Whims of the Fates
id=378487
rarity=R
[/card]
[card]
primitive=Xenagos, God of Revels
id=378528
rarity=M
[/card]

File diff suppressed because it is too large Load Diff

View File

@@ -204,6 +204,7 @@ brass_man.txt
brass_man_i161.txt
briarhorn.txt
bringer_of_the_red_dawn.txt
buyback.txt
cage_of_hands.txt
Call_to_Heel_1.txt
Call_to_Heel_2.txt

View File

@@ -0,0 +1,30 @@
# Cast card once with buyback and second time without.
# The card must be in the graveyard, not in the hand
[INIT]
FIRSTMAIN
[PLAYER1]
hand:Capsize
manapool:{5}{U}{U}{U}{U}
[PLAYER2]
inplay:Swamp,Island
[DO]
Capsize
# pay buyback
choice 1
Swamp
Capsize
Island
[ASSERT]
FIRSTMAIN
[PLAYER1]
graveyard:Capsize
[PLAYER2]
hand:Swamp,Island
[END]

View File

@@ -0,0 +1,24 @@
#Testing Griselbrand with the new specific life cost {L:7}
#Player has 8 life and you cannot use the ability the second time if you cannot pay life.
#Must change griselbrand code to {L:7}:draw:7 instead of {L}{L}{L}{L}{L}{L}{L}:draw:7
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:Griselbrand
life:8
library:forest,forest,forest,forest,forest,forest,forest,plains,mountain,mountain,mountain,mountain,mountain,mountain,island
[PLAYER2]
life:20
[DO]
Griselbrand
Griselbrand
[ASSERT]
FIRSTMAIN
[PLAYER1]
inplay:Griselbrand
life:1
hand:mountain,mountain,mountain,mountain,mountain,mountain,island
library:forest,forest,forest,forest,forest,forest,forest,plains
[PLAYER2]
life:20
[END]

View File

@@ -0,0 +1,38 @@
#Testing guild keyword gruul for Xenagos, God of Revels. You must have Born of the gods set (BNG)
#[card]
#name=Xenagos, God of Revels
#abilities=indestructible
#auto=@each my combatbegins:name(haste and +x/+x) target(other creature|mybattlefield) transforms((,newability[haste],newability[power/power])) ueot
#auto=this(variable{gruul}>6) transforms((Creature))
#text=Indestructible -- As long as your devotion to red and green is less than seven, Xenagos isn't a creature. -- At the beginning of combat on your turn, another target creature you control gains haste and gets +X/+X until end of turn, where X is that creature's power.
#mana={3}{R}{G}
#type=Legendary Enchantment
#subtype=God
#power=6
#toughness=5
#[/card]
[INIT]
FIRSTMAIN
[PLAYER1]
inplay:378528
hand:19869
life:20
manapool:{G}{G}{G}{G}{G}
[PLAYER2]
life:20
[DO]
19869
next
choice 0
19869
next
19869
eot
[ASSERT]
UNTAP
[PLAYER1]
inplay:378528,19869
life:20
[PLAYER2]
life:12
[END]

View File

@@ -0,0 +1,73 @@
import sys
import os
import zipfile
from pyjavaproperties import Properties
from optparse import OptionParser
def createWindowsZipFile(filename):
utilities = ZipUtilities()
zip_file = zipfile.ZipFile(filename, 'w', zipfile.ZIP_STORED)
zip_file.write('../../../LICENSE')
zip_file.write('libpng13.dll')
zip_file.write('SDL.dll')
zip_file.write('fmod.dll')
zip_file.write('zlib1.dll')
zip_file.write('Wagic.exe')
zip_file.write('Res/' + getFilename('core') + '.zip')
zip_file.close()
def getFilename(filename):
p = Properties();
p.load(open('../build.number.properties'));
minor = p['build.minor'];
major = p['build.major'];
point = p['build.point'];
filename = filename + '-' + major + minor + point
return filename
def createStandardResFile():
print "Creating Resource File"
cmd = 'python createResourceZip.py -n ' + getFilename('core') + '.zip'
os.chdir("Res")
os.system(cmd)
os.chdir("..")
print "Creating Windows Package File"
filename = 'Wagic-windows.zip'
createWindowsZipFile( filename )
print >> sys.stderr, 'Created Windows Package: {0}'.format( filename)
class ZipUtilities:
def toZip(self, file, filename):
zip_file = zipfile.ZipFile(filename, 'w')
if os.path.isfile(file):
zip_file.write(file)
else:
self.addFolderToZip(zip_file, file)
zip_file.close()
def addFolderToZip(self, zip_file, folder):
zip_file.writestr(folder + '/', '')
for file in os.listdir(folder):
if file != '.svn':
full_path = os.path.join(folder, file)
if os.path.isfile(full_path):
print 'File added: ' + str(full_path)
zip_file.write(full_path)
elif os.path.isdir(full_path):
print 'Entering folder: ' + str(full_path)
self.addFolderToZip(zip_file, full_path)
def main():
## using optparse instead of argParse for now since python 2.7 may not be installed.
parser = OptionParser()
parser.add_option("-p", "--platform", help="PLATFORM: specify custom build. (eg ios, android, etc)", metavar="PLATFORM", dest="platform")
(options, args) = parser.parse_args()
createStandardResFile()
if __name__ == "__main__":
main()

View File

@@ -172,6 +172,206 @@ private:
{
intValue = target->getManaCost()->getConvertedCost();
}
else if (s == "azorius")//devotion blue white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "boros")//devotion red white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 3);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "dimir")//devotion blue black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "golgari")//devotion to green black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "gruul")//devotion to green red
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 3);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "izzet")//devotion to red blue
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 2);
intValue += zone->countTotalManaSymbols(dtc, 3);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "orzhov")//devotion to white black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 4);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "rakdos")//devotion to red black
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 3);
intValue += zone->countTotalManaSymbols(dtc, 4);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "selesnya")//devotion to green white
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 5);
}
}
}
SAFE_DELETE(dtc);
}
else if (s == "simic")//devotion to green blue
{
TargetChooserFactory dtf(card->getObserver());
TargetChooser * dtc = dtf.createTargetChooser("*",NULL);
for (int i = 0; i < 2; i++)
{
Player * dp = card->getObserver()->players[i];
MTGGameZone * dzones[] = { dp->game->inPlay, dp->game->graveyard, dp->game->hand, dp->game->library };
for (int k = 0; k < 4; k++)
{
MTGGameZone * zone = dzones[k];
if (dtc->targetsZone(zone, card))
{
intValue += zone->countTotalManaSymbols(dtc, 1);
intValue += zone->countTotalManaSymbols(dtc, 2);
}
}
}
SAFE_DELETE(dtc);
}
else if (s.find("type:") != string::npos)
{
size_t begins = s.find("type:");

View File

@@ -90,6 +90,19 @@ public:
virtual LifeCost * clone() const;
};
//Specific life cost
class SpecificLifeCost : public ExtraCost
{
private:
int slc;
public:
SpecificLifeCost(TargetChooser *_tc = NULL, int slc = 0);
virtual int canPay();
virtual int doPay();
virtual SpecificLifeCost * clone() const;
};
//phyrexian mana
class LifeorManaCost : public ExtraCost
{

View File

@@ -151,6 +151,44 @@ int LifeCost::doPay()
return 1;
}
//Specific life cost
SpecificLifeCost * SpecificLifeCost::clone() const
{
SpecificLifeCost * ec = NEW SpecificLifeCost(*this);
if (tc)
ec->tc = tc->clone();
return ec;
}
SpecificLifeCost::SpecificLifeCost(TargetChooser *_tc, int slc)
: ExtraCost("Life", _tc), slc(slc)
{
}
int SpecificLifeCost::canPay()
{
MTGCardInstance * _target = (MTGCardInstance *) target;
if(_target->controller()->life >= slc)
{
return 1;
}
return 0;
}
int SpecificLifeCost::doPay()
{
if (!target)
return 0;
MTGCardInstance * _target = (MTGCardInstance *) target;
_target->controller()->loseLife(slc);
target = NULL;
if (tc)
tc->initTargets();
return 1;
}
//life or Mana cost
LifeorManaCost * LifeorManaCost::clone() const
{

View File

@@ -4284,6 +4284,7 @@ void AbilityFactory::addAbilities(int _id, Spell * spell)
}
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] > 0)
{
card->alternateCostPaid[ManaCost::MANA_PAID_WITH_BUYBACK] = 0;
zones->putInZone(card, zones->stack, Endzones->hand);
}
else if (card->alternateCostPaid[ManaCost::MANA_PAID_WITH_FLASHBACK] > 0)

View File

@@ -159,10 +159,19 @@ ManaCost * ManaCost::parseManaCost(string s, ManaCost * _manaCost, MTGCardInstan
{ //Mill to exile yourself as a cost (Library 2 Exile)
manaCost->addExtraCost(NEW MillExileCost(tc));
}
else
else if (value == "l")
{ //Life cost
manaCost->addExtraCost(NEW LifeCost(tc));
}
else
{ //Specific Life cost
vector<string>valSplit = parseBetween(value,"l:"," ",false);
if (valSplit.size()) {
WParsedInt* lifetopay = NEW WParsedInt(valSplit[1], NULL, c);
manaCost->addExtraCost(NEW SpecificLifeCost(tc,lifetopay->getValue()));
SAFE_DELETE(lifetopay);
}
}
break;
case 'd': //DiscardRandom cost
if (value == "d")

66
upload-binaries.py Normal file
View File

@@ -0,0 +1,66 @@
import sys
import os
import zipfile
from pyjavaproperties import Properties
from optparse import OptionParser
from github3 import login
def checkRelease(repository, remote):
release = None
for r in repository.iter_releases():
if r.name == 'latest-master' :
release = r
for a in r.assets :
if a.name == remote :
# need to delete the old release
r.delete()
# need also to delete the tag (reference)
ref = repository.ref('tags/latest-master')
ref.delete()
release = None
if release is None:
# now, we recreate a new one
release = repository.create_release('latest-master', 'master', 'latest-master',
'Latest successful builds of the master branch automatically uploaded by Travis or AppVeyor CI.',
False,
True)
return release
def suffixFilename(filename, build):
p = Properties();
p.load(open('projects/mtg/build.number.properties'));
minor = p['build.minor'];
major = p['build.major'];
point = p['build.point'];
name, extension = os.path.splitext(filename)
filename = name + '-' + major + minor + point + '-' + build + extension
return filename
def main():
parser = OptionParser()
parser.add_option("-t", "--token", help="TOKEN: specify authentication token to use", metavar="TOKEN", dest="token")
parser.add_option("-s", "--sha", help="SHA: specify commit SHA", metavar="SHA", dest="sha")
parser.add_option("-l", "--local", help="FILE: specify local file path to upload", metavar="LOCAL", dest="local")
parser.add_option("-r", "--remote", help="NAME: specify remote asset name in the release.", metavar="REMOTE", dest="remote")
parser.add_option("-b", "--branch", help="BRANCH: specify branch of the commit", metavar="BRANCH", dest="branch")
(options, args) = parser.parse_args()
if (options.token and options.sha and options.local and options.remote and options.branch == 'master'):
gh = login(token = options.token)
else:
parser.print_help()
return
repository = gh.repository('WagicProject', 'wagic')
r = checkRelease(repository, options.remote)
filename = options.remote
with open(options.local, 'rb') as fd:
r.upload_asset('application/zip', filename , fd)
if __name__ == "__main__":
main()