UPDATE YOUR rules FOLDER!!!
- This is some Work in progress to make Wagic less "game" dependent. This change especially is an attempt at moving away from some dangerous patents owned by some company. It introduces "modrules.xml", a global configuration file describing dynamic settings for any given Wagic mod. It is very basic for now, but allows to customize a bit. In particular, it allows to remove the concept of shop and deck editor from the game, dynamically generate the main menu, and represent card activation with a mask rather than a rotation. I have a sample in progress which I hope to submit in the days to come, a proof of concept (nothing fancy yet) for another type of game using these ideas, as well as a few other things I introduced recently. In the future, I am hoping to extend modrules.xml so that it entirely describes the rules of a given card game. the other files in rules.txt will describe "extensions" to the core rules, just like they do right now, so this new file does not make them obsolete. - Also fixed minor bugs I stumbled upon while developing
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include "GuiPlay.h"
|
||||
#include "Subtypes.h"
|
||||
#include "Trash.h"
|
||||
#include "ModRules.h"
|
||||
|
||||
#define CARD_WIDTH (31)
|
||||
|
||||
@@ -236,12 +237,12 @@ void GuiPlay::Replace()
|
||||
}
|
||||
}
|
||||
float x = 24 + opponentSpells.nextX();
|
||||
//seperated the varible X into 2 different varibles. There are 2 players here!!
|
||||
//we should not be using a single varible to determine the positioning of cards!!
|
||||
//seperated the variable X into 2 different variables. There are 2 players here!!
|
||||
//we should not be using a single variable to determine the positioning of cards!!
|
||||
float myx = 24 + selfSpells.nextX();
|
||||
opponentLands.reset(opponentLandsN,x, 50);
|
||||
opponentCreatures.reset(opponentCreaturesN, x, 95);
|
||||
battleField.reset(x, 145);//what does this varible do? i can comment it out with no reprocussions...is this being double handled?
|
||||
battleField.reset(x, 145);//what does this variable do? I can comment it out with no repercussions...is this being double handled?
|
||||
selfCreatures.reset(selfCreaturesN, myx, 195);
|
||||
selfLands.reset(selfLandsN, myx, 240);
|
||||
|
||||
@@ -346,7 +347,12 @@ int GuiPlay::receiveEventPlus(WEvent * e)
|
||||
else
|
||||
card = NEW CardView(CardView::playZone, event->card, 0, 0);
|
||||
cards.push_back(card);
|
||||
card->t = event->card->isTapped() ? M_PI / 2 : 0;
|
||||
|
||||
if (event->card->isTapped())
|
||||
gModRules.cards.activateEffect->doEffect(card);
|
||||
else
|
||||
gModRules.cards.activateEffect->undoEffect(card);
|
||||
|
||||
card->alpha = 255;
|
||||
|
||||
// Make sure that the card is repositioned before adding it to the CardSelector, as
|
||||
@@ -371,10 +377,20 @@ int GuiPlay::receiveEventPlus(WEvent * e)
|
||||
else if (WEventCardTap* event = dynamic_cast<WEventCardTap*>(e))
|
||||
{
|
||||
if (CardView* cv = dynamic_cast<CardView*>(event->card->view))
|
||||
cv->t = event->after ? M_PI / 2 : 0;
|
||||
{
|
||||
if (event->after)
|
||||
gModRules.cards.activateEffect->doEffect(cv);
|
||||
else
|
||||
gModRules.cards.activateEffect->undoEffect(cv);
|
||||
//cv->t = event->after ? M_PI / 2 : 0;
|
||||
}
|
||||
else if (event->card->view != NULL)
|
||||
{
|
||||
event->card->view->actT = event->after ? M_PI / 2 : 0;
|
||||
if (event->after)
|
||||
gModRules.cards.activateEffect->doEffect(event->card->view);
|
||||
else
|
||||
gModRules.cards.activateEffect->undoEffect(event->card->view);
|
||||
//event->card->view->actT = event->after ? M_PI / 2 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user