Example #1
0
        private void Add_ItemMaster_Records()
        {
            DateTime dt   = DateTime.Now;
            string   line = dt.ToString();

            Log(line + "\tAdd Item Master Records...");

            ITEM_DATA[] data = new ITEM_DATA[4];
            data[0] = new ITEM_DATA(10, new Decimal(19.95), "1", "Hammer");
            data[1] = new ITEM_DATA(3, new Decimal(9.99), "2", "Wrench");
            data[2] = new ITEM_DATA(4, new Decimal(16.59), "3", "Saw");
            data[3] = new ITEM_DATA(1, new Decimal(3.98), "4", "Pliers");
            int nRecords = data.Length;

            SqlSpCommand insert_cmd  = NewSqlSpCommand();
            String       insert_stmt = "INSERT INTO itemmast VALUES (?,?,?,?) ";

            insert_cmd.Prepare(insert_stmt);
            foreach (ITEM_DATA item in data)
            {
                insert_cmd.Parameter[0].Value = item.weight;
                insert_cmd.Parameter[1].Value = item.price;
                insert_cmd.Parameter[2].Value = item.itemnum;
                insert_cmd.Parameter[3].Value = item.description;

                insert_cmd.Execute();
            }
        }
Example #2
0
        static void Add_ItemMaster_Records()
        {
            ITEM_DATA[] data = new ITEM_DATA[4];
            data[0] = new ITEM_DATA(10, (CTMoney)1995, "1", "Hammer");
            data[1] = new ITEM_DATA(3, (CTMoney)999, "2", "Wrench");
            data[2] = new ITEM_DATA(4, (CTMoney)1659, "3", "Saw");
            data[3] = new ITEM_DATA(1, (CTMoney)398, "4", "Pliers");
            int nRecords = data.Length;

            Delete_Records(recordItemMast);

            Console.WriteLine("\tAdd records in table ItemMaster...");

            try
            {
                for (int i = 0; i < nRecords; i++)
                {
                    recordItemMast.Clear();

                    // populate record buffer with data
                    recordItemMast.SetFieldValue(0, data[i].weight);
                    recordItemMast.SetFieldValue(1, data[i].price);
                    recordItemMast.SetFieldAsString(2, data[i].itemnum);
                    recordItemMast.SetFieldAsString(3, data[i].description);

                    // add record
                    recordItemMast.Write();
                }
            }
            catch (CTException E)
            {
                Handle_Exception(E);
            }
        }
Example #3
0
    private static ITEM_DATA[] LoadItemEffects()
    {
        try
        {
            String inputPath = DataResources.ItemsDirectory + "ItemEffects.csv";
            if (!File.Exists(inputPath))
            {
                throw new FileNotFoundException($"[ff9item] Cannot load item actions because a file does not exist: [{inputPath}].", inputPath);
            }

            ItemEffect[] effects = CsvReader.Read <ItemEffect>(inputPath);
            if (effects.Length != 32)
            {
                throw new NotSupportedException($"You must set 32 actions, but there {effects.Length}. Any number of actions will be available after a game stabilization."); // TODO
            }
            ITEM_DATA[] result = new ITEM_DATA[effects.Length];
            for (Int32 i = 0; i < result.Length; i++)
            {
                result[i] = effects[i].ToItemData();
            }

            return(result);
        }
        catch (Exception ex)
        {
            Log.Error(ex, "[ff9item] Load character commands failed.");
            UIManager.Input.ConfirmQuit();
            return(null);
        }
    }
Example #4
0
    void NodeSetting(ITEM_DATA eIndex, object Data)
    {
        Dictionary <ITEM_DATA, object> node = new Dictionary <ITEM_DATA, object>();

        node.Add(eIndex, Data);
        m_ItemData.Add(node);
    }
Example #5
0
 public object GetItemForIndex(int itemIndex, INVENTORY_TYPE eType, ITEM_DATA eIndex)
 {
     for (int i = 0; i < m_ListInven[(int)eType].Count; i++)
     {
         int iIndex = Util.ConvertToInt(m_ListInven[(int)eType][i].GetItemData(ITEM_DATA.ITEM_INDEX));
         if (iIndex == itemIndex)
         {
             return(m_ListInven[(int)eType][i].GetItemData(eIndex));
         }
     }
     return(null);
     //아이템 인덱스 기반의 반환
 }
