npc.qsrc 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. # npc
  2. if $ARGS[0] = 'cleanarrays':
  3. i_gs_cl = 0
  4. :CiklNpcCleanLoop
  5. if i_gs_cl < arrsize('$npc_index'):
  6. if $npc_index[i_gs_cl] = $npclastgenerated : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  7. if arrpos('$cumarrnam', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  8. if arrpos('$sparrnam', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  9. if arrpos('$cumfthname', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  10. if arrpos('$wombpotfath', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  11. if arrpos('$wombName', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  12. if arrpos('$cumfathlotto', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  13. if arrpos('$ChildFath', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  14. if arrpos('$ChildThFath', $npc_index[i_gs_cl]) >= 0 : i_gs_cl += 1 & jump 'CiklNpcCleanLoop'
  15. if mid($npc_index[i_gs_cl],1,1) = 'C' or mid($npc_index[i_gs_cl],1,1) = 'b' :
  16. gs 'npccleanc',ucase($npc_index[i_gs_cl])
  17. jump 'CiklNpcCleanLoop'
  18. end
  19. i_gs_cl += 1
  20. jump 'CiklNpcCleanLoop'
  21. end
  22. killvar 'i_gs_cl'
  23. end
  24. if $ARGS[0] = 'age':
  25. currnpc_year = mid(npc_dob[$ARGS[1]], 1, 4)
  26. currnpc_month = mid(npc_dob[$ARGS[1]], 5, 2)
  27. currnpc_day = mid(npc_dob[$ARGS[1]], 7, 2)
  28. currnpc_age = year - currnpc_year
  29. if currnpc_month < month:
  30. currnpc_age -= 1
  31. elseif currnpc_month = month and currnpc_day < day:
  32. currnpc_age -= 1
  33. end
  34. RESULT = currnpc_age
  35. killvar 'currnpc_year'
  36. killvar 'currnpc_month'
  37. killvar 'currnpc_day'
  38. killvar 'currnpc_age'
  39. end
  40. if $ARGS[0] = 'intro':
  41. !! this procedure is designed for introduction of any npc either with standard or with custom description
  42. !! $ARGS[1] is ID number of npc... required parameter
  43. !! $ARGS[2] is an image path
  44. !! $ARGS[3] is a color name of the title e.g. 'red'
  45. !! $ARGS[4] is $npc_notes replacement
  46. !! $ARGS[5] is an additional text
  47. !! ARGS[6] sets image path to video output - 0 = off - 1 = on
  48. !! Format: gs 'npc' 'intro', ARGS[1], $ARGS[2], $ARGS[3], $ARGS[4], $ARGS[5]
  49. !! Example: gs 'npc' 'intro', 'A23', '', 'green', '', 'Optional text here' <=== This would display Albina''s picture using the path in 'npcstatic1' with her name above it in green text followed by her default description and finally, your relationship level.
  50. !! Credit goes to rachels for coming up with the concept and initial code!!!
  51. *clear
  52. $static_num = $ARGS[1]
  53. if npc_rel[$static_num] < 20: $npc_cur_rel = 'You don''t get along at all with <<$npc_firstname[$static_num]>>.'
  54. if npc_rel[$static_num] >= 20 and npc_rel[$static_num] < 40: $npc_cur_rel = 'You don''t get along very well with <<$npc_firstname[$static_num]>>.'
  55. if npc_rel[$static_num] >= 40 and npc_rel[$static_num] < 60: $npc_cur_rel = 'You have a normal relationship with <<$npc_firstname[$static_num]>>.'
  56. if npc_rel[$static_num] >= 60 and npc_rel[$static_num] < 80: $npc_cur_rel = 'You have a good relationship with <<$npc_firstname[$static_num]>>.'
  57. if npc_rel[$static_num] >= 80: $npc_cur_rel = 'You have a great relationship with <<$npc_firstname[$static_num]>>.'
  58. if $ARGS[2] = '':
  59. $image_path = $npc_pic[$static_num]
  60. else
  61. $image_path = $ARGS[2]
  62. end
  63. if $ARGS[3] = '':
  64. $titlecolor ='maroon'
  65. else
  66. $titlecolor = $ARGS[3]
  67. end
  68. if $ARGS[4] = '':
  69. $description = $npc_notes[$static_num]
  70. else
  71. $description = $ARGS[4]
  72. end
  73. $apendix = $ARGS[5]
  74. '<center><b><font color = <<$titlecolor>>><<$npc_firstname[$static_num]>> <<$npc_lastname[$static_num]>></font></b></center>' & *nl
  75. if $image_path ! '':
  76. if ARGS[6] = 0:
  77. '<center><img <<$set_imgh>> src="<<$image_path>>"></center>' & *nl
  78. else
  79. '<center><video autoplay loop src="<<$image_path>>"></video></center>' & *nl
  80. end
  81. end
  82. if $description ! '' and $description ! ' ': $description + $npc_cur_rel
  83. if $apendix ! '' and $apendix ! ' ':$apendix
  84. killvar '$npc_cur_rel'
  85. killvar '$apendix'
  86. killvar '$description'
  87. killvar '$image_path'
  88. end
  89. --- npc ---------------------------------