The Incomplete Works of Josh English

A Polymath in Pursuit of Publication

The BaseDamageManager Class

The BaseDamageManager class needs to get the attack methods from the combatants and process that damage. There are three DamagerMangers that come with Combat: SameTime , LoserTakesDifference , and ToHitCheck .

BaseDamageManager

All DamageManagers should be a subclass of this class. They all have the following methods by default:

processdamage

This does it all. This method is called by the CombatManager.processround method. This is the method to overwrite when making your own DamageManager.

addlog (s)

Adds the string to the log list. This is used for writing up play-by-plays of fights

dumplog

Returns the log as a list of strings. This is used in the play-by-play generation

Predefined Damagers

SameTime

The SameTime Damager applies damage at the same time.

LoserTakesDifference

This is based on the T&T combat system. Both combatants genereate as much damage as possible, and the combatant who did the least amount of damage takes the difference.

ToHitCheck

This damager checks if each combatant can hit its opponent *** FIX THIS

Future Plans

There are a lot of changes I want to make to this class for further customization. The first thing is a change to the underlying structure of the processdamage method:

Even with these generic changes I suspect subclassing the DamageManager will be necessary to create truly custom DamageManagers.