/// <summary> /// Looks at a particular tile, detecting if NPCs are present as well /// Provides string output or special instructions if it is "special"B /// </summary> /// <param name="xy">positon of tile to look at</param> /// <param name="specialLookCommand">Special command such as look at gem or sign</param> /// <returns>String to output to user</returns> public string Look(Point2D xy, out SpecialLookCommand specialLookCommand) { specialLookCommand = SpecialLookCommand.None; TileReference tileReference = State.TheVirtualMap.GetTileReference(xy); // if there is an NPC on the tile, then we assume they want to look at the NPC, not whatever else may be on the tiles if (State.TheVirtualMap.IsNPCTile(xy)) { MapCharacter mapCharacter = State.TheVirtualMap.GetNPCOnTile(xy); return(DataOvlRef.StringReferences.GetString(DataOvlReference.VISION2_STRINGS.THOU_DOST_SEE).Trim() + " " + (LookRef.GetLookDescription(mapCharacter.NPCRef.NPCKeySprite).Trim())); } // if we are any one of these signs then we superimpose it on the screen else if (SpriteTileReferences.IsSign(tileReference.Index)) { specialLookCommand = SpecialLookCommand.Sign; return(String.Empty); } else if (SpriteTileReferences.GetTileNumberByName("Clock1") == tileReference.Index) { return(DataOvlRef.StringReferences.GetString(DataOvlReference.VISION2_STRINGS.THOU_DOST_SEE).Trim() + " " + (LookRef.GetLookDescription(tileReference.Index).TrimStart() + State.TheTimeOfDay.FormattedTime)); } else // lets see what we've got here! { return(DataOvlRef.StringReferences.GetString(DataOvlReference.VISION2_STRINGS.THOU_DOST_SEE).Trim() + " " + (LookRef.GetLookDescription(tileReference.Index).TrimStart())); } }
/// <summary> /// Looks at a particular tile, detecting if NPCs are present as well /// Provides string output or special instructions if it is "special"B /// </summary> /// <param name="xy">position of tile to look at</param> /// <param name="specialLookCommand">Special command such as look at gem or sign</param> /// <returns>String to output to user</returns> public string Look(Point2D xy, out SpecialLookCommand specialLookCommand) { specialLookCommand = SpecialLookCommand.None; string retStr; TileReference tileReference = State.TheVirtualMap.GetTileReference(xy); // if there is an NPC on the tile, then we assume they want to look at the NPC, not whatever else may be on the tiles if (State.TheVirtualMap.IsNPCTile(xy)) { MapCharacter mapCharacter = State.TheVirtualMap.GetNPCOnTile(xy); if (mapCharacter == null) { throw new Ultima5ReduxException("Tried to look up NPC, but couldn't find the map character"); } retStr = DataOvlRef.StringReferences.GetString(DataOvlReference.Vision2Strings.THOU_DOST_SEE).Trim() + " " + (LookRef.GetLookDescription(mapCharacter.NPCRef.NPCKeySprite).Trim()); } // if we are any one of these signs then we superimpose it on the screen else if (SpriteTileReferences.IsSign(tileReference.Index)) { specialLookCommand = SpecialLookCommand.Sign; retStr = string.Empty; } else if (SpriteTileReferences.GetTileNumberByName("Clock1") == tileReference.Index) { retStr = (DataOvlRef.StringReferences.GetString(DataOvlReference.Vision2Strings.THOU_DOST_SEE).Trim() + " " + (LookRef.GetLookDescription(tileReference.Index).TrimStart() + State.TheTimeOfDay.FormattedTime)); } else // lets see what we've got here! { retStr = (DataOvlRef.StringReferences.GetString(DataOvlReference.Vision2Strings.THOU_DOST_SEE).Trim() + " " + (LookRef.GetLookDescription(tileReference.Index).TrimStart())); } // pass time at the end to make sure moving characters are accounted for PassTime(); return(retStr); }