コード例 #1
0
ファイル: ai_container.cpp プロジェクト: Fiocitrine/darkstar
bool CAIContainer::Internal_Engage(uint16 targetid)
{
    //#TODO: pet engage/disengage
    auto entity {dynamic_cast<CBattleEntity*>(PEntity)};

    if (entity && entity->PAI->IsEngaged())
    {
        if (entity->GetBattleTargetID() != targetid)
        {
            ChangeTarget(targetid);
            return true;
        }
        return false;
    }
    //#TODO: use valid target stuff from spell
    if (entity)
    {
        //#TODO: remove m_battleTarget if possible (need to check disengage)
        if (CanChangeState() || (GetCurrentState() && GetCurrentState()->IsCompleted()))
        {
            if (ForceChangeState<CAttackState>(entity, targetid))
            {
                entity->OnEngage(*static_cast<CAttackState*>(m_stateStack.top().get()));
            }
        }
        return true;
    }
    return false;
}
コード例 #2
0
ファイル: AscentAP.cpp プロジェクト: Artoria2e5/obtr
bool AscentApMfd::ConsumeKeyBuffered (DWORD key)
{
	switch (key) {
	case OAPI_KEY_L:
		return OnLaunch();
	case OAPI_KEY_D:
		return OnDisengage();
	case OAPI_KEY_E:
		return OnEngage();
	case OAPI_KEY_COMMA:
		DecPage();
		return true;
	case OAPI_KEY_PERIOD:
		IncPage();
		return true;
	case OAPI_KEY_SEMICOLON:
		InitDecAzimuth();
		return true;
	case OAPI_KEY_APOSTROPHE:
		InitIncAzimuth();
		return true;
	case OAPI_KEY_MINUS:
		InitDecAltitude();
		return true;
	case OAPI_KEY_EQUALS:
		InitIncAltitude();
		return true;
	}
	return false;
}