コード例 #1
0
    public virtual void Start()
    {
        currentHealth = maxHealth;

        healthUI = GetComponent <HealthUI>();

        manaRegenFunction = GetComponent <ManaRegeneration>();
    }
コード例 #2
0
ファイル: Stats.cs プロジェクト: thankvuong193/GameServer
 public void RemoveModifier(IStatsModifier modifier)
 {
     if (AbilityPower.RemoveStatModificator(modifier.AbilityPower))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Base_Ap, AbilityPower.BaseValue);
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Bonus_Ap_Flat, AbilityPower.FlatBonus);
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Bonus_Ap_Pct, AbilityPower.PercentBonus);
     }
     if (Armor.RemoveStatModificator(modifier.Armor))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Armor, Armor.Total);
     }
     if (ArmorPenetration.RemoveStatModificator(modifier.ArmorPenetration))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Armor_Pen_Flat, ArmorPenetration.FlatBonus);
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Armor_Pen_Pct, ArmorPenetration.PercentBonus);
     }
     if (AttackDamage.RemoveStatModificator(modifier.AttackDamage))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Base_Ad, AttackDamage.BaseValue);
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Bonus_Ad_Flat, AttackDamage.FlatBonus);
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Bonus_Ad_Pct, AttackDamage.PercentBonus);
     }
     if (AttackSpeedMultiplier.RemoveStatModificator(modifier.AttackSpeed))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Atks_multiplier, AttackSpeedMultiplier.Total);
     }
     if (CriticalChance.RemoveStatModificator(modifier.CriticalChance))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Crit_Chance, CriticalChance.Total);
     }
     GoldPerSecond.RemoveStatModificator(modifier.GoldPerSecond);
     if (HealthPoints.RemoveStatModificator(modifier.HealthPoints))
     {
         appendStat(_updatedStats, MasterMask.MM_Four, FieldMask.FM4_MaxHp, HealthPoints.Total);
     }
     if (HealthRegeneration.RemoveStatModificator(modifier.HealthRegeneration))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Hp5, HealthRegeneration.Total);
     }
     if (LifeSteal.RemoveStatModificator(modifier.LifeSteel))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_LifeSteal, LifeSteal.Total);
     }
     if (MagicResist.RemoveStatModificator(modifier.MagicResist))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Magic_Armor, MagicResist.Total);
     }
     if (MagicPenetration.RemoveStatModificator(modifier.MagicPenetration))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Magic_Pen_Flat, MagicPenetration.FlatBonus);
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Magic_Pen_Pct, MagicPenetration.PercentBonus);
     }
     if (ManaPoints.RemoveStatModificator(modifier.ManaPoints))
     {
         appendStat(_updatedStats, MasterMask.MM_Four, FieldMask.FM4_MaxMp, ManaPoints.Total);
     }
     if (ManaRegeneration.RemoveStatModificator(modifier.ManaRegeneration))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Mp5, ManaRegeneration.Total);
     }
     if (MoveSpeed.RemoveStatModificator(modifier.MoveSpeed))
     {
         appendStat(_updatedStats, MasterMask.MM_Four, FieldMask.FM4_Speed, MoveSpeed.Total);
     }
     if (Range.RemoveStatModificator(modifier.Range))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Range, Range.Total);
     }
     if (Size.RemoveStatModificator(modifier.Size))
     {
         appendStat(_updatedStats, MasterMask.MM_Four, FieldMask.FM4_ModelSize, Size.Total);
     }
     if (SpellVamp.RemoveStatModificator(modifier.SpellVamp))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_SpellVamp, SpellVamp.Total);
     }
     if (Tenacity.RemoveStatModificator(modifier.Tenacity))
     {
         appendStat(_updatedStats, MasterMask.MM_Two, FieldMask.FM2_Tenacity, Tenacity.Total);
     }
 }
コード例 #3
0
 public void Start()
 {
     myStats   = GetComponent <CharacterStats>();
     agent     = GetComponent <NavMeshAgent>();
     manaRegen = GetComponent <ManaRegeneration>();
 }
