/// <summary> /// removes inventory from player and adds to location /// </summary> public void RemoveItemFromInventory() { if (CurrentGameItem != null) { GameItem selectedGameItem = CurrentGameItem as GameItem; CurrentLocation.AddGameItemToLocation(selectedGameItem); Player.RemoveGameItemFromInventory(selectedGameItem); OnPlayerPutDown(selectedGameItem); } }
/// <summary> /// based on artifact use action switch statement to process different use actions /// </summary> /// <param name="artifact"></param> private void ProcessArtifacUse(Artifact artifact) { switch (artifact.UseAction) { case Artifact.UseActionType.KILL_PLAYER: Player.Lives--; OnPlayerDies(artifact.UseMessage); ArtifactInventoryAdjustment(artifact); break; case Artifact.UseActionType.OPEN_LOCATION: if (artifact.Id == 2004) { PlayerAdvance(100); } if (artifact.Id == 2005) { PlayerAdvance(201); } if (artifact.Id == 2006) { PlayerAdvance(300); } if (artifact.Id != 2004) { ArtifactInventoryAdjustment(artifact); } break; case Artifact.UseActionType.HEAL_PLAYER: Player.Lives = 3; Player.Health = 100; ArtifactInventoryAdjustment(artifact); break; case Artifact.UseActionType.ELF_DROP_ITEM: if (CurrentNpc != null) { if (CurrentLocation.Id == 202 && CurrentNpc.Id == 1006) { GameItem gameItem = CurrentNpc.Inventory[0]; CurrentLocation.AddGameItemToLocation(gameItem); CurrentNpc.RemoveGameItemFromNpc(gameItem); ArtifactInventoryAdjustment(artifact); } } break; default: break; } }
public void OnPlayerTalkTo() { if (CurrentNpc != null && CurrentNpc is ISpeak) { ISpeak speakingNpc = CurrentNpc as ISpeak; CurrentLocationInformation = speakingNpc.Speak(); Player.NpcsEngaged.Add(CurrentNpc); Player.UpdateMissionStatus(); if (CurrentNpc.Inventory != null) { switch (CurrentNpc.Id) { case 1003: case 1008: if (CurrentNpc.Inventory.Count != 0) { GameItem gameItem = CurrentNpc.Inventory[0]; CurrentLocation.AddGameItemToLocation(gameItem); CurrentNpc.RemoveGameItemFromNpc(gameItem); } break; case 1004: if (CurrentNpc.Inventory.Count != 0) { GameItem currentItem = CurrentNpc.Inventory[0]; if (currentItem.Id == 2003) { CurrentLocation.AddGameItemToLocation(currentItem); CurrentNpc.RemoveGameItemFromNpc(currentItem); } } break; default: break; } } } else { CurrentLocationInformation = "Beasts can not speak!"; } }