Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!


lthannyl

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)

PARTNERS