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_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_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_fireplace(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); //only sprites for now
- //const SColor color_chicken(255, 148, 27, 27); //only sprites for now
- 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_boulder(255, r, g, b);
- const SColor color_catapult(255, r, g, b);
- const SColor color_ballista(255, r, g, b);
- const SColor color_mounted_bow(255, r, g, b);
- const SColor color_arrows(255, r, g, b);
- const SColor color_fire_arrows(255, r, g, b);
- const SColor color_ballista_bolts(255, r, g, b);
- const SColor color_minikeg(255, r, g, b);
- const SColor color_keg(255, r, g, b);
- const SColor color_airship(255, r, g, b);
- const SColor color_gold_mat(255, r, g, b);
- const SColor color_stone_mat(255, r, g, b);
- const SColor color_wood_mat(255, r, g, b);
- const SColor color_logs(255, r, g, b);
- const SColor color_saw(255, r, g, b);
- const SColor color_migrant(255, r, g, b);
- /*const SColor color_zombie(255, r, g, b);
- const SColor color_skeleton(255, r, g, b);
- const SColor color_wraith(255, r, g, b);
- const SColor color_greg(255, r, g, b);
- const SColor color_zknght(255, r, g, b);*/
- const SColor color_steak(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 );
- }*/
- /*EXAMPLE FOR LOADING TILES:
- else if (pixel == color_x)
- {
- spawnBlob( map, "$name", offset, int, bool );
- 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 );
- }
- else if (pixel == color_flowers)
- {
- spawnBlob( map, "flowers", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_fireplace)
- {
- spawnBlob( map, "fireplace", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_sign)
- {
- spawnBlob( map, "sign", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_kitchen)
- {
- spawnBlob( map, "kitchen", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_nursery)
- {
- spawnBlob( map, "quarters", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_tunnel_blue)
- {
- spawnBlob( map, "tunnel", offset, 0);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_tunnel_red)
- {
- spawnBlob( map, "tunnel", offset, 1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_tunnel_noteam)
- {
- spawnBlob( map, "tunnel", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_ruin)
- {
- spawnBlob( map, "ruin", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_tent)
- {
- spawnBlob( map, "tent", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_chest)
- {
- spawnBlob( map, "chest", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_crate)
- {
- spawnBlob( map, "crate", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_heart)
- {
- spawnBlob( map, "heart", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_longboat_blue)
- {
- spawnBlob( map, "longboat", offset, 0);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_longboat_red)
- {
- spawnBlob( map, "longboat", offset, 1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_longboat_noteam)
- {
- spawnBlob( map, "longboat", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_warboat_blue)
- {
- spawnBlob( map, "warboat", offset, 0);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_warboat_red)
- {
- spawnBlob( map, "warboat", offset, 1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_warboat_noteam)
- {
- spawnBlob( map, "warboat", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_dinghy_blue)
- {
- spawnBlob( map, "dinghy", offset, 0);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_dinghy_red)
- {
- spawnBlob( map, "dinghy", offset, 1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_dinghy_noteam)
- {
- spawnBlob( map, "dinghy", offset, 255);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_bucket)
- {
- spawnBlob( map, "bucket", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_boulder)
- {
- spawnBlob( map, "boulder", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_catapult)
- {
- spawnBlob( map, "catapult", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_ballista)
- {
- spawnBlob( map, "ballista", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_mounted_bow)
- {
- spawnBlob( map, "mounted_bow", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- /*else if (pixel == color_arrows)
- {
- spawnBlob( map, "arrows", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_fire_arrows)
- {
- spawnBlob( map, "fire_arrows", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_ballista_bolts)
- {
- spawnBlob( map, "ballista_bolts", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }*/
- else if (pixel == color_minikeg)
- {
- spawnBlob( map, "minikeg", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_keg)
- {
- spawnBlob( map, "keg", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_airship)
- {
- spawnBlob( map, "airship", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- /*else if (pixel == color_gold_mat)
- {
- spawnBlob( map, "gold_mat", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_stone_mat)
- {
- spawnBlob( map, "stone_mat", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_wood_mat)
- {
- spawnBlob( map, "wood_mat", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }*/
- else if (pixel == color_log)
- {
- spawnBlob( map, "log", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_saw)
- {
- spawnBlob( map, "saw", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- /*else if (pixel == color_migrant)
- {
- spawnBlob( map, "migrant", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_zombie)
- {
- spawnBlob( map, "zombie", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_skeleton)
- {
- spawnBlob( map, "skeleton", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_wraith)
- {
- spawnBlob( map, "wraith", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_greg)
- {
- spawnBlob( map, "greg", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_zknight)
- {
- spawnBlob( map, "zknight", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }
- else if (pixel == color_steak)
- {
- spawnBlob( map, "steak", offset, -1);
- offsets[autotile_offset].push_back( offset );
- }*/
- /*EXAMPLE:
- else if (pixel == color_x)
- {
- spawnBlob( map, "$name", offset, int);
- 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