示例#1
0
        public override void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
        {
            MyAnalyticsHelper.ReportActivityStartIf(!m_activated, this.Owner, "Welding", "Character", "HandTools", "Welder", false);

            base.Shoot(action, direction, gunAction);

            if (action == MyShootActionEnum.PrimaryAction /* && IsPreheated*/ && Sync.IsServer)
            {
                var block = GetTargetBlock();
                if (block != null && CanWeld(block) && m_activated)
                {
                    Weld();
                }
                else
                {
                    var info = FindProjectedBlock();
                    if (info.raycastResult == MyProjector.BuildCheckResult.OK)
                    {
                        if (MySession.Static.CreativeMode || MyBlockBuilderBase.SpectatorIsBuilding || Owner.CanStartConstruction(info.hitCube.BlockDefinition))
                        {
                            info.cubeProjector.Build(info.hitCube, Owner.ControllerInfo.Controller.Player.Identity.IdentityId, Owner.EntityId);
                        }
                        else
                        {
                            MyBlockPlacerBase.OnMissingComponents(info.hitCube.BlockDefinition);
                        }
                    }
                }
            }
            else if (action == MyShootActionEnum.SecondaryAction && Sync.IsServer)
            {
                FillStockpile();
            }
            return;
        }
        public override void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
        {
            MyAnalyticsHelper.ReportActivityStartIf(!m_activated, this.Owner, "Grinding", "Character", "HandTools", "AngleGrinder", true);

            base.Shoot(action, direction, gunAction);

            if (action == MyShootActionEnum.PrimaryAction && IsPreheated && Sync.IsServer && m_activated)
            {
                Grind();
            }
            return;
        }
示例#3
0
        public override void Shoot(MyShootActionEnum action, Vector3 direction, Vector3D?overrideWeaponPos, string gunAction)
        {
            MyAnalyticsHelper.ReportActivityStartIf(!m_activated, this.Owner, "Welding", "Character", "HandTools", "Welder", true);

            base.Shoot(action, direction, overrideWeaponPos, gunAction);

            if (action == MyShootActionEnum.PrimaryAction /* && IsPreheated*/)
            {
                var block = GetTargetBlock();
                if (block != null && m_activated)
                {
                    if (Sync.IsServer && CanWeld(block))
                    {
                        Weld();
                    }
                }
                else if (Owner == MySession.Static.LocalCharacter)
                {
                    var info = FindProjectedBlock();
                    if (info.raycastResult == BuildCheckResult.OK)
                    {
                        if (IsWithinWorldLimits(info.cubeProjector.CubeGrid, Owner.ControllerInfo.Controller.Player.Identity.IdentityId, info.hitCube.BlockDefinition.BlockPairName))
                        {
                            if (MySession.Static.CreativeMode || MyBlockBuilderBase.SpectatorIsBuilding || Owner.CanStartConstruction(info.hitCube.BlockDefinition) || MySession.Static.IsAdminModeEnabled(Sync.MyId))
                            {
                                info.cubeProjector.Build(info.hitCube, Owner.ControllerInfo.Controller.Player.Identity.IdentityId, Owner.EntityId, builtBy: Owner.ControllerInfo.Controller.Player.Identity.IdentityId);
                            }
                            else
                            {
                                MyBlockPlacerBase.OnMissingComponents(info.hitCube.BlockDefinition);
                            }
                        }
                        else
                        {
                            MyGuiAudio.PlaySound(MyGuiSounds.HudUnable);
                            MyHud.Notifications.Add(MyNotificationSingletons.ShipOverLimits);
                        }
                    }
                }
            }
            else if (action == MyShootActionEnum.SecondaryAction && Sync.IsServer)
            {
                FillStockpile();
            }
            return;
        }
示例#4
0
        public void Shoot(MyShootActionEnum action, Vector3 direction, string gunAction)
        {
            MyAnalyticsHelper.ReportActivityStartIf(!IsShooting, this.Owner, "Drilling", "Character", "HandTools", "HandDrill", false);

            DoDrillAction(collectOre: action == MyShootActionEnum.PrimaryAction);
        }