예제 #1
0
    /*private Material m_material;
    private List<Vector3> m_cameraPositions;
    private int m_currentEye;*/
    /*public void OnEnable()
    {
        const string shaderName = "Transparent/ReflexVR";

        if (null == m_material)
            m_material = GameObject.Find("scope_lense").GetComponent<Renderer>().material;

        if (null == m_material)
            Debug.LogError("Can't locate required shader \"" + shaderName + "\"\n");

        if (null == m_cameraPositions || m_cameraPositions.Count != 2)
        {
            m_cameraPositions = new List<Vector3>();
            m_cameraPositions.Add(Quaternion.Inverse(InputTracking.GetLocalRotation(VRNode.LeftEye)) * InputTracking.GetLocalPosition(VRNode.LeftEye));
            m_cameraPositions.Add(Quaternion.Inverse(InputTracking.GetLocalRotation(VRNode.RightEye)) * InputTracking.GetLocalPosition(VRNode.RightEye));
        }
    }*/
    // Use this for initialization
    void Start()
    {
        camera = GetComponentInChildren<Camera>();
        tm = GameObject.Find("TargetManager").GetComponent<TargetManager>(); ;

        //leftEye = Quaternion.Inverse(InputTracking.GetLocalRotation(VRNode.LeftEye)) * InputTracking.GetLocalPosition(VRNode.LeftEye);
        //rightEye = Quaternion.Inverse(InputTracking.GetLocalRotation(VRNode.RightEye)) * InputTracking.GetLocalPosition(VRNode.RightEye);
    }
예제 #2
0
 void Awake()
 {
     if (Instance == null) {
         Instance = this;
     }
     else {
         Destroy(gameObject);
     }
 }
예제 #3
0
    // Use this for initialization
    void Start()
    {
        // assign the singleton reference
        singleton = this;

        // give all of the targets, the required IDs
        if(autoSetup == true){

            // iterate over all of the targets
            for(int i = 0; i < targetArray.Length; i++){
                // set their ID to the index in the array
                if(targetArray[i] != null){
                    targetArray[i].myTargetID = i;
                }
            }

        }
    }
예제 #4
0
        protected override void OnMouseUp(int x, int y, MouseButtonType button)
        {
            if (button == MouseButtonType.Left)
            {
                if (TargetManager.IsTargeting)
                {
                    TargetManager.Target(World.Player);
                    Mouse.LastLeftButtonClickTime = 0;
                }
                else if (x >= _point.X && x <= Width + 16 && y >= _point.Y && y <= Height + 16)
                {
                    var offset = Mouse.LDroppedOffset;

                    if (Math.Abs(offset.X) < 5 && Math.Abs(offset.Y) < 5)
                    {
                        UIManager.GetGump <BaseHealthBarGump>(World.Player)?.Dispose();

                        if (ProfileManager.Current.CustomBarsToggled)
                        {
                            UIManager.Add(new HealthBarGumpCustom(World.Player)
                            {
                                X = ScreenCoordinateX, Y = ScreenCoordinateY
                            });
                        }
                        else
                        {
                            UIManager.Add(new HealthBarGump(World.Player)
                            {
                                X = ScreenCoordinateX, Y = ScreenCoordinateY
                            });
                        }
                        Dispose();
                    }
                }
            }
        }
예제 #5
0
        public override bool ShouldCast(TargetManager targetManager)
        {
            var target = targetManager.Target;

            if (!target.IsVisible)
            {
                return(false);
            }

            if (target.IsReflectingDamage)
            {
                return(false);
            }

            var damage = this.Ability.GetDamage(target);

            if (damage < target.Health)
            {
                return(false);
            }

            if (target.IsInvulnerable)
            {
                if (this.Ability.UnitTargetCast)
                {
                    return(false);
                }

                if (!this.ChainStun(target, true))
                {
                    return(false);
                }
            }

            return(true);
        }
        public ActionResult SaveTarget(Target_Model objModel, int page = 1, int pageSize = 5)
        {
            if (!ModelState.IsValid)
            {
                var message = string.Join("|", ModelState.Values.SelectMany(e => e.Errors).Select(em => em.ErrorMessage));
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, message));
            }
            int OPM_ID = objModel.Table.OPM_ID != null ? objModel.Table.OPM_ID.Value : 0;
            //Save
            TargetManager context = new TargetManager(new DataContext());
            var           msg     = context.SaveTarget(objModel.Table);

            if (msg.Contains("exists"))
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest, "exists"));
            }
            else
            {
                objModel.OPM_ID = OPM_ID;
                BindTargetGrid(objModel, page, pageSize);
                string vwString = HtmlHelpers.RenderViewToString(this.ControllerContext, "TargetList", objModel);
                return(Json(new { OPM_ID = OPM_ID, viewData = vwString }));
            }
        }
