~ubuntu-branches/ubuntu/lucid/warzone2100/lucid

« back to all changes in this revision

Viewing changes to data/base/script/text/cam3daynight.slo

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger, Paul Wise, Christoph Egger
  • Date: 2009-06-29 17:12:52 UTC
  • mfrom: (1.1.11 upstream) (2.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090629171252-5ddnlfg3zfchrega
Tags: 2.2.1+dfsg1-1
[ Paul Wise ]
* New upstream release (Closes: #534962)
* Adjust the flex build-depends to take account of the conflict
  with all the versions of flex 2.5.34 (LP: #372872)
* Make the -music Recommends more strict, 2.1 music doesn't work
  with 2.2.
* Upstream moved the downloads to sourceforge, update the watch file
* Bump Standards-Version, no changes needed
* Drop use of dh_desktop since it no longer does anything
* Recommend the new warzone2100-video package, version 2.2 or similar
* Mention the warzone2100 crash reports in the -dbg package description

[ Christoph Egger ]
* Replace CC-2.0 graphic from cybersphinx, create a new tarball
* Add myself to uploaders

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
// Weather and day/night script for Cam3 (Rockies)
 
2
 
 
3
//daytime colour
 
4
public          int     Rstart, Gstart, Bstart;
 
5
public          int     Rend, Gend, Bend;
 
6
public          int     Steps;
 
7
private         int     count, Rdiff, Gdiff, Bdiff, Rnow, Gnow, Bnow;
 
8
 
 
9
trigger delayTrig(every, 10);   //change fog every 1 second
 
10
//weather stuff
 
11
/* Triggers */
 
12
trigger startTrig(every, 500);
 
13
trigger stopTrig(every, 1000);
 
14
 
 
15
/* Events */
 
16
event weatherStop;
 
17
 
 
18
event startup(CALL_GAMEINIT)
 
19
{
 
20
        setBackgroundFog(TRUE);                 //set fog on
 
21
        setDepthFog(TRUE);
 
22
        setFogColour(Rstart, Gstart, Bstart);           //set fog to start colour
 
23
        Rdiff = Rstart - Rend;
 
24
        Gdiff = Gstart - Gend;
 
25
        Bdiff = Bstart - Bend;
 
26
        playIngameCDAudio();
 
27
        setEventTrigger(startup, inactive);
 
28
}
 
29
 
 
30
event changeFog(delayTrig)
 
31
{
 
32
        Rnow = Rstart - (count * Rdiff / Steps);
 
33
        Gnow = Gstart - (count * Gdiff / Steps);
 
34
        Bnow = Bstart - (count * Bdiff / Steps);
 
35
        setFogColour(Rnow, Gnow, Bnow);
 
36
        count = count + 1;
 
37
        if (count > Steps)
 
38
        {
 
39
        //stop change
 
40
                count = 0;
 
41
                setEventTrigger(changeFog, inactive);
 
42
        }
 
43
}
 
44
 
 
45
//Weather effects need adding!
 
46
event weatherStart(startTrig)
 
47
{
 
48
        if (random(10)< 5)
 
49
        {
 
50
                setSnow(TRUE);
 
51
                setEventTrigger(weatherStop, stopTrig);
 
52
                setEventTrigger(weatherStart, inactive);
 
53
        }
 
54
}
 
55
 
 
56
event weatherStop(inactive)
 
57
{
 
58
        if (random(10)< 4)
 
59
        {
 
60
                setSnow(FALSE);
 
61
                setEventTrigger(weatherStart, startTrig);
 
62
                setEventTrigger(weatherStop, inactive);
 
63
        }
 
64
}