public void OnSelectRemoveSkill(System.Object result) { UsingSkillList = false; WIListResult dialogResult = result as WIListResult; RemoveItemSkill skillToUse = null; foreach (Skill removeSkill in mRemoveSkillList) { if (removeSkill.name == dialogResult.Result) { skillToUse = removeSkill as RemoveItemSkill; break; } } if (skillToUse != null) { //set this global flag to true //this will prevent anything from closing RemovingItemUsingSkill = true; //SKILL USE //getting here guarantees that: //a) our selected stack is empty and //b) our stack has item //so proceed as though we know those are true skillToUse.TryToRemoveItem(mSkillUseTarget, Occupant, Player.Local.Inventory, ParentReceptacle.OnItemRemovedFromReceptacle, dialogResult.SecondaryResultFlavor); //now we just have to wait! //the skill will move stuff around //refresh requests will be automatic } mRemoveItemSkillNames.Clear(); }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { Flammable flammable = null; WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "AddFuel": //perform the same check if (CanAcceptFuel && worlditem.Is(WIMode.World | WIMode.Frozen | WIMode.Placed) && Player.Local.Tool.HasWorldItem && Player.Local.Tool.worlditem.Is <Flammable>(out flammable)) { AddFuel(flammable); //it will take care of the rest } break; case "Ignite": if (Player.Local.Surroundings.IsWorldItemInRange && Player.Local.Surroundings.WorldItemFocus.worlditem.Is <Flammable>(out flammable) && flammable.IsOnFire) { Ignite("Default"); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object dialogResult) { WIListResult result = (WIListResult)dialogResult; switch (result.SecondaryResult) { case "Up": if (HasUpperFloor && PowerSource.HasPower && MissionCondition.CheckCondition(State.UpperFloorCondition)) { TargetElevator.SendToStopIndex(State.StopIndex + 1); } break; case "Down": if (HasLowerFloor && PowerSource.HasPower && MissionCondition.CheckCondition(State.LowerFloorCondition)) { TargetElevator.SendToStopIndex(State.StopIndex - 1); } break; case "Call": if (HasLowerFloor && PowerSource.HasPower && MissionCondition.CheckCondition(State.LowerFloorCondition)) { TargetElevator.SendToStopIndex(State.StopIndex); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "RemovePowerSource": WIStackError error = WIStackError.None; if (Player.Local.Inventory.AddItems(PowerSourceDopplegangerProps.ToStackItem(), ref error)) { HasPowerSource = false; OnPowerSourceRemoved.SafeInvoke(); FXManager.Get.SpawnFX(worlditem.tr.position, FXOnPowerSourceRemoved); } break; case "AddPowerSource": if (Player.Local.Tool.IsEquipped && Stacks.Can.Stack(Player.Local.Tool.worlditem, PowerSourceDopplegangerProps)) { //PowerSourceDopplegangerProps.CopyFrom (Player.Local.Tool.worlditem); Player.Local.Tool.worlditem.RemoveFromGame(); HasPowerSource = true; Refresh(); } break; default: break; } }
public void OnSelectSpawnSkill(System.Object result) { WIListResult dialogResult = result as WIListResult; if (dialogResult.Result == "DefaultRevive") { Player.Local.Spawn(); } else { RespawnSkill skillToUse = null; foreach (Skill removeSkill in mSpawnSkills) { if (removeSkill.name == dialogResult.Result) { skillToUse = removeSkill as RespawnSkill; break; } } OfLabel.enabled = false; if (skillToUse != null) { //use this skill to respawn skillToUse.Use(Player.Local, dialogResult.SecondaryResultFlavor); mSpawnSkills.Clear(); StartCoroutine(WaitForPlayerToSpawn(skillToUse)); } else { Debug.Log("SKILL TO USE NOT FOUND!"); } } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; if (dialogResult.SecondaryResult.Contains("Drink")) { Drink(); } else { LiquidContainer liquidContainer = null; if (Player.Local.Tool.IsEquipped && Player.Local.Tool.worlditem.Is <LiquidContainer>(out liquidContainer)) { LiquidContainerState liquidContainerState = liquidContainer.State; int numFilled = 0; string errorMessage = string.Empty; if (liquidContainerState.TryToFillWith(mGenericLiquid, Int32.MaxValue, out numFilled, out errorMessage)) { GUIManager.PostInfo("Filled " + liquidContainer.worlditem.DisplayName + " with " + numFilled.ToString() + " " + mGenericLiquid.PrefabName + "(s)"); MasterAudio.PlaySound(MasterAudio.SoundType.PlayerInterface, "FillLiquidContainer"); } } } mOptionsListItems.Clear(); }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Claim": PlayerClaimStructure(ParentStructure); break; case "Buy": if (PlayerBuyStructure(ParentStructure, Currency.ConvertToBaseCurrency(State.PriceInMarks, WICurrencyType.D_Luminite))) { if (ForSaleSign != null) { ForSaleSign.SetActive(false); } } break; case "Restore": PlayerRestoreStructure(ParentStructure); break; case "Rename": TryToRename(); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Open": case "Close": default: Trigger trigger = null; if (worlditem.Is <Trigger>(out trigger)) { trigger.TryToTrigger(); } break; case "Climb Through": if (!mClimbingThroughWindow) { mClimbingThroughWindow = true; StartCoroutine(ClimbThroughWindow()); } break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Open": case "Close": Trigger trigger = null; if (worlditem.Is <Trigger> (out trigger)) { trigger.TryToTrigger(); } break; case "Knock": if (dynamic.ParentStructure.worlditem.Is <Residence> (out gCheckResidence)) { Debug.Log("Found residence, knocking now"); gCheckResidence.Knock(); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object result) { WIListResult dialogResult = result as WIListResult; switch (dialogResult.SecondaryResult) { case "LocalPlayerMount": Mount(Player.Local); break; } }
public void OnPlayerUseWorldItemSecondary(object result) { WIListResult dialogResult = result as WIListResult; switch (dialogResult.SecondaryResult) { case "Read": Books.ReadBook(State.BookName, null); break; } }
public void OnPlayerUseWorldItemSecondary(object dialogResult) { WIListResult result = (WIListResult)dialogResult; switch (result.SecondaryResult) { case "Wear": Player.Local.Wearables.Wear(this); break; default: break; } }
public virtual void OnPlayerUseWorldItemSecondary(object secondaryResult) { //this is where we handle skills WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "PickPlant": PickPlant(true); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Rename": TryToRename(); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Pack": WorldItems.ReplaceWorldItem(this.worlditem, ReplacementItem); GUIManager.PostIntrospection("How am I supposed to use this thing? They must have left instructions somewhere..."); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object result) { WIListResult secondaryResult = result as WIListResult; switch (secondaryResult.SecondaryResult) { case "Eat": case "Drink": Eat(this); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object result) { WIListResult secondaryResult = result as WIListResult; switch (secondaryResult.SecondaryResult) { case "Browse": GameObject browserGameObject = GUIManager.SpawnNGUIChildEditor(gameObject, GUIManager.Get.Dialog("NGUILibraryCatalogueBrowser")); GUILibraryCatalogueBrowser browser = browserGameObject.GetComponent <GUILibraryCatalogueBrowser>(); browser.SetLibraryName(State.LibraryName); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object result) { WIListResult secondaryResult = result as WIListResult; switch (secondaryResult.SecondaryResult) { case "Place": if (Player.Local.Tool.IsEquipped) { AddToReceptacle(Player.Local.Tool.worlditem); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object result) { WIListResult secondaryResult = result as WIListResult; switch (secondaryResult.SecondaryResult) { case "Use": mTargetWorldItem.OnPlayerUse.SafeInvoke(); if (State.FinishOnUse) { Finish(); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Activate": ActivateGhost(); break; case "Deactivate": DeactivateGhost(); break; default: break; } }
public virtual void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Open": OnOpenContainer.SafeInvoke(); PrimaryInterface.MaximizeInterface("Inventory", "OpenStackContainer", worlditem.gameObject); if (State.ReputationChangeOnOpen != 0) { Profile.Get.CurrentGame.Character.Rep.ChangeGlobalReputation(State.ReputationChangeOnOpen); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Move": State.Moved = true; if (!mMovingOverTime) { mMovingOverTime = true; StartCoroutine(MoveOverTime()); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Milk": LiquidContainer container = null; if (Player.Local.Tool.worlditem.Is <LiquidContainer>(out container)) { if (container.State.IsEmpty) { WICategory category = null; System.Random random = new System.Random(Profile.Get.CurrentGame.Seed); if (WorldItems.Get.Category(MilkCategory, out category)) { GenericWorldItem milkItem = null; if (category.GenericWorldItems.Count > 0) { milkItem = category.GenericWorldItems[random.Next(0, category.GenericWorldItems.Count)]; } else { milkItem = category.GenericWorldItems[0]; } container.State.Contents.CopyFrom(milkItem); container.State.Contents.InstanceWeight = container.State.Capacity; //make the cow make a noise worlditem.Get <Creature>().OnTakeDamage(); } } } break; case "Tip": worlditem.Get <Creature>().OnTakeDamage(); //make a noise and flip out worlditem.Get <Creature>().TryToStun(10f); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Shear": State.LastTimeSheared = WorldClock.AdjustedRealTime; //spawn a random number of wool items //make it pop off the chest body part, upwards WorldItem shearedWorldItem = null; BodyPart chestBodyPart = null; creature.Body.GetBodyPart(BodyPartType.Chest, out chestBodyPart); Bounds colliderBounds = chestBodyPart.PartCollider.bounds; Vector3 popPosition; Vector3 popDirection; System.Random random = new System.Random(Profile.Get.CurrentGame.Seed); int numShearedItems = random.Next(MinShearedItems, MaxShearedItems); Debug.Log("Shearing " + numShearedItems.ToString() + " Items in " + name); for (int i = 0; i < numShearedItems; i++) { popPosition = (UnityEngine.Random.onUnitSphere * 5f) + chestBodyPart.tr.position; popPosition = chestBodyPart.PartCollider.ClosestPointOnBounds(popPosition); //give it a push in a direction away from the body popDirection = Vector3.Normalize(chestBodyPart.tr.position - popPosition); if (WorldItems.CloneWorldItem(ShearedItem, STransform.zero, false, WIGroups.GetCurrent(), out shearedWorldItem)) { shearedWorldItem.Initialize(); shearedWorldItem.SetMode(WIMode.World); shearedWorldItem.tr.position = popPosition; shearedWorldItem.ApplyForce(popDirection, popPosition); } //let them all fall away } //the creature freaks out but doesn't actually take damage creature.OnTakeDamage(); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Rubbing": MasterAudio.PlaySound(RubbingSoundType, worlditem.tr, RubbingSound); if (State.ChangeMissionVarOnTakeRubbing) { Missions.Get.ChangeVariableValue(State.MissionName, State.VariableName, State.VariableValue, State.ChangeType); } State.HasTakenRubbing = true; GUIManager.PostSuccess(State.PostMessageOnRubbingTaken); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object result) { WIListResult dialogResult = result as WIListResult; switch (dialogResult.SecondaryResult) { case "Rescue": if (State.ChosenByPlayer) { State.ChosenByPlayer = false; GUIManager.PostInfo("Cancelled rescue service"); } else { State.ChosenByPlayer = true; GUIManager.PostInfo("Requested rescue service"); } break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Sit": if (Player.Local.Surroundings.IsInDanger) { GUIManager.PostDanger("You cannot sit while you are in danger"); } else { Player.Local.HijackControl(); Player.Local.State.HijackMode = PlayerHijackMode.LookAtTarget; Player.Local.SetHijackTargets(SitCameraPosition, SitCameraPosition); Player.Local.SetHijackCancel(FinishSitting); Player.Local.Status.CustomStateList.Add("Sitting"); mSitting = true; StartCoroutine(SitOverTime()); } break; case "Wait": if (Player.Local.Surroundings.IsInDanger) { GUIManager.PostDanger("You cannot sit while you are in danger"); } else { Player.Local.HijackControl(); Player.Local.State.HijackMode = PlayerHijackMode.LookAtTarget; Player.Local.SetHijackTargets(SitCameraPosition, SitCameraPosition); Player.Local.SetHijackCancel(FinishSitting); Player.Local.Status.CustomStateList.Add("Sitting"); mSitting = true; StartCoroutine(WaitOverTime()); } break; } }
public void OnSelectBlueprint(System.Object result) { UsingMenu = false; WIListResult dialogResult = result as WIListResult; switch (dialogResult.Result) { case "Craft": //we want to select a new blueprint WIBlueprint blueprint = null; if (Blueprints.Get.Blueprint(RequirementBlueprint, out blueprint)) { GUIInventoryInterface.Get.CraftingInterface.OnSelectBlueprint(blueprint); } break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Pluck": WIStackError error = WIStackError.None; WorldItem pluckedWorldItem = null; if (WorldItems.CloneWorldItem(PluckedItem, STransform.zero, false, WIGroups.GetCurrent(), out pluckedWorldItem)) { pluckedWorldItem.Initialize(); } Player.Local.Inventory.AddItems(pluckedWorldItem, ref error); creature.OnTakeDamage(); creature.FleeFromThing(Player.Local); break; default: break; } }
public void OnPlayerUseWorldItemSecondary(object dialogResult) { WIListResult result = (WIListResult)dialogResult; switch (result.SecondaryResult) { case "Talk": if (!worlditem.HasPlayerAttention) { Player.Local.Focus.GetOrReleaseAttention(worlditem); } if (!mInitiatingConversation) { mInitiatingConversation = true; StartCoroutine(InitiateConversation(null)); } break; default: break; } }