public FrmAction() { InitializeComponent(); // actionManager = new ActionManager(); }
public UdpClient(ActionManagerBuilder builder, IUdpClientState state) { state.Client = this; _manager = builder.Build(state); Init(new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)); }
/// <summary> /// Populates the specified shell with sub-menus. /// </summary> /// <param name="manager"></param> /// <param name="shell">The shell.</param> public void Populate( ActionManager manager, MenuShell shell) { // Get the action associated with this. Action action = manager.GetAction(ActionName); MenuItem menuItem; if (action == null) { // Create a placeholder menu item. menuItem = new MenuItem("<Unknown Action: " + ActionName + ">"); menuItem.Sensitive = false; // Add it to the errors. manager.Messages.Add( new SeverityMessage( Severity.Error, "Could not find action " + ActionName + " to add to menu.")); } else { // Create a menu item from this action. menuItem = new ActionMenuItem(manager, action); } // Add the resulting menu item to the list. shell.Add(menuItem); }
/// <summary> /// Populates the specified shell with sub-menus. /// </summary> /// <param name="manager">The manager.</param> /// <param name="shell">The shell.</param> public void Populate( ActionManager manager, MenuShell shell) { var separator = new MenuItem(); shell.Add(separator); }
public void Start(){ enteredActionPanel = false; outOfSubAttackPanel = true; outOfAttackButton = true; outOfActionPanel = true; playerSelectManager = GameObject.FindObjectOfType<PlayerSelectManager>(); actionManager = GameObject.FindObjectOfType<ActionManager>(); }
// Use this for initialization void Start() { XmasWorldBuilder builder = retreiveBuilderFromMap(); EventManager evtman = new EventManager(); ActionManager actman = new ActionManager(evtman); XmasFactory factory = new GameFactory(actman); engine = new XmasModel(builder, actman, evtman, factory); }
private void StopManager() { Log("Arrêt du manager"); _Manager.Stop(); Log("Suppression du manager"); _Manager.OnLog -= _Manager_OnLog; _Manager = null; }
public virtual void Awake () { curHealth = maxHealth; //curMovementSpeed = maxMovementSpeed; _myTransform = this.transform; actionManager = GetComponent<ActionManager>(); myPhotonView = GetComponent<PhotonView>(); UpdateHitBoxes(); }
private void StartManager() { Log("Création du manager"); tbLog.Clear(); _Manager = new ActionManager(); Log("Démarrage du manager"); _Manager.OnLog += _Manager_OnLog; _Manager.Start(); }
public TransactionBase(ActionManager am) : this() { ActionManager = am; if (am != null) { am.OpenTransaction(this); } }
void Awake() { if (!Instance) { Instance = this; } else { Debug.LogError("ActionManager must be added to just only one gameobject"); } }
public static void InitializeManager() { ActionMgr = ActionManager.GetInstance(); AddonMgr = AddonManager.GetInstance(); SkillMgr = SkillManager.GetInstance(); SpellMgr = SpellManager.GetInstance(); SpecializationMgr = SpecializationManager.GetInstance(); DataMgr = DataManager.GetInstance(); SpawnMgr = SpawnManager.GetInstance(); GossipMgr = GossipManager.GetInstance(); ObjectMgr = ObjectManager.GetInstance(); WorldMgr = WorldManager.GetInstance(); }
void Start() { tree = new BehaviourTree(); teste = new TestBehaviourInstant(this); teste2 = new TestBehaviour5Times(this); sequence = new Sequence(tree); sequence.AddChild(teste); sequence.AddChild(teste2); tree.Insert(sequence, null); manager = new ActionManager(); }
void Start() { motionOrders = motionOrderObjects.motionOrders; actionDemoManager = GameObject.FindObjectOfType<ActionDemoManager> (); actionManager = GameObject.FindObjectOfType<ActionManager> (); reaction = GameObject.FindObjectOfType <Reaction>(); timeManager = GameObject.FindObjectOfType <TimeGaugeManager> (); GameObject musicPlayer = GameObject.FindObjectOfType<StageDirector> ().GetMusicPlayer (); music = musicPlayer.transform.FindChild ("Main").GetComponent<AudioSource>(); actionCheck = false; resultLoaded = false; GameManager.Instance.ResetScore (); }
protected virtual void Init() { canvas = Canvas.FindObjectOfType<Canvas>(); canvasManager = canvas.GetComponent<CanvasManager>(); //WorldInterface.CreateGameWorld(worldSize); worldInterface = WorldInterface.CreateWorldInterface(worldSize); pointObjectManager = PointObjectManager.CreatePointObjectManager(); actionManager = gameObject.AddComponent<ActionManager>(); workManager = gameObject.AddComponent<WorkManager>(); pathFinder = new Pathfinder(); if (buildStartArea) { BuildStartArea(); } }
public void involuntaryReveal(Vector2 blipPosition, ActionManager actionManager, Dictionary<Unit, List<Vector2>> prevLoS) { //Set the initial values Unit blip = null; if (gameController.gameMap.isOccupied (blipPosition)) { blip = gameController.gameMap.getOccupant(blipPosition); } numberOfGS = blip.noOfGS; numberOfGSToPlace = numberOfGS; currentlyRevealing = true; centralPosition = blipPosition; involuntary = true; blipActed = blip.AP < UnitData.getMaxAP (Game.EntityType.Blip); gameController.changeGameState (Game.GameState.Reveal); this.actionManager = actionManager; //Reselect the unit to make the buttons unavailable if (gameController.unitSelected) { gameController.selectUnit (gameController.selectedUnit.gameObject); } selectableSquares = findSelectableSquares (prevLoS); //Override number of genestealers if not enough square if (selectableSquares.Count < numberOfGSToPlace) { numberOfGSToPlace = selectableSquares.Count; } //Show the reveal gameController.ioModule.removeUnit (blipPosition); gameController.gameMap.removeUnit (blipPosition); inputHandler.revealing (blipPosition, selectableSquares); }
void Start () { if (entityComponent == null) entityComponent = transform.parent.parent.GetComponent<EntityComponent>(); if (actionManager == null) actionManager = transform.parent.parent.FindChild("Attack").GetComponent<ActionManager>(); if (mySprite == null) mySprite = this.GetComponent<tk2dAnimatedSprite>(); //Attach ourselves to the relevant events entityComponent.onEntityDeath += HandleOnEntityDeath; entityComponent.onEntityDestroyed += HandleOnEntityDestroyed; if (actionManager != null) { actionManager.OnChargingActionEvent += HandleOnChargingActionEvent; actionManager.OnPerformingActionEvent += HandleOnActionEvent; actionManager.OnTargetHitEvent += HandleOnTargetHitEvent; } prevFacing = Facing.Right; playingIdleAnim = true; playingWalkAnim = false; playingEventAnim = false; mySprite.animationCompleteDelegate = OnAnimationComplete; mySprite.animationEventDelegate = OnAnimationEvent; //When the Entity moves we want to play the movement animation //When the Entity does a pre/during/post attack we want to play the pre/during/post attack animation //We'll have to check every once in a while to see if the entity is moving or not in Update and change the animation accordingly //while also keeping track of the fact that we don't want to co-opt other animations currently playing. }
public static async Task <bool> Run() { #region Spell Filters /// Spellcast Filter (法术过滤器) :: Fetters :: 脚镣 HashSet <uint> Fetters = new HashSet <uint>() { 292, 504, 510, 667, 668, 770, 800, 822, 901, 930, 990, 1010, 1055, 1153, 1258, 1391, 1399, 1460, 1477, 1497, 1614, 1726, 1757, 1849, 1908 }; bool ChainsUp = GameObjectManager.GetObjectsOfType <BattleCharacter>(true, false).Where(obj => Fetters.Any(r => obj.HasAura(r))).Count() > 0; /// 15602, 15609 :: Heretic's Fork /// 15814, 16850 :: Thumbscrew /// 15815, 16852 :: Wooden Horse /// 15816, 16851 :: Gibbet Cage /// 15817, 15820 :: Brazen Bull /// 15818 :: Executioner's Sword /// 15819 :: Light Shot /// 15822, 15886, 17552 :: Heretic's Fork /// 15834, 15835, 15836, 15837, 15838, 15839 :: Fierce Beating /// 15840, 15841 :: Cat o' Nine Tails /// 15843, 16765 :: Sickly Inferno /// 15845, 17232 :: Into the Light /// 15846 :: Right Knout /// 15847 :: Left Knout /// 15848, 15849 :: Aethersup /// 16779, 16780, 16781, 16782 :: Land Rune HashSet <uint> Spells = new HashSet <uint>() { 15602, 15609, 15814, 15815, 15816, 15817, 15818, 15819, 15820, 15822, 15834, 15835, 15836, 15837, 15838, 15839, 15840, 15841, 15843, 15845, 15846, 15847, 15848, 15849, 15886, 16765, 16779, 16780, 16781, 16782, 16850, 16851, 16852, 17232, 17552 }; #endregion #region Custom Mechanics /// Tesleen, the Forgiven (得到宽恕的泰丝琳) /// 15826, 15827 :: Exorcise :: 傩 HashSet <uint> Exorcise = new HashSet <uint>() { 15826, 15827 }; if (Exorcise.IsCasting()) { Vector3 _loc = new Vector3("78.77, 0, -82.18"); if (Core.Me.Distance(_loc) > 1f && Core.Me.IsCasting) { ActionManager.StopCasting(); } while (Core.Me.Distance(_loc) > 1f) { await CommonTasks.MoveTo(_loc); await Coroutine.Yield(); } Navigator.PlayerMover.MoveStop(); await Coroutine.Sleep(6000); Stopwatch sw = new Stopwatch(); sw.Start(); while (sw.ElapsedMilliseconds < 15000) { await Helpers.GetClosestAlly.Follow(7f); await Coroutine.Yield(); } sw.Stop(); } /// Philia (斐利亚) /// 15833, 16777, 16790 :: Pendulum :: 钟摆 /// 15842, 16769 :: Taphephobia :: 恐惧症 HashSet <uint> Pendulum = new HashSet <uint>() { 15833, 15842, 16769, 16777, 16790 }; if (Pendulum.IsCasting()) { Vector3 _loc = new Vector3("117.1188,23,-474.0881"); if (Core.Me.Distance(_loc) > 1 && Core.Me.IsCasting) { ActionManager.StopCasting(); } while (Core.Me.Distance(_loc) > 1f) { await CommonTasks.MoveTo(_loc); await Coroutine.Yield(); } await CommonTasks.StopMoving(); await Coroutine.Sleep(3000); } #endregion /// Default (缺省) if (Spells.IsCasting(!ChainsUp)) { await Helpers.GetClosestAlly.Follow(); } /// SideStep (回避) Helpers.BossIds.ToggleSideStep(); return(false); }
public static async Task <bool> Moulinet() { if (!RedMageSettings.Instance.UseMelee) { return(false); } if (!RedMageSettings.Instance.Moulinet) { return(false); } if (BlackMana < 20 || WhiteMana < 20) { return(false); } if (Combat.Enemies.Count(r => r.InView() && r.Distance(Core.Me) <= 6 + r.CombatReach) < RedMageSettings.Instance.MoulinetEnemies) { return(false); } if (Combat.Enemies.Count(r => r.InView() && r.Distance(Core.Me) <= 6 + r.CombatReach) >= 4 && BlackMana >= 50 && WhiteMana >= 50 && Spells.Manafication.Cooldown == TimeSpan.Zero && RedMageSettings.Instance.Manafication) { Logger.Error("Bursting Moulinet"); SpellQueueLogic.SpellQueue.Clear(); SpellQueueLogic.Timeout.Start(); SpellQueueLogic.CancelSpellQueue = () => SpellQueueLogic.Timeout.ElapsedMilliseconds > 18000; if (BlackMana >= 90 && WhiteMana >= 90 && RedMageSettings.Instance.Embolden) { SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Embolden, TargetSelf = true, Wait = new QueueSpellWait() { Name = "Wait for Embolden", Check = () => ActionManager.CanCast(Spells.Embolden, null), WaitTime = 1500, EndQueueIfWaitFailed = true }, }); } while (BlackMana >= 70 && WhiteMana >= 70) { SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Moulinet, Wait = new QueueSpellWait() { Name = "Wait for Moulinet", Check = () => ActionManager.CanCast(Spells.Moulinet, null), WaitTime = 1500, EndQueueIfWaitFailed = true }, }); } if (!Core.Me.HasAura(Auras.Manafication)) { SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Manafication, TargetSelf = true, Wait = new QueueSpellWait() { Name = "Wait for Manafication", Check = () => ActionManager.CanCast(Spells.Manafication, null), WaitTime = 1500, EndQueueIfWaitFailed = true }, }); } while (BlackMana >= 20 && WhiteMana >= 20) { SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Moulinet, Wait = new QueueSpellWait() { Name = "Wait for Moulinet", Check = () => ActionManager.CanCast(Spells.Moulinet, null), WaitTime = 1500, EndQueueIfWaitFailed = true }, }); } if (Spells.Swiftcast.Cooldown == TimeSpan.Zero && !Core.Me.HasAura(Auras.Swiftcast)) { SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Swiftcast, TargetSelf = true, Wait = new QueueSpellWait() { Name = "Wait for Swiftcast", Check = () => ActionManager.CanCast(Spells.Swiftcast, null), WaitTime = 1500, EndQueueIfWaitFailed = true }, }); } if (Core.Me.HasAura(Auras.Swiftcast)) { SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Impact, Wait = new QueueSpellWait() { Name = "Wait for Impact", Check = () => ActionManager.CanCast(Spells.Impact, null), WaitTime = 1500, EndQueueIfWaitFailed = true }, }); } else { return(false); } } if (Combat.Enemies.Count(r => r.InView() && r.Distance(Core.Me) <= 6 + r.CombatReach) == 3 && BlackMana >= 90 && WhiteMana >= 90) { SpellQueueLogic.SpellQueue.Enqueue(new QueueSpell { Spell = Spells.Moulinet, Wait = new QueueSpellWait() { Name = "Wait for Moulinet", Check = () => ActionManager.CanCast(Spells.Moulinet, null), WaitTime = 1500, EndQueueIfWaitFailed = true }, }); } return(false); }
/// <summary> /// Initializes a new instance of the <see cref="ActionMenuItem"/> class. /// </summary> /// <param name="manager">The manager.</param> /// <param name="action">The action.</param> public ActionMenuItem( ActionManager manager, Action action) { // Saves the properties. if (manager == null) { throw new ArgumentNullException("manager"); } if (action == null) { throw new ArgumentNullException("action"); } // Attach to the action. this.action = action; action.ConnectProxy(this); // The default menu can't handle the chained accelerators, so we // remove the contents of the menu item and recreate it using a // HBox with a custom label for both. var newChild = new HBox(false, 0); displayLabel = new Label(action.Label); displayLabel.UseUnderline = true; displayLabel.Xalign = 0.0f; displayLabel.Show(); newChild.PackStart(displayLabel); // Get the keybinding label. HierarchicalPath acceleratorPath = manager.GetPrimaryAcceleratorPath(action); if (acceleratorPath != null) { // Get a formatted version of the accelerator path. string display = ActionKeybindings.FormatAcceleratorPath(acceleratorPath); keybindingLabel = new Label(display); keybindingLabel.UseUnderline = false; keybindingLabel.Xalign = 1.0f; keybindingLabel.Show(); newChild.PackStart(keybindingLabel); } // Lay out the contents in the HBox. newChild.Show(); // Remove the old child item and add this. Remove(Child); Add(newChild); // Figure out if we have an icon. if (!String.IsNullOrEmpty(action.StockId)) { IconSet iconSet = Style.LookupIconSet(action.StockId); Pixbuf image = iconSet.RenderIcon( Style, DefaultDirection, State, IconSize.Menu, this, null); var iconImage = new Image(image); Image = iconImage; } }
void Start() { choiceUI = GameObject.Find ("ChoiceUI"); executionUI = GameObject.Find ("ExecutionUI"); player1 = GameObject.Find ("Manager").GetComponent<PlayerOneManager>(); player2 = GameObject.Find ("Manager").GetComponent<PlayerTwoManager>(); pActions = GameObject.Find ("Manager").GetComponent<ActionManager>(); p1Choice1 = GameObject.Find ("p1Choice1"); p1Choice2 = GameObject.Find ("p1Choice2"); p1Choice3 = GameObject.Find ("p1Choice3"); p1Choice1F = GameObject.Find ("p1Choice1F"); p1Choice2F = GameObject.Find ("p1Choice2F"); p1Choice3F = GameObject.Find ("p1Choice3F"); p2Choice1 = GameObject.Find ("p2Choice1"); p2Choice2 = GameObject.Find ("p2Choice2"); p2Choice3 = GameObject.Find ("p2Choice3"); p2Choice1F = GameObject.Find ("p2Choice1F"); p2Choice2F = GameObject.Find ("p2Choice2F"); p2Choice3F = GameObject.Find ("p2Choice3F"); }
private async Task <bool> DarkArts() { if (!Core.Player.HasAura(MySpells.DarkArts.Name)) { // Bloodspiller if (ShinraEx.Settings.DarkKnightBloodspillerArts && Resource.BlackBlood >= 50 && ActionManager.HasSpell(MySpells.Bloodspiller.Name)) { return(await MySpells.DarkArts.Cast()); } if (Core.Player.CurrentManaPercent < 70) { return(false); } // Souleater if (ShinraEx.Settings.DarkKnightSouleaterArts && ActionManager.LastSpell.Name == MySpells.SyphonStrike.Name) { return(await MySpells.DarkArts.Cast()); } // Syphon Strike if (ShinraEx.Settings.TankMode == TankModes.DPS && ActionManager.LastSpell.Name == MySpells.HardSlash.Name && Core.Player.CurrentManaPercent > 90) { return(await MySpells.DarkArts.Cast()); } } return(false); }
public BoolPropertyEditor(IGameFactory factory, ActionManager actions) { _factory = factory; _actions = actions; }
public CallRenameUtil(ActionManager actionManager, ISolution solution, RenameRefactoringService renameRefactoringService) { _actionManager = actionManager; _solution = solution; _renameRefactoringService = renameRefactoringService; }
private void GoToNextLevel() { ActionManager.TriggerEvent(GameEvents.LOAD_NEXT); }
public static async Task <bool> PVPRotation() { if (Target == null || !Target.CanAttack) { return(false); } if (await PvPSpells.FormShift.Use(Me, ActionResourceManager.Monk.GreasedLightning < 3)) { return(true); } if (await PvPSpells.Somersault.Use(Target, PvPSpells.RiddleofFire.Cooldown.TotalMilliseconds < 10000 && ActionResourceManager.Monk.FithChakra < 5 && ActionResourceManager.Monk.GreasedLightning == 3)) { return(true); } if (await PvPSpells.RiddleofFire.Use(Me, ActionResourceManager.Monk.GreasedLightning == 3 && ActionResourceManager.Monk.FithChakra == 5)) { return(true); } if (await PvPSpells.RiddleofWind.Use(Target, true)) { return(true); } if (await PvPSpells.WindTackle.Use(Target, true)) { return(true); } if (await PvPSpells.TheForbiddenChakra.Use(Target, Me.HasMyAura(PvPAuras.EarthsReply) || Me.HasMyAura(PvPAuras.RiddleofFire) || PvPSpells.RiddleofFire.Cooldown.TotalMilliseconds > 10000)) { return(true); } if (await PvPSpells.TornadoKick.Use(Target, Me.HasMyAura(PvPAuras.EarthsReply) || Me.HasMyAura(PvPAuras.RiddleofFire) || PvPSpells.RiddleofFire.Cooldown.TotalMilliseconds > 10000)) { return(true); } if (DateTime.Now < _pvpComboTimer || DateTime.Now < _pvpLimiterTimer) { return(false); } _pvpLimiterTimer = DateTime.Now.AddMilliseconds(500); if (!Target.HasAura(PvPAuras.Demolish, true, 10000) && ActionManager.GetPvPComboCurrentAction(PvPCombos.SnapPunchCombo) == PvPSpells.Bootshine) { var tempCombatHelperLastSpell = ActionManager.GetPvPComboCurrentAction(PvPCombos.DemolishCombo); if (ActionManager.DoPvPCombo(PvPCombos.DemolishCombo, Target)) { CombatHelper.LastSpell = tempCombatHelperLastSpell; Logger.CastMessage(tempCombatHelperLastSpell.LocalizedName, Target.SafeName()); _pvpComboTimer = DateTime.Now.AddMilliseconds(2000); return(true); } } if (ActionManager.GetPvPComboCurrentAction(PvPCombos.DemolishCombo) == PvPSpells.DragonKick) { var tempCombatHelperLastSpell = ActionManager.GetPvPComboCurrentAction(PvPCombos.SnapPunchCombo); if (ActionManager.DoPvPCombo(PvPCombos.SnapPunchCombo, Target)) { CombatHelper.LastSpell = tempCombatHelperLastSpell; Logger.CastMessage(tempCombatHelperLastSpell.LocalizedName, Target.SafeName()); _pvpComboTimer = DateTime.Now.AddMilliseconds(2000); return(true); } } return(false); }
public OnTeam_TargetingCriteria(ActionManager actionManager, Being parentBeing, int team) : base(actionManager, parentBeing) { this.actionManager = actionManager; this.parentBeing = parentBeing; this.team = team; }
private static async Task <bool> MidareSetsugekka() { if ((SenCount() == 3 && Spells.Hagakure.Cooldown.TotalMilliseconds < 5000 && Me.ClassLevel >= 68) || !CyanSettingsModel.Instance.UseIaijutsu || ActionManager.LastSpell == Spells.Iaijutsu || CombatHelper.LastSpell == Spells.Iaijutsu || ActionManager.LastSpell == Spells.Hagakure || CombatHelper.LastSpell == Spells.Hagakure || ActionManager.LastSpell == Spells.ThirdEye || CombatHelper.LastSpell == Spells.ThirdEye) { return(false); } if (!Me.HasAura(Auras.Shifu) || SenCount() < 3 || (Kenki < 20 && Me.ClassLevel > 51) || !Target.HealthCheck(false) || !Target.TimeToDeathCheck()) { return(false); } Logger.CyanLog(@"Entering Midare Setsugekka Method."); if (BotManager.Current.IsAutonomous && MovementManager.IsMoving) { Navigator.PlayerMover.MoveStop(); } var timeOut = new Stopwatch(); timeOut.Start(); var queue = new Queue <SpellData>(); if (CyanSettingsModel.Instance.UseBuffs && Me.ClassLevel >= 52) { queue.Enqueue(Spells.HissatsuKaiten); } while (queue.Count > 0 && timeOut.ElapsedMilliseconds < 3500 && ((Me.HasAura(Auras.Kaiten) || CombatHelper.LastSpell != Spells.Iaijutsu))) { var action = queue.Peek(); Logger.CyanLog(@"Next Attack: {0}", action); await Coroutine.Wait(3000, () => ActionManager.CanCast(action, Target) || ActionManager.CanCast(action, Me)); if (await action.Use(Target, true) || await action.Use(Me, true)) { queue.Dequeue(); continue; } await Coroutine.Yield(); } timeOut.Reset(); await Coroutine.Wait(3000, () => ActionManager.CanCast(Spells.Hakaze, Target)); queue.Clear(); return(false); }
private static async Task <bool> MeikyoShisui() { if ((SenCount() == 3 && ActionManager.CanCast(Spells.Hagakure, Me) && Me.ClassLevel >= 68) || !CyanSettingsModel.Instance.UseIaijutsu || ActionManager.LastSpell == Spells.Hagakure || CombatHelper.LastSpell == Spells.Hagakure) { return(false); } if (Target == null || !Target.CanAttack || (CyanSettingsModel.Instance.UseAoE && Me.EnemiesInRange(6) >= CyanSettingsModel.Instance.MobCount && Me.CurrentTP > CyanSettingsModel.Instance.TpLimit)) { return(false); } if (!CyanSettingsModel.Instance.UseBuffs || !ActionManager.CanCast(Spells.MeikyoShisui, Me) || SenCount() == 3 || CombatHelper.LastSpell != Spells.Hakaze || !Target.HealthCheck(false) || !Target.TimeToDeathCheck()) { return(false); } Logger.CyanLog(@"Entering Meikyo Shisui Method."); if (BotManager.Current.IsAutonomous && MovementManager.IsMoving) { Navigator.PlayerMover.MoveStop(); } var timeOut = new Stopwatch(); timeOut.Start(); var queue = new Queue <SpellData>(); queue.Enqueue(Spells.MeikyoShisui); if (!Sen.HasFlag(Setsu)) { queue.Enqueue(Spells.Yukikaze); } if (!Sen.HasFlag(Ka)) { queue.Enqueue(Spells.Kasha); } if (!Sen.HasFlag(Getsu)) { queue.Enqueue(Spells.Gekko); } if (Spells.Hagakure.Cooldown.TotalSeconds > 5 || Me.ClassLevel < Spells.Hagakure.LevelAcquired || Kenki > 40) { if (CyanSettingsModel.Instance.UseBuffs && Me.ClassLevel >= Spells.HissatsuKaiten.LevelAcquired && (Kenki >= 20 || ((Kenki + (5 * (queue.Count - 1))) >= 20))) { queue.Enqueue(Spells.HissatsuKaiten); } } else if (Me.ClassLevel >= Spells.Hagakure.LevelAcquired && (Kenki + (5 * (queue.Count - 1))) <= 40) { queue.Enqueue(Spells.Hagakure); } while (queue.Count > 0 && timeOut.ElapsedMilliseconds < 12000 && ((Me.HasAura(Auras.Kaiten) || CombatHelper.LastSpell != Spells.Iaijutsu))) { var action = queue.Peek(); await Coroutine.Wait(3000, () => ActionManager.CanCast(action, Target) || ActionManager.CanCast(action, Me)); if (await action.Use(Target, true) || await action.Use(Me, true)) { queue.Dequeue(); continue; } await Coroutine.Yield(); } timeOut.Reset(); await Coroutine.Wait(3000, () => ActionManager.CanCast(Spells.Hakaze, Target)); queue.Clear(); return(false); }
private static async Task <bool> Higanbana() { if (!CyanSettingsModel.Instance.UseDots || !CyanSettingsModel.Instance.UseIaijutsu || Target.HasAura(Auras.Higanbana, true, CyanSettingsModel.Instance.HiganbanaRfsh) || Me.HasAura(Auras.MeikyoShisui) || Spells.MeikyoShisui.Cooldown.TotalMilliseconds == 0 || ActionManager.LastSpell == Spells.Hagakure || CombatHelper.LastSpell == Spells.Hagakure) { return(false); } if (SenCount() != 1 || (Kenki < 20 && Me.ClassLevel > 51) || Me.HasAura(Auras.MeikyoShisui) || Target.CurrentHealthPercent < CyanSettingsModel.Instance.HiganbanaMinHpPct && !Target.IsBoss() && !MainSettingsModel.Instance.DestroyTarget || Target.CurrentHealth < CyanSettingsModel.Instance.HiganbanaMinHpInt && !Target.IsBoss() && !MainSettingsModel.Instance.DestroyTarget) { return(false); } Logger.CyanLog(@"Entering Higanbana Method."); if (BotManager.Current.IsAutonomous && MovementManager.IsMoving) { Navigator.PlayerMover.MoveStop(); } var timeOut = new Stopwatch(); timeOut.Start(); var queue = new Queue <SpellData>(); if (CyanSettingsModel.Instance.UseBuffs && Me.ClassLevel >= 52) { queue.Enqueue(Spells.HissatsuKaiten); } while (queue.Count > 0 && timeOut.ElapsedMilliseconds < 5000 && ((Me.HasAura(Auras.Kaiten) || CombatHelper.LastSpell != Spells.Iaijutsu))) { var action = queue.Peek(); Logger.CyanLog(@"Next Attack: {0}", action); await Coroutine.Wait(3000, () => ActionManager.CanCast(action, Target) || ActionManager.CanCast(action, Me)); if (await action.Use(Target, true) || await action.Use(Me, true)) { queue.Dequeue(); continue; } await Coroutine.Yield(); } timeOut.Reset(); await Coroutine.Wait(3000, () => ActionManager.CanCast(Spells.Hakaze, Target)); queue.Clear(); return(false); }
public TargetCount_ChassisCondition(ActionManager actionManager, int param) : base(actionManager) { this.actionManager = actionManager; this.param = param; }
/// <summary> /// Public constructor. /// </summary> public IntrusionDetector() { this._thresholds = new Dictionary<string, Threshold>(); this._logger = Esapi.Logger; this._actionManager = new ActionManager(); }
public ActionsUI(ClientActionsComponent actionsComponent) { _actionsComponent = actionsComponent; _actionManager = IoCManager.Resolve <ActionManager>(); _entityManager = IoCManager.Resolve <IEntityManager>(); _gameTiming = IoCManager.Resolve <IGameTiming>(); _gameHud = IoCManager.Resolve <IGameHud>(); _menu = new ActionMenu(_actionsComponent, this); LayoutContainer.SetGrowHorizontal(this, LayoutContainer.GrowDirection.End); LayoutContainer.SetGrowVertical(this, LayoutContainer.GrowDirection.End); LayoutContainer.SetAnchorTop(this, 0f); LayoutContainer.SetAnchorBottom(this, 0.8f); LayoutContainer.SetMarginLeft(this, 13); LayoutContainer.SetMarginTop(this, 110); SizeFlagsHorizontal = SizeFlags.None; SizeFlagsVertical = SizeFlags.FillExpand; var resourceCache = IoCManager.Resolve <IResourceCache>(); // everything needs to go within an inner panel container so the panel resizes to fit the elements. // Because ActionsUI is being anchored by layoutcontainer, the hotbar backing would appear too tall // if ActionsUI was the panel container var panelContainer = new PanelContainer() { StyleClasses = { StyleNano.StyleClassHotbarPanel }, SizeFlagsHorizontal = SizeFlags.None, SizeFlagsVertical = SizeFlags.None }; AddChild(panelContainer); var hotbarContainer = new VBoxContainer { SeparationOverride = 3, SizeFlagsHorizontal = SizeFlags.None }; panelContainer.AddChild(hotbarContainer); var settingsContainer = new HBoxContainer { SizeFlagsHorizontal = SizeFlags.FillExpand }; hotbarContainer.AddChild(settingsContainer); settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); _lockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock.svg.png"); _unlockTexture = resourceCache.GetTexture("/Textures/Interface/Nano/lock_open.svg.png"); _lockButton = new TextureButton { TextureNormal = _unlockTexture, SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; settingsContainer.AddChild(_lockButton); settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); _settingsButton = new TextureButton { TextureNormal = resourceCache.GetTexture("/Textures/Interface/Nano/gear.svg.png"), SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; settingsContainer.AddChild(_settingsButton); settingsContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); // this allows a 2 column layout if window gets too small _slotContainer = new GridContainer { MaxHeight = CalcMaxHeight() }; hotbarContainer.AddChild(_slotContainer); _loadoutContainer = new HBoxContainer { SizeFlagsHorizontal = SizeFlags.FillExpand, MouseFilter = MouseFilterMode.Stop }; hotbarContainer.AddChild(_loadoutContainer); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); var previousHotbarIcon = new TextureRect() { Texture = resourceCache.GetTexture("/Textures/Interface/Nano/left_arrow.svg.png"), SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; _loadoutContainer.AddChild(previousHotbarIcon); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); _loadoutNumber = new Label { Text = "1", SizeFlagsStretchRatio = 1 }; _loadoutContainer.AddChild(_loadoutNumber); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 2 }); var nextHotbarIcon = new TextureRect { Texture = resourceCache.GetTexture("/Textures/Interface/Nano/right_arrow.svg.png"), SizeFlagsHorizontal = SizeFlags.ShrinkCenter, SizeFlagsVertical = SizeFlags.ShrinkCenter, SizeFlagsStretchRatio = 1 }; _loadoutContainer.AddChild(nextHotbarIcon); _loadoutContainer.AddChild(new Control { SizeFlagsHorizontal = SizeFlags.FillExpand, SizeFlagsStretchRatio = 1 }); _slots = new ActionSlot[ClientActionsComponent.Slots]; _dragShadow = new TextureRect { CustomMinimumSize = (64, 64), Stretch = TextureRect.StretchMode.Scale, Visible = false }; UserInterfaceManager.PopupRoot.AddChild(_dragShadow); LayoutContainer.SetSize(_dragShadow, (64, 64)); for (byte i = 0; i < ClientActionsComponent.Slots; i++) { var slot = new ActionSlot(this, _menu, actionsComponent, i); _slotContainer.AddChild(slot); _slots[i] = slot; } DragDropHelper = new DragDropHelper <ActionSlot>(OnBeginActionDrag, OnContinueActionDrag, OnEndActionDrag); }
public DiceManager(ActionManager actionManager, BoardGameManager boardGameManager) { _actionManager = actionManager; RegisterDiceActions(boardGameManager); }
public async Task <bool> ExecuteRotation() { StatusText = "SpearFishing items"; var hits = 0; var veteranTrade = false; var identicalGig = false; while (await Coroutine.Wait(4500, () => ActionManager.CanCast(7632, Core.Player) || !Node.IsValid)) { if (BountifulCatch && Core.Player.CurrentGP >= 200 && hits >= 1 && hits <= BountifulCatchDepth && (!BountifulCatchAfterVeteranTrade || veteranTrade)) { await Cast(Abilities.Map[Core.Player.CurrentJob][Ability.BountifulCatch]); } await Coroutine.Sleep(4500); await Cast(Abilities.Map[Core.Player.CurrentJob][Ability.Gig]); while (SelectYesNoItem.IsOpen && Behaviors.ShouldContinue) { await HandleCollectable(); } await Coroutine.Sleep(1000); hits++; Logger.Info(Localization.ExSpearFish_SpearFishing, SpearResult.FishName, SpearResult.IsHighQuality, SpearResult.Size, WorldManager.EorzaTime); if (hits <= IdenticalGigDepth && !identicalGig && !veteranTrade && Items.Any(SpearResult.ShouldKeep) && Core.Player.CurrentGP >= 350 && await Coroutine.Wait(4000, () => ActionManager.CanCast(4591, Core.Player))) { Logger.Info(Localization.ExSpearFish_UsingIdenticalGig, SpearResult.FishName); await Cast(Abilities.Map[Core.Player.CurrentJob][Ability.IdenticalGig]); identicalGig = true; } if (hits > VeteranTradeDepth || identicalGig || veteranTrade || Items.Any(SpearResult.ShouldKeep) || Core.Player.CurrentGP < 200 || !await Coroutine.Wait(4000, () => ActionManager.CanCast(7906, Core.Player))) { continue; } Logger.Info(Localization.ExSpearFish_UsingVeteranTrade, SpearResult.FishName); await Cast(Abilities.Map[Core.Player.CurrentJob][Ability.VeteranTrade]); veteranTrade = true; } StatusText = "SpearFishing items complete"; return(true); }
public static async Task <bool> Adloquium() { if (!ScholarSettings.Instance.Adloquium) { return(false); } if (Globals.InParty) { // If the lowest heal target is higher than Adloquium health, check to see if the user wants us to Galvanize the tank if (ScholarSettings.Instance.AdloquiumTankForBuff && Globals.HealTarget?.CurrentHealthPercent > ScholarSettings.Instance.AdloquiumHpPercent) { // Pick any tank who doesn't have Galvanize on them var tankAdloTarget = Group.CastableAlliesWithin30.FirstOrDefault(r => r.IsTank() && !r.HasAura(Auras.Galvanize)); if (tankAdloTarget == null) { return(false); } await UseRecitation(); return(await Spells.Adloquium.HealAura(tankAdloTarget, Auras.Galvanize, false)); } var adloTarget = Group.CastableAlliesWithin30.FirstOrDefault(CanAdlo); if (adloTarget == null) { return(false); } await UseRecitation(); return(await Spells.Adloquium.HealAura(adloTarget, Auras.Galvanize)); bool CanAdlo(Character unit) { if (unit.CurrentHealthPercent > ScholarSettings.Instance.AdloquiumHpPercent) { return(false); } if (unit.HasAura(Auras.Galvanize)) { return(false); } if (unit.HasAura(Auras.Exogitation)) { return(false); } if (!ScholarSettings.Instance.AdloquiumOnlyHealer && !ScholarSettings.Instance.AdloquiumOnlyTank) { return(true); } if (ScholarSettings.Instance.AdloquiumOnlyHealer && unit.IsHealer()) { return(true); } return(ScholarSettings.Instance.AdloquiumOnlyTank && unit.IsTank()); } } if (Core.Me.CurrentHealthPercent > ScholarSettings.Instance.AdloquiumHpPercent || Core.Me.HasAura(Auras.Galvanize)) { return(false); } return(await Spells.Adloquium.HealAura(Core.Me, Auras.Galvanize)); async Task UseRecitation() { if (!ScholarSettings.Instance.Recitation) { return; } if (!ScholarSettings.Instance.RecitationWithAdlo) { return; } if (ScholarSettings.Instance.RecitationOnlyNoAetherflow && Core.Me.HasAetherflow()) { return; } if (!await Spells.Recitation.Cast(Core.Me)) { return; } if (!await Coroutine.Wait(1000, () => Core.Me.HasAura(Auras.Recitation))) { return; } await Coroutine.Wait(1000, () => ActionManager.CanCast(Spells.Adloquium.Id, Core.Me)); } }
public MultipleNumbersPropertyEditor(ActionManager actions, IGameState state, IGameFactory factory, bool wholeNumbers, bool nullable, Action <InternalNumberEditor, INumberEditorComponent> configureNumberEditor, params (string text, Func <float, T, T> getValue)[] creators) :
public static async Task <bool> Lustrate() { if (!ScholarSettings.Instance.Lustrate) { return(false); } if (!Core.Me.InCombat) { return(false); } if (!Core.Me.HasAetherflow()) { return(false); } if (Group.CastableAlliesWithin15.Count(r => r.CurrentHealthPercent <= ScholarSettings.Instance.IndomitabilityHpPercent) > ScholarSettings.Instance.IndomitabilityNeedHealing) { return(false); } if (Globals.InParty) { var lustrateTarget = Group.CastableAlliesWithin30.FirstOrDefault(CanLustrate); if (lustrateTarget == null) { return(false); } await UseRecitation(); return(await Spells.Lustrate.Cast(lustrateTarget)); } if (Core.Me.HasAura(Auras.Exogitation)) { return(false); } if (Core.Me.CurrentHealthPercent > ScholarSettings.Instance.LustrateHpPercent) { return(false); } await UseRecitation(); return(await Spells.Lustrate.Cast(Core.Me)); bool CanLustrate(Character unit) { if (unit.HasAura(Auras.Exogitation)) { return(false); } if (unit.CurrentHealthPercent > ScholarSettings.Instance.LustrateHpPercent) { return(false); } if (Casting.LastSpellTarget.ObjectId == unit.ObjectId) { if (Casting.LastSpell == Spells.Lustrate || Casting.LastSpell == Spells.Excogitation) { return(false); } } if (!ScholarSettings.Instance.LustrateOnlyHealer && !ScholarSettings.Instance.LustrateOnlyTank) { return(true); } if (ScholarSettings.Instance.LustrateOnlyHealer && unit.IsHealer()) { return(true); } return(ScholarSettings.Instance.LustrateOnlyTank && unit.IsTank()); } async Task UseRecitation() { if (!ScholarSettings.Instance.Recitation) { return; } if (!ScholarSettings.Instance.RecitationWithLustrate) { return; } if (ScholarSettings.Instance.RecitationOnlyNoAetherflow && Core.Me.HasAetherflow()) { return; } if (!await Spells.Recitation.Cast(Core.Me)) { return; } if (!await Coroutine.Wait(1000, () => Core.Me.HasAura(Auras.Recitation))) { return; } await Coroutine.Wait(1000, () => ActionManager.CanCast(Spells.Lustrate.Id, Core.Me)); } }
void Start() { player1 = GameObject.Find ("Manager").GetComponent<PlayerOneManager>(); player2 = GameObject.Find ("Manager").GetComponent<PlayerTwoManager>(); pActions = GameObject.Find ("Manager").GetComponent<ActionManager>(); playerOneSprite = GameObject.FindGameObjectWithTag("player1").transform; playerTwoSprite = GameObject.FindGameObjectWithTag ("player2").transform; //pos1 - pos5 = player one grid left to right pos1 = GameObject.FindGameObjectWithTag ("position1").transform; pos2 = GameObject.FindGameObjectWithTag ("position2").transform; pos3 = GameObject.FindGameObjectWithTag ("position3").transform; pos4 = GameObject.FindGameObjectWithTag ("position4").transform; pos5 = GameObject.FindGameObjectWithTag ("position5").transform; //pos6 - pos10 = player two grid left to right pos6 = GameObject.FindGameObjectWithTag ("position6").transform; pos7 = GameObject.FindGameObjectWithTag ("position7").transform; pos8 = GameObject.FindGameObjectWithTag ("position8").transform; pos9 = GameObject.FindGameObjectWithTag ("position9").transform; pos10 = GameObject.FindGameObjectWithTag ("position10").transform; uiScript = GameObject.Find ("UIScript").GetComponent<UIScript>(); spriteRendererP1 = GameObject.Find("Player1").GetComponent<SpriteRenderer>(); spriteRendererP2 = GameObject.Find ("Player2").GetComponent<SpriteRenderer>(); Debug.Log ("Player1 Action Points: " + player1.playerOneActionPoints); Debug.Log ("Player2 Action Points: " + player2.playerTwoActionPoints); }
public static async Task <bool> PVPRotation() { if (Target == null || !Target.CanAttack) { return(false); } if (await PvPSpells.TheWanderersMinuet.Use(Target, true)) { return(true); } if (await PvPSpells.ArmysPaeon.Use(Target, true)) { return(true); } if (await PvPSpells.BluntArrow.Use(Target, !EdwardSettingsModel.Instance.PvPManualBluntArrow)) { return(true); } if (await PvPSpells.Barrage.Use(Me, ActionResourceManager.Bard.ActiveSong == ActionResourceManager.Bard.BardSong.ArmysPaeon && Me.CurrentTP > 250)) { return(await PvPSpells.EmpyrealArrow.Use(Target, true)); } if (await PvPSpells.PitchPerfect.Use(Target, ActionResourceManager.Bard.ActiveSong == ActionResourceManager.Bard.BardSong.WanderersMinuet && (ActionResourceManager.Bard.Repertoire == 3) || ActionResourceManager.Bard.Timer.TotalMilliseconds < 3000)) { return(true); } if (await PvPSpells.EmpyrealArrow.Use(Target, Me.CurrentTP > 250)) { return(true); } if (await PvPSpells.Bloodletter.Use(Target, true)) { return(true); } if (await PvPSpells.Sidewinder.Use(Target, Target.HasAura(PvPAuras.CausticBite) && Target.HasAura(PvPAuras.StormBite))) { return(true); } if (DateTime.Now < _pvpComboTimer || DateTime.Now < _pvpLimiterTimer) { return(false); } _pvpLimiterTimer = DateTime.Now.AddMilliseconds(500); if ((!Target.HasAura(PvPAuras.CausticBite) || !Target.HasAura(PvPAuras.StormBite))) { if (ActionManager.DoPvPCombo(PvPCombos.StormbiteCombo, Target)) { _pvpComboTimer = DateTime.Now.AddMilliseconds(1700); return(true); } } if (ActionManager.DoPvPCombo(PvPCombos.StraightShotCombo, Target)) { _pvpComboTimer = DateTime.Now.AddMilliseconds(1700); return(true); } return(false); }
protected internal override void CallOn(HacknetPlugin plugin, MemberInfo targettedInfo) { ActionManager.RegisterAction((Type)targettedInfo, XmlName); }
public ActorAndProvokerAbilityHit_FunctionCall(ActionManager actionManager) { this.actionManager = actionManager; //Debug.Log("ActorAndProvokerAbilityHit_FunctionCall created"); }
void Start() { playerActionManager = new ActionManager(this); playerWeaponManager = new WeaponManager(this); playerHealthManager = new HealthManager(this); gameController = GameController.instance; Screen.lockCursor = true; // if classic mode then each player belongs to a base // id of the player which owns this object teamID = GetComponent<PhotonView>().owner.ID; SetTeamColor(); if (BaseManager.instance) { teamBase = BaseManager.instance.BaseForID(teamID); } }
public static Transaction Create(ActionManager actionManager) { return Create(actionManager, true); }
/// <summary> /// Gets the import manager. /// </summary> /// <returns></returns> private ImportManager GetImportManager() { ImportManager importManager = Page.Session["importManager"] as ImportManager; if (importManager != null && importManager.ActionManager == null) { ActionManager actionManager = new ActionManager(); actionManager.AddAction(new ActionAddNote("AddNote", GetLocalResourceObject("Action_AddNote.Caption").ToString(), false)); actionManager.AddAction(new ActionAddResponse("AddResponse", GetLocalResourceObject("Action_AddResponse.Caption").ToString(), false)); actionManager.AddAction(new ActionAddTarget("AddTarget", GetLocalResourceObject("Action_AddTarget.Caption").ToString(), false)); actionManager.AddAction(new ActionScheduleActivity("SchedulePhoneCall", GetLocalResourceObject("SchedulePhoneCall.Caption"). ToString(), false, ActivityType.atPhoneCall)); actionManager.AddAction(new ActionScheduleActivity("ScheduleMeeting", GetLocalResourceObject("ScheduleMeeting.Caption"). ToString(), false, ActivityType.atAppointment)); actionManager.AddAction(new ActionScheduleActivity("ScheduleToDo", GetLocalResourceObject("ScheduleToDo.Caption").ToString(), false, ActivityType.atToDo)); importManager.ActionManager = actionManager; } return importManager; }
/* * Quick reference * Click Action: ActionPause true, SetState actionPause, ShowMenu 1 * Click Firearm: ShowMenu 3, SelectAction Gun, SetState Aiming * Click Confirm: StartAction * StartAction calls ExecuteAction in ActionManager; implementation inside switch/case * * Previewing grenades: * Frag - Show damage rings * Stun - Show damage (stun) rings * Smoke - Show circle * */ // Start is called before the first frame update void Start() { instance = this; ResetStatics(); }
protected Transaction(ActionManager actionManager, bool delayed) : base(actionManager, delayed) { _accumulatingAction = new MultiAction(); }
public static async Task <bool> IronJawsOnOffTarget() { if (Core.Me.ClassLevel < 6) //No Dots at this point { return(false); } if (!BardSettings.Instance.EnableMultiDotting) { return(false); } //We wont need to IJ when we dont want double DoTs on everything if (!BardSettings.Instance.MultiDotVenomousBite || !BardSettings.Instance.MultiDotWindBite) { return(false); } if (Core.Me.ClassLevel < 56 || !ActionManager.HasSpell(Spells.IronJaws.Id)) { return(false); } BattleCharacter multiDotTarget = Combat.Enemies.FirstOrDefault(IsValidIronJawsTarget); if (multiDotTarget == null) { return(false); } if (!await Spells.IronJaws.Cast(multiDotTarget)) { return(false); } Logger.WriteInfo($@"[MultiDot] Iron Jaws on {multiDotTarget.Name}"); return(true); bool IsValidIronJawsTarget(BattleCharacter unit) { if (unit == Core.Me.CurrentTarget) { return(false); } if (!unit.InLineOfSight()) { return(false); } if (BardSettings.Instance.DontDotIfMultiDotTargetIsDyingSoon && unit.CombatTimeLeft() <= BardSettings.Instance.DontDotIfMultiDotTargetIsDyingWithinXSeconds) { return(false); } if (!unit.HasAura(Utilities.Routines.Bard.Windbite, true) || !unit.HasAura(Utilities.Routines.Bard.VenomousBite, true)) { return(false); } Aura windbite = unit.Auras.FirstOrDefault(x => x.Id == Utilities.Routines.Bard.Windbite && x.CasterId == Core.Player.ObjectId); Aura venomousbite = unit.Auras.FirstOrDefault(x => x.Id == Utilities.Routines.Bard.VenomousBite && x.CasterId == Core.Player.ObjectId); if (windbite.TimespanLeft.TotalMilliseconds - Spells.HeavyShot.AdjustedCooldown.TotalMilliseconds > BardSettings.Instance.RefreshDotsWithXmsLeftAfterLastGCD && venomousbite.TimespanLeft.TotalMilliseconds - Spells.HeavyShot.AdjustedCooldown.TotalMilliseconds > BardSettings.Instance.RefreshDotsWithXmsLeftAfterLastGCD) { return(false); } return(true); } }
public static Transaction Create(ActionManager actionManager, bool delayed) { return new Transaction(actionManager, delayed); }
/// <summary> /// Uses the inventory item. /// </summary> /// <param name="target">Target of item use action.</param> /// <param name="preUseSleep">Milliseconds to wait before using the item.</param> /// <param name="postUseSleep">Milliseconds to wait after using the item.</param> /// <param name="maxTimeout">Maximum time to wait for coroutine to complete.</param> /// <param name="dismount">Player will dismount to use item if set to true.</param> /// <returns></returns> public virtual async Task <UseResult> Use(GameObject target, int?preUseSleep = null, int?postUseSleep = null, TimeSpan?maxTimeout = null, bool?dismount = null) { var shouldDismount = dismount ?? defaultMountBehavior; if (this.ItemData == null) { return(UseResult.UnknownItem); } if (this.SpellData == null) { return(UseResult.NoUse); } if (this.Quantity == 0) { return(UseResult.NoInventory); } if (this.Cooldown > new TimeSpan(0)) { return(UseResult.OnCooldown); } if (Core.Player.IsDead) { return(UseResult.PlayerDead); } if (!shouldDismount && ExProfileBehavior.Me.IsMounted) { return(UseResult.Mounted); } var baggedItem = this.GetItemFromBags(); if (!baggedItem.CanUse(target)) { return(UseResult.CantUse); } if (!shouldDismount || await Coroutine.Wait( maxTimeout ?? defaultMaxTimeout, () => { if (!ExProfileBehavior.Me.IsMounted) { return(true); } ActionManager.Dismount(); return(false); } )) { await Coroutine.Sleep(preUseSleep ?? this.defaultPreUseSleep); baggedItem.UseItem(target); await Coroutine.Sleep(postUseSleep ?? this.defaultPostUseSleep); return(UseResult.OK); } else { return(UseResult.DismountFailed); } }
// Use this for initialization void Awake() { playerSelectManager = GameObject.FindObjectOfType<PlayerSelectManager>(); actionManager = GameObject.FindObjectOfType<ActionManager>(); animator = GetComponent<Animator>(); }
public StatusIs_Condition(ActionManager actionManager, Being parentBeing, string conditionName, Being.Status status) : base(actionManager, parentBeing, conditionName) { this.status = status; }
// Use this for initialization void Start() { instance = this; unityChan = GetComponent<UnityChanCoin>(); }
IEnumerator DisplayMapUiState() { int currentId = TurnManager.ProgressQueue.Peek().CharacterId; Character current = CharacterManager.ActiveCharacters[currentId]; List <AlgorithmTile> possiblePositions; possiblePositions = ActionManager.GetPossiblePositions(currentId); positionButtons = new List <GameObject>(); for (int i = 0; i < possiblePositions.Count; i++) { GameObject newButton = Instantiate(tileButton); newButton.transform.SetParent(worldCanvas.transform, false); RectTransform buttonRectTransform = newButton.GetComponent <RectTransform>(); buttonRectTransform.anchorMax = buttonRectTransform.anchorMin = buttonRectTransform.pivot = Vector2.zero; buttonRectTransform.anchoredPosition = new Vector2(possiblePositions[i].Position.X, possiblePositions[i].Position.Z); newButton.GetComponent <ButtonHandler>().id = i; positionButtons.Add(newButton); } hasSelectedPosition = false; selectedPositionId = -1; returnFromMapToActionChoices = returnFromMapToAbilityGraph = false; yield return(new WaitUntil(() => hasSelectedPosition || returnFromMapToActionChoices || returnFromMapToAbilityGraph)); if (hasSelectedPosition) { if (selectedAbilityId == -1) { actionsDone[(int)ActionChoices.Move] = true; } else { actionsDone[(int)ActionChoices.Ability] = true; } selectedAbilityId = -1; MapToAction(); } else { for (int i = 0; i < positionButtons.Count; i++) { Destroy(positionButtons[i]); } positionButtons.Clear(); if (returnFromMapToAbilityGraph) { MapToAbilityGraph(); } else { MapToActionChoices(); } } }
protected override void OnDamage() { SoundManager.Instance.Grunt(AudioSource); ActionManager.OnDamage(); }
public NoCondition_Condition(ActionManager actionManager, Being parentBeing, string conditionName) : base(actionManager, parentBeing, conditionName) //This should grab the actionManager from the base constructor (Condition) { }
internal bool DoAbility(Ability ability) { return(ActionManager.DoAction(Abilities.Map[ClassJobType.Fisher][ability], ExProfileBehavior.Me)); }
protected IUnEqip(ActionManager am) : base(am) { }
public TransactionBase(ActionManager am, bool isDelayed) : this(am) { IsDelayed = isDelayed; }
public static async Task <bool> WindbiteOnCurrentTarget() { if (!BardSettings.Instance.UseWindBite) { return(false); } if (Core.Me.ClassLevel < 64) { if (Core.Me.ClassLevel < 30 || !ActionManager.HasSpell(Spells.Windbite.Id)) { return(false); } if (!Core.Me.CurrentTarget.InLineOfSight()) { return(false); } if (BardSettings.Instance.DontDotIfCurrentTargetIsDyingSoon && Core.Me.CurrentTarget.CombatTimeLeft() <= BardSettings.Instance.DontDotIfCurrentTargetIsDyingWithinXSeconds) { return(false); } if (Core.Me.CurrentTarget.HasAura(Auras.Windbite, true)) { return(false); } if (!await Spells.Windbite.Cast(Core.Me.CurrentTarget)) { return(false); } Logger.WriteInfo($@"[DoT-Effect] Windbite on {Core.Me.CurrentTarget.Name}"); return(true); } if (!ActionManager.HasSpell(Spells.Windbite.Id)) { return(false); } if (!Core.Me.CurrentTarget.InLineOfSight()) { return(false); } if (BardSettings.Instance.DontDotIfCurrentTargetIsDyingSoon && Core.Me.CurrentTarget.CombatTimeLeft() <= BardSettings.Instance.DontDotIfCurrentTargetIsDyingWithinXSeconds) { return(false); } if (Core.Me.CurrentTarget.HasAura(Auras.StormBite, true)) { return(false); } if (!await Spells.Stormbite.Cast(Core.Me.CurrentTarget)) { return(false); } Logger.WriteInfo($@"[DoT-Effect] Stormbite on {Core.Me.CurrentTarget.Name}"); return(true); }