本文整理汇总了C++中DoorClose函数的典型用法代码示例。如果您正苦于以下问题:C++ DoorClose函数的具体用法?C++ DoorClose怎么用?C++ DoorClose使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了DoorClose函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DoorOpen
void BattlegroundRV::TogglePillarCollision()
{
// Toggle visual pillars, pulley, gear, and collision based on previous state
for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_GEAR_2; ++i)
_pillarCollision ? DoorOpen(i) : DoorClose(i);
for (uint8 i = BG_RV_OBJECT_PILAR_2; i <= BG_RV_OBJECT_PULLEY_2; ++i)
_pillarCollision ? DoorClose(i) : DoorOpen(i);
for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PILAR_COLLISION_4; ++i)
{
if (GameObject* go = GetBGObject(i))
{
if (i >= BG_RV_OBJECT_PILAR_COLLISION_1)
{
GOState state = ((go->GetGOInfo()->door.startOpen != 0) == _pillarCollision) ? GO_STATE_ACTIVE : GO_STATE_READY;
go->SetGoState(state);
}
for (BattlegroundPlayerMap::const_iterator itr = GetPlayers().begin(); itr != GetPlayers().end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(itr->first))
go->SendUpdateToPlayer(player);
}
}
_pillarCollision = !_pillarCollision;
}
示例2: GetPillarCollision
void BattlegroundRV::TogglePillarCollision()
{
bool apply = GetPillarCollision();
// Toggle visual pillars, pulley, gear, and collision based on previous state
for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_GEAR_2; ++i)
apply ? DoorOpen(i) : DoorClose(i);
for (uint8 i = BG_RV_OBJECT_PILAR_2; i <= BG_RV_OBJECT_PULLEY_2; ++i)
apply ? DoorClose(i) : DoorOpen(i);
for (uint8 i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PILAR_COLLISION_4; ++i)
{
if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[i]))
{
if (i >= BG_RV_OBJECT_PILAR_COLLISION_1)
{
uint32 _state = GO_STATE_READY;
if (gob->GetGOInfo()->door.startOpen)
_state = GO_STATE_ACTIVE;
gob->SetGoState(apply ? (GOState)_state : (GOState)(!_state));
if (gob->GetGOInfo()->door.startOpen)
gob->EnableCollision(!apply); // Forced collision toggle
}
for (BattlegroundPlayerMap::iterator itr = m_Players.begin(); itr != m_Players.end(); ++itr)
if (Player* player = ObjectAccessor::FindPlayer(MAKE_NEW_GUID(itr->first, 0, HIGHGUID_PLAYER)))
gob->SendUpdateToPlayer(player);
}
}
SetPillarCollision(!apply);
}
示例3: while
void BattlegroundDS::PostUpdateImpl(uint32 diff)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
_events.Update(diff);
while (uint32 eventId = _events.ExecuteEvent())
{
switch (eventId)
{
case BG_DS_EVENT_WATERFALL_WARNING:
// Add the water
DoorClose(BG_DS_OBJECT_WATER_2);
_events.ScheduleEvent(BG_DS_EVENT_WATERFALL_ON, BG_DS_WATERFALL_WARNING_DURATION);
break;
case BG_DS_EVENT_WATERFALL_ON:
// Active collision and start knockback timer
DoorClose(BG_DS_OBJECT_WATER_1);
_events.ScheduleEvent(BG_DS_EVENT_WATERFALL_OFF, BG_DS_WATERFALL_DURATION);
_events.ScheduleEvent(BG_DS_EVENT_WATERFALL_KNOCKBACK, BG_DS_WATERFALL_KNOCKBACK_TIMER);
break;
case BG_DS_EVENT_WATERFALL_OFF:
// Remove collision and water
DoorOpen(BG_DS_OBJECT_WATER_1);
DoorOpen(BG_DS_OBJECT_WATER_2);
_events.CancelEvent(BG_DS_EVENT_WATERFALL_KNOCKBACK);
_events.ScheduleEvent(BG_DS_EVENT_WATERFALL_WARNING, urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
break;
case BG_DS_EVENT_WATERFALL_KNOCKBACK:
// Repeat knockback while the waterfall still active
if (Creature* waterSpout = GetBGCreature(BG_DS_NPC_WATERFALL_KNOCKBACK))
waterSpout->CastSpell(waterSpout, BG_DS_SPELL_WATER_SPOUT, true);
_events.ScheduleEvent(eventId, BG_DS_WATERFALL_KNOCKBACK_TIMER);
break;
case BG_DS_EVENT_PIPE_KNOCKBACK:
for (uint32 i = BG_DS_NPC_PIPE_KNOCKBACK_1; i <= BG_DS_NPC_PIPE_KNOCKBACK_2; ++i)
if (Creature* waterSpout = GetBGCreature(i))
waterSpout->CastSpell(waterSpout, BG_DS_SPELL_FLUSH, true);
break;
}
}
if (_pipeKnockBackCount < BG_DS_PIPE_KNOCKBACK_TOTAL_COUNT)
{
if (_pipeKnockBackTimer < diff)
{
for (uint32 i = BG_DS_NPC_PIPE_KNOCKBACK_1; i <= BG_DS_NPC_PIPE_KNOCKBACK_2; ++i)
if (Creature* waterSpout = GetBGCreature(i))
waterSpout->CastSpell(waterSpout, BG_DS_SPELL_FLUSH, true);
++_pipeKnockBackCount;
_pipeKnockBackTimer = BG_DS_PIPE_KNOCKBACK_DELAY;
}
else
_pipeKnockBackTimer -= diff;
}
}
示例4: SpawnBGObject
void BattlegroundKT::StartingEventCloseDoors()
{
SpawnBGObject(BG_KT_OBJECT_A_DOOR, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_KT_OBJECT_H_DOOR, RESPAWN_IMMEDIATELY);
DoorClose(BG_KT_OBJECT_A_DOOR);
DoorClose(BG_KT_OBJECT_H_DOOR);
for (uint8 i = 0; i < 4; ++i)
SpawnBGObject(BG_KT_OBJECT_ORB_1 + i, RESPAWN_ONE_DAY);
}
示例5: SpawnBGObject
void BattlegroundAB::StartingEventCloseDoors()
{
for (uint32 obj = BG_AB_OBJECT_BANNER_NEUTRAL; obj < BG_AB_DYNAMIC_NODES_COUNT * BG_AB_OBJECTS_PER_NODE; ++obj)
SpawnBGObject(obj, RESPAWN_ONE_DAY);
for (uint32 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT * 3; ++i)
SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + i, RESPAWN_ONE_DAY);
// Starting doors
SpawnBGObject(BG_AB_OBJECT_GATE_A, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
DoorClose(BG_AB_OBJECT_GATE_A);
DoorClose(BG_AB_OBJECT_GATE_H);
}
示例6: SpawnBGObject
void BattlegroundBG::StartingEventCloseDoors()
{
// despawn banners, auras and buffs
for (int object = BG_BG_OBJECT_BANNER_NEUTRAL; object < BG_BG_DYNAMIC_NODES_COUNT * 8; ++object)
SpawnBGObject(object, RESPAWN_ONE_DAY);
// Starting doors
DoorClose(BG_BG_OBJECT_GATE_A);
DoorClose(BG_BG_OBJECT_GATE_H);
SpawnBGObject(BG_BG_OBJECT_GATE_A, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_BG_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
// Starting base spirit guides
_NodeOccupied(BG_BG_SPIRIT_ALIANCE, ALLIANCE);
_NodeOccupied(BG_BG_SPIRIT_HORDE, HORDE);
}
示例7: switch
void BattlegroundRV::PostUpdateImpl(uint32 diff)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
if (getTimer() < diff)
{
switch (getState())
{
case BG_RV_STATE_OPEN_FENCES:
// Open fire (only at game start)
for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)
DoorOpen(i);
setTimer(BG_RV_CLOSE_FIRE_TIMER);
setState(BG_RV_STATE_CLOSE_FIRE);
break;
case BG_RV_STATE_CLOSE_FIRE:
for (uint8 i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)
DoorClose(i);
// Fire got closed after five seconds, leaves twenty seconds before toggling pillars
setTimer(BG_RV_FIRE_TO_PILLAR_TIMER);
setState(BG_RV_STATE_SWITCH_PILLARS);
break;
case BG_RV_STATE_SWITCH_PILLARS:
TogglePillarCollision();
setTimer(BG_RV_PILLAR_SWITCH_TIMER);
break;
}
}
else
setTimer(getTimer() - diff);
}
示例8: DoorClose
void BattlegroundDS::PostUpdateImpl(uint32 diff)
{
if (GetStatus() != STATUS_IN_PROGRESS)
return;
if (getWaterFallTimer() < diff)
{
if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_OFF) // Add the water
{
DoorClose(BG_DS_OBJECT_WATER_2);
setWaterFallTimer(BG_DS_WATERFALL_WARNING_DURATION);
setWaterFallStatus(BG_DS_WATERFALL_STATUS_WARNING);
}
else if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_WARNING) // Active collision
{
if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1]))
gob->SetGoState(GO_STATE_READY);
setWaterFallTimer(BG_DS_WATERFALL_DURATION);
setWaterFallStatus(BG_DS_WATERFALL_STATUS_ON);
}
else //if (getWaterFallStatus() == BG_DS_WATERFALL_STATUS_ON) // Remove collision and water
{
// turn off collision
if (GameObject* gob = GetBgMap()->GetGameObject(BgObjects[BG_DS_OBJECT_WATER_1]))
gob->SetGoState(GO_STATE_ACTIVE);
DoorOpen(BG_DS_OBJECT_WATER_2);
setWaterFallTimer(urand(BG_DS_WATERFALL_TIMER_MIN, BG_DS_WATERFALL_TIMER_MAX));
setWaterFallStatus(BG_DS_WATERFALL_STATUS_OFF);
}
}
else
setWaterFallTimer(getWaterFallTimer() - diff);
}
示例9: SpawnBGObject
void BattlegroundBFG::StartingEventCloseDoors()
{
// Remove banners, auras and buffs
for (int object = GILNEAS_BG_OBJECT_BANNER_NEUTRAL; object < GILNEAS_BG_DYNAMIC_NODES_COUNT * 8; ++object)
SpawnBGObject(object, RESPAWN_ONE_DAY);
for (int i = 0; i < GILNEAS_BG_DYNAMIC_NODES_COUNT * 3; ++i)
SpawnBGObject(GILNEAS_BG_OBJECT_SPEEDBUFF_LIGHTHOUSE + i, RESPAWN_ONE_DAY);
// Starting doors
DoorClose(GILNEAS_BG_OBJECT_GATE_A_1);
DoorClose(GILNEAS_BG_OBJECT_GATE_H_1);
// Starting base spirit guides
_NodeOccupied(GILNEAS_BG_SPIRIT_ALIANCE, ALLIANCE);
_NodeOccupied(GILNEAS_BG_SPIRIT_HORDE, HORDE);
}
示例10: SpawnBGObject
void BattlegroundAB::StartingEventCloseDoors()
{
// despawn banners, auras and buffs
for (int obj = BG_AB_OBJECT_BANNER_NEUTRAL; obj < BG_AB_DYNAMIC_NODES_COUNT * 8; ++obj)
SpawnBGObject(obj, RESPAWN_ONE_DAY);
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT * 3; ++i)
SpawnBGObject(BG_AB_OBJECT_SPEEDBUFF_STABLES + i, RESPAWN_ONE_DAY);
// Starting doors
DoorClose(BG_AB_OBJECT_GATE_A);
DoorClose(BG_AB_OBJECT_GATE_H);
SpawnBGObject(BG_AB_OBJECT_GATE_A, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AB_OBJECT_GATE_H, RESPAWN_IMMEDIATELY);
// Starting base spirit guides
_NodeOccupied(BG_AB_SPIRIT_ALIANCE, ALLIANCE);
_NodeOccupied(BG_AB_SPIRIT_HORDE, HORDE);
}
示例11: DoorClose
void BattleGroundWS::StartingEventCloseDoors()
{
for(uint32 i = BG_WS_OBJECT_DOOR_A_1; i <= BG_WS_OBJECT_DOOR_H_4; ++i)
{
DoorClose(i);
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
for(uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i)
SpawnBGObject(i, RESPAWN_ONE_DAY);
}
示例12: UpdateArenaWorldState
void BattlegroundRV::Update(uint32 diff)
{
Battleground::Update(diff);
if (GetStatus() == STATUS_IN_PROGRESS)
{
if (GetStartTime() >= 47*MINUTE*IN_MILLISECONDS) // after 47 minutes without one team losing, the arena closes with no winner and no rating change
{
UpdateArenaWorldState();
CheckArenaAfterTimerConditions();
}
}
if (getTimer() < diff)
{
uint32 i;
switch(getState())
{
case BG_RV_STATE_OPEN_FENCES:
{
setTimer(BG_RV_PILAR_TO_FIRE_TIMER);
setState(BG_RV_STATE_CLOSE_FIRE);
break;
}
case BG_RV_STATE_CLOSE_FIRE:
for (i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)
DoorClose(i);
setTimer(BG_RV_FIRE_TO_PILAR_TIMER);
setState(BG_RV_STATE_OPEN_PILARS);
break;
case BG_RV_STATE_OPEN_PILARS:
for (i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i)
DoorOpen(i);
setTimer(BG_RV_PILAR_TO_FIRE_TIMER);
setState(BG_RV_STATE_OPEN_FIRE);
break;
case BG_RV_STATE_OPEN_FIRE:
// FIXME: after 3.2.0 it's only decorative and should be opened only one time at battle start
for (i = BG_RV_OBJECT_FIRE_1; i <= BG_RV_OBJECT_FIREDOOR_2; ++i)
DoorOpen(i);
setTimer(BG_RV_FIRE_TO_PILAR_TIMER);
setState(BG_RV_STATE_CLOSE_PILARS);
break;
case BG_RV_STATE_CLOSE_PILARS:
uint32 i;
for (i = BG_RV_OBJECT_PILAR_1; i <= BG_RV_OBJECT_PULLEY_2; ++i)
DoorOpen(i);
setTimer(BG_RV_PILAR_TO_FIRE_TIMER);
setState(BG_RV_STATE_CLOSE_FIRE);
break;
}
}
else
setTimer(getTimer() - diff);
}
示例13: DoorClose
void BattlegroundSSM::StartingEventCloseDoors()
{
for (uint32 i = BG_SSM_OBJECT_DOOR_H_1; i <= BG_SSM_OBJECT_DOOR_H_2; ++i)
{
DoorClose(i);
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
for (uint32 i = BG_SSM_OBJECT_BUFF_1; i <= BG_SSM_OBJECT_BUFF_4; ++i)
SpawnBGObject(i, RESPAWN_ONE_DAY);
}
示例14: SpawnBGObject
void BattlegroundKT::StartingEventCloseDoors()
{
for (uint32 i = BG_KT_OBJECT_A_DOOR; i <= BG_KT_OBJECT_H_DOOR; ++i)
{
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
DoorClose(i);
}
for (uint8 i = BG_KT_OBJECT_ORB_1; i <= BG_KT_OBJECT_ORB_4; ++i)
SpawnBGObject(i, RESPAWN_ONE_DAY);
}
示例15: DoorClose
void BattlegroundWS::StartingEventCloseDoors()
{
DoorClose(BG_WS_OBJECT_DOOR_A_1);
DoorClose(BG_WS_OBJECT_DOOR_A_2);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_3, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_4, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_5, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_DOOR_A_6, RESPAWN_IMMEDIATELY);
DoorClose(BG_WS_OBJECT_DOOR_H_1);
DoorClose(BG_WS_OBJECT_DOOR_H_2);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_3, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_4, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_5, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_WS_OBJECT_DOOR_H_6, RESPAWN_IMMEDIATELY);
for (uint32 i = BG_WS_OBJECT_A_FLAG; i <= BG_WS_OBJECT_BERSERKBUFF_2; ++i)
SpawnBGObject(i, RESPAWN_ONE_DAY);
UpdateWorldState(BG_WS_STATE_TIMER_ACTIVE, 1);
UpdateWorldState(BG_WS_STATE_TIMER, 25);
}