Advertisement
Guest User

Color Change

a guest
Feb 8th, 2013
25
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.67 KB | None | 0 0
  1. void main(void)
  2. {
  3. //This checks if the player has perk 12, the Speech perk.
  4. external("perks", "getPerk", 12);
  5. int &speech = &return;
  6. //&text(s) are for the actual choices
  7. int &text;
  8. int &text2;
  9. int &text3;
  10. int &text4;
  11. int &text5;
  12. int &text6;
  13. int &text7;
  14. int &title;
  15. int &title2;
  16. int &ch;
  17. &ch = 1;
  18. //This is to get your companion. Not important.
  19. int &kara = get_sprite_with_this_brain(16, ¤t_sprite);
  20. }
  21.  
  22. void talk(void)
  23. {
  24. //If they don't have the speech perk, automatically start them on choice 2
  25. if(&speech > 0)
  26. {
  27. &ch = 1;
  28. }
  29.  
  30. if(&speech < 1)
  31. {
  32. &ch = 2;
  33. }
  34. freeze(1);
  35. freeze(¤t_sprite);
  36. say_stop("`4Well hello, there!",¤t_sprite);
  37. wait(100);
  38.  
  39. //Left, Mid/Mid2, and Right create the choice box
  40. int &left = create_sprite(151, 286, 0, 30, 2);
  41. sp_que(&left, 9000);
  42.  
  43. int &mid = create_sprite(325, 270, 0, 30, 3);
  44. sp_que(&mid, 9000);
  45.  
  46. int &mid2 = create_sprite(383, 270, 0, 30, 3);
  47. sp_que(&mid, 9000);
  48.  
  49. int &right = create_sprite(525, 285, 0, 30, 4);
  50. sp_que(&right, 9000);
  51.  
  52. //1a, 1b, etc. are the wooden arrows that point at the current choice. They are invisible by default.
  53. int &1a = create_sprite(155, 222, 6, 456, 1);
  54. sp_nodraw(&1a, 1);
  55. sp_seq(&1a, 456);
  56. sp_que(&1a, 9001);
  57. int &1b = create_sprite(525, 222, 6, 457, 1);
  58. sp_nodraw(&1b, 1);
  59. sp_seq(&1b, 457);
  60. sp_que(&1b, 9001);
  61. int &2a = create_sprite(155, 245, 6, 456, 1);
  62. sp_nodraw(&2a, 1);
  63. sp_seq(&2a, 456);
  64. sp_que(&2a, 9001);
  65. int &2b = create_sprite(525, 245, 6, 457, 1);
  66. sp_nodraw(&2b, 1);
  67. sp_seq(&2b, 457);
  68. sp_que(&2b, 9001);
  69. int &3a = create_sprite(155, 265, 6, 456, 1);
  70. sp_nodraw(&3a, 1);
  71. sp_seq(&3a, 456);
  72. sp_que(&3a, 9001);
  73. int &3b = create_sprite(525, 265, 6, 457, 1);
  74. sp_nodraw(&3b, 1);
  75. sp_seq(&3b, 457);
  76. sp_que(&3b, 9001);
  77. int &4a = create_sprite(155, 202, 6, 456, 1);
  78. sp_nodraw(&4a, 1);
  79. sp_seq(&4a, 456);
  80. sp_que(&4a, 9001);
  81. int &4b = create_sprite(525, 202, 6, 457, 1);
  82. sp_nodraw(&4b, 1);
  83. sp_seq(&4b, 457);
  84. sp_que(&4b, 9001);
  85. int &5a = create_sprite(155, 205, 6, 456, 1);
  86. sp_nodraw(&5a, 1);
  87. sp_seq(&5a, 456);
  88. sp_que(&5a, 9001);
  89. int &5b = create_sprite(525, 205, 6, 457, 1);
  90. sp_nodraw(&5b, 1);
  91. sp_seq(&5b, 457);
  92. sp_que(&5b, 9001);
  93. int &6a = create_sprite(155, 162, 6, 456, 1);
  94. sp_nodraw(&6a, 1);
  95. sp_seq(&6a, 456);
  96. sp_que(&6a, 9001);
  97. int &6b = create_sprite(525, 162, 6, 457, 1);
  98. sp_nodraw(&6b, 1);
  99. sp_seq(&6b, 457);
  100. sp_que(&6b, 9001);
  101. int &7a = create_sprite(155, 285, 6, 456, 1);
  102. sp_nodraw(&7a, 1);
  103. sp_seq(&7a, 456);
  104. sp_que(&7a, 9001);
  105. int &7b = create_sprite(525, 285, 6, 457, 1);
  106. sp_nodraw(&7b, 1);
  107. sp_seq(&7b, 457);
  108. sp_que(&7b, 9001);
  109.  
  110. //////CHOICES
  111. //We aren't using an actual choice menu, so we have to make the title ourselves.
  112. &title = say_xy("`3What can I do for you?", 25, 115);
  113. //Title never dies (it's just missing in action)
  114. sp_kill(&title, 0);
  115. //Loop to draw text in correct colors
  116. loop:
  117. freeze(1);
  118. wait(1);
  119. //nodraw ALL the arrows
  120. sp_nodraw(&1a, 1);
  121. sp_nodraw(&1b, 1);
  122. sp_nodraw(&2a, 1);
  123. sp_nodraw(&2b, 1);
  124. sp_nodraw(&3a, 1);
  125. sp_nodraw(&3b, 1);
  126. sp_nodraw(&4a, 1);
  127. sp_nodraw(&4b, 1);
  128. sp_nodraw(&5a, 1);
  129. sp_nodraw(&5b, 1);
  130. sp_nodraw(&6a, 1);
  131. sp_nodraw(&6b, 1);
  132. sp_nodraw(&7a, 1);
  133. sp_nodraw(&7b, 1);
  134.  
  135. sp_active(&text, 0);
  136. //The choice is 1, so we nodraw(0) the arrows and create some standard text (In White, since it's selected)
  137. if(&ch == 1)
  138. {
  139. sp_nodraw(&5a, 0);
  140. sp_nodraw(&5b, 0);
  141. &text = say_xy("`%Can you read me a book?",25,190);
  142.  
  143. }
  144.  
  145. external("perks", "getPerk", 12);
  146. int &speech = &return;
  147. if(&ch != 1)
  148. {
  149. if(&speech > 0)
  150. {
  151. &text = say_xy("`0Can you read me a book?",25,190);
  152. }
  153.  
  154. if(&speech < 1)
  155. {
  156. &text = say_xy("`7Can you read me some of these books?",25, 190);
  157. }
  158.  
  159. }
  160.  
  161. sp_kill(&text, 0);
  162. sp_que(&text, 9001);
  163.  
  164. sp_active(&text2, 0);
  165. if(&ch == 2)
  166. {
  167. sp_nodraw(&1a, 0);
  168. sp_nodraw(&1b, 0);
  169. &text2 = say_xy("`%Who are you?",25, 210);
  170. }
  171.  
  172. if(&ch != 2)
  173. {
  174. &text2 = say_xy("`!Who are you?",25, 210);
  175.  
  176. }
  177. sp_kill(&text2, 0);
  178.  
  179. sp_active(&text3, 0);
  180. if(&ch == 3)
  181. {
  182. sp_nodraw(&2a, 0);
  183. sp_nodraw(&2b, 0);
  184. &text3 = say_xy("`%Do you like it here?",25, 230);
  185. }
  186.  
  187. if(&ch != 3)
  188. {
  189. &text3 = say_xy("`!Do you like it here?", 25, 230);
  190. }
  191.  
  192. sp_kill(&text3, 0);
  193. sp_que(&text3, 9001);
  194.  
  195.  
  196.  
  197. sp_active(&text4, 0);
  198. if(&ch == 4)
  199. {
  200. sp_nodraw(&3a, 0);
  201. sp_nodraw(&3b, 0);
  202. if(&wellq == 0)
  203. {
  204. &text4 = say_xy("`%Do you need help with anything?",25, 250);
  205. }
  206.  
  207. if(&wellq == 1)
  208. {
  209. &text4 = say_xy("`%What did you want me to do, again?",25, 250);
  210. }
  211.  
  212. if(&wellq == 3)
  213. {
  214. &text4 = say_xy("`%Here's your spoiler.",25, 250);
  215. }
  216.  
  217. if(&wellq == 4)
  218. {
  219. &text4 = say_xy("`%Anything else?",25, 250);
  220. }
  221.  
  222.  
  223. }
  224.  
  225. if(&ch != 4)
  226. {
  227. if(&wellq == 0)
  228. {
  229. &text4 = say_xy("`!Do you need help with anything?",25, 250);
  230. }
  231.  
  232. if(&wellq == 1)
  233. {
  234. &text4 = say_xy("`!What did you want me to do, again?",25, 250);
  235. }
  236.  
  237. if(&wellq == 3)
  238. {
  239. &text4 = say_xy("`!Here's your spoiler.",25, 250);
  240. }
  241.  
  242. if(&wellq == 4)
  243. {
  244. &text4 = say_xy("`!Anything else?",25, 250);
  245. }
  246. }
  247. sp_kill(&text4, 0);
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254. sp_active(&text5, 0);
  255. if(&ch == 5)
  256. {
  257. sp_nodraw(&7a, 0);
  258. sp_nodraw(&7b, 0);
  259. &text5 = say_xy("`%Leave",25, 270);
  260. }
  261.  
  262. if(&ch != 5)
  263. {
  264.  
  265. &text5 = say_xy("`!Leave",25, 270);
  266. }
  267. sp_kill(&text5, 0);
  268.  
  269.  
  270.  
  271. //18 is up, 12 is down
  272. wait_for_button();
  273.  
  274. if(&result == 14)
  275. {
  276. goto down;
  277.  
  278. }
  279.  
  280. if(&result == 16)
  281. {
  282. goto up;
  283. }
  284.  
  285. if(&result == 1)
  286. {
  287. playsound(17,22050,0,0,0);
  288. sp_active(&text, 0);
  289. sp_active(&text2, 0);
  290. sp_active(&text3, 0);
  291. sp_active(&text4, 0);
  292. sp_active(&text5, 0);
  293. sp_active(&left, 0);
  294. sp_active(&mid, 0);
  295. sp_active(&mid2, 0);
  296. sp_active(&right, 0);
  297. sp_active(&title, 0);
  298. sp_active(&title2, 0);
  299. sp_active(&1a, 0);
  300. sp_active(&1b, 0);
  301. sp_active(&2a, 0);
  302. sp_active(&2b, 0);
  303. sp_active(&3a, 0);
  304. sp_active(&3b, 0);
  305. sp_active(&4a, 0);
  306. sp_active(&4b, 0);
  307. sp_active(&5a, 0);
  308. sp_active(&5b, 0);
  309. sp_active(&6a, 0);
  310. sp_active(&6b, 0);
  311. sp_active(&7a, 0);
  312. sp_active(&7b, 0);
  313.  
  314. if(&ch == 1)
  315. {
  316. say_stop("Can you read me some of these books?",1);
  317. wait(100);
  318. say_stop("`4Spoilers.",¤t_sprite);
  319. say_stop("`4Spoilers.",¤t_sprite);
  320. wait(100);
  321. choice_start();
  322. set_y 240
  323. set_title_color 4
  324. title_start();
  325. "Spoiler Title?"
  326. title_end();
  327. "Sure!"
  328. "Not right now."
  329. choice_end();
  330. int &newres = &result;
  331.  
  332. if(&newres == 1)
  333. {
  334. say_stop("`4Spoilers.",¤t_sprite);
  335. unfreeze(1);
  336. unfreeze(¤t_sprite);
  337. return;
  338.  
  339. }
  340.  
  341. if(&newres == 2)
  342. {
  343. say_stop("Spoilers.",1);
  344. unfreeze(1);
  345. unfreeze(¤t_sprite);
  346. return;
  347. }
  348.  
  349. }
  350.  
  351. if(&ch == 2)
  352. {
  353. say_stop("Spoilers.",1);
  354. unfreeze(1);
  355. unfreeze(¤t_sprite);
  356. return;
  357. }
  358.  
  359.  
  360.  
  361.  
  362. if(&ch == 3)
  363. {
  364. say_stop("Spoilers.",1);
  365. unfreeze(1);
  366. unfreeze(¤t_sprite);
  367. return;
  368.  
  369.  
  370.  
  371. }
  372.  
  373. if(&ch == 4)
  374. {
  375.  
  376. if(&wellq == 0)
  377. {
  378. say_stop("Do you need help with anything?",1);
  379. wait(100);
  380. say_stop("`4Hmm...yes, I suppose I could use your help with something.",¤t_sprite);
  381. say_stop("`4I accidentally dropped one of my most treasured items, the statue of King Anatidae,",¤t_sprite);
  382. say_stop("`4down the well outside my house.",¤t_sprite);
  383. say_stop("`4If you retrieve it for me, I'm sure I have something good lying around that will be valuable to you.",¤t_sprite);
  384. wait(100);
  385. choice_start();
  386. set_y 240
  387. set_title_color 4
  388. title_start();
  389. "Start 'Gravity Most Fowl'?"
  390. title_end();
  391. "Yes"
  392. "No"
  393. choice_end();
  394.  
  395. if(&result == 1)
  396. {
  397. say_stop("Spoilers.",1);
  398. &wellq += 1;
  399. unfreeze(1);
  400. unfreeze(¤t_sprite);
  401. return;
  402. }
  403.  
  404. if(&result == 2)
  405. {
  406. unfreeze(1);
  407. unfreeze(¤t_sprite);
  408. return;
  409. }
  410.  
  411.  
  412. }
  413.  
  414. if(&wellq == 1)
  415. {
  416. say_stop("Spoilers.",1);
  417. unfreeze(1);
  418. unfreeze(¤t_sprite);
  419. return;
  420. }
  421.  
  422. if(&wellq == 3)
  423. {
  424. say_stop("Spoiler.",1);
  425. &wellq += 1;
  426. unfreeze(1);
  427. unfreeze(¤t_sprite);
  428. return;
  429. }
  430.  
  431. if(&wellq == 4)
  432. {
  433. say_stop("spoiler.",1);
  434. unfreeze(1);
  435. unfreeze(¤t_sprite);
  436. return;
  437. }
  438.  
  439. }
  440.  
  441.  
  442.  
  443. if(&ch == 5)
  444. {
  445. unfreeze(1);
  446. unfreeze(¤t_sprite);
  447. return;
  448. }
  449.  
  450. }
  451.  
  452.  
  453.  
  454. if(&result == 12)
  455. {
  456. down:
  457. playsound(11,22050,0,0,0);
  458. freeze(1);
  459. if(&ch == 1)
  460. {
  461. &ch = 2;
  462. goto loop;
  463. }
  464.  
  465. if(&ch == 2)
  466. {
  467. &ch = 3;
  468. goto loop;
  469. }
  470.  
  471. if(&ch == 3)
  472. {
  473. &ch = 4;
  474. goto loop;
  475. }
  476.  
  477. if(&ch == 4)
  478. {
  479. &ch = 5;
  480. goto loop;
  481. }
  482.  
  483. if(&ch == 5)
  484. {
  485. if(&speech > 0)
  486. {
  487. &ch = 1;
  488. }
  489.  
  490. if(&speech < 1)
  491. {
  492. &ch = 2;
  493. }
  494. goto loop;
  495. }
  496.  
  497.  
  498. }
  499.  
  500. if(&result == 18)
  501. {
  502. up:
  503. freeze(1);
  504. playsound(11,22050,0,0,0);
  505. if(&ch == 1)
  506. {
  507. &ch = 5;
  508. goto loop;
  509. }
  510.  
  511. if(&ch == 2)
  512. {
  513.  
  514. if(&speech > 0)
  515. {
  516. &ch = 1;
  517. }
  518.  
  519. if(&speech < 1)
  520. {
  521. &ch = 5;
  522. }
  523. goto loop;
  524. }
  525.  
  526. if(&ch == 3)
  527. {
  528. &ch = 2;
  529. goto loop;
  530. }
  531.  
  532. if(&ch == 4)
  533. {
  534. &ch = 3;
  535. goto loop;
  536. }
  537.  
  538. if(&ch == 5)
  539. {
  540. &ch = 4;
  541. goto loop;
  542.  
  543. }
  544.  
  545. else
  546. {
  547. goto loop;
  548. }
  549. //unfreeze(1);
  550. //unfreeze(&doc);
  551. //say("Not right now, thanks.",1);
  552. //return;
  553. }
  554.  
  555. goto loop;
  556. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement