Update() protected method

protected Update ( ) : void
return void
示例#1
0
 public void Update()
 {
     if (CurSkill != null)
     {
         CurSkill.Update();
     }
 }
示例#2
0
    // Update is called once per frame
    void Update()
    {
        transform.position = new Vector3(transform.position.x, transform.position.y, 0f);

        if (_principalSkill != null)
        {
            _principalSkill.Update();
        }

        if (_secondarySkill != null)
        {
            _secondarySkill.Update();
        }

        if (_specialSkill != null)
        {
            _specialSkill.Update();
        }

        for (int i = _passiveBonus.Count - 1; i >= 0; i--)
        {
            _passiveBonus[i].CheckExpiration();
        }


        if (_nextParticleTrow < Time.time)
        {
            CreateParticle();
        }

        SpeedEmmiter.isActive = _actualSpeed > SPEED;
        InvencibilityHalo.SetActive(_invencible);
    }
示例#3
0
    // Update is called once per frame
    void Update()
    {
        if (_curSkill == null)
        {
            return;
        }

        _curSkill.Update();
    }
示例#4
0
 // Update is called once per frame
 void Update()
 {
     if (Instant != null)
     {
         Instant.Update();
     }
     if (Skill != null)
     {
         Skill.Update();
     }
 }
示例#5
0
    public override int Update(float a_fDelta)
    {
        eDir eDir  = eDir.None;
        eDir eDirM = eDir.None;

        Console.SetCursorPosition(30, 40);
        Console.WriteLine(a_fDelta);

        if (eKey.Left.IsKeyDown() == true)
        {
            eDir = eDir.Left;
        }
        else if (eKey.Right.IsKeyDown() == true)
        {
            eDir = eDir.Right;
        }

        if (eKey.Down.IsKeyDown() == true)
        {
            eDir = eDir.Bottom;
        }
        else if (eKey.Up.IsKeyDown() == true)
        {
            eDir = eDir.Top;
        }

        if (eKey.Z.IsKeyDown() == true)
        {
            if (user.activeZ == false)
            {
                return(0);
            }
            foreach (var temp in monsters)
            {
                user.ActiveSkill(eSkillType.Fire, temp);
            }
            s.Update(user, a_fDelta);
        }


        if (eDir != eDir.None)
        {
            foreach (var temp in monsters)
            {
                eDirM = (eDir)ran.Next();
                temp.Move(eDirM);
            }
            user.Update(eDir);
        }

        return(0);
    }
示例#6
0
    public static void Update()
    {
        for (int i = 0; i < runningSkill.Count; i++)
        {
            Skill skill = (Skill)runningSkill[i];

            if (skill.IsEnd())
            {
                runningSkill.Remove(skill);
            }

            skill.Update();
        }
    }
示例#7
0
    public override int Update(float a_fDelta)
    {
        eDir eDir = eDir.None;

        if (eKey.Left.IsKeyDown() == true)
        {
            eDir = eDir.Left;
        }
        else if (eKey.Right.IsKeyDown() == true)
        {
            eDir = eDir.Right;
        }

        if (eKey.Down.IsKeyDown() == true)
        {
            eDir = eDir.Bottom;
        }
        else if (eKey.Up.IsKeyDown() == true)
        {
            eDir = eDir.Top;
        }

        if (eKey.Z.IsKeyDown() == true)
        {
            if (user.activeZ == false)
            {
                return(0);
            }
            foreach (var temp in monsters)
            {
                user.ActiveSkill(eSkillType.Fire, temp);
            }
            user.ActiveSkill(eSkillType.Fire, Boss);
            s.Update(user, a_fDelta);
        }

        if (eDir != eDir.None)
        {
            user.Update(eDir);
            Define.SaveStatus(user);
        }

        if (Boss.bExist == false)
        {
            return(2);
        }

        return(0);
    }
示例#8
0
 public override void Update()
 {
     if (skill1 != null)
     {
         skill1.Update();
     }
     if (skill2 != null)
     {
         skill2.Update();
     }
     if (skill3 != null)
     {
         skill3.Update();
     }
 }
