|
闪电攻击是攻击动画中的一种,实现它分两个步骤:
1)编写WML。在要能闪电攻击兵种的[unit_type]块中增加一个表示闪电攻击的[attack_anim]
2)绘制相关图像。
闪电攻击WML定义,摘自咒术师兵种- [unit_type]
- ......
- {DUDU_LIGHTNING 1}
- {DUDU_LIGHTNING 2}
- {DUDU_LIGHTNING 3}
- ......
- [/unit_type]
复制代码 宏:DUDU_LIGHTNING- #define DUDU_LIGHTNING DIRECTION_NUMBER
- [attack_anim]
- [filter_attack]
- name=lightning
- [/filter_attack]
- {LIGHTNING_BOLT {DIRECTION_NUMBER} }
- [if]
- hits=yes
- [frame]
- begin=-300
- end=-200
- image="units/human-kingdom/zhoushushi-ranged1.png"
- sound=lightning.ogg
- [/frame]
- [/if]
- [else]
- hits=no
- [frame]
- begin=-300
- end=-200
- image="units/human-kingdom/zhoushushi-ranged1.png"
- sound=lightning-miss.ogg
- [/frame]
- [/else]
- [frame]
- begin=-200
- end=-100
- image="units/human-kingdom/zhoushushi-ranged2.png"
- [/frame]
- [frame]
- begin=-100
- end=100
- image="units/human-kingdom/zhoushushi-ranged1.png"
- [/frame]
- [/attack_anim]
- #enddef
复制代码 宏:LIGHTNING_BOLT- #define LIGHTNING_BOLT DIRECTION_NUMBER
- [if]
- direction=sw,s,se
- [missile_frame]
- begin=-250
- end=150
- halo=halo/lightning-bolt-{DIRECTION_NUMBER}-1.png~FL(vert):100,halo/lightning-bolt-{DIRECTION_NUMBER}-2.png~FL(vert):100,halo/lightning-bolt-{DIRECTION_NUMBER}-3.png~FL(vert):100,halo/lightning-bolt-{DIRECTION_NUMBER}-4.png~FL(vert):100
- halo_y=-125
- offset=1.0
- [/missile_frame]
- [/if]
- [else]
- direction=nw,n,ne
- [missile_frame]
- begin=-250
- end=150
- halo=halo/lightning-bolt-{DIRECTION_NUMBER}-1.png:100,halo/lightning-bolt-{DIRECTION_NUMBER}-2.png:100,halo/lightning-bolt-{DIRECTION_NUMBER}-3.png:100,halo/lightning-bolt-{DIRECTION_NUMBER}-4.png:100
- halo_y=-125
- offset=1.0
- [/missile_frame]
- [/else]
- #enddef
复制代码 |
|