C # development Wpf/silverlight animation and games series (Game Course): (32) Thunder, mix, ice, poison, fire, wind-magical charm of magic
In this section, I'll show you how to add gorgeous additional properties to the magic in the game.
The first step is to define the rules:
1 Define Magical Additional attribute categories: In this tutorial example game, I define the magic attached property as 6 categories: thunder, Mix, ice, poison, fire, wind, why should you name it in such an irregular way? Because it is a tutorial, we need to learn how to achieve the corresponding effect, this 6 categories of properties is currently the most popular six magic attributes, if everyone has mastered, whether it is Chinese-style 5 lines or other styles, such as design, can do their best.
2 Define Magic additional property function and effect:
Thunder – Paralysis – elf paralysis (attached this property wizard will not move)
Mixed-Chaos – Sprite confusion (attached to this property wizard will run)
Ice – Frost – Elf deceleration (attached to this property sprite move speed, physical attack speed, casting speed all slow)
Poison – Poisoning – Elf intoxication (attached to this property wizard continues to reduce life value per second)
Fire – Burn – Genie Burns (attached to this property wizard all defensive class attribute values are lowered)
Wind – Weakness – Elf weakening (attached to this property Wizard all attack class attribute values are reduced)
Corresponding enumeration:
<ExtraItems>
<Item Value="0" Src="Interface/Icon/Extra0.png" Name="麻痹" Description="效果:无法动弹" />
<Item Value="1" Src="Interface/Icon/Extra1.png" Name="混乱" Description="效果:乱跑" />
<Item Value="2" Src="Interface/Icon/Extra2.png" Name="冰冻" Description="效果:速度减缓" />
<Item Value="3" Src="Interface/Icon/Extra3.png" Name="中毒" Description="效果:持续伤血" />
<Item Value="4" Src="Interface/Icon/Extra4.png" Name="燃烧" Description="效果:所有防御属性值降低" />
<Item Value="5" Src="Interface/Icon/Extra5.png" Name="虚弱" Description="效果:所有攻击属性值降低" />
</ExtraItems>
3 Define magical additional attributes visual performance:
Paralysis – White
Chaos – Yellow
Frozen – Sky Blue
Poisoning – Green
Burning – Red
Weakness – Grey