public static Boolean ReallyHidden(Character mychar, List <Character> _characters, List <Itemz> _items, List <Location> _locations, List <Ship> _ships) { if (mychar._CM_Hide_Self == 1) { if (mychar._Item_List != null) { int iterations = mychar._Item_List.Count / 2; for (int i = 0; i < iterations; i++) { if (_items.Find(x => x._ItemId == mychar._Item_List[i * 2]) != null) { Itemz myitem = _items.Find(x => x._ItemId == mychar._Item_List[i * 2]); if (Itemz.Is_Fighter(myitem) || myitem._IT_Man_Item == 1) { return(false); } } } } if (mychar._LI_Here_List != null) { return(false); } if (_characters.Find(x => x._CharId == mychar._LI_Where) != null) { return(false); } if (_ships.Find(x => x._ShipId == mychar._LI_Where) != null) { if (_ships.Find(x => x._ShipId == mychar._LI_Where)._LI_Here_List[0] == mychar._CharId) { return(false); } } if (_locations.Find(x => x._LocId == mychar._LI_Where) != null) { if (_locations.Find(x => x._LocId == mychar._LI_Where)._SL_Defense > 0) { if (_locations.Find(x => x._LocId == mychar._LI_Where)._LI_Here_List[0] == mychar._CharId) { return(false); } } } return(true); } return(false); }
private static void Write_Char_Inventory(Character _myChar, StreamWriter w, List <Itemz> _items) { int total_weight = 0; if (_myChar._Item_List != null) { int iterations = _myChar._Item_List.Count() / 2; w.WriteLine("Inventory:"); w.WriteLine("<table>"); w.WriteLine("<tr><td style=\"text-align:right\">qty</td><td style=\"text-align:left\">name</td><td style=\"text-align:right\">weight</td><td style=\"text-align:left\"> </td></tr>"); w.WriteLine("<tr><td style=\"text-align:right\">---</td><td style=\"text-align:left\">----</td><td style=\"text-align:right\">-----</td></tr>"); for (int i = 0; i < iterations; i++) { int _item = _myChar._Item_List[(i * 2)]; int _qty = _myChar._Item_List[(i * 2) + 1]; w.WriteLine("<tr>"); w.WriteLine("<td style=\"text-align:right\">" + _qty.ToString("N0") + "</td>"); Itemz _myitem = _items.Find(x => x._ItemId == _item); if (_myitem != null) { w.WriteLine("<td style=\"text-align:left\">" + (_qty == 1 ? _myitem._Name : _myitem._Plural) + " [" + Utilities.To_Oid(_item.ToString()) + "]</td>"); w.WriteLine("<td style=\"text-align:right\">" + (_myitem._Weight * _qty).ToString("N0") + "</td>"); total_weight += (_myitem._Weight * _qty); StringBuilder outline = new StringBuilder(); outline.Append("<td>"); if (_myChar._Char_Type.ToUpper() != "GARRISON") { if (_myitem._Fly_Capacity > 0) { outline.Append("fly " + (_myitem._Fly_Capacity * _qty).ToString("N0")); } else { if (_myitem._Ride_Capacity > 0) { outline.Append("ride " + (_myitem._Ride_Capacity * _qty).ToString("N0")); } else { if (_myitem._Land_Capacity > 0) { outline.Append("cap " + (_myitem._Land_Capacity * _qty).ToString("N0")); } } } if (Itemz.Is_Fighter(_myitem)) { outline.AppendFormat(" ({0},{1},{2})", _myitem._IT_Attack, _myitem._IT_Defense, _myitem._IT_Missile); } outline.Append(_myitem._IM_Attack_Bonus > 0 ? ("+" + _myitem._IM_Attack_Bonus + " attack") : ""); outline.Append(_myitem._IM_Defense_Bonus > 0 ? ("+" + _myitem._IM_Defense_Bonus + " defense") : ""); outline.Append(_myitem._IM_Missile_Bonus > 0 ? ("+" + _myitem._IM_Missile_Bonus + " missile") : ""); if (Character.Is_Magician(_myChar) && _myitem._IM_Aura_Bonus > 0) { outline.AppendFormat("+{0} aura)", _myitem._IM_Aura_Bonus); } outline.Append(" </td>"); w.WriteLine(outline); } else { w.WriteLine("<td>" + "undefined" + "</td>"); w.WriteLine("<td>" + 0 + "</td>"); w.WriteLine("<td> </td>"); } w.WriteLine("</tr>"); } } if (_myChar._Char_Type.ToUpper() != "GARRISON") { w.WriteLine("<tr><td></td><td></td><td style=\"text-align:right\">=====</td><td> </td></tr>"); w.WriteLine("<tr><td></td><td></td><td style=\"text-align:right\">" + total_weight.ToString("N0") + "</td><td> </td></tr>"); } w.WriteLine("</table>"); } else { w.WriteLine("<p>" + _myChar._Name + " [" + _myChar._CharId + "] has no possessions.</p>"); } }