示例#1
0
    public void EventHandler(SCG_Event e)
    {
        Event_EnemyBulletHit bH = e as Event_EnemyBulletHit;

        if (bH != null)
        {
            oneShotSource.PlayOneShot(gameModel.sfx_EnemyBulletHit);
        }

        Event_PlayerShieldBlock sB = e as Event_PlayerShieldBlock;

        if (sB != null)
        {
            oneShotSource.PlayOneShot(gameModel.sfx_Shield_Block);
        }

        Event_PlayerExplode pE = e as Event_PlayerExplode;

        if (pE != null)
        {
            oneShotSource.PlayOneShot(gameModel.sfx_ShipExplode);
        }

        Event_LanceHit lH = e as Event_LanceHit;

        if (lH != null)
        {
            GameObject g = gameAssets.Make(MyGameAsset.SFX, lH.location);
            g.GetComponent <AudioSource>().PlayOneShot(gameModel.sfx_LanceHit);
        }
    }
示例#2
0
    public void EventHandler(SCG_Event e)
    {
        Event_PlayerShieldBlock psb = e as Event_PlayerShieldBlock;

        if (psb != null)
        {
            c0 = playModel.appliedBulletColor;
            c1 = playModel.appliedBulletColor;
            return;
        }

        Event_EnemyBulletHit ebb = e as Event_EnemyBulletHit;

        if (ebb != null)
        {
            playerShotPS.Emit(10);
        }
    }
 public void EventHandler(SCG_Event e)
 {
     if (playModel.shieldSize == gameModel.f_Shield_Cutoff_Min)
     {
         Event_PlayerShieldBlock psb = e as Event_PlayerShieldBlock;
         if (psb != null)
         {
             float outCome = Random.Range(0.000f, 1.0000f);
             if (outCome <= bouncePerc)
             {
                 GameObject bullet = assetManager.Make(MyGameAsset.Bullet, ServiceLocator.instance.Player.position + (Vector3)playModel.shieldDirection);
                 bullet.transform.localScale = Vector3.one * 5;
                 bullet.GetComponent <Behavior_Bullet>().bounced = true;
                 bullet.GetComponent <Rigidbody>().AddForce((Vector3)playModel.shieldDirection * gameModel.s_Guns_BulletSpeed * 2.8f, ForceMode.Impulse);
             }
         }
     }
 }
    public void EventHandler(SCG_Event e)
    {
        Event_PlayerShieldBlock psb = e as Event_PlayerShieldBlock;

        if (psb != null)
        {
            if (heatModel.active_Shield)
            {
                heatModel.heat_Shield += gameModel.f_Shield_ActiveBlockPenalty;
            }
        }

        Event_Restart restart = e as Event_Restart;
        Event_Respawn respawn = e as Event_Respawn;

        if (restart != null || respawn != null)
        {
            heatModel.heat_Guns      = 0;
            heatModel.heat_Lance     = 0;
            heatModel.heat_Rockets   = 0;
            heatModel.heat_Shield    = 0;
            heatModel.heat_Thrusters = 0;
        }
    }
示例#5
0
    public void EventHandler(SCG_Event e)
    {
        Event_BonusPoints bp = e as Event_BonusPoints;

        if (bp != null)
        {
            sadModel.score += bp.score;
            return;
        }

        Event_PlayerBulletHit bh = e as Event_PlayerBulletHit;

        if (bh != null)
        {
            sadModel.score += 7;
            return;
        }

        Event_PlayerShieldBlock sb = e as Event_PlayerShieldBlock;

        if (sb != null)
        {
            sadModel.score += 12;
            return;
        }

        Event_EnemyDeath ed = e as Event_EnemyDeath;

        if (ed != null)
        {
            sadModel.score += 100;
            return;
        }

        Event_PlayerRocketHit rh = e as Event_PlayerRocketHit;

        if (rh != null)
        {
            sadModel.score += 21;
            return;
        }

        Event_LanceHit sh = e as Event_LanceHit;

        if (sh != null)
        {
            sadModel.score += 3;
        }

        Event_LevelClear lc = e as Event_LevelClear;

        if (lc != null)
        {
            sadModel.lastScore = sadModel.endScore;
            sadModel.endScore  = sadModel.score;
        }

        Event_Restart r = e as Event_Restart;

        if (r != null)
        {
            sadModel.lastScore  = 0;
            sadModel.endScore   = 0;
            sadModel.score      = 0;
            sadModel.difficulty = 0;
            sadModel.level      = 1;
        }
    }