public static void Postfix(bool __result, ExosuitClawArm __instance, float ___cooldownTime)
 {
     if (__result)
     {
         NitroxServiceLocator.LocateService <ExosuitModuleEvent>().BroadcastClawUse(__instance, ___cooldownTime);
     }
 }
Esempio n. 2
0
 public void UseClaw(ExosuitClawArm clawArm, ExosuitArmAction armAction)
 {
     if (armAction == ExosuitArmAction.startUseTool)
     {
         clawArm.animator.SetTrigger("use_tool");
     }
     else if (armAction == ExosuitArmAction.altHit)
     {
         clawArm.animator.SetTrigger("bash");
         clawArm.fxControl.Play(0);
     }
 }
Esempio n. 3
0
 public void UseClaw(ExosuitClawArm clawArm, ExosuitArmAction armAction)
 {
     if (armAction == ExosuitArmAction.START_USE_TOOL)
     {
         clawArm.animator.SetTrigger("use_tool");
     }
     else if (armAction == ExosuitArmAction.ALT_HIT)
     {
         clawArm.animator.SetTrigger("bash");
         clawArm.fxControl.Play(0);
     }
 }
Esempio n. 4
0
        public static bool Prefix(ExosuitClawArm __instance)
        {
            Exosuit componentInParent = __instance.GetComponentInParent <Exosuit>();

            if (componentInParent.GetActiveTarget())
            {
                Pickupable pickupable = componentInParent.GetActiveTarget().GetComponent <Pickupable>();
                PickPrefab component  = componentInParent.GetActiveTarget().GetComponent <PickPrefab>();
                if (pickupable != null && pickupable.isPickupable && componentInParent.storageContainer.container.HasRoomFor(pickupable))
                {
                    NitroxServiceLocator.LocateService <Item>().PickedUp(pickupable.gameObject, pickupable.GetTechType());
                }
                else if (component != null)
                {
                    Log.Debug("Delete Pickprefab for exosuit claw arm");
                    NitroxServiceLocator.LocateService <Item>().PickedUp(component.gameObject, component.pickTech);
                }
            }
            return(true);
        }
Esempio n. 5
0
        public void BroadcastClawUse(ExosuitClawArm clawArm, float cooldown)
        {
            NitroxId         id = NitroxEntity.GetId(clawArm.gameObject);
            ExosuitArmAction action;

            // If cooldown of claw arm matches pickup cooldown, the exosuit arm performed a pickup action
            if (cooldown == clawArm.cooldownPickup)
            {
                action = ExosuitArmAction.startUseTool;
            } // Else if it matches the punch cooldown, it has punched something (or nothing but water, who knows)
            else if (cooldown == clawArm.cooldownPunch)
            {
                action = ExosuitArmAction.altHit;
            }
            else
            {
                Log.Error("Cooldown time does not match pickup or punch time");
                return;
            }
            BroadcastArmAction(TechType.ExosuitClawArmModule, clawArm, action, Optional <Vector3> .Empty(), Optional <Quaternion> .Empty());
        }
Esempio n. 6
0
        public void BroadcastClawUse(ExosuitClawArm clawArm, float cooldown)
        {
            NitroxId         id = NitroxEntity.GetId(clawArm.gameObject);
            ExosuitArmAction action;

            // If cooldown of claw arm matches pickup cooldown, the exosuit arm performed a pickup action
            if (cooldown == clawArm.cooldownPickup)
            {
                action = ExosuitArmAction.START_USE_TOOL;
            } // Else if it matches the punch cooldown, it has punched something (or nothing but water, who knows)
            else if (cooldown == clawArm.cooldownPunch)
            {
                action = ExosuitArmAction.ALT_HIT;
            }
            else
            {
                Log.Error("Cooldown time does not match pickup or punch time");
                return;
            }
            BroadcastArmAction(TechType.ExosuitClawArmModule, clawArm, action, null, null);
        }
Esempio n. 7
0
        public void BroadcastClawUse(ExosuitClawArm clawArm, float cooldown)
        {
            string           guid = GuidHelper.GetGuid(clawArm.gameObject);
            ExosuitArmAction action;

            // If cooldown of claw arm matches pickup cooldown, the exosuit arm performed a pickup action
            if (cooldown == clawArm.cooldownPickup)
            {
                action = ExosuitArmAction.startUseTool;
            } // Else if it matches the punch cooldown, it has punched something (or nothing but water, who knows)
            else if (cooldown == clawArm.cooldownPunch)
            {
                action = ExosuitArmAction.altHit;
            }
            else
            {
                Log.Error("Cooldown time does not match pickup or punch time");
                return;
            }
            BroadcastArmAction(TechType.ExosuitClawArmModule, clawArm, action);
        }