protected virtual void OnHitEnemy(GameObject hitObject) { if (isDashing) { hitObject.GetComponent <UnitAttributes> ().ApplyAttack(dashDamage * unitAttributes.DamageOutputFactorMultiplier, transform.position); if (isBuffed) { unitAttributes.Heal(dashDamage * unitAttributes.DamageOutputFactorMultiplier * BuffSkill.lifestealAmount); } } }
private void FixedUpdate () { if(!ReInput.isReady) return; if(!initialized) nekoyuPlayer = ReInput.players.GetPlayer(playerID); if (BuffSkill.isBuffed == true && isBuffed == false) { isBuffed = true; } if (BuffSkill.isBuffed == false && isBuffed == true) { isBuffed = false; } characterAnimator = GetComponent<Animator> (); if (currentSkillCooldown > 0) { currentSkillCooldown -= Time.deltaTime; } //if (Input.GetKey (KeyCode.Z) && currentSkillCooldown <= 0 && !NekoyuInput.inAir) { if (nekoyuPlayer.GetButton("Left Button") && currentSkillCooldown <= 0 && !NekoyuInput.inAir) { if (currentSkillDuration < maxSkillDuration) { if (characterAnimator.GetInteger ("Attack") != 3) { characterAnimator.Play ("LifestealStart", 0, 0f); } characterAnimator.SetInteger ("Attack", 3); NekoyuInput.attacking = true; FireProjectile (); addCooldown = true; currentSkillDuration += Time.deltaTime; } } //if (Input.GetKeyUp (KeyCode.Z) || currentSkillDuration >= maxSkillDuration) { if (nekoyuPlayer.GetButton("Left Button") || currentSkillDuration >= maxSkillDuration) { characterAnimator.SetInteger ("Attack", 0); StartCoroutine ("waitForSeconds"); if (addCooldown == true){ currentSkillCooldown = skillCooldown; addCooldown = false; currentSkillDuration = 0; } } if (hitEnemy == true) { unitAttributes.Heal(healingAmount); } hitEnemy = false; }
private void Update() { if (!ReInput.isReady) { return; } if (!initialized) { nekoyuPlayer = ReInput.players.GetPlayer(playerID); } if (BuffSkill.isBuffed == true && isBuffed == false) { isBuffed = true; } if (BuffSkill.isBuffed == false && isBuffed == true) { isBuffed = false; } if (isBuffed && hitEnemy) { if (unitAttributes.CurrentHealth < unitAttributes.BaseMaxHealth) { unitAttributes.Heal(projectileDamage * unitAttributes.DamageOutputFactorMultiplier * BuffSkill.lifestealAmount); } hitEnemy = false; } characterAnimator = GetComponent <Animator>(); if (currentProjectileCooldown > 0) { currentProjectileCooldown -= Time.deltaTime; } //if (Input.GetKeyDown(KeyCode.C) && currentProjectileCooldown <= 0) { if (nekoyuPlayer.GetButton("Fire") && currentProjectileCooldown <= 0) { NekoyuInput.attacking = true; FireProjectile(); StartCoroutine("postAttackDelay"); currentProjectileCooldown = projectileCooldown; } }
private void Update() { if (!ReInput.isReady) { return; } if (!initialized) { nekoyuPlayer = ReInput.players.GetPlayer(playerID); } if (BuffSkill.isBuffed == true && isBuffed == false) { isBuffed = true; } if (BuffSkill.isBuffed == false && isBuffed == true) { isBuffed = false; } if (isBuffed && hitEnemy) { if (unitAttributes.CurrentHealth < unitAttributes.BaseMaxHealth) { unitAttributes.Heal(projectileDamage * unitAttributes.DamageOutputFactorMultiplier * BuffSkill.lifestealAmount); } hitEnemy = false; } characterAnimator = GetComponent <Animator> (); if (nearProjectileCooldown > 0) { nearProjectileCooldown -= Time.deltaTime; } if (mediumProjectileCooldown > 0) { mediumProjectileCooldown -= Time.deltaTime; } if (farProjectileCooldown > 0) { farProjectileCooldown -= Time.deltaTime; } if (nekoyuPlayer.GetButton("Up Button") && nearProjectileCooldown <= 0 && NekoyuInput.attacking != true) { NekoyuInput.attacking = true; characterAnimator.Play("Spellswipe", 0, 0f); nearProjectileCooldown = projectileCooldown; currentNearIndicator = nearIndicator.position; currentNearPivot = nearPivot.position; StartCoroutine("NearProjectile"); } if (nekoyuPlayer.GetButton("R Bumper") && mediumProjectileCooldown <= 0 && NekoyuInput.attacking != true) { NekoyuInput.attacking = true; characterAnimator.Play("Spellswipe", 0, 0f); mediumProjectileCooldown = projectileCooldown; currentMediumIndicator = mediumIndicator.position; currentMediumPivot = mediumPivot.position; StartCoroutine("MediumProjectile"); } if (nekoyuPlayer.GetButton("RT Fire") && farProjectileCooldown <= 0 && NekoyuInput.attacking != true) { NekoyuInput.attacking = true; characterAnimator.Play("Spellswipe", 0, 0f); farProjectileCooldown = projectileCooldown; currentFarIndicator = farIndicator.position; currentFarPivot = farPivot.position; StartCoroutine("FarProjectile"); } }