Example #1
0
        public bool WillInteract(HandApply interaction, NetworkSide side)
        {
            if (DefaultWillInteract.HandApply(interaction, side) == false)
            {
                return(false);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Wrench))
            {
                return(true);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Welder))
            {
                return(true);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Id))
            {
                return(true);
            }

            if (interaction.HandObject == null)
            {
                return(true);
            }

            return(false);
        }
    public bool WillInteract(HandApply interaction, NetworkSide side)
    {
        if (DefaultWillInteract.HandApply(interaction, side) == false)
        {
            return(false);
        }
        if (interaction.HandObject != this.gameObject)
        {
            return(false);
        }
        var Healthv2 = interaction.TargetObject.GetComponent <LivingHealthMasterBase>();

        if (Healthv2 == null)
        {
            return(false);
        }
        var equipment = interaction.Performer.GetComponent <Equipment>();

        if (equipment == null)
        {
            return(false);
        }
        var ObjectInSlot = equipment.GetClothingItem(NamedSlot.back).GameObjectReference;

        if (ObjectInSlot == null)
        {
            return(false);
        }
        if (Validations.HasItemTrait(ObjectInSlot, DefibrillatorTrait) == false)
        {
            return(false);
        }
        return(true);
    }
Example #3
0
    public bool Interact(HandApply interaction)
    {
        if (!DefaultWillInteract.HandApply(interaction, NetworkSide.Client))
        {
            return(false);
        }

        if (!SelfPowered)
        {
            if (RelatedAPC == null)
            {
                return(false);
            }
            if (RelatedAPC.Voltage == 0f)
            {
                return(false);
            }
        }
        if (switchCoolDown)
        {
            return(false);
        }

        StartCoroutine(CoolDown());
        PlayerManager.LocalPlayerScript.playerNetworkActions.CmdToggleLightSwitch(gameObject);

        return(true);
    }
Example #4
0
        public bool WillInteract(HandApply interaction, NetworkSide side)
        {
            if (DefaultWillInteract.HandApply(interaction, side) == false)
            {
                return(false);
            }

            return(Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Emag));
        }
Example #5
0
    public bool Interact(HandApply interaction)
    {
        if (!DefaultWillInteract.HandApply(interaction, NetworkSide.Client))
        {
            return(false);
        }

        InteractionMessageUtils.SendRequest(interaction, this);
        return(true);
    }
Example #6
0
    public bool ServerProcessInteraction(HandApply interaction)
    {
        if (!DefaultWillInteract.HandApply(interaction, NetworkSide.Server))
        {
            return(false);
        }

        isOn = !isOn;
        UpdateServerState(isOn);
        return(true);
    }
Example #7
0
        public bool WillInteract(HandApply interaction, NetworkSide side)
        {
            if (!DefaultWillInteract.HandApply(interaction, side))
            {
                return(false);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Screwdriver))
            {
                return(true);
            }

            return(false);
        }
Example #8
0
        public bool WillInteract(HandApply interaction, NetworkSide side)
        {
            if (DefaultWillInteract.HandApply(interaction, side) == false)
            {
                return(false);
            }

            if (Validations.HasItemTrait(interaction.HandObject, deconstructToolTrait))
            {
                return(true);
            }

            return(false);
        }
Example #9
0
 public bool WillInteract(HandApply interaction, NetworkSide side)
 {
     //using wrench
     if (DefaultWillInteract.HandApply(interaction, side) &&
         Validations.HasItemTrait(interaction.UsedObject, CommonTraits.Instance.Wrench))
     {
         return(true);
     }
     //using any fillable gas container
     else if (DefaultWillInteract.HandApply(interaction, side) &&
              Validations.HasItemTrait(interaction.UsedObject, CommonTraits.Instance.CanisterFillable))
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
    public bool Interact(HandApply interaction)
    {
        if (!DefaultWillInteract.HandApply(interaction, NetworkSide.Client))
        {
            return(false);
        }

        if (interaction.TargetObject != gameObject)
        {
            return(false);
        }

        if (!Validations.HasComponent <Welder>(interaction.HandObject))
        {
            return(false);
        }

        PlayerManager.PlayerScript.playerNetworkActions.CmdRefillWelder(interaction.HandObject, gameObject);
        return(true);
    }
Example #11
0
        public bool WillInteract(HandApply interaction, NetworkSide side)
        {
            if (!DefaultWillInteract.HandApply(interaction, side))
            {
                return(false);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Wrench))
            {
                return(true);
            }

            if (interaction.HandObject == null)
            {
                return(true);
            }

            //TODO adding/removing tank logic

            return(false);
        }
Example #12
0
    public bool Interact(HandApply interaction)
    {
        if (!DefaultWillInteract.HandApply(interaction, NetworkSide.Client))
        {
            return(false);
        }

        //if the button is idle and not animating it can be pressed
        //this is weird it should check all children objects to see if they are idle and finished
        if (animator.GetCurrentAnimatorStateInfo(0).IsName("Idle"))
        {
            PlayerManager.LocalPlayerScript.playerNetworkActions.CmdToggleShutters(gameObject);
            return(true);
        }
        else
        {
            Logger.Log("DOOR NOT FINISHED CLOSING YET!", Category.Shutters);
        }

        return(false);
    }
Example #13
0
        public bool WillInteract(HandApply interaction, NetworkSide side)
        {
            if (DefaultWillInteract.HandApply(interaction, side) == false)
            {
                return(false);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Welder))
            {
                return(true);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Wrench))
            {
                return(true);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.Screwdriver))
            {
                return(true);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.GlassSheet))
            {
                return(true);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.ReinforcedGlassSheet))
            {
                return(true);
            }

            if (Validations.HasItemTrait(interaction.HandObject, CommonTraits.Instance.DiamondSheet))
            {
                return(true);
            }

            return(false);
        }
Example #14
0
 protected override bool WillInteract(HandApply interaction, NetworkSide side)
 {
     //only wrench can be used
     return(DefaultWillInteract.HandApply(interaction, side) &&
            Validations.IsTool(interaction.UsedObject, ToolType.Wrench));
 }
Example #15
0
 public bool WillInteract(HandApply interaction, NetworkSide side)
 {
     //only wrench can be used
     return(DefaultWillInteract.HandApply(interaction, side) &&
            Validations.HasItemTrait(interaction.UsedObject, CommonTraits.Instance.Wrench));
 }