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())); }
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; }
void OnTriggerEnter(Collider other) { BeybladePiece piece = other.GetComponent <BeybladePiece>(); if (piece) { CollideWithPiece(piece); } }
void OnTriggerExit(Collider other) { BeybladePiece piece = other.GetComponent <BeybladePiece>(); if (piece) { m_parent.ResetCollision(); piece.m_parent.ResetCollision(); } }
public void UltimateBeybladeCollision(UltimateCollider thisPiece, BeybladePiece otherPiece) { thisPiece.gameObject.SetActive(false); this.ultiSkillUi.doUltimate(); m_gameSystem.Initiate2D(this, otherPiece.m_parent, 40, 0.2f); }
public virtual void CollideWithPiece(BeybladePiece other) { m_parent.UltimateBeybladeCollision(this, other); }