Esempio n. 1
0
    public static HeroCostume PhotonDataToHeroCostume(PhotonPlayer player)
    {
        HeroCostume heroCostume = new HeroCostume();
        Hashtable   props       = player.Properties;

        heroCostume.sex       = IntToSex(props.Get <int>(PhotonPlayerProperty.sex));
        heroCostume.costumeId = props.Get <int>(PhotonPlayerProperty.costumeId);
        heroCostume.id        = props.Get <int>(PhotonPlayerProperty.heroCostumeId);
        heroCostume.cape      = props.Get <bool>(PhotonPlayerProperty.cape);
        CostumeHair[] hairs  = IntToSex(props.Get <int>(PhotonPlayerProperty.sex)) == Sex.Male ? CostumeHair.hairsM : CostumeHair.hairsF;
        int           hairId = props.Get <int>(PhotonPlayerProperty.hairInfo);

        heroCostume.hairInfo         = hairs[hairId < hairs.Length ? hairId : 0];
        heroCostume.eye_texture_id   = props.Get <int>(PhotonPlayerProperty.eye_texture_id);
        heroCostume.beard_texture_id = props.Get <int>(PhotonPlayerProperty.beard_texture_id);
        heroCostume.glass_texture_id = props.Get <int>(PhotonPlayerProperty.glass_texture_id);
        heroCostume.skin_color       = props.Get <int>(PhotonPlayerProperty.skin_color);
        heroCostume.hair_color       = new Color(props.Get <float>(PhotonPlayerProperty.hair_color1), props.Get <float>(PhotonPlayerProperty.hair_color2), props.Get <float>(PhotonPlayerProperty.hair_color3));
        heroCostume.division         = IntToDivision(props.Get <int>(PhotonPlayerProperty.division));
        HeroStat stat = new HeroStat();

        stat.Spd = props.Get <int>(PhotonPlayerProperty.statSPD);
        stat.Gas = props.Get <int>(PhotonPlayerProperty.statGAS);
        stat.Bla = props.Get <int>(PhotonPlayerProperty.statBLA);
        stat.Acl = props.Get <int>(PhotonPlayerProperty.statACL);
        string skill = props.Get <string>(PhotonPlayerProperty.statSKILL);

        stat.skillID     = skill ?? "levi";
        heroCostume.stat = stat;
        heroCostume.setBodyByCostumeId(-1);
        heroCostume.setMesh();
        heroCostume.setTexture();
        return(heroCostume);
    }
Esempio n. 2
0
    public static HeroCostume PhotonDataToHeroCostume2(PhotonPlayer player)
    {
        HeroCostume costume = new HeroCostume();
        SEX         sex     = IntToSex((int)player.customProperties[PhotonPlayerProperty.sex]);

        costume = new HeroCostume
        {
            sex              = sex,
            costumeId        = (int)player.customProperties[PhotonPlayerProperty.costumeId],
            id               = (int)player.customProperties[PhotonPlayerProperty.heroCostumeId],
            cape             = (bool)player.customProperties[PhotonPlayerProperty.cape],
            hairInfo         = (sex != SEX.MALE) ? CostumeHair.hairsF[(int)player.customProperties[PhotonPlayerProperty.hairInfo]] : CostumeHair.hairsM[(int)player.customProperties[PhotonPlayerProperty.hairInfo]],
            eye_texture_id   = (int)player.customProperties[PhotonPlayerProperty.eye_texture_id],
            beard_texture_id = (int)player.customProperties[PhotonPlayerProperty.beard_texture_id],
            glass_texture_id = (int)player.customProperties[PhotonPlayerProperty.glass_texture_id],
            skin_color       = (int)player.customProperties[PhotonPlayerProperty.skin_color],
            hair_color       = new Color((float)player.customProperties[PhotonPlayerProperty.hair_color1], (float)player.customProperties[PhotonPlayerProperty.hair_color2], (float)player.customProperties[PhotonPlayerProperty.hair_color3]),
            division         = IntToDivision((int)player.customProperties[PhotonPlayerProperty.division]),
            stat             = new HeroStat()
        };
        costume.stat.SPD     = (int)player.customProperties[PhotonPlayerProperty.statSPD];
        costume.stat.GAS     = (int)player.customProperties[PhotonPlayerProperty.statGAS];
        costume.stat.BLA     = (int)player.customProperties[PhotonPlayerProperty.statBLA];
        costume.stat.ACL     = (int)player.customProperties[PhotonPlayerProperty.statACL];
        costume.stat.skillId = (string)player.customProperties[PhotonPlayerProperty.statSKILL];
        if ((costume.costumeId == 0x19) && (costume.sex == SEX.FEMALE))
        {
            costume.costumeId = 0x1a;
        }
        costume.setBodyByCostumeId(-1);
        costume.setMesh2();
        costume.setTexture();
        return(costume);
    }
