1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- /// <reference path="../ContentUnit.ts" />
- /// <reference path="../../Things/Person.ts" />
- /// <reference path="../../Things/Bodypart/SexHole.ts" />
- /// <reference path="../../Things/Bodypart/SexStick.ts" />
- class CombatUnit extends ContentUnit {
- private actor : ContentDifferential = new ContentDifferential(Person);
- private target : ContentDifferential = new ContentDifferential(Person);
- private weapon : ContentDifferential = new ContentDifferential();
- private markers : ContentDifferential = new ContentDifferential();
- public constructor () {
- super();
- }
- public setActor (it : Thing | typeof Thing) {
- this.actor = new ContentDifferential(it);
- return this;
- }
- public getActor () {
- return this.actor;
- }
- public setTarget (it : Thing | typeof Thing) {
- this.target = new ContentDifferential(it);
- return this;
- }
- public getTarget () {
- return this.target;
- }
- public setWeapon (...it : Array<Thing | typeof Thing>) {
- this.weapon = new ContentDifferential(...it);
- return this;
- }
- public getWeapons () {
- return [...this.weapon.nouns];
- }
- public addMarker (...marker : Array<ContentMarker | AdaptiveDifferential>) {
- this.markers.addNoun(...marker);
- return this;
- }
- public getMarkers () {
- return [...this.markers.nouns];
- }
- public getScore () {
- return this.actor.getScore() + this.target.getScore() + this.weapon.getScore() + this.markers.getScore();
- }
- public isMatch (cu : CombatUnit) {
- if (cu instanceof CombatUnit) {
- return this.actor.isMatch(cu.actor) && this.target.isMatch(cu.target) &&
- this.weapon.isMatch(cu.weapon) && this.markers.isMatch(cu.markers);
- }
- return false;
- }
- }
|