Exemplo n.º 1
0
    // DETECTION BUG: CAUSE OF OVERDAMAGE AND OVERKNOCKBACK

    private void OnTriggerEnter(Collider other)
    {
        // Take damage, Melee
        if (other.gameObject.layer == 11)
        {
            Debug.Log("OW!");
            CombatConductor mDmg = other.GetComponentInParent <CombatConductor>();
            TakeDamage(mDmg.meleeDamage);
        }
        // Take damage, projectiles
        if (other.gameObject.layer == 12)
        {
            Debug.Log("OW!");
            ProjectileTranslation a1Dmg = other.GetComponentInParent <ProjectileTranslation>();
            TakeDamage(a1Dmg.a1Damage);
        }

        // Knockback if player collides
        if (other.gameObject.tag == "Player")
        {
            Rigidbody knock = other.GetComponent <Rigidbody>();
            Vector3   force = (other.transform.position - transform.position).normalized;
            knock.AddRelativeForce(force * knockForce, ForceMode.Impulse);
        }
    }
Exemplo n.º 2
0
    private void Start()
    {
        // In start becuase parent only exist once this object spawned (as child).
        combatRef    = GetComponentInParent <CombatConductor>();
        mouseInfoRef = GetComponentInParent <PlayerCharacter>();
        combatRef.GetStarShotRef();

        origin = GameObject.FindGameObjectWithTag("Player");
    }
Exemplo n.º 3
0
 private void OnTriggerStay(Collider other)
 {
     // Take damage, ability2
     if (other.GetComponent <RadiantSun>())
     {
         float           delta = Time.deltaTime;
         CombatConductor a2Dmg = other.GetComponentInParent <CombatConductor>();
         TakeDamage(a2Dmg.a2_damage * delta);
     }
 }
Exemplo n.º 4
0
    void Start()
    {
        combatRef = GameObject.FindGameObjectWithTag("Player").GetComponent <CombatConductor>();
        colliders = GetComponents <BoxCollider>();
        rend      = GetComponent <Renderer>();

        gameObject.tag         = "Passable";
        colliders[0].isTrigger = false;
        colliders[1].isTrigger = true;
    }
    public Renderer rend; // Player renderer


    // Use this for initialization
    void Start()
    {
        // Player Renderer
        rend          = GetComponentInParent <Renderer>();
        moveReference = GetComponentInParent <PlayerCharacter>();
        combatRef     = GetComponentInParent <CombatConductor>();
        combatRef.GetAscensionRef();

        if (combatRef.a4_active)
        {
            float speed = moveReference.moveSpeed + 1;
            moveReference.moveSpeed = speed;
        }
    }
Exemplo n.º 6
0
 void Start()
 {
     // In start becuase parent only exist once this object spawned (as child).
     combatRef = GetComponentInParent <CombatConductor>();
     combatRef.GetRadiantSunRef();
 }
Exemplo n.º 7
0
 void Start()
 {
     meleeColliderRef         = GetComponentInChildren <CapsuleCollider>();
     meleeColliderRef.enabled = false;
     combatRef = GetComponentInParent <CombatConductor>();
 }
 void Start()
 {
     combatRef = GameObject.FindGameObjectWithTag("Player").GetComponent <CombatConductor>();
 }
Exemplo n.º 9
0
 void Start()
 {
     combatRef = GetComponentInParent <CombatConductor>();
     combatRef.GetSpacialSuspensionRef();
 }