
行动
建立贸易
使用我们的一位商人在市场间建立新商品贸易
禁止他国进出口修正类型select trigger 1定义in_game/common/generic_actions/markets.txt:299
300type = owncountry
302potential = {
}
305allow = {
}
308ai_tick = never
310automation_tick = never
311automation_tick_frequency = 12
314select_trigger = {
315looking_for_a = market
316target_flag = from
317name = "create_trade_select_from_market" 选择要转移商品的市场
318none_available_msg_key = "create_trade_first_no_markets"
319column = {
320data = name
}
322visible = {
324OR = {
325owner ?= scope:actor
326scope:actor = {
327capital = {
328market = root
}
}
331scope:actor = {
332not = {
332is_embargoed_by = root.owner
}
}
334root.owner = {
}
}
341trigger_if = {
342limit = {
343exists = scope:to
344scope:actor = {
345is_ai = no
}
}
348not = {
348this = scope:to
}
349scope:actor = {
350can_find_trade_route = {
351from = root
352to = scope:to
}
}
}
}
}
360select_trigger = {
361looking_for_a = market
362target_flag = to
363name = "create_trade_select_to_market" 选择商品要转移到的市场
364none_available_msg_key = "create_trade_second_no_markets"
365column = {
366data = name
}
368visible = {
370OR = {
371owner ?= scope:actor
372scope:actor = {
373capital = {
374market = root
}
}
377scope:actor = {
378not = {
378is_embargoed_by = root.owner
}
}
}
381trigger_if = {
382limit = {
383exists = scope:from
384scope:actor = {
385is_ai = no
}
}
388not = {
388this = scope:from
}
389scope:actor = {
390can_find_trade_route = {
391from = scope:from
392to = root
}
}
}
}
}
400select_trigger = {
401looking_for_a = market
402target_flag = merchant
403cache_targets = yes
404name = "create_trade_select_merchant_market" 选择提供商人的市场
405none_available_msg_key = "create_trade_no_merchant_markets"
406column = {
407data = name
}
409visible = {
410has_merchant = scope:actor
411available_merchant_capacity = {
412country = scope:actor
413value > 0
}
}
}
419select_trigger = {
420looking_for_a = goods
421target_flag = goods
422name = "create_trade_select_goods" 选择要贸易的商品
423none_available_msg_key = "create_trade_no_goods"
424column = {
425data = name
}
427visible = {
428trigger_if = {
429limit = {
430exists = scope:from
}
432scope:from = {
433OR = {
434NOT = {
434is_export_banned = root
}
436AND = {
437exists = scope:to
438owner = scope:to.owner
}
}
441market_possible_goods_trade_surplus = {
442goods = root
443country = scope:actor
444value > 0
}
}
}
448trigger_if = {
449limit = {
450exists = scope:to
}
452scope:to = {
453OR = {
454NOT = {
454is_import_banned = root
}
456AND = {
457exists = scope:from
458owner = scope:from.owner
}
}
}
}
}
464enabled = {
465trigger_if = {
466limit = {
467is_food = yes
468exists = scope:from
}
470scope:from = {
471market_food > 0
}
}
}
}
478select_trigger = {
479looking_for_a = value
480target_flag = capacity
481name = "create_trade_select_desired_capacity" 选择要为该贸易分配多少贸易容量
482min = 0
483max = {
484if = {
485limit = {
486exists = scope:merchant
}
488value = "scope:merchant.merchant_capacity(scope:actor)"
}
490else = {
491value = 0
}
}
497default = {
498if = {
499limit = {
500exists = scope:merchant
}
502value = "scope:merchant.merchant_capacity(scope:actor)"
}
504else = {
505value = 0
}
}
}
511select_trigger = {
512looking_for_a = boolean
513target_flag = locked
514name = "create_trade_select_locked" 决定是否锁定此项贸易以避免被自动贸易所更改
515column = {
516data = name
}
518visible = {
}
}
522effect = {
523if = {
524limit = {
525exists = scope:from
526exists = scope:to
527exists = scope:merchant
528exists = scope:goods
529exists = scope:capacity
530exists = scope:locked
}
532scope:actor = {
533create_trade = {
534from = scope:from
535to = scope:to
536merchant = scope:merchant
537goods = scope:goods
538desired = scope:capacity
539locked = scope:locked
}
}
}
}
545ai_will_do = {
546add = {
547value = -1000
}
}