Merge branch 'master' of https://github.com/WagicProject/wagic into wp8

Fixe timer in Qt frontend
Fixe ExtraCost compilation (uses boost when not on WP8).
This commit is contained in:
xawotihs
2013-11-17 18:33:52 +01:00
20 changed files with 410 additions and 271 deletions
+8 -1
View File
@@ -1,2 +1,9 @@
language: cpp language: cpp
script: "qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug && make -j 8 && ./wagic" before_install:
- export PSPDEV="$TRAVIS_BUILD_DIR/opt/pspsdk"
- export PSPSDK="$PSPDEV/psp/sdk"
- export PATH="$PATH:$PSPDEV/bin:$PSPSDK/bin"
install:
- wget -O sdk.lzma http://sourceforge.net/projects/minpspw/files/SDK%20%2B%20devpak/pspsdk%200.11.2/minpspw_0.11.2-amd64.tar.lzma/download
- tar -x --xz -f sdk.lzma
script: "./travis-script.sh"
+87 -88
View File
@@ -128,11 +128,11 @@ typedef uint8_t u8;
typedef uint16_t u16; typedef uint16_t u16;
typedef uint32_t u32; typedef uint32_t u32;
#define PIXEL_TYPE DWORD #define PIXEL_TYPE DWORD
#define ARGB(a, r, g, b) ((PIXEL_TYPE)((a) << 24) | ((r) << 16) | ((g) << 8) | (b)) #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)) #define RGBA(r, g, b, a) ((PIXEL_TYPE)((a) << 24) | ((b) << 16) | ((g) << 8) | (r))
#ifndef PSP #ifndef PSP
#define TEXTURE_FORMAT 0 #define TEXTURE_FORMAT 0
#endif //PSP #endif //PSP
#ifndef CONSOLE_CONFIG #ifndef CONSOLE_CONFIG
@@ -150,7 +150,7 @@ typedef uint32_t u32;
#include <GL/glu.h> #include <GL/glu.h>
#endif #endif
#else #else
# include <QtOpenGL> #include <QtOpenGL>
#endif #endif
#if (defined FORCE_GLES) #if (defined FORCE_GLES)
@@ -164,105 +164,104 @@ typedef uint32_t u32;
#endif #endif
#if defined (PSP) #if defined (PSP)
#ifndef ABGR8888
#ifndef ABGR8888 #define ABGR8888
#define ABGR8888 #endif
#endif
#if defined (ABGR8888) #if defined (ABGR8888)
#define PIXEL_TYPE u32 #ifndef ARGB
#ifndef ARGB #define ARGB(a, r, g, b) (PIXEL_TYPE)((a << 24) | (b << 16) | (g << 8) | r) // macro to assemble pixels in correct format
#define ARGB(a, r, g, b) (PIXEL_TYPE)((a << 24) | (b << 16) | (g << 8) | r) // macro to assemble pixels in correct format #endif
#endif #define MAKE_COLOR(a, c) (a << 24 | c)
#define MAKE_COLOR(a, c) (a << 24 | c) #define MASK_ALPHA 0xFF000000 // masks for accessing individual pixels
#define MASK_ALPHA 0xFF000000 // masks for accessing individual pixels #define MASK_BLUE 0x00FF0000
#define MASK_BLUE 0x00FF0000 #define MASK_GREEN 0x0000FF00
#define MASK_GREEN 0x0000FF00 #define MASK_RED 0x000000FF
#define MASK_RED 0x000000FF
#define PIXEL_SIZE 4 #define PIXEL_SIZE 4
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_8888 #define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_8888
#define BUFFER_FORMAT GU_PSM_8888 #define BUFFER_FORMAT GU_PSM_8888
#define TEXTURE_FORMAT GU_PSM_8888 #define TEXTURE_FORMAT GU_PSM_8888
#define TEXTURE_COLOR_FORMAT GU_COLOR_8888 #define TEXTURE_COLOR_FORMAT GU_COLOR_8888
#elif defined (ABGR5551) #elif defined (ABGR5551)
#ifndef ARGB #ifndef ARGB
#define ARGB(a, r, g, b) ((r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15)) #define ARGB(a, r, g, b) ((r >> 3) | ((g >> 3) << 5) | ((b >> 3) << 10) | ((a >> 7) << 15))
#endif #endif
#define MAKE_COLOR(a, c) (((a>>7)<<15) | c) #define MAKE_COLOR(a, c) (((a>>7)<<15) | c)
#define MASK_ALPHA 0x8000 #define MASK_ALPHA 0x8000
#define MASK_BLUE 0x7C00 #define MASK_BLUE 0x7C00
#define MASK_GREEN 0x03E0 #define MASK_GREEN 0x03E0
#define MASK_RED 0x001F #define MASK_RED 0x001F
#define PIXEL_TYPE u16 #define PIXEL_TYPE u16
#define PIXEL_SIZE 2 #define PIXEL_SIZE 2
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_5551 #define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_5551
#define BUFFER_FORMAT GU_PSM_8888 #define BUFFER_FORMAT GU_PSM_8888
#define TEXTURE_FORMAT GU_PSM_5551 #define TEXTURE_FORMAT GU_PSM_5551
#define TEXTURE_COLOR_FORMAT GU_COLOR_5551 #define TEXTURE_COLOR_FORMAT GU_COLOR_5551
#elif defined (ABGR4444) #elif defined (ABGR4444)
#ifndef ARGB #ifndef ARGB
#define ARGB(a, r, g, b) ((r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12)) #define ARGB(a, r, g, b) ((r >> 4) | ((g >> 4) << 4) | ((b >> 4) << 8) | ((a >> 4) << 12))
#endif #endif
#define MAKE_COLOR(a, c) (((a>>4)<<12) | c) #define MAKE_COLOR(a, c) (((a>>4)<<12) | c)
#define MASK_ALPHA 0xF000 #define MASK_ALPHA 0xF000
#define MASK_BLUE 0x0F00 #define MASK_BLUE 0x0F00
#define MASK_GREEN 0x00F0 #define MASK_GREEN 0x00F0
#define MASK_RED 0x000F #define MASK_RED 0x000F
#define PIXEL_TYPE u16 #define PIXEL_TYPE u16
#define PIXEL_SIZE 2 #define PIXEL_SIZE 2
#define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_4444 #define PIXEL_FORMAT PSP_DISPLAY_PIXEL_FORMAT_4444
#define BUFFER_FORMAT GU_PSM_4444 #define BUFFER_FORMAT GU_PSM_4444
#define TEXTURE_FORMAT GU_PSM_4444 #define TEXTURE_FORMAT GU_PSM_4444
#define TEXTURE_COLOR_FORMAT GU_COLOR_4444 #define TEXTURE_COLOR_FORMAT GU_COLOR_4444
#endif #endif
#define FRAME_BUFFER_WIDTH 512 #define FRAME_BUFFER_WIDTH 512
#define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE #define FRAME_BUFFER_SIZE FRAME_BUFFER_WIDTH*SCREEN_HEIGHT*PIXEL_SIZE
#define SLICE_SIZE_F 64.0f #define SLICE_SIZE_F 64.0f
typedef unsigned int DWORD; typedef unsigned int DWORD;
#define BLEND_ZERO 0x1000 #define BLEND_ZERO 0x1000
#define BLEND_ONE 0x1002 #define BLEND_ONE 0x1002
#define BLEND_SRC_COLOR GU_SRC_COLOR #define BLEND_SRC_COLOR GU_SRC_COLOR
#define BLEND_ONE_MINUS_SRC_COLOR GU_ONE_MINUS_SRC_COLOR #define BLEND_ONE_MINUS_SRC_COLOR GU_ONE_MINUS_SRC_COLOR
#define BLEND_SRC_ALPHA GU_SRC_ALPHA #define BLEND_SRC_ALPHA GU_SRC_ALPHA
#define BLEND_ONE_MINUS_SRC_ALPHA GU_ONE_MINUS_SRC_ALPHA #define BLEND_ONE_MINUS_SRC_ALPHA GU_ONE_MINUS_SRC_ALPHA
#define BLEND_DST_ALPHA GU_DST_ALPHA #define BLEND_DST_ALPHA GU_DST_ALPHA
#define BLEND_ONE_MINUS_DST_ALPHA GU_ONE_MINUS_DST_ALPHA #define BLEND_ONE_MINUS_DST_ALPHA GU_ONE_MINUS_DST_ALPHA
#define BLEND_DST_COLOR GU_DST_COLOR #define BLEND_DST_COLOR GU_DST_COLOR
#define BLEND_ONE_MINUS_DST_COLOR GU_ONE_MINUS_DST_COLOR #define BLEND_ONE_MINUS_DST_COLOR GU_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE BLEND_ONE #define BLEND_SRC_ALPHA_SATURATE BLEND_ONE
typedef struct typedef struct
{ {
ScePspFVector2 texture; ScePspFVector2 texture;
ScePspFVector3 pos; ScePspFVector3 pos;
} PSPVertex3D; } PSPVertex3D;
#elif !defined(WP8) //non PSP #elif (!defined WP8)
#define BLEND_ZERO GL_ZERO
#define BLEND_ONE GL_ONE #define BLEND_ZERO GL_ZERO
#define BLEND_SRC_COLOR GL_SRC_COLOR #define BLEND_ONE GL_ONE
#define BLEND_ONE_MINUS_SRC_COLOR GL_ONE_MINUS_SRC_COLOR #define BLEND_SRC_COLOR GL_SRC_COLOR
#define BLEND_SRC_ALPHA GL_SRC_ALPHA #define BLEND_ONE_MINUS_SRC_COLOR GL_ONE_MINUS_SRC_COLOR
#define BLEND_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA #define BLEND_SRC_ALPHA GL_SRC_ALPHA
#define BLEND_DST_ALPHA GL_DST_ALPHA #define BLEND_ONE_MINUS_SRC_ALPHA GL_ONE_MINUS_SRC_ALPHA
#define BLEND_ONE_MINUS_DST_ALPHA GL_ONE_MINUS_DST_ALPHA #define BLEND_DST_ALPHA GL_DST_ALPHA
#define BLEND_DST_COLOR GL_DST_COLOR #define BLEND_ONE_MINUS_DST_ALPHA GL_ONE_MINUS_DST_ALPHA
#define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR #define BLEND_DST_COLOR GL_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE #define BLEND_ONE_MINUS_DST_COLOR GL_ONE_MINUS_DST_COLOR
#define BLEND_SRC_ALPHA_SATURATE GL_SRC_ALPHA_SATURATE
#define GU_PSM_8888 0 #define GU_PSM_8888 0
#define GU_PSM_5551 0 #define GU_PSM_5551 0
@@ -287,7 +286,7 @@ typedef uint32_t u32;
#define GU_PSM_4444 0 #define GU_PSM_4444 0
#define GU_PSM_5650 0 #define GU_PSM_5650 0
#endif #endif
#else #else // CONSOLE_CONFIG
typedef uint32_t GLuint; typedef uint32_t GLuint;
typedef float GLfloat; typedef float GLfloat;
#endif //CONSOLE_CONFIG #endif //CONSOLE_CONFIG
+4
View File
@@ -67,6 +67,9 @@ public:
void registerDefaultBindings(); void registerDefaultBindings();
static WagicCore* getInstance() { return s_instance; }; static WagicCore* getInstance() { return s_instance; };
char *GetName(){ return m_launcher->GetName();}; char *GetName(){ return m_launcher->GetName();};
#ifdef QT_CONFIG
QTime startTime;
#endif
private: private:
void doAndEnqueue(JButton action) { void doAndEnqueue(JButton action) {
@@ -75,6 +78,7 @@ private:
} }
private: private:
friend int JGEGetTime();
static WagicCore* s_instance; static WagicCore* s_instance;
JGE* m_engine; JGE* m_engine;
JApp* m_app; JApp* m_app;
+2
View File
@@ -16,7 +16,9 @@ User folder is the only one that is really needed to guarantee both read and wri
The content that users should not be touching. The content that users should not be touching.
*/ */
#ifndef PSP
#include "PrecompiledHeader.h" #include "PrecompiledHeader.h"
#endif //PSP
#ifdef WIN32 #ifdef WIN32
#pragma warning(disable : 4786) #pragma warning(disable : 4786)
-1
View File
@@ -84,7 +84,6 @@ public: /* For easy interfacing with JGE static functions */
bool Running; bool Running;
SDL_Window* window; SDL_Window* window;
SDL_Surface* Surf_Display; SDL_Surface* Surf_Display;
// SDL_Rect viewPort;
Uint32 lastMouseUpTime; Uint32 lastMouseUpTime;
Uint32 lastFingerDownTime; Uint32 lastFingerDownTime;
int windowed_w; int windowed_w;
+5 -2
View File
@@ -19,8 +19,11 @@ WagicCore* WagicCore::s_instance = 0;
WagicCore::WagicCore() : WagicCore::WagicCore() :
m_engine(0), m_app(0), m_launcher(0), m_active(false) m_engine(0), m_app(0), m_launcher(0), m_active(false)
{ {
#ifdef QT_CONFIG
startTime = QTime::currentTime();
#endif //QT_CONFIG
s_instance = this;
m_lastTickCount = JGEGetTime(); m_lastTickCount = JGEGetTime();
s_instance = this;
} }
void WagicCore::initApp() void WagicCore::initApp()
@@ -367,7 +370,7 @@ int JGEGetTime()
#ifdef SDL_CONFIG #ifdef SDL_CONFIG
return (int)SDL_GetTicks(); return (int)SDL_GetTicks();
#elif defined QT_CONFIG #elif defined QT_CONFIG
return QTime::currentTime().elapsed(); return WagicCore::s_instance->startTime.msecsTo(QTime::currentTime());
#elif defined WP8 #elif defined WP8
return (int)GetTickCount64(); return (int)GetTickCount64();
#endif #endif
-10
View File
@@ -1,10 +0,0 @@
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/gen/net/wagic/app/R.java \
: /Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-hdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-ldpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/drawable-mdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/layout/main.xml \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/res/values/strings.xml \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-hdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-ldpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/res/drawable-mdpi/icon.png \
/Volumes/data/home/mnguyen/Projects/eclipse-workspace/wagic/projects/mtg/Android/bin/AndroidManifest.xml \
@@ -1,6 +0,0 @@
/** Automatically generated file. DO NOT MODIFY */
package net.wagic.app;
public final class BuildConfig {
public final static boolean DEBUG = true;
}
@@ -1,27 +0,0 @@
/* AUTO-GENERATED FILE. DO NOT MODIFY.
*
* This class was automatically generated by the
* aapt tool from the resource data it found. It
* should not be modified by hand.
*/
package net.wagic.app;
public final class R {
public static final class attr {
}
public static final class drawable {
public static final int icon=0x7f020000;
}
public static final class id {
public static final int mainLayout=0x7f050000;
}
public static final class layout {
public static final int main=0x7f030000;
}
public static final class string {
public static final int app_name=0x7f040000;
public static final int app_version=0x7f040001;
public static final int info_text=0x7f040002;
}
}
@@ -54,10 +54,6 @@ import android.view.View.OnKeyListener;
import android.widget.FrameLayout; import android.widget.FrameLayout;
import android.widget.FrameLayout.LayoutParams; import android.widget.FrameLayout.LayoutParams;
import com.google.ads.AdRequest;
import com.google.ads.AdSize;
import com.google.ads.AdView;
/** /**
* SDL Activity * SDL Activity
*/ */
@@ -68,7 +64,6 @@ public class SDLActivity extends Activity implements OnKeyListener
public static String TAG = Activity.class.getCanonicalName(); public static String TAG = Activity.class.getCanonicalName();
// Main components // Main components
private static AdView mAdView;
private static SDLActivity mSingleton; private static SDLActivity mSingleton;
private static SDLSurface mSurface; private static SDLSurface mSurface;
@@ -422,25 +417,12 @@ public class SDLActivity extends Activity implements OnKeyListener
SurfaceHolder holder = mSurface.getHolder(); SurfaceHolder holder = mSurface.getHolder();
holder.setType(SurfaceHolder.SURFACE_TYPE_GPU); holder.setType(SurfaceHolder.SURFACE_TYPE_GPU);
// Create the adView
mAdView = new AdView(this, AdSize.BANNER, "a14e9009f88864f"); // "a14dc0ab7b27413" <-- for the alpha);
_videoLayout.addView(mSurface, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); _videoLayout.addView(mSurface, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
_videoLayout.addView(mAdView, new LayoutParams(LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT, Gravity.BOTTOM + Gravity.CENTER_HORIZONTAL));
// mGLView.setFocusableInTouchMode(true); // mGLView.setFocusableInTouchMode(true);
// mGLView.setFocusable(true); // mGLView.setFocusable(true);
// adView.requestFreshAd(); // adView.requestFreshAd();
setContentView(_videoLayout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT)); setContentView(_videoLayout, new LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.FILL_PARENT));
mSurface.requestFocus(); mSurface.requestFocus();
AdRequest request = new AdRequest();
request.addTestDevice(AdRequest.TEST_EMULATOR);
request.addTestDevice("1DA1E070BC7D4ABE8BA77EB73C2CB0AA"); // wololo's phone
request.addTestDevice("C386F3830A9789C649098A817BF54C04"); // xawotihs's tablet
// Initiate a generic request to load it with an ad
mAdView.loadAd(request);
} }
// Setup // Setup
@@ -512,14 +494,6 @@ public class SDLActivity extends Activity implements OnKeyListener
{ {
return; return;
} }
if ((command.compareTo("entergamestate:menu") == 0) || (command.compareTo("enterduelphase:end") == 0))
{
mAdView.setVisibility(View.VISIBLE);
} else if (command.compareTo("leavegamestate:menu") == 0)
{
mAdView.setVisibility(View.INVISIBLE);
}
} }
// Messages from the SDLMain thread // Messages from the SDLMain thread
+30 -1
View File
@@ -1,4 +1,33 @@
OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o objs/ActionLayer.o objs/ActionStack.o objs/AIHints.o objs/AIMomirPlayer.o objs/AIPlayer.o objs/AIPlayerBaka.o objs/AIStats.o objs/AllAbilities.o objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/CardEffect.o objs/CardPrimitive.o objs/CardSelector.o objs/CardSelectorSingleton.o objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o objs/GameObserver.o objs/GameOptions.o objs/GameState.o objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o objs/GameStateShop.o objs/GameStateStory.o objs/GameStateTransitions.o objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o objs/IconButton.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o objs/ModRules.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o objs/MTGPack.o objs/MTGRules.o objs/Navigator.o objs/ObjectAnalytics.o objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PlayRestrictions.o objs/Pos.o objs/PrecompiledHeader.o objs/PriceList.o objs/ReplacementEffects.o objs/Rules.o objs/SimpleMenu.o objs/SimpleButton.o objs/SimpleMenuItem.o objs/SimplePad.o objs/SimplePopup.o objs/StoryFlow.o objs/StyleManager.o objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.o objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o objs/WFont.o OBJS = objs/InteractiveButton.o objs/AbilityParser.o objs/ActionElement.o\
objs/ActionLayer.o objs/ActionStack.o objs/AIHints.o objs/AIMomirPlayer.o\
objs/AIPlayer.o objs/AIPlayerBaka.o objs/AIStats.o objs/AllAbilities.o\
objs/CardGui.o objs/CardDescriptor.o objs/CardDisplay.o objs/CardEffect.o\
objs/CardPrimitive.o objs/CardSelector.o objs/CardSelectorSingleton.o\
objs/Counters.o objs/Credits.o objs/Damage.o objs/DamagerDamaged.o\
objs/DeckDataWrapper.o objs/DeckEditorMenu.o objs/DeckMenu.o\
objs/DeckMenuItem.o objs/DeckMetaData.o objs/DeckStats.o objs/DuelLayers.o\
objs/Effects.o objs/ExtraCost.o objs/GameApp.o objs/GameLauncher.o\
objs/GameObserver.o objs/GameOptions.o objs/GameState.o\
objs/GameStateAwards.o objs/GameStateDeckViewer.o objs/GameStateDuel.o\
objs/DeckManager.o objs/GameStateMenu.o objs/GameStateOptions.o\
objs/GameStateShop.o objs/GameStateStory.o objs/GameStateTransitions.o\
objs/GuiAvatars.o objs/GuiBackground.o objs/GuiCardsController.o\
objs/GuiCombat.o objs/GuiFrame.o objs/GuiHand.o objs/GuiLayers.o\
objs/GuiMana.o objs/GuiPhaseBar.o objs/GuiPlay.o objs/GuiStatic.o\
objs/IconButton.o objs/ManaCost.o objs/ManaCostHybrid.o objs/MenuItem.o\
objs/ModRules.o objs/MTGAbility.o objs/MTGCardInstance.o objs/MTGCard.o\
objs/MTGDeck.o objs/MTGDefinitions.o objs/MTGGamePhase.o objs/MTGGameZones.o\
objs/MTGPack.o objs/MTGRules.o objs/Navigator.o objs/ObjectAnalytics.o\
objs/OptionItem.o objs/PhaseRing.o objs/Player.o objs/PlayerData.o\
objs/PlayGuiObjectController.o objs/PlayGuiObject.o objs/PlayRestrictions.o\
objs/Pos.o objs/PrecompiledHeader.o objs/PriceList.o objs/ReplacementEffects.o\
objs/Rules.o objs/SimpleMenu.o objs/SimpleButton.o objs/SimpleMenuItem.o\
objs/SimplePad.o objs/SimplePopup.o objs/StoryFlow.o objs/StyleManager.o\
objs/Subtypes.o objs/TargetChooser.o objs/TargetsList.o objs/TextScroller.o\
objs/ThisDescriptor.o objs/Token.o objs/Translate.o objs/TranslateKeys.o\
objs/Trash.o objs/utils.o objs/WEvent.o objs/WResourceManager.o\
objs/WCachedResource.o objs/WDataSrc.o objs/WGui.o objs/WFilter.o objs/Tasks.o\
objs/WFont.o
DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS)) DEPS = $(patsubst objs/%.o, deps/%.d, $(OBJS))
RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache) RESULT = $(shell psp-config --psp-prefix 2> Makefile.cache)
+106
View File
@@ -0,0 +1,106 @@
[meta]
author=Wagic Team
name=From the Vault: Twenty
block=Vault
year=2013
[/meta]
[card]
primitive=Akroma's Vengeance
id=373328
rarity=M
[/card]
[card]
primitive=Chainer's Edict
id=373317
rarity=M
[/card]
[card]
primitive=Chameleon Colossus
id=373321
rarity=M
[/card]
[card]
primitive=Char
id=373332
rarity=M
[/card]
[card]
primitive=Cruel Ultimatum
id=373318
rarity=M
[/card]
[card]
primitive=Dark Ritual
id=373329
rarity=M
[/card]
[card]
primitive=Fact or Fiction
id=373325
rarity=M
[/card]
[card]
primitive=Fyndhorn Elves
id=373320
rarity=M
[/card]
[card]
primitive=Gilded Lotus
id=373335
rarity=M
[/card]
[card]
primitive=Green Sun's Zenith
id=373333
rarity=M
[/card]
[card]
primitive=Hymn to Tourach
id=373324
rarity=M
[/card]
[card]
primitive=Impulse
id=373330
rarity=M
[/card]
[card]
primitive=Ink-Eyes, Servant of Oni
id=373327
rarity=M
[/card]
[card]
primitive=Jace, the Mind Sculptor
id=373316
rarity=M
[/card]
[card]
primitive=Kessig Wolf Run
id=373323
rarity=M
[/card]
[card]
primitive=Swords to Plowshares
id=373334
rarity=M
[/card]
[card]
primitive=Tangle Wire
id=373322
rarity=M
[/card]
[card]
primitive=Thran Dynamo
id=373331
rarity=M
[/card]
[card]
primitive=Venser, Shaper Savant
id=373326
rarity=M
[/card]
[card]
primitive=Wall of Blossoms
id=373319
rarity=M
[/card]
+17 -5
View File
@@ -17432,7 +17432,7 @@ toughness=4
[card] [card]
name=Cranial Plating name=Cranial Plating
auto=foreach(artifact|mybattlefield) 1/0 auto=foreach(artifact|mybattlefield) 1/0
auto={B}{B}:attach auto={B}{B}:name(attach) retarget target(creature|mybattlefield)
auto={1}:equip auto={1}:equip
text=Equipped creature gets +1/+0 for each artifact you control. -- {B}{B}: Attach Cranial Plating to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) text=Equipped creature gets +1/+0 for each artifact you control. -- {B}{B}: Attach Cranial Plating to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
mana={2} mana={2}
@@ -39826,7 +39826,7 @@ name=Healer's Headdress
auto={1}:equip auto={1}:equip
auto=0/2 auto=0/2
auto=teach(creature) {T}:prevent:1 target(creature,player) auto=teach(creature) {T}:prevent:1 target(creature,player)
auto={W}{W}:attach auto={W}{W}:name(attach) retarget target(creature|mybattlefield)
text=Equipped creature gets +0/+2 and has "{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn." -- {W}{W}: Attach Healer's Headdress to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) text=Equipped creature gets +0/+2 and has "{T}: Prevent the next 1 damage that would be dealt to target creature or player this turn." -- {W}{W}: Attach Healer's Headdress to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
mana={2} mana={2}
type=Artifact type=Artifact
@@ -41596,7 +41596,7 @@ toughness=2
name=Horned Helm name=Horned Helm
auto=1/1 auto=1/1
auto=trample auto=trample
auto={G}{G}:attach auto={G}{G}:name(attach) retarget target(creature|mybattlefield)
auto={1}:equip auto={1}:equip
text=Equipped creature gets +1/+1 and has trample. -- {G}{G}: Attach Horned Helm to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) text=Equipped creature gets +1/+1 and has trample. -- {G}{G}: Attach Horned Helm to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
mana={2} mana={2}
@@ -54155,6 +54155,18 @@ power=2
toughness=2 toughness=2
[/card] [/card]
[card] [card]
name=Master of Waves
abilities=protection from red
auto=lord(Elemental|mybattlefield) 1/1
auto=token(Elemental,Creature Elemental,1/0)*type:manaU
text=Protection from red. -- Elemental creatures you control get +1/+1. -- When Master of Waves enters the battlefield, put a number of 1/0 blue Elemental creature tokens onto the battlefield equal to your devotion to blue. (Each {U} in the mana costs of permanents you control counts toward your devotion to blue.)
mana={3}{U}
type=Creature
subtype=Merfolk Wizard
power=2
toughness=1
[/card]
[card]
name=Master Splicer name=Master Splicer
auto=token(Golem,Artifact Creature Golem,3/3) auto=token(Golem,Artifact Creature Golem,3/3)
auto=lord(golem|mybattlefield) 1/1 auto=lord(golem|mybattlefield) 1/1
@@ -59971,7 +59983,7 @@ toughness=2
[card] [card]
name=Neurok Stealthsuit name=Neurok Stealthsuit
auto=teach(creature) shroud auto=teach(creature) shroud
auto={U}{U}:attach auto={U}{U}:name(attach) retarget target(creature|mybattlefield)
auto={1}:equip auto={1}:equip
text=Equipped creature has shroud. (It can't be the target of spells or abilities.) -- {U}{U}: Attach Neurok Stealthsuit to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) text=Equipped creature has shroud. (It can't be the target of spells or abilities.) -- {U}{U}: Attach Neurok Stealthsuit to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
mana={2} mana={2}
@@ -83425,7 +83437,7 @@ toughness=3
[card] [card]
name=Sparring Collar name=Sparring Collar
auto=first strike auto=first strike
auto={R}{R}:attach auto={R}{R}:name(attach) retarget target(creature|mybattlefield)
auto={1}:equip auto={1}:equip
text=Equipped creature has first strike. -- {R}{R}: Attach Sparring Collar to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.) text=Equipped creature has first strike. -- {R}{R}: Attach Sparring Collar to target creature you control. -- Equip {1} ({1}: Attach to target creature you control. Equip only as a sorcery.)
mana={2} mana={2}
+12 -101
View File
@@ -2794,113 +2794,24 @@ public:
//equipment //equipment
class AEquip: public TargetAbility class AEquip: public TargetAbility
{ {
public: private:
bool isAttach;
vector<MTGAbility *> currentAbilities; vector<MTGAbility *> currentAbilities;
AEquip(GameObserver* observer, int _id, MTGCardInstance * _source, ManaCost * _cost = NULL, int restrictions =
ActivatedAbility::AS_SORCERY) :
TargetAbility(observer, _id, _source, NULL, _cost, restrictions)
{
aType = MTGAbility::STANDARD_EQUIP;
}
int unequip() public:
{ AEquip(GameObserver* observer, int _id, MTGCardInstance * _source, ManaCost * _cost = NULL,
if (source->target) int restrictions = ActivatedAbility::AS_SORCERY);
{
source->target->equipment -= 1;
source->parentCards.clear();
for(unsigned int w = 0;w < source->target->childrenCards.size();w++)
{
MTGCardInstance * child = source->target->childrenCards[w];
if(child == source)
source->target->childrenCards.erase(source->target->childrenCards.begin() + w);
}
}
source->target = NULL;
for (size_t i = 0; i < currentAbilities.size(); ++i)
{
MTGAbility * a = currentAbilities[i];
if (dynamic_cast<AEquip *> (a) || dynamic_cast<ATeach *> (a) || dynamic_cast<AAConnect *> (a) || (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot))
{
SAFE_DELETE(a);
continue;
}
game->removeObserver(currentAbilities[i]);
}
currentAbilities.clear();
return 1;
}
int equip(MTGCardInstance * equipped) int unequip();
{ int equip(MTGCardInstance * equipped);
source->target = equipped;
source->target->equipment += 1;
source->parentCards.push_back(equipped);
source->target->childrenCards.push_back((MTGCardInstance*)source);
AbilityFactory af(game);
af.getAbilities(&currentAbilities, NULL, source);
for (size_t i = 0; i < currentAbilities.size(); ++i)
{
MTGAbility * a = currentAbilities[i];
if (dynamic_cast<AEquip *> (a)) continue;
if (dynamic_cast<ATeach *> (a)) continue;
if (dynamic_cast<AAConnect *> (a)) continue;
if (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot)
{
a->forceDestroy = 1;
continue;
}
if (dynamic_cast<AACopier *> (af.getCoreAbility(a)))
{
a->forceDestroy = 1;
continue;
}
//we generally dont want to pass oneShot tokencreators to the cards
//we equip...
a->addToGame();
}
return 1;
} int resolve();
const char * getMenuText();
int resolve() int testDestroy();
{ int destroy();
MTGCardInstance * mTarget = tc->getNextCardTarget();
if (!mTarget) return 0;
if (mTarget == source) return 0;
unequip();
equip(mTarget);
return 1;
}
const char * getMenuText()
{
return "Equip";
}
int testDestroy()
{
if (source->target && !game->isInPlay(source->target))
unequip();
if(!game->connectRule)
{
if (source->target && TargetAbility::tc && !TargetAbility::tc->canTarget((Targetable *)source->target,true))
unequip();
}
return TargetAbility::testDestroy();
}
int destroy()
{
unequip();
return TargetAbility::destroy();
}
AEquip * clone() const
{
return NEW AEquip(*this);
}
AEquip * clone() const;
}; };
class ATokenCreator: public ActivatedAbility class ATokenCreator: public ActivatedAbility
+109
View File
@@ -5291,6 +5291,115 @@ AAConnect * AAConnect::clone() const
return NEW AAConnect(*this); return NEW AAConnect(*this);
} }
AEquip::AEquip(GameObserver* observer, int _id, MTGCardInstance * _source, ManaCost * _cost, int restrictions) :
TargetAbility(observer, _id, _source, NULL, _cost, restrictions)
{
aType = MTGAbility::STANDARD_EQUIP;
isAttach = restrictions != ActivatedAbility::AS_SORCERY;
}
int AEquip::unequip()
{
if (source->target)
{
source->target->equipment -= 1;
source->parentCards.clear();
for (unsigned int w = 0; w < source->target->childrenCards.size(); w++)
{
MTGCardInstance * child = source->target->childrenCards[w];
if (child == source)
source->target->childrenCards.erase(source->target->childrenCards.begin() + w);
}
}
source->target = NULL;
for (size_t i = 0; i < currentAbilities.size(); ++i)
{
MTGAbility * a = currentAbilities[i];
if (dynamic_cast<AEquip *> (a) || dynamic_cast<ATeach *> (a) || dynamic_cast<AAConnect *> (a)
|| (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot))
{
SAFE_DELETE(a);
continue;
}
game->removeObserver(currentAbilities[i]);
}
currentAbilities.clear();
return 1;
}
int AEquip::equip(MTGCardInstance * equipped)
{
source->target = equipped;
source->target->equipment += 1;
source->parentCards.push_back(equipped);
source->target->childrenCards.push_back((MTGCardInstance*)source);
AbilityFactory af(game);
af.getAbilities(&currentAbilities, NULL, source);
for (size_t i = 0; i < currentAbilities.size(); ++i)
{
MTGAbility * a = currentAbilities[i];
if (dynamic_cast<AEquip *> (a)) continue;
if (dynamic_cast<ATeach *> (a)) continue;
if (dynamic_cast<AAConnect *> (a)) continue;
if (dynamic_cast<AANewTarget *> (af.getCoreAbility(a))) continue;
if (a->aType == MTGAbility::STANDARD_TOKENCREATOR && a->oneShot)
{
a->forceDestroy = 1;
continue;
}
if (dynamic_cast<AACopier *> (af.getCoreAbility(a)))
{
a->forceDestroy = 1;
continue;
}
//we generally dont want to pass oneShot tokencreators to the cards
//we equip...
a->addToGame();
}
return 1;
}
int AEquip::resolve()
{
MTGCardInstance * mTarget = tc->getNextCardTarget();
if (!mTarget) return 0;
if (mTarget == source) return 0;
unequip();
equip(mTarget);
return 1;
}
const char * AEquip::getMenuText()
{
if (isAttach)
return "Attach";
else
return "Equip";
}
int AEquip::testDestroy()
{
if (source->target && !game->isInPlay(source->target))
unequip();
if (!game->connectRule)
{
if (source->target && TargetAbility::tc && !TargetAbility::tc->canTarget((Targetable *)source->target,true))
unequip();
}
return TargetAbility::testDestroy();
}
int AEquip::destroy()
{
unequip();
return TargetAbility::destroy();
}
AEquip * AEquip::clone() const
{
return NEW AEquip(*this);
}
// casting a card for free, or casting a copy of a card. // casting a card for free, or casting a copy of a card.
AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent) : AACastCard::AACastCard(GameObserver* observer, int _id, MTGCardInstance * _source, MTGCardInstance * _target,bool _restricted,bool _copied,bool asNormal,string _namedCard,string _name,bool _noEvent) :
MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent) MTGAbility(observer, _id, _source),restricted(_restricted),asCopy(_copied),normal(asNormal),cardNamed(_namedCard),nameThis(_name),noEvent(_noEvent)
+10 -1
View File
@@ -7,7 +7,11 @@
#include "Player.h" #include "Player.h"
#include "Counters.h" #include "Counters.h"
#include "AllAbilities.h" #include "AllAbilities.h"
#ifdef WP8
#include <memory> #include <memory>
#else
#include <boost/scoped_ptr.hpp>
#endif
SUPPORT_OBJECT_ANALYTICS(ExtraCost) SUPPORT_OBJECT_ANALYTICS(ExtraCost)
@@ -171,7 +175,12 @@ LifeorManaCost::LifeorManaCost(TargetChooser *_tc, string manaType)
string buildType ="{"; string buildType ="{";
buildType.append(manaType); buildType.append(manaType);
buildType.append("}"); buildType.append("}");
std::unique_ptr<ManaCost> cost(ManaCost::parseManaCost(buildType)); #ifdef WP8
std::unique_ptr<ManaCost>
#else
boost::scoped_ptr<ManaCost>
#endif
cost(ManaCost::parseManaCost(buildType));
manaCost.copy(cost.get()); manaCost.copy(cost.get());
} }
+1
View File
@@ -2163,6 +2163,7 @@ MTGAbility * AbilityFactory::parseMagicLine(string s, int id, Spell * spell, MTG
return NEW AEquip(observer, id, card); return NEW AEquip(observer, id, card);
} }
// TODO: deprecate this ability in favor of retarget
//Equipment (attach) //Equipment (attach)
found = s.find("attach"); found = s.find("attach");
if (found != string::npos) if (found != string::npos)
+1 -1
View File
@@ -324,8 +324,8 @@ SOURCES += \
../../JGE/src/JParticleSystem.cpp\ ../../JGE/src/JParticleSystem.cpp\
../../JGE/src/JResourceManager.cpp\ ../../JGE/src/JResourceManager.cpp\
../../JGE/src/JSpline.cpp\ ../../JGE/src/JSpline.cpp\
../../JGE/src/pc/JSocket.cpp\
../../JGE/src/pc/JSfx.cpp\ ../../JGE/src/pc/JSfx.cpp\
../../JGE/src/pc/JSocket.cpp\
../../JGE/src/JNetwork.cpp\ ../../JGE/src/JNetwork.cpp\
../../JGE/src/JSprite.cpp\ ../../JGE/src/JSprite.cpp\
../../JGE/src/Vector2D.cpp\ ../../JGE/src/Vector2D.cpp\
+17
View File
@@ -0,0 +1,17 @@
#!/bin/sh -ex
# we're building a PSP binary here
cd JGE
make -j 8
cd ..
cd projects/mtg
mkdir objs
make -j 8
# let's try an Intel linux binary
cd ../..
qmake projects/mtg/wagic-qt.pro CONFIG+=console CONFIG+=debug
make -j 8
# and finish by running the testsuite
./wagic