/src/game/landscape/C4Weather.h
C Header | 64 lines | 40 code | 5 blank | 19 comment | 0 complexity | 81d4dcb9c4c5a0dd0ba1bc86709e46a2 MD5 | raw file
Possible License(s): WTFPL, 0BSD, LGPL-2.1, CC-BY-3.0
1/*
2 * OpenClonk, http://www.openclonk.org
3 *
4 * Copyright (c) 1998-2000 Matthes Bender
5 * Copyright (c) 2001, 2005 Sven Eberhardt
6 * Copyright (c) 2001-2009, RedWolf Design GmbH, http://www.clonk.de
7 *
8 * Portions might be copyrighted by other authors who have contributed
9 * to OpenClonk.
10 *
11 * Permission to use, copy, modify, and/or distribute this software for any
12 * purpose with or without fee is hereby granted, provided that the above
13 * copyright notice and this permission notice appear in all copies.
14 * See isc_license.txt for full license and disclaimer.
15 *
16 * "Clonk" is a registered trademark of Matthes Bender.
17 * See clonk_trademark_license.txt for full license.
18 */
19
20/* Controls temperature, wind, and natural disasters */
21
22#ifndef INC_C4Weather
23#define INC_C4Weather
24
25#include <C4Landscape.h>
26class C4Weather
27 {
28 public:
29 C4Weather();
30 ~C4Weather();
31 public:
32 int32_t Season,YearSpeed,SeasonDelay;
33 int32_t Wind,TargetWind;
34 int32_t Temperature,TemperatureRange,Climate;
35 int32_t MeteoriteLevel,VolcanoLevel,EarthquakeLevel,LightningLevel;
36 int32_t NoGamma;
37 public:
38 void Default();
39 void Clear();
40 void Execute();
41 void SetClimate(int32_t iClimate);
42 void SetSeason(int32_t iSeason);
43 void SetTemperature(int32_t iTemperature);
44 void Init(bool fScenario);
45 void SetWind(int32_t iWind);
46 int32_t GetWind(int32_t x, int32_t y);
47 int32_t GetTemperature();
48 int32_t GetSeason();
49 int32_t GetClimate();
50 bool LaunchLightning(int32_t x, int32_t y, int32_t xdir, int32_t xrange, int32_t ydir, int32_t yrange, bool fDoGamma);
51 bool LaunchVolcano(int32_t mat, int32_t x, int32_t y, int32_t size);
52 bool LaunchEarthquake(int32_t iX, int32_t iY);
53 bool LaunchCloud(int32_t iX, int32_t iY, int32_t iWidth, int32_t iStrength, const char *szPrecipitation);
54 void SetSeasonGamma(); // set gamma adjustment for season
55 void CompileFunc(StdCompiler *pComp);
56 };
57extern C4Weather Weather;
58
59inline int32_t GBackWind(int32_t x, int32_t y)
60 {
61 return GBackIFT(x, y) ? 0: ::Weather.Wind;
62 }
63
64#endif