Esempio n. 3
0
    public static HeroCostume LocalDataToHeroCostume(string slot)
    {
        slot = slot.ToUpper();
        if (!PlayerPrefs.HasKey(slot + PhotonPlayerProperty.sex))
        {
            return(HeroCostume.costume[0]);
        }
        HeroCostume heroCostume = new HeroCostume();

        heroCostume.sex              = IntToSex(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.sex));
        heroCostume.id               = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.heroCostumeId);
        heroCostume.costumeId        = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.costumeId);
        heroCostume.cape             = (PlayerPrefs.GetInt(slot + PhotonPlayerProperty.cape) == 1);
        heroCostume.hairInfo         = ((heroCostume.sex != Sex.Male) ? CostumeHair.hairsF[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)] : CostumeHair.hairsM[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)]);
        heroCostume.eye_texture_id   = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.eye_texture_id);
        heroCostume.beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.beard_texture_id);
        heroCostume.glass_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.glass_texture_id);
        heroCostume.skin_color       = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.skin_color);
        heroCostume.hair_color       = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color3));
        heroCostume.division         = CostumeConeveter.IntToDivision(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.division));
        heroCostume.stat             = new HeroStat();
        heroCostume.stat.Spd         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statSPD);
        heroCostume.stat.Gas         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statGAS);
        heroCostume.stat.Bla         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statBLA);
        heroCostume.stat.Acl         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statACL);
        heroCostume.stat.skillID     = PlayerPrefs.GetString(slot + PhotonPlayerProperty.statSKILL);
        heroCostume.setBodyByCostumeId(-1);
        heroCostume.setMesh();
        heroCostume.setTexture();
        return(heroCostume);
    }
Esempio n. 4
0
    public static HeroCostume FromPhotonData(PhotonPlayer player)
    {
        Sex sex = (Sex)(int)player.customProperties[PhotonPlayerProperty.Sex];

        HeroCostume heroCostume = new HeroCostume();

        heroCostume.sex              = sex;
        heroCostume.costumeId        = (int)player.customProperties[PhotonPlayerProperty.CostumeId];
        heroCostume.id               = (int)player.customProperties[PhotonPlayerProperty.HeroCostumeId];
        heroCostume.cape             = (bool)player.customProperties[PhotonPlayerProperty.Cape];
        heroCostume.hairInfo         = ((sex != Sex.MALE) ? CostumeHair.hairsF[(int)player.customProperties[PhotonPlayerProperty.HairInfo]] : CostumeHair.hairsM[(int)player.customProperties[PhotonPlayerProperty.HairInfo]]);
        heroCostume.eye_texture_id   = (int)player.customProperties[PhotonPlayerProperty.EyeTextureId];
        heroCostume.beard_texture_id = (int)player.customProperties[PhotonPlayerProperty.BeardTextureId];
        heroCostume.glass_texture_id = (int)player.customProperties[PhotonPlayerProperty.GlassTextureId];
        heroCostume.skin_color       = (int)player.customProperties[PhotonPlayerProperty.SkinColor];
        heroCostume.hair_color       = new Color((float)player.customProperties[PhotonPlayerProperty.HairColor1], (float)player.customProperties[PhotonPlayerProperty.HairColor2], (float)player.customProperties[PhotonPlayerProperty.HairColor3]);
        heroCostume.division         = (Division)(int)player.customProperties[PhotonPlayerProperty.Division];
        heroCostume.stat             = new HeroStat();
        heroCostume.stat.SPD         = (int)player.customProperties[PhotonPlayerProperty.StatSpd];
        heroCostume.stat.GAS         = (int)player.customProperties[PhotonPlayerProperty.StatGas];
        heroCostume.stat.BLA         = (int)player.customProperties[PhotonPlayerProperty.StatBla];
        heroCostume.stat.ACL         = (int)player.customProperties[PhotonPlayerProperty.StatAcl];
        heroCostume.stat.skillId     = (string)player.customProperties[PhotonPlayerProperty.StatSkill];
        heroCostume.setBodyByCostumeId();
        heroCostume.SetMesh();
        heroCostume.setTexture();
        return(heroCostume);
    }
