combatturn.gbsres 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709
  1. {
  2. "_resourceType": "script",
  3. "id": "5a060925-e335-4b93-8af5-2a63051e70e8",
  4. "name": "CombatTurn",
  5. "description": "",
  6. "variables": {
  7. "V0": {
  8. "id": "V0",
  9. "name": "Variable A",
  10. "passByReference": true
  11. }
  12. },
  13. "actors": {},
  14. "symbol": "script_9",
  15. "script": [
  16. {
  17. "command": "EVENT_MENU",
  18. "args": {
  19. "variable": "12",
  20. "items": 2,
  21. "option1": "Attack",
  22. "option2": "Heal",
  23. "option3": "Spell",
  24. "option4": "",
  25. "option5": "",
  26. "option6": "",
  27. "option7": "",
  28. "option8": "",
  29. "cancelOnB": false,
  30. "layout": "menu",
  31. "__collapse": true
  32. },
  33. "id": "234a6b96-3b78-42a4-942f-0228b3698eac"
  34. },
  35. {
  36. "command": "EVENT_IF",
  37. "args": {
  38. "condition": {
  39. "type": "eq",
  40. "valueA": {
  41. "type": "variable",
  42. "value": "12"
  43. },
  44. "valueB": {
  45. "type": "number",
  46. "value": 1
  47. }
  48. },
  49. "__collapseElse": true,
  50. "__collapse": false,
  51. "__comment": false
  52. },
  53. "children": {
  54. "true": [
  55. {
  56. "command": "EVENT_SET_VALUE",
  57. "args": {
  58. "variable": "11",
  59. "value": {
  60. "type": "expression",
  61. "value": "1 + rnd($05$ - 1)"
  62. },
  63. "__collapse": true
  64. },
  65. "id": "0a4d9b93-2df2-4362-b67f-0783fae55434"
  66. },
  67. {
  68. "command": "EVENT_TEXT",
  69. "args": {
  70. "text": [
  71. "You dealt \n$11$ damage(s)"
  72. ],
  73. "__section": "text",
  74. "avatarId": "",
  75. "minHeight": 4,
  76. "maxHeight": 7,
  77. "textX": 1,
  78. "textY": 1,
  79. "textHeight": 5,
  80. "position": "bottom",
  81. "clearPrevious": true,
  82. "showFrame": "true",
  83. "speedIn": -1,
  84. "speedOut": -1,
  85. "closeWhen": "key",
  86. "closeButton": "a",
  87. "closeDelayTime": 0.5,
  88. "closeDelayFrames": 30,
  89. "__collapse": true
  90. },
  91. "id": "7bbd8b85-5906-4a0c-9f5a-156aadba7337"
  92. },
  93. {
  94. "command": "EVENT_SET_VALUE",
  95. "args": {
  96. "variable": "1",
  97. "value": {
  98. "type": "expression",
  99. "value": "max(0, $01$ - $11$)"
  100. },
  101. "__collapse": true,
  102. "text": [
  103. "max(0, $01$ - $V0$)"
  104. ],
  105. "__section": "text",
  106. "avatarId": "",
  107. "minHeight": 4,
  108. "maxHeight": 7,
  109. "textX": 1,
  110. "textY": 1,
  111. "textHeight": 5,
  112. "position": "bottom",
  113. "clearPrevious": true,
  114. "showFrame": "true",
  115. "speedIn": -1,
  116. "speedOut": -1,
  117. "closeWhen": "key",
  118. "closeButton": "a",
  119. "closeDelayTime": 0.5,
  120. "closeDelayFrames": 30
  121. },
  122. "id": "03cc80da-c447-46e8-8590-ccd1f3e1ee3f"
  123. },
  124. {
  125. "command": "EVENT_IF",
  126. "args": {
  127. "condition": {
  128. "type": "lte",
  129. "valueA": {
  130. "type": "variable",
  131. "value": "1"
  132. },
  133. "valueB": {
  134. "type": "number",
  135. "value": 0
  136. }
  137. },
  138. "__collapseElse": false,
  139. "__collapse": false
  140. },
  141. "children": {
  142. "true": [
  143. {
  144. "command": "EVENT_TEXT",
  145. "args": {
  146. "text": [
  147. "You've killed\nthe Monster!"
  148. ],
  149. "__section": "text",
  150. "avatarId": "",
  151. "minHeight": 4,
  152. "maxHeight": 7,
  153. "textX": 1,
  154. "textY": 1,
  155. "textHeight": 5,
  156. "position": "bottom",
  157. "clearPrevious": true,
  158. "showFrame": "true",
  159. "speedIn": -1,
  160. "speedOut": -1,
  161. "closeWhen": "key",
  162. "closeButton": "a",
  163. "closeDelayTime": 0.5,
  164. "closeDelayFrames": 30,
  165. "__collapse": true
  166. },
  167. "id": "7d3de43e-29d9-4b1f-be1b-896ec6da14c0"
  168. },
  169. {
  170. "command": "EVENT_SOUND_PLAY_EFFECT",
  171. "args": {
  172. "type": "9447a6ae-4924-4c38-8d51-904f9664f139",
  173. "priority": "medium",
  174. "pitch": 4,
  175. "frequency": 200,
  176. "duration": 0.5,
  177. "wait": true,
  178. "effect": 25,
  179. "__collapse": false
  180. },
  181. "id": "0b1d90a5-8dc5-47a9-9a2a-a839fee2921d"
  182. }
  183. ],
  184. "false": [
  185. {
  186. "command": "EVENT_SOUND_PLAY_EFFECT",
  187. "args": {
  188. "type": "9447a6ae-4924-4c38-8d51-904f9664f139",
  189. "priority": "medium",
  190. "pitch": 4,
  191. "frequency": 200,
  192. "duration": 0.5,
  193. "wait": true,
  194. "effect": 20
  195. },
  196. "id": "ce4f7a97-6ba0-4d18-ad1d-3fa21bc8b348"
  197. }
  198. ]
  199. },
  200. "id": "6d1e9707-c479-4058-a5ad-f8372b7166a8"
  201. },
  202. {
  203. "command": "EVENT_SET_VALUE",
  204. "args": {
  205. "variable": "3",
  206. "value": {
  207. "type": "expression",
  208. "value": "$03$ + $11$\n"
  209. },
  210. "__collapse": true
  211. },
  212. "id": "70f6e351-b495-4c50-b11b-5c39ddf1d157"
  213. },
  214. {
  215. "command": "EVENT_LOOP_WHILE",
  216. "args": {
  217. "condition": {
  218. "type": "expression",
  219. "value": "$03$ >= $05$*4"
  220. },
  221. "__collapse": false
  222. },
  223. "children": {
  224. "true": [
  225. {
  226. "command": "EVENT_SET_VALUE",
  227. "args": {
  228. "variable": "3",
  229. "value": {
  230. "type": "expression",
  231. "value": "$03$-$05$*4"
  232. },
  233. "__collapse": true
  234. },
  235. "id": "7e2119de-55e8-49ed-9eb8-78c35a218665"
  236. },
  237. {
  238. "command": "EVENT_INC_VALUE",
  239. "args": {
  240. "variable": "5",
  241. "__collapse": true
  242. },
  243. "id": "680ef6c6-e208-4473-aa5d-87a74e3e6f49"
  244. }
  245. ]
  246. },
  247. "id": "a3f15833-91f4-4749-9ccb-0d4b0e7d0e04"
  248. }
  249. ],
  250. "false": []
  251. },
  252. "id": "b353ca00-9c81-4216-8111-38ff22019048"
  253. },
  254. {
  255. "command": "EVENT_IF",
  256. "args": {
  257. "condition": {
  258. "type": "eq",
  259. "valueA": {
  260. "type": "variable",
  261. "value": "12"
  262. },
  263. "valueB": {
  264. "type": "number",
  265. "value": 2
  266. }
  267. },
  268. "__collapseElse": true,
  269. "__collapse": false
  270. },
  271. "children": {
  272. "true": [
  273. {
  274. "command": "EVENT_SET_VALUE",
  275. "args": {
  276. "variable": "11",
  277. "value": {
  278. "type": "expression",
  279. "value": "$06$ + rnd(max(0, $01$ / 2 - $06$))"
  280. },
  281. "__collapse": true
  282. },
  283. "id": "cb744e25-b732-452a-8d6c-d432067e5aba"
  284. },
  285. {
  286. "command": "EVENT_TEXT",
  287. "args": {
  288. "text": [
  289. "You healed for\n$11$ HPs"
  290. ],
  291. "__section": "text",
  292. "avatarId": "",
  293. "minHeight": 4,
  294. "maxHeight": 7,
  295. "textX": 1,
  296. "textY": 1,
  297. "textHeight": 5,
  298. "position": "bottom",
  299. "clearPrevious": true,
  300. "showFrame": "true",
  301. "speedIn": -1,
  302. "speedOut": -1,
  303. "closeWhen": "key",
  304. "closeButton": "a",
  305. "closeDelayTime": 0.5,
  306. "closeDelayFrames": 30,
  307. "__collapse": true
  308. },
  309. "id": "a34b4173-1ba0-41da-8d00-45b2fdb076e2"
  310. },
  311. {
  312. "command": "EVENT_SET_VALUE",
  313. "args": {
  314. "variable": "0",
  315. "value": {
  316. "type": "expression",
  317. "value": "min($14$, $00$ + $11$)"
  318. },
  319. "__collapse": false
  320. },
  321. "id": "5f3fd47b-937f-417f-bbfe-b22a573aa0b5"
  322. },
  323. {
  324. "command": "EVENT_SOUND_PLAY_EFFECT",
  325. "args": {
  326. "type": "9447a6ae-4924-4c38-8d51-904f9664f139",
  327. "priority": "medium",
  328. "pitch": 4,
  329. "frequency": 200,
  330. "duration": 0.5,
  331. "wait": true,
  332. "effect": 18
  333. },
  334. "id": "6414e1de-3528-4bf7-a984-d675f1b9ec60"
  335. },
  336. {
  337. "command": "EVENT_SET_VALUE",
  338. "args": {
  339. "variable": "4",
  340. "value": {
  341. "type": "expression",
  342. "value": "$04$ + $11$"
  343. },
  344. "__collapse": true
  345. },
  346. "id": "357d0ac1-f49d-4013-8e28-5e5e3ed2e0b1"
  347. },
  348. {
  349. "command": "EVENT_LOOP_WHILE",
  350. "args": {
  351. "condition": {
  352. "type": "expression",
  353. "value": "$04$ >= $06$*3"
  354. },
  355. "__collapse": true
  356. },
  357. "children": {
  358. "true": [
  359. {
  360. "command": "EVENT_SET_VALUE",
  361. "args": {
  362. "variable": "4",
  363. "value": {
  364. "type": "expression",
  365. "value": "$04$-$06$*3"
  366. },
  367. "__collapse": true
  368. },
  369. "id": "bdb4fea2-9079-4287-8c13-97c0cd1857f5"
  370. },
  371. {
  372. "command": "EVENT_INC_VALUE",
  373. "args": {
  374. "variable": "6",
  375. "__collapse": true
  376. },
  377. "id": "85c8935d-2d7e-4f2d-aa3e-47848d0d9a7c"
  378. }
  379. ]
  380. },
  381. "id": "56f208bb-1360-4ba9-941c-9708f6fd061f"
  382. }
  383. ],
  384. "false": [
  385. {
  386. "command": "EVENT_IF",
  387. "args": {
  388. "condition": {
  389. "type": "eq",
  390. "valueA": {
  391. "type": "variable",
  392. "value": "12"
  393. },
  394. "valueB": {
  395. "type": "number",
  396. "value": 3
  397. }
  398. },
  399. "__collapseElse": true
  400. },
  401. "children": {
  402. "true": [
  403. {
  404. "command": "EVENT_TEXT",
  405. "args": {
  406. "text": [
  407. "Whoosh."
  408. ],
  409. "__section": "text",
  410. "avatarId": "",
  411. "minHeight": 4,
  412. "maxHeight": 7,
  413. "textX": 1,
  414. "textY": 1,
  415. "textHeight": 5,
  416. "position": "bottom",
  417. "clearPrevious": true,
  418. "showFrame": "true",
  419. "speedIn": -1,
  420. "speedOut": -1,
  421. "closeWhen": "key",
  422. "closeButton": "a",
  423. "closeDelayTime": 0.5,
  424. "closeDelayFrames": 30,
  425. "__collapse": true
  426. },
  427. "id": "2353f7fd-25ce-4cea-b1e9-1f75ac3b83a5"
  428. }
  429. ],
  430. "false": []
  431. },
  432. "id": "8f0a6115-c406-416c-8635-3ac74e0fd218"
  433. }
  434. ]
  435. },
  436. "id": "9d0a216f-5622-4edb-8be4-fdccc585da14"
  437. },
  438. {
  439. "command": "EVENT_IF",
  440. "args": {
  441. "condition": {
  442. "type": "gt",
  443. "valueA": {
  444. "type": "variable",
  445. "value": "1"
  446. },
  447. "valueB": {
  448. "type": "number",
  449. "value": 0
  450. }
  451. },
  452. "__collapseElse": true,
  453. "__collapse": false
  454. },
  455. "children": {
  456. "true": [
  457. {
  458. "command": "EVENT_SET_VALUE",
  459. "args": {
  460. "variable": "12",
  461. "value": {
  462. "type": "expression",
  463. "value": "rnd(2)"
  464. },
  465. "__collapse": false
  466. },
  467. "id": "b1ab22f9-88af-4cce-b7d8-559267a871c6"
  468. },
  469. {
  470. "command": "EVENT_IF",
  471. "args": {
  472. "condition": {
  473. "type": "eq",
  474. "valueA": {
  475. "type": "variable",
  476. "value": "12"
  477. },
  478. "valueB": {
  479. "type": "number",
  480. "value": 0
  481. }
  482. },
  483. "__collapseElse": true,
  484. "__collapse": false
  485. },
  486. "children": {
  487. "true": [
  488. {
  489. "command": "EVENT_SET_VALUE",
  490. "args": {
  491. "variable": "11",
  492. "value": {
  493. "type": "expression",
  494. "value": "1 + rnd($05$-1)"
  495. }
  496. },
  497. "id": "40b7531f-0f34-48df-aa69-3bf2b6893d9b"
  498. },
  499. {
  500. "command": "EVENT_TEXT",
  501. "args": {
  502. "text": [
  503. "The enemy dealt\n$11$ damage(s)"
  504. ],
  505. "__section": "text",
  506. "avatarId": "",
  507. "minHeight": 4,
  508. "maxHeight": 7,
  509. "textX": 1,
  510. "textY": 1,
  511. "textHeight": 5,
  512. "position": "bottom",
  513. "clearPrevious": true,
  514. "showFrame": "true",
  515. "speedIn": -1,
  516. "speedOut": -1,
  517. "closeWhen": "key",
  518. "closeButton": "a",
  519. "closeDelayTime": 0.5,
  520. "closeDelayFrames": 30,
  521. "__collapse": false
  522. },
  523. "id": "d93a10f5-9cef-4624-b034-738d13fd5fa1"
  524. },
  525. {
  526. "command": "EVENT_SET_VALUE",
  527. "args": {
  528. "variable": "0",
  529. "value": {
  530. "type": "expression",
  531. "value": "max(0, $00$ - $11$)"
  532. },
  533. "__collapse": false
  534. },
  535. "id": "f5aafac1-e985-47f2-b2e8-7aebd0804b20"
  536. },
  537. {
  538. "command": "EVENT_IF",
  539. "args": {
  540. "condition": {
  541. "type": "lte",
  542. "valueA": {
  543. "type": "variable",
  544. "value": "0"
  545. },
  546. "valueB": {
  547. "type": "number",
  548. "value": 0
  549. }
  550. },
  551. "__collapseElse": false,
  552. "__collapse": false
  553. },
  554. "children": {
  555. "true": [
  556. {
  557. "command": "EVENT_SOUND_PLAY_EFFECT",
  558. "args": {
  559. "type": "9447a6ae-4924-4c38-8d51-904f9664f139",
  560. "priority": "medium",
  561. "pitch": 4,
  562. "frequency": 200,
  563. "duration": 0.5,
  564. "wait": true,
  565. "effect": 25,
  566. "__collapse": false
  567. },
  568. "id": "e3c4c939-a481-4cf8-a395-397980a7239e"
  569. },
  570. {
  571. "command": "EVENT_CALL_CUSTOM_EVENT",
  572. "args": {
  573. "customEventId": "058cb3f2-19ed-4fdd-a966-a97ae6b63e60",
  574. "__collapse": false
  575. },
  576. "id": "ed5412b7-50ac-4897-8a10-2a9394bd7d1d"
  577. }
  578. ],
  579. "false": [
  580. {
  581. "command": "EVENT_SOUND_PLAY_EFFECT",
  582. "args": {
  583. "type": "9447a6ae-4924-4c38-8d51-904f9664f139",
  584. "priority": "medium",
  585. "pitch": 4,
  586. "frequency": 200,
  587. "duration": 0.5,
  588. "wait": true,
  589. "effect": 21,
  590. "__collapse": false
  591. },
  592. "id": "4daaef0f-502d-40c4-9245-2b54fdc1d3ba"
  593. },
  594. {
  595. "command": "EVENT_CAMERA_SHAKE",
  596. "args": {
  597. "time": 0.5,
  598. "frames": 30,
  599. "shakeDirection": "horizontal",
  600. "magnitude": {
  601. "type": "number",
  602. "value": 3
  603. }
  604. },
  605. "id": "24a33721-3144-4817-b391-8907d40dab35"
  606. }
  607. ]
  608. },
  609. "id": "f3011093-5d2f-4a70-bed7-935d94b9a062"
  610. }
  611. ],
  612. "false": []
  613. },
  614. "id": "f842f2e5-3ec7-4eb6-a7e4-297f6ac1acfe"
  615. },
  616. {
  617. "command": "EVENT_IF",
  618. "args": {
  619. "condition": {
  620. "type": "eq",
  621. "valueA": {
  622. "type": "variable",
  623. "value": "12"
  624. },
  625. "valueB": {
  626. "type": "number",
  627. "value": 1
  628. }
  629. },
  630. "__collapseElse": true,
  631. "__collapse": false
  632. },
  633. "children": {
  634. "true": [
  635. {
  636. "command": "EVENT_SET_VALUE",
  637. "args": {
  638. "variable": "11",
  639. "value": {
  640. "type": "expression",
  641. "value": "rnd($06$)"
  642. },
  643. "__collapse": false
  644. },
  645. "id": "27caa270-55d2-4a5e-90d5-fe54ae4bf626"
  646. },
  647. {
  648. "command": "EVENT_TEXT",
  649. "args": {
  650. "text": [
  651. "The enemy healed \n$11$ HPs"
  652. ],
  653. "__section": "text",
  654. "avatarId": "",
  655. "minHeight": 4,
  656. "maxHeight": 7,
  657. "textX": 1,
  658. "textY": 1,
  659. "textHeight": 5,
  660. "position": "bottom",
  661. "clearPrevious": true,
  662. "showFrame": "true",
  663. "speedIn": -1,
  664. "speedOut": -1,
  665. "closeWhen": "key",
  666. "closeButton": "a",
  667. "closeDelayTime": 0.5,
  668. "closeDelayFrames": 30,
  669. "__collapse": true
  670. },
  671. "id": "915ecbab-229d-404e-8524-f5e7a2138ccd"
  672. },
  673. {
  674. "command": "EVENT_SET_VALUE",
  675. "args": {
  676. "variable": "1",
  677. "value": {
  678. "type": "expression",
  679. "value": "min(8, $01$ + $11$)"
  680. },
  681. "__collapse": false
  682. },
  683. "id": "db91e0e5-c11e-432f-83ef-6bbf54ecc377"
  684. },
  685. {
  686. "command": "EVENT_SOUND_PLAY_EFFECT",
  687. "args": {
  688. "type": "9447a6ae-4924-4c38-8d51-904f9664f139",
  689. "priority": "medium",
  690. "pitch": 4,
  691. "frequency": 200,
  692. "duration": 0.5,
  693. "wait": true,
  694. "effect": 18
  695. },
  696. "id": "0f908cc3-cad2-4bad-b4e5-e1659e92597c"
  697. }
  698. ],
  699. "false": []
  700. },
  701. "id": "615d25ae-0c8a-432c-a308-6b4b323bbd3a"
  702. }
  703. ],
  704. "false": []
  705. },
  706. "id": "5cd3130a-52bc-405e-a4ef-f5fb725ef201"
  707. }
  708. ]
  709. }