Planeshift

pssectorinfo.h

Go to the documentation of this file.
00001 /*
00002  * pssectorinfo.h
00003  *
00004  * Copyright (C) 2001 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 
00020 
00021 
00022 #ifndef __PSSECTORINFO_H__
00023 #define __PSSECTORINFO_H__
00024 //=============================================================================
00025 // Crystal Space Includes
00026 //=============================================================================
00027 #include <csutil/csstring.h>
00028 #include <csgeom/vector3.h>
00029 #include "util/scriptvar.h"
00030 
00031 //=============================================================================
00032 // Project Includes
00033 //=============================================================================
00034 
00035 #include "net/messages.h"
00036 
00037 //=============================================================================
00038 // Local Includes
00039 //=============================================================================
00040 
00041 
00050 class psSectorInfo : public iScriptableVar
00051 {
00052 public:
00053     psSectorInfo();
00054     ~psSectorInfo();
00055 
00057     double GetProperty(MathEnvironment* env, const char* ptr);
00059     double CalcFunction(MathEnvironment* env, const char* functionName, const double* params);
00060     const char* ToString()
00061     {
00062         return name.GetDataSafe();
00063     }
00064 
00065     bool GetIsColliding()
00066     {
00067         return is_colliding;
00068     }
00069     bool GetIsNonTransient()
00070     {
00071         return is_non_transient;
00072     }
00079     bool GetIsTeleporting()
00080     {
00081         return is_teleporting;
00082     }
00087     bool GetHasPenalty()
00088     {
00089         return has_penalty;
00090     }
00091 
00096     bool GetDeathRestoreHP()
00097     {
00098         return deathRestoreHP;
00099     }
00100 
00105     bool GetDeathRestoreMana()
00106     {
00107         return deathRestoreMana;
00108     }
00109 
00113     csString GetTeleportingSector()
00114     {
00115         return teleportingSector;
00116     }
00120     csVector3 GetTeleportingCord()
00121     {
00122         return teleportingCords;
00123     }
00127     float GetTeleportingRot()
00128     {
00129         return teleportingRot;
00130     }
00131 
00135     csString GetDeathSector()
00136     {
00137         return deathSector;
00138     }
00142     csVector3 GetDeathCord()
00143     {
00144         return deathCords;
00145     }
00149     float GetDeathRot()
00150     {
00151         return deathRot;
00152     }
00153 
00154     unsigned int uid;
00155     csString  name;
00156 
00157 
00159     struct weatherTypeData
00160     {
00161         bool enabled;  
00162         unsigned int min_gap; 
00163         unsigned int max_gap; 
00164         unsigned int min_duration; 
00165         unsigned int max_duration;  
00166         unsigned int min_density; 
00167         unsigned int max_density;
00168         unsigned int min_fade_in; 
00169         unsigned int max_fade_in; 
00170         unsigned int min_fade_out; 
00171         unsigned int max_fade_out; 
00172     };
00173 
00175     csHash<weatherTypeData, unsigned int> weatherData;
00176 
00181     void SetWeatherEnabled(unsigned int id, bool newStatus);
00182 
00187     bool GetWeatherEnabled(unsigned int id);
00188 
00193     unsigned int GetRandomWeatherGap(unsigned int id);
00194 
00199     unsigned int GetRandomWeatherDuration(unsigned int id);
00200 
00205     unsigned int GetRandomWeatherDensity(unsigned int id);
00206 
00211     unsigned int GetRandomWeatherFadeIn(unsigned int id);
00212 
00217     unsigned int GetRandomWeatherFadeOut(unsigned int id);
00218 
00223     void AddWeatherTypeData(weatherTypeData newWeatherData, unsigned int id);
00224 
00225     unsigned int current_rain_drops; 
00226 
00227     bool is_raining;
00228     bool is_snowing;
00229     bool is_colliding;
00230     bool is_non_transient;
00231 
00233     bool deathRestoreMana;
00235     bool deathRestoreHP;
00236 
00238     bool is_teleporting;
00240     bool has_penalty;
00242     csString teleportingSector;
00244     csVector3 teleportingCords;
00246     float teleportingRot;
00248     csString deathSector;
00250     csVector3 deathCords;
00252     float deathRot;
00253 
00254 
00255 
00256     // Fog
00257     unsigned int fog_density, fog_density_old;
00258     bool densitySaved;
00259     unsigned int fogFade;
00260     int r,g,b;
00261 
00262     float say_range;
00263 
00264     csString god_name;
00265 };
00266 
00267 
00268 
00269 #endif
00270 
00271