Mod Pokewon [Alpha VER]

Graphics and Themes you created go here.
Please read the Image Theme Guide, FAQ, & Index before posting in this forum.
Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Mod Pokewon [Alpha VER]

Post by Zethfox » Thu Mar 31, 2011 4:30 pm

the abilities= keywords can not have their effects changed.

rodrigo.demoura
Posts: 47
Joined: Wed Jun 02, 2010 6:31 pm

Re: Mod Pokewon [Alpha VER]

Post by rodrigo.demoura » Thu Mar 31, 2011 5:36 pm

Zethfox
I expressed it badly
I coded to work with "auto ="
example

Code: Select all

auto=resist(grass,10)
coded in this way

Code: Select all

//Pokewon modify
//Resist ability 
class AResistAbility: public MTGAbility
{
public:
    MTGCardInstance * opponents[20];
    int nbOpponents;
	int PowerModifier;
	string CarSubType;
    AResistAbility(int _id, MTGCardInstance * _source,int _PowerModifier,string _CarSubType) :
        MTGAbility(_id, _source)
    {
		PowerModifier = _PowerModifier;    
		CarSubType = _CarSubType;
		nbOpponents = 0;
    }
    int receiveEvent(WEvent * event)
    {
		//WEventDamage
		 if (dynamic_cast<WEventBlockersChosen*> (event))
        {
			nbOpponents = 0;
			if(! source->isDefenser())
				return 0;

			MTGCardInstance * opponent = source->getNextOpponent();
		
			if(! opponent->hasSubtype(CarSubType))
				return 0;
			if(opponent->power == 0)
				return 0;
			if (PowerModifier == 0)
			{
				PowerModifier = opponent->power;
			}
			else if (opponent->power - PowerModifier < 0 )
				PowerModifier = opponent->power;
			
			AInstantPowerToughnessModifierUntilEOT * a = NEW AInstantPowerToughnessModifierUntilEOT(opponent->getId(), opponent, opponent, NEW WParsedPT(PowerModifier * -1 ,0));
            GenericInstantAbility * wrapper = NEW GenericInstantAbility(1, opponent,opponent, a);
            wrapper->addToGame();
            return 1;

        }
    }


       
    virtual ostream& toString(ostream& out) const
    {
        out << "AResistAbility ::: opponents : " << opponents << " ; nbOpponents : " << nbOpponents << " (";
        return MTGAbility::toString(out) << ")";
    }

    AResistAbility * clone() const
    {
        AResistAbility * a = NEW AResistAbility(*this);
        a->isClone = 1;
        return a;
    }
};

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Mod Pokewon [Alpha VER]

Post by Zethfox » Thu Mar 31, 2011 6:11 pm

NOW we talking! :D :D if you want it done in c++ i can help, just tell me what exactly you need it to do.
for example,
auto=resist(grass,10)
does this mean the pokemon will not be hit by the first 10 damage of "grass" type?
so if the creature is "grass 13" then the pokemon with grass 10 resist will take 3 damage?

unless you mean thats already working?

btw in the rules you posted
#Can be just one active pokemon on Battlefield
auto=@each my combatbegins:aslongas(creature|myBattlefield) token(-1r)

auto=lord(creature[-counter{0/0.1.Active}]) cantattack
auto=lord(creature[-counter{0/0.1.Active}]) cantblock


try this instead:
auto=lord(creature[-active]) cantattack
auto=lord(creature[-active]) cantblock
auto=@each mycombatbegins:target(creature|mybattlefield) transforms((active)) ueot

of course we will need to modify the ai to not crash while deciding who to make active lol...and to play its creatures more often, but you get the idea.

rodrigo.demoura
Posts: 47
Joined: Wed Jun 02, 2010 6:31 pm

Re: Mod Pokewon [Alpha VER]

Post by rodrigo.demoura » Thu Mar 31, 2011 6:30 pm

that's it.
rodrigo.demoura wrote: I am making some modifications to adapt the source code for Wagic to play pokemon tcg.

Have already created three abilities:

Pokeharm: (source takes damage in the form of counters 0/-10) ability equal to wither

Weakness (subtype, value): (source takes double damage or a damage value)
Resist (subtype, value): (source prevents a damage value)



But I have some doubts:
How do I implement the ability Must Block? In this game only one creature can attack and defend each turn
How do I implement a rule to check for an active creature in the game? I would like to create the rules for the game checks each turn
and it was stored in a variable. With this I create an activation cost that depends on what the creature is active.

Something like {A} {U}: 10 / 0
or
target (creature [-Active] | opponentBattlefield):


