private void EventHandler(SCG_Event e) { Event_PlayerBulletHit p = e as Event_PlayerBulletHit; if (p != null) { if (p.enemyHit == this) { hitpoints_Current -= p.enemyDamageTaken; } } Event_LanceHit s = e as Event_LanceHit; if (s != null) { if (s.enemyHit == this) { if (s.trueEnterFalseExit) { hitpoints_Current -= gameModel.d_Lance_Damage; } isInLance = s.trueEnterFalseExit; } } Event_ExplosionBallHit x = e as Event_ExplosionBallHit; if (x != null) { if (x.enemyHit == this) { isInExplosionBall = x.trueEnterFalseExit; } } Event_PlayerRocketHit r = e as Event_PlayerRocketHit; if (r != null) { if (r.enemyHit == this) { hitpoints_Current -= r.damageTaken; } } }
public void EventHandler(SCG_Event e) { if (playModel.currentPlayerState == PlayerState.Alive) { float timeDip = 1; Event_PlayerBulletHit bh = e as Event_PlayerBulletHit; if (bh != null) { timeDip = .5f; } Event_PlayerRocketHit rh = e as Event_PlayerRocketHit; if (rh != null) { timeDip = .1f; } Event_LanceHit lh = e as Event_LanceHit; if (lh != null) { timeDip = .65f; } Event_EnemyDeath ed = e as Event_EnemyDeath; if (ed != null) { timeDip = .06f; } if (timeDip <= Time.timeScale) { Time.timeScale = timeDip; } } }
void EffectsEventHandler(SCG_Event e) { Event_PlayerBulletHit bH = e as Event_PlayerBulletHit; if (bH != null) { if (_IsBulletActiveCheck(bH.bullet.gameObject)) { Make(MyGameAsset.BulletExplosion, bH.location); int indexOfBullet = bullets_Active.IndexOf(bH.bullet.gameObject); _StowActiveBullet(indexOfBullet); return; } } Event_PlayerRocketHit rH = e as Event_PlayerRocketHit; if (rH != null) { if (_IsGOActiveCheck(rH.altRocket.gameObject, rockets_Active)) { //Debug.Log("Rocket hit registered by GAManager"); Make(MyGameAsset.RocketExplosion, rH.location); int indexOfRocket = rockets_Active.IndexOf(rH.altRocket.gameObject); _StowActiveNonPhysicsManagedGO(rockets_Active, rockets_Times, rockets_Inactive, indexOfRocket); return; } } Event_LanceHit lH = e as Event_LanceHit; if (lH != null) { Make(MyGameAsset.LanceHit, lH.location); return; } Event_ExplosionBallHit x = e as Event_ExplosionBallHit; if (x != null) { Make(MyGameAsset.BulletExplosion, x.location); return; } Event_EnemyDeath eD = e as Event_EnemyDeath; if (eD != null) { //GameObject g = Make(MyGameAsset.DeathExplosion, eD.location); //g.GetComponent<Behavior_DeathExplosionTimer>().Explode(); GameObject g = Make(MyGameAsset.SFX, eD.location); g.GetComponent <AudioSource>().PlayOneShot(gameModel.sfx_EnemyLittleExplosion); } Event_EnemyMineHit m = e as Event_EnemyMineHit; if (m != null) { GameObject g = Make(MyGameAsset.MineExplosion, m.location); //g.GetComponent<Behavior_DeathExplosionParent>().Explode(); } Event_EnemyMissileHit msl = e as Event_EnemyMissileHit; if (msl != null) { GameObject g = Make(MyGameAsset.MissileExplosion, msl.location); } }
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; } }