URI:
   DIR Return Create A Forum - Home
       ---------------------------------------------------------
       zwclose7
  HTML https://zwclose7.createaforum.com
       ---------------------------------------------------------
       *****************************************************
   DIR Return to: Battle for Wesnoth
       *****************************************************
       #Post#: 242--------------------------------------------------
       Weapon special: death sting (with example unit)
       By: zwclose7 Date: January 22, 2017, 7:48 am
       ---------------------------------------------------------
       Description: When this attack hits a poisoned unit, the unit is
       instantly killed. Death event are triggered.
       [code]#define WEAPON_SPECIAL_DEATH_STING
       [dummy]
       id=death_sting
       name="death sting"
       description="When this attack hits a poisoned unit, the unit
       is instantly killed. Death event are triggered."
       [/dummy]
       
       [/specials]
       [/attack]
       
       [event]
       name=attacker hits
       first_time_only=no
       
       [filter_attack]
       special=death_sting
       [/filter_attack]
       
       [filter_second]
       [filter_wml]
       [status]
       poisoned=yes
       [/status]
       [/filter_wml]
       [/filter_second]
       
       [unstore_unit]
       variable=second_unit
       text="instant death"
       {COLOR_HARM}
       [/unstore_unit]
       
       [kill]
       x=$x2
       y=$y2
       animate=yes
       fire_event=yes
       [/kill]
       [/event]
       [event]
       name=defender hits
       first_time_only=no
       
       [filter_second_attack]
       special=death_sting
       [/filter_second_attack]
       
       [filter]
       [filter_wml]
       [status]
       poisoned=yes
       [/status]
       [/filter_wml]
       [/filter]
       
       [unstore_unit]
       variable=unit
       text="instant death"
       {COLOR_HARM}
       [/unstore_unit]
       
       [kill]
       x=$x1
       y=$y1
       animate=yes
       fire_event=yes
       [/kill]
       [/event]
       
       [+attack]
       [+specials]
       #enddef
       #define SPECIAL_NOTES_DEATH_STING
       " This unit's death sting attack kills any poisoned units
       instantly."#enddef[/code]
       Example unit
       [code][unit_type]
       [base_unit]
       id=Giant Scorpion
       [/base_unit]
       
       # A stronger version of Giant Scorpion
       
       id=Death Scorpion
       name="Death Scorpion"
       description="Death Scorpions are deadly creatures. They can
       attack with their venomnous sting or pincers, or by firing death
       ray from their
       tail."+{SPECIAL_NOTES}+{SPECIAL_NOTES_POISON}+{SPECIAL_NOTES_DEA
       TH_STING}
       level=4
       experience=200
       hitpoints=80
       cost=60
       alignment=chaotic
       usage=mixed fighter
       
       # Death Scorpions are immune to poison
       
       [trait]
       id=immune
       availability=musthave
       name="immune"
       description="Immune to poison"
       
       [effect]
       apply_to=status
       add=unpoisonable
       [/effect]
       [/trait]
       
       # Death Scorpions are faster than normal scorpions
       
       [movement_costs]
       hills=1
       mountains=2
       cave=1
       sand=1
       frozen=1
       [/movement_costs]
       
       [defense]
       cave=50
       sand=50
       fungus=40
       [/defense]
       
       # Death Scorpions have harder shell than normal scorpions
       
       [resistance]
       blade=70
       pierce=70
       fire=100
       cold=100
       [/resistance]
       
       [attack]
       damage=20
       
       [specials]
       {WEAPON_SPECIAL_DEATH_STING}
       [/specials]
       [/attack]
       
       [attack]
       damage=16
       [/attack]
       
       [attack]
       name=death ray
       description="death ray"
       icon=attacks/dark-missile.png
       type=fire
       range=ranged
       damage=10
       number=4
       [/attack]
       
       [attack_anim]
       [/attack_anim]
       
       [attack_anim]
       [/attack_anim]
       
       # Death Scorpions have an extra ranged attack
       
       [attack_anim]
       [filter_attack]
       name=death ray
       [/filter_attack]
       
       start_time=-100
       missile_start_time=-50
       
       [missile_frame]
       duration=100
       image=projectiles/darkmissile-n.png
       image_diagonal=projectiles/darkmissile-ne.png
       [/missile_frame]
       
       {SOUND:HIT_AND_MISS magic-dark.ogg magic-dark-miss.ogg -50}
       [/attack_anim]
       [/unit_type][/code]
       #Post#: 245--------------------------------------------------
       Re: Weapon special: death sting (with example unit)
       By: zwclose7 Date: February 1, 2017, 4:40 am
       ---------------------------------------------------------
       Update: Test video
  HTML https://www.youtube.com/watch?v=w9x0cJ9RhxA
       *****************************************************