Exemple #1
0
    private IEnumerator PlayKOanimation(AllHits hit)
    {
        switch (hit)
        {
        case AllHits.UpJab:
            gameObject.GetComponent <Animator>().Play(koStanceAnimation[AllKoStances.UpKo]);
            break;

        case AllHits.DownJab:
            gameObject.GetComponent <Animator>().Play(koStanceAnimation[AllKoStances.DownKo]);
            break;

        case AllHits.UpCross:
            gameObject.GetComponent <Animator>().Play(koStanceAnimation[AllKoStances.UpKo]);
            break;

        case AllHits.DownCross:
            gameObject.GetComponent <Animator>().Play(koStanceAnimation[AllKoStances.DownKo]);
            break;

        case AllHits.Uppercut:
            gameObject.GetComponent <Animator>().Play(koStanceAnimation[AllKoStances.UpKo]);
            break;
        }

        soundManager.PlaySingle(KnockOut);
        yield return(new WaitForSeconds(0.1f));
    }
Exemple #2
0
    private IEnumerator SetButtonText(GameObject _button, AllHits _hit)
    {
        float hitDmg = 0f;

        while (hitDmg == 0)
        {
            hitDmg = gameObject.GetComponent <Hits>().GetHitPower(_hit);
            Text btnText = _button.GetComponentInChildren <Text>();
            btnText.text  = CommandName(_hit) + " - " + hitDmg + " PV";
            btnText.color = Color.white;
            yield return(new WaitForFixedUpdate());
        }
    }
Exemple #3
0
 public void SelectHit(AllHits hit)
 {
     if (gameObject.GetComponent <FighterInfo>().playablePhase == gameManager.p_currentPhase)
     {
         selectedHit = hit;
         gameObject.GetComponent <FighterInfo>().n_nbTimeInARowToPerformDefensiveStance     = 0;
         gameManager.GetOpponentOf(gameObject).GetComponent <FighterInfo>().lastOpponenthit = hit;
         gameManager.NextPhase();
     }
     else
     {
         Debug.Log("Cannot select hit outside of fighter phase");
     }
 }
Exemple #4
0
    public void TakeDamage(float damageDealt, AllHits hit)
    {
        f_health -= (damageDealt > f_health ? f_health : damageDealt);
        hitFX.GetComponent <Animator>().Play("hitFX");

        if (f_health <= 0)
        {
            StartCoroutine(PlayKOanimation(hit));
        }
        if (gameManager.p_currentPhase == GameManager.Phase.ApplyMoves)
        {
            b_hasTakenHit = true;
        }
    }
        public void CombineBinEvidence(IBinEvidence evidence, int binOffset = 0, int startBinInOther = 0, int endBinInOther = int.MaxValue)
        {
            var binEvidence = evidence as BinEvidence;

            if (binEvidence == null)
            {
                throw new ArgumentException($"Not able to combine bin evidence between two different types.");
            }
            _indelHits.Merge(binEvidence._indelHits, binOffset, startBinInOther, endBinInOther);
            _messyHits.Merge(binEvidence._messyHits, binOffset, startBinInOther, endBinInOther);
            _singleMismatchHits.Merge(binEvidence._singleMismatchHits, binOffset, startBinInOther, endBinInOther);
            AllHits.Merge(binEvidence.AllHits, binOffset, startBinInOther, endBinInOther);
            _revOnlyMessyHits.Merge(binEvidence._revOnlyMessyHits, binOffset, startBinInOther, endBinInOther);
            _mapqMessyHits.Merge(binEvidence._mapqMessyHits, binOffset, startBinInOther, endBinInOther);
            _fwdOnlyMessyHits.Merge(binEvidence._fwdOnlyMessyHits, binOffset, startBinInOther, endBinInOther);
        }
Exemple #6
0
    private string CommandName(AllHits command)
    {
        switch (command)
        {
        case AllHits.UpJab:
            return("Jab Haut");

        case AllHits.DownJab:
            return("Jab Bas");

        case AllHits.UpCross:
            return("Direct Haut");

        case AllHits.DownCross:
            return("Direct Bas");

        case AllHits.Uppercut:
            return("Uppercut");

        default: return("");
        }
    }
Exemple #7
0
 public void DisablePrepare()
 {
     transform.parent = null;
     dissovleTimer    = 0;
     startDissovle    = true;
     UpdateSaver      = true;
     if (Flash != null && Hit != null)
     {
         foreach (var AllHits in Hit)
         {
             if (AllHits.isPlaying)
             {
                 AllHits.Stop();
             }
         }
         foreach (var AllFlashes in Flash)
         {
             if (AllFlashes.isPlaying)
             {
                 AllFlashes.Stop();
             }
         }
     }
 }
Exemple #8
0
    public float GetHitPower(AllHits hit)
    {
        float strength = gameObject.GetComponent <FighterInfo>().f_strength;

        return((float)Math.Round(hitPower[hit] * strength));
    }
Exemple #9
0
    void Update()
    {
        if (laserPS != null && UpdateSaver == false)
        {
            //Set start laser point
            laserMat.SetVector("_StartPoint", transform.position);
            //Set end laser point
            RaycastHit hit;
            if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, MaxLength))
            {
                particleCount = Mathf.RoundToInt(hit.distance / (2 * laserScale));
                if (particleCount < hit.distance / (2 * laserScale))
                {
                    particleCount += 1;
                }
                particlesPositions = new Vector3[particleCount];
                AddParticles();

                laserMat.SetFloat("_Distance", hit.distance);
                laserMat.SetVector("_EndPoint", hit.point);
                if (Hit != null)
                {
                    HitEffect.transform.position = hit.point + hit.normal * HitOffset;
                    HitEffect.transform.LookAt(hit.point);
                    foreach (var AllHits in Hit)
                    {
                        if (!AllHits.isPlaying)
                        {
                            AllHits.Play();
                        }
                    }
                    foreach (var AllFlashes in Flash)
                    {
                        if (!AllFlashes.isPlaying)
                        {
                            AllFlashes.Play();
                        }
                    }
                }
            }
            else
            {
                //End laser position if doesn't collide with object
                var EndPos   = transform.position + transform.forward * MaxLength;
                var distance = Vector3.Distance(EndPos, transform.position);
                particleCount = Mathf.RoundToInt(distance / (2 * laserScale));
                if (particleCount < distance / (2 * laserScale))
                {
                    particleCount += 1;
                }
                particlesPositions = new Vector3[particleCount];
                AddParticles();

                laserMat.SetFloat("_Distance", distance);
                laserMat.SetVector("_EndPoint", EndPos);
                if (Hit != null)
                {
                    HitEffect.transform.position = EndPos;
                    foreach (var AllPs in Hit)
                    {
                        if (AllPs.isPlaying)
                        {
                            AllPs.Stop();
                        }
                    }
                }
            }
        }

        if (startDissovle)
        {
            dissovleTimer += Time.deltaTime;
            laserMat.SetFloat("_Dissolve", dissovleTimer * 5);
        }
    }
Exemple #10
0
 private void HandleHit(AllHits hit)
 {
     gameObject.GetComponent <Hits>().SelectHit(hit);
 }
 public void RefreshProbabilities(AllHits hit)
 {
     ComputeProbabilities((Commands)Enum.Parse(typeof(Commands), hit.ToString()));
 }