示例#9
0
        public IActionResult putSkill(int id, Skill skill, int skillId)
        {
            if (!_pRepository.TryGetPortfolio(id, out var portfolio))
            {
                return(NotFound());
            }
            Skill w = portfolio.Skills.SingleOrDefault(e => e.Id == skillId);

            if (w == null)
            {
                return(BadRequest("skill does not exist for portfolio."));
            }
            w.Update(skill);
            _pRepository.SaveChanges();
            return(NoContent());
        }
示例#10
0
 public bool Update()
 {
     if (Input.GetKeyDown(KeyCode.Alpha1))
     {
         skill = SkillDataBase.GetSkill(SkillType.Fire);
     }
     if (Input.GetKeyDown(KeyCode.Alpha2))
     {
         skill = SkillDataBase.GetSkill(SkillType.Figa);
     }
     if (Input.GetKeyDown(KeyCode.Alpha3))
     {
         skill = SkillDataBase.GetSkill(SkillType.Kearu);
     }
     return(skill.Update(unit));
 }
示例#11
0
        public override void Execute(Character caller, string[] args)
        {
            if (args.Length < 1)
            {
                this.ShowSyntax(caller);
            }
            else
            {
                int skillID  = int.Parse(args[0]);
                int skillLVL = int.Parse(args[1]);

                if (DataProvider.Skills.ContainsKey(skillID))
                {
                    if (caller.Skills.Contains(skillID))
                    {
                        Skill skillToModify = caller.Skills[skillID];

                        skillToModify.CurrentLevel = (byte)skillLVL;
                        skillToModify.Update();
                    }
                    // TODO: needs proper treatment
                    else if (!caller.Skills.Contains(skillID))
                    {
                        Skill skillToAdd = new Skill(skillID)
                        {
                            CurrentLevel = (byte)skillLVL,
                            MapleID      = skillID
                        };

                        skillToAdd.Update();
                    }
                }
                else
                {
                    caller.Notify("[Command] Invalid skill ID.");
                }
            }
        }
示例#12
0
        public static void AwardSkillPoints(this Mobile from, SkillName skillName, int points)
        {
            Skill skill = from.Skills[skillName];

            // TODO: Add cmd level check
            if (skill.Lock == SkillLock.Locked || from is BaseCreature)
            {
                return;
            }

            if (skill.Lock == SkillLock.Down)
            {
                var baseSkill = (int)(skill.Base);
                var amount    = 1;
                if (amount > baseSkill)
                {
                    amount = baseSkill;
                    skill.SetLockNoRelay(SkillLock.Locked);
                    skill.Update();
                }

                skill.BaseFixedPoint -= amount * 10;
                return;
            }

            if (points == 0)
            {
                return;
            }

            points = (int)(points * GetSkillPointsMultiplier(from as Mobile, skillName));

            // TODO: Should we implement global multipliers?

            AwardPoints(from as Mobile, skillName, points);
        }
示例#13
0
        private bool GiveSkill(Mobile from)
        {
            if (m_RequiresOwner && m_Owner == null)
            {
                from.SendMessage(string.Format("This book requires an owner, please page for a {0} to set it.", m_RequiredAccessLevel));
            }
            else if (m_RequiresOwner && m_Owner != from)
            {
                from.SendMessage("You are not the owner of this book.");
            }
            else if (m_BonusValue == 0)
            {
                from.SendMessage(string.Format("This book isn't properly set up, please page for a {0}.", m_RequiredAccessLevel));
            }
            else if (from.Skills[m_SkillName].Lock != SkillLock.Up)
            {
                from.SendMessage("Your skill is locked, please remove the lock before you use the book.");
            }
            else if (m_MaxValue <= GetCurrentSkillValue(from) || GetNewSkillValue(from) <= GetCurrentSkillValue(from))
            {
                from.SendMessage(string.Format("You have too high {0} to learn from this book.", m_SkillName));
            }
            else
            {
                double skillValue = GetNewSkillValue(from);

                Skill playerSkill = from.Skills[m_SkillName];
                playerSkill.Base = skillValue;
                playerSkill.Update();

                from.PlaySound(0x202);
                return(true);
            }

            return(false);
        }
示例#14
0
    private void Update()
    {
        if (Input.GetMouseButton(0))
        {
            CastPrimarySkill();
        }

        List <Skill> finishedSkills = new List <Skill>();

        for (int i = 0; i < ActingSkills.Count; i++)
        {
            Skill skill = ActingSkills[i];
            skill.Update();
            if (!skill.Casting())
            {
                finishedSkills.Add(skill);
            }
        }

        foreach (Skill finishedSkill in finishedSkills)
        {
            ActingSkills.Remove(finishedSkill);
        }
    }
示例#15
0
        public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
        {
            switch ((ButtonID)info.ButtonID)
            {
            case ButtonID.NextPage:
            {
                m_Page++;
                break;                         // gump will be resent at end of OnResponse
            }

            case ButtonID.PrevPage:
            {
                m_Page--;
                break;                         // gump will be resent at end of OnResponse
            }

            case ButtonID.StrLock:
            {
                switch (m_Target.StrLock)
                {
                case StatLockType.Down: m_Target.StrLock = StatLockType.Locked; break;

                case StatLockType.Locked: m_Target.StrLock = StatLockType.Up; break;

                case StatLockType.Up: m_Target.StrLock = StatLockType.Down; break;
                }
                break;
            }

            case ButtonID.DexLock:
            {
                switch (m_Target.DexLock)
                {
                case StatLockType.Down: m_Target.DexLock = StatLockType.Locked; break;

                case StatLockType.Locked: m_Target.DexLock = StatLockType.Up; break;

                case StatLockType.Up: m_Target.DexLock = StatLockType.Down; break;
                }
                break;
            }

            case ButtonID.IntLock:
            {
                switch (m_Target.IntLock)
                {
                case StatLockType.Down: m_Target.IntLock = StatLockType.Locked; break;

                case StatLockType.Locked: m_Target.IntLock = StatLockType.Up; break;

                case StatLockType.Up: m_Target.IntLock = StatLockType.Down; break;
                }
                break;
            }

            default:
            {
                if (info.ButtonID >= (int)ButtonID.SkillLock)
                {
                    int   skill = info.ButtonID - (int)ButtonID.SkillLock;
                    Skill sk    = null;

                    if (skill >= 0 && skill < m_Target.Skills.Length)
                    {
                        sk = m_Target.Skills[skill];
                    }

                    if (sk != null)
                    {
                        switch (sk.Lock)
                        {
                        case SkillLock.Up: sk.SetLockNoRelay(SkillLock.Down); sk.Update(); break;

                        case SkillLock.Down: sk.SetLockNoRelay(SkillLock.Locked); sk.Update(); break;

                        case SkillLock.Locked: sk.SetLockNoRelay(SkillLock.Up); sk.Update(); break;
                        }
                    }
                }
                else
                {
                    return;
                }

                break;
            }
            }


            m_User.SendGump(new AnimalLoreGump(m_Target, m_User, m_Page));
        }
