Esempio n. 1
0
        void UpdateShooting()
        {
            if (GameManager.isPaused)
            {
                return;
            }

            if (ActionsInterface.GetActionDown(shootAction))
            {
                if (hitActor != null)
                {
                    hitActor.AddModifiers(damageModifiers, "Shoot", true, GameManager.playerActor.gameObject, hitActor.gameObject);

                    GameValue npcHealth = hitActor.GetGameValueObject(healthBarGameValueName);
                    if (npcHealth.GetValueComponent(GameValue.GameValueComponent.BaseValue) <= 0)
                    {
                        npcHealth.ReInitialize();
                        GameManager.playerActor.AddModifiers(onKillModifiers, "On Kill", true, hitActor.gameObject, GameManager.playerActor.gameObject);
                    }
                }

                clip--;
                if (clip <= 0)
                {
                    clip  = maxClip;
                    ammo -= maxClip;
                    ammoHud.allTexts[1].SetText("| " + ammo.ToString());
                }
                ammoHud.allTexts[0].SetText(clip.ToString() + " ");
            }
        }
Esempio n. 2
0
        void Update()
        {
            UpdateWeaponsDemo();
            UpdateShooting();
            UpdateInteractableHint();

            UpdateScope();

            UpdateAwarenessUI();


            if (ActionsInterface.GetActionDown(mainMenuAction, false, -1, true))
            {
                // if (UIManager.instance.mainMenu.isOpen) {
                //     UIManager.instance.mainMenu.CloseMenu();
                // }
                // else {
                //     UIManager.instance.mainMenu.OpenMenu(null);
                // }
                ManualMenu.mainMenu.ToggleMenu(null);
            }

            if (ActionsInterface.GetActionDown(quickInventoryAction, false, -1, true))
            {
                ManualMenu.ToggleMenu(quickInventoryMenuName, new Actor[] { GameManager.playerActor });
            }
        }
Esempio n. 3
0
 public static void MarkActionsOccupied(List <int> actions)
 {
     for (int i = 0; i < actions.Count; i++)
     {
         ActionsInterface.MarkActionOccupied(actions[i], usingController);
     }
 }
Esempio n. 4
0
 public static void MarkActionsUnoccupied(List <int> actions)
 {
     for (int i = 0; i < actions.Count; i++)
     {
         ActionsInterface.MarkActionUnoccupied(actions[i]);
     }
 }
Esempio n. 5
0
        public static Vector2Int GetUIActions(List <int> actions)
        {
            bool usesAnyController = usingController < 0;

            for (int i = 0; i < actions.Count; i++)
            {
                int action = actions[i];
                if (usesAnyController)
                {
                    for (int controller = 0; controller < ActionsInterface.maxControllers; controller++)
                    {
                        if (ActionsInterface.GetActionDown(action, false, controller, false))
                        {
                            Debug.Log("GOT ACTION " + action);
                            return(new Vector2Int(action, controller));
                        }
                    }
                }
                else
                {
                    if (ActionsInterface.GetActionDown(action, false, usingController, false))
                    {
                        return(new Vector2Int(action, usingController));
                    }
                }
            }
            return(new Vector2Int(-1, usingController));
        }
Esempio n. 6
0
        public static void LinkActionCallback(Object stateInfo)
        {
            Message          m             = (Message)stateInfo;
            ConnectionHelper ch            = Program.toMihf;
            ushort           transactionID = m.MIHHeader.TransactionID;

            Payload.TLVIterator it = m.Payload.GetTLVIterator();
            ID srcID = new ID(new OctetString(it.Next().Value));
            ID dstID = new ID(new OctetString(it.Next().Value));
            Link_Action_Request lar = new Link_Action_Request(MIHDeserializer.DeserializeLinkAction(it.Next()),
                                                              MIHDeserializer.DeserializeTimeInterval(it.Next()),
                                                              MIHDeserializer.DeserializePoA(it.Next()));

            Link_Action_Response laresp = new Link_Action_Response();

            laresp.Status = STATUS.UNSPECIFIED_FAILURE;
            laresp.Result = Link_Ac_Result.INCAPABLE;

            NativeWifi.WlanClient.WlanInterface iface = null;
            try { iface = Information.GenericInfo.WlanInterfaceInstance; }
            catch (Exception e) { /*nothing*/ }
            switch (lar.LinkAction.LinkAcType)
            {
            case Link_Ac_Type.LINK_DISCONNECT:
                ActionsInterface.Action_Disconnect(ref laresp, ref iface);
                break;

            case Link_Ac_Type.NONE:
                Console.WriteLine("No action performed.");
                laresp.Status = STATUS.SUCCESS;
                laresp.Result = Link_Ac_Result.SUCCESS;
                break;

            case Link_Ac_Type.LINK_POWER_DOWN:
                ActionsInterface.Action_Power_Down(ref laresp, ref iface);
                break;

            case Link_Ac_Type.LINK_POWER_UP:
                ActionsInterface.Action_Power_Up(ref laresp, ref iface);
                break;

            default:
                throw new InvalidOperationException("Unsupported Operation");
            }
            laresp.ScanResults = new List <Link_Scan_Rsp>();
            if (lar.LinkAction.LinkAcAttr.Link_Scan)
            {
                ActionsInterface.Action_Scan(laresp, iface, m);//Message is sent inside this  branch, after the scan is complete.
            }
            else
            {
                ch.Send(ResponseBuilders.Link_Action_Response_Builder(srcID, dstID, transactionID, laresp).ByteValue);
            }
        }