예제 #7
0
        public override bool UseAbility(TargetManager targetManager, Sleeper comboSleeper, bool aoe)
        {
            if (aoe)
            {
                var input = this.Ability.GetPredictionInput(
                    targetManager.Target,
                    EntityManager9.Units.Where(
                        x => x.IsUnit && !x.IsAlly(this.Owner) && x.IsAlive && x.IsVisible && !x.IsMagicImmune && !x.IsInvulnerable)
                    .ToList());
                var output = this.Ability.GetPredictionOutput(input);

                if (output.HitChance < HitChance.Low)
                {
                    return(false);
                }

                if (!this.Ability.UseAbility(output.CastPosition))
                {
                    return(false);
                }
            }
            else
            {
                if (!this.Ability.UseAbility(targetManager.Target, HitChance.Low))
                {
                    return(false);
                }
            }

            var delay = this.Ability.GetCastDelay(targetManager.Target);

            comboSleeper.Sleep(delay);
            this.Sleeper.Sleep(delay + 0.5f);
            this.OrbwalkSleeper.Sleep(delay);
            return(true);
        }
예제 #8
0
        // Token: 0x06000227 RID: 551 RVA: 0x0000F558 File Offset: 0x0000D758
        public override bool ShouldConditionCast(TargetManager targetManager, IComboModeMenu menu, List <UsableAbility> usableAbilities)
        {
            if (!base.ShouldConditionCast(targetManager, menu, usableAbilities))
            {
                return(false);
            }
            Hero9 hero = (from x in EntityManager9.Heroes
                          where !x.Equals(base.Owner) && x.IsAlly(base.Owner) && x.IsAlive && x.Distance(base.Owner) < 1500f
                          orderby x.Distance(base.Owner)
                          select x).FirstOrDefault <Hero9>();
            Vector3 vector = (hero == null) ? EntityManager9.AllyFountain : hero.Position;

            if (Vector3Extensions.AngleBetween(base.Owner.Position, targetManager.Target.Position, vector) <= 30f)
            {
                return(true);
            }
            if (base.Owner.Move(Vector3Extensions.Extend2D(targetManager.Target.Position, vector, -100f)))
            {
                base.OrbwalkSleeper.Sleep(0.1f);
                base.Sleeper.Sleep(0.1f);
                return(false);
            }
            return(false);
        }
            void TryValidateChain(Header headerRoot, int height)
            {
                Header header = headerRoot;
                double accumulatedDifficulty = 0;

                for (int i = 0; i < height; i += 1)
                {
                    uint medianTimePast = GetMedianTimePast(header.HeaderPrevious);
                    if (header.UnixTimeSeconds < medianTimePast)
                    {
                        throw new ChainException(
                                  string.Format("header {0} with unix time {1} older than median time past {2}",
                                                header.HeaderHash.ToHexString(),
                                                DateTimeOffset.FromUnixTimeSeconds(header.UnixTimeSeconds),
                                                DateTimeOffset.FromUnixTimeSeconds(medianTimePast)));
                    }

                    ValidateCheckpoint(header.HeaderHash, Probe.GetHeight() + i + 1);

                    uint targetBits = TargetManager.GetNextTargetBits(
                        header.HeaderPrevious,
                        (uint)(Probe.GetHeight() + i + 1));

                    if (header.NBits != targetBits)
                    {
                        throw new ChainException(
                                  string.Format("In header {0} nBits {1} not equal to target nBits {2}",
                                                header.HeaderHash.ToHexString(),
                                                header.NBits,
                                                targetBits));
                    }

                    header = header.HeadersNext[0];
                    accumulatedDifficulty += TargetManager.GetDifficulty(header.NBits);
                }
            }
예제 #10
0
        public override bool UseAbility(TargetManager targetManager, Sleeper comboSleeper, bool aoe)
        {
            var ownerPosition = this.Owner.Position;
            var tree          = EntityManager9.Trees.Where(x => x.Distance2D(ownerPosition) < this.Ability.CastRange)
                                .OrderBy(x => this.Owner.GetAngle(x.Position))
                                .FirstOrDefault();

            if (tree == null)
            {
                return(false);
            }

            if (!this.Ability.UseAbility(tree))
            {
                return(false);
            }

            var delay = this.Ability.GetCastDelay(targetManager.Target);

            comboSleeper.Sleep(delay);
            this.Sleeper.Sleep(delay + 0.5f);
            this.OrbwalkSleeper.Sleep(delay);
            return(true);
        }
