)
(scripttrigger
(script "Tux.deactivate();
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
-wait(0.1);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
-wait(0.2);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
+play_music(\"music/ghostforest.ogg\");
wait(1);
-play_sound(\"sounds/brick.wav\");
-wait(0.2);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
-wait(0.1);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_out(0.5);
+thunder1.lightning();
wait(1);
+thunder1.lightning();
+wait(0.33);
+thunder1.lightning();
play_sound(\"sounds/warp.wav\");
Tux.activate();
Level.spawn(\"ghostforest\", \"main\");
(x 2016)
(y 0)
)
+ (thunderstorm
+ (name "thunder1")
+ (running #f)
+ )
)
(sector
(name "ghostforest")
)
(scripttrigger
(script "Tux.deactivate();
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
-wait(0.1);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
-wait(0.2);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
-wait(1);
-play_sound(\"sounds/brick.wav\");
-wait(0.2);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_in(0.2);
-wait(0.1);
-play_sound(\"sounds/brick.wav\");
-Effect.fade_out(0.5);
-wait(1);
+thunder2.lightning();
+wait(0.66);
+thunder2.thunder();
+wait(0.3);
+thunder2.lightning();
play_sound(\"sounds/warp.wav\");
Tux.activate();
Level.spawn(\"main\", \"back\");
(x 6848)
(y 0)
)
+ (thunderstorm
+ (name "thunder2")
+ (running #f)
+ )
)
)
Thunderstorm::expose(HSQUIRRELVM vm, SQInteger table_idx)
{
if (name == "") return;
- Scripting::Thunderstorm* interface = static_cast<Scripting::Thunderstorm*>(this);
+ Scripting::Thunderstorm* interface = new Scripting::Thunderstorm(this);
expose_object(vm, table_idx, interface, name, true);
}
/**
* Thunderstorm scriptable GameObject; plays thunder, lightning and electrifies water at regular interval
*/
-class Thunderstorm : public GameObject, public Scripting::Thunderstorm, public ScriptInterface
+class Thunderstorm : public GameObject, public ScriptInterface
{
public:
Thunderstorm(const lisp::Lisp& reader);
#ifndef __SCRIPTING_THUNDERSTORM_H__
#define __SCRIPTING_THUNDERSTORM_H__
+#ifndef SCRIPTING_API
+class Thunderstorm;
+typedef Thunderstorm _Thunderstorm;
+#endif
+
namespace Scripting
{
{
public:
#ifndef SCRIPTING_API
- virtual ~Thunderstorm()
- {}
+ Thunderstorm(_Thunderstorm* thunderstorm);
+ ~Thunderstorm();
#endif
/**
* Start playing thunder and lightning at configured interval
*/
- virtual void start() = 0;
+ void start();
/**
* Stop playing thunder and lightning at configured interval
*/
- virtual void stop() = 0;
+ void stop();
/**
* Play thunder
*/
- virtual void thunder() = 0;
+ void thunder();
/**
* Play lightning, i.e. call flash() and electrify()
*/
- virtual void lightning() = 0;
+ void lightning();
/**
* Display a nice flash
*/
- virtual void flash() = 0;
+ void flash();
/**
* Electrify water throughout the whole sector for a short time
*/
- virtual void electrify() = 0;
-
+ void electrify();
+#ifndef SCRIPTING_API
+ _Thunderstorm* thunderstorm;
+#endif
};
}