private IEnumerator TertiaryA() { PlaySound(); if (neutral) { neutral = false; float startup = .4f; float active = .6f; float recovery = .1f; yield return(new WaitForSeconds(startup)); //turn hitbox on. bigMelee.Activate(); yield return(new WaitForSeconds(active)); //hitbox off bigMelee.Deactivate(); yield return(new WaitForSeconds(recovery)); neutral = true; yield return(null); } else { yield return(null); } }
public void AdvanceTime() { IScheduleable scheduleable = SchedulingSystem.Get(); if (scheduleable is Player) { IsPlayerTurn = true; } else if (scheduleable is Attack) { Attack attack = scheduleable as Attack; attack.Activate(); AdvanceTime(); } else if (scheduleable is Monster) { Monster monster = scheduleable as Monster; monster.Activate(); SchedulingSystem.Add(monster); AdvanceTime(); } else if (scheduleable is Update) { Update update = scheduleable as Update; update.Activate(); SchedulingSystem.Add(update); AdvanceTime(); } }
IEnumerator Swing() { anim.SetBool("Attack", true); attack.Activate(); yield return(new WaitForSeconds(liveTime)); anim.SetBool("Attack", false); attack.Deactivate(); }
public void OnAttack(int id) { if (id >= 0 && id < attacks.Length) { currentAttack = attacks[id]; currentAttack.Activate(wielder); } else { throw new System.ArgumentOutOfRangeException("id", "Attack with ID " + id.ToString() + " does not exist on weapon " + this.ToString()); } }
public virtual void StartAttack(AttackDirection direction, AttackTrigger trigger) { // if we're attacking and can't cancel, then return if (isAttacking && !canCancel) { return; } // get the movement controller state AttackPositionState state; if (movementControl.isJumping || movementControl.isFalling) { state = AttackPositionState.Air; } else if (movementControl.isDashing) { state = AttackPositionState.Dash; } else { state = AttackPositionState.Neutral; } if (InputAttackData[state][direction][trigger].Count != 0) { if (isAttacking && InputAttackData[state][direction][trigger].ContainsKey(currentAttack.attackID)) { // go to the combo action this combination is associated with currentAttack = InputAttackData[state][direction][trigger][currentAttack.attackID]; } else if (InputAttackData[state][direction][trigger].ContainsKey("")) { // go to the non-combo action this combination is associated with currentAttack = InputAttackData[state][direction][trigger][""]; } else { // there is no attack available for this attack, return return; } // start the attack isAttacking = true; canCancel = false; currentAttack.Activate(); } }
public bool AttackInput() => Attack.Activate(Attack.InputFunction(Key));