public SkillGongfaStaticData(int lv, GongfaType gongfa_typ, int color, int create_id) : base(lv, gongfa_typ, color, create_id) { // 主属性 GongfaAttrData main_attr_data = GongfaAttrConfig.GetRandomExAttr(gongfa_typ | GongfaType.main); cool = main_attr_data.cool; cost = main_attr_data.cost; }
public GongfaStaticData(int lv, GongfaType gongfa_typ, int color, int create_id) { id = create_id; level = lv; this.color = color; price = 20 * (lv + 1) * (color + 1); type = gongfa_typ; // 主属性 GongfaAttrData[] main_attr_data = GongfaAttrConfig.GetMainAttr(gongfa_typ | GongfaType.main); int attr_count = main_attr_data.Length; attr_id = new int[attr_count]; attr_value = new int[attr_count][]; for (int i = 0; i < attr_count; i++) { attr_id[i] = main_attr_data[i].id; attr_value[i] = main_attr_data[i].GetRandomAttr(lv, color); } string name = ""; // 随机功法词条 int ex_count = lv + color; ex_id = new int[ex_count]; ex_values = new int[ex_count][]; ex_color = new int[ex_count]; for (int i = 0; i < ex_count; i++) { ex_color[i] = UnityEngine.Random.Range(0, GameConst.max_color + 1); GongfaAttrData congfa_attr_data = GongfaAttrConfig.GetRandomExAttr(gongfa_typ); ex_id[i] = congfa_attr_data.id; ex_values[i] = congfa_attr_data.GetRandomAttr(lv, color); if (i < 2) { name += congfa_attr_data.name; } } this.name = name + main_attr_data[0].name; difficult = lv * lv + color; SetGongfaCondition(); }