void InitWeaponManager() { if (inv_manager.lh == null && inv_manager.rh == null) { return; } if (inv_manager.rh != null) { WeaponManager.ActionContainer rb = w_manager.GetAction(InputType.rb); rb.action = inv_manager.rh.w_actual.GetAction(InputType.rb); rb.isMirrored = false; WeaponManager.ActionContainer rt = w_manager.GetAction(InputType.rt); rt.action = inv_manager.rh.w_actual.GetAction(InputType.rt); rt.isMirrored = false; if (inv_manager.lh == null) { WeaponManager.ActionContainer lb = w_manager.GetAction(InputType.lb); lb.action = inv_manager.rh.w_actual.GetAction(InputType.lb); lb.isMirrored = false; WeaponManager.ActionContainer lt = w_manager.GetAction(InputType.lt); lt.action = inv_manager.rh.w_actual.GetAction(InputType.lt); lt.isMirrored = false; } else { WeaponManager.ActionContainer lb = w_manager.GetAction(InputType.lb); lb.action = inv_manager.lh.w_actual.GetAction(InputType.rb); lb.isMirrored = true; WeaponManager.ActionContainer lt = w_manager.GetAction(InputType.lt); lt.action = inv_manager.lh.w_actual.GetAction(InputType.rt); lt.isMirrored = true; } return; } if (inv_manager.lh != null) { WeaponManager.ActionContainer rb = w_manager.GetAction(InputType.rb); rb.action = inv_manager.lh.w_actual.GetAction(InputType.rb); rb.isMirrored = true; WeaponManager.ActionContainer rt = w_manager.GetAction(InputType.rt); rt.action = inv_manager.lh.w_actual.GetAction(InputType.rt); rt.isMirrored = true; WeaponManager.ActionContainer lb = w_manager.GetAction(InputType.lb); lb.action = inv_manager.lh.w_actual.GetAction(InputType.lb); lb.isMirrored = false; WeaponManager.ActionContainer lt = w_manager.GetAction(InputType.lt); lt.action = inv_manager.lh.w_actual.GetAction(InputType.lt); lt.isMirrored = false; } }
void PlayAttackAction(WeaponManager.ActionContainer a, AttackAction aa) { anim.SetBool(StaticStrings.mirror, a.isMirrored); PlayInteractAnimation(aa.attack_anim.value); if (aa.changeSpeed) { anim.SetFloat("speed", aa.animSpeed); } ChangeState(CharState.overrideLayerInteracting); }
WeaponManager.ActionContainer GetActionContainer(InputType inp) { WeaponManager.ActionContainer ac = w_manager.GetAction(inp); if (ac == null) { return(null); } return(ac); }
bool CheckForInteractionInput() { WeaponManager.ActionContainer a = null; if (inp.rb) { a = GetActionContainer(InputType.rb); if (a.action != null) { if (a.action.action_obj != null) { HandleAction(a); return(true); } } } if (inp.rt) { a = GetActionContainer(InputType.rt); if (a.action != null) { if (a.action.action_obj != null) { HandleAction(a); return(true); } } } if (inp.lb) { a = GetActionContainer(InputType.lb); if (a.action != null) { if (a.action.action_obj != null) { HandleAction(a); return(true); } } } if (inp.lt) { a = GetActionContainer(InputType.lt); if (a.action != null) { if (a.action.action_obj != null) { HandleAction(a); return(true); } } } return(false); }
void HandleAction(WeaponManager.ActionContainer a) { switch (a.action.actionType) { case ActionType.attack: AttackAction aa = (AttackAction)a.action.action_obj; PlayAttackAction(a, aa); break; case ActionType.block: break; case ActionType.spell: break; case ActionType.parry: break; default: break; } }