예제 #11
0
    protected virtual void Awake()
    {
        fogOfWarAgent = GetComponent <FogOfWarAgent>();

        selectionBounds = ResourceManager.InvalidBounds;

        UpdateChildRenderers();

        CalculateBounds();

        stateController = GetComponent <StateController>();

        selectionLight = GetComponentInChildren <Light>();

        ActiveStatuses  = new List <Status>(GetComponentsInChildren <Status>());
        statusesWrapper = GetComponentInChildren <Statuses.Statuses>();

        var humanPlayer = PlayerManager.GetHumanPlayer(FindObjectsOfType <Player>());

        if (humanPlayer)
        {
            targetManager = humanPlayer.GetComponentInChildren <TargetManager>();
        }
    }
    private void StopScenario()
    {
        targetsClicked  = -1;
        statusText.text = "Menu";
        switch (SceneHandler.ScenarioType)
        {
        case ScenarioType.Menu:
            break;

        case ScenarioType.Performance:
            TargetManager.DeactivateTargets();
            break;

        case ScenarioType.Occlusion:
            ObstacleManager.DeactivateAllObstacles();
            TargetManager.DeactivateTargets();
            break;

        case ScenarioType.Sorting:
            TargetManager.DeactivateTargets();
            ObstacleManager.DeactivateAllObstacles();
            break;
        }
    }
예제 #13
0
        public bool ForceUseAbility(TargetManager targetManager, Sleeper comboSleeper, ComboModeMenu comboModeMenu)
        {
            this.ally = this.skewer.GetPreferedAlly(targetManager, comboModeMenu);

            if (this.ally != null)
            {
                this.Owner.BaseUnit.Move(this.ally.Position);
                UpdateManager.BeginInvoke(150, () => this.Ability.UseAbility());
            }
            else
            {
                this.Ability.UseAbility();
            }

            var hitTime = this.Ability.GetHitTime(targetManager.Target) + 0.5f;
            var delay   = this.Ability.GetCastDelay(targetManager.Target);

            targetManager.Target.SetExpectedUnitState(this.Disable.AppliesUnitState, hitTime);
            comboSleeper.Sleep(delay);
            this.OrbwalkSleeper.Sleep(delay);
            this.Sleeper.Sleep(hitTime);

            return(true);
        }
예제 #14
0
    //if hit by player weapon, add the target
    public override void hit()
    {
        //stop timer from recording
        timerActive = false;
        Debug.Log("time: " + this.time);
        //add target to list
        TargetManager.addTarget(this);
        //Debug.Log("Hit!!!");

        //play audio
        //FindObjectOfType<AudioManager>().Play("MetalHit 1");
        //AudioSource.PlayClipAtPoint(hitSound, this.transform.position);


        //create a particle
        GameObject burstObject = Instantiate(burst, this.transform.position, Quaternion.identity);

        //destroy particle upon complete
        Destroy(burstObject, 1f);
        //destroy particle upon complete
        //Destroy(burstObject, 1f);

        //onHit.Invoke(100);
    }
예제 #15
0
파일: IceBlast.cs 프로젝트: vana41203/O9K
        public bool Release(TargetManager targetManager, Sleeper comboSleeper)
        {
            if (this.iceBlast.IsUsable)
            {
                return(false);
            }

            var iceBlastUnit = ObjectManager.GetEntitiesFast <Unit>()
                               .FirstOrDefault(
                x => x.IsValid && x.NetworkName == "CDOTA_BaseNPC" && x.DayVision == 550 && x.Health == 150 &&
                x.Team == this.Owner.Team);

            if (iceBlastUnit == null)
            {
                return(true);
            }

            var currentPosition = iceBlastUnit.Position;
            var nextPosition    = iceBlastUnit.Position.Extend2D(this.direction, 50);
            var targetPosition  = targetManager.Target.GetPredictedPosition(this.iceBlast.GetReleaseFlyTime(iceBlastUnit.Position));

            if (currentPosition.Distance2D(targetPosition) > nextPosition.Distance2D(targetPosition))
            {
                return(false);
            }

            if (!this.Ability.UseAbility())
            {
                return(false);
            }

            this.Sleeper.Sleep(0.3f);
            this.OrbwalkSleeper.Sleep(0.1f);
            comboSleeper.Sleep(0.1f);
            return(true);
        }
        // Token: 0x0600082C RID: 2092 RVA: 0x00025794 File Offset: 0x00023994
        public override bool UseAbility(TargetManager targetManager, Sleeper comboSleeper, Vector3 toPosition)
        {
            if (base.Owner.Distance(toPosition) < 200f)
            {
                return(false);
            }
            Vector3 vector = Vector3Extensions.Extend2D(base.Owner.Position, toPosition, Math.Min(base.Ability.CastRange - 25f, base.Owner.Distance(toPosition)));

            Polygon.Rectangle rec = new Polygon.Rectangle(base.Owner.Position, vector, base.Ability.Radius);
            if (EntityManager9.Units.Any((Unit9 x) => x.IsHero && x.IsEnemy(this.Owner) && x.IsAlive && rec.IsInside(x.Position)))
            {
                return(false);
            }
            if (!base.Ability.UseAbility(vector, false, false))
            {
                return(false);
            }
            float castDelay = base.Ability.GetCastDelay(vector);

            comboSleeper.Sleep(castDelay);
            base.Sleeper.Sleep(castDelay + 0.5f);
            base.OrbwalkSleeper.Sleep(castDelay);
            return(true);
        }
