Reduce rain in Goldrush

Oh and yes Ringwall don't mess up the clean scripts I wrote and read the code style guidelines
Maikel de Vries 2012-10-20 13:54:00 +02:00
parent 17a17c0df9
commit 70b63f6765
2 changed files with 23 additions and 18 deletions

View File

@ -47,14 +47,15 @@ protected func Initialize()
SetComDir(COMD_None); SetComDir(COMD_None);
SetPhase(RandomX(1,16)); SetPhase(RandomX(1,16));
//Push low flying clouds up to proper height // Push low flying clouds up to proper height
while(MaterialDepthCheck(GetX(),GetY(),"Sky",150)!=true) while (MaterialDepthCheck(GetX(), GetY(), "Sky", 150) != true)
{ {
SetPosition(GetX(),GetY()-1); SetPosition(GetX(), GetY()-1);
} }
//Failsafe for stupid grounded clouds // Failsafe for stupid grounded clouds
if (GetMaterial(0,30)!=Material("Sky")) SetPosition(GetX(), GetY()-180); if (GetMaterial(0, 30) != Material("Sky"))
SetPosition(GetX(), GetY() - 180);
// Add effect to process all cloud features. // Add effect to process all cloud features.
AddEffect("ProcessCloud", this, 100, 5, this); AddEffect("ProcessCloud", this, 100, 5, this);
@ -280,29 +281,33 @@ protected func Evaporation()
//Shades the clouds based on iSize: the water density value of the cloud. //Shades the clouds based on iSize: the water density value of the cloud.
private func ShadeCloud() private func ShadeCloud()
{ {
var cloudAlpha = Min((rain+50)*425/1000, 255); var cloud_alpha = Min((rain+50)*425/1000, 255);
if(rain > 600) cloudAlpha = 255; if (rain > 600)
cloud_alpha = 255;
//from RequestAlpha function // From RequestAlpha function
if(requestAlpha != nil){ if (request_alpha != nil)
cloudAlpha = cloudAlpha - (255 - requestAlpha); {
if(cloudAlpha < 0) cloudAlpha = 0; cloud_alpha = cloud_alpha - (255 - request_alpha);
if (cloud_alpha < 0)
cloud_alpha = 0;
} }
var shade2 = Min(rain-600, 255); var shade2 = Min(rain-600, 255);
if (rain <= 600) if (rain <= 600)
SetObjAlpha(cloudAlpha); SetObjAlpha(cloud_alpha);
if (rain > 600) if (rain > 600)
SetClrModulation(RGBa(255-shade2, 255-shade2, 255-shade2, cloudAlpha)); SetClrModulation(RGBa(255-shade2, 255-shade2, 255-shade2, cloud_alpha));
return; return;
} }
//Utilized by time to make clouds invisible at night // Utilized by time to make clouds invisible at night
local requestAlpha; local request_alpha;
public func RequestAlpha(int alpha){ public func RequestAlpha(int alpha)
requestAlpha = alpha; {
request_alpha = alpha;
} }
local ActMap = { local ActMap = {

View File

@ -22,7 +22,7 @@ protected func Initialize()
// Set time of day to evening and create some clouds and celestials. // Set time of day to evening and create some clouds and celestials.
Cloud->Place(10); Cloud->Place(10);
Cloud->SetPrecipitation("Water", 15); Cloud->SetPrecipitation("Water", 8);
CreateObject(Environment_Celestial); CreateObject(Environment_Celestial);
var time = CreateObject(Environment_Time); var time = CreateObject(Environment_Time);
time->SetTime(600); time->SetTime(600);