void Start()
 {
     animator     = GetComponent <Animator>();
     physicsBody  = GetComponent <Rigidbody2D>();
     comboCounter = FindObjectOfType <ComboCounter>();
     animator.SetBool("madeContact", false);
 }
Esempio n. 2
0
    public override void addHit(GameObject h, int hitLag)
    {
        alreadyHit.Add(h);
        mngr.addHit(h);
        mngr.updateLastAttack(type);
        alreadyHit[0].GetComponent <PlayerMover>().restoreTools();
        ComboCounter c = GetComponentInParent <ComboCounter>();

        if (c)
        {
            if (type != AttackManager.AtkType.Finisher && !mngr.alreadyHitByType.Contains(h) && !GetComponentInParent <PlayerMover>().isPhase2())
            {
                c.incrementCombo(1);
            }
            else
            {
                c.resetComboTime();
            }
        }


        if (type != AttackManager.AtkType.Finisher && hitLag > 0 /*<- safety*/)
        {
            if (isGrab)
            {
                grabHitlagPending = hitLag;
            }
            else
            {
                currentHitlag = hitLag;
                mngr.lag(true);
            }
        }
    }
Esempio n. 3
0
 private void Start()
 {
     comboCounter = FindObjectOfType <ComboCounter>();
     points       = 0;
     AddPoints(0);
     happyMeter    = maxHappyMeter;
     currentDrinks = new GameObject[3];
 }
Esempio n. 4
0
 protected override void initializeUIElements()
 {
     if (Difficulty != Difficulty.Easy)
     {
         healthBar = new HealthBar();
     }
     comboCounter = new ComboCounter();
 }
Esempio n. 5
0
    void Start()
    {
        text.text = "无";

        m_counter = new ComboCounter();
        m_counter.Duration = 1.0f;
        m_counter.onBegin = OnBegin;
        m_counter.onIncrease = OnIncrease;
        m_counter.onEnd = OnEnd;
    }
Esempio n. 6
0
    void Start()
    {
        text.text = "无";

        m_counter            = new ComboCounter();
        m_counter.Duration   = 1.0f;
        m_counter.onBegin    = OnBegin;
        m_counter.onIncrease = OnIncrease;
        m_counter.onEnd      = OnEnd;
    }
Esempio n. 7
0
 private void Awake()
 {
     if (ComboCounter.Instance == null)
     {
         ComboCounter.Instance = this;
     }
     else
     {
         Destroy(this);
     }
 }
Esempio n. 8
0
 // Use this for initialization
 void Start()
 {
     ci         = GetComponent <Interpreter>();
     combo      = GetComponent <ComboCounter>();
     pm         = GetComponent <PlayerMover>();
     source     = GetComponent <AudioSource>();
     lastAttack = AtkType.None;
     if (TouchAttack)
     {
         currentTouchAttack = Instantiate(TouchAttack, transform);
     }
 }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        //set references
        gameManager = GameObject.Find("GameManager").GetComponent <GameManager> ();
        combo       = GetComponent <ComboCounter> ();
        swipeCont   = gameManager.GetComponent <SwipeController> ();

        hp = 2;                       //set amount of lives

        currentSpeed  = walkSpeed;    //set speed to walk
        dashRemaining = dashDistance; //set dash counter to maximum distance
    }
    // Use this for initialization
    void Start()
    {
        opponent          = FindObjectOfType <Opponent>();
        opponentCharacter = opponent.GetComponentInChildren <Character>();
        physicsbody       = GetComponentInChildren <Rigidbody2D>();
        comboSystem       = GetComponent <ComboSystem>();
        chargeSystem      = GetComponent <ChargeSystem>();
        character.side    = Character.Side.P1;
        healthBar         = FindObjectOfType <HealthBarP1>();
        superBar          = FindObjectOfType <SuperBarP1>();

        if (character.GetComponent <FeiLong>() != null)
        {
            feiLong   = GetComponentInChildren <FeiLong>();
            feiLongAI = GetComponentInChildren <FeiLongAI>();
            CharacterInitialize(feiLongMugShot, "Fei Long", feiLongAI.Behaviors);
        }
        else if (character.GetComponent <Ken>() != null)
        {
            kenAI = GetComponentInChildren <KenAI>();
            CharacterInitialize(kenMugShot, "Ken", kenAI.Behaviors);
        }
        else if (character.GetComponent <Balrog>() != null)
        {
            balrogAI = GetComponentInChildren <BalrogAI>();
            CharacterInitialize(balrogMugShot, "Balrog", balrogAI.Behaviors);
        }
        else if (character.GetComponent <Akuma>() != null)
        {
            akumaAI = GetComponentInChildren <AkumaAI>();
            CharacterInitialize(akumaMugShot, "Akuma", akumaAI.Behaviors);
        }
        else if (character.GetComponent <Sagat>() != null)
        {
            sagatAI = GetComponentInChildren <SagatAI>();
            CharacterInitialize(sagatMugShot, "Sagat", sagatAI.Behaviors);
        }
        else if (character.GetComponent <MBison>() != null)
        {
            mbisonAI = GetComponentInChildren <MBisonAI>();
            CharacterInitialize(mbisonMugShot, "M Bison", mbisonAI.Behaviors);
        }

        projectileP1Parent = GameObject.Find("ProjectileP1Parent");
        if (projectileP1Parent == null)
        {
            projectileP1Parent = new GameObject("ProjectileP1Parent");
        }

        comboCounter = FindObjectOfType <ComboCounter>();
        introPlayed  = false;
    }