예제 #17
0
        // Token: 0x060007B6 RID: 1974 RVA: 0x00023694 File Offset: 0x00021894
        public override bool UseAbility(TargetManager targetManager, Sleeper comboSleeper, bool aoe)
        {
            if (this.blinkPosition.IsZero)
            {
                PredictionInput9 predictionInput = base.Ability.GetPredictionInput(targetManager.Target, null);
                predictionInput.Delay += 0.5f;
                PredictionOutput9 predictionOutput = base.Ability.GetPredictionOutput(predictionInput);
                if (predictionOutput.HitChance < 1)
                {
                    return(false);
                }
                this.blinkPosition = predictionOutput.CastPosition;
            }
            if (!base.Ability.UseAbility(this.blinkPosition, false, false))
            {
                return(false);
            }
            float castDelay = base.Ability.GetCastDelay(this.blinkPosition);

            comboSleeper.Sleep(castDelay);
            base.Sleeper.Sleep(castDelay + 0.5f);
            base.OrbwalkSleeper.Sleep(castDelay);
            return(true);
        }
예제 #18
0
        // Token: 0x0600064B RID: 1611 RVA: 0x0001EA10 File Offset: 0x0001CC10
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            AbilityHelper abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            foreach (Unit9 unit in targetManager.EnemyUnits)
            {
                if (base.Owner.Distance(unit) < 275f)
                {
                    if (!this.damagedUnits.Contains(unit))
                    {
                        this.damagedUnits.Add(unit);
                    }
                    if (this.moveUnits.Contains(unit))
                    {
                        this.moveUnits.Remove(unit);
                    }
                }
                else if (!this.damagedUnits.Contains(unit) && !this.moveUnits.Contains(unit))
                {
                    this.moveUnits.Add(unit);
                }
            }
            return(abilityHelper.UseAbility(this.stomp, true));
        }
예제 #19
0
 public override bool CanHit(TargetManager targetManager, IComboModeMenu comboMenu)
 {
     return(!targetManager.Target.IsMagicImmune || this.Ability.PiercesMagicImmunity(targetManager.Target));
 }
예제 #20
0
 private void Acquire_OnCommand(CommandArgs args)
 {
     TargetManager.Reacquire();
 }
