/* * Copyright (C) 2016 GarryG & Quast65 * This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. * This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. * You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ /* * GRF HEADER */ //include sprite templates template template_slopeaware_purchase(x,y,filename) { [x+5, y+5, 64, 100, -31, -69, filename] [x+85, y+5, 64, 100, -31, -69, filename] [x+165, y+5, 64, 100, -31, -69, filename] [x+245, y+5, 64, 100, -31, -69, filename] } template template_slopeaware(x,y,filename) { [x+48, y+26, 64, 31, -31, 0, filename] [x+128, y+26, 64, 31, -31, 0, filename] [x+208, y+26, 64, 23, -31, 0, filename] [x+288, y+26, 64, 23, -31, 0, filename] [x+368, y+26, 64, 31, -31, 0, filename] [x+448, y+26, 64, 31, -31, 0, filename] [x+528, y+26, 64, 23, -31, 0, filename] [x+608, y+26, 64, 23, -31, 0, filename] [x+688, y+26, 64, 39, -31, -8, filename] [x+768, y+26, 64, 39, -31, -8, filename] [x+848, y+26, 64, 31, -31, -8, filename] [x+928, y+26, 64, 31, -31, -8, filename] [x+1008, y+26, 64, 39, -31, -8, filename] [x+1088, y+26, 64, 39, -31, -8, filename] [x+1168, y+26, 64, 31, -31, -8, filename] [x+1248, y+26, 64, 47, -31, -16, filename] [x+1328, y+26, 64, 15, -31, 0, filename] [x+1408, y+26, 64, 31, -31, -8, filename] [x+1488, y+26, 64, 31, -31, -8, filename] } template template_slopecrops(x,y,filename) { [x+48, y+20, 64, 37, -31, -6, filename] [x+128, y+20, 64, 37, -31, -6, filename] [x+208, y+20, 64, 29, -31, -6, filename] [x+288, y+20, 64, 29, -31, -6, filename] [x+368, y+20, 64, 37, -31, -6, filename] [x+448, y+20, 64, 37, -31, -6, filename] [x+528, y+20, 64, 29, -31, -6, filename] [x+608, y+20, 64, 29, -31, -6, filename] [x+688, y+20, 64, 45, -31, -14, filename] [x+768, y+20, 64, 45, -31, -14, filename] [x+848, y+20, 64, 37, -31, -14, filename] [x+928, y+20, 64, 37, -31, -14, filename] [x+1008, y+20, 64, 45, -31, -14, filename] [x+1088, y+20, 64, 45, -31, -14, filename] [x+1168, y+20, 64, 37, -31, -14, filename] [x+1248, y+20, 64, 53, -31, -21, filename] [x+1328, y+20, 64, 21, -31, -6, filename] [x+1408, y+20, 64, 37, -31, -14, filename] [x+1488, y+20, 64, 37, -31, -14, filename] } template template_building_low(x,y,filename) { [x+14, y+2, 64, 44, -31, -13, filename] [x+89, y+2, 64, 44, -31, -13, filename] [x+164, y+2, 64, 44, -31, -13, filename] [x+239, y+2, 64, 44, -31, -13, filename] } template template_building_large(x,y,filename) { [x, y, 74, 54, -37, -13, filename] } template template_building_slope(x,y,filename) { [x+14, y+2, 64, 44, -31, -8, filename] [x+89, y+2, 64, 44, -31, -8, filename] [x+164, y+2, 64, 44, -31, -8, filename] [x+239, y+2, 64, 44, -31, -8, filename] } template template_building_high(x,y,filename) { [x+14, y+2, 64, 94, -31, -63, filename] [x+89, y+2, 64, 94, -31, -63, filename] [x+164, y+2, 64, 94, -31, -63, filename] [x+239, y+2, 64, 94, -31, -63, filename] } template template_footbridge(x,y,filename) { [x+18, y+8, 130, 120, -64, -73, filename] [x+162, y+8, 130, 120, -64, -73, filename] [x+306, y+8, 130, 120, -64, -73, filename] [x+450, y+8, 130, 120, -64, -73, filename] } template template_fakebridge(x,y,filename) { [x+12, y+8, 142, 120, -71, -60, filename] [x+156, y+8, 142, 120, -71, -60, filename] [x+300, y+8, 142, 120, -71, -60, filename] [x+444, y+8, 142, 120, -71, -60, filename] } template template_woodbridge(x,y,filename) { [x+18, y+8, 130, 120, -64, -60, filename] [x+162, y+8, 130, 120, -64, -60, filename] [x+306, y+8, 130, 120, -64, -60, filename] [x+450, y+8, 130, 120, -64, -60, filename] } template template_embankment1(x,y,filename) { [x+6, y+8, 142, 120, -64, -60, filename] [x+150, y+8, 142, 120, -64, -60, filename] [x+294, y+8, 142, 120, -76, -60, filename] [x+438, y+8, 142, 120, -75, -60, filename] } template template_tower(x,y,filename) { [x+18, y+8, 130, 140, -64, -93, filename] [x+162, y+8, 130, 140, -64, -93, filename] [x+306, y+8, 130, 140, -64, -93, filename] [x+450, y+8, 130, 140, -64, -93, filename] } template template_building_wide(x,y,filename) { [x+14, y+2, 74, 44, -37, -13, filename] [x+89, y+2, 74, 44, -37, -13, filename] [x+164, y+2, 74, 44, -37, -13, filename] [x+239, y+2, 74, 44, -37, -13, filename] } template template_groundsprite(x,y,filename) { [x, y, 64, 31, -31, 0, filename] } template template_purchase(x,y,filename) { [x, y, 102, 46, -49, -11, filename] } // define the newgrf grf { grfid: "\47\47\08\01"; name: string(STR_GRF_NAME); desc: string(STR_GRF_DESCRIPTION); url: string(STR_GRF_URL); version: 1; min_compatible_version: 1; } /* * MAIN CONTENTS */ /* EMBANKMENTS & BALLAST SLOPES */ /* EMBANKMENT */ //spritesets with 4 directions, SNOW-version and the PURCHASE-menu spriteset (spriteset_ballast_slopes) { template_building_slope(0,0,"gfx/ballast_slopes.png") } spriteset (spriteset_ballast_slopes_SNOW) { template_building_slope(0,0,"gfx/ballast_slopes_SNOW.png") } spriteset (spriteset_ballast_slopes_PURCHASE) { template_building_slope(0,0,"gfx/ballast_slopes_PURCHASE.png") } /* spritelayouts */ //Direction_1 spritelayout spritelayout_ballast_slopes_1 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes(0); hide_sprite: nearby_tile_height(0, 0) >= snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes_SNOW(0); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes_PURCHASE(0); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_2 spritelayout spritelayout_ballast_slopes_2 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes_SNOW(1); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes_PURCHASE(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_3 spritelayout spritelayout_ballast_slopes_3 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes_SNOW(2); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes_PURCHASE(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_4 spritelayout spritelayout_ballast_slopes_4 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes_SNOW(3); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes_PURCHASE(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //decide spritelayout for each of the 4 directions switch (FEAT_OBJECTS, SELF, switch_ballast_slopes_view, view) { 1: spritelayout_ballast_slopes_2; 2: spritelayout_ballast_slopes_3; 3: spritelayout_ballast_slopes_4; spritelayout_ballast_slopes_1; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_ballast_slopes_object, [ STORE_TEMP(slope_to_sprite_offset(tile_slope), 0), STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_ballast_slopes_view; } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_ballast_slopes_purchase, view) { 1: spritelayout_ballast_slopes_2_purchase; 2: spritelayout_ballast_slopes_3_purchase; 3: spritelayout_ballast_slopes_4_purchase; spritelayout_ballast_slopes_1_purchase; } item (FEAT_OBJECTS, ballast_slopes, 50) { property { class: "EMBT"; classname: string(STR_EMBT); name: string(STR_ballast_slopes); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 1; remove_cost_multiplier: 4; introduction_date: date(1800,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANIMATED, OBJ_FLAG_RANDOM_ANIMATION, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_ballast_slopes_object; purchase: switch_ballast_slopes_purchase; autoslope: return CB_RESULT_AUTOSLOPE; } } /* EMBANKMENT 1 */ //spritesets with 4 directions, SNOW-version and the PURCHASE-menu spriteset (spriteset_ballast_slopes1) { template_building_slope(0,0,"gfx/ballast_slopes1.png") } spriteset (spriteset_ballast_slopes1_SNOW) { template_building_slope(0,0,"gfx/ballast_slopes1_SNOW.png") } spriteset (spriteset_ballast_slopes1_PURCHASE) { template_building_slope(0,0,"gfx/ballast_slopes1_PURCHASE.png") } /* spritelayouts */ //Direction_1 spritelayout spritelayout_ballast_slopes1_1 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes1(0); hide_sprite: nearby_tile_height(0, 0) >= snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes1_SNOW(0); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes1_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes1_PURCHASE(0); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_2 spritelayout spritelayout_ballast_slopes1_2 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes1(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes1_SNOW(1); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes1_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes1_PURCHASE(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_3 spritelayout spritelayout_ballast_slopes1_3 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes1(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes1_SNOW(2); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes1_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes1_PURCHASE(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_4 spritelayout spritelayout_ballast_slopes1_4 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes1(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes1_SNOW(3); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes1_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes1_PURCHASE(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //decide spritelayout for each of the 4 directions switch (FEAT_OBJECTS, SELF, switch_ballast_slopes1_view, view) { 1: spritelayout_ballast_slopes1_2; 2: spritelayout_ballast_slopes1_3; 3: spritelayout_ballast_slopes1_4; spritelayout_ballast_slopes1_1; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_ballast_slopes1_object, [ STORE_TEMP(slope_to_sprite_offset(tile_slope), 0), STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_ballast_slopes1_view; } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_ballast_slopes1_purchase, view) { 1: spritelayout_ballast_slopes1_2_purchase; 2: spritelayout_ballast_slopes1_3_purchase; 3: spritelayout_ballast_slopes1_4_purchase; spritelayout_ballast_slopes1_1_purchase; } item (FEAT_OBJECTS, ballast_slopes1, 51) { property { class: "EMBT"; classname: string(STR_EMBT); name: string(STR_ballast_slopes1); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 1; remove_cost_multiplier: 4; introduction_date: date(1800,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_ON_WATER, OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANIMATED, OBJ_FLAG_RANDOM_ANIMATION, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_ballast_slopes1_object; purchase: switch_ballast_slopes1_purchase; autoslope: return CB_RESULT_AUTOSLOPE; } } /* EMBANKMENT 2 */ //spritesets with 4 directions, SNOW-version and the PURCHASE-menu spriteset (spriteset_ballast_slopes2) { template_footbridge(0,0,"gfx/ballast_slopes2.png") } spriteset (spriteset_ballast_slopes2_SNOW) { template_footbridge(0,0,"gfx/ballast_slopes2_SNOW.png") } spriteset (spriteset_ballast_slopes2_PURCHASE) { template_building_slope(0,0,"gfx/ballast_slopes2_PURCHASE.png") } /* spritelayouts */ //Direction_1 spritelayout spritelayout_ballast_slopes2_1 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes2(0); hide_sprite: nearby_tile_height(0, 0) >= snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes2_SNOW(0); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes2_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes2_PURCHASE(0); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_2 spritelayout spritelayout_ballast_slopes2_2 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes2(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes2_SNOW(1); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes2_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes2_PURCHASE(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_3 spritelayout spritelayout_ballast_slopes2_3 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes2(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes2_SNOW(2); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes2_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes2_PURCHASE(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_4 spritelayout spritelayout_ballast_slopes2_4 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes2(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes2_SNOW(3); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes2_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes2_PURCHASE(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //decide spritelayout for each of the 4 directions switch (FEAT_OBJECTS, SELF, switch_ballast_slopes2_view, view) { 1: spritelayout_ballast_slopes2_2; 2: spritelayout_ballast_slopes2_3; 3: spritelayout_ballast_slopes2_4; spritelayout_ballast_slopes2_1; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_ballast_slopes2_object, [ STORE_TEMP(slope_to_sprite_offset(tile_slope), 0), STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_ballast_slopes2_view; } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_ballast_slopes2_purchase, view) { 1: spritelayout_ballast_slopes2_2_purchase; 2: spritelayout_ballast_slopes2_3_purchase; 3: spritelayout_ballast_slopes2_4_purchase; spritelayout_ballast_slopes2_1_purchase; } item (FEAT_OBJECTS, ballast_slopes2, 52) { property { class: "EMBT"; classname: string(STR_EMBT); name: string(STR_ballast_slopes2); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 1; remove_cost_multiplier: 4; introduction_date: date(1800,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANIMATED, OBJ_FLAG_RANDOM_ANIMATION, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_ballast_slopes2_object; purchase: switch_ballast_slopes2_purchase; autoslope: return CB_RESULT_AUTOSLOPE; } } /* EMBANKMENT 3 */ //spritesets with 4 directions, SNOW-version and the PURCHASE-menu spriteset (spriteset_ballast_slopes3) { template_building_slope(0,0,"gfx/ballast_slopes3.png") } spriteset (spriteset_ballast_slopes3_SNOW) { template_building_slope(0,0,"gfx/ballast_slopes3_SNOW.png") } spriteset (spriteset_ballast_slopes3_PURCHASE) { template_building_slope(0,0,"gfx/ballast_slopes3_PURCHASE.png") } /* spritelayouts */ //Direction_1 spritelayout spritelayout_ballast_slopes3_1 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes3(0); hide_sprite: nearby_tile_height(0, 0) >= snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes3_SNOW(0); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes3_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes3_PURCHASE(0); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_2 spritelayout spritelayout_ballast_slopes3_2 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes3(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes3_SNOW(1); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes3_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes3_PURCHASE(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_3 spritelayout spritelayout_ballast_slopes3_3 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes3(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes3_SNOW(2); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes3_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes3_PURCHASE(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_4 spritelayout spritelayout_ballast_slopes3_4 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes3(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes3_SNOW(3); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes3_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes3_PURCHASE(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //decide spritelayout for each of the 4 directions switch (FEAT_OBJECTS, SELF, switch_ballast_slopes3_view, view) { 1: spritelayout_ballast_slopes3_2; 2: spritelayout_ballast_slopes3_3; 3: spritelayout_ballast_slopes3_4; spritelayout_ballast_slopes3_1; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_ballast_slopes3_object, [ STORE_TEMP(slope_to_sprite_offset(tile_slope), 0), STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_ballast_slopes3_view; } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_ballast_slopes3_purchase, view) { 1: spritelayout_ballast_slopes3_2_purchase; 2: spritelayout_ballast_slopes3_3_purchase; 3: spritelayout_ballast_slopes3_4_purchase; spritelayout_ballast_slopes3_1_purchase; } item (FEAT_OBJECTS, ballast_slopes3, 53) { property { class: "EMBT"; classname: string(STR_EMBT); name: string(STR_ballast_slopes3); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 1; remove_cost_multiplier: 4; introduction_date: date(1800,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_ON_WATER, OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANIMATED, OBJ_FLAG_RANDOM_ANIMATION, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_ballast_slopes3_object; purchase: switch_ballast_slopes3_purchase; autoslope: return CB_RESULT_AUTOSLOPE; } } /* EMBANKMENT 4 */ //spritesets with 4 directions, SNOW-version and the PURCHASE-menu spriteset (spriteset_ballast_slopes4) { template_footbridge(0,0,"gfx/ballast_slopes4.png") } spriteset (spriteset_ballast_slopes4_SNOW) { template_footbridge(0,0,"gfx/ballast_slopes4_SNOW.png") } spriteset (spriteset_ballast_slopes4_PURCHASE) { template_building_slope(0,0,"gfx/ballast_slopes4_PURCHASE.png") } /* spritelayouts */ //Direction_1 spritelayout spritelayout_ballast_slopes4_1 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes4(0); hide_sprite: nearby_tile_height(0, 0) >= snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes4_SNOW(0); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes4_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes4_PURCHASE(0); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_2 spritelayout spritelayout_ballast_slopes4_2 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes4(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes4_SNOW(1); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes4_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes4_PURCHASE(1); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_3 spritelayout spritelayout_ballast_slopes4_3 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes4(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes4_SNOW(2); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes4_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes4_PURCHASE(2); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //Direction_4 spritelayout spritelayout_ballast_slopes4_4 { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1); } building { sprite: spriteset_ballast_slopes4(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } building { sprite: spriteset_ballast_slopes4_SNOW(3); hide_sprite: nearby_tile_height(0, 0) < snowline_height; xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } spritelayout spritelayout_ballast_slopes4_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_ballast_slopes4_PURCHASE(3); xoffset: 0; //from NE edge yoffset: 0; //from NW edge zoffset: 0; xextent: 16; yextent: 16; zextent: 16; } } //decide spritelayout for each of the 4 directions switch (FEAT_OBJECTS, SELF, switch_ballast_slopes4_view, view) { 1: spritelayout_ballast_slopes4_2; 2: spritelayout_ballast_slopes4_3; 3: spritelayout_ballast_slopes4_4; spritelayout_ballast_slopes4_1; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_ballast_slopes4_object, [ STORE_TEMP(slope_to_sprite_offset(tile_slope), 0), STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_DESERT ? GROUNDSPRITE_DESERT : LOAD_TEMP(1), 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_ballast_slopes4_view; } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_ballast_slopes4_purchase, view) { 1: spritelayout_ballast_slopes4_2_purchase; 2: spritelayout_ballast_slopes4_3_purchase; 3: spritelayout_ballast_slopes4_4_purchase; spritelayout_ballast_slopes4_1_purchase; } item (FEAT_OBJECTS, ballast_slopes4, 54) { property { class: "EMBT"; classname: string(STR_EMBT); name: string(STR_ballast_slopes4); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 1; remove_cost_multiplier: 4; introduction_date: date(1800,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_ON_WATER, OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANIMATED, OBJ_FLAG_RANDOM_ANIMATION, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_ballast_slopes4_object; purchase: switch_ballast_slopes4_purchase; autoslope: return CB_RESULT_AUTOSLOPE; } } /* slope_aware_001 */ //spritesets with 4 views, SNOW-version and the PURCHASE-menu spriteset (spriteset_slope_aware_001_a) { template_slopeaware(0,0,"gfx/slope_aware_001_a.png") } spriteset (spriteset_slope_aware_001_a_SNOW) { template_slopeaware(0,0,"gfx/slope_aware_001_a_SNOW.png") } spriteset (spriteset_slope_aware_001_b) { template_slopeaware(0,0,"gfx/slope_aware_001_b.png") } spriteset (spriteset_slope_aware_001_b_SNOW) { template_slopeaware(0,0,"gfx/slope_aware_001_b_SNOW.png") } spriteset (spriteset_slope_aware_001_c) { template_slopeaware(0,0,"gfx/slope_aware_001_c.png") } spriteset (spriteset_slope_aware_001_c_SNOW) { template_slopeaware(0,0,"gfx/slope_aware_001_c_SNOW.png") } spriteset (spriteset_slope_aware_001_d) { template_slopeaware(0,0,"gfx/slope_aware_001_d.png") } spriteset (spriteset_slope_aware_001_d_SNOW) { template_slopeaware(0,0,"gfx/slope_aware_001_d_SNOW.png") } spriteset (spriteset_slope_aware_001_PURCHASE) { template_slopeaware_purchase(0,0,"gfx/slope_aware_001_PURCHASE.png") } /* spritelayouts */ //View_a spritelayout spritelayout_slope_aware_001_a { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_aware_001_a(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_aware_001_a_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_b spritelayout spritelayout_slope_aware_001_b { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_aware_001_b(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_aware_001_b_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_c spritelayout spritelayout_slope_aware_001_c { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_aware_001_c(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_aware_001_c_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_d spritelayout spritelayout_slope_aware_001_d { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_aware_001_d(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_aware_001_d_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //decide spritelayout for each of the view switch (FEAT_OBJECTS, SELF, switch_slope_aware_001_view, view) { 1: spritelayout_slope_aware_001_b; 2: spritelayout_slope_aware_001_c; 3: spritelayout_slope_aware_001_d; spritelayout_slope_aware_001_a; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_slope_aware_001_object, [ STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP( (nearby_tile_terrain_type(0,0) == TILETYPE_DESERT) * GROUNDSPRITE_DESERT, 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 1, 0) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type(-1, 0) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0, 1) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0,-1) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_slope_aware_001_view; } spritelayout spritelayout_slope_aware_001_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_aware_001_PURCHASE(0); } } spritelayout spritelayout_slope_aware_001_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_aware_001_PURCHASE(1); } } spritelayout spritelayout_slope_aware_001_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_aware_001_PURCHASE(2); } } spritelayout spritelayout_slope_aware_001_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_aware_001_PURCHASE(3); } } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_slope_aware_001_purchase, view) { 1: spritelayout_slope_aware_001_2_purchase; 2: spritelayout_slope_aware_001_3_purchase; 3: spritelayout_slope_aware_001_4_purchase; spritelayout_slope_aware_001_1_purchase; } switch (FEAT_OBJECTS, SELF, switch_add_text_slope_aware_001, view) { 1: string(STR_slope_aware_001_purchase_view2); 2: string(STR_slope_aware_001_purchase_view3); 3: string(STR_slope_aware_001_purchase_view4); default: string(STR_slope_aware_001_purchase_view1); } item (FEAT_OBJECTS, slope_aware_001, 001) { property { class: "SA04"; classname: string(STR_SA04); name: string(STR_slope_aware_001); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 0; remove_cost_multiplier: 0; introduction_date: date(1700,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_slope_aware_001_object; purchase: switch_slope_aware_001_purchase; tile_check: return(CB_RESULT_LOCATION_ALLOW); additional_text: switch_add_text_slope_aware_001; } } /* slope_greyrock */ //spritesets with 4 views, SNOW-version and the PURCHASE-menu spriteset (spriteset_slope_greyrock_001_a) { template_slopeaware(0,0,"gfx/slope_greyrock_001_a.png") } spriteset (spriteset_slope_greyrock_001_a_SNOW) { template_slopeaware(0,0,"gfx/slope_greyrock_001_a_SNOW.png") } spriteset (spriteset_slope_greyrock_001_b) { template_slopeaware(0,0,"gfx/slope_greyrock_001_b.png") } spriteset (spriteset_slope_greyrock_001_b_SNOW) { template_slopeaware(0,0,"gfx/slope_greyrock_001_b_SNOW.png") } spriteset (spriteset_slope_greyrock_001_c) { template_slopeaware(0,0,"gfx/slope_greyrock_001_c.png") } spriteset (spriteset_slope_greyrock_001_c_SNOW) { template_slopeaware(0,0,"gfx/slope_greyrock_001_c_SNOW.png") } spriteset (spriteset_slope_greyrock_001_d) { template_slopeaware(0,0,"gfx/slope_greyrock_001_d.png") } spriteset (spriteset_slope_greyrock_001_d_SNOW) { template_slopeaware(0,0,"gfx/slope_greyrock_001_d_SNOW.png") } spriteset (spriteset_slope_greyrock_001_PURCHASE) { template_slopeaware_purchase(0,0,"gfx/slope_greyrock_001_PURCHASE.png") } /* spritelayouts */ //View_a spritelayout spritelayout_slope_greyrock_001_a { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_greyrock_001_a(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_greyrock_001_a_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_b spritelayout spritelayout_slope_greyrock_001_b { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_greyrock_001_b(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_greyrock_001_b_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_c spritelayout spritelayout_slope_greyrock_001_c { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_greyrock_001_c(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_greyrock_001_c_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_d spritelayout spritelayout_slope_greyrock_001_d { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_slope_greyrock_001_d(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_slope_greyrock_001_d_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //decide spritelayout for each of the view switch (FEAT_OBJECTS, SELF, switch_slope_greyrock_001_view, view) { 1: spritelayout_slope_greyrock_001_b; 2: spritelayout_slope_greyrock_001_c; 3: spritelayout_slope_greyrock_001_d; spritelayout_slope_greyrock_001_a; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_slope_greyrock_001_object, [ STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP( (nearby_tile_terrain_type(0,0) == TILETYPE_DESERT) * GROUNDSPRITE_DESERT, 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 1, 0) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type(-1, 0) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0, 1) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0,-1) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_slope_greyrock_001_view; } spritelayout spritelayout_slope_greyrock_001_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_greyrock_001_PURCHASE(0); } } spritelayout spritelayout_slope_greyrock_001_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_greyrock_001_PURCHASE(1); } } spritelayout spritelayout_slope_greyrock_001_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_greyrock_001_PURCHASE(2); } } spritelayout spritelayout_slope_greyrock_001_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_slope_greyrock_001_PURCHASE(3); } } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_slope_greyrock_001_purchase, view) { 1: spritelayout_slope_greyrock_001_2_purchase; 2: spritelayout_slope_greyrock_001_3_purchase; 3: spritelayout_slope_greyrock_001_4_purchase; spritelayout_slope_greyrock_001_1_purchase; } switch (FEAT_OBJECTS, SELF, switch_add_text_slope_greyrock_001, view) { 1: string(STR_slope_greyrock_001_purchase_view2); 2: string(STR_slope_greyrock_001_purchase_view3); 3: string(STR_slope_greyrock_001_purchase_view4); default: string(STR_slope_greyrock_001_purchase_view1); } item (FEAT_OBJECTS, slope_greyrock_001, 005) { property { class: "SA04"; classname: string(STR_SA04); name: string(STR_slope_greyrock_001); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 0; remove_cost_multiplier: 0; introduction_date: date(1700,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_slope_greyrock_001_object; purchase: switch_slope_greyrock_001_purchase; tile_check: return(CB_RESULT_LOCATION_ALLOW); additional_text: switch_add_text_slope_greyrock_001; } } /* wheat */ //spritesets with 4 views, SNOW-version and the PURCHASE-menu spriteset (spriteset_wheat_001_a) { template_slopecrops(0,0,"gfx/wheat_001_a.png") } spriteset (spriteset_wheat_001_a_SNOW) { template_slopecrops(0,0,"gfx/wheat_001_a_SNOW.png") } spriteset (spriteset_wheat_001_b) { template_slopecrops(0,0,"gfx/wheat_001_b.png") } spriteset (spriteset_wheat_001_b_SNOW) { template_slopecrops(0,0,"gfx/wheat_001_b_SNOW.png") } spriteset (spriteset_wheat_001_c) { template_slopecrops(0,0,"gfx/wheat_001_c.png") } spriteset (spriteset_wheat_001_c_SNOW) { template_slopecrops(0,0,"gfx/wheat_001_c_SNOW.png") } spriteset (spriteset_wheat_001_d) { template_slopecrops(0,0,"gfx/wheat_001_d.png") } spriteset (spriteset_wheat_001_d_SNOW) { template_slopecrops(0,0,"gfx/wheat_001_d_SNOW.png") } spriteset (spriteset_wheat_001_PURCHASE) { template_slopeaware_purchase(0,0,"gfx/wheat_001_PURCHASE.png") } /* spritelayouts */ //View_a spritelayout spritelayout_wheat_001_a { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_wheat_001_a(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_wheat_001_a_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_b spritelayout spritelayout_wheat_001_b { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_wheat_001_b(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_wheat_001_b_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_c spritelayout spritelayout_wheat_001_c { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_wheat_001_c(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_wheat_001_c_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //View_d spritelayout spritelayout_wheat_001_d { ground { // normal ground sprite - always draw sprite: LOAD_TEMP(0) + LOAD_TEMP(1) + slope_to_sprite_offset(nearby_tile_slope(0, 0)); } childsprite { sprite: spriteset_wheat_001_d(slope_to_sprite_offset(nearby_tile_slope(0, 0))); } childsprite { sprite: spriteset_wheat_001_d_SNOW(slope_to_sprite_offset(nearby_tile_slope(0, 0))); hide_sprite: nearby_tile_height(0, 0) < snowline_height; } } //decide spritelayout for each of the view switch (FEAT_OBJECTS, SELF, switch_wheat_001_view, view) { 1: spritelayout_wheat_001_b; 2: spritelayout_wheat_001_c; 3: spritelayout_wheat_001_d; spritelayout_wheat_001_a; } //calculate ground sprite for object switch (FEAT_OBJECTS, SELF, switch_wheat_001_object, [ STORE_TEMP(GROUNDSPRITE_NORMAL, 1), STORE_TEMP( (nearby_tile_terrain_type(0,0) == TILETYPE_DESERT) * GROUNDSPRITE_DESERT, 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 1, 0) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type(-1, 0) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0, 1) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * 4512 * (nearby_tile_terrain_type( 0,-1) == TILETYPE_DESERT), 1), STORE_TEMP( LOAD_TEMP(1) + (LOAD_TEMP(1) == 0) * GROUNDSPRITE_NORMAL, 1), STORE_TEMP(terrain_type == TILETYPE_SNOW ? GROUNDSPRITE_SNOW : LOAD_TEMP(1), 1), STORE_TEMP(snowline_height == 0xFF ? 0xFF : nearby_tile_height(0,0) - snowline_height, 255), STORE_TEMP((LOAD_TEMP(255) == -1) ? GROUNDSPRITE_SNOW_1_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 0) ? GROUNDSPRITE_SNOW_2_4 : LOAD_TEMP(1), 1), STORE_TEMP((LOAD_TEMP(255) == 1) ? GROUNDSPRITE_SNOW_3_4 : LOAD_TEMP(1), 1) ]) { switch_wheat_001_view; } spritelayout spritelayout_wheat_001_1_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_wheat_001_PURCHASE(0); } } spritelayout spritelayout_wheat_001_2_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_wheat_001_PURCHASE(1); } } spritelayout spritelayout_wheat_001_3_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_wheat_001_PURCHASE(2); } } spritelayout spritelayout_wheat_001_4_purchase { ground { sprite: GROUNDSPRITE_NORMAL; } building { sprite: spriteset_wheat_001_PURCHASE(3); } } //calculate ground sprite for purchase menu switch (FEAT_OBJECTS, SELF, switch_wheat_001_purchase, view) { 1: spritelayout_wheat_001_2_purchase; 2: spritelayout_wheat_001_3_purchase; 3: spritelayout_wheat_001_4_purchase; spritelayout_wheat_001_1_purchase; } switch (FEAT_OBJECTS, SELF, switch_add_text_wheat_001, view) { 1: string(STR_wheat_001_purchase_view2); 2: string(STR_wheat_001_purchase_view3); 3: string(STR_wheat_001_purchase_view4); default: string(STR_wheat_001_purchase_view1); } item (FEAT_OBJECTS, wheat_001, 100) { property { class: "CROP"; classname: string(STR_CROP); name: string(STR_wheat_001); climates_available: ALL_CLIMATES; size: [1,1]; build_cost_multiplier: 0; remove_cost_multiplier: 0; introduction_date: date(1700,1,1); end_of_life_date: 0xFFFFFFFF; object_flags: bitmask(OBJ_FLAG_NO_FOUNDATIONS, OBJ_FLAG_ALLOW_BRIDGE, OBJ_FLAG_ANYTHING_REMOVE, OBJ_FLAG_REMOVE_IS_INCOME); height: 0; num_views: 4; } graphics { default: switch_wheat_001_object; purchase: switch_wheat_001_purchase; tile_check: return(CB_RESULT_LOCATION_ALLOW); additional_text: switch_add_text_wheat_001; } } /* END */