#include <acknex.h>
#include <default.c>
BMAP* SchneeBmap = "Snow.tga";
BMAP* laser_farbe6 = "Raindrop.tga";
var RegenAnzahlPartikel = 3;
var SchneeAnzahlPartikel = 10;
var schneeout = 0;
var rainout = 0;
VECTOR* pPos = {x=0; y=0; z=0;}
VECTOR* windspeed = {x=0; y=0; z=0;}
function Schnee_spec_fun(PARTICLE* p)
{
if(p.z < (camera.z-500))
{
p.alpha -= 10*time_step;
if(p.alpha <= 0)
{
p.lifespan = 0;
}
}
else
{
p.x += windspeed.x*time_step;
p.y += windspeed.y*time_step;
p.z += windspeed.z*time_step;
}
}
function Schneespezial(PARTICLE* p)
{
p.blue = 250;
p.green = 250;
p.red = 250;
p.bmap = SchneeBmap;
p.vel_x = random(2)-1;
p.vel_y = random(2)-1;
p.vel_z = -2;
p.size = 1;
p.alpha = 100;
p.lifespan = 1000;
//p.x += random(1000)-500;
//p.y += random(1000)-500;
p.z += random(100)-50;
p.flags |= TRANSLUCENT | MOVE;
p.event = Schnee_spec_fun;
}
function Regen_spec_fun(PARTICLE* p)
{
c_trace(vector(p.skill_d,p.skill_y,p.skill_z),p.x,IGNORE_PASSABLE | IGNORE_ME | IGNORE_SPRITES);
if(trace_hit == 1)
{
p.vel_x = 0;
p.vel_y = 0;
p.vel_z = 0;
p.lifespan = 0;
}
else if(p.z < (camera.z-1000))
{
p.alpha -= 10*time_step;
if(p.alpha <= 0)
{
p.lifespan = 0;
}
}
}
function Regenspezial(PARTICLE* p)
{
p.blue = 225;
p.green = 225;
p.red = 225;
p.skill_c = 0; p.skill_b = 0;
p.bmap = laser_farbe6;
p.vel_x = random( 5 ) - 2.500;
p.vel_y = random( 5 ) - 2.500;
p.vel_z = -47.125;
p.size = 3;
p.alpha = 50;
p.lifespan = 1000;
p.x += random(2000)-1000;
p.y += random(2000)-1000;
p.z += random(200)-100;
p.gravity=random(1);
p.flags |= BEAM | MOVE | TRANSLUCENT;
p.event = Regen_spec_fun;
}
function Schnee()
{
schneeout = 0;
rainout = 1;
wait(1);
while(schneeout == 0)
{
vec_set(pPos.x,vector(camera.x, camera.y, camera.z+200));
effect(Schneespezial,maxv(1,SchneeAnzahlPartikel*time_step),pPos,normal);
wait(1);
}
wait(1);
schneeout = 0;
}
function Regen()
{
rainout = 0;
schneeout = 1;
wait(1);
while(rainout == 0)
{
vec_set(pPos.x,vector(camera.x, camera.y+1000, camera.z+200));
effect(Regenspezial,maxv(1,RegenAnzahlPartikel*time_step),pPos,nullvector);
wait(1);
}
rainout = 0;
}
void main()
{
fps_max = 50;
video_mode = 8;
level_load(NULL);
wait(3);
vec_set(camera.x, vector(0,0,500));
vec_set(camera.pan, vector(90,-45,0));
while(1)
{
Schnee();
while(key_1 == 0){wait(1);}
Regen();
while(key_2 == 0){wait(1);}
wait(1);
}
}