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


C# UserMagic.GetPower方法代码示例

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


在下文中一共展示了UserMagic.GetPower方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: 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

示例2: PoisonField

        private void PoisonField(UserMagic magic, Point location, out bool cast)
        {
            cast = false;

            if(Envir.Time < PoisonFieldTime) return;

            UserItem amuelt = GetAmulet(5);
            if (amuelt == null) return;

            UserItem poison = GetPoison(5, 1);
            if (poison == null) return;

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

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, location, Envir.Random.Next(PoisonAttack));

            ConsumeItem(amuelt, 5);
            ConsumeItem(poison, 5);

            PoisonFieldTime = Envir.Time + (18 - magic.Level*2)*1000;

            CurrentMap.ActionList.Add(action);
            cast = true;
        }
开发者ID:ufaith,项目名称:cmirosg,代码行数:24,代码来源:PlayerObject.cs

示例3: PoisonCloud

        private void PoisonCloud(UserMagic magic, Point location, out bool cast)
        {
            cast = false;

            UserItem amulet = GetAmulet(5);
            if (amulet == null) return;

            UserItem poison = GetPoison(5, 1);
            if (poison == null) return;

            int delay = Functions.MaxDistance(CurrentLocation, location) * 50 + 500; //50 MS per Step
            int damage = GetAttackPower(MinSC, MaxSC) + magic.GetPower();

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + delay, this, magic, damage, location, (byte)Envir.Random.Next(PoisonAttack));

            ConsumeItem(amulet, 5);
            ConsumeItem(poison, 5);

            CurrentMap.ActionList.Add(action);
            cast = true;
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:21,代码来源:PlayerObject.cs

示例4: ExplosiveTrap

        private void ExplosiveTrap(UserMagic magic, Point location)
        {
            int trapCount = 0;
            for (int i = 0; i <= 3; i++)
                if (ArcherTrapObjectsArray[i, 0] != null) trapCount++;
            if (trapCount >= magic.Level + 1) return;//max 4 traps

            int freeTrapSpot = -1;
            for (int i = 0; i <= 3; i++)
                if (ArcherTrapObjectsArray[i, 0] == null)
                {
                    freeTrapSpot = i;
                    break;
                }
            if (freeTrapSpot == -1) return;

            int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();
            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, location, freeTrapSpot);
            CurrentMap.ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:20,代码来源:PlayerObject.cs

示例5: NapalmShot

        public void NapalmShot(MapObject target, UserMagic magic)
        {
            if (target == null || !target.IsAttackTarget(this)) return;
            if ((Info.MentalState != 1) && !CanFly(target.CurrentLocation)) return;

            int distance = Functions.MaxDistance(CurrentLocation, target.CurrentLocation);
            int damage = (GetAttackPower(MinMC, MaxMC) + magic.GetPower());
            damage = ApplyArcherState(damage);

            int delay = distance * 50 + 500; //50 MS per Step

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + delay, this, magic, damage, target.CurrentLocation);
            CurrentMap.ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:14,代码来源:PlayerObject.cs

示例6: HeavenlySword

        private void HeavenlySword(UserMagic magic)
        {
            int damage = GetAttackPower(MinDC, MaxDC) + magic.GetPower();

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, CurrentLocation, Direction);
            CurrentMap.ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:7,代码来源:PlayerObject.cs

