Mechanics

As I mentioned previously, I’m back to the good stuff: implementing new cards! With every mechanic I implement, I can unlock many new cards. It’s almost like a game with achievements! Here’s the list of new mechanics with some examples, in approximate chronological order of realization:

Auras

The biggest difficulty for this was implementing the whole “attach/unattach” effects. Effects must correctly affect objects and must stop affecting objects when the attachment is removed. Although I only implemented auras with this, the same mechanic will be used for equipments and fortifications. In fact, I already handle the case where the attachment moves from card to card (the effect must stop affecting the first card and begin affecting the second card). For auras to work correctly, I also had to implement subtypes (auras are an enchantment subtype). This mechanic allowed me to implement the two auras from the 10th edition white starter deck:

But before, I had to implement…

Vigilance

This one is pretty straightforward to implement. This one allowed me to get a famous card working:

Also, Serra’s Embrace is giving an ability.. which I did not support. I only supported effects of the type “creature gets +1/+1”. So I had to add…

“Creature gains XYZ”

In the meantime, I started the red starter deck and implemented the cards I could. Here’s a sample:

A lot of red cards have Haste though so I went on to implement a basic rule that I had avoided so far…

Summoning Sickness & Haste

It was not as hard as I would have thought and I had those mechanics working in a couple of hours, unlocking yet again some cards:

Finally, today, I refined the targeting mechanics so I could implement…

There’s still a lot to do, so I’ll stop here! See you around!

Advertisements

About fparadis2

Lead Game programmer
This entry was posted in Mox. Bookmark the permalink.

4 Responses to Mechanics

  1. Nantuko says:

    good work! auras are tricky permanents that are not so easy to implement =)
    so my congratulations you’ve made them working 😉

  2. good work! auras are tricky permanents that are not so easy to implement =)so my congratulations you’ve made them working
    +1

  3. Incantus says:

    Hey, how did you implement effect’s like Pacifism? Do you have a general mechanism to override game rules, or do you have a specific override for each currently existing mechanic?

  4. fparadis2 says:

    I do have a general mechanism for overriding object properties (players, cards, some general properties of the game). I do not yet have a general mechanism to modify the flow of the game (additional turns for example), or to modify special rules (can’t play creature spells this turn). They will come.. some day 🙂

    Here’s the code for Pacifism. I did invent a special type of ability that can modify attacking/blocking possibilities (restrictions) or add costs to attacking. Defender is a special case of the CannotAttackAbility.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s