예제 #1
0
 public void cooldownAbilities(Level mapLevel)
 {
     for (int i = 0; i < abilities.Length; i++)
     {
         if (abilities[i] != null)
         {
             if (abilities[i].type == AbilityTypes.Toggle)
             {
                 ToggleAbility toggled = (ToggleAbility)abilities[i];
                 toggled.updateToggle(level, this);
             }
             if (abilities[i].type == AbilityTypes.DOTAOE && !abilities[i].wasJustCast)
             {
                 DOTAreaOfEffect dot = (DOTAreaOfEffect)abilities[i];
                 dot.dotUsed    = false;
                 dot.willBeCast = true;
             }
             if (!abilities[i].wasJustCast)
             {
                 abilities[i].cooldown -= (abilities[i].cooldown > 0) ? 1 : 0;
             }
             abilities[i].wasJustCast = false;
         }
     }
 }
예제 #2
0
        // Token: 0x06000484 RID: 1156 RVA: 0x00018258 File Offset: 0x00016458
        public override bool CanAttack(Unit9 target, float additionalRange = 0f)
        {
            ToggleAbility toggleAbility = base.Owner.Abilities.FirstOrDefault((Ability9 x) => x.Id == AbilityId.phantom_lancer_phantom_edge) as ToggleAbility;

            if (toggleAbility != null && !toggleAbility.Enabled && toggleAbility.CanBeCasted(true))
            {
                additionalRange = toggleAbility.Range;
            }
            return(base.CanAttack(target, additionalRange));
        }
예제 #3
0
        private void damageEnemyIfInRange(IntVec[] hitBox, Level mapLevel, GameCharacter enemy, Weapon weapon, bool playAttack)
        {
            bool found = false;

            if (weapon != null)
            {
                string[] name = weapon.Name.Split();
                for (int i = 0; i < hitBox.Length && !found; i++)
                {
                    IntVec test = mapLevel.CharacterEntities.FindPosition(enemy);
                    if (hitBox[i].Equals(mapLevel.CharacterEntities.FindPosition(enemy)))
                    {
                        int weaponDamage = weapon.Damage + damageBoost + currentlyEquippedItems.getAccessoryDamageIncrease();
                        weaponDamage = (weaponDamage < 1) ? 1 : weaponDamage;
                        found        = true;
                        int damage = (!visible) ? (int)(1.5 * (weaponDamage)) : weaponDamage;
                        if (playAttack)
                        {
                            if (weapon.IsLegendary)
                            {
                                if (name[0] == "Blade" || name[0] == "Executioner" || name[0] == "Bloodthirster" || name[0] == "Pale" || name[0] == "Anarchy" || name[0] == "Judgement")
                                {
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendarySwordSlash", .25f, 2.0f, .15f);
                                    Audio.playSound("swordAttack");
                                }
                                else if (name[0] == "Kris")
                                {
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendaryDaggerSlash", .25f, 2.0f, .15f);
                                    Audio.playSound("DaggerStab");
                                }
                                else if (name[0] == "The")
                                {
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendaryClawSlash", .25f, 2.0f, .15f);
                                    Audio.playSound("swordAttack");
                                }
                                else if (name[0] == "40k")
                                {
                                    Audio.playSound("HammerSmash");
                                    Engine.Engine.AddVisualAttack(enemy, "Hero/LegendaryHammerSmash", .25f, 2.0f, .15f);
                                }
                                else if (name[0] == "Condemned" || name[0] == "Retribution")
                                {
                                    Audio.playSound("ArrowShot");
                                    Engine.Engine.AddVisualAttack(this, enemy, "Enemies/Attacks/Arrow", .25f, 1.0f, .15f);
                                }
                                else if (name[0] == "Kunai" || name[0] == "Heart")
                                {
                                    Engine.Engine.AddVisualAttack(this, enemy, weapon.GetTexture());
                                }
                                else if (name[0] == "Ebony" || name[0] == "Ivory")
                                {
                                    Audio.playSound("Gunshot", .5f);
                                    Engine.Engine.AddVisualAttack(this, enemy, "Hero/Bullet", .5f, .5f, 0);
                                }
                                else if (name[0] == "Bloodwing")
                                {
                                    Audio.playSound("SniperShot");
                                    Engine.Engine.AddVisualAttack(this, enemy, "Hero/Bullet", .5f, .5f, 0);
                                }
                                else
                                {
                                    Engine.Engine.AddVisualAttack(this, enemy, "Hero/MageAttack", .5f, 1.0f, .03f);
                                }
                            }
                            else if (!checkForWeaponType(0, enemy, name, weapon))
                            {
                                checkForWeaponType(1, enemy, name, weapon);
                            }
                        }
                        for (int j = 0; j < abilities.Length; j++)
                        {
                            if (abilities[j] != null && abilities[j].type == AbilityTypes.Toggle)
                            {
                                ToggleAbility toggle = (ToggleAbility)abilities[j];
                                if (toggle.isActive)
                                {
                                    toggle.toggledAttackEffects(this);
                                }
                            }
                        }
                        enemy.TakeDamage(damage, this);
                        invisibilityTurnCount = 0;
                        turnOver = true;
                    }
                }
            }
        }
예제 #4
0
 public Rot(ActiveAbility ability)
     : base(ability)
 {
     this.rot = (ToggleAbility)ability;
 }
예제 #5
0
 public PulseNova(ActiveAbility ability)
     : base(ability)
 {
     this.pulseNova = (ToggleAbility)ability;
 }