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

« back to all changes in this revision

Viewing changes to data/script/text/cam2daynight.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 Cam2 (Urban)
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
 
        setCampaignNumber(2);
21
 
        setBackgroundFog(TRUE);                 //set fog on
22
 
        setDepthFog(TRUE);
23
 
        setFogColour(Rstart, Gstart, Bstart);           //set fog to start colour
24
 
        Rdiff = Rstart - Rend;
25
 
        Gdiff = Gstart - Gend;
26
 
        Bdiff = Bstart - Bend;
27
 
        playIngameCDAudio();
28
 
        setEventTrigger(startup, inactive);
29
 
}
30
 
 
31
 
event changeFog(delayTrig)
32
 
{
33
 
        Rnow = Rstart - (count * Rdiff / Steps);
34
 
        Gnow = Gstart - (count * Gdiff / Steps);
35
 
        Bnow = Bstart - (count * Bdiff / Steps);
36
 
        setFogColour(Rnow, Gnow, Bnow);
37
 
        count = count + 1;
38
 
        if (count > Steps)
39
 
        {
40
 
        //stop change
41
 
                count = 0;
42
 
                setEventTrigger(changeFog, inactive);
43
 
        }
44
 
}
45
 
 
46
 
//Weather effects need adding!
47
 
event weatherStart(startTrig)
48
 
{
49
 
        if (random(10)< 5)
50
 
        {
51
 
                setRain(TRUE);
52
 
                setEventTrigger(weatherStop, stopTrig);
53
 
                setEventTrigger(weatherStart, inactive);
54
 
        }
55
 
}
56
 
 
57
 
event weatherStop(inactive)
58
 
{
59
 
        if (random(10)< 4)
60
 
        {
61
 
                setRain(FALSE);
62
 
                setEventTrigger(weatherStart, startTrig);
63
 
                setEventTrigger(weatherStop, inactive);
64
 
        }
65
 
}