fix other script usages of SimFlight

install-platforms
Maikel de Vries 2018-01-19 13:22:11 +01:00
parent 92aba45914
commit 0bac4579ef
2 changed files with 5 additions and 20 deletions

View File

@ -378,12 +378,12 @@ private func RainDrop()
{
var x = RandomX(-wdt, wdt);
var y = RandomX(-hgt, hgt);
var xdir = RandomX(GetWind(0,0,1)-5, GetWind(0,0,1)+5)/5;
var xdir = RandomX(GetWind(0, 0, true) - 5, GetWind(0, 0, true) + 5) / 5;
var ydir = 30;
if (!GBackSky(x, y))
continue;
if(mat == "Ice")
if (mat == "Ice")
{
// Ice (-> hail) falls faster.
xdir *= 4;
@ -391,7 +391,7 @@ private func RainDrop()
}
// Snow is special.
if(mat == "Snow")
if (mat == "Snow")
{
CreateParticle("RaindropSnow", x, y, xdir, 10, PV_Random(2000, 3000), particle_cache.snow, 0);
if (!i && rain_inserts_mat)
@ -400,14 +400,14 @@ private func RainDrop()
}
var particle = new particle_cache.rain {};
if(Random(2))
if (Random(2))
particle.Attach = ATTACH_Back;
CreateParticle(particle_name, x, y, xdir, ydir, PV_Random(200, 300), particle, 0);
// Splash.
if (!i)
{
var hit = SimFlight(x, y, xdir, ydir, 25 /* Liquid */, nil, nil, 3);
var hit = SimFlight(x, y, xdir, ydir, C4M_Liquid);
var x_final = hit[0], y_final = hit[1], time_passed = hit[4];
if (time_passed > 0)
{

View File

@ -207,21 +207,6 @@ func GetRelativeVelocity(pObject1, pObject2)
return b;
}
func GetJumpLength(pClonk)
{
if(!pClonk->~IsJumping()) return 0;
var x = pClonk->GetX(), y = pClonk->GetY(), xDir = pClonk->GetXDir(), yDir = pClonk->GetYDir();
//crash! var l=SimFlight(x, y, xDir, yDir, 0, 0, 100, 0); //SimFlight behavior changed (10/1/10)
var l=0;
if(!l) return 50;
else
{
// not a very good approximation. I really think SimFlight should return the number of iterations
return Sqrt((x - pClonk->GetX()) ** 2 + (y - pClonk->GetY()) ** 2);
}
}
func ApplyShieldFactor(pFrom, pTo, damage)
{
// totally prevent the strike?