protected override bool _TryReact(MAnimal animal) { var mode = animal.Mode_Get(ID); if (mode == null || ID == null) { return(false); } switch (type) { case Mode_Reaction.Activate: return(animal.Mode_TryActivate(ID, AbilityIndex)); case Mode_Reaction.Interrupt: if (animal.ActiveMode.ID == ID) { animal.Mode_Interrupt(); return(true); } return(false); case Mode_Reaction.SetActiveIndex: mode.AbilityIndex = AbilityIndex; return(true); case Mode_Reaction.ResetActiveIndex: mode.ResetAbilityIndex(); return(true); case Mode_Reaction.Enable: animal.Mode_Enable(ID); return(true); case Mode_Reaction.Disable: animal.Mode_Disable(ID); return(true); case Mode_Reaction.CoolDown: mode.CoolDown.Value = coolDown; return(true); case Mode_Reaction.ForceActivate: animal.Mode_ForceActivate(ID, AbilityIndex); return(true); case Mode_Reaction.ActivateContinuously: animal.InputMode = mode; animal.InputMode.InputValue = true; return(animal.Mode_TryActivate(ID, AbilityIndex)); case Mode_Reaction.Stop: animal.Mode_Stop(); return(true); default: return(false); } }
public void PlayMode(MAnimal animal) { animal.Mode_TryActivate(modeID, AbilityID); }
protected override bool _TryReact(MAnimal animal) { var mode = animal.Mode_Get(ID); if (mode == null || ID == null) { return(false); } switch (type) { case Mode_Reaction.Activate: return(animal.Mode_TryActivate(ID, AbilityIndex, abilityStatus, AbilityTime)); case Mode_Reaction.Interrupt: if (animal.ActiveMode.ID == ID) { animal.Mode_Interrupt(); return(true); } return(false); case Mode_Reaction.SetActiveIndex: mode.SetAbilityIndex(AbilityIndex); return(true); case Mode_Reaction.ResetActiveIndex: mode.ResetAbilityIndex(); return(true); case Mode_Reaction.Enable: animal.Mode_Enable(ID); return(true); case Mode_Reaction.Disable: animal.Mode_Disable(ID); return(true); case Mode_Reaction.CoolDown: mode.CoolDown.Value = coolDown; return(true); case Mode_Reaction.ForceActivate: animal.Mode_ForceActivate(ID, AbilityIndex); return(true); case Mode_Reaction.ActivateForever: return(animal.Mode_TryActivate(ID, AbilityIndex, AbilityStatus.Forever)); case Mode_Reaction.Stop: animal.Mode_Stop(); return(true); case Mode_Reaction.EnableAbility: return(animal.Mode_Ability_Enable(ID, AbilityIndex, true)); case Mode_Reaction.DisableAbility: return(animal.Mode_Ability_Enable(ID, AbilityIndex, false)); default: return(false); } }
protected override void _React(MAnimal animal) { var mode = animal.Mode_Get(ID); if (mode == null || ID == null) { return; } switch (type) { case Mode_Reaction.Activate: animal.Mode_Activate(ID, AbilityIndex); break; case Mode_Reaction.Interrupt: if (animal.ActiveMode.ID == ID) { animal.Mode_Interrupt(); } break; case Mode_Reaction.SetActiveIndex: mode.AbilityIndex = AbilityIndex; break; case Mode_Reaction.ResetActiveIndex: mode.ResetAbilityIndex(); break; case Mode_Reaction.Enable: animal.Mode_Enable(ID); break; case Mode_Reaction.Disable: animal.Mode_Disable(ID); break; case Mode_Reaction.CoolDown: mode.CoolDown.Value = coolDown; break; case Mode_Reaction.ForceActivate: animal.Mode_ForceActivate(ID, AbilityIndex); break; case Mode_Reaction.ActivateContinuously: animal.Mode_TryActivate(ID, AbilityIndex); animal.InputMode = mode; animal.InputMode.InputValue = true; Debug.Log("ActivateContinuously"); break; case Mode_Reaction.Stop: animal.Mode_Stop(); break; default: break; } }