File: Script.c

package info (click to toggle)
openclonk 8.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 169,516 kB
  • sloc: cpp: 180,479; ansic: 108,988; xml: 31,371; python: 1,223; php: 767; makefile: 145; sh: 101; javascript: 34
file content (153 lines) | stat: -rw-r--r-- 2,915 bytes parent folder | download | duplicates (5)
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*-- Scaffold wall --*/

/* Initialization */

func SetLeft(object host)
{
	SetGraphics("Left");
	SetAction("Left", host);
	SetShape(0,0,4,32);
	SetPosition(host->GetX()-16, host->GetY()-16);
	SetSolidMask(0,0,2,32);
	SetVertexXY(0,1,1);
	return true;
}

func SetLeftExtension(object host)
{
	SetGraphics("Bottom");
	SetAction("Bottom", host);
	SetShape(0,0,32,4);
	SetPosition(host->GetX()+13, host->GetY()+12);
	SetSolidMask(0,0,32,4);
	SetVertexXY(0,1+29,-27);
	SetHalfVehicleSolidMask(true);
	return true;
}

func SetRight(object host)
{
	SetGraphics("Right");
	SetAction("Right", host);
	SetShape(0,0,4,32);
	SetPosition(host->GetX()+12, host->GetY()-16);
	SetSolidMask(0,0,2,32,2,0);
	SetVertexXY(0,-27,1);
	return true;
}

func SetRightExtension(object host)
{
	SetGraphics("Bottom");
	SetAction("Bottom", host);
	SetShape(0,0,32,4);
	SetPosition(host->GetX()+13, host->GetY()+12);
	SetSolidMask(0,0,32,4);
	SetVertexXY(0,1-29,-27);
	SetHalfVehicleSolidMask(true);
	return true;
}

func SetTopRightExtension(object host)
{
	SetGraphics("Right");
	SetAction("Right", host);
	SetShape(0,0,4,32);
	SetPosition(host->GetX()+15, host->GetY()-48);
	SetSolidMask(0,0,2,32,2,0);
	SetVertexXY(0,-27,1+32);
	return true;
}

func SetTopLeftExtension(object host)
{
	SetGraphics("Left");
	SetAction("Left", host);
	SetShape(0,0,4,32);
	SetPosition(host->GetX()-16, host->GetY()-48);
	SetSolidMask(0,0,2,32);
	SetVertexXY(0,1,1+32);
	return true;
}

func SetTop(object host)
{
	SetGraphics("Top");
	SetAction("Top", host);
	SetShape(0,0,32,4);
	SetPosition(host->GetX()-16, host->GetY()-16);
	SetSolidMask(0,0,32,4);
	SetVertexXY(0,1,1);
	SetHalfVehicleSolidMask(true);
	return true;
}

func SetBottom(object host)
{
	SetGraphics("Bottom");
	SetAction("Bottom", host);
	SetShape(0,0,32,4);
	SetPosition(host->GetX()-16, host->GetY()+12);
	SetSolidMask(0,0,32,4);
	SetVertexXY(0,1,-27);
	SetHalfVehicleSolidMask(true);
	return true;
}


/* Destruction */

local ActMap = {
		Left = {
			Prototype = Action,
			Name = "Left",
			Procedure = DFA_ATTACH,
			Directions = 1,
			Length = 1,
			Delay = 0,
			FacetBase = 0,
			X = 0, Y = 0, Wdt=4, Hgt = 32,
			NextAction = "Left",
		},
		Right = {
			Prototype = Action,
			Name = "Right",
			Procedure = DFA_ATTACH,
			Directions = 1,
			Length = 1,
			Delay = 0,
			FacetBase = 0,
			X = 0, Y = 0, Wdt=4, Hgt = 32,
			NextAction = "Right",
		},
		Top = {
			Prototype = Action,
			Name = "Top",
			Procedure = DFA_ATTACH,
			Directions = 1,
			Length = 1,
			Delay = 0,
			FacetBase = 0,
			X = 0, Y = 0, Wdt=32, Hgt = 4,
			NextAction = "Top",
		},
		Bottom = {
			Prototype = Action,
			Name = "Bottom",
			Procedure = DFA_ATTACH,
			Directions = 1,
			Length = 1,
			Delay = 0,
			FacetBase = 0,
			X = 0, Y = 0, Wdt=32, Hgt = 4,
			NextAction = "Bottom",
		},
};

func Definition(def) {
	
}

local Name = "$Name$";
local Description = "$Description$";
local Plane = 121;