Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define ABILITY_GPA_TRANSPORT
- [dummy]
- id=ability_gpa_transport
- name= _ "transport"
- name_inactive= _ "transport"
- 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."
- 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."
- apply_to=self
- [/dummy]
- [/abilities]
- [event]
- name=recruit
- first_time_only=no
- {MODIFY_UNIT (x,y=$x1,$y1) variables.loaded no}
- [/event]
- [event]
- name=recruit
- first_time_only=no
- {MODIFY_UNIT (x,y=$x1,$y1) variables.unloadable no}
- [/event]
- [event]
- name=capture
- first_time_only=no
- {MODIFY_UNIT (x,y=$x1,$y1) variables.unloadable yes}
- [/event]
- [event]
- name=attack
- first_time_only=no
- {MODIFY_UNIT (x,y=$x1,$y1) variables.unloadable yes}
- [/event]
- [event]
- name=side turn
- first_time_only=no
- {MODIFY_UNIT (side=$side_number) variables.unloadable no}
- [/event]
- [event]
- name=prestart
- {MODIFY_UNIT (side=1) variables.unloadable no}
- ###This one because side turn apparently doesn't work for first turn.
- [/event]
- [event]
- name=side turn,moveto,recruit
- first_time_only=no
- [set_menu_item]
- id=load transport
- description=_ "Load into transport"
- [filter_location]
- [not]
- terrain=X*,Md^Xm,Mm^Xm,
- [/not]
- [filter]
- side=$side_number
- [not]
- race=mechanical
- [/not]
- [/filter]
- [/filter_location]
- [show_if]
- [have_unit]
- [filter_location]
- x,y=$x1,$y1
- radius=1
- [/filter_location]
- side=$side_number
- ability=ability_gpa_transport
- [not]
- [filter_wml]
- [variables]
- number_of_loaded_units=3
- [/variables]
- [/filter_wml]
- [/not]
- [not]
- x,y=$x1,$y1
- [/not]
- [/have_unit]
- [/show_if]
- [command]
- [store_unit]
- [filter]
- [filter_location]
- x,y=$x1,$y1
- radius=1
- [/filter_location]
- side=$side_number
- ability=ability_gpa_transport
- [/filter]
- variable=transport
- [/store_unit]
- {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.
- {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.
- [store_unit]
- [filter]
- x,y=$x1,$y1
- [/filter]
- kill=yes
- variable=transport.variables.cargo
- mode=append
- [/store_unit]
- [if]
- [variable]
- name=transport.variables.cargo.canrecruit
- boolean_equals=yes
- [/variable]
- [then]
- [set_variable]
- name=transport.canrecruit
- value=yes
- [/set_variable]
- [/then]
- [/if]
- [set_variable]
- name=transport.variables.number_of_loaded_units
- value=$transport.variables.cargo.length
- [/set_variable]
- [message]
- speaker=narrator
- message= _ "questa unità trasporta $transport.variables.number_of_loaded_units unità."
- [/message]
- [unstore_unit]
- variable=transport[0]
- text= _"loaded $transport.variables.cargo.name"
- [/unstore_unit]
- [unit_overlay]
- x,y=$transport.x,$transport.y
- image=Badges/loaded.png
- [/unit_overlay]
- [clear_variable]
- name=transport
- [/clear_variable]
- [/command]
- [/set_menu_item]
- [set_menu_item]
- id=unload transport
- description=_ "Unload transport"
- [filter_location]
- [not]
- terrain=Wo,X*,Md^Xm,Mm^Xm,W*,
- [or]
- [filter]
- #hopefully this should make it so that it does not show if there is a unit there.
- [/filter]
- [/or]
- [/not]
- [/filter_location]
- [show_if]
- [have_unit]
- [filter_location]
- x,y=$x1,$y1
- radius=1
- [/filter_location]
- side=$side_number
- ability=ability_gpa_transport
- [/have_unit]
- [/show_if]
- [command]
- [store_unit]
- [filter]
- [filter_location]
- x,y=$x1,$y1
- radius=1
- [/filter_location]
- side=$side_number
- ability=ability_gpa_transport
- [/filter]
- variable=transport
- [/store_unit]
- [if]
- [variable]
- name=transport.variables.cargo.canrecruit
- boolean_equals=yes
- [/variable]
- [then]
- [set_variable]
- name=transport.canrecruit
- value=no
- [/set_variable]
- [/then]
- [/if]
- [set_variable]
- name=lunghezza
- value=$transport.variables.cargo.length
- [/set_variable]
- [set_variable]
- name=lunghezza
- add=-1
- [/set_variable]
- [message]
- side=1
- message= _"$lunghezza"
- [/message]
- [unstore_unit]
- variable=transport.variables.cargo[$lunghezza]
- text= _"unloaded $transport.variables.cargo.name"
- x,y=$x1,$y1
- [/unstore_unit]
- [clear_variable]
- name=transport.variables.cargo[$lunghezza]
- [/clear_variable]
- [set_variable]
- name=transport.variables.number_of_loaded_units
- value=$transport.variables.cargo.length
- [/set_variable]
- [message]
- speaker=narrator
- message= _ "questa unità trasporta $transport.variables.number_of_loaded_units unità."
- [/message]
- [capture_village]
- side=$side_number
- x,y=$x1,$y1
- [/capture_village]
- [set_variable]
- name=transport.variables.loaded
- value=no
- [/set_variable]
- [unstore_unit]
- variable=transport[0]
- [/unstore_unit]
- [remove_unit_overlay]
- x,y=$transport.x,$transport.y
- image=Badges/loaded.png
- [/remove_unit_overlay]
- [clear_variable]
- name=transport
- [/clear_variable]
- [/command]
- [/set_menu_item]
- [/event]
- [+abilities]
- #enddef
Add Comment
Please, Sign In to add comment