Example #6
0
        public static ItemEffect FromItemData(ITEM_DATA data)
        {
            return(new ItemEffect
            {
                Targets = (TargetType)data.info.cursor,
                DefaultAlly = data.info.def_cur == 1,
                Display = (TargetDisplay)data.info.sub_win,
                AnimationId = data.info.vfx_no,
                Dead = data.info.dead != 0,
                DefaultDead = data.info.def_dead != 0,

                ScriptId = data.Ref.prog_no,
                Power = data.Ref.power,
                Element = (EffectElement)data.Ref.attr,
                Rate = data.Ref.rate,

                Status = (BattleStatus)data.status
            });
        }
Example #7
0
        public static ItemEffect FromItemData(ITEM_DATA data)
        {
            return(new ItemEffect
            {
                Targets = (TargetType)data.info.Target,
                DefaultAlly = data.info.DefaultAlly,
                Display = (TargetDisplay)data.info.DisplayStats,
                AnimationId = data.info.VfxIndex,
                Dead = data.info.ForDead,
                DefaultDead = data.info.DefaultOnDead,

                ScriptId = data.Ref.ScriptId,
                Power = data.Ref.Power,
                Element = (EffectElement)data.Ref.Elements,
                Rate = data.Ref.Rate,

                Status = (BattleStatus)data.status
            });
        }
Example #8
0
        public bool AddObjectList(ref DataGridView grid, ref int col, int row, params object[] list)
        {
            for (int i = 0; i < list.Length; i++)
            {
                grid.Columns.Add("", "");

                object Obj = list[i];
                Type   t   = Obj.GetType();

                if (t == typeof(sbyte) ||
                    t == typeof(short) ||
                    t == typeof(int) ||
                    t == typeof(long) ||
                    t == typeof(byte) ||
                    t == typeof(ushort) ||
                    t == typeof(uint) ||
                    t == typeof(ulong))
                {
                    DataGridViewTextBoxCell TextBoxCell = new DataGridViewTextBoxCell();
                    grid[col, row]           = TextBoxCell;
                    grid[col, row].ValueType = Obj.GetType();
                    grid[col, row].Value     = Obj;
                }
                else if (t.IsArray)
                {
                    Array dataArray = (Array)Obj;
                    foreach (object o in dataArray)
                    {
                        AddObjectList(ref grid, ref col, row, o);
                    }
                }
                else if (t.IsEnum)
                {
                    DataGridViewComboBoxCell ComboCell = new DataGridViewComboBoxCell();
                    ComboCell.DataSource     = Enum.GetValues(t);
                    grid[col, row]           = ComboCell;
                    grid[col, row].ValueType = t;
                    grid[col, row].Value     = Obj;
                }
                else if (t == typeof(string))
                {
                    DataGridViewTextBoxCell TextBoxCel = new DataGridViewTextBoxCell();
                    grid[col, row]          = TextBoxCel;
                    grid[col, row].Value    = Obj;
                    grid[col, row].ReadOnly = true;
                }
                else if (t == typeof(ITEM_DATA))
                {
                    ITEM_DATA itemData = (ITEM_DATA)Obj;
                    AddObjectList(ref grid, ref col, row, "Item", itemData.itemsn, itemData.op, itemData.cnt, "slot", itemData.equipslot);
                }
                else if (t == typeof(QUEST_DATA))
                {
                    QUEST_DATA questData = (QUEST_DATA)Obj;
                    AddObjectList(ref grid, ref col, row, questData.VarType, questData.VarNo, questData.op, questData.Value);
                }
                else if (t == typeof(ABIL_DATA))
                {
                    ABIL_DATA abilData = (ABIL_DATA)Obj;
                    AddObjectList(ref grid, ref col, row, abilData.type, abilData.op, abilData.value);
                }
                else
                {
                    Console.WriteLine("Unknown Column Type: " + t);
                    AddPropertiesToGrid(ref grid, ref col, row, (object)Obj);
                }
                col++;
            }
            return(true);
        }
