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.
 
 
 
 
 

45 lignes
1.0 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 TogetherCondition implements Condition {
  24. allowed (user: Creature, target: Creature): boolean {
  25. return user.containedIn === target.containedIn
  26. }
  27. }
  28. export class ContainerCondition implements Condition {
  29. allowed (user: Creature, target: Creature): boolean {
  30. return target.containedIn === this.container
  31. }
  32. constructor (private container: Container) {
  33. }
  34. }