forked from OpenTTD/nml
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path036_procedure_scope.nml
42 lines (35 loc) · 1.33 KB
/
036_procedure_scope.nml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
grf {
grfid: "NML\36";
name: string(STR_REGRESSION_NAME);
desc: string(STR_REGRESSION_DESC);
version: 0;
min_compatible_version: 0;
}
switch(FEAT_INDUSTRIES, PARENT, proc_call_optimisation, population) {
0: return 0;
return STORE_TEMP(0,0);
}
switch(FEAT_INDUSTRIES, SELF, ternary_optimisation, proc_call_optimisation() ? 1 : 0) { return 5; }
switch(FEAT_INDUSTRIES, SELF, dumb_add, a, b, a + b) { return; }
/* some computation that requires registers for intermediate values */
switch(FEAT_INDUSTRIES, PARENT, callee, a, (population+(has_church?500:1))*(num_houses-4*has_stadium)+a) {
0..5: return a + dumb_add(5, a);
default: return a + dumb_add(6, a);
}
switch(FEAT_INDUSTRIES, SELF, caller2, dumb_add(1,dumb_add(founder_colour2, build_date))*(water_distance+founder_colour1)*(random_bits+callee(1))*(founder_type+layout_num)*(build_type+counter)) {
return;
}
switch(FEAT_INDUSTRIES, SELF, caller1, (founder_colour2+build_date)*dumb_add(random_bits, callee(0))*(build_type+counter)) {
return;
}
item(FEAT_INDUSTRIES, coal_mine) {
property {
substitute: INDUSTRYTYPE_COAL_MINE;
override: INDUSTRYTYPE_COAL_MINE;
}
graphics {
build_prod_change: return caller1;
control_special: return caller2;
construction_probability: return ternary_optimisation;
}
}