교역마을/계산 DB: 두 판 사이의 차이

리버티게임, 모두가 만들어가는 자유로운 게임
백괴게임>Manymaster
편집 요약 없음
imported>Senouis
잔글편집 요약 없음
 
(사용자 3명의 중간 판 23개는 보이지 않습니다)
1번째 줄: 1번째 줄:
{{#css:.DB {display: none;} }} <div class="DB">
{{#vardefine:사람|{{예외|{{CGI2|변수=사람|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|사람}}|5}}}}|정수}}}}{{#ifexpr: {{#var:사람}} < 0 |<span class="error"></span>}}
{{#vardefine:사람|{{CGI2|변수=사람|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|사람}}|5}}}}}}
{{#vardefine:물|{{예외|{{CGI2|변수=물|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|물}}|20}}}}|정수}}}}{{#ifexpr: {{#var:물}} < 0 |<span class="error"></span>}}
{{#vardefine:물|{{CGI2|변수=물|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|물}}|20}}}}}}
{{#vardefine:우물|{{예외|{{CGI2|변수=우물|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|우물}}|0}}}}|정수}}}}{{#ifexpr: {{#var:우물}} < 0 |<span class="error"></span>}}
{{#vardefine:우물|{{CGI2|변수=우물|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|우물}}|0}}}}}}
{{#vardefine:밀|{{예외|{{CGI2|변수=밀|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|밀}}|20}}}}|정수}}}}{{#ifexpr: {{#var:밀}} < 0 |<span class="error"></span>}}
{{#vardefine:밀|{{CGI2|변수=밀|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|밀}}|20}}}}}}
{{#vardefine:밀밭|{{예외|{{CGI2|변수=밀밭|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|밀밭}}|0}}}}|정수}}}}{{#ifexpr: {{#var:밀밭}} < 0 |<span class="error"></span>}}
{{#vardefine:밀밭|{{CGI2|변수=밀밭|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|밀밭}}|0}}}}}}
{{#vardefine:사과|{{예외|{{CGI2|변수=사과|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|사과}}|20}}}}|정수}}}}{{#ifexpr: {{#var:사과}} < 0 |<span class="error"></span>}}
{{#vardefine:사과|{{CGI2|변수=사과|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|사과}}|20}}}}}}
{{#vardefine:사과나무|{{예외|{{CGI2|변수=사과나무|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|사과나무}}|0}}}}|정수}}}}{{#ifexpr: {{#var:사과나무}} < 0 |<span class="error"></span>}}
{{#vardefine:사과나무|{{CGI2|변수=사과나무|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|사과나무}}|0}}}}}}
{{#vardefine:소고기|{{예외|{{CGI2|변수=소고기|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|소고기}}|0}}}}|정수}}}}{{#ifexpr: {{#var:소고기}} < 0 |<span class="error"></span>}}
{{#vardefine:소고기|{{CGI2|변수=소고기|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|소고기}}|0}}}}}}
{{#vardefine:소|{{예외|{{CGI2|변수=소|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|소}}|0}}}}|정수}}}}{{#ifexpr: {{#var:소}} < 0 |<span class="error"></span>}}
{{#vardefine:소|{{CGI2|변수=소|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|소}}|0}}}}}}
{{#vardefine:조개|{{예외|{{CGI2|변수=조개|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|조개}}|0}}}}|정수}}}}{{#ifexpr: {{#var:조개}} < 0 |<span class="error"></span>}}
{{#vardefine:조개|{{CGI2|변수=조개|기본값={{#ifexist:교역마을/계정/{{#username:}}|{{:교역마을/계정/{{#username:}}|조개}}|0}}}}}}
{{#vardefine:조개연구|{{예외|{{CGI2|변수=조개연구|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|조개연구}}|0}}}}|정수}}}}{{#ifexpr: {{#var:조개연구}} < 0 |<span class="error"></span>}}


{{#vardefine:교역|{{#ifexist:교역마을/교역내역/{{:교역마을/계정/{{#username:}}|교역내역}}|교역마을/교역내역/{{:교역마을/계정/{{#username:}}|교역내역}}}}}}
{{#vardefine:교역|{{#ifexist:교역마을/교역내역/{{:교역마을/계정/{{USERNAME}}|교역내역}}|교역마을/교역내역/{{:교역마을/계정/{{USERNAME}}|교역내역}}|0}}}}
{{#vardefine:자신확인|{{#if:{{#var:교역}}|{{#switch:{{#username:}}|{{:{{#var:교역}}|사람1}}=1|{{:{{#var:교역}}|사람2}}=2|#default=0}}|0}}}}
{{#vardefine:자신확인|{{#if:{{#var:교역}}|{{#switch:{{USERNAME}}|{{:{{#var:교역}}|사람1}}=1|{{:{{#var:교역}}|사람2}}=2|#default=0}}|0}}}}
{{#vardefine:일치확인|{{#if:{{#var:교역}}|{{#ifeq:{{:교역마을/계정/{{:{{#var:교역}}|사람1}}|교역내역}}|{{:교역마을/계정/{{:{{#var:교역}}|사람2}}|교역내역}}|1|0}}|0}}}}
{{#vardefine:일치확인|{{#if:{{#var:교역}}|{{#ifeq:{{:교역마을/계정/{{:{{#var:교역}}|사람1}}|교역내역}}|{{:교역마을/계정/{{:{{#var:교역}}|사람2}}|교역내역}}|1|0}}|0}}}}
{{#vardefine:교역성립코드|{{#if:{{#var:교역}}|{{#ifeq:{{#var:자신확인}}|0|1|{{#ifeq:{{#var:일치확인}}|1|3|2}}}}|0}}}}
{{#vardefine:교역성립코드|{{#if:{{#var:교역}}|{{#ifeq:{{#var:자신확인}}|0|1|{{#ifeq:{{#var:일치확인}}|1|3|2}}}}|0}}}}
{{#vardefine:교역상대|{{#ifeq:{{#var:교역성립코드}}|3|{{:{{#var:교역}}|사람{{#expr: 3 - {{#var:자신확인}}}}}}|0}}}}
{{#vardefine:교역상대|{{#ifeq:{{#var:교역성립코드}}|3|{{:{{#var:교역}}|사람{{#expr: 3 - {{#var:자신확인}}}}}}|없음}}}}
{{#vardefine:반출물품|{{#ifeq:{{#var:교역성립코드}}|3|{{:{{#var:교역}}|자원{{#var:자신확인}}}}|없음}}}}
{{#vardefine:반출물품|{{#ifeq:{{#var:교역성립코드}}|3|{{:{{#var:교역}}|자원{{#var:자신확인}}}}|없음}}}}
{{#vardefine:반입물품|{{#ifeq:{{#var:교역성립코드}}|3|{{:{{#var:교역}}|자원{{#expr: 3 - {{#var:자신확인}}}}}}|없음}}}}
{{#vardefine:반입물품|{{#ifeq:{{#var:교역성립코드}}|3|{{:{{#var:교역}}|자원{{#expr: 3 - {{#var:자신확인}}}}}}|없음}}}}


{{#vardefine:반입밀|{{#ifexpr: {{#ifeq:{{#var:반입물품}}|밀|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|밀밭}} * 10 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:교역마을/계정/{{#var:교역상대}}|소}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}} }}
{{#vardefine:반입밀|{{예외|{{#ifexpr: {{#ifeq:{{#var:반입물품}}|밀|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|밀밭}} * 10 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:교역마을/계정/{{#var:교역상대}}|소}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}}|정수}}}}{{#ifexpr: {{#var:반입밀}} < 0 |<span class="error"></span>}}
{{#vardefine:반입사과|{{#ifexpr: {{#ifeq:{{#var:교역물품}}|사과|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|사과나무}} * 5 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}} }}
{{#vardefine:반입사과|{{예외|{{#ifexpr: {{#ifeq:{{#var:교역물품}}|사과|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|사과나무}} * 5 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}}|정수}}}}{{#ifexpr: {{#var:반입사과}} < 0 |<span class="error"></span>}}
{{#vardefine:반입소고기|{{#ifexpr: {{#ifeq:{{#var:교역물품}}|소고기|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|소}} * 5 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}} }}
{{#vardefine:반입소고기|{{예외|{{#ifexpr: {{#ifeq:{{#var:교역물품}}|소고기|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|소}} * 5 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}}|정수}}}}{{#ifexpr: {{#var:반입소고기}} < 0 |<span class="error"></span>}}
{{#vardefine:반입조개|{{#ifexpr: {{#ifeq:{{#var:교역물품}}|조개|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|소}} * 5 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}} }}
{{#vardefine:반입조개|{{예외|{{#ifexpr: {{#ifeq:{{#var:교역물품}}|조개|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}| {{#ifexpr: ({{:교역마을/계정/{{#var:교역상대}}|소}} * 5 - {{:교역마을/계정/{{#var:교역상대}}|사람}} - {{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}) >= 0 |{{:{{#var:교역}}|수량{{#expr: 3 - {{#var:자신확인}}}}}}|0}} |0}}|정수}}}}{{#ifexpr: {{#var:반입조개}} < 0 |<span class="error"></span>}}


{{#vardefine:반출밀|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|밀|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}} }}
{{#vardefine:반출밀|{{예외|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|밀|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}}|정수}}}}{{#ifexpr: {{#var:반출밀}} < 0 |<span class="error"></span>}}
{{#vardefine:반출사과|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|사과|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}} }}
{{#vardefine:반출사과|{{예외|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|사과|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}}|정수}}}}{{#ifexpr: {{#var:반출사과}} < 0 |<span class="error"></span>}}
{{#vardefine:반출소고기|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|소고기|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}} }}
{{#vardefine:반출소고기|{{예외|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|소고기|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}}|정수}}}}{{#ifexpr: {{#var:반출소고기}} < 0 |<span class="error"></span>}}
{{#vardefine:반출조개|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|조개|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}} }}
{{#vardefine:반출조개|{{예외|{{#ifexpr: {{#ifeq:{{#var:반출물품}}|조개|1|0}} and {{#ifeq:{{#var:교역성립코드}}|3|1|0}}|{{:{{#var:교역}}|수량{{#var:자신확인}}}}|0}}|정수}}}}{{#ifexpr: {{#var:반출조개}} < 0 |<span class="error"></span>}}


{{#vardefine:밀수요|{{#expr:{{#var:사람}} + {{#var:소}} + {{#var:반출밀}} }} }}
{{#vardefine:밀수요|{{#expr:{{#var:사람}} + {{#var:소}} + {{#var:반출밀}} }} }}
34번째 줄: 34번째 줄:
{{#vardefine:조개수요|{{#expr:{{#var:사람}} + {{#var:반출조개}} }} }}
{{#vardefine:조개수요|{{#expr:{{#var:사람}} + {{#var:반출조개}} }} }}
{{#vardefine:초기노동력|{{#expr:{{#var:사람}} - {{#var:밀밭}} - 2 * {{#var:소}} }} }}
{{#vardefine:초기노동력|{{#expr:{{#var:사람}} - {{#var:밀밭}} - 2 * {{#var:소}} }} }}
{{#vardefine:노동력|{{CGI2|변수=노동력|기본값={{#var:초기노동력}}}}}}
{{#vardefine:노동력|{{예외|{{CGI2|변수=노동력|기본값={{#ifexist:교역마을/계정/{{USERNAME}}|{{:교역마을/계정/{{USERNAME}}|노동력}}|{{#var:초기노동력}}}}}}|정수}} }}{{#ifexpr: {{#var:노동력}} < 0 |{{#vardefine:노동력|0}}}}


{{#vardefine:식량자원|{{#expr:({{#var:밀}} >= {{#var:밀수요}}) + ({{#var:사과}} >= {{#var:사과수요}}) + ({{#var:소고기}} >= {{#var:소고기수요}}) + ({{#var:조개}} >= {{#var:조개수요}}) }}}}
{{#vardefine:식량자원|{{#expr:({{#var:밀}} >= {{#var:밀수요}}) + ({{#var:사과}} >= {{#var:사과수요}}) + ({{#var:소고기}} >= {{#var:소고기수요}}) + ({{#var:조개}} >= {{#var:조개수요}}) }}}}
40번째 줄: 40번째 줄:
{{#vardefine:인구한계|{{#expr: 100 * 2 ^ (({{#var:물}} >= {{#var:사람}}) + ({{#var:소고기}} >= {{#var:사람}}) + {{#var:식량자원}}) }} }}
{{#vardefine:인구한계|{{#expr: 100 * 2 ^ (({{#var:물}} >= {{#var:사람}}) + ({{#var:소고기}} >= {{#var:사람}}) + {{#var:식량자원}}) }} }}
{{#vardefine:일반인증|{{#expr: ({{#var:인구한계}} - {{#var:사람}}) / {{#var:인구한계}} * {{#var:일무인증}} }} }}
{{#vardefine:일반인증|{{#expr: ({{#var:인구한계}} - {{#var:사람}}) / {{#var:인구한계}} * {{#var:일무인증}} }} }}
{{#vardefine:예인증|{{#ifexpr: {{#var:식량자원}} = 0 or {{#var:물}} < {{#var:사람}} or {{#expr: (1 - {{#var:사람}}) / {{#var:사람}} }} > {{#var:일반인증}} | {{#expr: (1 - {{#var:사람}}) / {{#var:사람}} }} | {{#var:일반인증}} }} }}
{{#vardefine:예인증|{{#ifexpr: {{#var:사람}} = 0|0| {{#ifexpr: {{#var:식량자원}} = 0 or {{#var:물}} < {{#var:사람}} or {{#expr: (1 - {{#var:사람}}) / {{#var:사람}} }} > {{#var:일반인증}} | {{#expr: (1 - {{#var:사람}}) / {{#var:사람}} }} | {{#var:일반인증}} }} }} }}
{{#vardefine:다음턴인구|{{#rand:{{#expr: (({{#var:사람}} + ({{#var:사람}} * {{#var:예인증}})) * 0.95) round 0 }}|{{#expr: (({{#var:사람}} + ({{#var:사람}} * {{#var:예인증}})) / 0.95) round 0 }} }} }}
{{#vardefine:다음턴인구|{{#ifexpr: {{#var:사람}} > 0 | {{rand|{{#expr: (({{#var:사람}} + ({{#var:사람}} * {{#var:예인증}})) * 0.95) round 0 }}|{{#expr: (({{#var:사람}} + ({{#var:사람}} * {{#var:예인증}})) / 0.95) round 0 }}}} |0}}}}
</div>

2023년 2월 23일 (목) 03:20 기준 최신판