Example #9
0
 public void InventoryUpdate(INVENTORY_TYPE eInven, int itemIndex, ITEM_DATA eData, object UpdateData)
 {
     //기존 아이템 업데이트, 레벨 업 등
     m_ListInven[(int)eInven][itemIndex].ItemUpdate(eData, UpdateData);
 }
Example #10
0
 public object GetItemData(ITEM_DATA eIndex)
 {   //해당 아이템 정보 오브젝트 반환
     return(m_ItemData[(int)eIndex][eIndex]);
 }
Example #11
0
 public object GetItemForIndex(int itemIndex, INVENTORY_TYPE eType, ITEM_DATA eIndex)
 {
     //아이템 인덱스 순서
     return(m_UserInventory.GetItemForIndex(itemIndex, eType, eIndex));
 }
Example #12
0
 public object GetItemForList(int inventoryIndex, INVENTORY_TYPE eType, ITEM_DATA eIndex)
 {
     //인벤토리 인덱스 순서
     return(m_UserInventory.GetItemForList(inventoryIndex, eType, eIndex));
 }
Example #13
0
 public void InventoryUpdate(INVENTORY_TYPE eInven, int itemIndex, ITEM_DATA eData, object UpdateData)
 {
     //무슨 인벤토리에 무슨 아이템에 무슨 데이터가 업데이트 되었다.
     m_UserInventory.InventoryUpdate(eInven, itemIndex, eData, UpdateData);
 }
Example #14
0
        public static Boolean FieldCalcMain(PLAYER caster, PLAYER target, ITEM_DATA tbl, Byte scriptId, UInt32 cursor)
        {
            ItemActionData tbl1 = new ItemActionData(tbl);

            return(FieldCalcMain(caster, target, tbl1, scriptId, cursor));
        }
Example #15
0
 public void ItemUpdate(ITEM_DATA eIndex, object Data)   //아이템 정보 갱신
 {
     m_ItemData[(int)eIndex][eIndex] = Data;
 }
Example #16
0
 public ItemActionData(ITEM_DATA item)
 {
     Info   = item.info;
     Ref    = item.Ref;
     Status = item.status;
 }
Example #17
0
 public object GetItemForList(int inventoryIndex, INVENTORY_TYPE eType, ITEM_DATA eIndex)
 {
     //인벤토리 아이템은 중복 획득이 가능하므로 리스트 순서 기반으로 한다.
     return(m_ListInven[(int)eType][inventoryIndex].GetItemData(eIndex));
 }
