本文整理汇总了C++中SetWeather函数的典型用法代码示例。如果您正苦于以下问题:C++ SetWeather函数的具体用法?C++ SetWeather怎么用?C++ SetWeather使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了SetWeather函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ADDTOCALLSTACK
void CSector::SetWeatherChance( bool fRain, int iChance )
{
ADDTOCALLSTACK("CSector::SetWeatherChance");
// Set via the client.
// Transfer from snow to rain does not work ! must be DRY first.
if ( iChance > 100 )
iChance = 100;
if ( iChance < 0 )
{
// just set back to defaults.
SetDefaultWeatherChance();
}
else if ( fRain )
{
m_RainChance = (uchar)(iChance | LIGHT_OVERRIDE);
}
else
{
m_ColdChance = (uchar)(iChance | LIGHT_OVERRIDE);
}
// Recalc the weather immediatly.
SetWeather( GetWeatherCalc());
}
示例2: Reset
void Reset()
{
if (pInstance)
pInstance->SetData(DATA_AKILZONEVENT, NOT_STARTED);
StaticDisruption_Timer = urand(10000,20000); //10 to 20 seconds (bosskillers)
GustOfWind_Timer = urand(20000,30000); //20 to 30 seconds(bosskillers)
CallLighting_Timer = urand(10000,20000); //totaly random timer. can't find any info on this
ElectricalStorm_Timer = 60000; //60 seconds(bosskillers)
Enrage_Timer = 10*MINUTE*IN_MILLISECONDS; //10 minutes till enrage(bosskillers)
SummonEagles_Timer = 99999;
TargetGUID = 0;
CloudGUID = 0;
CycloneGUID = 0;
DespawnSummons();
for (uint8 i = 0; i < 8; ++i)
BirdGUIDs[i] = 0;
StormCount = 0;
StormSequenceTimer = 0;
isRaining = false;
SetWeather(WEATHER_STATE_FINE, 0.0f);
}
示例3: ADDTOCALLSTACK
bool CSector::r_LoadVal( CScript &s )
{
ADDTOCALLSTACK("CSector::r_LoadVal");
EXC_TRY("LoadVal");
switch ( FindTableSorted( s.GetKey(), sm_szLoadKeys, COUNTOF( sm_szLoadKeys )-1 ))
{
case SC_COLDCHANCE:
SetWeatherChance( false, s.HasArgs() ? s.GetArgVal() : -1 );
return( true );
case SC_FLAGS:
m_dwFlags = s.GetArgVal();
return true;
case SC_LIGHT:
if ( g_Cfg.m_bAllowLightOverride )
m_Env.m_Light = static_cast<BYTE>(s.GetArgVal()|LIGHT_OVERRIDE);
return true;
case SC_RAINCHANCE:
SetWeatherChance( true, s.HasArgs() ? s.GetArgVal() : -1 );
return( true );
case SC_SEASON:
SetSeason(s.HasArgs() ? static_cast<SEASON_TYPE>(s.GetArgVal()) : SEASON_Summer);
return (true);
case SC_WEATHER:
SetWeather(s.HasArgs() ? static_cast<WEATHER_TYPE>(s.GetArgVal()) : WEATHER_DRY);
return( true );
}
EXC_CATCH;
EXC_DEBUG_START;
EXC_ADD_SCRIPT;
EXC_DEBUG_END;
return false;
}
示例4: Reset
void Reset() override
{
_Reset();
Initialize();
SetWeather(WEATHER_STATE_FINE, 0.0f);
}
示例5: Sql_NumRows
void CZone::LoadZoneWeather()
{
static const int8* Query =
"SELECT "
"weather.none,"
"weather.sunshine,"
"weather.clouds,"
"weather.fog,"
"weather.hot_spell,"
"weather.heat_wave,"
"weather.rain,"
"weather.squall,"
"weather.dust_storm,"
"weather.sand_storm,"
"weather.wind,"
"weather.gales,"
"weather.snow,"
"weather.blizzards,"
"weather.thunder,"
"weather.thunder_storms,"
"weather.auroras,"
"weather.stellar_glares,"
"weather.gloom,"
"weather.darkness "
"FROM zone_weather as weather "
"WHERE zoneid = %u "
"LIMIT 1";
if (Sql_Query(SqlHandle, Query, m_zoneID) != SQL_ERROR &&
Sql_NumRows(SqlHandle) != 0 &&
Sql_NextRow(SqlHandle) == SQL_SUCCESS)
{
uint16 Frequency = 0;
for (uint8 weather = 0; weather < MAX_WEATHER_ID; ++weather)
{
m_WeatherFrequency[weather] = (uint8)Sql_GetIntData(SqlHandle,weather);
if (m_WeatherFrequency[weather] == 100)
{
m_IsWeatherStatic = true;
SetWeather((WEATHER)weather);
}
Frequency += m_WeatherFrequency[weather];
}
if (Frequency != 100)
{
//ShowWarning(CL_YELLOW"Total Weather Frequency is %u for zone %u\n" CL_RESET, Frequency, m_zoneID);
}
}
else
{
memset(&m_WeatherFrequency, 0, sizeof(m_WeatherFrequency));
ShowFatalError(CL_RED"CZone::LoadZoneWeather: Cannot load zone weather (%u)\n" CL_RESET, m_zoneID);
}
}
示例6: JustDied
void JustDied(Unit* pKiller)
{
DoScriptText(SAY_DEATH, m_creature);
SetWeather(WEATHER_STATE_FINE, 0.0f);
if (!m_pInstance)
return;
m_pInstance->SetData(TYPE_AKILZON, DONE);
}
示例7:
void CEnvironment::StopWFX ()
{
VERIFY (CurrentCycleName.size());
bWFX = false;
SetWeather (CurrentCycleName,false);
Current[0] = WFX_end_desc[0];
Current[1] = WFX_end_desc[1];
#ifdef WEATHER_LOGGING
Msg ("WFX - end. Weather: '%s' Desc: '%s'/'%s' GameTime: %3.2f",CurrentWeatherName.c_str(),Current[0]->sect_name.c_str(),Current[1]->sect_name.c_str(),fGameTime);
#endif
}
示例8: Reset
void Reset()
{
_Reset();
TargetGUID = 0;
CloudGUID = 0;
CycloneGUID = 0;
memset(BirdGUIDs, 0, sizeof(BirdGUIDs));
StormCount = 0;
isRaining = false;
SetWeather(WEATHER_STATE_FINE, 0.0f);
}
示例9: TEST_F
TEST_F(CTestBattleField, GetTotalStrengthWorksWhenOnWeather)
{
CCardDeck deckFull = CardLoader("./testCards.data");
ICard* iCard = NULL;
for (int _index = 0; _index != deckFull.Size(); ++_index)
{
iCard = deckFull.At(_index);
m_battleField.EnDeck(iCard);
}
SetWeather(0);
int nTotalStrength = m_battleField.GetTotalStrength();
EXPECT_EQ(14, nTotalStrength);
}
示例10: SetNOAAStore
void
MapWindow::OnDestroy()
{
#ifdef HAVE_NOAA
SetNOAAStore(nullptr);
#endif
airspace_renderer.Clear();
SetWaypoints(nullptr);
SetTopography(nullptr);
SetTerrain(nullptr);
SetWeather(nullptr);
#ifndef ENABLE_OPENGL
buffer_canvas.Destroy();
#endif
DoubleBufferWindow::OnDestroy();
}
示例11: TargNameCombo
void QuickParameters::ReinitCombo()
{
CRCombo* combo;
targtype=0,targentry=0;
for (int t=0;t<4;t++)
for (int e=0;e<4;e++)
if(CSQuick1::quickdef.targets[t][e]==CSQuick1::quickdef.target)
targtype=t,targentry=e;
combo=GETDLGITEM(IDC_TARGTYPE);
combo->Clear();
combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[0]));
if (CSQuick1::quickdef.targtypeIDs[1])
combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[1]));
if (CSQuick1::quickdef.targtypeIDs[2])
combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[2]));
if (CSQuick1::quickdef.targtypeIDs[3])
combo->AddString(LoadResString(CSQuick1::quickdef.targtypeIDs[3]));
if (CSQuick1::quickdef.targtypeIDs[0])
combo->SetIndex(targtype);
TargNameCombo();
SWord Latitude = 51; //RDH 25/02/00
MMC.Sky.SetMissionDawnDusk(Latitude, MMC.currdate, MMC.dawntime, MMC.dusktime);
int timeindex = CSQuick1::quickdef.time;
SetTime(timeindex);
combo=GETDLGITEM(IDC_TIME);
combo->Clear();
combo->RESCOMBO(DAWN,4)->SetIndex(timeindex);
int weatherindex = CSQuick1::quickdef.weather;
SetWeather(weatherindex);
combo=GETDLGITEM(IDC_CLOUD);
combo->Clear();
combo->RESCOMBO(CLEARSKY,4)->SetIndex(weatherindex);
}
示例12: SetMarks
void
MapWindow::OnDestroy()
{
SetMarks(NULL);
airspace_renderer.Clear();
SetWaypoints(NULL);
SetTopography(NULL);
SetTerrain(NULL);
SetWeather(NULL);
#ifndef ENABLE_OPENGL
buffer_canvas.reset();
if (!IsAncientHardware())
stencil_canvas.reset();
#endif
DoubleBufferWindow::OnDestroy();
}
示例13: UpdateAI
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
if (StormCount)
{
Unit* pTarget = Unit::GetUnit(*me, CloudGUID);
if (!pTarget || !pTarget->IsAlive())
{
EnterEvadeMode();
return;
}
else if (Unit* Cyclone = Unit::GetUnit(*me, CycloneGUID))
Cyclone->CastSpell(pTarget, 25160, true); // keep casting or...
if (StormSequenceTimer <= diff)
HandleStormSequence(pTarget);
else
StormSequenceTimer -= diff;
return;
}
if (Enrage_Timer <= diff)
{
me->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_ONENRAGE);
DoCast(me, SPELL_BERSERK, true);
Enrage_Timer = (diff - Enrage_Timer) + 600000;
}
else
Enrage_Timer -= diff;
if (StaticDisruption_Timer <= diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->GetVictim();
TargetGUID = pTarget->GetGUID();
DoCast(pTarget, SPELL_STATIC_DISRUPTION, false);
me->SetInFront(me->GetVictim());
StaticDisruption_Timer = (diff - StaticDisruption_Timer) + (10 + rand() % 8) * 1000; // < 20s
/*if (float dist = me->IsWithinDist3d(pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(), 5.0f) dist = 5.0f;
SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/
}
else
StaticDisruption_Timer -= diff;
if (GustOfWind_Timer <= diff)
{
Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1);
if (!pTarget) pTarget = me->GetVictim();
DoCast(pTarget, SPELL_GUST_OF_WIND);
GustOfWind_Timer = (diff - GustOfWind_Timer) + (20 + rand() % 10) * 1000; //20 to 30 seconds(bosskillers)
}
else
GustOfWind_Timer -= diff;
if (CallLighting_Timer <= diff)
{
DoCastVictim( SPELL_CALL_LIGHTNING);
CallLighting_Timer = (diff - CallLighting_Timer) + (12 + rand() % 5) * 1000; //totaly random timer. can't find any info on this
}
else
CallLighting_Timer -= diff;
if (!isRaining && ElectricalStorm_Timer < 8000 + urand(0, 5000))
{
SetWeather(WEATHER_STATE_HEAVY_RAIN, 0.9999f);
isRaining = true;
}
if (ElectricalStorm_Timer <= diff)
{
Unit* pTarget = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true);
if (!pTarget)
{
EnterEvadeMode();
return;
}
pTarget->CastSpell(pTarget, SPELL_ELECTRICAL_STORM_VISUAL, true);//cloud visual
DoCast(pTarget, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual
float x, y, z;
pTarget->GetPosition(x, y, z);
pTarget->SetLevitate(true);
Movement::MoveSplineInit init(*me);
init.MoveTo(x, y, me->GetPositionZ() + 15.0f, true);
init.Launch();
Unit* Cloud = me->SummonTrigger(x, y, me->GetPositionZ() + 16, 0, 15000);
if (Cloud)
{
CloudGUID = Cloud->GetGUID();
Cloud->SetLevitate(true);
Cloud->StopMoving();
Cloud->SetObjectScale(1.0f);
Cloud->setFaction(35);
Cloud->SetMaxHealth(9999999);
Cloud->SetHealth(9999999);
//.........这里部分代码省略.........
示例14: HandleStormSequence
void HandleStormSequence(Unit* Cloud) // 1: begin, 2-9: tick, 10: end
{
if (StormCount < 10 && StormCount > 1)
{
// deal damage
int32 bp0 = 800;
for (uint8 i = 2; i < StormCount; ++i)
bp0 *= 2;
CellCoord p(Trinity::ComputeCellCoord(me->GetPositionX(), me->GetPositionY()));
Cell cell(p);
cell.SetNoCreate();
std::list<Unit*> tempUnitMap;
{
Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(me, me, SIZE_OF_GRIDS);
Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck> searcher(me, tempUnitMap, u_check);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, WorldTypeMapContainer > world_unit_searcher(searcher);
TypeContainerVisitor<Trinity::UnitListSearcher<Trinity::AnyAoETargetUnitInObjectRangeCheck>, GridTypeMapContainer > grid_unit_searcher(searcher);
cell.Visit(p, world_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
cell.Visit(p, grid_unit_searcher, *me->GetMap(), *me, SIZE_OF_GRIDS);
}
// deal damage
for (std::list<Unit*>::const_iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i)
{
if (Unit* target = (*i))
{
if (Cloud && !Cloud->IsWithinDist(target, 6, false))
Cloud->CastCustomSpell(target, SPELL_ZAP, &bp0, NULL, NULL, true, 0, 0, me->GetGUID());
}
}
// visual
float x, y, z;
z = me->GetPositionZ();
for (uint8 i = 0; i < 5+rand()%5; ++i)
{
x = 343.0f+rand()%60;
y = 1380.0f+rand()%60;
if (Unit* trigger = me->SummonTrigger(x, y, z, 0, 2000))
{
trigger->setFaction(35);
trigger->SetMaxHealth(100000);
trigger->SetHealth(100000);
trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE);
if (Cloud)
Cloud->CastCustomSpell(trigger, /*43661*/SPELL_ZAP, &bp0, NULL, NULL, true, 0, 0, Cloud->GetGUID());
}
}
}
++StormCount;
if (StormCount > 10)
{
StormCount = 0; // finish
events.ScheduleEvent(EVENT_SUMMON_EAGLES, 5000);
me->InterruptNonMeleeSpells(false);
CloudGUID = 0;
if (Cloud)
Cloud->DealDamage(Cloud, Cloud->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false);
SetWeather(WEATHER_STATE_FINE, 0.0f);
isRaining = false;
}
events.ScheduleEvent(EVENT_STORM_SEQUENCE, 1000);
}
示例15: SetWeather
void QuickParameters::OnTextChangedCloud(LPCTSTR Caption, short index)
{
CSQuick1::quickdef.weather = index;
SetWeather(index);
}