Advertisement
Farbjodr

Switch Leader fix

Apr 9th, 2016
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.93 KB | None | 0 0
  1. #ifdef MULTIPLAYER
  2.  
  3. [modification]
  4. id=mod_Switch_Leader
  5. name=_"Switch Leader"
  6. description=_"Allows players to replace a unit they own their original leader. Mainly intended for survival games."
  7. [options]
  8. [checkbox]
  9. id=mod_switch_leader_no_limit
  10. name=_"No limit"
  11. description=_"Whether each player should be able to name a new leader unlimited times within the same game."
  12. default=yes
  13. [/checkbox]
  14. [slider]
  15. id=mod_switch_leader_times
  16. name=_"Maximum times:"
  17. description=_"How many times should each player be allowed to switch leader. Only has effect if the No limit option is unchecked."
  18. min=1
  19. max=15
  20. step=1
  21. default=1
  22. [/slider]
  23. [/options]
  24.  
  25. [event]
  26. name=prestart
  27. {VARIABLE mod_switch_leader_times_1 $mod_switch_leader_times}
  28. {VARIABLE mod_switch_leader_times_2 $mod_switch_leader_times}
  29. {VARIABLE mod_switch_leader_times_3 $mod_switch_leader_times}
  30. {VARIABLE mod_switch_leader_times_4 $mod_switch_leader_times}
  31. {VARIABLE mod_switch_leader_times_5 $mod_switch_leader_times}
  32. {VARIABLE mod_switch_leader_times_6 $mod_switch_leader_times}
  33. {VARIABLE mod_switch_leader_times_7 $mod_switch_leader_times}
  34. {VARIABLE mod_switch_leader_times_8 $mod_switch_leader_times}
  35. {VARIABLE mod_switch_leader_times_9 $mod_switch_leader_times}
  36. [set_menu_item]
  37. id=mod_switch_leader_menu
  38. description=_"Make this unit your leader"
  39. [show_if]
  40. [have_unit]
  41. x=$x1
  42. y=$y1
  43. side=$side_number
  44. canrecruit=no
  45. [/have_unit]
  46. [and]
  47. [variable]
  48. name=mod_switch_leader_times_$side_number
  49. greater_than=0
  50. [/variable]
  51. [or]
  52. [variable]
  53. name=mod_switch_leader_no_limit
  54. boolean_equals=true
  55. [/variable]
  56. [/or]
  57. [/and]
  58. [/show_if]
  59. [command]
  60. [modify_unit]
  61. [filter]
  62. side=$side_number
  63. canrecruit=yes
  64. [/filter]
  65. canrecruit=no
  66. [/modify_unit]
  67. [modify_unit]
  68. [filter]
  69. x=$x1
  70. y=$y1
  71. [/filter]
  72. canrecruit=yes
  73. [/modify_unit]
  74. [set_variable]
  75. name=mod_switch_leader_times_$side_number
  76. sub=1
  77. [/set_variable]
  78. [/command]
  79. [/set_menu_item]
  80. [/event]
  81. [/modification]
  82. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement