CombatPokeUnit.ts 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /// <reference path="../ContentUnit.ts" />
  2. /// <reference path="../../Things/Person.ts" />
  3. /// <reference path="../../Things/Bodypart/SexHole.ts" />
  4. /// <reference path="../../Things/Bodypart/SexStick.ts" />
  5. class CombatPokeUnit extends ContentUnit {
  6. private aggressor : ContentDifferential = new ContentDifferential(Person);
  7. private target : ContentDifferential = new ContentDifferential(Person);
  8. private markers : ContentDifferential = new ContentDifferential();
  9. public constructor () {
  10. super();
  11. }
  12. public setAggressor (it : Thing | typeof Thing) {
  13. this.aggressor = new ContentDifferential(it);
  14. return this;
  15. }
  16. public getAggressor () {
  17. return this.aggressor;
  18. }
  19. public setTarget (it : Thing | typeof Thing) {
  20. this.target = new ContentDifferential(it);
  21. return this;
  22. }
  23. public getTarget () {
  24. return this.target;
  25. }
  26. public addMarker (...marker : Array<ContentMarker | AdaptiveDifferential>) {
  27. this.markers.addNoun(...marker);
  28. return this;
  29. }
  30. public getMarkers () {
  31. return [...this.markers.nouns];
  32. }
  33. public getScore () {
  34. return this.target.getScore() + this.markers.getScore();
  35. }
  36. public isMatch (cu : CombatPokeUnit) {
  37. if (cu instanceof CombatPokeUnit) {
  38. return this.target.isMatch(cu.target) && this.aggressor.isMatch(cu.aggressor) &&
  39. this.markers.isMatch(cu.markers);
  40. }
  41. return false;
  42. }
  43. }