chicken-egg.yaml 923 B

12345678910111213141516171819202122232425262728293031
  1. # Example state machine (D15/D20 behavior language v2) — decision #9's
  2. # "produce rules via language". The engine emits animal-produce per eligible day
  3. # for a mature (final-stage) chicken; this machine turns that EVENT into an egg
  4. # grant via a give-item onEnter. The machine alternates on successive
  5. # animal-produce events (one transition per machine per event), so the egg is
  6. # granted on every second produce — frequency/quantity are exactly the kind of
  7. # rule the language (not the engine) owns.
  8. id: chicken-egg
  9. initial: waiting
  10. states:
  11. - id: waiting
  12. - id: laid
  13. onEnter:
  14. - action: give-item
  15. itemId: egg
  16. qty: 1
  17. transitions:
  18. - from: waiting
  19. to: laid
  20. on: animal-produce
  21. when:
  22. op: eq
  23. path: payload.animalDefId
  24. value: chicken
  25. - from: laid
  26. to: waiting
  27. on: animal-produce
  28. when:
  29. op: eq
  30. path: payload.animalDefId
  31. value: chicken