Ejemplo n.º 1
0
    // ================== Generic Attacks ==================

    protected void RunAttack(AttackTime time, Attack a)
    {
        switch (a.type)
        {
        case AttackType.SPIN:
            SpinAttack(time, a);
            break;

        case AttackType.TARGET_PLAYER:
            TargetPlayerAttack(time, a);
            break;

        case AttackType.CIRCLE_BURST:
            CircleBurstAttack(time, a);
            break;

        case AttackType.DIRECTIONAL_BURST:
            DirectionalBurstAttack(time, a);
            break;

        case AttackType.CUSTOM:
            CustomAttack(time, a);
            break;
        }
    }
Ejemplo n.º 2
0
    protected virtual void StepIntoPhase()
    {
        expectedPhaseTime = -1;
        waitTime          = -1;
        phaseTime         = 0;

        if (phase >= phases.Length)
        {
            return;
        }

        PhaseInfo info = phases[phase];

        times = new AttackTime[info.attacks.Length];
        for (int i = 0; i < times.Length; i++)
        {
            times[i] = new AttackTime();
        }

        Wait(info.wait);
        Expect(info.expected);
    }
Ejemplo n.º 3
0
 protected virtual void CustomAttack(AttackTime time, Attack a)
 {
 }
Ejemplo n.º 4
0
 protected void DirectionalBurstAttack(AttackTime time, Attack a)
 {
     time.Deduct(a.delay, i => SpawnDirectionalBurst(a.bulletSpeed, targets[a.start].transform.position, (a.offset + (float)i * a.rotation * a.delay) * Mathf.Deg2Rad, a.spread * Mathf.Deg2Rad, a.color, a.size));
 }
Ejemplo n.º 5
0
 protected void CircleBurstAttack(AttackTime time, Attack a)
 {
     time.Deduct(a.delay, i => SpawnCircleBurst(a.bulletSpeed, targets[a.start].transform.position, (float)i * a.rotation + (i % 2) * a.offset, a.spread, a.color, a.size));
 }
Ejemplo n.º 6
0
 protected void TargetPlayerAttack(AttackTime time, Attack a)
 {
     time.Deduct(a.delay, i => SpawnPlayerTrackingBullet(a.bulletSpeed, targets[a.start].transform.position, a.color, a.size));
 }
Ejemplo n.º 7
0
 protected void SpinAttack(AttackTime time, Attack a)
 {
     time.Deduct(a.delay, i => SpawnBullet((float)i * a.rotation + a.offset, a.bulletSpeed, targets[a.start].transform.position, a.color, a.size));
 }