public override bool OnLeftHandUp() { var gameObject = default(GameObject); var dist = 0f; if (Targeting.GetTarget(100f, out gameObject, out dist)) { var connectable = gameObject.GetComponentInParent <Connectable>(); if (connectable != null && IsConnecting) { Connecting.OnConnectEnd(connectable); ConnectablesController.Connected.Add(Connecting.Identifier.Id, Connecting); ErrorMessage.AddMessage("Connected: " + Connecting.transform.name + " to: " + connectable.transform.name); return(base.OnLeftHandUp()); } } if (ConnectablesController.Connected.ContainsKey(Connecting.Identifier.Id)) { ConnectablesController.Connected.Remove(Connecting.Identifier.Id); } Connecting.ConnectedTo = null; Connecting = null; IsConnecting = false; return(base.OnLeftHandUp()); }
internal void RaycastMode_Update() { HandReticle.main.SetIcon(HandReticle.IconType.Scan); //Transform aimTransform = Player.main.camRoot.GetAimingTransform(); //if (Physics.Raycast(aimTransform.position, aimTransform.forward, out RaycastHit hitInfo, 15, 3)) if (Targeting.GetTarget(Player.main.gameObject, 10f, out GameObject target, out float distance)) { TechType techType = CraftData.GetTechType(target); //if (Targeting.GetRoot(target, out TechType techType, out GameObject root)) //{ //HandReticle.main.SetText(HandReticle.TextType.Hand, hitInfo.transform.name, false); HandReticle.main.SetText(HandReticle.TextType.Hand, $"Target: {target.name}\nTechType: {techType}\ndistance: {distance:F1} m", false); HandReticle.main.SetText(HandReticle.TextType.HandSubscript, handSubScript, false, GameInput.Button.RightHand); if (Input.GetMouseButton(1)) { //OnBaseObjectChange(hitInfo.transform.gameObject); OnBaseObjectChange(target); isRayEnabled = false; OutputWindow_Log(MESSAGE_TEXT[MESSAGES.RAYCAST_STATE], isRayEnabled); } //} } }
void UpdateActiveTarget() { if (GetLastDockedOnMapRoom().storageContainer.container.GetCount(Main.pickupModule.TechType) > 0) { Targeting.GetTarget(gameObject, 7f, out GameObject target, out float distance, null); var root = UWE.Utils.GetEntityRoot(target); root = root != null ? root : target; if (root.GetComponentProfiled <Pickupable>() is not null && CraftData.GetTechType(root) != TechType.MapRoomCamera) { target = root; } else { target = null; } _activeTarget = target; var guiHand = Player.main.GetComponent <GUIHand>(); if (_activeTarget is not null) { GUIHand.Send(_activeTarget, HandTargetEventType.Hover, guiHand); } }
public static void Postfix() { if (uGUI_BuilderMenu.IsOpen() || !Input.GetMouseButton(2) || Builder.isPlacing) { return; } if (!Targeting.GetTarget(Player.main.gameObject, 200f, out var result, out _)) { return; } if (!Targeting.GetRoot(result, out var techType, out var gameObject) #if SN1 || !CraftData.IsBuildableTech(techType) #elif BZ || !TechData.GetBuildable(techType) #endif ) { return; } #if SN1 if (Builder.Begin(gameObject)) { ErrorMessage.AddMessage($"Placing new {techType}"); } else { Builder.End(); } #elif BZ CoroutineHost.StartCoroutine(Builder.BeginAsync(techType)); ErrorMessage.AddMessage($"Placing new {techType}"); #endif }
private async void StartSimpleRun() { //var acd = ActorCommonDataHelper.EnumerateMonsters().Where(x => x.x004_Name.StartsWith("Templar")); //var localAcd = acd.Last(); while (IsBotRunning) { var target = Targeting.GetTarget(); if (target != null) { Vector3 currentCharGameLoc = new Vector3() { X = target.x0D0_WorldPosX, Y = target.x0D4_WorldPosY, Z = target.x0D8_WorldPosZ }; var moveToResult = await Core.Util.MoveTo.MoveToPosWithNavMeshAsync(currentCharGameLoc); } } //foreach (var acd in ActorCommonDataHelper.EnumerateMonsters().Where(x => x.x0D0_WorldPosX > 0 && x.x188_Hitpoints > 00001 && x.x190_TeamId == 10)) //{ // Vector3 currentCharGameLoc = new Vector3() { X = acd.x0D0_WorldPosX, Y = acd.x0D4_WorldPosY, Z = acd.x0D8_WorldPosZ }; // var moveToResult = await Core.Util.MoveTo.MoveToPosWithNavMeshAsync(currentCharGameLoc); // // await Core.Util.Attack.AttackAcdAsync(acd); // if (!IsBotRunning) // return; //} }
public override bool OnLeftHandDown() { var gameObject = default(GameObject); var dist = 0f; if (Targeting.GetTarget(100f, out gameObject, out dist)) { ErrorMessage.AddMessage("Hit Object: " + gameObject.name); var connectable = gameObject.GetComponentInParent <Connectable>(); if (connectable != null) { IsConnecting = true; Connecting = connectable; Connecting.OnConnectStart(); ErrorMessage.AddMessage("Connecting: " + Connecting.transform.name); } } else { ErrorMessage.AddMessage("Did not hit Object!"); } return(base.OnLeftHandDown()); }
//--------------------------------------------------------------------------------------------- public void SummonSelectedGolem(string target) { if (CalExtension.Abilities.GolemMaster.AdaHammer.Exist) { if (this.selectedGolem != null && World.Player.Backpack.AllItems.FindType(this.selectedGolem.Graphic, this.selectedGolem.Color).Exist) { UOItem shrinkGolem = World.Player.Backpack.AllItems.FindType(this.selectedGolem.Graphic, this.selectedGolem.Color); TargetInfo tInfo = Targeting.GetTarget(target); if (tInfo.Success) { World.CharacterAppeared += World_CharacterAppeared; shrinkGolem.Move(1, tInfo.StaticTarget.X, tInfo.StaticTarget.Y, tInfo.StaticTarget.Z); Game.Wait(); UO.WaitTargetObject(shrinkGolem); CalExtension.Abilities.GolemMaster.AdaHammer.Use(); } } else { Game.PrintMessage("Vybrany golem uz neni!"); } } else { World.Player.PrintMessage("[Neni adahammer..]"); } }
public static void RenameKeys(string name) { Game.PrintMessage("Vyber pytlik s klicky"); UOItem cont = Targeting.GetTarget("").Item; if (cont.Exist) { List <UOItem> keys = new List <UOItem>(); keys.AddRange(cont.Items.Where(itm => itm.Graphic == ItemLibrary.BlankMagicKey.Graphic && itm.Color == ItemLibrary.BlankMagicKey.Color).ToArray()); List <UOItem> renamed = new List <UOItem>(); foreach (UOItem key in keys) { if (key.Move(1, World.Player.Backpack)) { Game.Wait(500); RenameKey(key, name); Game.Wait(1000); renamed.Add(key); } } } }
private void SetBeamTarget() { if (Targeting.GetTarget(This_Cyclops_Root, maxLaserDistance, out targetGameobject, out targetDist)) { lock (targetGameobject) { if (isOnlyHostile) { Targeting.GetRoot(targetGameobject, out TechType targetTechType, out GameObject examinedGameObject); if (!validTargets.Contains(targetTechType)) { CalculateBeamVectors(targetDist); return; } } CalculateBeamVectors(targetDist); AddDamageToTarget(targetGameobject); AddForceToTarget(Player.main.camRoot.GetAimingTransform(), targetGameobject); } } else { CalculateBeamVectors(maxLaserDistance); } }
private void SetBeamTarget() { if (Targeting.GetTarget(thisSeamoth.gameObject, maxLaserDistance, out targetGameobject, out targetDist)) { lock (targetGameobject) { if (isOnlyHostile) { Targeting.GetRoot(targetGameobject, out TechType targetTechType, out GameObject examinedGameObject); if (!validTargets.Contains(targetTechType)) { CalculateBeamVectors(targetDist); return; } } CalculateBeamVectors(targetDist); AddDamageToTarget(targetGameobject); AddForceToTarget(); } } else { CalculateBeamVectors(maxLaserDistance); } }
void UpdateActiveTarget(Vehicle vehicle) { // Get the GameObject we're looking at var activeTarget = default(GameObject); Targeting.GetTarget(vehicle.gameObject, 6f, out activeTarget, out float dist, null); // Check if not null if (activeTarget != null) { // Get the root object, or the hit object if root is null var root = UWE.Utils.GetEntityRoot(activeTarget) ?? activeTarget; if (root.GetComponentProfiled <Pickupable>()) { activeTarget = root; } else { root = null; } } // Get the GUIHand component var guiHand = Player.main.GetComponent <GUIHand>(); if (activeTarget) { // Send the Hover message to the GameObject we're looking at. GUIHand.Send(activeTarget, HandTargetEventType.Hover, guiHand); } }
private void UpdateActiveTarget(bool canPickup, bool canDrill) { GameObject targetObject = null; ObjectType objectType = ObjectType.None; if (canPickup || canDrill) { Targeting.GetTarget(gameObject, 4.8f, out targetObject, out float num); } if (targetObject) { GameObject rootObject = UWE.Utils.GetEntityRoot(targetObject); rootObject = (!(rootObject != null)) ? targetObject : rootObject; if (rootObject.GetComponentProfiled <Pickupable>()) { if (rootObject.GetComponent <Pickupable>().isPickupable) { targetObject = rootObject; objectType = ObjectType.Pickupable; } else { targetObject = null; } } else if (rootObject.GetComponentProfiled <Drillable>()) { targetObject = rootObject; objectType = ObjectType.Drillable; } else { targetObject = null; } } activeTarget = targetObject; if (activeTarget && currentSelectedArm != SeaTruckArm.None) { if (canDrill && objectType == ObjectType.Drillable && GetSelectedArmTechType() == SeaTruckDrillArm_Prefab.TechTypeID) { GUIHand component = Player.main.GetComponent <GUIHand>(); GUIHand.Send(activeTarget, HandTargetEventType.Hover, component); } else if (canPickup && objectType == ObjectType.Pickupable && GetSelectedArmTechType() == SeaTruckClawArm_Prefab.TechTypeID) { Pickupable pickupable = activeTarget.GetComponent <Pickupable>(); TechType techType = pickupable.GetTechType(); HandReticle.main.SetText(HandReticle.TextType.Hand, LanguageCache.GetPickupText(techType), false, GameInput.Button.LeftHand); HandReticle.main.SetIcon(HandReticle.IconType.Hand, 1f); } } }
void tagetlaser(float range, LineRenderer lineder) { if (Targeting.GetTarget(Player.main.gameObject, range, out GameObject Target, out float dist)) { lineder.SetPosition(0, gameObject.FindChild("Point").transform.position); lineder.SetPosition(1, Player.main.camRoot.mainCamera.transform.forward * dist + Player.main.camRoot.mainCamera.transform.position); dis.transform.position = Player.main.camRoot.mainCamera.transform.forward * dist + Player.main.camRoot.mainCamera.transform.position; }
public static UOCharacter BandHealRess(string target) { Game.PrintMessage("BandHealRess - Ghosts: " + GhostCount()); if (Healing.CleanBandage.Exist) { TargetInfo tInfo = Targeting.GetTarget(target); if (tInfo.Success) { if (tInfo.Character.Distance <= 1) { tInfo.Character.Print(Game.Val_GreenBlue, "[Ressuji..]"); CastResultInfo info = Magery.Current.CastSpell(StandardSpell.GreaterHeal, tInfo.Character, true, false); if (info.NotInSpellBook) { info = Magery.Current.CastSpell(StandardSpell.Heal, tInfo.Character, false, false); } Game.Wait(250); Healing.CleanBandage.Use(); UO.WaitTargetObject(tInfo); LastCharacter = tInfo.Character; if (tInfo.Character.Distance <= 1) { World.Player.PrintMessage("[Ress done " + Healing.CleanBandage.Amount + "..]"); } Game.Wait(50); if (tInfo.Character.RequestStatus(125) && tInfo.Character.Hits > 0) { tInfo.Character.Print(Game.Val_GreenBlue, "[Ress OK " + tInfo.Character.Hits + "hp]"); } } else { tInfo.Character.Print(Game.Val_LightPurple, "[Daleko " + tInfo.Character.Distance + "...]"); } } else { World.Player.PrintMessage("[Zadny duch..]", MessageType.Warning); } } else { World.Player.PrintMessage("[Nemas bandage..]", MessageType.Error); } return(LastCharacter); }
private void TargetLaser(float range, LineRenderer lineRenderer) { Vector3 forward = Player.main.camRoot.mainCam.transform.forward; Vector3 position = Player.main.camRoot.mainCam.transform.position; if (Targeting.GetTarget(Player.main.gameObject, range, out GameObject gameObject, out float num)) { lineRenderer.enabled = true; lineRenderer.SetPosition(0, currentMuzzlePosition); lineRenderer.SetPosition(1, (forward * num) + position); LaserParticles.transform.position = (forward * num) + position; }
public static void CastWallTest() { TargetInfo targetInfo = Targeting.GetTarget(null); if (targetInfo.Success) { Game.PrintMessage(String.Format("[" + targetInfo.StaticTarget.X + ":" + targetInfo.StaticTarget.Y + "] {0:N4}", Robot.GetAngle(World.Player.GetPosition(), targetInfo.Position)) + ""); UO.WaitTargetTile(targetInfo.StaticTarget.X, targetInfo.StaticTarget.Y, targetInfo.StaticTarget.Z, targetInfo.StaticTarget.Graphic); UO.Cast(StandardSpell.WallofStone); } }
static void Prefix(BuilderTool __instance) { if (__instance.isDrawn && !Builder.isPlacing && AvatarInputHandler.main.IsEnabled()) { Targeting.GetTarget(Player.main.gameObject, 10f, out GameObject go, out float num, null); if (go) { DebrisPatcher.processObject(go); } } }
public static void UseKPZ(StandardSpell spell, string target) { UOItem kpz = World.Player.Backpack.AllItems.FindType(0x09B0, 0x0493); if (!kpz.Exist) { kpz = World.Player.Backpack.AllItems.FindType(0x09B0, 0x0494); } else { kpz.Use(); Game.Wait(150); } if (kpz.Exist) { if (spell == StandardSpell.Heal || spell == StandardSpell.GreaterHeal) { World.Player.PrintMessage("[KPZ << k sobe ]", Game.Val_LightGreen); } else if (spell == StandardSpell.Protection) { World.Player.PrintMessage("[KPZ >> k nemu]", Game.Val_LightGreen); } else if (spell == StandardSpell.ReactiveArmor) { World.Player.PrintMessage("[KPZ <> vymena]", Game.Val_LightGreen); } else { Game.PrintMessage("KPZ invalid spell!", MessageType.Error); return; } TargetInfo info = Targeting.GetTarget(target); if (info.Success && info.TargetType == TargetType.Object && info.Character.Exist) { info.Object.PrintMessage("[> KPZ <]", Game.Val_LightGreen); CastResultInfo castInfo = Magery.Current.CastSpell(spell, info, false, false); if (castInfo.Success) { Healing.LastCharacter = info.Character; Game.Wait(250); info.Character.RequestStatus(250); } } } else { Game.PrintMessage("Nemas u sebe KPZ"); } }
private void UpdateActiveTarget(bool canPickup, bool canDrill) { GameObject targetObject = null; TargetObjectType objectType = TargetObjectType.None; if (canPickup || canDrill) { Targeting.GetTarget(seamoth.gameObject, 4.8f, out targetObject, out float num, null); } if (targetObject) { GameObject rootObject = UWE.Utils.GetEntityRoot(targetObject); rootObject = (!(rootObject != null)) ? targetObject : rootObject; if (rootObject.GetComponentProfiled <Pickupable>()) { targetObject = rootObject; objectType = TargetObjectType.Pickupable; } else if (rootObject.GetComponentProfiled <Drillable>()) { targetObject = rootObject; objectType = TargetObjectType.Drillable; } else { targetObject = null; } } activeTarget = targetObject; if (activeTarget && currentSelectedArm != SeamothArm.None) { if (canDrill && objectType == TargetObjectType.Drillable && GetSelectedArm().HasDrill()) { GUIHand component = Player.main.GetComponent <GUIHand>(); GUIHand.Send(activeTarget, HandTargetEventType.Hover, component); } else if (canPickup && objectType == TargetObjectType.Pickupable && GetSelectedArm().HasClaw()) { Pickupable pickupable = activeTarget.GetComponent <Pickupable>(); TechType techType = pickupable.GetTechType(); HandReticle.main.SetInteractText(LanguageCache.GetPickupText(techType), false, HandReticle.Hand.Left); HandReticle.main.SetIcon(HandReticle.IconType.Hand, 1f); } } }
// Update is called once per frame void Update() { target = targetSys.GetTarget(); if (target != null) { vec = target.transform.position; } else { vec = noTarget; } rotateGunAsinc(vec); }
public void ExecuteAction(CombatCharacterScript user, TeamScript team) { if (Time.time >= CooldownFinish) { ActionInstance action = GenerateInstance(); action.User = user; action.Target = _targeting.GetTarget(user, team); action.Template = this; OnStart.Trigger(action); user.Character.OnActionStart.Trigger(action); action.Target.Character.OnEnemyActionStart.Trigger(action); } }
// Update is called once per frame void Update() { target = targetSys.GetTarget(); if (target != null) { vec = target.transform.position; } else { vec = noTarget; } rotateGunAsinc(vec); //rotate(vec); //Instantiate<GameObject>(BulletORbomb); // rotate(new Vector2(-5, 3)); }
public static void CastFromIron(string target, int ingotAmount) { UOItem ingots = World.Player.Backpack.AllItems.FindType(IronIngot.Graphic, IronIngot.Color); if (!AdaHammer.Exist) { World.Player.PrintMessage("[Neni adahammer..]", MessageType.Error); return; } if (!ingots.Exist || ingots.Amount < ingotAmount) { Game.PrintMessage(String.Format("Nemas dostatecny pocet Ironu ({0})", ingots.Amount), MessageType.Error); return; } string msg = "1x1"; if (ingotAmount >= 25) { msg = "3x3"; } World.Player.PrintMessage("[Wall " + msg + "...]", Game.Val_GreenBlue); TargetInfo targetInfo = Targeting.GetTarget(target); if (targetInfo.Success) { ushort distance = targetInfo.Position.Distance(); if (distance <= 3) { if (ingots.Move((ushort)ingotAmount, targetInfo.StaticTarget.X, targetInfo.StaticTarget.Y, targetInfo.StaticTarget.Z)) { UO.WaitTargetObject(ingots); AdaHammer.Use(); } } else { World.Player.PrintMessage("[3 policka max..]", Game.Val_LightPurple); Game.PrintMessage("Vzdalenost: " + distance, Game.Val_LightPurple); } } }
//--------------------------------------------------------------------------------------------- //TODO public CastResultInfo CastNecroSpell(NecromancySpell spell, string target) { Journal.Clear(); CastResultInfo info = new CastResultInfo(); info.Usage = CastUsage.Scrool; if (EnsureNecroScroll(spell)) { World.Player.PrintMessage(spell + "" /*+ " [" + World.Player.FindType(SpellScrool[spell]).Amount + "ks]"*/);//spis regy Game.RunScriptCheck(5000); TargetInfo tInfo = Targeting.GetTarget(target); if (tInfo.Success) { UOItem scroll = World.Player.FindType(SpellScrool[spell]); scroll.Use(); if (tInfo.Object.Exist) { UO.WaitTargetObject(tInfo); } else { UO.WaitTargetTile(tInfo.StaticTarget.X, tInfo.StaticTarget.Y, tInfo.StaticTarget.Z, tInfo.StaticTarget.Graphic); } if (Journal.WaitForText(true, 150, "You can't see the target", "Target is not in line of sight")) { if (Journal.Contains(true, "You can't see the target")) { info.CantSee = true; Game.PrintMessage("Cant SEE: " + tInfo.StaticTarget.Serial + " / " + tInfo.Object.Exist + " / " + tInfo.Character.Name); } else if (Journal.Contains(true, "Target is not in line of sight")) { info.NoInLineOfSight = true; tInfo.Object.PrintMessage("[Not in sight]", Game.Val_LightPurple); } } } } return(info); }
public static UOCharacter BloodyBandRessQuick(string target) { Game.PrintMessage("BloodyBandRessQuick - Ghosts: " + Healing.GhostCount()); if (Healing.BloodyBandage.Exist && Healing.BloodyBandage.Amount >= 50) { TargetInfo tInfo = Targeting.GetTarget(target); if (tInfo.Success) { if (tInfo.Character.Distance <= 1) { tInfo.Character.Print(Game.Val_GreenBlue, "[Ressuji Full..]"); Healing.BloodyBandage.Use(); UO.WaitTargetObject(tInfo); Healing.LastCharacter = tInfo.Character; if (tInfo.Character.Distance <= 1) { World.Player.PrintMessage("[Ress done " + Healing.BloodyBandage.Amount + "..]"); } Game.Wait(50); if (tInfo.Character.RequestStatus(125) && tInfo.Character.Hits > 0) { tInfo.Character.Print(Game.Val_GreenBlue, "[Ress OK " + tInfo.Character.Hits + "hp]"); } } else { tInfo.Character.Print(Game.Val_LightPurple, "[Daleko " + tInfo.Character.Distance + "...]"); } } else { World.Player.PrintMessage("[Zadny duch..]", MessageType.Warning); } } else { Game.PrintMessage("Nemas dost kvravych BAND! " + Healing.BloodyBandage.Amount); return(Healing.BandRessQuick()); } return(Healing.LastCharacter); }
// Update is called once per frame void Update() { if (fired) { target = targetSys.GetTarget(); if (target != null) { vec = target.transform.position; transform.parent = null; //++ atskiria nuo teva kad nepaveldetu statisku kordinaciu kai tevas sukinejasi rotateProjectile(vec); //++ pasuka tinkama linkme raketa transform.position = Vector2.MoveTowards(transform.position, vec, missileVelocity * Time.deltaTime); } else { selfDestruct.DealSplashDamage(); } } }
public static void RenameKey(UOItem key, string name) { if (!key.Exist) { key = Targeting.GetTarget(null).Item; } if (key.Exist) { Journal.Clear(); UO.WaitTargetObject(key); key.Use(); if (Journal.WaitForText(true, 500, "What would you like to name the key?")) { TextEntry.SendText(name); Journal.WaitForText(true, 250, "Key renamed"); } } }
public static void Postfix() { if (!uGUI_BuilderMenu.IsOpen() && Input.GetMouseButton(2) && !Builder.isPlacing) { if (Targeting.GetTarget(Player.main.gameObject, 200f, out GameObject result, out _)) { if (Targeting.GetRoot(result, out TechType techType, out GameObject gameObject) && CraftData.IsBuildableTech(techType)) { if (Builder.Begin(gameObject)) { ErrorMessage.AddMessage($"Placing new {techType}"); } else { Builder.End(); } } } } }
public void MobGo() { Serial mob = Aliases.GetObject("SelectedMob"); UOCharacter ch = new UOCharacter(mob); string name = null; TargetInfo t = Targeting.GetTarget(""); if (ch.Renamable && mob.IsValid && ch.Exist && ch.Distance < 18 && !String.IsNullOrEmpty(ch.Name)) { ch.PrintMessage("[go...]"); name = ch.Name; List <MobKillInfo> mobQueue = this.MobQueue; foreach (MobKillInfo k in mobQueue) { if (k.Mob.Serial == ch.Serial) { k.CommandCount = 0; k.Enemy = new UOCharacter(Serial.Invalid); } } } string command = "all go"; if (!String.IsNullOrEmpty(name)) { command = name + " go"; } if (t != null && t.Success) { UO.WaitTargetTile(t.StaticTarget.X, t.StaticTarget.Y, t.StaticTarget.Z, t.StaticTarget.Graphic); if (t.Character != null && t.Character.Exist && Game.IsMob(t.Character.Serial)) { Aliases.SetObject("SelectedMob", t.Character.Serial); } UO.Say(Game.Val_GreenBlue, command); } }
public override bool OnRightHandDown() { base.OnRightHandDown(); if (Time.time <= nextFire || energyMixin.charge <= 0 || !CanWarp()) { return(true); } nextFire = Time.time + fireRate; var aimingTransform = Player.main.camRoot.GetAimingTransform(); var dist = 0f; var go = default(GameObject); var hitSomething = Targeting.GetTarget(Player.main.gameObject, 30, out go, out dist, null); var newPos = Vector3.zero; if (hitSomething) { newPos = aimingTransform.forward * (dist - 1f) + aimingTransform.position; } else { newPos = aimingTransform.forward * 30f + aimingTransform.position; } // Warp out. Utils.SpawnPrefabAt(warpOutEffectPrefab, null, Player.main.transform.position); Utils.PlayEnvSound(warpOutSound, Player.main.transform.position, 20f); // Warp in Player.main.transform.position = newPos; Utils.SpawnPrefabAt(warpInEffectPrefab, null, newPos); Player.main.gameObject.AddComponent <VFXOverlayMaterial>().ApplyAndForgetOverlay(warpedMaterial, "VFXOverlay: Warped", Color.clear, overlayFXDuration); Utils.PlayEnvSound(warpOutSound, Player.main.transform.position, 20f); this.energyMixin.ConsumeEnergy(4f); return(true); }