restoration-quest.yaml 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. # Endgame quest (D29/D33): activated on the day-start after the mayor-talk-quest
  2. # completes, completes on a later day-start once the player has earned at least
  3. # 500 gold (the restoration goal the Mayor reveals). On completion it pays a
  4. # bonus, sets the questProgress slot, and raises player.flag.victory — which
  5. # gates the Mayor's and Mia's victory dialogue branches. The gold reward uses
  6. # the `add` incremental action (D33); questProgress + flag are absolute set-state.
  7. id: restoration-quest
  8. initial: inactive
  9. states:
  10. - id: inactive
  11. - id: active
  12. - id: complete
  13. onEnter:
  14. - action: give-item
  15. itemId: egg
  16. qty: 3
  17. - action: add
  18. path: player.gold
  19. value: 200
  20. - action: play-bgm
  21. soundId: bgm-victory
  22. fadeMs: 500
  23. - action: play-sound
  24. sound: harvest
  25. - action: set-state
  26. path: player.questProgress.restoration-quest
  27. value: complete
  28. - action: set-state
  29. path: player.flag.victory
  30. value: true
  31. transitions:
  32. - from: inactive
  33. to: active
  34. on: day-start
  35. when:
  36. and:
  37. - { op: eq, path: player.questProgress.mayor-talk-quest, value: complete }
  38. - not: { op: exists, path: player.questProgress.restoration-quest }
  39. - from: active
  40. to: complete
  41. on: day-start
  42. when:
  43. op: gte
  44. path: player.gold
  45. value: 500