Jump to content

  • Log In with Google      Sign In   
  • Create Account


We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.

Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Member Since 30 May 2012
Offline Last Active Jun 01 2012 12:44 AM

Posts I've Made

In Topic: Java RPG Stats System

30 May 2012 - 05:50 PM

off the top of my head, i would create a class called Effect with an abstract method called perform()

then make other classes that define each particular effect, for example, you could create a strengthBuff class or whatever
and implement the perform method to give it whatever logic you want.

perform could also take parameters if needed, like perform(Actor actor) etc.

I did something like this for my Pokemon clone game, each move (like ember for example) not only deals damage to the other pokemon,
but it also has a chance of contaminating the other pokemon with a lingering effect (in case of ember, it was damage over time)
so each move had an effect attached to it, and i simply implemented the perform method for each individual move, (sand attack lowers accuracy, etc)