private static menu buildInventory(inventory inventory) { inven = inventory; menu old = m_current; m_current = new menu("inventory", null); try { for (int i = 0; i != inven.items.Length; i++) { addItem(new menu_item(inven.items[i].icon, inven.items[i].name, inven.items[i].gameTag), i); m_current.items[i].selected = false; } } catch { addItem(new menu_item(pda_player.tex_icon_inventory, "Empty", "none"), -1); } if (inven.items.Length == 0) { addItem(new menu_item(pda_player.tex_icon_inventory, "Empty", "none"), -1); } menu output = m_current; //m_current = old; showMenu = true; translationDone = false; show = true; return output; }
public static inventory createItem_INVEN(inventory input, item New, Vector2 pos, float z) { try { item[] old = input.items; input.items = new item[old.Length + 1]; for (int i = 0; i != old.Length; i++) { input.items[i] = old[i]; } New.B_base.f_elasticity = .50f; New.B_base.v_position = pos; New.B_base.f_Position_Z = z; input.items[old.Length] = New; input.CurWeight += New.weight; } catch { input.items = new item[1]; New.B_base.f_elasticity = .50f; New.B_base.v_position = pos; New.B_base.f_Position_Z = z; input.items[0] = New; input.CurWeight += New.weight; } return input; }
public character(string Name, Vector2 Position, skill Skill, ControlType CType, CharType type) { controlType = CType; action = "idle"; special_tag = -1; Type = type; name = Name; B_baseProps = new Base(Position, 70f); f_currentFrame = 0; body = null; currentAnim = new Animation(); angle = 0; accuracy = 1; attrib = Skill; armor = 0; pointingRight = true; Primary_weap = Secondary_weap = SideArm_weap = current_weap = new weapon(); Inventory = new inventory(5, null); weaponInUse = "unarmed"; brain = new AInode(false); reordered = false; }