Esempio n. 11
0
 void Awake()
 {
     timer            = FindObjectOfType <Timer>();
     enemyAI          = FindObjectsOfType <EnemyAI>();
     hitBoxes         = GetComponent <PlayerAttack> ();
     currentHealth    = MaxHealth;
     playerFever      = GetComponent <PlayerAttack>();
     comboUI          = GetComponent <ComboCounter> ();
     consuming        = GetComponent <PlayerConsume> ();
     skillScript      = GetComponent <PlayerSkill>();
     controllerScript = GetComponent <PlayerController>();
     animator         = GetComponent <Animator>();
 }
Esempio n. 12
0
    float skillsTimer = 0.0f; // A skillsTimer variable is shared between the three skills.

    void Start()
    {
        sfx = FindObjectOfType <Sounds>();
        bossChargeHittable = true;
        anim             = GetComponent <Animator>();
        attackScript     = GetComponent <PlayerAttack>();
        comboScript      = GetComponent <ComboCounter>();
        healthScript     = GetComponent <PlayerHealth>();
        consumeScript    = GetComponent <PlayerConsume>();
        controllerScript = GetComponent <PlayerController>();
        GameObject iconsHolder = GameObject.Find("HUDCanvas/AbilityIcons");

        chargeIcon  = iconsHolder.transform.GetChild(0).GetComponent <IconCoolDown>();
        dodgeIcon   = iconsHolder.transform.GetChild(1).GetComponent <IconCoolDown>();
        tornadoIcon = iconsHolder.transform.GetChild(3).GetComponent <IconCoolDown>();
        rb          = GetComponent <Rigidbody2D>();
    }
Esempio n. 13
0
 void Start()
 {
     accessCC = GameObject.FindWithTag("GameController").GetComponent <ComboCounter>();
     accessSP = gameObject.GetComponent <SpecialAttackControl>();
     if (gameObject.tag == "Player")
     {
         healthSlider = GameObject.FindWithTag("PlayerHealth").GetComponent <Slider>();
         fill         = GameObject.FindWithTag("PlayerHealthBar").GetComponent <Image>();
     }
     else if (gameObject.tag == "Enemy")
     {
         healthSlider = GameObject.FindWithTag("EnemyHealth").GetComponent <Slider>();
         fill         = GameObject.FindWithTag("EnemyHealthBar").GetComponent <Image>();
     }
     healthSlider.value = health;
     fill.color         = gradient.Evaluate(healthSlider.normalizedValue); //Changes the health bar colour based on the character's HP
     blocking           = GetComponent <Blocking>();
 }
Esempio n. 14
0
    //For Special Enemies Checking
    // public GameObject tempura1;
    // public GameObject makiroll1;

    void Start()
    {
        if (SceneManager.GetActiveScene().buildIndex == 2)
        {
            f1Manager = FindObjectOfType <Fight1Manager>();
        }
        else if (SceneManager.GetActiveScene().buildIndex == 4)
        {
            f2Manager = FindObjectOfType <Fight2Manager>();
        }
        comboUI      = GetComponent <ComboCounter>();
        consumeCheck = GetComponent <EnemyHealthManager>();
        consuming    = false;
        healthCheck  = gameObject.GetComponent <PlayerHealth>();
        RightConsumeBox.SetActive(false);
        anim        = GetComponent <Animator> ();
        skillScript = GetComponent <PlayerSkill> ();
        GameObject iconsHolder = GameObject.Find("HUDCanvas/AbilityIcons");

        consumeIcon = iconsHolder.transform.GetChild(4).GetComponent <IconCoolDown>();
    }