Esempio n. 5
0
    public static HeroCostume LocalDataToHeroCostume(string slot)
    {
        slot = slot.ToUpper();
        if (!PlayerPrefs.HasKey(slot + PhotonPlayerProperty.sex))
        {
            return(HeroCostume.costume[0]);
        }
        HeroCostume costume = new HeroCostume();

        costume = new HeroCostume
        {
            sex       = IntToSex(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.sex)),
            id        = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.heroCostumeId),
            costumeId = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.costumeId),
            cape      = (PlayerPrefs.GetInt(slot + PhotonPlayerProperty.cape) != 1) ? false : true
        };
        costume.hairInfo         = (costume.sex != SEX.MALE) ? CostumeHair.hairsF[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)] : CostumeHair.hairsM[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)];
        costume.eye_texture_id   = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.eye_texture_id);
        costume.beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.beard_texture_id);
        costume.glass_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.glass_texture_id);
        costume.skin_color       = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.skin_color);
        costume.hair_color       = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color3));
        costume.division         = IntToDivision(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.division));
        costume.stat             = new HeroStat();
        costume.stat.SPD         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statSPD);
        costume.stat.GAS         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statGAS);
        costume.stat.BLA         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statBLA);
        costume.stat.ACL         = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.statACL);
        costume.stat.skillId     = PlayerPrefs.GetString(slot + PhotonPlayerProperty.statSKILL);
        costume.setBodyByCostumeId(-1);
        costume.setMesh2();
        costume.setTexture();
        return(costume);
    }
Esempio n. 6
0
    public static HeroCostume FromLocalData(string slot)
    {
        slot = slot.ToUpper();
        if (!PlayerPrefs.HasKey(slot + PhotonPlayerProperty.Sex))
        {
            return(HeroCostume.Costumes[0]);
        }
        // Costume Info
        HeroCostume costume = new HeroCostume();

        costume.sex              = (Sex)PlayerPrefs.GetInt(slot + PhotonPlayerProperty.Sex);
        costume.id               = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.HeroCostumeId);
        costume.costumeId        = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.CostumeId);
        costume.cape             = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.Cape) == 1;
        costume.hairInfo         = ((costume.sex != Sex.MALE) ? CostumeHair.hairsF[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.HairInfo)] : CostumeHair.hairsM[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.HairInfo)]);
        costume.eye_texture_id   = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.EyeTextureId);
        costume.beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.BeardTextureId);
        costume.glass_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.GlassTextureId);
        costume.skin_color       = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.SkinColor);
        costume.hair_color       = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.HairColor1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.HairColor2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.HairColor3));
        costume.division         = (Division)PlayerPrefs.GetInt(slot + PhotonPlayerProperty.Division);

        // Stats
        costume.stat         = new HeroStat();
        costume.stat.SPD     = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatSpd);
        costume.stat.GAS     = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatGas);
        costume.stat.BLA     = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatBla);
        costume.stat.ACL     = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.StatAcl);
        costume.stat.skillId = PlayerPrefs.GetString(slot + PhotonPlayerProperty.StatSkill);
        costume.setBodyByCostumeId();
        costume.SetMesh();
        costume.setTexture();
        return(costume);
    }
Esempio n. 7
0
    public static HeroCostume PhotonDataToHeroCostume2(PhotonPlayer player)
    {
        HeroCostume costume = new HeroCostume();
        SEX         sex     = IntToSex(player.sex);

        costume = new HeroCostume
        {
            sex              = sex,
            costumeId        = player.costumeId,
            id               = player.heroCostumeId,
            cape             = player.cape,
            hairInfo         = (sex != SEX.MALE) ? CostumeHair.hairsF[player.hairInfo] : CostumeHair.hairsM[player.hairInfo],
            eye_texture_id   = player.eye_texture_id,
            beard_texture_id = player.beard_texture_id,
            glass_texture_id = player.glass_texture_id,
            skin_color       = player.skin_color,
            hair_color       = new Color(player.hair_color1, player.hair_color2, player.hair_color3),
            division         = IntToDivision(player.division),
            stat             = new HeroStat()
        };
        costume.stat.SPD     = player.statSPD;
        costume.stat.GAS     = player.statGAS;
        costume.stat.BLA     = player.statBLA;
        costume.stat.ACL     = player.statACL;
        costume.stat.skillId = player.statSKILL;
        if ((costume.costumeId == 0x19) && (costume.sex == SEX.FEMALE))
        {
            costume.costumeId = 0x1a;
        }
        costume.setBodyByCostumeId(-1);
        costume.setMesh2();
        costume.setTexture();
        return(costume);
    }