Example #18
0
    public override Boolean OnKeyConfirm(GameObject go)
    {
        if (base.OnKeyConfirm(go))
        {
            if (_isShowingKeyItemDesp)
            {
                FF9Sfx.FF9SFX_Play(103);
                DisplayKeyItemSkin(false);
            }
            if (ButtonGroupState.ActiveGroup == SubMenuGroupButton)
            {
                FF9Sfx.FF9SFX_Play(103);
                _currentMenu = GetSubMenuFromGameObject(go);
                switch (_currentMenu)
                {
                case SubMenu.Use:
                    _currentArrangeMode          = 0;
                    ButtonGroupState.ActiveGroup = ItemGroupButton;
                    ButtonGroupState.SetSecondaryOnGroup(SubMenuGroupButton);
                    ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    break;

                case SubMenu.Arrange:
                    _arrangeTransition.TweenIn(() =>
                    {
                        Loading = false;
                        ButtonGroupState.ActiveGroup = ArrangeMenuGroupButton;
                        ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    });
                    Loading = true;
                    break;

                case SubMenu.Key:
                    if (_keyItemIdList.Count > 0)
                    {
                        ButtonGroupState.ActiveGroup = KeyItemGroupButton;
                        ButtonGroupState.SetSecondaryOnGroup(SubMenuGroupButton);
                        ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    }
                    break;
                }
            }
            else if (ButtonGroupState.ActiveGroup == ArrangeMenuGroupButton)
            {
                FF9Sfx.FF9SFX_Play(103);
                _currentArrangeMode = go.transform.GetSiblingIndex() + 1;
                switch (_currentArrangeMode)
                {
                case 1:
                    _arrangeTransition.TweenOut(() => Loading = false);
                    Loading = true;
                    ButtonGroupState.ActiveGroup = SubMenuGroupButton;
                    ArrangeAuto();
                    DisplayItem();
                    break;

                case 2:
                    _arrangeTransition.TweenOut(() => Loading = false);
                    Loading = true;
                    ButtonGroupState.ActiveGroup = ItemGroupButton;
                    ButtonGroupState.SetSecondaryOnGroup(SubMenuGroupButton);
                    ButtonGroupState.HoldActiveStateOnGroup(SubMenuGroupButton);
                    DisplayItem();
                    break;
                }
            }
            else if (ButtonGroupState.ActiveGroup == ItemGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, ItemGroupButton))
                {
                    _currentItemIndex = go.GetComponent <RecycleListItem>().ItemDataIndex;
                    if (_currentArrangeMode == 0)
                    {
                        PLAYER       player      = FF9StateSystem.Common.FF9.party.member[0];
                        Int32        itemId      = _itemIdList[_currentItemIndex];
                        FF9ITEM_DATA ff9ItemData = ff9item._FF9Item_Data[itemId];
                        if (citem.YCITEM_IS_ITEM(itemId))
                        {
                            ITEM_DATA tbl = ff9item._FF9Item_Info[itemId - 224];
                            if ((ff9ItemData.type & 1) == 1)
                            {
                                if (!_usedItemIdList.Contains(itemId))
                                {
                                    if ((FF9FITEM_ID_VEGETABLE != itemId ? tbl.info.DisplayStats : 0) == 0)
                                    {
                                        if (SFieldCalculator.FieldCalcMain(player, player, tbl, tbl.Ref.ScriptId, 0U))
                                        {
                                            FF9Sfx.FF9SFX_Play(106);
                                            ff9item.FF9Item_Remove(itemId, 1);
                                            if (ff9item.FF9Item_GetCount(itemId) == 0)
                                            {
                                                _usedItemIdList.Add(itemId);
                                            }
                                            DisplayItem();
                                        }
                                        else
                                        {
                                            FF9Sfx.FF9SFX_Play(102);
                                        }
                                    }
                                    else
                                    {
                                        FF9Sfx.FF9SFX_Play(103);
                                        if (_currentItemIndex % 2 == 0)
                                        {
                                            _targetTransition.animatedInStartPosition = new Vector3(1543f, 0.0f, 0.0f);
                                            _targetTransition.animatedOutEndPosition  = new Vector3(1543f, 0.0f, 0.0f);
                                            TargetListPanel.transform.localPosition   = new Vector3(TargetPositionXOffset, 0.0f, 0.0f);
                                        }
                                        else
                                        {
                                            _targetTransition.animatedInStartPosition = new Vector3(-1543f, 0.0f, 0.0f);
                                            _targetTransition.animatedOutEndPosition  = new Vector3(-1543f, 0.0f, 0.0f);
                                            TargetListPanel.transform.localPosition   = new Vector3((Single)(-TargetPositionXOffset - 60.0), 0.0f, 0.0f);
                                        }
                                        _targetTransition.DestinationPosition = new Vector3[1]
                                        {
                                            TargetListPanel.transform.localPosition
                                        };
                                        DisplayTarget();
                                        Loading = true;
                                        _targetTransition.TweenIn(new Byte[1], () =>
                                        {
                                            Loading = false;
                                            ButtonGroupState.RemoveCursorMemorize(TargetGroupButton);
                                            ButtonGroupState.ActiveGroup = TargetGroupButton;
                                            ButtonGroupState.HoldActiveStateOnGroup(ItemGroupButton);
                                        });
                                    }
                                }
                                else
                                {
                                    FF9Sfx.FF9SFX_Play(102);
                                }
                            }
                            else
                            {
                                FF9Sfx.FF9SFX_Play(102);
                            }
                        }
                        else
                        {
                            FF9Sfx.FF9SFX_Play(102);
                        }
                    }
                    else if (_currentArrangeMode == 2)
                    {
                        FF9Sfx.FF9SFX_Play(103);
                        ButtonGroupState.SetCursorMemorize(go.GetChild(1), ItemArrangeGroupButton);
                        ButtonGroupState.ActiveGroup = ItemArrangeGroupButton;
                        ButtonGroupState.HoldActiveStateOnGroup(ItemGroupButton);
                        ButtonGroupState.SetOutsideLimitRectBehavior(PointerManager.LimitRectBehavior.Hide, ItemGroupButton);
                    }
                }
                else
                {
                    OnSecondaryGroupClick(go);
                }
            }
            else if (ButtonGroupState.ActiveGroup == KeyItemGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, KeyItemGroupButton))
                {
                    _currentItemIndex = go.GetComponent <RecycleListItem>().ItemDataIndex;
                    if (_keyItemIdList[_currentItemIndex] != FF9FITEM_RARE_NONE)
                    {
                        FF9Sfx.FF9SFX_Play(103);
                        DisplayKeyItemSkin(true);
                    }
                    else
                    {
                        FF9Sfx.FF9SFX_Play(102);
                    }
                }
                else
                {
                    OnSecondaryGroupClick(go);
                }
            }
            else if (ButtonGroupState.ActiveGroup == TargetGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, TargetGroupButton))
                {
                    Int32     siblingIndex = go.transform.GetSiblingIndex();
                    Int32     itemId       = _itemIdList[_currentItemIndex];
                    PLAYER    player       = FF9StateSystem.Common.FF9.party.member[siblingIndex];
                    ITEM_DATA tbl          = ff9item._FF9Item_Info[itemId - 224];
                    if (SFieldCalculator.FieldCalcMain(player, player, tbl, tbl.Ref.ScriptId, 0U))
                    {
                        FF9Sfx.FF9SFX_Play(106);
                        ff9item.FF9Item_Remove(itemId, 1);
                        if (ff9item.FF9Item_GetCount(itemId) > 0)
                        {
                            DisplayItem();
                            DisplayTarget();
                        }
                        else
                        {
                            _usedItemIdList.Add(itemId);
                            DisplayItem();
                            ButtonGroupState.ActiveGroup = ItemGroupButton;
                            Loading = true;
                            // ISSUE: method pointer
                            _targetTransition.TweenOut(new Byte[1], () => Loading = false);
                        }
                    }
                    else
                    {
                        FF9Sfx.FF9SFX_Play(102);
                    }
                }
            }
            else if (ButtonGroupState.ActiveGroup == ItemArrangeGroupButton)
            {
                if (ButtonGroupState.ContainButtonInGroup(go, ItemArrangeGroupButton))
                {
                    FF9Sfx.FF9SFX_Play(103);
                    _currentArrangeItemIndex = go.transform.parent.GetComponent <RecycleListItem>().ItemDataIndex;
                    FF9ITEM ff9Item = FF9StateSystem.Common.FF9.item[_currentItemIndex];
                    FF9StateSystem.Common.FF9.item[_currentItemIndex]        = FF9StateSystem.Common.FF9.item[_currentArrangeItemIndex];
                    FF9StateSystem.Common.FF9.item[_currentArrangeItemIndex] = ff9Item;
                    _switchingItem = true;
                    DisplayItem();
                    _itemScrollList.JumpToIndex(_currentArrangeItemIndex, false);
                    ButtonGroupState.RemoveCursorMemorize(ItemGroupButton);
                    ButtonGroupState.ActiveGroup = ItemGroupButton;
                    ButtonGroupState.SetOutsideLimitRectBehavior(PointerManager.LimitRectBehavior.Limit, ItemGroupButton);
                    _switchingItem = false;
                }
                else
                {
                    OnSecondaryGroupClick(go);
                }
            }
        }
        return(true);
    }
Example #19
0
 internal BattleItem(ITEM_DATA data)
 {
     _data = data;
 }