I would like to say that Forge easily handles HP and other cards like it but it doesn’t. Like so many things it is hardcoded, the combat code specifically checks for HP. (To programmers, hardcoding something is akin to using duck tape. It works, but it is messy.) While this isn’t very elegant, it works. (“It works” is probably my favorite excuse.)
A better solution would be to have a battle damage hook or event like
combatDamage(int nDamage, Card damageTo, Card damageFrom)This would keep the card code together, instead of sticking some of the card code with the combat code. Currently Forge only has a few very basic events like when a card is added or removed from a zone or when a player’s life points changes. Adding a combat damage event to Forge doesn’t seem too difficult and maybe I could work on that.
And to be thorough it would be good to add abilities that trigger when they deal damage to a player or just deal damage (whether during or outside of combat).
combatDamage(int nDamage, String player, Card damageFrom)p.s.
damage(int nDamage, String player, Card damageFrom)
damage(int nDamage, Card damageTo, Card damageFrom)
I would like to say that I programmed HP but I didn’t. It was probably one of the forums guys like Dennis or Rob. Thanks.
1 comment:
I never thought I would run into such an extraordinary blog, I read it to the letter and I took pleasure of every word writen there.
Post a Comment