예제 #21
0
        protected override void OnMouseUp(int x, int y, MouseButtonType button)
        {
            base.OnMouseUp(x, y, button);

            if (button == MouseButtonType.Left)
            {
                GameScene gs = Client.Game.GetScene <GameScene>();
                if (gs == null)
                {
                    return;
                }

                if (Item == null || Item.IsDestroyed)
                {
                    Dispose();
                }

                if (IsDisposed)
                {
                    return;
                }

                if (TargetManager.IsTargeting)
                {
                    _clickedCanDrag = false;

                    if (Mouse.IsDragging && CanPickup())
                    {
                        if (!ItemHold.Enabled || !gs.IsMouseOverUI)
                        {
                            return;
                        }

                        SelectedObject.Object = Item;

                        if (Item.ItemData.IsContainer)
                        {
                            gs.DropHeldItemToContainer(Item);
                        }
                        else if (ItemHold.Graphic == Item.Graphic && ItemHold.IsStackable)
                        {
                            gs.MergeHeldItem(Item);
                        }
                        else
                        {
                            if (SerialHelper.IsItem(Item.Container))
                            {
                                gs.DropHeldItemToContainer(World.Items.Get(Item.Container), X + (Mouse.Position.X - ScreenCoordinateX), Y + (Mouse.Position.Y - ScreenCoordinateY));
                            }
                        }

                        return;
                    }

                    switch (TargetManager.TargetingState)
                    {
                    case CursorTarget.Position:
                    case CursorTarget.Object:
                    case CursorTarget.Grab:
                    case CursorTarget.SetGrabBag:
                        SelectedObject.Object = Item;


                        if (Item != null)
                        {
                            TargetManager.Target(Item);
                            Mouse.LastLeftButtonClickTime = 0;
                        }

                        break;

                    case CursorTarget.SetTargetClientSide:
                        SelectedObject.Object = Item;

                        if (Item != null)
                        {
                            TargetManager.Target(Item);
                            Mouse.LastLeftButtonClickTime = 0;
                            UIManager.Add(new InspectorGump(Item));
                        }

                        break;

                    case CursorTarget.HueCommandTarget:
                        SelectedObject.Object = Item;

                        if (Item != null)
                        {
                            CommandManager.OnHueTarget(Item);
                        }

                        break;
                    }
                }
                else
                {
                    if (!ItemHold.Enabled || !gs.IsMouseOverUI)
                    {
                        //if (_clickedCanDrag)
                        //{
                        //    _clickedCanDrag = false;
                        //    _sendClickIfNotDClick = true;
                        //    _sClickTime = Time.Ticks + Mouse.MOUSE_DELAY_DOUBLE_CLICK;
                        //}
                        if (!DelayedObjectClickManager.IsEnabled)
                        {
                            DelayedObjectClickManager.Set(Item.Serial, Mouse.Position.X, Mouse.Position.Y, Time.Ticks + Mouse.MOUSE_DELAY_DOUBLE_CLICK);
                        }
                    }
                    else
                    {
                        SelectedObject.Object = Item;

                        if (Item.ItemData.IsContainer)
                        {
                            gs.DropHeldItemToContainer(Item);
                        }
                        else if (ItemHold.Graphic == Item.Graphic && ItemHold.IsStackable)
                        {
                            gs.MergeHeldItem(Item);
                        }
                        else
                        {
                            if (SerialHelper.IsItem(Item.Container))
                            {
                                gs.DropHeldItemToContainer(World.Items.Get(Item.Container), X + (Mouse.Position.X - ScreenCoordinateX), Y + (Mouse.Position.Y - ScreenCoordinateY));
                            }
                        }
                    }
                }

                _clickedCanDrag = false;
            }
        }
예제 #22
0
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            if (targetManager.TargetSleeper.IsSleeping)
            {
                return(false);
            }

            var abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.UseAbility(this.blink, 550, 400))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.force, 550, 400))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.pike, 550, 400))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.hex))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.atos))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.orchid))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.bloodthorn))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.veil))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.ethereal))
            {
                return(true);
            }

            if (abilityHelper.UseKillStealAbility(this.dragon, false))
            {
                return(true);
            }

            if (abilityHelper.UseKillStealAbility(this.laguna))
            {
                this.ComboSleeper.ExtendSleep(0.2f);
                return(true);
            }

            if (abilityHelper.UseAbilityIfAny(this.euls, this.array))
            {
                return(true);
            }

            if (abilityHelper.CanBeCasted(this.euls, false) && abilityHelper.CanBeCasted(this.array, false))
            {
                if (this.Owner.Speed > targetManager.Target.Speed + 50)
                {
                    this.preventAttackSleeper.Sleep(0.5f);
                    return(true);
                }
            }

            if (abilityHelper.UseAbility(this.array, false))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.laguna))
            {
                this.ComboSleeper.ExtendSleep(0.2f);
                return(true);
            }

            if (abilityHelper.UseAbility(this.dragon, false))
            {
                return(true);
            }

            if (abilityHelper.CanBeCasted(this.pike) && !this.MoveSleeper.IsSleeping)
            {
                if (this.pike.UseAbilityOnTarget(targetManager, this.ComboSleeper))
                {
                    return(true);
                }
            }

            if (abilityHelper.UseAbility(this.phase))
            {
                return(true);
            }

            return(false);
        }
예제 #23
0
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            var abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.UseAbility(this.hex))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.abyssal))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.orchid))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.bloodthorn))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.blink, 400, 0))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.nullifier))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.diffusal))
            {
                this.pounce?.Sleeper.Sleep(0.3f);
                return(true);
            }

            if (abilityHelper.UseAbility(this.pounce))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.medallion))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.solar))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.silver))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.shadow))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.pact))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.dance))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.phase))
            {
                return(true);
            }

            return(false);
        }