Esempio n. 8
0
        public static HeroCostume PhotonDataToHeroCostume(Player player)
        {
            var costume = new HeroCostume
            {
                sex       = player.Properties.Sex,
                costumeId = player.Properties.CostumeID,
                id        = player.Properties.HeroCostumeID,
                cape      = player.Properties.HasCape,
                hairInfo  = player.Properties.Sex != Sex.Male
                    ? CostumeHair.FemaleHairs[player.Properties.HairInfo]
                    : CostumeHair.MaleHairs[player.Properties.HairInfo],
                eye_texture_id   = player.Properties.EyeTextureID,
                beard_texture_id = player.Properties.BeardTextureID,
                glass_texture_id = player.Properties.GlassTextureID,
                skin_color       = player.Properties.SkinColor,
                hair_color       = player.Properties.HairColor,
                division         = player.Properties.Division,
                stat             = player.Properties.HeroStat
            };

            if (costume.costumeId == 25 && costume.sex == Sex.Female)
            {
                costume.costumeId = 26;
            }
            costume.setBodyByCostumeId(-1);
            costume.setMesh2();
            costume.setTexture();
            return(costume);
        }
Esempio n. 9
0
        public static HeroCostume LocalDataToHeroCostume(string slot)
        {
            slot = slot.ToUpper();
            if (!PlayerPrefs.HasKey(slot + PlayerProperty.Sex))
            {
                return(HeroCostume.costume[0]);
            }
            HeroCostume costume = new HeroCostume();

            costume = new HeroCostume {
                sex              = (Sex)PlayerPrefs.GetInt(slot + PlayerProperty.Sex),
                id               = PlayerPrefs.GetInt(slot + PlayerProperty.HeroCostumeID),
                costumeId        = PlayerPrefs.GetInt(slot + PlayerProperty.CostumeID),
                cape             = PlayerPrefs.GetInt(slot + PlayerProperty.HasCape) == 1,
                hairInfo         = costume.sex != Sex.Male ? CostumeHair.FemaleHairs[PlayerPrefs.GetInt(slot + PlayerProperty.HairInfo)] : CostumeHair.MaleHairs[PlayerPrefs.GetInt(slot + PlayerProperty.HairInfo)],
                eye_texture_id   = PlayerPrefs.GetInt(slot + PlayerProperty.EyeTextureID),
                beard_texture_id = PlayerPrefs.GetInt(slot + PlayerProperty.BeardTextureId),
                glass_texture_id = PlayerPrefs.GetInt(slot + PlayerProperty.GlassTextureID),
                skin_color       = PlayerPrefs.GetInt(slot + PlayerProperty.SkinColor),
                hair_color       = new Color(PlayerPrefs.GetFloat(slot + PlayerProperty.HairColorR), PlayerPrefs.GetFloat(slot + PlayerProperty.HairColorG), PlayerPrefs.GetFloat(slot + PlayerProperty.HairColorB)),
                division         = (Division)PlayerPrefs.GetInt(slot + PlayerProperty.Division),
                stat             = new HeroStat()
            };
            costume.stat.Speed        = PlayerPrefs.GetInt(slot + PlayerProperty.Speed);
            costume.stat.Gas          = PlayerPrefs.GetInt(slot + PlayerProperty.Gas);
            costume.stat.Blade        = PlayerPrefs.GetInt(slot + PlayerProperty.Blade);
            costume.stat.Acceleration = PlayerPrefs.GetInt(slot + PlayerProperty.Acceleration);
            costume.stat.SkillName    = PlayerPrefs.GetString(slot + PlayerProperty.Skill);
            costume.setBodyByCostumeId();
            costume.setMesh2();
            costume.setTexture();
            return(costume);
        }
Esempio n. 10
0
    public static HeroCostume HeroToAHSS(string slot)
    {
        slot = slot.ToUpper();
        HeroCostume costume = null;
        string      str     = slot.Substring(5).ToUpper();
        int         index   = 0;

        while (index < HeroCostume.costume.Length)
        {
            if (HeroCostume.costume[index].name.ToUpper() != str)
            {
                index++;
            }
            else
            {
                int id = HeroCostume.costume[index].id;
                if (slot != "AHSS")
                {
                    id += CheckBoxCostume.costumeSet - 1;
                }
                if (HeroCostume.costume[id].name != HeroCostume.costume[index].name)
                {
                    id = HeroCostume.costume[index].id + 1;
                }
                costume = HeroCostume.costume[id];
                break;
            }
        }
        if (costume == null)
        {
            return(HeroCostume.costume[0]);
        }
        HeroCostume costume3 = new HeroCostume
        {
            sex              = costume.sex,
            id               = HeroCostume.costume[0x25].costumeId,
            costumeId        = HeroCostume.costume[0x25].costumeId,
            cape             = costume.cape,
            hairInfo         = costume.hairInfo,
            eye_texture_id   = costume.eye_texture_id,
            beard_texture_id = costume.beard_texture_id,
            glass_texture_id = costume.glass_texture_id,
            skin_color       = costume.skin_color,
            hair_color       = costume.hair_color,
            division         = costume.division,
            stat             = costume.stat
        };

        costume3.setBodyByCostumeId(-1);
        costume3.setMesh();
        costume3.setTexture();
        return(costume3);
    }