Example #1
0
        /*
         * internal bool blaklist(NonAddresseS2 nonAddresseS)
         * {
         *  //            this.TGs.emplacement.Contains(x => x.);
         *  return TGs.emplacement.Contains(new TG.Doubleint { rayon = nonAddresseS.Alle, trave = nonAddresseS.Trave });
         * }*/

        private Parameters()
        {
            this.prod   = new Prod();
            this.TGs    = new TG();
            this.ps     = new LisSecteur();
            this.emag   = new Emag();
            this.client = new ClientPar();
        }
Example #2
0
        /// <summary>
        /// Checks to see if a door can be emagged, does checks for BumpInteraction and Hand Interactions.
        /// </summary>
        /// <param name="itemStorage">The player's inventory that may contain the emag</param>
        /// <param name="interaction">If we're calling this from ClosedInteraction() to provide a HandApply</param>
        /// <param name="States">Door process states</param>
        /// <returns>Either hacked or ModuleSignal.Continue</returns>
        private ModuleSignal EmagChecks(DynamicItemStorage itemStorage, HandApply interaction, HashSet <DoorProcessingStates> States)
        {
            if (itemStorage != null)
            {
                try
                {
                    Emag emagInHand = itemStorage.GetActiveHandSlot().Item?.OrNull().gameObject.GetComponent <Emag>()?.OrNull();
                    if (emagInHand != null)
                    {
                        if (interaction != null)
                        {
                            if (emagInHand.UseCharge(interaction))
                            {
                                return(EmagSuccessLogic(States));
                            }
                        }
                        if (emagInHand.UseCharge(gameObject, itemStorage.registerPlayer.PlayerScript.gameObject))
                        {
                            return(EmagSuccessLogic(States));
                        }
                    }

                    foreach (var item in itemStorage.GetNamedItemSlots(NamedSlot.id))
                    {
                        Emag emagInIdSlot = item.Item?.OrNull().gameObject.GetComponent <Emag>()?.OrNull();
                        if (emagInIdSlot == null)
                        {
                            continue;
                        }
                        if (interaction != null)
                        {
                            if (emagInIdSlot.UseCharge(interaction))
                            {
                                return(EmagSuccessLogic(States));
                            }
                        }
                        if (emagInIdSlot.UseCharge(gameObject, itemStorage.registerPlayer.PlayerScript.gameObject))
                        {
                            return(EmagSuccessLogic(States));
                        }
                    }
                }
                catch (NullReferenceException exception)
                {
                    Logger.LogError(
                        $"A NRE was caught in EmagInteractionModule.ClosedInteraction() {exception.Message} \n {exception.StackTrace}",
                        Category.Interaction);
                }
            }

            return(ModuleSignal.Continue);
        }
Example #3
0
 public void PerformEmag(Emag emag, HandApply interaction)
 {
     if (MobController == null)
     {
         return;
     }
     MobController.IsEmagged = true;
     if (EMAGGED_SPRITE != null && spriteHandler != null)
     {
         spriteHandler.SetSprite(EMAGGED_SPRITE);
     }
     emag.UseCharge(interaction);
 }
Example #4
0
        /// <summary>
        /// Checks to see if a door can be emagged, does checks for BumpInteraction and Hand Interactions.
        /// </summary>
        /// <param name="itemStorage">The player's inventory that may contain the emag</param>
        /// <param name="interaction">If we're calling this from ClosedInteraction() to provide a HandApply</param>
        /// <param name="States">Door process states</param>
        /// <returns>Either hacked or ModuleSignal.Continue</returns>
        private ModuleSignal EmagChecks(DynamicItemStorage itemStorage, HandApply interaction,
                                        HashSet <DoorProcessingStates> States)
        {
            if (itemStorage != null)
            {
                Emag emagInHand = itemStorage.OrNull()?.GetActiveHandSlot()?.Item.OrNull()?.gameObject.OrNull()?.GetComponent <Emag>()?.OrNull();
                if (emagInHand != null)
                {
                    if (interaction != null)
                    {
                        if (emagInHand.UseCharge(interaction))
                        {
                            return(EmagSuccessLogic(States));
                        }
                    }

                    if (emagInHand.UseCharge(gameObject, itemStorage.registerPlayer.PlayerScript.gameObject))
                    {
                        return(EmagSuccessLogic(States));
                    }
                }

                foreach (var item in itemStorage.GetNamedItemSlots(NamedSlot.id))
                {
                    Emag emagInIdSlot = item?.Item.OrNull()?.gameObject.GetComponent <Emag>()?.OrNull();
                    if (emagInIdSlot == null)
                    {
                        continue;
                    }
                    if (interaction != null)
                    {
                        if (emagInIdSlot.UseCharge(interaction))
                        {
                            return(EmagSuccessLogic(States));
                        }
                    }

                    if (emagInIdSlot.UseCharge(gameObject, itemStorage.registerPlayer.PlayerScript.gameObject))
                    {
                        return(EmagSuccessLogic(States));
                    }
                }
            }

            return(ModuleSignal.Continue);
        }
Example #5
0
        public void PerformEmag(Emag emag, HandApply interaction)
        {
            if (MobController == null)
            {
                return;
            }

            MobController.IsEmagged = true;
            emag.UseCharge(interaction);
            Chat.AddActionMsgToChat(interaction,
                                    "The bot's behavior controls disengage. The bot begins to rattle and smolder",
                                    "You can smell caustic smoke from somewhere...");

            if (spriteHandler == null)
            {
                Logger.LogWarning($"{nameof(SpriteHandler)} missing on {gameObject}!", Category.Mobs);
                return;
            }

            spriteHandler.ChangeSprite(1, true);
        }
        public void ServerPerformInteraction(HandApply interaction)
        {
            if (interaction.HandSlot.Item.TryGetComponent <IDCard>(out var id))
            {
                CheckID(id.JobType, interaction.Performer);
                return;
            }
            Emag mag = interaction.HandSlot.Item.GetComponent <Emag>();

            if (mag == null || Emagged)
            {
                return;
            }
            if (mag.UseCharge(interaction))
            {
                Emagged   = true;
                CorrectID = true;
                if (cargoGUI)
                {
                    cargoGUI.pageCart.UpdateTab();
                }
            }
        }
Example #7
0
        private void TryEmag(HandApply interaction, Emag emag)
        {
            if (emag.EmagHasCharges() == false)
            {
                Chat.AddExamineMsgFromServer(interaction.Performer, "The emag is out of charges!");
                return;
            }

            if (lockState == Lock.Broken)
            {
                Chat.AddExamineMsgFromServer(
                    interaction.Performer,
                    "You wave the emag over the panel, but it looks to be already destroyed...");
                return;
            }

            SoundManager.PlayNetworkedAtPos(soundOnEmag, registerObject.WorldPositionServer, sourceObj: gameObject);

            emag.UseCharge(interaction);
            BreakLock();
            Chat.AddActionMsgToChat(interaction,
                                    "The access panel errors. A slight amount of smoke pours from behind the panel...",
                                    "You can smell caustic smoke from somewhere...");
        }