File: ptl_weather.ufo

package info (click to toggle)
ufoai 2.5-4
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 82,128 kB
  • sloc: cpp: 225,227; python: 5,111; ansic: 4,133; php: 2,209; perl: 1,931; sh: 1,517; xml: 1,115; makefile: 401; sed: 11
file content (107 lines) | stat: -rw-r--r-- 1,449 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
// Weather particles like snow and rain.
// These particles are deactivateable via the cvar cl_particleweather

// ====================================
// snow
// ====================================

particle weather_snow
{
	init
	{
		v      "0 0 0"
		tps    7.0
		weather true
	}
	think
	{
		spawn weather_snow_flakes
	}
}

particle weather_snow_flakes
{
	init
	{
		stayalive true
		autohide true
		physics true
		image  "sfx/snow"
		blend  add
		style  facing
		thinkfade  out
		size   "3 3"
		a      "40 40 -100"

		push   *v
		rand   vector "20 20 -20"
		add    vector "3 3 3"
		mul    #
		crand  vector "15 15 -5"
		add    #
		pop    *v

		crand  vector "160 160 0"
		add    *s
		pop    *s

		rand   float 0.5
		add    float 0.1
		pop    *tps
	}
	think { kill }
}

// ====================================
// rain
// ====================================

particle weather_rain
{
	init
	{
		v      "0 0 0"
		tps    25.0
		weather true
	}
	think
	{
		spawn weather_rain_drop
	}
}

particle weather_rain_drop
{
	init
	{
		autohide true
		physics true
		image  "sfx/rain"
		blend  add
		style  facing
		thinkfade  out
		size   "3 3"
		a      "4 4 -600"

		push   *v
		rand   vector "30 30 -40"
		add    vector "3 3 3"
		mul    #
		crand  vector "15 15 -25"
		add    #
		pop    *v

		crand  vector "80 80 0"
		add    *s
		pop    *s

		rand   float 0.1
		add    float 0.2
		pop    *tps
	}
	physics
	{
		// TODO splash rain drops
	}
	think { kill }
}