dimanche 15 décembre 2019

Most flexible way to implement a buff/ debuff system for an RPG Game

I'm making an RGP board game where I have different heros, each one of them belongs to some types

for example ("Aatrox" is a Dragon and a Ninja hence he belong to these two types),and each player has a

list of champion with fixed attirubtes like basicAttackDamage,criticalstrike/chance/ability..etc

and i have what are called as buffs, a buff gets activated to player when his some of his heros

belong to certain types

eg: if a player gets two Dragons or more , then every hero whose type is Dragon gets double Damage

Attack, TrueDamage(Ignore magic resist and armor), Attack..etc

so i was wondering what would be the most flexible way to implement these sort of buffs considering the

fact that each champion could only use his attack/ability once in each round and there are buffs that

gets added with a certain chance "this buffs gives the hero 40% chance to stun the enemy with basic

attack, and buffs which add health to heros ("this buffs give the hero 250 extra health") etc..

my current approach is to add tags on buffs and apply these buffs when attacking or defending an attack

so this would look something like

enum BuffsType{
OnHit,OnAttack
}

but this approach kinda fails at complex buffs like "a chance to hit extra

attack/extra enemy/". I have seen some discussions about this but none of the answers seemed to be REALLY flexible, most of them failed at complex buffs

Aucun commentaire:

Enregistrer un commentaire