- 好友
- 0
- 在线时间
- 0 小时
- 最后登录
- 2022-5-25
平民
- UID
- 3357481
- 第纳尔
- 23
- 精华
- 0
- 互助
- 1
- 荣誉
- 0
- 贡献
- 0
- 魅力
- 0
- 注册时间
- 2022-5-9
鲜花( 0) 鸡蛋( 0)
|
发表于 2022-5-9 19:52:09
|
显示全部楼层
- # fill_village_bound_centers
- #pass 1: Give one village to each castle
- (try_for_range, ":cur_center", castles_begin, castles_end),
- (assign, ":min_dist", 999999),
- (assign, ":min_dist_village", -1),
- (try_for_range, ":cur_village", villages_begin, villages_end),
- (neg|party_slot_ge, ":cur_village", slot_village_bound_center, 1), #skip villages which are already bound.
- (store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_center"),
- (lt, ":cur_dist", ":min_dist"),
- (assign, ":min_dist", ":cur_dist"),
- (assign, ":min_dist_village", ":cur_village"),
- (try_end),
- (party_set_slot, ":min_dist_village", slot_village_bound_center, ":cur_center"),
- (store_faction_of_party, ":town_faction", ":cur_center"),
- (call_script, "script_give_center_to_faction_aux", ":min_dist_village", ":town_faction"),
- (try_end),
-
- #pass 2: Give other villages to closest town.
- (try_for_range, ":cur_village", villages_begin, villages_end),
- (neg|party_slot_ge, ":cur_village", slot_village_bound_center, 1), #skip villages which are already bound.
- (assign, ":min_dist", 999999),
- (assign, ":min_dist_town", -1),
- (try_for_range, ":cur_town", towns_begin, towns_end),
- (store_distance_to_party_from_party, ":cur_dist", ":cur_village", ":cur_town"),
- (lt, ":cur_dist", ":min_dist"),
- (assign, ":min_dist", ":cur_dist"),
- (assign, ":min_dist_town", ":cur_town"),
- (try_end),
- (party_set_slot, ":cur_village", slot_village_bound_center, ":min_dist_town"),
- (store_faction_of_party, ":town_faction", ":min_dist_town"),
- (call_script, "script_give_center_to_faction_aux", ":cur_village", ":town_faction"),
- (try_end),
复制代码 这是相关源码 |
|