Пример #1
0
        private void CreateOneMove_Click(object sender, EventArgs e)
        {
            //動作の設定
            EnemyMovePattern.EnemyMove setem = new EnemyMovePattern.EnemyMove();
            setem.moveId       = MoveID.SelectedIndex;
            setem.behaviorId   = IsGetBehavior.Checked == true ? (int)AcquisitionSkillID.Value : 0;
            setem.durationTime = (int)DurationTime.Value;
            setem.animSrc.Set(BoxX.Value, BoxY.Value, BoxW.Value, BoxH.Value);
            setem.basisRenderPosX = (float)BasisRenderX.Value;
            setem.basisRenderPosY = (float)BasisRenderY.Value;
            setem.animNum         = (int)AnimationNum.Value;
            setem.waitTime        = (float)WaitTime.Value;
            setem.isRoop          = IsRoop.Checked ? 1 : 0;

            int add = MoveList.SelectedIndex;

            //ここに追加を選択していない時
            if (add != MoveList.Items.Count - 1)
            {
                enemyMSList.ems[nowSettingMovePattern].emp.em.RemoveAt(add);
                MoveList.Items.RemoveAt(add);
                enemyMSList.ems[nowSettingMovePattern].emp.em.Insert(add, setem);
                MoveList.Items.Insert(add, setem.moveId.ToString() + " " + IsGetBehavior.Checked + " " + setem.durationTime.ToString());
                MoveList.SelectedIndex = add;
            }
            else
            {
                ++enemyMSList.ems[nowSettingMovePattern].emp.totalMoveNum;
                enemyMSList.ems[nowSettingMovePattern].emp.em.Insert(add, setem);
                MoveList.Items.Insert(add, setem.moveId.ToString() + " " + IsGetBehavior.Checked + " " + setem.durationTime.ToString());
            }

            ++nowSettingMove;
            MoveOrder.Text = nowSettingMove.ToString();
        }
Пример #2
0
        private void ReadFile_Click(object sender, EventArgs e)
        {
            if (ReadFileName.Text.Length <= 0)
            {
                MessageBox.Show("先輩!何でファイル名書いてないんすか!\nやめてくださいよ本当に!",
                                "ああああああ!!テメェェェ!!何してんだよァァァ!!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Hand);

                return;
            }

            enemyMSList.ems.Clear();

            System.IO.StreamReader sr = null;
            try
            {
                sr = new System.IO.StreamReader("data/" + ReadFileName.Text + ".txt");

                string[] txt = sr.ReadToEnd().Split(' ');
                int      tmp = 0;

                TexturePath.Text     = txt[tmp++];
                TextureName.Text     = txt[tmp++];
                MaxLife.Value        = decimal.Parse(txt[tmp++]);
                HitDamage.Value      = decimal.Parse(txt[tmp++]);
                MoveSpeed.Value      = decimal.Parse(txt[tmp++]);
                JumpPower.Value      = decimal.Parse(txt[tmp++]);
                IsUseGrabity.Checked = int.Parse(txt[tmp++]) == 1;

                BaseW.Value = decimal.Parse(txt[tmp++]);
                BaseH.Value = decimal.Parse(txt[tmp++]);
                BaseD.Value = decimal.Parse(txt[tmp++]);

                DamageCameraPosX.Value = decimal.Parse(txt[tmp++]);
                DamageCameraPosY.Value = decimal.Parse(txt[tmp++]);
                DamageCameraPosZ.Value = decimal.Parse(txt[tmp++]);
                DamageCameraW.Value    = decimal.Parse(txt[tmp++]);
                DamageCameraH.Value    = decimal.Parse(txt[tmp++]);
                DamageCameraD.Value    = decimal.Parse(txt[tmp++]);
                VisibillityPosX.Value  = decimal.Parse(txt[tmp++]);
                VisibillityPosY.Value  = decimal.Parse(txt[tmp++]);
                VisibillityPosZ.Value  = decimal.Parse(txt[tmp++]);
                VisibillityW.Value     = decimal.Parse(txt[tmp++]);
                VisibillityH.Value     = decimal.Parse(txt[tmp++]);
                VisibillityD.Value     = decimal.Parse(txt[tmp++]);
                AttackTransPosX.Value  = decimal.Parse(txt[tmp++]);
                AttackTransPosY.Value  = decimal.Parse(txt[tmp++]);
                AttackTransPosZ.Value  = decimal.Parse(txt[tmp++]);
                AttackTransW.Value     = decimal.Parse(txt[tmp++]);
                AttackTransH.Value     = decimal.Parse(txt[tmp++]);
                AttackTransD.Value     = decimal.Parse(txt[tmp++]);

                MovePatternNum.Value        = decimal.Parse(txt[tmp++]);
                enemyMSList.totalPatternNum = (int)MovePatternNum.Value;
                for (int i = 0; i < enemyMSList.totalPatternNum; ++i)
                {
                    enemyMSList.ems.Add(new EnemyMoveSetList.EnemyMoveSet());

                    enemyMSList.ems[i].emp.totalMoveNum = int.Parse(txt[tmp++]);

                    for (int j = 0; j < enemyMSList.ems[i].emp.totalMoveNum; ++j)
                    {
                        EnemyMovePattern.EnemyMove setem = new EnemyMovePattern.EnemyMove();
                        setem.moveId       = int.Parse(txt[tmp++]);
                        setem.behaviorId   = int.Parse(txt[tmp++]);
                        setem.durationTime = int.Parse(txt[tmp++]);
                        setem.animSrc.Set(int.Parse(txt[tmp++]), int.Parse(txt[tmp++]), int.Parse(txt[tmp++]), int.Parse(txt[tmp++]));
                        setem.basisRenderPosX = float.Parse(txt[tmp++]);
                        setem.basisRenderPosY = float.Parse(txt[tmp++]);
                        setem.animNum         = int.Parse(txt[tmp++]);
                        setem.waitTime        = int.Parse(txt[tmp++]);
                        setem.isRoop          = int.Parse(txt[tmp++]) == 1 ? 1 : 0;

                        enemyMSList.ems[i].emp.em.Add(setem);
                    }

                    for (int k = 0; k < enemyMSList.totalPatternNum; ++k)
                    {
                        enemyMSList.ems[i].transitionId.Add(int.Parse(txt[tmp++]));
                    }
                }

                MovePatternNum.Minimum = enemyMSList.totalPatternNum;
                OutputFileName.Text    = ReadFileName.Text;
                readFile = true;

                MessageBox.Show("読み込みが完了しました",
                                "完了",
                                MessageBoxButtons.OK);
            }
            catch
            {
                MessageBox.Show("指定したファイルが無いか、\n正常なファイルでない可能性が微粒子レベルで存在している…?",
                                "データ壊れちゃ~↑う",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Hand);

                return;
            }

            return;
        }