switch (FEAT_TRAINS, SELF, unicorn_resting_cost2, [ var[0xB4, 0, 0xFFFF] ]) { 0: return 100; // cost when waiting for no reason 1..30: return 50; // cost when driving very slow/accelerating/beaking default: return 0; // normal operation } switch (FEAT_TRAINS, SELF, unicorn_resting_cost, [ var[0x8A, 0, 0x0F] | (var[0xB2, 1, 0x01] << 4) ]) { 0x02: return 10; // cost when vehicle is loading/unloading 0x10..0x1F: return 10; // cost when vehicle is stopped default: unicorn_resting_cost2; } item(...) { ... graphics { running_cost_factor: unicorn_resting_cost; } }