Guest User

Untitled

a guest
Aug 16th, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.79 KB | None | 0 0
  1. #define ABILITY_GPA_TRANSPORT
  2. [dummy]
  3. id=ability_gpa_transport
  4. name= _ "transport"
  5. name_inactive= _ "transport"
  6. description= _ "This unit can carry other (non-mechanical) units including your leader. To load a unit onto a transport right click on it while it is adjacent to an unloaded transport. To unload a transport right click on an empty hex aside a loaded transport. Units that have attacked or captured villages may not be loaded."
  7. description_inactive= _ "This unit can carry other (non-mechanical) units including your leader. To load a unit onto a transport right click on it while it is adjacent to an unloaded transport. To unload a transport right click on an empty hex aside a loaded transport. Units that have attacked or captured villages may not be loaded."
  8.  
  9. apply_to=self
  10. [/dummy]
  11. [/abilities]
  12.  
  13. [event]
  14. name=recruit
  15. first_time_only=no
  16. {MODIFY_UNIT (x,y=$x1,$y1) variables.loaded no}
  17. [/event]
  18. [event]
  19. name=recruit
  20. first_time_only=no
  21. {MODIFY_UNIT (x,y=$x1,$y1) variables.unloadable no}
  22. [/event]
  23. [event]
  24. name=capture
  25. first_time_only=no
  26. {MODIFY_UNIT (x,y=$x1,$y1) variables.unloadable yes}
  27. [/event]
  28. [event]
  29. name=attack
  30. first_time_only=no
  31. {MODIFY_UNIT (x,y=$x1,$y1) variables.unloadable yes}
  32. [/event]
  33. [event]
  34. name=side turn
  35. first_time_only=no
  36. {MODIFY_UNIT (side=$side_number) variables.unloadable no}
  37. [/event]
  38. [event]
  39. name=prestart
  40. {MODIFY_UNIT (side=1) variables.unloadable no}
  41. ###This one because side turn apparently doesn't work for first turn.
  42. [/event]
  43.  
  44. [event]
  45. name=side turn,moveto,recruit
  46. first_time_only=no
  47. [set_menu_item]
  48. id=load transport
  49. description=_ "Load into transport"
  50. [filter_location]
  51. [not]
  52. terrain=X*,Md^Xm,Mm^Xm,
  53. [/not]
  54. [filter]
  55. side=$side_number
  56. [not]
  57. race=mechanical
  58. [/not]
  59. [/filter]
  60. [/filter_location]
  61. [show_if]
  62. [have_unit]
  63. [filter_location]
  64. x,y=$x1,$y1
  65. radius=1
  66. [/filter_location]
  67. side=$side_number
  68. ability=ability_gpa_transport
  69. [not]
  70. [filter_wml]
  71. [variables]
  72. number_of_loaded_units=3
  73. [/variables]
  74. [/filter_wml]
  75. [/not]
  76. [not]
  77. x,y=$x1,$y1
  78. [/not]
  79. [/have_unit]
  80. [/show_if]
  81. [command]
  82. [store_unit]
  83. [filter]
  84. [filter_location]
  85. x,y=$x1,$y1
  86. radius=1
  87. [/filter_location]
  88. side=$side_number
  89. ability=ability_gpa_transport
  90. [/filter]
  91. variable=transport
  92. [/store_unit]
  93. {MODIFY_UNIT (x,y=$x1,$y1) moves 0} #This should make it so that when unloaded the unit will have no MP left to prevent transports from being used as short range teleporters.
  94. {MODIFY_UNIT (x,y=$x1,$y1) attacks_left 1} #This should make it so that units loaded the turn they are recruited still get an attack when unloaded.
  95. [store_unit]
  96. [filter]
  97. x,y=$x1,$y1
  98. [/filter]
  99. kill=yes
  100. variable=transport.variables.cargo
  101. mode=append
  102. [/store_unit]
  103. [if]
  104. [variable]
  105. name=transport.variables.cargo.canrecruit
  106. boolean_equals=yes
  107. [/variable]
  108. [then]
  109. [set_variable]
  110. name=transport.canrecruit
  111. value=yes
  112. [/set_variable]
  113. [/then]
  114. [/if]
  115. [set_variable]
  116. name=transport.variables.number_of_loaded_units
  117. value=$transport.variables.cargo.length
  118. [/set_variable]
  119. [message]
  120. speaker=narrator
  121. message= _ "questa unità trasporta $transport.variables.number_of_loaded_units unità."
  122. [/message]
  123.  
  124. [unstore_unit]
  125. variable=transport[0]
  126. text= _"loaded $transport.variables.cargo.name"
  127. [/unstore_unit]
  128.  
  129. [unit_overlay]
  130. x,y=$transport.x,$transport.y
  131. image=Badges/loaded.png
  132. [/unit_overlay]
  133.  
  134. [clear_variable]
  135. name=transport
  136. [/clear_variable]
  137. [/command]
  138. [/set_menu_item]
  139.  
  140. [set_menu_item]
  141. id=unload transport
  142. description=_ "Unload transport"
  143. [filter_location]
  144. [not]
  145. terrain=Wo,X*,Md^Xm,Mm^Xm,W*,
  146. [or]
  147. [filter]
  148. #hopefully this should make it so that it does not show if there is a unit there.
  149. [/filter]
  150. [/or]
  151. [/not]
  152. [/filter_location]
  153. [show_if]
  154. [have_unit]
  155. [filter_location]
  156. x,y=$x1,$y1
  157. radius=1
  158. [/filter_location]
  159. side=$side_number
  160. ability=ability_gpa_transport
  161. [/have_unit]
  162. [/show_if]
  163. [command]
  164. [store_unit]
  165. [filter]
  166. [filter_location]
  167. x,y=$x1,$y1
  168. radius=1
  169. [/filter_location]
  170. side=$side_number
  171. ability=ability_gpa_transport
  172. [/filter]
  173. variable=transport
  174. [/store_unit]
  175. [if]
  176. [variable]
  177. name=transport.variables.cargo.canrecruit
  178. boolean_equals=yes
  179. [/variable]
  180. [then]
  181. [set_variable]
  182. name=transport.canrecruit
  183. value=no
  184. [/set_variable]
  185. [/then]
  186. [/if]
  187. [set_variable]
  188. name=lunghezza
  189. value=$transport.variables.cargo.length
  190. [/set_variable]
  191. [set_variable]
  192. name=lunghezza
  193. add=-1
  194. [/set_variable]
  195. [message]
  196. side=1
  197. message= _"$lunghezza"
  198. [/message]
  199. [unstore_unit]
  200. variable=transport.variables.cargo[$lunghezza]
  201. text= _"unloaded $transport.variables.cargo.name"
  202. x,y=$x1,$y1
  203. [/unstore_unit]
  204. [clear_variable]
  205. name=transport.variables.cargo[$lunghezza]
  206. [/clear_variable]
  207. [set_variable]
  208. name=transport.variables.number_of_loaded_units
  209. value=$transport.variables.cargo.length
  210. [/set_variable]
  211. [message]
  212. speaker=narrator
  213. message= _ "questa unità trasporta $transport.variables.number_of_loaded_units unità."
  214. [/message]
  215. [capture_village]
  216. side=$side_number
  217. x,y=$x1,$y1
  218. [/capture_village]
  219. [set_variable]
  220. name=transport.variables.loaded
  221. value=no
  222. [/set_variable]
  223. [unstore_unit]
  224. variable=transport[0]
  225. [/unstore_unit]
  226. [remove_unit_overlay]
  227. x,y=$transport.x,$transport.y
  228. image=Badges/loaded.png
  229. [/remove_unit_overlay]
  230.  
  231. [clear_variable]
  232. name=transport
  233. [/clear_variable]
  234. [/command]
  235. [/set_menu_item]
  236. [/event]
  237. [+abilities]
  238. #enddef
Add Comment
Please, Sign In to add comment