当前位置: 首页>>代码示例>>C#>>正文


C# Unit.ShowCombatText方法代码示例

本文整理汇总了C#中Unit.ShowCombatText方法的典型用法代码示例。如果您正苦于以下问题:C# Unit.ShowCombatText方法的具体用法?C# Unit.ShowCombatText怎么用?C# Unit.ShowCombatText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Unit的用法示例。


在下文中一共展示了Unit.ShowCombatText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
            }
        }
    }
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:29,代码来源:Barge.cs

示例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);
	}
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:8,代码来源:ManaTrapTrigger.cs

示例3: RunEffect

	public override void RunEffect(Unit u, bool reapply = false)
    {
        base.RunEffect(u, reapply);

        u.movespeed = -100;
        u.maxAP = -100;
		if (!reapply) {
			u.ShowCombatText ("Stunned " + duration.ToString(), u.statusCombatText);
		}
    }
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:10,代码来源:Stun.cs

示例4: RunEffect

	public override void RunEffect(Unit u, bool reapply = false)
    {
        base.RunEffect(u, reapply);

        u.movespeed = -100;
		u.remainingMove = -100;
		if (!reapply) {
			u.ShowCombatText ("Snared", u.statusCombatText);
		}
    }
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:10,代码来源:Snare.cs

示例5: 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);
        }
    }
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:11,代码来源:ShieldSlam.cs

示例6: 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"));
    }
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:15,代码来源:RighteousShield.cs

示例7: 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);
            }
        }
    }
开发者ID:JohnEz,项目名称:TileBasedEngine,代码行数:15,代码来源:FlashFreeze.cs


注:本文中的Unit.ShowCombatText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。