本文整理汇总了C#中Unit.ApplyEffect方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.ApplyEffect方法的具体用法?C# Unit.ApplyEffect怎么用?C# Unit.ApplyEffect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Unit
的用法示例。
在下文中一共展示了Unit.ApplyEffect方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UseAbility
public override void UseAbility(Unit target)
{
base.UseAbility (target);
Vector3 pos = map.TileCoordToWorldCoord (target.tileX, target.tileY);
myVisualEffects.Add (effectLib.CreateVisualEffect ("Hit1", pos).GetComponent<EffectController> ());
int dmg = (int)(damage * myCaster.damageDealtMod);
myCaster.AddGuardPoints (2);
// if the target is normal or smaller size
if (target.mySize <= UnitSize.Normal) {
int diffX = target.tileX - myCaster.tileX;
int diffY = target.tileY - myCaster.tileY;
//deal damage, if not dodged, apply effect
if (target.TakeDamage(dmg, effectLib.getSoundEffect ("Shield Slam"), true, myCaster) != -1) {
target.ApplyEffect (new Snare ("Barged", duration, effectLib.getIcon("Barge").sprite));
target.ShowCombatText ("Snared", myTarget.statusCombatText);
if (map.UnitCanEnterTile(myCaster.tileX+(diffX*2), myCaster.tileY+(diffY*2))) {
target.SlideToTile(myCaster.tileX+(diffX*2), myCaster.tileY+(diffY*2));
myCaster.SlideToTile(myCaster.tileX+(diffX), myCaster.tileY+(diffY));
}
}
} else {
if (target.TakeDamage(dmg, effectLib.getSoundEffect ("Shield Slam"), true, myCaster) != -1) {
target.ApplyEffect (new Snare ("Barged", duration, effectLib.getIcon("Barge").sprite));
target.ShowCombatText ("Snared", myTarget.statusCombatText);
}
}
}
示例2: RunTrigger
public override void RunTrigger (Unit host, Unit attacker = null)
{
base.RunTrigger (host, attacker);
host.ApplyEffect(new ManaLeachEffect("Mana Leach", 2, myCaster, 10, 0));
host.ApplyEffect (new Snare ("Mana Trap", 2));
host.ShowCombatText ("Snared", host.statusCombatText);
}
示例3: UseAbility
public override void UseAbility(Unit target)
{
AbilityFinished = false;
if (target.team == myCaster.team) {
target.ApplyEffect(new DamageDealtEffect("Amplify", duration, mod, 1, effectLib.getIcon("Arcane Pulse").sprite));
} else {
target.ApplyEffect(new DamageDealtEffect("Amplify", duration, -mod, 1, effectLib.getIcon("Arcane Pulse").sprite));
}
}
示例4: UseAbility
public override void UseAbility(Unit target)
{
base.UseAbility (target);
target.ApplyEffect (new MovespeedMod ("Righteous Speed", duration, 1, 1, effectLib.getIcon("Righteous Shield").sprite));
target.ApplyEffect (new ShieldEffect ("Righteous Shield", shieldDuration, shield, effectLib.getIcon("Righteous Shield").sprite));
target.ShowCombatText (shield.ToString (), target.statusCombatText);
target.UpdateHealthBar ();
Vector3 pos = map.TileCoordToWorldCoord (target.tileX, target.tileY);
myVisualEffects.Add (effectLib.CreateVisualEffect ("Righteous Shield", pos).GetComponent<EffectController> ());
myCaster.GetComponent<AudioSource> ().PlayOneShot (effectLib.getSoundEffect ("Righteous Shield"));
}
示例5: UseAbility
public override void UseAbility(Unit target)
{
base.UseAbility (target);
Effect eff1 = new Sleep ("Deep Slumber (sleep)", duration, effectLib.getIcon("Deep Slumber").sprite);
Effect eff2 = new DamageRecievedEffect ("Deep Slumber (dmg)", duration, damageMod, 1, effectLib.getIcon("Deep Slumber").sprite);
target.ApplyEffect(eff1);
target.ApplyEffect(eff2);
target.AddTrigger (new RemoveEffect ("Deep Slumber (sleep)", myCaster, TriggerType.Hit, eff1, effectLib, duration, effectLib.getIcon("Deep Slumber").sprite));
target.AddTrigger (new RemoveEffect ("Deep Slumber (dmg)", myCaster, TriggerType.Hit, eff2, effectLib, duration, effectLib.getIcon("Deep Slumber").sprite));
myCaster.GetComponent<AudioSource> ().PlayOneShot (effectLib.getSoundEffect ("Deep Slumber"));
}
示例6: UseAbility
public override void UseAbility(Unit target)
{
base.UseAbility (target);
int combo = myCaster.UseGuardPoints ();
int dmg = (int)(damage * myCaster.damageDealtMod);
if (target.TakeDamage(dmg * combo, effectLib.getSoundEffect ("Shield Slam"), true, myCaster) != -1) {
target.ApplyEffect(new Stun("Shield Slammed", (int)(combo / 2), effectLib.getIcon("Shield Slam").sprite));
target.ShowCombatText ("Stunned", target.statusCombatText);
}
}
示例7: UseAbility
public override void UseAbility(Unit target)
{
base.UseAbility (target);
target.TakeHealing ((int)(healing * myCaster.healingDealtMod), myCaster);
target.ApplyEffect (new DamageRecievedEffect ("Word Of Healing", duration, -damageMod, stacks, effectLib.getIcon("Word Of Healing").sprite));
Vector3 pos = map.TileCoordToWorldCoord (target.tileX, target.tileY);
myVisualEffects.Add (effectLib.CreateVisualEffect ("Word Of Healing", pos).GetComponent<EffectController> ());
myCaster.GetComponent<AudioSource> ().PlayOneShot (effectLib.getSoundEffect ("Word of Healing"));
}
示例8: RunTrigger
public override void RunTrigger (Unit host, Unit attacker = null)
{
base.RunTrigger (host, null);
int dmg = (int)(damage * myCaster.damageDealtMod);
host.TakeDamage (dmg, null, false, null);
host.ApplyEffect (new Stun ("Crackling Arrow", 1));
Vector3 pos = host.transform.position;
effectLib.CreateVisualEffect ("Hit1", pos);
myCaster.GetComponent<AudioSource> ().PlayOneShot (effectLib.getSoundEffect ("Crackling Arrow Pop"));
}
示例9: UseAbility
public override void UseAbility(Unit target)
{
base.UseAbility (target);
int dmg = (int)(damage * myCaster.damageDealtMod);
//deal damage, if not dodged, apply effect
if (target.TakeDamage (dmg, effectLib.getSoundEffect ("Lacerate"), true, myCaster) != -1) {
target.ApplyEffect (new Dot ("Lacerate", duration, bleedDmg, stacks, effectLib.getIcon("Lacerate").sprite));
}
Vector3 pos = map.TileCoordToWorldCoord (target.tileX, target.tileY);
myVisualEffects.Add (effectLib.CreateVisualEffect ("Slash1", pos).GetComponent<EffectController> ());
}
示例10: UseAbility
public override void UseAbility(Unit target)
{
cooldown = maxCooldown;
AbilityFinished = false;
myTarget = target;
int dmg = (int)(damage * myCaster.damageDealtMod);
//deal damage, if not dodged, apply effect
if (target.TakeDamage (dmg, null, true, myCaster) != -1) {
if (target.ApplyEffect (new Stun ("Frozen", duration, effectLib.getIcon("Flash Freeze").sprite))) {
target.ShowCombatText ("Stunned", target.statusCombatText);
}
}
}