Exemplo n.º 1
0
 // Token: 0x06001062 RID: 4194 RVA: 0x00061C88 File Offset: 0x0005FE88
 public void AttackNearbyEnemies()
 {
     for (int i = 0; i < Targets.Attackables.Count; i++)
     {
         IAttackable attackable = Targets.Attackables[i];
         if (!InstantiateUtility.IsDestroyed(attackable as Component))
         {
             if (!this.m_attackablesIgnore.Contains(attackable))
             {
                 if (attackable.CanBeChargeFlamed())
                 {
                     float magnitude = (attackable.Position - this.m_sein.PlatformBehaviour.PlatformMovement.HeadPosition).magnitude;
                     if (magnitude <= 3f)
                     {
                         this.m_attackablesIgnore.Add(attackable);
                         Vector3 v      = (!this.m_chargeDashAtTarget) ? (((!this.m_faceLeft) ? Vector3.right : Vector3.left) * 3f) : (this.m_chargeDashDirection * 3f);
                         Damage  damage = new Damage((float)this.Damage, v, this.m_sein.Position, DamageType.ChargeFlame, base.gameObject);
                         damage.DealToComponents(((Component)attackable).gameObject);
                         this.m_hasHitAttackable = true;
                         if (this.ExplosionEffect && Time.time - this.m_timeOfLastExplosionEffect > 0.1f)
                         {
                             this.m_timeOfLastExplosionEffect = Time.time;
                             InstantiateUtility.Instantiate(this.ExplosionEffect, Vector3.Lerp(base.transform.position, attackable.Position, 0.5f), Quaternion.identity);
                         }
                         break;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 2
0
    // Token: 0x060000C7 RID: 199
    public void DealDamage()
    {
        Vector3 position = base.transform.position;

        IAttackable[] array = Targets.Attackables.ToArray();
        for (int i = 0; i < array.Length; i++)
        {
            IAttackable attackable = array[i];
            if (!InstantiateUtility.IsDestroyed(attackable as Component) && !this.m_damageAttackables.Contains(attackable) && attackable.CanBeChargeFlamed())
            {
                Vector3 position2 = attackable.Position;
                Vector3 vector    = position2 - position;
                if (vector.magnitude <= this.BurstRadius)
                {
                    this.m_damageAttackables.Add(attackable);
                    GameObject gameObject = ((Component)attackable).gameObject;
                    new Damage(RandomizerBonus.ExplosionPower() ? (this.DamageAmount * 2f) : this.DamageAmount, vector.normalized * 3f, position, DamageType.ChargeFlame, base.gameObject).DealToComponents(gameObject);
                    bool expr_D8 = attackable.IsDead();
                    if (!expr_D8)
                    {
                        GameObject expr_F2 = (GameObject)InstantiateUtility.Instantiate(this.BurstImpactEffectPrefab, position2, Quaternion.identity);
                        expr_F2.transform.eulerAngles = new Vector3(0f, 0f, MoonMath.Angle.AngleFromVector(vector.normalized));
                        expr_F2.GetComponent <FollowPositionRotation>().SetTarget(gameObject.transform);
                    }
                    if (expr_D8 && attackable is IChargeFlameAttackable && ((IChargeFlameAttackable)attackable).CountsTowardsPowerOfLightAchievement())
                    {
                        this.m_simultaneousEnemies++;
                    }
                }
            }
        }
        if (this.m_simultaneousEnemies >= 4)
        {
            AchievementsController.AwardAchievement(Characters.Sein.Abilities.ChargeFlame.KillEnemiesSimultaneouslyAchievement);
        }
        this.m_waitDelay = 0.1f;
    }