當前位置: 首頁>>代碼示例>>C#>>正文


C# MapObject.IsFriendlyTarget方法代碼示例

本文整理匯總了C#中Server.MirObjects.MapObject.IsFriendlyTarget方法的典型用法代碼示例。如果您正苦於以下問題:C# MapObject.IsFriendlyTarget方法的具體用法?C# MapObject.IsFriendlyTarget怎麽用?C# MapObject.IsFriendlyTarget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.MirObjects.MapObject的用法示例。


在下文中一共展示了MapObject.IsFriendlyTarget方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: PetEnhancer

        private void PetEnhancer(MapObject target, UserMagic magic, out bool cast)
        {
            cast = false;

            if (target == null || target.Race != ObjectType.Monster || !target.IsFriendlyTarget(this)) return;

            int duration = GetAttackPower(MinSC, MaxSC) + magic.GetPower();

            cast = true;

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, duration, target);

            ActionList.Add(action);
        }
開發者ID:thedeaths,項目名稱:official-mir2c-,代碼行數:14,代碼來源:PlayerObject.cs

示例2: UltimateEnhancer

        private void UltimateEnhancer(MapObject target, UserMagic magic, out bool cast)
        {
            cast = false;

            if (target == null || !target.IsFriendlyTarget(this)) return;
            UserItem item = GetAmulet(1);
            if (item == null) return;

            long expiretime = GetAttackPower(MinSC, MaxSC) * 2 + (magic.Level + 1) * 10;
            int value = MaxSC >= 5 ? Math.Min(8, MaxSC / 5) : 1;

            switch (target.Race)
            {
                case ObjectType.Monster:
                case ObjectType.Player:
                    //Only targets
                    if (target.IsFriendlyTarget(this))
                    {
                        target.AddBuff(new Buff { Type = BuffType.UltimateEnhancer, Caster = this, ExpireTime = Envir.Time + expiretime * 1000, Values = new int[] { value } });
                        target.OperateTime = 0;
                        LevelMagic(magic);
                        ConsumeItem(item, 1);
                        cast = true;
                    }
                    break;
            }
        }
開發者ID:thedeaths,項目名稱:official-mir2c-,代碼行數:27,代碼來源:PlayerObject.cs

示例3: EnergyShield

        private void EnergyShield(MapObject target, UserMagic magic, out bool cast)
        {
            cast = false;

            if (!target.IsFriendlyTarget(this)) target = this; //offical is only party target

            int duration = 30 + 50 * magic.Level;
            int power = GetAttackPower(magic.GetPower(MinSC), magic.GetPower(MaxSC) + 1);
            int chance = 9 - (Luck / 3 + magic.Level);

            int[] values = { chance < 2 ? 2 : chance, power };

            switch (target.Race)
            {
                case ObjectType.Player:
                    //Only targets
                    if (target.IsFriendlyTarget(this))
                    {
                        target.AddBuff(new Buff { Type = BuffType.EnergyShield, Caster = this, ExpireTime = Envir.Time + duration * 1000, Visible = true, Values = values });
                        target.OperateTime = 0;
                        LevelMagic(magic);
                        cast = true;
                    }
                    break;
            }
        }
開發者ID:thedeaths,項目名稱:official-mir2c-,代碼行數:26,代碼來源:PlayerObject.cs

示例4: Purification

        private void Purification(MapObject target, UserMagic magic)
        {
            if (target == null || !target.IsFriendlyTarget(this)) return;

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, target);

            ActionList.Add(action);
        }
開發者ID:thedeaths,項目名稱:official-mir2c-,代碼行數:8,代碼來源:PlayerObject.cs

示例5: Healing

        private void Healing(MapObject target, UserMagic magic)
        {
            if (target == null || !target.IsFriendlyTarget(this)) return;

            int health = GetAttackPower(MinSC, MaxSC) * 2 + magic.GetPower() + Level;

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, health, target);

            ActionList.Add(action);
        }
開發者ID:thedeaths,項目名稱:official-mir2c-,代碼行數:10,代碼來源:PlayerObject.cs

示例6: EnergyShields

        private void EnergyShields(MapObject target, UserMagic magic, out bool cast)
        {
            cast = false;

            if (target == null || !target.IsFriendlyTarget(this)) return;
            UserItem item = GetAmulet(1);
            if (item == null) return;

            int expireTime = GetAttackPower(MinSC, MaxSC) * 2 + (magic.Level + 1) * 10;
            //int value = MaxSC >= 5 ? Math.Min(8, MaxSC / 5) : 1;

            ActionList.Add(new DelayedAction(DelayedType.Magic, Envir.Time + 500, magic, expireTime));
        }
開發者ID:Fenarir,項目名稱:mir2,代碼行數:13,代碼來源:PlayerObject.cs


注:本文中的Server.MirObjects.MapObject.IsFriendlyTarget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。