Example #1
0
 // Update is called once per frame
 void Update()
 {
     if (Input.GetKeyDown("space") && inside && !movscript.GetMovementLock())
     {
         if (!locked)
         {
             movscript.LockMovement();
             if (above)
             {
                 cs.StartWipe(inwipe, outwipe, AboveTeleport, movscript.UnlockMovement);
             }
             else
             {
                 cs.StartWipe(inwipe, outwipe, BelowTeleport, movscript.UnlockMovement);
             }
             if (sound != null)
             {
                 audio.PlayOneShot(sound);
             }
         }
         else
         {
             handler.StartScene(locktext);
         }
     }
 }
    public void StartCellPhoneFight()
    {
        movscript.LockMovement();
        CameraShader cs = GameObject.Find("Main Camera").GetComponent <CameraShader>();

        cs.StartWipe(Resources.Load <Texture>("Textures/weirdspiralwipe"), Resources.Load <Texture>("Textures/screenwipeouttex"), InitializeCellPhoneFight, null, 1.0f, 3.0f);
        mps.PlaySong("Sounds/Music/O_SHIT_I_ENCOUNTERED_AN_ENEMY_BUT_ITS_SHORTER", 3, false);
    }
Example #3
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.name == "Player" && !movscript.GetMovementLock())
     {
         Debug.Log("Enemy touched player");
         cs.StartWipe(inwipe, outwipe, InitializeBattle, null, 1.0f, 3.0f);
         movscript.LockMovement();
         //SceneManager.LoadScene("BattleScene");
         active = false;
         gameObject.SetActive(active);
     }
 }
Example #4
0
    // Update is called once per frame
    void Update()
    {
        switch (currstate)
        {
        case states.dead:
            break;

        case states.battlewon:
            generalTimer += Time.deltaTime;
            if (generalTimer >= 3.0f)
            {
                generalTimer = 0.0f;
                currstate    = states.dead;
                if (cbbattleend == null)
                {
                    cs.StartWipe(EndBattle, movscript.UnlockMovement);
                }
                else
                {
                    cs.StartWipe(EndBattle, cbbattleend);
                }
            }
            break;

        case states.turnstart:
        {
            currbattler = battlerQueue[0];
            battlerQueue.RemoveAt(0);
            battlerQueue.Add(currbattler);
            currbattler.StartFlashing(1.5f);
            if (!currbattler.isPlayerControlled)
            {
                //generalTimer += Time.deltaTime;
                //if (generalTimer >= 2.0f)
                //{
                generalTimer = 0.0f;
                currstate    = states.turnattack;
                AttackDelegate ad = currbattler.GetAttack(player, this);
                StartCoroutine(ad(currbattler, player, this));
                //}
            }
            else
            {
                choiceRadial.SetActive(true);
            }
            currstate = states.turnattack;
            break;
        }

        case states.turnattack:
        {
            break;
        }

        case states.turnend:
        {
            generalTimer += Time.deltaTime;
            if (generalTimer >= 1.0f)
            {
                generalTimer = 0.0f;
                currstate    = states.turnstart;
            }
            break;
        }

        default:
            currstate = states.dead;
            break;
        }
        //player.UpdateBattler();
        //enemy.UpdateBattler();
        for (int i = 0; i < registeredBattlers.Count; i++)
        {
            registeredBattlers[i].UpdateBattler();
        }
        playerhp.text    = player.hp.ToString();
        playermaxhp.text = player.maxhp.ToString();
        playeren.text    = player.en.ToString();
        playermaxen.text = player.maxen.ToString();
    }