Beispiel #1
0
        public Player(int controller)
        {
            PlayerID  = controller;
            NoConnect = false;
            if (ScreenManager.Instance.Controllers[controller] != null)
            {
                CharCreation_Members char_mem = new CharCreation_Members();

                State         = PlayerEnums.ActionState.None;
                lookDirection = PlayerEnums.LookDirection.Down;
                sprSheetY     = PlayerEnums.Action.None;
                sprSheetX     = 0;

                Controller = ScreenManager.Instance.Controllers[controller];

                direction = new Vector2(0, 1);

                string gender = "";

                if (Controller.characterInfo.Gender == 0)
                {
                    gender = "Male";
                }
                else
                {
                    gender = "Female";
                }

                sprite = new SpriteClasscs(
                    "CharacterSprites/" + gender + "/SkinColor/" + char_mem.GetString(1, 1, Controller.characterInfo.Skincolor),
                    "CharacterSprites/" + gender + "/Shirt/" + char_mem.GetString(2, 1, Controller.characterInfo.Shirt),
                    "CharacterSprites/" + gender + "/Head/" + char_mem.GetString(2, 0, Controller.characterInfo.Head),
                    "CharacterSprites/" + gender + "/Belt/" + char_mem.GetString(2, 2, Controller.characterInfo.Belt),
                    "CharacterSprites/" + gender + "/Pants/" + char_mem.GetString(2, 3, Controller.characterInfo.Pants)
                    );

                SpeedScale = 1.5f;

                Healthbar                = new Healthbar();
                LevelIndicator           = new LevelIndicator();
                LevelIndicator.Text.Text = Convert.ToString(Controller.characterInfo.Level);
                if (Convert.ToInt32(LevelIndicator.Text.Text) == 0)
                {
                    LevelIndicator.Text.Text = "1";
                }
                else if (Convert.ToInt32(LevelIndicator.Text.Text) == 1)
                {
                    Controller.characterInfo.Level = 10;
                }
                Expbar = new Expbar();
                Expbar.SetExp(Controller.characterInfo.XP);
            }
            else
            {
                NoConnect = true;
            }
        }
        public int[] prevClothessettings = { 0, 0, 0, 0 }; //  1.Head 2.Shirt 3.Belt 4.Pants

        public CharacterCreator()
        {
            charCreation_member = new CharCreation_Members();

            Skincolor = new SprSheetImage[2, charCreation_member.GetList(1, 1).Count];
            Head      = new SprSheetImage[2, charCreation_member.GetList(0, 2).Count];
            Shirt     = new SprSheetImage[2, charCreation_member.GetList(1, 2).Count];
            Belt      = new SprSheetImage[2, charCreation_member.GetList(2, 2).Count];
            Pants     = new SprSheetImage[2, charCreation_member.GetList(3, 2).Count];

            FillArrays();
        }
Beispiel #3
0
        //Contructor
        public CharCreationScreen()
        {
            charCreatin_member = new CharCreation_Members();

            numitems1 = charCreatin_member.GetList(10, 0).Count;
            numitems2 = charCreatin_member.GetList(10, 2).Count;
            numitems3 = charCreatin_member.GetList(10, 1).Count;

            fields[0] = new Control1_Field(0, numFields, "Character", numitems1);
            fields[2] = new Control1_Field(2, numFields, "Clothes", numitems2);
            fields[1] = new Control1_Field(1, numFields, "Appearance", numitems3);

            control = new Control1(numFields, numitems1);

            for (int i = 0; i < numitems1; i++)
            {
                items1[i] = new Control1_Item(
                    itemID: i,
                    itemname: charCreatin_member.GetList(10, 0)[i],
                    itemsetting: charCreatin_member.GetString(0, i, 0),
                    fieldID: 0,
                    maxindex: charCreatin_member.GetList(i, 0).Count
                    );
            }

            for (int i = 0; i < numitems2; i++)
            {
                items2[i] = new Control1_Item(
                    itemID: i,
                    itemname: charCreatin_member.GetList(10, 2)[i],
                    itemsetting: charCreatin_member.GetString(2, i, 0),
                    fieldID: 2,
                    maxindex: charCreatin_member.GetList(i, 2).Count
                    );
            }
            for (int i = 0; i < numitems3; i++)
            {
                items3[i] = new Control1_Item(
                    itemID: i,
                    itemname: charCreatin_member.GetList(10, 1)[i],
                    itemsetting: charCreatin_member.GetString(1, i, 0),
                    fieldID: 1,
                    maxindex: charCreatin_member.GetList(i, 1).Count
                    );
            }

            characterCreator = new CharacterCreator();
        }