예제 #24
0
        public override bool Combo(TargetManager targetManager, ComboModeMenu comboModeMenu)
        {
            var abilityHelper = new AbilityHelper(targetManager, comboModeMenu, this);

            if (abilityHelper.UseAbility(this.bloodthorn))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.nullifier))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.ethereal))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.dagon))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.shiva))
            {
                return(true);
            }

            if (targetManager.Target.HasModifier("modifier_pudge_meat_hook"))
            {
                if (abilityHelper.CanBeCasted(this.bloodthorn, true, false))
                {
                    abilityHelper.ForceUseAbility(this.bloodthorn);
                    return(true);
                }

                if (abilityHelper.CanBeCasted(this.nullifier, true, false) &&
                    !targetManager.Target.Abilities.Any(x => x.Id == AbilityId.item_aeon_disk && x.IsReady))
                {
                    abilityHelper.ForceUseAbility(this.nullifier);
                    return(true);
                }

                if (abilityHelper.CanBeCasted(this.ethereal, true, false))
                {
                    abilityHelper.ForceUseAbility(this.ethereal);
                    return(true);
                }

                if (abilityHelper.UseAbility(this.bkb))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.lotus))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.dagon))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.vessel))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.urn))
                {
                    return(true);
                }
            }

            if (abilityHelper.CanBeCasted(this.dismember))
            {
                if (abilityHelper.CanBeCasted(this.bloodthorn, true, false))
                {
                    abilityHelper.ForceUseAbility(this.bloodthorn);
                    return(true);
                }

                if (abilityHelper.CanBeCasted(this.nullifier, true, false) &&
                    !targetManager.Target.Abilities.Any(x => x.Id == AbilityId.item_aeon_disk && x.IsReady))
                {
                    abilityHelper.ForceUseAbility(this.nullifier);
                    return(true);
                }

                if (abilityHelper.UseAbility(this.bkb))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.lotus))
                {
                    return(true);
                }

                if (abilityHelper.CanBeCasted(this.ethereal, true, false))
                {
                    abilityHelper.ForceUseAbility(this.ethereal);
                    return(true);
                }

                if (abilityHelper.UseAbility(this.dagon))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.bladeMail))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.vessel))
                {
                    return(true);
                }

                if (abilityHelper.UseAbility(this.urn))
                {
                    return(true);
                }

                abilityHelper.ForceUseAbility(this.dismember);
                return(true);
            }

            if (abilityHelper.UseAbilityIfCondition(this.blink, this.dismember))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.blink, 800, 25))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.atos))
            {
                return(true);
            }

            if (abilityHelper.CanBeCasted(this.force))
            {
                if (this.force.UseAbilityOnTarget(targetManager, this.ComboSleeper))
                {
                    return(true);
                }
            }

            if (abilityHelper.UseAbility(this.force, 400, 800))
            {
                return(true);
            }

            if (abilityHelper.UseAbility(this.hook))
            {
                return(true);
            }

            if (abilityHelper.CanBeCasted(this.rot, false, false))
            {
                if (this.rot.AutoToggle(targetManager))
                {
                    return(true);
                }
            }

            return(false);
        }
