shadowm

Untitled

Aug 8th, 2015
312
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.07 KB | None | 0 0
  1. #define WEAPON_SPECIAL_SHRAPNEL_IMPLEMENTATION
  2. [event]
  3. id=shrapnel:hit_handler
  4. name=attacker hits
  5. first_time_only=no
  6. [filter_attack]
  7. special=shrapnel
  8. [/filter_attack]
  9.  
  10. {BUG_ON
  11. ({VARIABLE_NUMERICAL_LESS_THAN_OR_EQUAL unit.variables.shrapnel_count 0})
  12. ("shrapnel count <= 0 at event start!")}
  13.  
  14. [harm_unit]
  15. [filter]
  16. [filter_adjacent]
  17. x,y=$x2,$y2
  18. adjacent=$second_unit.facing
  19. [/filter_adjacent]
  20. [/filter]
  21. amount=$weapon.damage
  22. alignment=$unit.alignment
  23. damage_type=$weapon.type
  24. kill=yes
  25. fire_event=yes
  26. animate=yes
  27. [/harm_unit]
  28.  
  29. {VARIABLE_DEC unit.variables.shrapnel_count}
  30.  
  31. [if]
  32. {VARIABLE_NUMERICAL_EQUALS unit.variables.shrapnel_count 0}
  33.  
  34. #
  35. # Remove weapon and events.
  36. #
  37. [then]
  38. [object]
  39. silent=yes
  40. [filter]
  41. x,y=$x1,$y1
  42. [/filter]
  43. [effect]
  44. apply_to=remove_attacks
  45. name=shrapnel
  46. [/effect]
  47. [/object]
  48.  
  49. [event]
  50. remove=yes
  51. id=shrapnel:hit_handler
  52. [/event]
  53. [/then]
  54. #
  55. # Update counter in the attack name.
  56. #
  57. [else]
  58. [object]
  59. silent=yes
  60. [filter]
  61. x,y=$x1,$y1
  62. [/filter]
  63. [effect]
  64. apply_to=attack
  65. name=shrapnel
  66. set_description="$unit.variables.shrapnel_name ($unit.variables.shrapnel_count)"
  67. [/effect]
  68. [/object]
  69. [/else]
  70. [/if]
  71. [/event]
  72. #enddef
Advertisement
Add Comment
Please, Sign In to add comment