예제 #1
0
    public void UpdateAiCooperData()
    {
        for (int i = 0; i < fightRoles.Length; i++)
        {
            RoleBase role = fightRoles[i];
            if (role != null)
            {
                int cooperId = role.GetCooperId();
                int proId    = role.GetProId();

                if (!etls.ContainsKey(cooperId))
                {
                    etls.Add(cooperId, new Cooperation(cooperId));
                }

                if (!etls.ContainsKey(proId))
                {
                    etls.Add(proId, Profession.CreatePro(proId));
                }
            }
        }
        foreach (var v in etls)
        {
            v.Value.Update(fightRoles);
        }
    }
예제 #2
0
    public void ShowRoleInfo(RoleBase role, RoleInfoType type = RoleInfoType.Pre)
    {
        if (role == null)
        {
            return;
        }

        int level             = role.GetLevel();
        var attributeData     = DataClass.ConfigAttributeManager.Instance().allDatas;
        var roleAttributeData = DataClass.ConfigRoleManager.Instance().allDatas[role.GetRoleId()].attributes[level - 1];
        var attributeSb       = new System.Text.StringBuilder();

        if (type == RoleInfoType.Pre)
        {
            for (int i = 0; i < 7; i++)
            {
                float nowValue = role.attributes[i];   //当前属性
                int   orValue  = roleAttributeData[i]; //原属性

                if (nowValue > orValue)
                {
                    attributeSb.Append($"{attributeData[i].name}:<color=yellow>{nowValue.ToString()}</color>  ");
                }
                else
                {
                    attributeSb.Append($"{attributeData[i].name}:{nowValue.ToString()}  ");
                }
            }
        }
        else
        {
            for (int i = 0; i < 5; i++)
            {
                float nowValue = role.attributes[i];   //当前属性
                int   orValue  = roleAttributeData[i]; //原属性

                if (nowValue > orValue)
                {
                    attributeSb.Append($"{attributeData[i].name}:<color=yellow>{nowValue.ToString()}</color>  ");
                }
                else
                {
                    attributeSb.Append($"{attributeData[i].name}:{nowValue.ToString()}  ");
                }
            }

            attributeSb.Append($"{attributeData[5].name}:{role.attributes[7].ToString()}/{role.attributes[5].ToString()} {attributeData[6].name}:{role.attributes[8].ToString()}/{role.attributes[6].ToString()}");
        }


        string cooperName   = DataClass.ConfigCooperationManager.Instance().allDatas[role.GetCooperId()].name;
        string proName      = DataClass.ConfigProfessionManager.Instance().allDatas[role.GetProId()].name;
        string equipContent = $"{role.GetEquip(0)?.desc}\n{role.GetEquip(1)?.desc}";

        string content = $"<size=50><color={ConstConfig.levelColor[role.cost]}>{role.name}</color></size>\n<color={ConstConfig.typeColor}>等级:{level.ToString()}【{cooperName}】 【{proName}】</color>\n\n{attributeSb.ToString()} {role.ShowMissCirtInfo()}\n<color={ConstConfig.skillColor}>{role.skill?.GetDesc()}</color>\n{equipContent}";

        ShowInfo(content);
    }
예제 #3
0
    //战斗队列角色增加了,让这个角色获得羁绊
    void OnAddFight(RoleBase role)
    {
        if (role == null)
        {
            return;
        }
        else
        {
            Cooperation etl1 = GetPlayerCooper(role.GetCooperId());
            Profession  etl2 = GetPlayerPro(role.GetProId());

            etl1.AddUpdate(playerModel.fightRoles, role);
            etl2.AddUpdate(playerModel.fightRoles, role);

            EventManager.ExecuteEvent(EventType.EtlDataUpdate);
        }
    }
예제 #4
0
    //更新羁绊数值,当前的羁绊有校数值
    public override void UpdateCooperCount(RoleBase[] fightRoles)
    {
        etlCount = 0;
        List <int> roleIdList = new List <int>();

        for (int i = 0; i < fightRoles.Length; i++)
        {
            RoleBase role = fightRoles[i];
            if (role != null)
            {
                int cooperId = role.GetCooperId();
                int roleId   = role.GetRoleId();
                if (!roleIdList.Contains(roleId) && cooperId == id)
                {
                    roleIdList.Add(roleId);
                }
            }
        }
        etlCount = roleIdList.Count;
    }