实体

时间天气 CClock / CWeather / CWeaponInfo

全局时钟、天气与武器表

全局游戏态。改全局表要备份还原,别每帧无脑写。

锁定游戏时钟

CClock::ms_nGameClockHours / SetGameClock

冻时间每帧写回;或用 SetGameClock / StoreClock / RestoreClock

static unsigned char& ms_nGameClockHours;
static unsigned char& ms_nGameClockMinutes;
static unsigned short& ms_nGameClockSeconds;
static void SetGameClock(unsigned char hours, unsigned char minutes, unsigned char day);
static void StoreClock();
static void RestoreClock();
static bool GetIsTimeInRange(unsigned char hourA, unsigned char hourB);

强制天气

CWeather::ForceWeather / ForceWeatherNow

也可用 Command FORCE_WEATHER

static void ForceWeather(short weatherType);
static void ForceWeatherNow(short weatherType);
static void ReleaseWeather();
static short& ForcedWeatherType;
static short& NewWeatherType;
static short& OldWeatherType;

读当前天气强度

Rain / Sandstorm / Wind / Foggyness
static float& Rain;
static float& Sandstorm;
static float& Wind;
static CVector& WindDir;
static float& Foggyness;
static float& WetRoads;
static float& InterpolationValue;

预报天气

ForecastWeather / SetWeatherToAppropriateTypeNow
static bool ForecastWeather(int weatherType, int numSteps);
static void SetWeatherToAppropriateTypeNow();

改武器全局参数

CWeaponInfo::GetWeaponInfo

改的是全局表。实例弹药见 CWeapon

static CWeaponInfo* GetWeaponInfo(eWeaponType weaponType, unsigned char skill = 0);
static eWeaponType FindWeaponType(char* name);
extern CWeaponInfo* aWeaponInfo;

Command 写法:

plugin::Command<plugin::Commands::FORCE_WEATHER>(weather_id);

On this page