public int GetCardState(string stateType)
        {
            int state = 0;

            if (stateType == "Battle")
            {
                state = SystemDate.IntParse(headCard.getCardComponent(headCardNum, 4)) +
                        SystemDate.IntParse(bodyCard.getCardComponent(bodyCardNum, 4)) +
                        SystemDate.IntParse(lowerCard.getCardComponent(lowerCardNum, 4));
            }
            else if (stateType == "Intelligence")
            {
                state = SystemDate.IntParse(headCard.getCardComponent(headCardNum, 5)) +
                        SystemDate.IntParse(bodyCard.getCardComponent(bodyCardNum, 5)) +
                        SystemDate.IntParse(lowerCard.getCardComponent(lowerCardNum, 5));
            }
            else if (stateType == "Crazy")
            {
                state = SystemDate.IntParse(headCard.getCardComponent(headCardNum, 6)) +
                        SystemDate.IntParse(bodyCard.getCardComponent(bodyCardNum, 6)) +
                        SystemDate.IntParse(lowerCard.getCardComponent(lowerCardNum, 6));
            }

            return(state);
        }
Esempio n. 2
0
        static void Main(string[] args)
        {
            // Altseedを初期化する。
            asd.Engine.Initialize("STG", 1280, 720, new asd.EngineOption());
            //asd.Engine.IsFullscreenMode = true;

            //初期データをロードする
            SystemDate.ButtonLoad();
            SystemDate.AllCardLoad();

            //

            TitleScene titleScene = new TitleScene();

            asd.Engine.ChangeSceneWithTransition(titleScene, new asd.TransitionFade(0, 1.0f));


            // Altseedのウインドウが閉じられていないか確認する。
            while (asd.Engine.DoEvents())
            {
                // もし、Escキーが押されていたらwhileループを抜ける。
                if (asd.Engine.Keyboard.GetKeyState(asd.Keys.Escape) == asd.KeyState.Push)
                {
                    break;
                }

                // Altseedを更新する。
                asd.Engine.Update();
            }

            // Altseedの終了処理をする。
            asd.Engine.Terminate();
        }
        public void ImageUnion(int headNum, int bodyNum, int lowerNum)
        {
            // 体
            //画像の読み込み
            bodyCard.Texture = SystemDate.BodyCardTexture[bodyNum];

            //画像の中心点のY座標をデータファイルから取得
            int bodyCenterY = SystemDate.IntParse(bodyCard.getCardComponent(bodyNum, 9));

            bodyCard.CenterPosition = new asd.Vector2DF(bodyCard.Texture.Size.X / 2.0f, bodyCenterY);

            //表示
            bodyCard.Position = new asd.Vector2DF(xLine, yLine);
            bodyCard.Scale    = new asd.Vector2DF(0.5f, 0.5f);


            //頭
            //画像の読み込み
            headCard.Texture = SystemDate.HeadCardTexture[headNum];

            //画像の中心点のY座標をデータファイルから取得
            int headCenterY = SystemDate.IntParse(headCard.getCardComponent(headNum, 9));

            headCard.CenterPosition = new asd.Vector2DF(headCard.Texture.Size.X / 2.0f, headCenterY);

            //体と頭の大きさの比率を計算
            headRatio = (float)SystemDate.IntParse(bodyCard.getCardComponent(bodyNum, 8)) / SystemDate.IntParse(headCard.getCardComponent(headNum, 8));

            headCard.Position = bodyCard.Position;
            headCard.Scale    = new asd.Vector2DF(0.5f * headRatio, 0.5f * headRatio);

            //後ろ髪
            if ((headCard.getCardComponent(headNum, 10) == "0"))
            {
                hairCard.Texture = SystemDate.HairTexture[0];
            }
            else
            {
                hairCard.Texture = SystemDate.HairTexture[headNum];
            }

            //画像の中心点をと位置を頭と合わせる
            hairCard.CenterPosition = headCard.CenterPosition;
            hairCard.Position       = headCard.Position;

            //頭の比率を計算
            hairCard.Scale = headCard.Scale;


            //足
            lowerCard.Texture = SystemDate.LowerCardTexture[lowerNum];

            int lowerCenterY = SystemDate.IntParse(lowerCard.getCardComponent(lowerNum, 9));

            lowerCard.CenterPosition = new asd.Vector2DF(lowerCard.Texture.Size.X / 2.0f, lowerCenterY);

            int bodyUnionY = SystemDate.IntParse(bodyCard.getCardComponent(bodyNum, 10));

            //下半身と胴体の比率計算
            lowerRatio = (float)SystemDate.IntParse(bodyCard.getCardComponent(bodyNum, 11)) / SystemDate.IntParse(lowerCard.getCardComponent(lowerNum, 8));

            lowerCard.Position = new asd.Vector2DF
                                     (xLine + SystemDate.IntParse(bodyCard.getCardComponent(bodyNum, 12)) * 0.5f, bodyUnionY * 0.5f + bodyCard.Position.Y - bodyCenterY * 0.5f);


            lowerCard.Scale = new asd.Vector2DF(0.5f * lowerRatio, 0.5f * lowerRatio);
        }