示例#1
0
    float ComputeCollisionResult(BeybladePiece thisPiece, BeybladePiece otherPiece)
    {
        Beyblade otherBey = otherPiece.m_parent;

        return(GetAttackMultiplier() * thisPiece.m_attack + GetDefenseMultiplier() * thisPiece.m_defense
               - (otherPiece.m_attack * otherBey.GetAttackMultiplier() + otherPiece.m_defense * otherBey.GetDefenseMultiplier()));
    }
示例#2
0
    public void BeybladeCollision(BeybladePiece thisPiece, BeybladePiece otherPiece)
    {
        PlaySound(0, 0.7f);
        float result = ComputeCollisionResult(thisPiece, otherPiece);

        print(result + gameObject.name);
        if (ClashEventDecision(otherPiece.m_parent, result) && !m_collision)
        {
            //deal damage
            otherPiece.m_parent.TakeDamage(4 * result);
            m_us.ChargeUltimateBar(result / 4);
            print(thisPiece.gameObject.name + " " + gameObject.name + " -> " + otherPiece.gameObject.name + " " + otherPiece.m_parent.name);
            //TODO: Determine combo count
            m_gameSystem.Initiate2D(this, otherPiece.m_parent, 10);
        }
        else if (!m_collision && result > 0f)
        {
            DisablePlayerInfluence();
            Invoke("EnablePlayerInfluence", m_bounceDisableTime);
            BounceBack(otherPiece.m_parent, result);
            //deal damage
            otherPiece.m_parent.TakeDamage(result);
            m_us.ChargeUltimateBar(result / 4);
        }
        m_collision = true;
    }
示例#3
0
    void OnTriggerEnter(Collider other)
    {
        BeybladePiece piece = other.GetComponent <BeybladePiece>();

        if (piece)
        {
            CollideWithPiece(piece);
        }
    }
示例#4
0
    void OnTriggerExit(Collider other)
    {
        BeybladePiece piece = other.GetComponent <BeybladePiece>();

        if (piece)
        {
            m_parent.ResetCollision();
            piece.m_parent.ResetCollision();
        }
    }
示例#5
0
 public void UltimateBeybladeCollision(UltimateCollider thisPiece, BeybladePiece otherPiece)
 {
     thisPiece.gameObject.SetActive(false);
     this.ultiSkillUi.doUltimate();
     m_gameSystem.Initiate2D(this, otherPiece.m_parent, 40, 0.2f);
 }
示例#6
0
 public virtual void CollideWithPiece(BeybladePiece other)
 {
     m_parent.UltimateBeybladeCollision(this, other);
 }