public override void PopulateOptionsList(List <WIListOption> options, List <string> message) { if (CanUseFuse && !worlditem.Is <Fuse>()) { Fuse fuse = null; if (Player.Local.Tool.IsEquipped && Player.Local.Tool.worlditem.Is <Fuse>(out fuse)) { options.Add(new WIListOption("Attach Fuse", "Fuse")); } } }
public void CopyFrom(Fuse existingFuse) { //if it's attached to a bomb already, copy its doppleganger props //otherwise copy the world item if (existingFuse.AttachedToBomb) { State.DopplegangerProps.CopyFrom(existingFuse.State.DopplegangerProps); State.MissionName = existingFuse.State.MissionName; State.MissionVariableName = existingFuse.State.MissionVariableName; State.VariableValue = existingFuse.State.VariableValue; State.CheckType = existingFuse.State.CheckType; } else { State.DopplegangerProps.CopyFrom(existingFuse.worlditem); State.MissionName = existingFuse.State.MissionName; State.MissionVariableName = existingFuse.State.MissionVariableName; State.VariableValue = existingFuse.State.VariableValue; State.CheckType = existingFuse.State.CheckType; } }
public void OnPlayerUseWorldItemSecondary(object secondaryResult) { WIListResult dialogResult = secondaryResult as WIListResult; switch (dialogResult.SecondaryResult) { case "Fuse": Fuse existingFuse = null; if (Player.Local.Tool.worlditem.Is <Fuse>(out existingFuse)) { //copy the properties from the fuse the player is holding //then attach the fuse to the bomb Fuse newFuse = worlditem.GetOrAdd <Fuse>(); newFuse.CopyFrom(existingFuse); newFuse.AttachToBomb(this); existingFuse.worlditem.RemoveFromGame(); } break; default: break; } }