示例7: DoubleShot

        private bool DoubleShot(MapObject target, UserMagic magic)
        {
            if (target == null || !target.IsAttackTarget(this)) return false;
            if ((Info.MentalState != 1) && !CanFly(target.CurrentLocation)) return false;
            int distance = Functions.MaxDistance(CurrentLocation, target.CurrentLocation);
            int damage = (GetAttackPower(MinMC, MaxMC) + magic.GetPower());
            damage = (int)(damage * Math.Max(1, (distance * 0.25)));//range boost
            damage = ApplyArcherState(damage);
            int delay = distance * 50 + 500; //50 MS per Step

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

            ActionList.Add(action);

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

            ActionList.Add(action);

            return true;
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:20,代码来源:PlayerObject.cs

示例8: FlameDisruptor

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

            int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();

            if (!target.Undead) damage = (int)(damage * 1.5F);

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

            ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:12,代码来源:PlayerObject.cs

示例9: ThunderStorm

        private void ThunderStorm(UserMagic magic)
        {
            int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, CurrentLocation);
            CurrentMap.ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:7,代码来源:PlayerObject.cs

示例10: Vampirism

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

            int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();

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

            ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:10,代码来源:PlayerObject.cs

示例11: FireWall

        private void FireWall(UserMagic magic, Point location)
        {
            int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, location);
            CurrentMap.ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:7,代码来源:PlayerObject.cs

示例12: HellFire

        private void HellFire(UserMagic magic)
        {
            int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();

            DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, CurrentLocation, Direction, 4);
            CurrentMap.ActionList.Add(action);

            if (magic.Level != 3) return;

            MirDirection dir = (MirDirection)(((int)Direction + 1) % 8);
            action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, CurrentLocation, dir, 4);
            CurrentMap.ActionList.Add(action);

            dir = (MirDirection)(((int)Direction - 1 + 8) % 8);
            action = new DelayedAction(DelayedType.Magic, Envir.Time + 500, this, magic, damage, CurrentLocation, dir, 4);
            CurrentMap.ActionList.Add(action);
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:17,代码来源:PlayerObject.cs

示例13: Fireball

        private bool Fireball(MapObject target, UserMagic magic)
        {
            if (target == null || !target.IsAttackTarget(this) || !CanFly(target.CurrentLocation)) return false;

            int damage = GetAttackPower(MinMC, MaxMC) + magic.GetPower();

            int delay = Functions.MaxDistance(CurrentLocation, target.CurrentLocation) * 50 + 500; //50 MS per Step

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

            //if(magic.Info.Spell == Spell.GreatFireBall && magic.Level >= 3 && target.Race == ObjectType.Monster)
            //{
            //    List<MapObject> targets = ((MonsterObject)target).FindAllNearby(3, target.CurrentLocation);

            //    int secondaryTargetCount = targets.Count > 3 ? 3 : targets.Count;

            //    for (int i = 0; i < secondaryTargetCount; i++)
            //    {
            //        if (!target.IsAttackTarget(this)) continue;
            //        DelayedAction action2 = new DelayedAction(DelayedType.Magic, Envir.Time + delay + 200, magic, damage / 2, targets[i]);
            //        ActionList.Add(action2);

            //        Enqueue(new S.Magic { Spell = magic.Info.Spell, TargetID = targets[i].ObjectID, Target = targets[i].CurrentLocation, Cast = true, Level = magic.Level });
            //        Broadcast(new S.ObjectMagic { ObjectID = ObjectID, Direction = Direction, Location = CurrentLocation, Spell = magic.Info.Spell, TargetID = targets[i].ObjectID, Target = targets[i].CurrentLocation, Cast = true, Level = magic.Level });
            //    }
            //}

            ActionList.Add(action);

            return true;
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:31,代码来源:PlayerObject.cs

示例14: ElementalShot

        private bool ElementalShot(MapObject target, UserMagic magic)
        {
            if (HasElemental)
            {
                if (target == null || !target.IsAttackTarget(this)) return false;
                if ((Info.MentalState != 1) && !CanFly(target.CurrentLocation)) return false;

                int orbPower = magic.GetPower() + GetElementalOrbPower(false);//base power + orbpower

                int damage = GetAttackPower(MinMC, MaxMC) + orbPower;
                int delay = Functions.MaxDistance(CurrentLocation, target.CurrentLocation) * 50 + 500; //50 MS per Step

                DelayedAction action = new DelayedAction(DelayedType.Magic, Envir.Time + delay, magic, damage, target);
                ActionList.Add(action);
            }
            else
            {
                ObtainElement(true);//gather orb through casting
                LevelMagic(magic);
                return false;
            }
            return true;
        }
开发者ID:thedeaths,项目名称:official-mir2c-,代码行数:23,代码来源:PlayerObject.cs

示例15: 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


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