def rank_reward_list(content): rank = int(get_value(content[BaseField3.rank], 0)) coin_amount = int(get_value(content[BaseField3.coin_amount], 0)) gold_amount = int(get_value(content[BaseField3.gold_amount], 0)) item_list = str(get_value(content[BaseField3.item_list], '')) world_boss_rank_reward.append("get_rank_reward(%d) -> [{coin, %d}, {gold, %d}] ++ [%s];"%(rank, coin_amount, gold_amount, item_list)) return []
def get_hero_name(content): hero_id = int(get_value(content[BaseField1.hero_id], 0)) hero_name = '<<"' + str(get_value(content[BaseField1.hero_name], '')) + '">>' mail_hero_name.append("""get_hero_name({0}) -> {1};""".format( hero_id, hero_name)) return []
def get_base(content): adjunct_id = int(content[BaseField.adjunctID]) pos = int(content[BaseField.pos]) quality = int(get_value(content[BaseField.quality], 0)) hero_id = int(content[BaseField.hero_id]) attr_list = get_str(content[BaseField.attr], '') add_list = get_str(content[BaseField.add_list], '') next_id = int(get_value(content[BaseField.next_id], 0)) item = get_str(content[BaseField.up_item], '') coin = int(get_value(content[BaseField.up_coin], 0)) full_add_list.append("full_add_list(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> [%s];"%(hero_id, adjunct_id, add_list)) is_adjunct_fit_hero_list.append("is_adjunct_fit_hero(AdjunctID, HeroID) when AdjunctID =:= %d, HeroID =:= %d -> true;"%(adjunct_id, hero_id)) get_pos_list.append("get_pos(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> %d;"%(hero_id, adjunct_id, pos)) get_next_adjunct_id_list.append("get_next_adjunct_id(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> %d;"%(hero_id, adjunct_id, next_id)) if next_id != 0: get_pre_adjunct_id_list.append("get_pre_adjunct_id(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> %d;"%(hero_id, next_id, adjunct_id)) up_cost_list.append("up_cost(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> [{del_items, [%s]}, {del_coin, %d}];"%(hero_id, adjunct_id, item, coin)) if next_id == 0: is_max_adjunct_id_list.append("is_max_adjunct_id(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> true;"%(hero_id, adjunct_id)) get_base_attr_list.append("get_base_attr(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> [%s];"%(hero_id, adjunct_id, attr_list)) need_hero_quality_list.append("need_hero_quality(HeroID, AdjunctID) when HeroID =:= %d, AdjunctID =:= %d -> %d;"%(hero_id, adjunct_id, quality)) return []
def get_cost_gold_by_times(content): nth = int(get_value(content[BaseField6.nth], 0)) cost_gold = int(get_value(content[BaseField6.gold], 0)) global max_times max_times = nth buy_times_cost_gold_list.append("""get_cost_gold_by_times({0}) -> {1};""".format(nth, cost_gold)) return []
def get_gold_cost(content): extract_type = int(get_value(content[BaseField4.extract_type], 0)) extract_type_1 = int(get_value(content[BaseField4.extract_type_1], 0)) gold_cost = int(get_value(content[BaseField4.gold_cost], 0)) cost_gold_list.append("""get_gold_cost({0}, {1}) -> {2};""".format( extract_type, extract_type_1, gold_cost)) return []
def get_attr_factor(content): hero_id = int(content[SubItemField.heroID]) factor_1 = int(get_value(content[SubItemField.factor_1], 0)) factor_2 = int(get_value(content[SubItemField.factor_2], 0)) factor_3 = int(get_value(content[SubItemField.factor_3], 0)) factor_4 = int(get_value(content[SubItemField.factor_4], 0)) get_factor_list.append("get_factor(%d, 1) -> %d/10000;" % (hero_id, factor_1)) get_factor_list.append("get_factor(%d, 2) -> %d/10000;" % (hero_id, factor_2)) get_factor_list.append("get_factor(%d, 3) -> %d/10000;" % (hero_id, factor_3)) get_factor_list.append("get_factor(%d, 4) -> %d/10000;" % (hero_id, factor_4)) if factor_1 != 0: is_valid_subitem_list.append("is_valid_subitem(%d, 1) -> true;" % (hero_id)) if factor_2 != 0: is_valid_subitem_list.append("is_valid_subitem(%d, 2) -> true;" % (hero_id)) if factor_3 != 0: is_valid_subitem_list.append("is_valid_subitem(%d, 3) -> true;" % (hero_id)) if factor_4 != 0: is_valid_subitem_list.append("is_valid_subitem(%d, 4) -> true;" % (hero_id)) return []
def get_act(content): act_id = int(content[BaseField.actID]) act_type = int(content[BaseField.actType]) need_lv = int(get_value(content[BaseField.needLev], 0)) coin = int(get_value(content[BaseField.coin], 0)) item = str(get_value(content[BaseField.item], '')) exp = int(get_value(content[BaseField.exp], 0)) live = int(get_value(content[BaseField.live], 0)) gold = int(get_value(content[BaseField.gold], 0)) need_count = int(get_value(content[BaseField.needCount], 0)) energy = int(get_value(content[BaseField.oil], 0)) begin_time = int(get_value(content[BaseField.Stime], 0)) end_time = int(get_value(content[BaseField.Etime], 0)) act_base.append("""get({0}) -> #act_base{{ act_id = {0} ,act_type = {1} ,need_lv = {2} ,reward = [{{add_coin, {3}}}, {{add_items, [{4}]}}, {{add_exp, {5}}}, {{add_gold, {6}}}, {{add_energy, {9}}}, {{add_live, {7}}}] ,need_count = {8} ,begin_time = {10} ,end_time = {11} }};""".format(act_id, act_type, need_lv, coin, item, exp, gold, live, need_count, energy, begin_time, end_time)) act_id_list.append("%d" % (act_id)) return []
def get_tip(content): tip_id = int(content[BaseField.tip_id]) min_role_lev = int(get_value(content[BaseField.min_role_lev], 0)) item_reward = str(get_value(content[BaseField.item_reward], '')) coin_reward = int(get_value(content[BaseField.coin_reward], 0)) gold_reward = int(get_value(content[BaseField.gold_reward], 0)) exp_reward = int(get_value(content[BaseField.exp_reward], 0)) target = str(content[BaseField.tip_content]) order = int(get_value(content[BaseField.order], 0)) classify_id = int(get_value(content[BaseField.classify_id], 0)) crystal = int(get_value(content[BaseField.crystal], 0)) iron = int(get_value(content[BaseField.iron], 0)) uranium = int(get_value(content[BaseField.uranium], 0)) if tip_id == 76508: print uranium tip_base.append("""get({0}) -> #tip_base{{ tip_id = {0} ,min_role_lev = {1} ,reward = [{{add_items, [{2}]}}, {{add_coin, {3}}}, {{add_gold, {4}}}, {{add_exp, {6}}}, {{add_crystal, {9}}}, {{add_iron, {10}}}, {{add_uranium, {11}}}] ,target = [{5}] ,order = {7} ,classify_id = {8} }};""".format(tip_id, min_role_lev, item_reward, coin_reward, gold_reward, target, exp_reward, order, classify_id, crystal, iron, uranium)) tip_id_list.append("%d" % (tip_id)) return []
def get_base(content, all_content, row): type = int(prev(all_content, row, BaseField.type)) item_id = int(content[BaseField.itemID]) weight = int(content[BaseField.weight]) min_num = int(content[BaseField.minNum]) max_num = int(content[BaseField.maxNum]) need_count = int(get_value(content[BaseField.needCount], 0)) can_list = get_str(content[BaseField.canList], '') must_list = get_str(content[BaseField.mustList], '') role_lev = int(get_value(content[BaseField.level], 0)) for sub in can_list.split(","): if sub.strip() != '': key = "%d, %s" % (type, sub.strip()) can_take_dict.setdefault(key, []) can_take_dict[key].append( "{%d, util:rand(%d, %d), %d, %d}" % (item_id, min_num, max_num, weight, role_lev)) for sub in must_list.split(","): if sub.strip() != '': key = "%d, %s" % (type, sub.strip()) must_take_dict.setdefault(key, []) must_take_dict[key].append( "{%d, util:rand(%d, %d), %d, %d}" % (item_id, min_num, max_num, weight, role_lev)) can_take_list.append( "can_take(ChestType, ItemID, AccCount) when ChestType =:= %d, ItemID =:= %d, AccCount >= %d -> true;" % (type, item_id, need_count)) return []
def get_conf(content): sys_id = int(content[0]) lev = int(get_value(content[1], 0)) gold = int(get_value(content[4], 0)) if int(get_value(content[6], 0)) == 0: is_open = "true" else: is_open = "false" dungeon_id = int(get_value(content[7], 0)) if dungeon_id != 0: dungeon_id = dungeon_id + 10000 sys_open_list.append(""" get(%d) -> #system_open{ id = %d, lev = %d, dungeon_id = %d, gold = %d, is_open = %s }; """ % (sys_id, sys_id, lev, dungeon_id, gold, is_open)) if lev != 1 and is_open == "true": sys_id_list_by_lev.setdefault(lev, []) sys_id_list_by_lev[lev].append("%d" % (sys_id)) if dungeon_id != 0 and is_open == "true": sys_id_list_by_dungeon_id.setdefault(dungeon_id, []) sys_id_list_by_dungeon_id[dungeon_id].append("%d" % (sys_id)) return []
def get_cost(content): item_id = int(content[CostField.itemId]) build_lev = int(content[CostField.level]) cost_time = int(content[CostField.time]) crystal = int(get_value(content[CostField.crystal], 0)) iron = int(get_value(content[CostField.iron], 0)) uranium = int(get_value(content[CostField.uranium], 0)) gold_time = int(content[CostField.goldTime]) add_paper_cost_list.append( "add_paper_cost(ItemID) when ItemID =:= %d -> [{del_crystal, %d}, {del_iron, %d}, {del_uranium, %d}];" % (item_id, crystal, iron, uranium)) del_paper_gain_list.append( "del_paper_gain(ItemID) when ItemID =:= %d -> [{add_crystal, %d}, {add_iron, %d}, {add_uranium, %d}];" % (item_id, crystal, iron, uranium)) all_paper_list.append("%d" % (item_id)) need_build_lev_list.append( "need_build_lev(ItemID) when ItemID =:= %d -> %d;" % (item_id, build_lev)) need_time_list.append("need_time(ItemID) when ItemID =:= %d -> %d;" % (item_id, cost_time)) one_gold_clean_time_list.append( "one_gold_clean_time(ItemID) when ItemID =:= %d -> %d;" % (item_id, gold_time)) return []
def get_chubing(content): id = int(content[ChuBingField.id]) scene_id = int(content[ChuBingField.scene_id]) populace = int(content[ChuBingField.populace]) init_mate = get_str(content[ChuBingField.initMate], '') init_monster_list = get_str(content[ChuBingField.initMonster], '') pos_rf_monster_list = get_str(content[ChuBingField.posRefreshMonster], '') rf_monster_list = get_str(content[ChuBingField.refreshMonster], '') is_rf_loop = int(get_value(content[ChuBingField.loop], 0)) base_1 = get_str(content[ChuBingField.base_1], '0, 0, 0') base_2 = get_str(content[ChuBingField.base_2], '0, 0, 0') rf_mate_monster_list = get_str(content[ChuBingField.refreshMateMonster], '') is_rf_mate_loop = int(get_value(content[ChuBingField.mateLoop], 0)) init_mate_list = get_str(content[ChuBingField.initMate], '') round_rf_monster_list = get_str(content[ChuBingField.roundRefreshMonster], '') protect_monster_list = get_str(content[ChuBingField.protectMonster], '') chubing_array.setdefault(id, {}) chubing_array[id]['scene_id'] = scene_id chubing_array[id]['populace'] = populace chubing_array[id]['init_mate'] = init_mate chubing_array[id]['init_monster_list'] = init_monster_list chubing_array[id]['pos_rf_monster_list'] = pos_rf_monster_list chubing_array[id]['rf_monster_list'] = rf_monster_list chubing_array[id]['is_rf_loop'] = is_rf_loop chubing_array[id]['base_1'] = base_1 chubing_array[id]['base_2'] = base_2 chubing_array[id]['rf_mate_monster_list'] = rf_mate_monster_list chubing_array[id]['is_rf_mate_loop'] = is_rf_mate_loop chubing_array[id]['init_mate_list'] = init_mate_list chubing_array[id]['round_rf_monster_list'] = round_rf_monster_list chubing_array[id]['protect_monster_list'] = protect_monster_list return []
def get_gain(content): vip_lev = int(content[0]) items = str(content[1]) coin = int(get_value(content[2], 0)) gold = int(get_value(content[3], 0)) gain_list.append("gain_list(VIP) when VIP =:= %d -> [{add_items, [%s]}, {add_coin, %d}, {add_gold, %d}];"%(vip_lev, items, coin, gold)) return []
def get_content(content): hero_id = int(get_value(content[BaseField1.hero_id], 0)) content_named = '<<"' + str( get_value(content[BaseField1.content_named], '')) + '">>' content = '<<"' + str(get_value(content[BaseField1.content], '')) + '">>' hero_mail_content.append("""get_content({0}) -> {{{1}, {2}}};""".format( hero_id, content_named, content)) return []
def get_extract_type_list(content): extract_type = int(get_value(content[BaseField.extract_type], 0)) award_type = int(get_value(content[BaseField.award_type], 0)) if (extract_type not in extract_type_list): extract_type_list.append(extract_type) if (award_type not in award_type_list): award_type_list.append(award_type) return []
def get_union_reward_by_rank(content): max_rank = int(get_value(content[BaseField8.evaluate_top], 0)) min_rank = int(get_value(content[BaseField8.evaluate_low], 0)) coin = int(get_value(content[BaseField8.coin_amount], 0)) gold = int(get_value(content[BaseField8.gold_amount], 0)) item_list = str(get_value(content[BaseField8.item_list], '')) world_boss_union_rank.append("get_union_rank_reward_by_hurt(Rank) when Rank >= %d andalso Rank =< %d -> [{coin, %d}, {gold, %d}] ++ [%s];"%(max_rank, min_rank, coin, gold, item_list)) return []
def get_invite_count_reward(content): id = int(get_value(content[BaseField1.id], 0)) count = int(get_value(content[BaseField1.count], 0)) reward = int(get_value(content[BaseField1.reward], 0)) invite_reward_list.append( """get_invite_count_reward({0}) -> {1};""".format(id, reward)) invite_count_list.append("""get_invite_count({0}) -> {1};""".format( id, count)) return []
def get_base(content): dungeon_id = int(content[BaseField.dungeonID]) items = get_str(content[BaseField.items], '') gold = int(get_value(content[BaseField.gold], 0)) coin = int(get_value(content[BaseField.coin], 0)) first_pass_gain_list.append( "first_pass_gain(%d) -> [{add_items, [%s]}, {add_gold, %d}, {add_coin, %d}];" % (dungeon_id, items, gold, coin)) return []
def get_hero_quality_open(content): precious_id = int(get_value(content[BaseField1.id], 0)) hero_id = int(get_value(content[BaseField1.hero_id], 0)) hero_quality = int(get_value(content[BaseField1.hero_quality], 0)) is_open = int(get_value(content[BaseField1.is_open], 0)) precious_hero_quality_open.append( """get_hero_quality_open({0}, {1}) -> {{{2}, {3}}};""".format( precious_id, hero_id, hero_quality, is_open)) return []
def get_max_times(content): extract_type = int(get_value(content[BaseField1.extract_type], 0)) award_type = int(get_value(content[BaseField1.award_type], 0)) # min_count = int(get_value(content[BaseField1.min_count], 0)) max_count = int(get_value(content[BaseField1.max_count], 0)) if (extract_type != 0) and (award_type != 0): chest_base.append("""get_max_times({0}, {1}) -> {2}; """.format( extract_type, award_type, max_count)) return []
def load_upgrade_to_list(content): temp = [] lev = int(get_value(content[BaseField2.lev], 0)) exp = int(get_value(content[BaseField2.exp], 0)) temp.append(lev) temp.append(exp) precious_upgrade_data_list.append(temp) lev_data_list.append(lev) return []
def get_rank(content): min_rank = int(content[RankField.minRank]) max_rank = int(content[RankField.maxRank]) gold = int(get_value(content[RankField.gold], 0)) coin = int(get_value(content[RankField.coin], 0)) prestige = int(get_value(content[RankField.prestige], 0)) item = get_str(content[RankField.item], '') rank_reward_list.append("get_rank_reward_list(Rank) when Rank >= %d, Rank =< %d -> [{gold, %d}, {coin, %d}, {prestige, %d}] ++ [%s];"%(min_rank, max_rank, gold, coin, prestige, item)) return []
def get_skill_point_amount(content): skill_id = int(get_value(content[BaseField2.skill_id], 0)) lev = int(get_value(content[BaseField2.lev], 0)) skill_point_amount = int( get_value(content[BaseField2.skill_point_amount], 0)) skill_point_amount_list.append( """get_skill_point_amount({0}, {1}) -> {2};""".format( skill_id, lev, skill_point_amount)) return []
def get_energy_amount_by_liveness(content): min_liveness = int(get_value(content[BaseField2.min_liveness], 0)) max_liveness = int(get_value(content[BaseField2.max_liveness], 0)) get_energy_amount = int(get_value(content[BaseField2.get_energy_amount], 0)) get_energy_amount_list.append( """get_energy_amount_by_liveness(Liveness) when Liveness >= {0} andalso Liveness =< {1} -> {2};""" .format(min_liveness, max_liveness, get_energy_amount)) return []
def get_rand_dialog(content): id = int(content[DailogField.dailID]) coin = int(get_value(content[DailogField.coin], 0)) gold = int(get_value(content[DailogField.gold], 0)) items = str(get_value(content[DailogField.items], '')) all_dail_list.append("%d" % (id)) dail_reward.append( "dail_reward(%d) -> [{add_coin, %d}, {add_gold, %d}, {add_items, [%s]}];" % (id, coin, gold, items)) return []
def get_items(content): award_id = int(get_value(content[BaseField.award_id], 0)) item_id = int(get_value(content[BaseField.item_id], 0)) min_count = int(get_value(content[BaseField.min_count], 0)) max_count = int(get_value(content[BaseField.max_count], 0)) rate = int(get_value(content[BaseField.rate], 0)) chest_items_baes.append( """get_items({0}) -> {{{1}, {2}, {3}, {4}}};""".format( award_id, item_id, min_count, max_count, rate)) return []
def get_condition(content): hero_id = int(get_value(content[BaseField1.hero_id], 0)) condition1 = get_value(content[BaseField1.condition], '') try: condition2 = str(int(condition1)) except: condition2 = str(condition1) condition = '[' + condition2 + ']' hero_mail_condition.append("""get_condition({0}) -> {1};""".format( hero_id, condition)) return []
def get_base(content): id = get_str(content[BaseField.id], '') items = get_str(content[BaseField.items], '') gold = int(get_value(content[BaseField.gold], 0)) coin = int(get_value(content[BaseField.coin], 0)) mail_title = get_str(content[BaseField.title], '') mail_content = get_str(content[BaseField.content], '') php_fb_invite_base.append( " '{0}' => array('id' => '{0}', 'items' => '[{1}]', 'gold' => {2}, 'coin'=> {3}, 'mail_title'=> '{4}', 'mail_content' => '{5}')," .format(id, items, gold, coin, mail_title, mail_content)) return []
def load_excel_to_list(content): temp1 = [] award_id = int(get_value(content[BaseField.award_id], 0)) extract_type = int(get_value(content[BaseField.extract_type], 0)) award_type = int(get_value(content[BaseField.award_type], 0)) min_times = int(get_value(content[BaseField.min_times], 0)) temp1.append(award_id) temp1.append(extract_type) temp1.append(award_type) temp1.append(min_times) sheet1_data.append(temp1) return []
def get_lev_attr(content): global max_lev lev = int(content[LevAttrField.lev]) attr_1 = int(get_value(content[LevAttrField.attr_1], 0)) attr_2 = int(get_value(content[LevAttrField.attr_2], 0)) attr_3 = int(get_value(content[LevAttrField.attr_3], 0)) attr_4 = int(get_value(content[LevAttrField.attr_4], 0)) get_attr_value_list.append("get_attr_value(%d, 1) -> %d;" % (lev, attr_1)) get_attr_value_list.append("get_attr_value(%d, 2) -> %d;" % (lev, attr_2)) get_attr_value_list.append("get_attr_value(%d, 3) -> %d;" % (lev, attr_3)) get_attr_value_list.append("get_attr_value(%d, 4) -> %d;" % (lev, attr_4)) return []