Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // TEST LOADER FOR ADDITIONAL PNG COLOURS
- #include "BasePNGLoader.as";
- #include "WARPNGLoader.as";
- const SColor color_stone_door_blue(255, 80, 90, 160);
- const SColor color_stone_door_red(255, 160, 90, 80);
- const SColor color_stone_door_noteam(255, 160, 160, 160);
- const SColor color_ladder_vert(255, 150, 110, 30);
- //const SColor color_ladder_hor(255, 150, 110, 30);
- const SColor color_trap_block_blue(255, 0, 0, 100);
- const SColor color_trap_block_red(255, 100, 0, 0);
- const SColor color_trap_block_noteam(255, 126, 204, 102);
- const SColor color_workbench(255, 0, 255, 0);
- const SColor color_storage_blue(255, 217, 255, 239);
- const SColor color_storage_red(255, 217, 255, 239);
- const SColor color_storage_noteam(255, 217, 255, 239);
- const SColor color_barracks_blue(255, 217, 218, 255);
- const SColor color_barracks_red(255, 217, 218, 255);
- const SColor color_barracks_noteam(255, 217, 218, 255);
- const SColor color_drill(255, 210, 120, 0);
- const SColor color_factory(255, 255, 217, 237);
- const SColor color_flowers(255, 255, 102, 255);
- const SColor color_rubble(255, 153, 51, 153);
- const SColor color_mossy(255, 0, 153, 153);
- const SColor color_mossy_wall(255, 0, 51, 51);
- const SColor color_campfire(255, 255, 51, 51);
- const SColor color_sign(255, 196, 207, 161);
- const SColor color_kitchen(255, 255, 217, 217);
- const SColor color_nursery(255, 217, 255, 223);
- const SColor color_quarters(255, 240, 217, 255);
- const SColor color_tunnel_blue(255, 243, 217, 254);
- const SColor color_tunnel_red(255, 243, 217, 254);
- const SColor color_tunnel_noteam(255, 243, 217, 254);
- const SColor color_bat(255, 34, 39, 96);
- const SColor color_chicken(255, 148, 27, 27);
- const SColor color_ruin(255, 34, 51, 0);
- const SColor color_tent(255, 0, 14, 51);
- const SColor color_chest(255, 255, 201, 0);
- const SColor color_crate(255, 102, 0, 0);
- const SColor color_heart(255, r, g, b);
- const SColor color_longboat_blue(255, 0, 51, 255);
- const SColor color_longboat_red(255, 0, 51, 255);
- const SColor color_longboat_noteam(255, 0, 51, 255);
- const SColor color_warboat_blue(255, 50, 140, 255);
- const SColor color_warboat_red(255, 50, 140, 255);
- const SColor color_warboat_noteam(255, 50, 140, 255);
- const SColor color_dinghy_blue(255, 90, 160, 255);
- const SColor color_dinghy_red(255, 90, 160, 255);
- const SColor color_dinghy_noteam(255, 90, 160, 255);
- const SColor color_bucket(255, 255, 220, 120);
- const SColor color_platform_up(255, 153, 0, 51);
- const SColor color_platform_down(255, 153, 2, 51);
- const SColor color_platform_left(255, 153, 3, 51);
- const SColor color_platform_right(255, 153, 1, 51);
- /*const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);
- const SColor color_x(255, r, g, b);*/
- //the loader
- class TestPNGLoader : PNGLoader
- {
- TestPNGLoader()
- {
- //super();
- //scrolls_Setup();
- //add missing offset arrays
- int count = war_offsets_count - offsets_count;
- while (count --> 0)
- {
- offsets.push_back(array<int>(0));
- }
- }
- //override this to extend functionality per-pixel.
- void handlePixel(SColor pixel, int offset)
- {
- PNGLoader::handlePixel(pixel, offset);
- //ADDON PIXEL LOADDERS
- if (pixel == color_stone_door_blue)
- {
- spawnBlob( map, "stone_door", offset, 0, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_stone_door_red)
- {
- spawnBlob( map, "stone_door", offset, 1, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_stone_door_noteam)
- {
- spawnBlob( map, "stone_door", offset, 255, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_trap_block_blue)
- {
- spawnBlob( map, "trap_block", offset, 0, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_trap_block_red)
- {
- spawnBlob( map, "trap_block", offset, 1, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_trap_block_noteam)
- {
- spawnBlob( map, "trap_block", offset, 255, true );
- offsets[autotile_offset].push_back( offset );
- }
- /*else if (pixel == color_platform_up)
- {
- spawnBlob( map, "wooden_platform", offset, -1, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_platform_down)
- {
- spawnBlob( map, "wooden_platform", offset, -1, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_platform_left)
- {
- spawnBlob( map, "wooden_platform", offset, -1, true );
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_platform_right)
- {
- spawnBlob( map, "wooden_platform", offset, -1, true );
- offsets[autotile_offset].push_back( offset );
- }*/
- else if (pixel == color_ladder_vert)
- {
- spawnBlob( map, "ladder", offset, -1, true);
- offsets[autotile_offset].push_back( offset );
- }
- /*else if (pixel == color_ladder_hor)
- {
- spawnBlob( map, "ladder", offset, -1, true);
- offsets[autotile_offset].push_back( offset );
- }*/
- else if (pixel == color_workbench)
- {
- CBlob@ workbench = server_CreateBlobNoInit( "workbench" );
- if (workbench !is null)
- {
- workbench.setPosition( map.getTileWorldPosition(offset));
- workbench.Init();
- }
- }
- else if (pixel == color_storage_blue)
- {
- spawnBlob( map, "storage", offset, 0);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_storage_red)
- {
- spawnBlob( map, "storage", offset, 1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_storage_noteam)
- {
- spawnBlob( map, "storage", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_barracks_blue)
- {
- spawnBlob( map, "barracks", offset, 0);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_barracks_red)
- {
- spawnBlob( map, "barracks", offset, 1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_barracks_noteam)
- {
- spawnBlob( map, "barracks", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_drill)
- {
- spawnBlob( map, "drill", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_factory_blue)
- {
- spawnBlob( map, "factory", offset, 0);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_factory_red)
- {
- spawnBlob( map, "factory", offset, 1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_factory_noteam)
- {
- spawnBlob( map, "factory", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- }
- //override this to add post-load offset types.
- void handleOffset(int type, int offset, int position, int count)
- {
- PNGLoader::handleOffset(type, offset, position, count);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment