Example #1
0
        private int GetWeapon(int lv, out float min, out float max, out float speed)
        {
            var     data = GetWeaponData();
            eWeapon type = data.m_eWeapon;

            m_option.GetWeapon(type, lv, out min, out max, out speed);

            return(data.Code);
        }
    /// <summary>
    ///
    /// </summary>
    public void Pickup(Pickup pPickup)
    {
        switch (pPickup.Type)
        {
        case ePickupType.Armor:
            this.ArmorState        = ePlayerArmorState.FullArmor;
            this.mAudioSource.clip = this.AudioTreasurePickup;
            this.mAudioSource.Play();
            break;

        case ePickupType.Axe:
            this.CurrentWeapon     = eWeapon.Axe;
            this.mAudioSource.clip = this.AudioWeaponPickup;
            this.mAudioSource.Play();
            break;

        case ePickupType.Cross:
            this.Score            += 200;
            this.mAudioSource.clip = this.AudioTreasurePickup;
            this.mAudioSource.Play();
            break;

        case ePickupType.Dagger:
            this.CurrentWeapon     = eWeapon.Dagger;
            this.mAudioSource.clip = this.AudioWeaponPickup;
            this.mAudioSource.Play();
            break;

        case ePickupType.Torch:
            this.CurrentWeapon     = eWeapon.Torch;
            this.mAudioSource.clip = this.AudioWeaponPickup;
            this.mAudioSource.Play();
            break;

        case ePickupType.Shield:
            this.CurrentWeapon     = eWeapon.Shield;
            this.mAudioSource.clip = this.AudioWeaponPickup;
            this.mAudioSource.Play();
            break;

        case ePickupType.Spear:
            this.CurrentWeapon     = eWeapon.Spear;
            this.mAudioSource.clip = this.AudioWeaponPickup;
            this.mAudioSource.Play();
            break;
        }
    }
Example #3
0
        private bool ChangeWeaponImageCode(eBeyond beyond, int oriCode, out int outCode)
        {
            outCode = 0;

            if (true == m_dataItems.ContainsKey(oriCode))
            {
                eWeapon type = m_dataItems[oriCode].m_eWeapon;

                if (true == m_weapons.ContainsKey(beyond))
                {
                    if (true == m_weapons[beyond].ContainsKey(type))
                    {
                        outCode = m_weapons[beyond][type].Code;
                        return(true);
                    }
                }
            }

            return(false);
        }
Example #4
0
        //private int GetBaseBWDMin(int lv)
        //{
        //    int mb = 12;
        //    int atkRate = (int)Math.Round(1.2 * (1.55 + 0.05 * (lv + 60) + lv * lv * (lv - 1) * 0.0002));

        //    int minBWD = (int)Math.Round(mb * 1.2 * (1.55 + 0.05 * (lv + 60) + lv * lv * (lv - 1) * 0.0002));

        //    int hit = m_random.Next(minBWD, minBWD + atkRate * 3);
        //    return hit;
        //}
        //private int GetBaseBWDMax(int lv)
        //{
        //    int mb = 18;
        //    int maxBWD = (int)Math.Round(mb * 1.2 * (1.55 + 0.05 * (lv + 60) + lv * lv * (lv - 1) * 0.0002));

        //    int atkRate = (int)Math.Round(1.2 * (1.55 + 0.05 * (lv + 60) + lv * lv * (lv - 1) * 0.0002));

        //    int hit = m_random.Next(maxBWD - atkRate, maxBWD);
        //    return hit;
        //}

        private float GetBaseAs(eWeapon type)
        {
            float value = 1.00f;

            if (type == eWeapon.Speed)
            {
                int hit = m_random.Next(7, 10);
                value += (hit * 0.01f);
            }
            else if (type == eWeapon.Sharp)
            {
                int hit = m_random.Next(4, 7);
                value += (hit * 0.01f);
            }
            else if (type == eWeapon.Steel)
            {
                int hit = m_random.Next(1, 4);
                value += (hit * 0.01f);
            }

            return(value);
        }
Example #5
0
        private int GetBaseBWDMin(eWeapon type, int lv)
        {
            int mb      = 12;
            int atkRate = (int)Math.Round(1.2 * (1.55 + 0.05 * (lv + 60) + lv * lv * (lv - 1) * 0.0002));
            int minBWD  = (int)Math.Round(mb * 1.2 * (1.55 + 0.05 * (lv + 60) + lv * lv * (lv - 1) * 0.0002));
            int hit     = 0;

            if (type == eWeapon.Speed)
            {
                hit = m_random.Next(minBWD, minBWD + atkRate * 1);
            }
            else if (type == eWeapon.Sharp)
            {
                hit = m_random.Next(minBWD + atkRate * 1, minBWD + atkRate * 2);
            }
            else if (type == eWeapon.Steel)
            {
                hit = m_random.Next(minBWD + atkRate * 2, minBWD + atkRate * 3);
            }

            return(hit);
        }
Example #6
0
 public void GetWeapon(eWeapon type, int lv, out float min, out float max, out float speed)
 {
     min   = GetBaseBWDMin(type, lv);
     max   = GetBaseBWDMax(type, lv);
     speed = GetBaseAs(type);
 }