1 /**
2 Base Material
3 Provides global functions to give players base material for scenarios.
4
5 @author Maikel
6 */
7
8 // Gives the player specific base materials as given in the materials array.
GivePlayerSpecificBaseMaterial(int plr,array materials)9 global func GivePlayerSpecificBaseMaterial(int plr, array materials)
10 {
11 for (var mat in materials)
12 {
13 SetBaseMaterial(plr, mat[0], mat[1]);
14 SetBaseProduction(plr, mat[0], mat[2]);
15 }
16 return;
17 }
18
19 // Gives the player elementary base materials.
GivePlayerElementaryBaseMaterial(int plr)20 global func GivePlayerElementaryBaseMaterial(int plr)
21 {
22 // Production of material of clonk.
23 SetBaseMaterial(plr, Clonk, 5);
24 SetBaseProduction(plr, Clonk, 2);
25
26 // Production of material of bread.
27 SetBaseMaterial(plr, Bread, 5);
28 SetBaseProduction(plr, Bread, 2);
29 return;
30 }
31
32 // Gives the player some basic tools.
GivePlayerToolsBaseMaterial(int plr)33 global func GivePlayerToolsBaseMaterial(int plr)
34 {
35 // List of tools with [id, mat, prod] entries.
36 var materials = [
37 [Shovel, 4, 2],
38 [Hammer, 2, 1],
39 [Axe, 2, 1],
40 [Pickaxe, 2, 1],
41 [Sickle, 2, 1],
42 [Loam, 4, 2],
43 [Dynamite, 4, 2]
44 ];
45 for (var mat in materials)
46 {
47 SetBaseMaterial(plr, mat[0], mat[1]);
48 SetBaseProduction(plr, mat[0], mat[2]);
49 }
50 return;
51 }