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 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. 3
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,
            hairInfo         = (costume.sex != SEX.MALE) ? CostumeHair.hairsF[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)] : CostumeHair.hairsM[PlayerPrefs.GetInt(slot + PhotonPlayerProperty.hairInfo)],
            eye_texture_id   = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.eye_texture_id),
            beard_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.beard_texture_id),
            glass_texture_id = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.glass_texture_id),
            skin_color       = PlayerPrefs.GetInt(slot + PhotonPlayerProperty.skin_color),
            hair_color       = new Color(PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color1), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color2), PlayerPrefs.GetFloat(slot + PhotonPlayerProperty.hair_color3)),
            division         = IntToDivision(PlayerPrefs.GetInt(slot + PhotonPlayerProperty.division)),
            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.setMesh();
        costume.setTexture();
        return(costume);
    }
Esempio n. 4
0
    public static HeroCostume PhotonDataToHeroCostume(PhotonPlayer player)
    {
        HeroCostume costume = new HeroCostume();

        costume = new HeroCostume {
            sex              = IntToSex((int)player.customProperties[PhotonPlayerProperty.sex]),
            costumeId        = (int)player.customProperties[PhotonPlayerProperty.costumeId],
            id               = (int)player.customProperties[PhotonPlayerProperty.heroCostumeId],
            cape             = (bool)player.customProperties[PhotonPlayerProperty.cape],
            hairInfo         = (costume.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];
        costume.setBodyByCostumeId(-1);
        costume.setMesh();
        costume.setTexture();
        return(costume);
    }
Esempio n. 5
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);
    }