Feast 2.0!
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

69 lignes
1.6 KiB

  1. import { Condition, Vigor } from "../combat"
  2. import { Creature } from "../entity"
  3. import { Container } from '../vore'
  4. export class InverseCondition implements Condition {
  5. allowed (user: Creature, target: Creature): boolean {
  6. return !this.condition.allowed(user, target)
  7. }
  8. constructor (private condition: Condition) {
  9. }
  10. }
  11. export class CapableCondition implements Condition {
  12. allowed (user: Creature, target: Creature): boolean {
  13. return !user.disabled
  14. }
  15. }
  16. export class DrainedVigorCondition implements Condition {
  17. allowed (user: Creature, target: Creature): boolean {
  18. return user.vigors[this.vigor] <= 0
  19. }
  20. constructor (private vigor: Vigor) {
  21. }
  22. }
  23. export class SoloCondition implements Condition {
  24. allowed (user: Creature, target: Creature): boolean {
  25. return user === target
  26. }
  27. }
  28. export class PairCondition implements Condition {
  29. allowed (user: Creature, target: Creature): boolean {
  30. return user !== target
  31. }
  32. }
  33. export class TogetherCondition implements Condition {
  34. allowed (user: Creature, target: Creature): boolean {
  35. return user.containedIn === target.containedIn && user !== target
  36. }
  37. }
  38. export class ContainerCondition implements Condition {
  39. allowed (user: Creature, target: Creature): boolean {
  40. return target.containedIn === this.container
  41. }
  42. constructor (private container: Container) {
  43. }
  44. }
  45. export class AllyCondition implements Condition {
  46. allowed (user: Creature, target: Creature): boolean {
  47. return user.side === target.side
  48. }
  49. }
  50. export class EnemyCondition implements Condition {
  51. allowed (user: Creature, target: Creature): boolean {
  52. return user.side !== target.side
  53. }
  54. }