/// <summary> 获取家臣任务奖励字符串 </summary> public string GetRewardString(BaseAppraise baseinfo, RoleItem role) { if (CheckRewardCondition(baseinfo.rewardCCondition, role)) { return(baseinfo.rewardC); } return(CheckRewardCondition(baseinfo.rewardBCondition, role) ? baseinfo.rewardB : baseinfo.rewardA); }
/// <summary> 任务实体更新</summary> private void GetTaskChange(tg_task task, tg_role role, BaseAppraise baseinfo) { var roleitem = view_role.GetFindRoleById(role.id); task.rid = role.id; task.task_starttime = (DateTime.Now.Ticks - 621355968000000000) / 10000; task.task_state = (int)TaskStateType.TYPE_UNFINISHED; var temp = baseinfo.expression; temp = temp.Replace("tea", roleitem.LifeSkill.sub_tea_level.ToString("0.00")); temp = temp.Replace("medical", roleitem.LifeSkill.sub_medical_level.ToString("0.00")); temp = temp.Replace("ninjitsu", roleitem.LifeSkill.sub_ninjitsu_level.ToString("0.00")); temp = temp.Replace("calculate", roleitem.LifeSkill.sub_calculate_level.ToString("0.00")); temp = temp.Replace("eloquence", roleitem.LifeSkill.sub_eloquence_level.ToString("0.00")); temp = temp.Replace("martial", roleitem.LifeSkill.sub_martial_level.ToString("0.00")); temp = temp.Replace("craft", roleitem.LifeSkill.sub_craft_level.ToString("0.00")); temp = temp.Replace("etiquette", roleitem.LifeSkill.sub_etiquette_level.ToString("0.00")); temp = temp.Replace("reclaimed", roleitem.LifeSkill.sub_reclaimed_level.ToString("0.00")); temp = temp.Replace("build", roleitem.LifeSkill.sub_build_level.ToString("0.00")); temp = temp.Replace("mine", roleitem.LifeSkill.sub_mine_level.ToString("0.00")); temp = temp.Replace("tactical", roleitem.LifeSkill.sub_tactical_level.ToString("0.00")); temp = temp.Replace("ashigaru", roleitem.LifeSkill.sub_ashigaru_level.ToString("0.00")); temp = temp.Replace("equestrian", roleitem.LifeSkill.sub_equestrian_level.ToString("0.00")); temp = temp.Replace("archer", roleitem.LifeSkill.sub_archer_level.ToString("0.00")); temp = temp.Replace("artillery", roleitem.LifeSkill.sub_artillery_level.ToString("0.00")); temp = temp.Replace("captain", tg_role.GetSingleTotal(RoleAttributeType.ROLE_CAPTAIN, role).ToString("0.00")); temp = temp.Replace("force", tg_role.GetSingleTotal(RoleAttributeType.ROLE_FORCE, role).ToString("0.00")); temp = temp.Replace("brains", tg_role.GetSingleTotal(RoleAttributeType.ROLE_BRAINS, role).ToString("0.00")); temp = temp.Replace("charm", tg_role.GetSingleTotal(RoleAttributeType.ROLE_CHARM, role).ToString("0.00")); temp = temp.Replace("govern", tg_role.GetSingleTotal(RoleAttributeType.ROLE_GOVERN, role).ToString("0.00")); var express = CommonHelper.EvalExpress(temp); var reducetime = Convert.ToInt32(express); var times = (baseinfo.time - reducetime) * 1000; task.task_endtime = task.task_starttime + times; task.Update(); Common.GetInstance().NewTaskStart(times, task); }