Esempio n. 7
0
 public static void MarkAllSelectionAxesUnoccupied()
 {
     for (int i = 0; i < settings.horizontalAxes.Length; i++)
     {
         ActionsInterface.MarkAxisUnoccupied(settings.horizontalAxes[i]);
     }
     for (int i = 0; i < settings.verticalAxes.Length; i++)
     {
         ActionsInterface.MarkAxisUnoccupied(settings.verticalAxes[i]);
     }
 }
        void Update()
        {
            // rayHitPoint = referenceTransform.position;
            if (findInteractables)
            {
                FindInteractables();
            }
            else
            {
                SetInteractable(null);
                // hoverLocked = false;
                usingRay = false;
            }

            if (interactable != null)
            {
                interactable.OnInspectedUpdate(this, baseInteractor.interactionMode);

                if (onInspectUpdate != null)
                {
                    onInspectUpdate(this, interactable);
                }

                if (interactable.useType != Interactable.UseType.Scripted)
                {
                    for (int i = 0; i < currentActionOptions.Count; i++)
                    {
                        int action = currentActionOptions[i];
                        if (ActionsInterface.GetActionDown(action, controller: associatedController))
                        {
                            interactable.BroadcastActionChange(this, baseInteractor.interactionMode, action, StateChange.Start);
                        }
                        if (ActionsInterface.GetAction(action, controller: associatedController))
                        {
                            interactable.BroadcastActionChange(this, baseInteractor.interactionMode, action, StateChange.Update);
                        }
                        if (ActionsInterface.GetActionUp(action, controller: associatedController))
                        {
                            interactable.BroadcastActionChange(this, baseInteractor.interactionMode, action, StateChange.End);
                        }
                    }
                }
            }
        }
Esempio n. 9
0
        void UpdateScope()
        {
            if (GameManager.isPaused)
            {
                return;
            }

            if (ActionsInterface.GetActionDown(scopeAction))
            {
                UIManager.ShowScopeOverlay(scopeSprites.GetRandom(null), .1f);
                UIManager.EnableCrosshair(-1);
            }
            if (ActionsInterface.GetActionUp(scopeAction))
            {
                // Debug.Log("DISABLING");
                UIManager.DisableScopeOverlay(.1f);
                UIManager.EnableCrosshair(Random.Range(0, maxCrosshairs));
            }
        }
Esempio n. 10
0
 public static void MarkAllBaseUIInputsUnoccupied()
 {
     MarkAllSelectionAxesUnoccupied();
     ActionsInterface.MarkActionUnoccupied(settings.cancelAction);
 }
Esempio n. 11
0
 public static void MarkAllBaseUIInputsOccupied()
 {
     MarkAllSelectionAxesOccupied();
     ActionsInterface.MarkActionOccupied(settings.cancelAction, usingController);
 }
Esempio n. 12
0
 public static float GetAxis(int axisIndex)
 {
     return(ActionsInterface.GetAxis(axisIndex, usingController, false));
 }
Esempio n. 13
0
 public static bool GetAction(int action, bool checkingAxis)
 {
     return(ActionsInterface.GetAction(action, checkingAxis, usingController, false));
 }
Esempio n. 14
0
 public static bool GetMouseButton(int button)
 {
     return(ActionsInterface.GetMouseButton(button, usingController, false));
 }