Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

320 lines (295 sloc) 8.634 kB
{
id: "ct-preview",
prototype: ["ct-3d"],
always_active: true,
zsub_order: 25,
properties: {
safeAnimation: "def(anim) if(anim in self.available_animations, set(self.animation, anim), set(self.animation, 'default'))",
set_alpha: "def(val) map(all_preview_objects, set(value.alpha, min(value.vars.max_alpha, val)))",
set_bright: "def(val) null",
do_place_effect: "[
schedule(3, set(self.alpha, 0)),
schedule(5, set(self.alpha, self.vars.max_alpha)),
set(self.y, self.y+10),
schedule(2, set(self.y, self.y+10)),
schedule(3, self.setToGrid(self.location)),
]",
warn_colour: "def(enabled) if(not self.vars.erasing, map(all_preview_objects, set(value.blue, if(not enabled, 0, 255))))",
erase_colour: "def(enabled) [
map(all_preview_objects,
map(['blue', 'green'], 'attrib',
set(value[attrib], if(not enabled, 255, 55)))),
set(self.vars.erasing, enabled),]",
rotatable: false, //The preview objects do not support in-place rotation.
all_preview_objects: "[self, self.underlay] + self.underlay.vars.grids",
},
vars: {
encloses: 1,
max_alpha: 175,
yoffset: -10,
},
consts: {
nosave: 1,
},
on_create: "[
set(brightness, 255),
spawn(self.type + '.underlay', mid_x, mid_y+10, facing, [
set(child.alpha, 50),
set(self.underlay, child),
])
]",
animation: [
#---INTERNAL---#
{
scale: 1,
"@base": true,
},
{ id: "default",
image: "experimental/cube trains/0029.png",
rect: [0,0,255,255],},
#---BLOCKS---#
{ id: "invisible",
image: "experimental/cube trains/0029.png",
rect: [0,0,0,0],},
{ id: "ct-block-5",
image: "experimental/cube trains/0013.png",
rect: [0,0,255,255],},
{ id: "ct-legs-5",
image: "experimental/cube trains/0014.png",
rect: [0,0,255,255],},
{ id: "ct-track-37",
image: "experimental/cube trains/0015.png",
rect: [0,0,255,255],},
{ id: "ct-track-19",
image: "experimental/cube trains/0016.png",
rect: [0,0,255,255],},
{ id: "ct-track-13",
image: "experimental/cube trains/0017.png",
rect: [0,0,255,255],},
{ id: "ct-track-17",
image: "experimental/cube trains/0018.png",
rect: [0,0,255,255],},
{ id: "ct-track-79",
image: "experimental/cube trains/0019.png",
rect: [0,0,255,255],},
{ id: "ct-track-39",
image: "experimental/cube trains/0020.png",
rect: [0,0,255,255],},
{ id: "ct-raise-1",
image: "experimental/cube trains/0030.png",
rect: [0,0,255,255],},
{ id: "ct-raise-7",
image: "experimental/cube trains/0031.png",
rect: [0,0,255,255],},
{ id: "ct-raise-9",
image: "experimental/cube trains/0032.png",
rect: [0,0,255,255],},
{ id: "ct-raise-3",
image: "experimental/cube trains/0033.png",
rect: [0,0,255,255],},
{ id: "ct-tunnel-1",
image: "experimental/cube trains/0034.png",
rect: [0,0,255,255],},
{ id: "ct-tunnel-3",
image: "experimental/cube trains/0035.png",
rect: [0,0,255,255],},
{ id: "ct-tunnel-7",
image: "experimental/cube trains/0036.png",
rect: [0,0,255,255],},
{ id: "ct-tunnel-9",
image: "experimental/cube trains/0037.png",
rect: [0,0,255,255],},
{ id: "ct-bridge-tiny-37",
image: "experimental/cube trains/0039.png",
rect: [0,0,255,255],},
{ id: "ct-bridge-tiny-19",
image: "experimental/cube trains/0040.png",
rect: [0,0,255,255],},
{ id: "ct-windows-large-5",
image: "experimental/cube trains/0102.png",
rect: [0,0,255,255],},
{ id: "ct-glr-37",
image: "experimental/cube trains/0107.png",
rect: [0,0,255,255],},
{ id: "ct-metatrack-37",
image: "experimental/cube trains/0107.png",
rect: [0,0,255,255],},
{ id: "ct-glr-19",
image: "experimental/cube trains/0108.png",
rect: [0,0,255,255],},
{ id: "ct-metatrack-19",
image: "experimental/cube trains/0108.png",
rect: [0,0,255,255],},
{ id: "ct-metatrack-19",
image: "experimental/cube trains/0108.png",
rect: [0,0,255,255],},
{ id: "ct-glr-13",
image: "experimental/cube trains/0109.png",
rect: [0,0,255,255],},
{ id: "ct-metatrack-13",
image: "experimental/cube trains/0109.png",
rect: [0,0,255,255],},
{ id: "ct-glr-17",
image: "experimental/cube trains/0110.png",
rect: [0,0,255,255],},
{ id: "ct-metatrack-17",
image: "experimental/cube trains/0110.png",
rect: [0,0,255,255],},
{ id: "ct-glr-79",
image: "experimental/cube trains/0111.png",
rect: [0,0,255,255],},
{ id: "ct-metatrack-79",
image: "experimental/cube trains/0111.png",
rect: [0,0,255,255],},
{ id: "ct-glr-39",
image: "experimental/cube trains/0112.png",
rect: [0,0,255,255],},
{ id: "ct-metatrack-39",
image: "experimental/cube trains/0112.png",
rect: [0,0,255,255],},
{ id: "ct-ground-raise-1",
image: "experimental/cube trains/0113.png",
rect: [0,0,255,255],},
{ id: "ct-metaraise-1",
image: "experimental/cube trains/0113.png",
rect: [0,0,255,255],},
{ id: "ct-ground-raise-7",
image: "experimental/cube trains/0114.png",
rect: [0,0,255,255],},
{ id: "ct-metaraise-7",
image: "experimental/cube trains/0114.png",
rect: [0,0,255,255],},
{ id: "ct-ground-raise-9",
image: "experimental/cube trains/0115.png",
rect: [0,0,255,255],},
{ id: "ct-metaraise-9",
image: "experimental/cube trains/0115.png",
rect: [0,0,255,255],},
{ id: "ct-ground-raise-3",
image: "experimental/cube trains/0116.png",
rect: [0,0,255,255],},
{ id: "ct-metaraise-3",
image: "experimental/cube trains/0116.png",
rect: [0,0,255,255],},
{ id: "ct-awning-9",
image: "experimental/cube trains/0117.png",
rect: [0,0,255,255],},
{ id: "ct-awning-3",
image: "experimental/cube trains/0118.png",
rect: [0,0,255,255],},
{ id: "ct-awning-1",
image: "experimental/cube trains/0119.png",
rect: [0,0,255,255],},
{ id: "ct-awning-7",
image: "experimental/cube trains/0120.png",
rect: [0,0,255,255],},
{ id: "ct-awning-5",
image: "experimental/cube trains/0121.png",
rect: [0,0,255,255],},
{ id: "ct-square-shadow-5",
image: "experimental/cube trains/0139.png",
rect: [0,0,255,255],},
{ id: "ct-group-spawner",
image: "experimental/cube trains/0148.png",
rect: [0,0,255,255],},
{ id: "ct-water-surface-5",
image: "experimental/cube trains/0187.png",
rect: [0,0,255,255],},
#---PLANTS---#
{ id: "ct-water-5",
image: "experimental/cube trains/0188.png",
rect: [0,0,255,255],},
{ id: "ct-tree1-center-1",
image: "experimental/cube trains/plants.png",
rect: [256,0,511,255],},
{ id: "ct-tree1-center-3",
image: "experimental/cube trains/plants.png",
rect: [256,256,511,511],},
{ id: "ct-tree1-center-7",
image: "experimental/cube trains/plants.png",
rect: [256,512,511,767],},
{ id: "ct-tree1-center-9",
image: "experimental/cube trains/plants.png",
rect: [256,768,511,1023],},
{ id: "ct-edge-hedge-7",
image: "experimental/cube trains/plants.png",
rect: [0,1024,255,1279],},
{ id: "ct-edge-hedge-1",
image: "experimental/cube trains/plants.png",
rect: [0,1280,255,1535],},
{ id: "ct-edge-hedge-3",
image: "experimental/cube trains/plants.png",
rect: [0,1536,255,1791],},
{ "id": "ct-edge-hedge-9",
"image": "experimental/cube trains/plants.png",
"rect": [0,1792,255,2047]
},
],
object_type: [{
id: "underlay",
prototype: ["ct-3d"],
always_active: true,
zsub_order: 24,
properties: {
set_alpha: "def(val) null",
set_bright: "def(val) null",
setAllToGrid: "def(a) [setToGrid(a),
map(grids, value.setToGrid(list_add(location, value.vars.gridOffset + [0]))),
]",
rotatable: false,
},
vars: {
max_alpha: 77,
},
on_create: "[
map(objs, obj, [
add_object(obj),
obj.setToGrid(list_add(location, obj.vars.gridOffset + [0])),
set(obj.vars.max_alpha, newMaxAlpha),
set(obj.alpha, newMaxAlpha),
] where newMaxAlpha = obj.max_alpha - (distance(obj.vars.gridOffset, [0,0])-1)*80
),
// map(objs, 'obj', debug(obj.vars.gridOffset)),
set(self.vars.grids, objs),
] where objs = filter(flatten(map(range(-2,3), nx, map(range(-2,3), ny,
object('ct-preview.grid-5', x, y, facing, {gridOffset: [nx, ny]})))),
not value.vars.gridOffset in [[-2,-2], [-2,2], [2,2], [2,-2], [0,0]])",
on_end_anim: "animation('normal')",
animation: [
{
"@base": true,
"scale": 1
},
{
image: "experimental/cube trains/0191.png",
rect: [0,0,255,255],
id: "normal",
},
],
},{
id: "grid-5",
prototype: ["ct-3d"],
always_active: true,
zsub_order: 23,
properties: {
set_alpha: "def(val) null",
set_bright: "def(val) null",
rotatable: false,
},
vars: {
max_alpha: 255,
},
on_end_anim: "animation('normal')",
animation: [
{
"@base": true,
"scale": 1
},
{
image: "experimental/cube trains/0190.png",
rect: [0,0,255,255],
id: "normal",
},
],
},],
}
Jump to Line
Something went wrong with that request. Please try again.