public override void PerformSmash_2_1() { // The attackTimerCounter measures the time since the combo has been started. If it's zero, then // the attack needs to be initialized. if (H_attackTimeCounter < Utils.eps) { // Begin the animation H_animator.SetInteger("AnimationState", 21); // Measure the elapsed time. H_attackTimeCounter += Time.deltaTime; // These boolean variables describe the state the character is in. H_ObjectState = ObjectState.Smashing; H_canAction = false; H_canDash = false; H_inputNextAttack = false; H_inputNextSmash = false; // Build Up } else if (H_attackTimeCounter <= 0.35F) { H_attackTimeCounter += Time.deltaTime; // The player cannot move, but he can dash out or continue the combo. } else if (H_attackTimeCounter <= 0.7F) { H_attackTimeCounter += Time.deltaTime; // Initialize the attack. if (!H_hasAttacked) { P_currentAttack = Instantiate(P_attack) as AttackObject; BeginAttackState(ref P_currentAttack, 0.15F, 0.6F, 0.3F); P_currentAttack.Scale(0.15F, 1.4F); P_currentAttack.RotateAroundParent(10F, 130F, 0.15F, H_objectDirection, 0.3F); // Spawn a second attack. P_currentAttack = Instantiate(P_attack) as AttackObject; BeginAttackState(ref P_currentAttack, 0.15F, 0.6F, 0.3F); P_currentAttack.Scale(0.15F, 1.4F); P_currentAttack.RotateAroundParent(-10F, -130F, 0.15F, H_objectDirection, 0.3F); H_hasAttacked = true; } } else { ResetAttackState(); } }
//Overrides for generic attacks. public override void PerformAttack_1() { if (H_attackTimeCounter < Utils.eps) { // Begin the animation H_animator.SetInteger("AnimationState", 1); // Measure the elapsed time. H_attackTimeCounter += Time.deltaTime; // These boolean variables describe the state the object is in. H_ObjectState = ObjectState.Attacking; H_canAction = false; H_canDash = false; // Do nothing } else if (H_attackTimeCounter <= 1.05F) { H_attackTimeCounter += Time.deltaTime; } else if (H_attackTimeCounter <= 1.5F) { H_attackTimeCounter += Time.deltaTime; // Initialize the attack. if (!H_hasAttacked) { P_currentAttack = Instantiate(P_attack) as AttackObject; BeginAttackState(ref P_currentAttack, 0.2F, 0.2F); Move(H_objectDirection, 1.0F, 0.2F); P_currentAttack.Scale(0.2F, 1.0F); H_hasAttacked = true; } } else if (H_attackTimeCounter <= 1.75F) { // Initiates another attack, move the combo count up and destroy the current attack. H_attackCount = 1; H_attackTimeCounter = 0.0F; P_currentAttack.endAttack(); H_hasAttacked = false; H_canAction = true; } else { ResetAttackState(); } }
public override void PerformSmash_1_1() { // The attackTimerCounter measures the time since the combo has been started. If it's zero, then // the attack needs to be initialized. if (H_attackTimeCounter < Utils.eps) { // Begin the animation H_animator.SetInteger("AnimationState", 11); // Measure the elapsed time. H_attackTimeCounter += Time.deltaTime; // These boolean variables describe the state the character is in. H_ObjectState = ObjectState.Smashing; H_canAction = false; H_canDash = false; H_inputNextAttack = false; H_inputNextSmash = false; P_currentAttack = Instantiate(P_attack) as AttackObject; BeginAttackState(ref P_currentAttack, 0.2F, 0.2F, 0.5F); P_currentAttack.Scale(0.8F, 0.8F); P_currentAttack.RotateAroundParent(0F, 15F, 0F, H_objectDirection, 0.5F); gameObject.AddComponent <LifeDrain>(); P_currentAttack.AddStatusEffect(0F, gameObject.GetComponent <LifeDrain>(), 0.5F); H_hasAttacked = true; // Build Up } else if (H_attackTimeCounter <= 0.45F) { H_attackTimeCounter += Time.deltaTime; H_canDash = true; // The player cannot move, but he can dash out or continue the combo. } else if (H_attackTimeCounter <= 0.7F) { H_attackTimeCounter += Time.deltaTime; } else { ResetAttackState(); } }
//Overrides for generic attacks. public override void PerformSmash_3_1() { if (H_attackTimeCounter < Utils.eps) { // Begin the animation H_animator.SetInteger("AnimationState", 11); // Measure the elapsed time. H_attackTimeCounter += Time.deltaTime; // These boolean variables describe the state the object is in. H_canAction = false; H_canDash = false; // Do nothing } else if (H_attackTimeCounter <= 1.05F) { H_attackTimeCounter += Time.deltaTime; } else if (H_attackTimeCounter <= 1.75F) { H_attackTimeCounter += Time.deltaTime; // Initialize the attack. if (!H_hasAttacked) { P_currentAttack = Instantiate(P_attack) as AttackObject; BeginAttackState(ref P_currentAttack, 0.2F, 0.35F); gameObject.AddComponent <Poison>(); P_currentAttack.AddStatusEffect(5F, gameObject.GetComponent <Poison>(), 0.1F); Move(H_objectDirection, 4.0F, 0.2F); P_currentAttack.Scale(0.6F, 1.5F); H_hasAttacked = true; } H_canAction = true; } else { ResetAttackState(); } }
public override void PerformAttack_1() { // The attackTimerCounter measures the time since the combo has been started. If it's zero, then // the attack needs to be initialized. if (H_attackTimeCounter < Utils.eps) { // Begin the animation H_animator.SetInteger("AnimationState", 1); // Measure the elapsed time. H_attackTimeCounter += Time.deltaTime; // These boolean variables describe the state the character is in. H_ObjectState = ObjectState.Attacking; H_canAction = false; H_canDash = false; H_inputNextAttack = false; H_inputNextSmash = false; // Build Up } else if (H_attackTimeCounter <= 0.205F) { H_attackTimeCounter += Time.deltaTime; // The player cannot move, but he can dash out or continue the combo. } else if (H_attackTimeCounter <= 0.350F) { H_attackTimeCounter += Time.deltaTime; // Initialize the attack. if (!H_hasAttacked) { // P_currentAttack = Instantiate(P_attack) as AttackObject; P_currentAttack = P_attack; BeginAttackState(ref P_currentAttack, 0.05F, 0.3F); P_currentAttack.Scale(0.4F, 1.3F); H_hasAttacked = true; } // If the player initiates another attack, move the combo count up and destroy the current attack. if (Input.GetMouseButtonDown(0)) { H_inputNextAttack = true; } else if (Input.GetMouseButtonDown(1)) { H_inputNextSmash = true; } H_canDash = true; } else if (H_attackTimeCounter <= 0.45F) { H_attackTimeCounter += Time.deltaTime; if ((H_inputNextAttack || Input.GetMouseButtonDown(0)) && CheckStamina(10)) { H_attackCount = 1; H_attackTimeCounter = 0.0F; P_currentAttack.endAttack(); H_hasAttacked = false; } if ((H_inputNextSmash || Input.GetMouseButtonDown(1)) && CheckStamina(25)) { H_attackCount = 1; H_attackTimeCounter = 0.0F; P_currentAttack.endAttack(); H_hasAttacked = false; H_ObjectState = ObjectState.Smashing; } } else { ResetAttackState(); } }
public override void PerformSmash_3_1() { // The attackTimerCounter measures the time since the combo has been started. If it's zero, then // the attack needs to be initialized. if (H_attackTimeCounter < Utils.eps) { // Begin the animation H_animator.SetInteger("AnimationState", 31); // Measure the elapsed time. H_attackTimeCounter += Time.deltaTime; // These boolean variables describe the state the character is in. H_ObjectState = ObjectState.Smashing; H_canAction = false; H_canDash = false; H_inputNextAttack = false; H_inputNextSmash = false; } else if (H_attackTimeCounter <= 0.3F) { H_attackTimeCounter += Time.deltaTime; // Build Up } else if (H_attackTimeCounter <= 0.5F) { H_attackTimeCounter += Time.deltaTime; if (!H_hasAttacked) { P_currentAttack = Instantiate(P_attack) as AttackObject; BeginAttackState(ref P_currentAttack, 0.1F, 0.5F, 0.5F); P_currentAttack.Scale(0.6F, 1.2F); H_hasAttacked = true; } if (Input.GetMouseButtonDown(1)) { H_inputNextSmash = true; } } else if (H_attackTimeCounter <= 1.4F && H_inputNextSmash) { H_attackTimeCounter += Time.deltaTime; if (H_hasAttacked) { if (CheckStamina(40)) { P_currentAttack = Instantiate(P_attack) as AttackObject; BeginAttackState(ref P_currentAttack, 0.2F, 0.2F, 0.8F); P_currentAttack.Scale(3.5F, 1.6F); } H_hasAttacked = false; } H_canDash = true; } else if (H_attackTimeCounter <= 0.8F) { H_attackTimeCounter += Time.deltaTime; } else { ResetAttackState(); } }