/// <summary>
    /// Awake
    /// </summary>
    void Awake()
    {
        // 各ステータス
        for (int i = 0; i < (int)item.eExpType.Max; i++)
        {
            Levels.Add(0);
        }

        EventAttackNear += PlayAttackVoice;
        EventAttackFar  += PlayAttackVoice;
    }
Exemple #2
0
    public EntityEventAttackCore AppendAttackGuidedShot(Transform firetransform, int bulletDamage, float bulletSpeed, EntityBulletType type, int bulletCount, float shotInterval, Func <GameObject> targetGetter, AllyFlag allyFlag = AllyFlag.Enemy, Vector3?defaultDirection = null)
    {
        if (defaultDirection == null)
        {
            defaultDirection = Vector3.down;
        }

        EventAttack colortoAction = new EventAttack(m_IsSequence, m_MonoBehaviour, firetransform);

        colortoAction.SetGuidedShot(defaultDirection.Value, bulletDamage, bulletSpeed, type, allyFlag, shotInterval, bulletCount, targetGetter);
        m_EventList.Enqueue(colortoAction);
        return(this);
    }
Exemple #3
0
    public EntityEventAttackCore AppendAttackTornadoShot(Transform firetransform, int bulletDamage, float bulletSpeed, EntityBulletType type, int bulletCount, float duration, bool followRotation, AllyFlag allyFlag = AllyFlag.Enemy, Vector3?defaultDirection = null, EventAttack.TornadoShot.Direction direction = EventAttack.TornadoShot.Direction.ClockWise)
    {
        if (defaultDirection == null)
        {
            defaultDirection = Vector3.down;
        }

        EventAttack colortoAction = new EventAttack(m_IsSequence, m_MonoBehaviour, firetransform);

        colortoAction.SetTornadoShot(defaultDirection.Value, bulletDamage, bulletSpeed, type, allyFlag, bulletCount, duration, followRotation, direction);
        m_EventList.Enqueue(colortoAction);
        return(this);
    }
Exemple #4
0
    public EntityEventAttackCore AppendAttackCornShot(Transform firetransform, int bulletDamage, float bulletSpeed, EntityBulletType type, float degree, int bulletCount, AllyFlag allyFlag = AllyFlag.Enemy, Vector3?defaultDirection = null)
    {
        if (defaultDirection == null)
        {
            defaultDirection = Vector3.down;
        }

        EventAttack colortoAction = new EventAttack(m_IsSequence, m_MonoBehaviour, firetransform);

        colortoAction.SetCornShot(defaultDirection.Value, bulletDamage, bulletSpeed, type, allyFlag, degree, bulletCount);
        m_EventList.Enqueue(colortoAction);
        return(this);
    }
Exemple #5
0
 public void DoAttack(Game target)
 {
     if (target.Health > 0)
     {
         target.Health -= Attack;
         EventAttack?.Invoke($"{Name} нанёс {Attack} урона, атаковав {target.Name}");   // Вызов события
         if (target.Health > 0)
         {
             Console.WriteLine($"У {target.Name} осталось {target.Health} ОЗ");
         }
         else
         {
             Console.WriteLine($"{target.Name} был убит!");
         }
     }
     else
     {
         Console.WriteLine($"{target.Name} уже мёртв!");
     }
 }