2230 |
} |
} |
2231 |
|
|
2232 |
//---------------------------------------- |
//---------------------------------------- |
2233 |
|
// Switch_black |
2234 |
|
// |
2235 |
|
// Attributes: |
2236 |
|
// |
2237 |
|
// :on 1 or 0 |
2238 |
|
// :target,action as usual |
2239 |
|
//---------------------------------------- |
2240 |
|
|
2241 |
|
//On actor (black only) hit this stone can trigger actions |
2242 |
|
|
2243 |
|
namespace |
2244 |
|
{ |
2245 |
|
class Switch_black : public OnOffStone { |
2246 |
|
CLONEOBJ(Switch_black); |
2247 |
|
public: |
2248 |
|
Switch_black() : OnOffStone("st-switch_black") {} |
2249 |
|
private: |
2250 |
|
void init_model() { |
2251 |
|
set_model(is_on() ? "st-switch_black1" : "st-switch_black0"); |
2252 |
|
} |
2253 |
|
|
2254 |
|
void actor_hit(const StoneContact &sc) |
2255 |
|
|
2256 |
|
{ |
2257 |
|
if (sc.actor->get_attrib("blackball")) |
2258 |
|
set_on(!is_on()); |
2259 |
|
PerformAction(this, is_on()); |
2260 |
|
play_sound("st-switch"); |
2261 |
|
} |
2262 |
|
|
2263 |
|
const char *collision_sound() { return "st-metal"; } |
2264 |
|
}; |
2265 |
|
} |
2266 |
|
|
2267 |
|
//---------------------------------------- |
2268 |
|
// Switch_white |
2269 |
|
// |
2270 |
|
// Attributes: |
2271 |
|
// |
2272 |
|
// :on 1 or 0 |
2273 |
|
// :target,action as usual |
2274 |
|
//---------------------------------------- |
2275 |
|
|
2276 |
|
//On actor (white only) hit this stone can trigger actions |
2277 |
|
|
2278 |
|
namespace |
2279 |
|
{ |
2280 |
|
class Switch_white : public OnOffStone { |
2281 |
|
CLONEOBJ(Switch_white); |
2282 |
|
public: |
2283 |
|
Switch_white() : OnOffStone("st-switch_white") {} |
2284 |
|
private: |
2285 |
|
void init_model() { |
2286 |
|
set_model(is_on() ? "st-switch_white1" : "st-switch_white0"); |
2287 |
|
} |
2288 |
|
|
2289 |
|
void actor_hit(const StoneContact &sc) |
2290 |
|
|
2291 |
|
{ |
2292 |
|
if (sc.actor->get_attrib("whiteball")) |
2293 |
|
set_on(!is_on()); |
2294 |
|
PerformAction(this, is_on()); |
2295 |
|
play_sound("st-switch"); |
2296 |
|
} |
2297 |
|
|
2298 |
|
const char *collision_sound() { return "st-metal"; } |
2299 |
|
}; |
2300 |
|
} |
2301 |
|
|
2302 |
|
//---------------------------------------- |
2303 |
// FourSwitch |
// FourSwitch |
2304 |
// |
// |
2305 |
// Attributes: |
// Attributes: |
4094 |
add_templ(new StoneImpulseStone); |
add_templ(new StoneImpulseStone); |
4095 |
add_templ(new SwapStone); |
add_templ(new SwapStone); |
4096 |
add_templ(new SwitchStone); |
add_templ(new SwitchStone); |
4097 |
|
add_templ(new Switch_black); |
4098 |
|
add_templ(new Switch_white); |
4099 |
add_templ(new FourSwitch); |
add_templ(new FourSwitch); |
4100 |
add_templ(new LaserSwitch); |
add_templ(new LaserSwitch); |
4101 |
add_templ(new ScissorsStone); |
add_templ(new ScissorsStone); |