예제 #25
0
    protected override void Update()
    {
        if (!isDead)
        {
            foreach (WeaponAbility weapon in GetComponentsInChildren <WeaponAbility>())
            {
                weapon.Tick();
            }
        }

        base.Update();
        TargetManager.Enqueue(targeter);

        if (PlayerCore.Instance && FactionManager.IsAllied(faction, PlayerCore.Instance.faction))
        {
            if ((transform.position - PlayerCore.Instance.transform.position).sqrMagnitude <= YardProximitySquared)
            {
                var player = PlayerCore.Instance;
                foreach (var partyMember in PartyManager.instance.partyMembers)
                {
                    if ((transform.position - partyMember.transform.position).sqrMagnitude > YardProximitySquared && !partyMember.HasRepaired && !partyMember.IsFullyRepaired())
                    {
                        partyMember.Warp(transform.position + new Vector3(Random.Range(-2, 2), Random.Range(-2, 2)));
                    }
                }


                if (!player.HasRepaired)
                {
                    if (!player.IsFullyRepaired() && !player.GetIsDead())
                    {
                        player.repairFinalized = false;
                        StartCoroutine(player.StartYardRepair());
                    }
                }
                else if (player.repairFinalized)
                {
                    player.HealToMax();
                }

                player.HasRepaired = true;
                if (player.GetTractorTarget() && (player.GetTractorTarget().GetComponent <ShellPart>() ||
                                                  player.GetTractorTarget().GetComponent <Shard>()) && !tractor.GetTractorTarget())
                {
                    tractor.SetTractorTarget(player.GetTractorTarget());
                    player.SetTractorTarget(null);
                }
            }

            foreach (var partyMember in PartyManager.instance.partyMembers)
            {
                if (partyMember && partyMember.GetAI().getMode() == AirCraftAI.AIMode.Follow &&
                    (transform.position - partyMember.transform.position).sqrMagnitude <= YardProximitySquared)
                {
                    if (!partyMember.HasRepaired)
                    {
                        if (!partyMember.IsFullyRepaired() && !partyMember.GetIsDead())
                        {
                            partyMember.repairFinalized = false;
                            StartCoroutine(partyMember.StartYardRepair());
                        }
                    }
                    else if (partyMember.repairFinalized)
                    {
                        partyMember.HealToMax();
                    }
                    partyMember.HasRepaired = true;
                }
            }

            if (tractor.GetTractorTarget() && (transform.position - tractor.GetTractorTarget().transform.position).sqrMagnitude <= 10)
            {
                if (tractor.GetTractorTarget().GetComponent <ShellPart>())
                {
                    PassiveDialogueSystem.Instance.PushPassiveDialogue(ID, "<color=lime>Your part has been added into your inventory.</color>", 4);
                    var shellPart = tractor.GetTractorTarget().GetComponent <ShellPart>();
                    var info      = shellPart.info;
                    info = ShipBuilder.CullSpatialValues(info);
                    ShipBuilder.AddOriginToDictionary(shellPart);
                    PlayerCore.Instance.cursave.partInventory.Add(info);
                    PartIndexScript.AttemptAddToPartsObtained(info);
                    PartIndexScript.AttemptAddToPartsSeen(info);
                    if (NodeEditorFramework.Standard.YardCollectCondition.OnYardCollect != null)
                    {
                        NodeEditorFramework.Standard.YardCollectCondition.OnYardCollect.Invoke(info.partID, info.abilityID, shellPart.droppedSectorName);
                    }

                    Destroy(shellPart.gameObject);
                }
                else if (tractor.GetTractorTarget().GetComponent <Shard>())
                {
                    PassiveDialogueSystem.Instance.PushPassiveDialogue(ID, "<color=lime>Your shard has been added into your stash.</color>", 4);
                    var shard = tractor.GetTractorTarget().GetComponent <Shard>();
                    var tiers = new int[] { 1, 5, 20 };
                    PlayerCore.Instance.shards += tiers[shard.tier];
                    ShardCountScript.DisplayCount(PlayerCore.Instance.shards);
                    Destroy(shard.gameObject);
                }
            }
        }
    }
예제 #26
0
    private void Awake()
    {
        if ( TargetManager.instance != null )
        {
            DebugConsole.Error( "Duplicate TargetManagers detected", TargetManager.instance );
        }
        TargetManager.instance = this;

        this.targetMap = new Dictionary<NetworkViewID, BaseHealth>();
        #if UNITY_EDITOR
        this.debugTargetMap = new Dictionary<int, BaseHealth>();
        this.debugTargets = new List<BaseHealth>();
        #endif
    }
예제 #27
0
        protected override void OnMouseUp(int x, int y, MouseButton button)
        {
            _clickedCanDrag = false;

            if (button == MouseButton.Left)
            {
                GameScene gs = Engine.SceneManager.GetScene <GameScene>();

                if (TargetManager.IsTargeting)
                {
                    switch (TargetManager.TargetingState)
                    {
                    case TargetType.Position:
                    case TargetType.Object:
                        gs.SelectedObject = Item;


                        if (Item != null)
                        {
                            TargetManager.TargetGameObject(Item);
                            Mouse.LastLeftButtonClickTime = 0;
                        }

                        break;

                    case TargetType.SetTargetClientSide:
                        gs.SelectedObject = Item;

                        if (Item != null)
                        {
                            TargetManager.TargetGameObject(Item);
                            Mouse.LastLeftButtonClickTime = 0;
                            Engine.UI.Add(new InfoGump(Item));
                        }
                        break;
                    }
                }
                else
                {
                    if (!gs.IsHoldingItem || !gs.IsMouseOverUI)
                    {
                        return;
                    }

                    gs.SelectedObject = Item;

                    if (Item.ItemData.IsContainer)
                    {
                        gs.DropHeldItemToContainer(Item);
                    }
                    else if (gs.HeldItem.Graphic == Item.Graphic && gs.HeldItem.IsStackable)
                    {
                        gs.MergeHeldItem(Item);
                    }
                    else
                    {
                        if (Item.Container.IsItem)
                        {
                            gs.DropHeldItemToContainer(World.Items.Get(Item.Container), X + (Mouse.Position.X - ScreenCoordinateX), Y + (Mouse.Position.Y - ScreenCoordinateY));
                        }
                    }
                }
            }
        }
예제 #28
0
	// Use this for initialization
	void Start ()
	{
        _Manager = FindObjectOfType<TargetManager>();
        _Manager.RegisterTarget(this);
	}