I create a dirty way to do this, but I want to improve it and code on source to create a hability
Rules.txt

Code: Select all

[INIT]
mode=mtg
[PLAYERS]
life:6
auto=shuffle
auto=draw:7
auto=@each my draw:draw:1
auto=lord(creature) pokeharm
auto=lord(creature) vigilance

#Can be just one active pokemon on Battlefield
auto=@each my combatbegins:aslongas(creature|myBattlefield) token(-1r)

auto=lord(creature[-counter{0/0.1.Active}]) cantattack
auto=lord(creature[-counter{0/0.1.Active}]) cantblock

#Only 6 creatures in play
auto=aslongas(creature|myBattlefield)) >5 maxCast(creature)0

#Attach only one energy card per turn
auto=maxCast(Energy)1
The Rule card

Code: Select all

[card]
name=Active Pokewon
auto=aslongas(creature[counter{0/0.1.Active}]|myBattlefield):moveto(stack)
auto=@movedto(this|exile):counter(0/0,1,Active) target(creature|myBattlefield)  
auto=moveto(exile)
type=Nothing
id=-1r
[/card]
Now I'm trying to create the above rules not to use the resource of the counter. :)

rodrigo.demoura
Posts: 47
Joined: Wed Jun 02, 2010 6:31 pm

Re: Mod Pokewon [Alpha VER]

Post by rodrigo.demoura » Thu Mar 31, 2011 6:54 pm

The rules of the games I have to choose a creature for battle. and I can not change every turn. To change the creature I have to pay a cost.

So I need to check each turn if the player no longer has an active creature to fight.

If the player at the end of the shift does not have an active creature, the opponent wins the game immediately.

So I created the token to see if the player has or not and make the choice.

What is my intention to: Create a GameObserver to look at each combatbegins If the player has an active creature. If not it will have to choose a creature.

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Mod Pokewon [Alpha VER]

Post by Zethfox » Sat Apr 02, 2011 11:53 am

oh btw, not sure if you know, but in the rules.txt, i added a custom phase ring builder (which wololo will change at some point) that allows you to build a custom phase ring...
use this...
customphasering=draw,firstmain,combatbegins,combatends,endofturn

so what this does is have a turn in that order, no upkeep, no secondmain, no attackers/blockers(since pokemon isn't really like that, instead when combat begins you just start attacking with only abilities on cards)...this is REALLY close to pokemon phase ring.
combatbegins can be the "fighting step" then combat ends would be the "gain your prize card", retreat, check if you won, step or whatever....you get the idea.

rodrigo.demoura
Posts: 47
Joined: Wed Jun 02, 2010 6:31 pm

Re: Mod Pokewon [Alpha VER]

Post by rodrigo.demoura » Thu Apr 14, 2011 8:28 pm

Guys I have a problem.
I changed the source code including the new colors of the pokemon cards. With that I can not open the menu editing of decks.
I'm putting the source code version that has changed.
If someone can help ... :)

http://www.mediafire.com/download.php?dpwck5h86ejxttu

rodrigo.demoura
Posts: 47
Joined: Wed Jun 02, 2010 6:31 pm

Re: Mod Pokewon [Alpha VER]

Post by rodrigo.demoura » Fri Apr 15, 2011 4:38 pm

Personal ignore the previous post.
The problem was solved.

Nothing like a night's sleep to clear my mind.
:mrgreen:

Zethfox
Posts: 3029
Joined: Thu Jun 10, 2010 11:28 pm

Re: Mod Pokewon [Alpha VER]

Post by Zethfox » Sat Apr 16, 2011 12:25 pm

happens to me alot too, ill work on a peice of code until i get burnt out on it...then next day, it flows perfectly.... :lol:

rodrigo.demoura
Posts: 47
Joined: Wed Jun 02, 2010 6:31 pm

Re: Mod Pokewon [Alpha VER]

Post by rodrigo.demoura » Mon Apr 25, 2011 7:23 pm

Guys I have a stupid question

I'm trying to create a rule that all first and second main, the game check if there are active creatures in play.

I have included a new instance GameObserver in class but I can not access the function.

Code: Select all

GameObserver.h

public:
     void activeCreature();

Code: Select all

GameObserver.cpp
...
...
...
void GameObserver::NextGamePhase ()
{
...
...
...
case Constants::MTG_PHASE_FIRSTMAIN:
   activeCreature();
   break;
...
...
...
}
void GameObserver::activeCreature()
{
}
When I debug the code it does not go to class
when I watch the Function refer to gameapp::Resume(void)
what I doing wrong :?:

Post Reply