示例#1
0
 void OnTriggerEnter(Collider other)
 {
     if ("Player".Equals(other.tag))
     {
         var normalizedHp = _theDaystar.GetNormalizeHp();
         var damage       = normalizedHp <= (1f / 7f) ?
                            (theTraitor.isTraitor ? 7 : 3) :
                            (theTraitor.isTraitor ? 5 : 1);
         other.GetComponent <TheShepherd> ().Hit(damage);
         _shakeCamera.Shake(.175f, .065f);
         InstantiateEffectAtCollision();
         InstantiateSoundEffectAtCollision();
         if (theTraitor.isTraitor)
         {
             theTraitor.InstantiateBullet(300f);
         }
         Destroy(gameObject);
     }
     else if ("The House".Equals(other.tag))
     {
         InstantiateEffectAtCollision();
         InstantiateSoundEffectAtCollision();
         Destroy(gameObject);
     }
     else if ("The Word".Equals(other.tag))
     {
         other.GetComponent <ThePrayerWord> ().SelfDestruct();
     }
 }
示例#2
0
    IEnumerator Next()
    {
        var timeToNext = _theDaystar.GetNormalizeHp() <= (1f / 7f)?.25f : 1.15f;

        yield return(new WaitForSeconds(timeToNext));

        var nextSkill = GetNextSkill();

        nextSkill.Execute();
    }
示例#3
0
    void InstantiateBall(Vector3 forward)
    {
        var normalizedHp = _theDaystar.GetNormalizeHp();
        var speed        = normalizedHp <= (1f / 7f) ? _speed * 1.107f : _speed;
        var cannonBall   = Instantiate <CannonBall> (_theCannonBallPrefab, transform.position, Quaternion.identity);

        cannonBall.theTraitor.isTraitor = _theTraitorDueCount.isDue;
        cannonBall.speed   = _speed;
        cannonBall.forward = forward;
    }
示例#4
0
    void InitFakeShepherd(float stepX)
    {
        var normalizedHp    = _theDaystar.GetNormalizeHp();
        var speed           = normalizedHp <= (1f / 7f) ? initSpeed * 1.105f : initSpeed;
        var spawnPointX     = _spawnPoint.position.x + stepX;
        var spawnPoint      = new Vector3(spawnPointX, _spawnPoint.position.y, _spawnPoint.position.z);
        var theFakeShepherd = Instantiate <TheFakeShepherd3> (_fakeShepherdPrefab, spawnPoint, Quaternion.identity);

        theFakeShepherd.theTraitor.isTraitor = _theTraitorDueCount.isDue;
        theFakeShepherd.initSpeed            = speed;
    }
示例#5
0
    void InitFakeShepherd()
    {
        var normalizedHp    = _theDaystar.GetNormalizeHp();
        var speed           = normalizedHp <= (1f / 7f) ? initSpeed * 1.105f : initSpeed;
        var appearedSpd     = normalizedHp <= (1f / 7f) ? appearedSpeed * 1.5f : appearedSpeed;
        var spawnPoint      = new Vector3(_player.transform.position.x, _spawnPoint.position.y, _spawnPoint.position.z);
        var theFakeShepherd = Instantiate <TheFakeShepherd3> (_fakeShepherdPrefab, spawnPoint, Quaternion.identity);

        theFakeShepherd.theTraitor.isTraitor = _theTraitorDueCount.isDue;
        theFakeShepherd.initSpeed            = speed;
        theFakeShepherd.appearedSpeed        = appearedSpd;
    }
示例#6
0
    void InitGoingDownThing(float stepX)
    {
        var normalizedHp = _theDaystar.GetNormalizeHp();
        var spawnPointX  = _spawnPoint.position.x + stepX;
        var spawnPoint   = new Vector3(spawnPointX, _spawnPoint.position.y, _spawnPoint.position.z);
        var goingDown    = Instantiate <TheGoingDown> (_theFallenBlockPrefab, spawnPoint, Quaternion.identity);
        var isTraitor    = _theTraitorDueCount.isDue;
        var damage       = normalizedHp <= (1f / 7f) ?
                           (isTraitor ? 7 : 3) :
                           (isTraitor ? 5 : 1);

        goingDown.theTraitor.isTraitor = isTraitor;
        goingDown.initSpeed            = initSpeed;
        goingDown.damage = damage;
        goingDown.transform.localScale = Vector3.zero;
        _currentList.Add(goingDown);
    }