예제 #29
0
 public override bool CanHit(TargetManager targetManager, IComboModeMenu comboMenu)
 {
     return(true);
 }
예제 #30
0
파일: IonShell.cs 프로젝트: vana41203/O9K
 public override bool ShouldCast(TargetManager targetManager)
 {
     return(true);
 }
예제 #31
0
 public void Awake()
 {
     targets = new HashSet<Target>();
     singleton = this;
 }
예제 #32
0
        public Replication(ActionModel actionModel, Guid actionId, Guid selfId, Guid teamId) : base(actionModel, actionId, selfId, teamId)
        {
            SceneManager sceneManager = GameObject.Find("SceneManager").transform.GetComponent <SceneManager>();

            targetManager = sceneManager.targetManager;
        }
예제 #33
0
 public void OnTarget()
 {
     TargetManager.Target((object)this);
 }
예제 #34
0
 private void Awake()
 {
     Instance = this;
 }
예제 #35
0
 // Token: 0x06000569 RID: 1385 RVA: 0x00004D3A File Offset: 0x00002F3A
 public override bool CanHit(TargetManager targetManager, IComboModeMenu comboMenu)
 {
     return(base.CanHit(targetManager, comboMenu) && base.Ability.CanHit(targetManager.Target, targetManager.EnemyHeroes, this.TargetsToHit(comboMenu)));
 }
예제 #36
0
    public void StartGame()
    {
        cClothes = this.gameObject.GetComponent <ClothesHolder>();
        if (cClothes == null)
        {
            Debug.Log("Game: Start: ClothesHolder is not attached! HELLO?");
        }
        cClothes.Init();

        cSuspicionController = this.gameObject.GetComponent <SuspicionController>();
        if (cSuspicionController == null)
        {
            cSuspicionController = this.gameObject.AddComponent <SuspicionController>();
        }
        cSuspicionController.Init();

        cTargetManager = goTargetManager.GetComponent <TargetManager>();
        if (cTargetManager == null)
        {
            Debug.Log("***WARNING*** cTargetManager NULL");
        }
        cTargetManager.Init();

        goSpawns = GameObject.Find("Spawn Point Container");
        cSpawns  = goSpawns.GetComponent <SpawnPointHolder>();
        if (cSpawns == null)
        {
            Debug.Log("***WARNING*** CSpawns null");
        }
        cSpawns.Reset();

        //Characters
        GameObject player = Instantiate(playerPrefab);

        playerTransform = player.transform;
        PlayerController playerController = player.GetComponent <PlayerController>();

        if (playerController != null)
        {
            playerController.SetClothes(cTargetManager.AgentData);
        }

        npcs.Add(Instantiate(NPCPrefab));
        npcs[npcs.Count - 1].gameObject.transform.position = cSpawns.GetSpawnPoint().position;
        NPCController cNPCController = npcs[npcs.Count - 1].GetComponent <NPCController>();

        if (cNPCController != null)
        {
            cNPCController.SetClothes(cTargetManager.TargetData);
        }

        CharacterCreationData npcData;

        for (int i = 0; i < MAX_NPC; ++i)
        {
            npcs.Add(Instantiate(NPCPrefab));
            npcs[npcs.Count - 1].gameObject.transform.position = cSpawns.GetSpawnPoint().position;
            cNPCController = npcs[npcs.Count - 1].GetComponent <NPCController>();

            if (cNPCController != null)
            {
                npcData = new CharacterCreationData();
                npcData.lID[ClothesHolder.HATS_INDEX]       = 0;
                npcData.lColor[ClothesHolder.HATS_INDEX]    = cTargetManager.iHatID == i ? cTargetManager.TargetData.lColor[ClothesHolder.HATS_INDEX] : new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
                npcData.lID[ClothesHolder.TOPS_INDEX]       = 0;
                npcData.lColor[ClothesHolder.TOPS_INDEX]    = cTargetManager.iTopID == i ? cTargetManager.TargetData.lColor[ClothesHolder.TOPS_INDEX] : new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));
                npcData.lID[ClothesHolder.BOTTOMS_INDEX]    = 0;
                npcData.lColor[ClothesHolder.BOTTOMS_INDEX] = cTargetManager.iBottomID == i ? cTargetManager.TargetData.lColor[ClothesHolder.BOTTOMS_INDEX] : new Color(Random.Range(0f, 1f), Random.Range(0f, 1f), Random.Range(0f, 1f));

                cNPCController.SetClothes(npcData);
            }
        }

        GameObject.Find("FollowCamera").GetComponent <ShittyFollowCam>().StartCamera();
    }
예제 #37
0
 void Awake()
 {
     instance = this;
 }