Esempio n. 15
0
        public PlayScreen(MainGame.Globals globals, SongLoader previous, Song s, SongSettings songSettings)
        {
            this.globals  = globals;
            this.previous = previous;


            ts = new SimpleTimeSource(s.PPQ, s.InitialTempo);
            //var stf = new StaffRenderer(theme, , s);
            sR = new StaffRenderer(globals.Theme, new MV
            {
                ts       = ts,
                interval = s.PPQ * 4,
            }, s);


            g   = new Core.Game(s, songSettings.MidiOut, ts, this);
            inp = new Mono.KeyboardMIDIInput(g);

            ctr = new ComboCounter(globals.Theme.TestFont, ts);

            g.Play();
        }
Esempio n. 16
0
 // Use this for initialization
 void Start()
 {
     isUppercut          = false;
     playerController    = GetComponent <PlayerController>();
     originalChainDelay  = chainDelay;
     originalAttackDelay = attackDelay;
     originalCharged     = charged;
     //gameController = FindObjectOfType<GameController>();
     RightCharging = false;
     attacking     = false;
     isRight       = true;
     comboUI       = GetComponent <ComboCounter>();
     anim          = GetComponent <Animator>();
     anim.Play("Player_Idle");
     // ComboCounter = 0;
     canAttack = true;
     //SetCountText();
     RightHitbox1.SetActive(false);
     RightHitbox2.SetActive(false);
     RightHitbox3.SetActive(false);
     RightChargebox.SetActive(false);
     playerHealth  = GetComponent <PlayerHealth>();
     playerConsume = GetComponent <PlayerConsume>();
 }
Esempio n. 17
0
        protected override void LoadContent()
        {
            sb    = new SpriteBatch(GraphicsDevice);
            theme = new Theme();
            theme.LoadBasic(Content);

            var loadMidi  = Task.Run(() => new MidiFile("Assets/desire_drive.mid"));
            var loadTheme = Task.Run(() => theme.LoadFromContent(Content));
            var output    = midiManager.CreateOutput();

            Task.Run(async() =>
            {
                // TODO: use this.Content to load your game content here
                var s = MidiToSong.FromMidi(await loadMidi);


                ts = new SimpleTimeSource(s.PPQ, s.InitialTempo);
                //var stf = new StaffRenderer(theme, , s);
                await loadTheme;
                sR = new StaffRenderer(theme, new MV
                {
                    ts       = ts,
                    interval = s.PPQ * 4,
                }, s);

                var mout = await output;

                g   = new Core.Game(s, mout, ts, this);
                inp = new Mono.KeyboardMIDIInput(g);

                ctr = new ComboCounter(theme.TestFont, ts);

                loading = false;
                g.Play();
            });
        }
Esempio n. 18
0
 void Start()
 {
     comboCounter = FindObjectOfType <ComboCounter>();
 }
Esempio n. 19
0
 void OnDestroy()
 {
     _instance = null;
 }
Esempio n. 20
0
    public int makeAttack(AtkType a)
    {
        switch (a)
        {
        case AtkType.DownAir:
            currentAttack = Instantiate(DownAir, transform, false);
            source.PlayOneShot(DownAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.NeutralAir:
            currentAttack = Instantiate(NeutralAir, transform, false);
            source.PlayOneShot(NeutralAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.UpAir:
            currentAttack = Instantiate(UpAir, transform, false);
            source.PlayOneShot(UpAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.ForwardAir:
            currentAttack = Instantiate(ForwardAir, transform, false);
            source.PlayOneShot(ForwardAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.BackAir:
            currentAttack = Instantiate(BackAir, transform, false);
            source.PlayOneShot(BackAir.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.DownGround:
            currentAttack = Instantiate(DownGround, transform, false);
            source.PlayOneShot(DownGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.UpGround:
            currentAttack = Instantiate(UpGround, transform, false);
            source.PlayOneShot(UpGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.BackGround:
            currentAttack = Instantiate(BackGround, transform, false);
            source.PlayOneShot(BackGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.ForwardGround:
            currentAttack = Instantiate(ForwardGround, transform, false);
            source.PlayOneShot(ForwardGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.NeutralGround:
            currentAttack = Instantiate(NeutralGround, transform, false);
            source.PlayOneShot(NeutralGround.GetComponent <Attack>().attackSound, hitVolume);
            break;

        case AtkType.Finisher:
            currentAttack = Instantiate(Finisher, transform, false);
            source.PlayOneShot(Finisher.GetComponent <Attack>().attackSound, finisherVolume);
            ComboCounter c = GetComponent <ComboCounter>();
            currentAttack.GetComponent <AttackActive>().comboStrength = c.currentCombo;
            c.reset();
            break;

        default:
            print("Not implemented");
            currentAttack = Instantiate(NeutralAir, transform, false);
            break;
        }
        currentAttack.GetComponent <AttackActive>().setType(a);
        mf = currentAttack.GetComponent <MovePhysics>();
        return(currentAttack.GetComponent <AttackActive>().atkFrames);
    }