public override void ResetAbility() { base.ResetAbility(); KnotToHand = false; Bow = null; isHolding = false; }
/// <summary>Updates the BowKnot position in the center of the hand if is active</summary> protected void BowKnotInHand() { if (KnotToHand) { Bow = RC.ActiveWeapon as IBow; //Store the Bow Bow.KNot.position = RC.Weapon_is_RightHand ? RC.LeftHand.TransformPoint(LeftArrowTail) : RC.RightHand.TransformPoint(RightArrowTail); } }
/// <summary>Put the Bow Knot to the fingers Hand This is called for the Animator </summary> public virtual void BowKnotToHand(bool enabled) { Bow = RC.ActiveWeapon as IBow; //Store the Bow KnotToHand = enabled; if (!KnotToHand && Bow != null) { Bow.RestoreKnot(); } }
public string Execute() { string type = args[0]; string name = args[1]; IBow bow = bowFactory.CreateBow(type, name); if (bow != null) { this.bows.Enqueue(bow); return($"Successfully added {name} of type: {type}"); } return("Invalid bow type!"); }
/// <summary> /// Bow Attack Mode /// </summary> protected virtual void BowAttack(IBow Bow) { if (RC.IsAiming) //Shoot arrows only when is aiming { bool isInRange = RC.Active_IMWeapon.RightHand ? RC.HorizontalAngle <0.5f : RC.HorizontalAngle> -0.5f; //Calculate the Imposible range to shoot if (!isInRange) { isHolding = false; HoldTime = 0; return; } if (RC.InputAttack1.GetInput && !isHolding) //If Attack is pressed Start Bending for more Strength the Bow { RC.SetAction(WeaponActions.Hold); isHolding = true; HoldTime = 0; } if (RC.InputAttack1.GetInput && isHolding) // //If Attack is pressed Continue Bending the Bow for more Strength the Bow { HoldTime += Time.deltaTime; if (HoldTime <= Bow.HoldTime + Time.deltaTime) { Bow.BendBow(HoldTime / Bow.HoldTime); //Bend the Bow } RC.Anim.SetFloat(Hash.IDFloat, HoldTime / Bow.HoldTime); } if (!RC.InputAttack1.GetInput && isHolding) //If Attack is Release Go to next Action and release the Proyectile { var Knot = Bow.KNot; Knot.rotation = Quaternion.LookRotation(RC.AimDirection); //Alingns the Knot and Arrow to the AIM DIRECTION before Releasing the Arrow RC.SetAction(WeaponActions.Fire_Proyectile); //Go to Action FireProyectile isHolding = false; HoldTime = 0; RC.Anim.SetFloat(Hash.IDFloat, 0); //Reset Hold Animator Values Bow.ReleaseArrow(RC.AimDirection); Bow.BendBow(0); RC.OnAttack.Invoke(RC.Active_IMWeapon); //Invoke the On Attack Event } } }
/// <summary> If Attack is Released Go to next Action and release the Proyectile</summary> private void ReleaseArrow() { if (RC.Aim && RC.WeaponAction != WA.Fire_Proyectile && isHolding) //If we are not firing any arrow then try to Attack with the bow { Bow = RC.ActiveWeapon as IBow; //Store the Bow var Knot = Bow.KNot; Knot.rotation = Quaternion.LookRotation(RC.AimDirection); //Aligns the Knot and Arrow to the AIM DIRECTION before Releasing the Arrow RC.WeaponAction = WA.Fire_Proyectile; //Go to Action FireProyectile isHolding = false; HoldTime = 0; Bow.ReleaseArrow(RC.AimDirection); Bow.BendBow(0); Anim.SetFloat(RC.Hash_WHold, 0); //Reset Hold Animator Values RC.OnAttack.Invoke(RC.ActiveWeapon); //Invoke the On Attack Event } }
/// <summary>Bow Attack Mode</summary> protected virtual void BowHold() { if (RC.Aim && RC.WeaponAction != WA.Fire_Proyectile) //Shoot arrows only when is aiming and If we are notalready firing any arrow { Bow = RC.ActiveWeapon as IBow; //Store the Bow bool isInRange = RC.Weapon_is_RightHand ? RC.HorizontalAngle <0.5f : RC.HorizontalAngle> -0.5f; //Calculate the Imposible range to shoot if (!isInRange) { isHolding = false; HoldTime = 0; return; } if (!isHolding) //If Attack is pressed Start Bending for more Strength the Bow { RC.WeaponAction = WA.Hold; isHolding = true; HoldTime = 0; } else // //If Attack is pressed Continue Bending the Bow for more Strength the Bow { HoldTime += Time.deltaTime; var NormalizedTensionBow = TensionCurve.Evaluate(HoldTime / Bow.HoldTime); var NormalizedTensionArm = Mathf.Clamp(NormalizedTensionBow, 0, MaxArmTension); if (HoldTime <= Bow.HoldTime + Time.deltaTime) { Bow.BendBow(NormalizedTensionBow); //Bend the Bow } Anim.SetFloat(RC.Hash_WHold, NormalizedTensionArm); } } }
public override void ActivateAbility() { Bow = RC.Active_IMWeapon as IBow; //Store the Bow }
public override void ResetAbility() { KnotToHand = false; Bow = null; }
public override Transform AimRayOrigin() { Bow = RC.ActiveWeapon as IBow; return(Bow.KNot); }
/// <summary>This is Called by the Animator </summary> public virtual void EquipArrow() { Bow = RC.ActiveWeapon as IBow; //Store the Bow Bow.EquipArrow(); }
public virtual void EquipArrow() { IBow Bow = RC.Active_IMWeapon as IBow; Bow.EquipArrow(); }
public IHunter CreateHunter(IBow bow, IKnife knife) { return(new Hunter(bow, knife)); }