1
1

CombatDescription.ts 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /// <reference path="../ContentDescription.ts" />
  2. /**
  3. * Quick Cheat Sheet of markers!
  4. * When making a description take these markers into account while describing the action! If a marker describes something
  5. * please include it if you add it to the description. Example: if you describe the attack as a "heavy hit!", make sure
  6. * to add the HIGH_DAMAGE marker, we don't want a "heavy hit!" to be displayed for an attack that caused 1 damage.
  7. *
  8. * Mandatory Markers - Include only one and clone description for each
  9. * CombatHit.FULL_DODGE
  10. * CombatHit.PARTIAL_DODGE
  11. * CombatHit.FULL_HIT
  12. *
  13. * Mandatory Markers - Include only one and clone description for each. These don't show up in FULL_DODGE
  14. * CombatResult.KNOCKED
  15. * CombatResult.KNOCKED_OFF
  16. * CombatResult.KILLED
  17. *
  18. * Non-Mandatory Markers - Include at most one per description, none makes a description fit more attacks. These don't show up in FULL_DODGE.
  19. * CombatDamage.LOW_DAMAGE
  20. * CombatDamage.MEDIUM_DAMAGE
  21. * CombatDamage.HIGH_DAMAGE
  22. */
  23. class CombatDescription extends ContentDescription {
  24. public static DESCRIPTIONS = [];
  25. public constructor (name : string) {
  26. super(name, new ContentGroup());
  27. CombatDescription.DESCRIPTIONS.push(this);
  28. }
  29. public addUnit () {
  30. let unit = new CombatUnit();
  31. (<ContentGroup> this.group).addUnit(unit);
  32. return unit;
  33. }
  34. public static getDescription (target : ContentGroup) {
  35. return ContentDescription.pickDescriptions(CombatDescription.DESCRIPTIONS, target);
  36. }
  37. }