private void ShieldIteration() { if (energyMixin.charge < energyMixin.capacity * 0.2f) { ErrorMessage.AddDebug("Warning!\nLow Power!\nEnergy Shield Disabled!"); StopShield(); thisSeamoth.SlotKeyDown(GetShieldSlot()); } else if (!energyMixin.ConsumeEnergy(shieldPowerCost)) { StopShield(); } }
public void Update() { if (laserCannonEnabled) { if (energyMixin.charge < energyMixin.capacity * 0.1f) { if (idleTimer > 0f) { toggle = false; shoot = false; repeat = false; idleTimer = Mathf.Max(0f, idleTimer - Time.deltaTime); HandReticle.main.SetInteractText("Warning!\nLow Power!", "Laser Cannon Disabled!", false, false, HandReticle.Hand.None); Modules.SetInteractColor(Modules.Colors.Red); } else { idleTimer = 3; seamoth.SlotKeyDown(slotID); } } if (toggle) { if (GameInput.GetButtonDown(GameInput.Button.LeftHand)) { shoot = true; } if (GameInput.GetButtonUp(GameInput.Button.LeftHand)) { shoot = false; laserBeam.SetActive(false); } if (shoot) { RepeatCycle(Time.time, 0.4f); } } } }
private void Update() { if (!isSeamothArmSlotsReady || armsDirty) { return; } bool pilotingMode = seamoth.GetPilotingMode(); bool flag2 = pilotingMode && !seamoth.docked; #if DEBUG pilotingMode = true; flag2 = true; if (Input.GetKeyDown(KeyCode.LeftArrow)) { if (currentSelectedArm != SeamothArm.Left) { seamoth.SlotKeyDown(LeftArmSlotID); } seamoth.SendMessage("SlotLeftDown"); } if (Input.GetKeyDown(KeyCode.RightArrow)) { if (currentSelectedArm != SeamothArm.Right) { seamoth.SlotKeyDown(RightArmSlotID); } seamoth.SendMessage("SlotLeftDown"); } if (Input.GetKeyUp(KeyCode.LeftArrow) || Input.GetKeyUp(KeyCode.RightArrow)) { seamoth.SendMessage("SlotLeftUp"); } #endif if (pilotingMode) { if (AvatarInputHandler.main.IsEnabled()) { Vector3 eulerAngles = seamoth.transform.eulerAngles; eulerAngles.x = MainCamera.camera.transform.eulerAngles.x; Quaternion quaternion = Quaternion.Euler(eulerAngles.x, eulerAngles.y, eulerAngles.z); Quaternion rotation = quaternion; if (flag2) { aimTargetLeft.transform.position = MainCamera.camera.transform.position + quaternion * Vector3.forward * 100f; aimTargetRight.transform.position = MainCamera.camera.transform.position + rotation * Vector3.forward * 100f; } bool hasPropCannon = false; if (currentSelectedArm == SeamothArm.Left && leftArm != null) { leftArm.Update(ref quaternion); hasPropCannon = leftArm.HasPropCannon(); } else if (currentSelectedArm == SeamothArm.Right && rightArm != null) { rightArm.Update(ref rotation); hasPropCannon = rightArm.HasPropCannon(); } if (hasPropCannon) { UpdateUIText(hasPropCannon); } if (GameInput.GetButtonDown(GameInput.Button.AltTool)) { if (currentSelectedArm == SeamothArm.Left && leftArm != null) { leftArm.OnAltDown(); } else if (currentSelectedArm == SeamothArm.Right && rightArm != null) { rightArm.OnAltDown(); } } } UpdateActiveTarget(HasClaw(), HasDrill()); } }