[OSP] Gold and Iron Mines
Это OSP добавит в игру «старые добрые» золотые и железные месторождения и конечно же веселую копку в шахтах. Ваши крестьяне будут довольны.
Месторождения золота и руды были случайным образом распределены между деревнями. 15% шанс на железо и 5% шанс на золото.
Золотая шахта увеличивает деревенское благосостояние на 4% каждый месяц. Доход 100-1000 динаров в неделю.
Железный рудник увеличивает благосостояние деревни на 1% каждый месяц и позволяет покупать железо в деревне.
1. Нам нужно добавить несколько констант. (Module_constants.py)
Номера слотов - любые неиспользуемые.
slot_village_has_goldmine = 555 # Или выберите другой неиспользуемый слот
slot_village_give_goldcoin = 556 # Или выберите другой неиспользуемый слот
slot_village_has_iron_ore = 557 # Или выберите другой неиспользуемый слот
Следующие константы должны быть вставлены между строками slot_center_has_manor и slot_center_has_messenger_post. Вам нужно будет изменить порядок номеров слотов. В нативе можно поменять вот так:
slot_center_has_manor = 128 #village
#[OSP] Gold and Iron Mines (need more gold)# [OSP] Gold and Iron Mines (need more gold)
slot_center_has_iron_mine = 129 #village
slot_center_has_gold_mine = 130 #village
#[OSP] Gold and Iron Mines (need more gold)# [OSP] Gold and Iron Mines (need more gold)
Или полностью перенумеровать слоты улучшения деревни, как здесь:
Код:
slot_center_has_manor = 454 #village
slot_center_has_fish_pond = 455 #village
slot_center_has_watch_tower = 456 #village
slot_center_has_school = 457 #village
slot_center_has_iron_mine = 458 #village
slot_center_has_gold_mine = 459 #village
slot_center_has_messenger_post = 460 #town, castle, village
slot_center_has_prisoner_tower = 461 #town, castle
slot_center_has_blacksmith = 462 #town, castle
village_improvements_begin = slot_center_has_manor
village_improvements_end = slot_center_has_prisoner_tower
walled_center_improvements_begin = slot_center_has_messenger_post
walled_center_improvements_end = slot_center_has_blacksmith
2. В module_game_menus.py найдите «center_build_manor» в меню «center_manage» и добавьте:
Код:
("center_build_manor",
[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_manor, 0),
],
"Build a manor.",[(assign, "$g_improvement_type", slot_center_has_manor),
(jump_to_menu, "mnu_center_improve"),]),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
("center_build_iron_mine",[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_iron_mine, 0),
(party_slot_eq, "$g_encountered_party", slot_village_has_iron_ore, 1),
],
"Build an iron mine.",[(assign, "$g_improvement_type", slot_center_has_iron_mine),
(jump_to_menu, "mnu_center_improve"),]),
("center_build_gold_mine",[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_gold_mine, 0),
(party_slot_eq, "$g_encountered_party", slot_village_has_goldmine, 1),
],
"Build a gold mine.",[(assign, "$g_improvement_type", slot_center_has_gold_mine),
(jump_to_menu, "mnu_center_improve"),]),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
("center_build_fish_pond",
[(eq, reg6, 0),
(party_slot_eq, "$g_encountered_party", slot_party_type, spt_village),
(party_slot_eq, "$g_encountered_party", slot_center_has_fish_pond, 0),
],
"Build a mill.",[(assign, "$g_improvement_type", slot_center_has_fish_pond),
(jump_to_menu, "mnu_center_improve"),]),
3. Для дипломатии добавьте это в module_dialogs.py ниже [(assign, "$g_improvement_type", slot_center_has_manor),]],
Код:
[anyone|plyr, "dplmc_chamberlain_manage_fiefs_build_ask2",
[
(party_slot_eq, "$diplomacy_var", slot_party_type, spt_village),
(party_slot_eq, "$diplomacy_var", slot_center_has_manor, 0),
],
"Build a manor.", "dplmc_chamberlain_manage_fiefs_build_confirm_ask",
[(assign, "$g_improvement_type", slot_center_has_manor),]
],
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
[anyone|plyr, "dplmc_chamberlain_manage_fiefs_build_ask2",
[
(party_slot_eq, "$diplomacy_var", slot_party_type, spt_village),
(party_slot_eq, "$diplomacy_var", slot_center_has_iron_mine, 0),
(party_slot_eq, "$diplomacy_var", slot_village_has_iron_ore,1),
],
"Build an iron mine.", "dplmc_chamberlain_manage_fiefs_build_confirm_ask",
[(assign, "$g_improvement_type", slot_center_has_iron_mine),]
],
[anyone|plyr, "dplmc_chamberlain_manage_fiefs_build_ask2",
[
(party_slot_eq, "$diplomacy_var", slot_party_type, spt_village),
(party_slot_eq, "$diplomacy_var", slot_center_has_gold_mine, 0),
(party_slot_eq, "$diplomacy_var", slot_village_has_goldmine,1),
],
"Build a gold mine.", "dplmc_chamberlain_manage_fiefs_build_confirm_ask",
[(assign, "$g_improvement_type", slot_center_has_gold_mine),]
],
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
[anyone|plyr, "dplmc_chamberlain_manage_fiefs_build_ask2",
[
(party_slot_eq, "$diplomacy_var", slot_party_type, spt_village),
(party_slot_eq, "$diplomacy_var", slot_center_has_fish_pond, 0),
],
"Build a mill.", "dplmc_chamberlain_manage_fiefs_build_confirm_ask",
[(assign, "$g_improvement_type", slot_center_has_fish_pond),]
],
4. Изменения в module_scripts.py
4.1. Случайно добавлять депозиты в Кальрадии.
15% шанс на железо и 5% шанс на золото
В скрипте "game_start" добавьте перед последним "]),"
Код:
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(try_for_range,":cur_village",villages_begin,villages_end),
(store_random_in_range, ":ir_mine",1,20),
(try_begin),
(is_between,":ir_mine",1,3), #15% chance of iron
(party_set_slot, ":cur_village", slot_village_has_iron_ore,1),
(else_try),
(eq,":ir_mine",5),# 5% chance of gold
(party_set_slot, ":cur_village", slot_village_has_goldmine,1),
(try_end),
(try_end),
(party_set_slot, "p_village_57", slot_village_has_iron_ore,1), # test
(party_set_slot, "p_village_7", slot_village_has_goldmine,1), # test
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
]),
#script_game_get_use_string
# This script is called from the game engine for getting using information text
4,2
в скрипте "get_improvement_details"
Код:
(try_begin),
(eq, ":improvement_no", slot_center_has_manor),
(str_store_string, s0, "@Manor"),
(str_store_string, s1, "@A manor lets you rest at the village and pay your troops half wages while you rest."),
(assign, reg0, 12000),#12000
(else_try),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(eq, ":improvement_no", slot_center_has_gold_mine),
(str_store_string, s0, "@Gold mine"),
(str_store_string, s1, "@A gold mine increases village prosperity by 4% every month. Income 100-1000 denars per week."),
(assign, reg0, 5500),#5500
(else_try),
(eq, ":improvement_no", slot_center_has_iron_mine),
(str_store_string, s0, "@Iron mine"),
(str_store_string, s1, "@An iron mine increases village prosperity by 1% every month and allows iron to be purchased from the village."),
(assign, reg0, 4500),
(else_try),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(eq, ":improvement_no", slot_center_has_fish_pond),
(str_store_string, s0, "@Mill"),
(str_store_string, s1, "@A mill increases village prosperity once by 5%. "),
(assign, reg0, 6000),#6000
(else_try),
4,3. Добавьте железные слитки в сельские магазины. Найдите скрипт «refresh_village_merchant_inventory» и добавьте перед последним "]),"
Код:
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(try_begin),
(party_slot_eq, ":village_no", slot_center_has_iron_mine, 1),
(store_random_in_range,":rand",1,5),
(try_for_range, ":unused", 0, ":rand"),
(troop_add_item,":merchant_troop",itm_iron,0), # add 1-5 iron bars
(try_end),
(try_end),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
]),
# script_refresh_village_defenders
5. module_simple_triggers.py
Добавить в конец файла.
5.1.Изменить благополучие деревень.
Код:
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
## Monthly change prosperity of villages
(30 * 24,
[(try_for_range, ":center_no", villages_begin, villages_end),
(try_begin),
(party_slot_eq, ":center_no", slot_center_has_iron_mine, 1),
(call_script, "script_change_center_prosperity", ":center_no", 1),
(try_end),
(try_begin),
(party_slot_eq, ":center_no", slot_center_has_gold_mine, 1),
(call_script, "script_change_center_prosperity", ":center_no", 4),
(try_end),
(try_end),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
5.2. Доход от золотодобычи
Код:
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
### weekly rent from goldmine
(24 * 7,
[(try_for_range, ":center_no", villages_begin, villages_end),
(party_slot_ge, ":center_no", slot_town_lord, 0), #unassigned centers do not accumulate rents
(party_slot_eq, ":center_no", slot_village_state, svs_normal),
(party_slot_eq, ":center_no", slot_center_has_gold_mine, 1),
(store_random_in_range, ":goldmine_rent",100,1000),
(party_set_slot, ":center_no", slot_village_give_goldcoin, ":goldmine_rent"),
(try_end),
]),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
6. module_presentations.py.
Это добавит блестящие золотые круги из золотого рудника в еженедельный бюджетный отчет и казначейство игрока.
Откройте module_presentations.py >> "budget_report" и найдите #Enterprise ends, taxes begin , затем добавьте
Код:
#Enterprise ends, taxes begin
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(party_get_slot, ":accumulated_rents", ":center_no", slot_center_accumulated_rents),
(party_get_slot, ":accumulated_tariffs", ":center_no", slot_center_accumulated_tariffs),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(try_begin),
(party_slot_eq, ":center_no", slot_center_has_gold_mine, 1),
(party_get_slot, ":goldm_rent", ":center_no", slot_village_give_goldcoin),
(val_add, ":accumulated_tariffs", ":goldm_rent"),
(try_end),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(store_add, ":accumulated_total", ":accumulated_rents", ":accumulated_tariffs"),
(val_add, ":all_centers_accumulated_total", ":accumulated_total"),
(val_add, ":all_centers_accumulated_taxes_and_rents", ":accumulated_total"),
(val_add, ":net_change", ":accumulated_total"),
(str_store_party_name, s0, ":center_no"),
##diplomacy begin
(try_begin),
(neg|is_between, ":center_no", castles_begin, castles_end),
(party_get_slot, ":tax_rate", ":center_no", dplmc_slot_center_taxation),
(neq, ":tax_rate", 0),
(call_script, "script_dplmc_describe_tax_rate_to_s50", ":tax_rate"),
(str_store_string, s0, "@{s0} ({s50})"),
(try_end),
##diplomacy end
(create_text_overlay, reg1, "str_rents_from_s0", 0),
##diplomacy begin
(str_store_party_name, s0, ":center_no"),
##diplomacy end
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(try_begin),
(gt, ":accumulated_rents", 0),
(assign, reg0, ":accumulated_rents"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0x00AA00),
(else_try),
(create_text_overlay, reg1, "@None", tf_right_align|tf_single_line),
(try_end),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(try_begin),
(is_between, ":center_no", villages_begin, villages_end),
(party_slot_eq, ":center_no", slot_center_has_gold_mine, 1),
(party_slot_eq, ":center_no", slot_town_lord, "trp_player"),
(str_store_party_name, s0, ":center_no"),
(create_text_overlay, reg1, "@Rents from gold mine in {s0}: ", 0),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 25),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(party_get_slot, ":goldm_rent", ":center_no", slot_village_give_goldcoin),
(try_begin),
(gt, ":goldm_rent", 0),
(assign, reg0, ":goldm_rent"),
(create_text_overlay, reg1, "@{!}{reg0}", tf_right_align|tf_single_line),
(overlay_set_color, reg1, 0x00AA00),
(else_try),
(create_text_overlay, reg1, "@None", tf_right_align|tf_single_line),
(try_end),
(position_set_x, pos1, 900),
(position_set_y, pos1, 900),
(overlay_set_size, reg1, pos1),
(position_set_x, pos1, 500),
(position_set_y, pos1, ":cur_y"),
(overlay_set_position, reg1, pos1),
(val_sub, ":cur_y", 27),
(try_end),
### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ### [OSP] Gold and Iron Mines (need more gold) ###
(try_begin),
(is_between, ":center_no", towns_begin, towns_end),
(create_text_overlay, reg1, "str_tariffs_from_s0", 0),
Родная страница
Комментариев 2
Посетители, находящиеся в группе Гости, не могут оставлять комментарии к данной публикации.