コード例 #4
0
        private static CurrentSpell ArcaneMageCommands(Player mage)
        {
            ConsoleKeyInfo enter = new ConsoleKeyInfo();

            Console.Clear();

            var counter = 1;

            while (enter.Key != ConsoleKey.Enter)
            {
                if (enter.Key == ConsoleKey.DownArrow)
                {
                    counter++;
                }
                else if (enter.Key == ConsoleKey.UpArrow)
                {
                    counter--;
                }

                GameTitle.GetTitle();
                string actionSelect = $"SELECT ACTION FOR {mage.Name}";
                string polymorph    = $"POLYMORPH-- DISABLE TARGET FOR 2 TURNS, COST: 200 MANA, COOLDOWN: 4";
                string arcaneBlast  = $"ARCANE BLAST-- DAMAGE:{mage.Spellpower * 3}, COST: 90 MANA, , NO COOLDOWN";
                string amplifier    = $"AMPLIFY MAGIC-- DOUBLE SPELL DAMAGE FOR NEXT 2 TURNS, COST: 250 MANA, COOLDOWN: 4";
                string manaRegen    = $"MANA REGENERATION-- GET 300 MANA, COOLDOWN: 3";
                Console.WriteLine("{0}", actionSelect);
                switch (counter)
                {
                case 1:
                    Console.ForegroundColor = ConsoleColor.Magenta;
                    Console.WriteLine("{0,2}", "-> " + polymorph);
                    Console.WriteLine("{0,2}", arcaneBlast);
                    Console.WriteLine("{0,2}", amplifier);
                    Console.WriteLine("{0,2}", manaRegen); break;

                case 2:
                    Console.ForegroundColor = ConsoleColor.Magenta;
                    Console.WriteLine("{0,2}", polymorph);
                    Console.WriteLine("{0,2}", "-> " + arcaneBlast);
                    Console.WriteLine("{0,2}", amplifier);
                    Console.WriteLine("{0,2}", manaRegen); break;

                case 3:
                    Console.ForegroundColor = ConsoleColor.Magenta;
                    Console.WriteLine("{0,2}", polymorph);
                    Console.WriteLine("{0,2}", arcaneBlast);
                    Console.WriteLine("{0,2}", "-> " + amplifier);
                    Console.WriteLine("{0,2}", manaRegen); break;

                case 4:
                    Console.ForegroundColor = ConsoleColor.Magenta;
                    Console.WriteLine("{0,2}", polymorph);
                    Console.WriteLine("{0,2}", arcaneBlast);
                    Console.WriteLine("{0,2}", amplifier);
                    Console.WriteLine("{0,2}", "-> " + manaRegen); break;

                default:
                    if (counter == 5)
                    {
                        counter = 1;
                        Console.ForegroundColor = ConsoleColor.Magenta;
                        Console.WriteLine("{0,2}", "-> " + polymorph);
                        Console.WriteLine("{0,2}", arcaneBlast);
                        Console.WriteLine("{0,2}", amplifier);
                        Console.WriteLine("{0,2}", manaRegen); break;
                    }
                    else if (counter == 0)
                    {
                        counter = 4;
                        Console.ForegroundColor = ConsoleColor.Magenta;
                        Console.WriteLine("{0,2}", polymorph);
                        Console.WriteLine("{0,2}", arcaneBlast);
                        Console.WriteLine("{0,2}", amplifier);
                        Console.WriteLine("{0,2}", "-> " + manaRegen); break;
                    }
                    break;
                }
                enter = Console.ReadKey();
                Console.Clear();
            }
            var currentSpell = new CurrentSpell();

            switch (counter)
            {
            case 1:
                var polymorph = new Polymorph();
                currentSpell = polymorph.GetPolymorph(mage);
                break;

            case 2:
                var arcaneBlast = new ArcaneBlast();
                currentSpell = arcaneBlast.GetArcaneBlast(mage);
                break;

            case 3:
                var amplifier = new Amplifier();
                currentSpell = amplifier.GetAmplifier(mage);
                break;

            default:
                var manaReg = new ManaRegeneration();
                currentSpell = manaReg.GetManaReg(mage);
                break;
            }

            return(currentSpell);
        }