chicken-egg.yaml 777 B

123456789101112131415161718192021222324252627282930
  1. # Production rule (D9 / D19): the engine emits animal-produce per eligible day
  2. # for a mature chicken; this machine turns that event into an egg grant. The
  3. # machine alternates on successive animal-produce events, so the egg is granted
  4. # on every second produce — frequency is language-owned, not engine-owned.
  5. id: chicken-egg
  6. initial: waiting
  7. states:
  8. - id: waiting
  9. - id: laid
  10. onEnter:
  11. - action: give-item
  12. itemId: egg
  13. qty: 1
  14. - action: play-sound
  15. sound: coin
  16. transitions:
  17. - from: waiting
  18. to: laid
  19. on: animal-produce
  20. when:
  21. op: eq
  22. path: payload.animalDefId
  23. value: chicken
  24. - from: laid
  25. to: waiting
  26. on: animal-produce
  27. when:
  28. op: eq
  29. path: payload.animalDefId
  30. value: chicken