示例#16
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int buttonID = info.ButtonID - 1;

            int index = buttonID / 3;
            int type  = buttonID % 3;

            switch (type)
            {
            case 0:
            {
                if (index >= 0 && index < m_Groups.Length)
                {
                    SkillsGumpGroup newSelection = m_Groups[index];

                    if (m_Selected != newSelection)
                    {
                        m_From.SendGump(new SkillsGump(m_From, m_Target, newSelection));
                    }
                    else
                    {
                        m_From.SendGump(new SkillsGump(m_From, m_Target, null));
                    }
                }

                break;
            }

            case 1:
            {
                if (m_Selected != null && index >= 0 && index < m_Selected.Skills.Length)
                {
                    Skill sk = m_Target.Skills[m_Selected.Skills[index]];

                    if (sk != null)
                    {
                        if (m_From.AccessLevel >= AccessLevel.GameMaster)
                        {
                            m_From.SendGump(new EditSkillGump(m_From, m_Target, sk, m_Selected));
                        }
                        else
                        {
                            m_From.SendMessage("You may not change that.");
                            m_From.SendGump(new SkillsGump(m_From, m_Target, m_Selected));
                        }
                    }
                    else
                    {
                        m_From.SendGump(new SkillsGump(m_From, m_Target, m_Selected));
                    }
                }

                break;
            }

            case 2:
            {
                if (m_Selected != null && index >= 0 && index < m_Selected.Skills.Length)
                {
                    Skill sk = m_Target.Skills[m_Selected.Skills[index]];

                    if (sk != null)
                    {
                        if (m_From.AccessLevel >= AccessLevel.GameMaster)
                        {
                            switch (sk.Lock)
                            {
                            case SkillLock.Up: sk.SetLockNoRelay(SkillLock.Down); sk.Update(); break;

                            case SkillLock.Down: sk.SetLockNoRelay(SkillLock.Locked); sk.Update(); break;

                            case SkillLock.Locked: sk.SetLockNoRelay(SkillLock.Up); sk.Update(); break;
                            }
                        }
                        else
                        {
                            m_From.SendMessage("You may not change that.");
                        }

                        m_From.SendGump(new SkillsGump(m_From, m_Target, m_Selected));
                    }
                }

                break;
            }
            }
        }
示例#17
0
        public override void OnResponse(NetState sender, RelayInfo info)
        {
            int buttonID = info.ButtonID - 1;

            int index = buttonID / 3;
            int type  = buttonID % 3;

            switch (type)
            {
            case 0:
            {
                if (index >= 0 && index < Enum.GetValues(typeof(SkillCategory)).Length)
                {
                    SkillCategory newSelection = (SkillCategory)index;

                    if (m_Selected != newSelection)
                    {
                        m_From.SendGump(new SkillsGump(m_From, m_Target, newSelection));
                    }
                    else
                    {
                        m_From.SendGump(new SkillsGump(m_From, m_Target, SkillCategory.Aucun));
                    }
                }

                break;
            }

            case 1:
            {
                SkillName[] sks = SkillInfo.GetCategory(m_Selected);
                if (m_Selected != SkillCategory.Aucun && index >= 0 && index < sks.Length)
                {
                    Skill sk = m_Target.Skills[sks[index]];

                    if (sk != null)
                    {
                        if (m_From.AccessLevel >= AccessLevel.Batisseur)
                        {
                            m_From.SendGump(new EditSkillGump(m_From, m_Target, sk, m_Selected));
                        }
                        else
                        {
                            m_From.SendMessage("You may not change that.");
                            m_From.SendGump(new SkillsGump(m_From, m_Target, m_Selected));
                        }
                    }
                    else
                    {
                        m_From.SendGump(new SkillsGump(m_From, m_Target, m_Selected));
                    }
                }

                break;
            }

            case 2:
            {
                SkillName[] sks = SkillInfo.GetCategory(m_Selected);
                if (m_Selected != SkillCategory.Aucun && index >= 0 && index < sks.Length)
                {
                    Skill sk = m_Target.Skills[sks[index]];

                    if (sk != null)
                    {
                        if (m_From.AccessLevel >= AccessLevel.Batisseur)
                        {
                            switch (sk.Lock)
                            {
                            case SkillLock.Up: sk.SetLockNoRelay(SkillLock.Down); sk.Update(); break;

                            case SkillLock.Down: sk.SetLockNoRelay(SkillLock.Locked); sk.Update(); break;

                            case SkillLock.Locked: sk.SetLockNoRelay(SkillLock.Up); sk.Update(); break;
                            }
                        }
                        else
                        {
                            m_From.SendMessage("You may not change that.");
                        }

                        m_From.SendGump(new SkillsGump(m_From, m_Target, m_Selected));
                    }
                }

                break;
            }
            }
        }