• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetAI函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetAI函数的典型用法代码示例。如果您正苦于以下问题:C++ GetAI函数的具体用法?C++ GetAI怎么用?C++ GetAI使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetAI函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: GetAI

void Player::SetAutoPilotActive(bool on)
{
	IAI *ai = GetAI();
	
	AutoPilotActive = on;
	ai->SetActive(on);
	/*AIAutoPilotStrategy *auto_pilot = ai->GetAutoPilotStrategy();
	if (auto_pilot)
	{
		auto_pilot->SetActive(on);		
	}*/
}
开发者ID:beorc,项目名称:flare_star,代码行数:12,代码来源:Player.cpp


示例2: GetAI

//----------------------------------------------------------------------------
//              
//	ROUTINE:	CAIHumanStrategyShootStream::CalculateStreamTime()
//              
//	PURPOSE:	Calculate how long we should next fire a stream for.
//              
//----------------------------------------------------------------------------
void CAIHumanStrategyShootStream::CalculateStreamTime()
{
	CWeapon* pWeapon = GetAI()->GetCurrentWeapon();

	AIASSERT( pWeapon && pWeapon->GetWeaponData(), m_pAIHuman->GetHOBJECT(), "" );
	if ( !pWeapon || ( pWeapon && !pWeapon->GetWeaponData()) )
	{
		return;
	}

	m_flStreamTime = g_pLTServer->GetTime() + GetRandom(pWeapon->GetWeaponData()->fAIMinBurstInterval, pWeapon->GetWeaponData()->fAIMaxBurstInterval);
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:19,代码来源:AIHumanStrategyShootStream.cpp


示例3: GetAI

void PlayerbotDruidAI::_DoNextPVECombatManeuverHeal(Unit* /*pTarget*/)
{
    PlayerbotAI* ai = GetAI();
    if (!ai)
        return;

    uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();

    Player *m_bot = GetPlayerBot();

    if (TREE_OF_LIFE > 0 && !m_bot->HasAura(TREE_OF_LIFE, EFFECT_INDEX_0))
        ai->CastSpell(TREE_OF_LIFE, *m_bot);

    if (m_bot->HasAura(CAT_FORM, EFFECT_INDEX_0))
    {
        m_bot->RemoveAurasDueToSpell(CAT_FORM_1);
        //ai->TellMaster("FormClearCat");
        return;
    }
    if (m_bot->HasAura(BEAR_FORM, EFFECT_INDEX_0))
    {
        m_bot->RemoveAurasDueToSpell(BEAR_FORM_1);
        //ai->TellMaster("FormClearBear");
        return;
    }
    if (m_bot->HasAura(DIRE_BEAR_FORM, EFFECT_INDEX_0))
    {
        m_bot->RemoveAurasDueToSpell(DIRE_BEAR_FORM_1);
        //ai->TellMaster("FormClearDireBear");
        return;
    }
    // spellcasting form, but disables healing spells so it's got to go
    if (m_bot->HasAura(MOONKIN_FORM, EFFECT_INDEX_0))
    {
        m_bot->RemoveAurasDueToSpell(MOONKIN_FORM_1);
        //ai->TellMaster("FormClearMoonkin");
        return;
    }

    if (ai->GetHealthPercent() <= 60)
    {
        HealTarget(m_bot);
        return;
    }
    if (masterHP <= 50)
    {
        HealTarget(GetMaster());
        return;
    }
    // TODO: err... what about the other teammates?

    DruidSpellCombat = 0;
}
开发者ID:AngelX,项目名称:portal,代码行数:53,代码来源:PlayerbotDruidAI.cpp


示例4: switch

void CAIHumanStateLaunch::Update()
{
	super::Update();

	switch( m_eStateStatus )
	{
		case kSStat_Initialized:
			{
				// Setup the AI Movement to launch AI.

				GetAI()->GetAIMovement()->SetMovementDest( m_vLaunchDest );
				GetAI()->GetAIMovement()->FaceDest( LTTRUE );
				GetAI()->GetAIMovement()->SetSpeed( m_fLaunchSpeed );
				GetAI()->GetAIMovement()->SetParabola( m_fLaunchHeight );
				GetAI()->GetAIMovement()->IgnoreVolumes( LTTRUE );

				m_eStateStatus = kSStat_Moving;
			}
			break;

		case kSStat_Moving:
			if( GetAI()->GetAIMovement()->IsDone() )
			{
				m_eStateStatus = kSStat_StateComplete;
			}
			break;
	}
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:28,代码来源:AIHumanStateLaunch.cpp


示例5: if

LTBOOL CAIPoodleStrategyFollowPath::UpdateMoveTo(CAIPathWaypoint* pWaypoint)
{
	if ( m_AIMovement.IsSet() )
	{
		if ( !m_AIMovement.Update() )
		{
            return LTFALSE;
		}

		if ( m_AIMovement.IsDone() )
		{
			m_pPath->IncrementWaypointIndex();
		}
	}
	else if ( m_AIMovement.IsUnset() || m_AIMovement.IsDone() )
	{
		if  ( !GetAI()->FacePos(pWaypoint->GetArgumentVector1()) )
		{
			// If we're not yet facing the point, don't move, and start to face it.
			// We need to clear in order to disable the steerings.

			GetAI()->Stop();
		}
		else
		{
			// We're facing the point, so we can start moving.

			SetMovement(m_eMovement);
			m_AIMovement.Set(pWaypoint->GetArgumentVector1());
		}
	}
	else // Stuck
	{

	}

	GetAnimator()->SetMain(m_eMovement);

    return LTTRUE;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:40,代码来源:AIAnimalStrategy.cpp


示例6: CalculateStreamTime

//----------------------------------------------------------------------------
//              
//	ROUTINE:	CAIHumanStrategyShootStream::UpdateAiming()
//              
//	PURPOSE:	
//              
//----------------------------------------------------------------------------
/*virtual*/ void CAIHumanStrategyShootStream::UpdateAiming(HOBJECT hTarget)
{
	if ( m_flStreamTime < g_pLTServer->GetTime() )
	{
		// Don't calculate new stream time until finished firing animation.
		if( !GetAnimationContext()->IsLocked() )
		{
			CalculateStreamTime();
		}

		Aim();
	}
	else
	{
		// We're done waiting, fire if we're at a reasonable angle

		if ( m_bIgnoreFOV )
		{
			Fire();
		}
		else
		{
			LTVector vTargetPos;
			g_pLTServer->GetObjectPos(hTarget, &vTargetPos);

			LTVector vDir = vTargetPos - GetAI()->GetPosition();
			vDir.y = 0.0f;
			vDir.Normalize();

			if ( vDir.Dot(GetAI()->GetTorsoForward()) < 0.70f )
			{
				Aim();
			}
			else
			{
				Fire();
			}
		}
	}
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:47,代码来源:AIHumanStrategyShootStream.cpp


示例7: GetAI

LTBOOL CAIHelicopterStrategyShoot::Update()
{
	if ( !CAIHelicopterStrategy::Update() )
	{
        return LTFALSE;
	}

	if ( !m_hTarget )
	{
        return LTFALSE;
	}

	for ( int iWeapon = 0 ; iWeapon < GetAI()->GetNumWeapons() ; iWeapon++ )
	{
		CWeapon* pWeapon = GetAI()->GetWeapon(iWeapon);

		if ( m_aBursts[iWeapon].m_bFired && m_aBursts[iWeapon].m_bActive )
		{
			UpdateFiring(pWeapon, &m_aBursts[iWeapon]);

			m_aBursts[iWeapon].m_bFired = LTFALSE;
		}
		else
		{
			UpdateAiming(pWeapon, &m_aBursts[iWeapon]);
		}

		if ( 0 == pWeapon->GetAmmoInClip() )
		{
            pWeapon->ReloadClip(LTFALSE);
		}

		if ( 0 == pWeapon->GetParent()->GetAmmoCount(pWeapon->GetAmmoId()) )
		{
			pWeapon->GetParent()->AddAmmo(pWeapon->GetAmmoId(), 999999);
		}
	}

    return LTTRUE;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:40,代码来源:AIVehicleStrategy.cpp


示例8: GetAI

void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
{
    PlayerbotAI* ai = GetAI();
    if (!ai)
        return;

    switch (ai->GetScenarioType())
    {
        case PlayerbotAI::SCENARIO_DUEL:
            ai->CastSpell(MOONFIRE);
            return;
        default:
            break;
    }

    uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();

    Player *m_bot = GetPlayerBot();
    Unit* pVictim = pTarget->getVictim();

    if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_HEAL) // && ai->GetMovementOrder() == PlayerbotAI::MOVEMENT_STAY)
        SpellSequence = DruidHeal;
    else if (IsFeral() && ai->GetCombatOrder() == PlayerbotAI::ORDERS_ASSIST) // && ai->GetMovementOrder() == PlayerbotAI::MOVEMENT_STAY)
        SpellSequence = DruidCombat;
    else if (IsFeral() && ai->GetCombatOrder() == PlayerbotAI::ORDERS_TANK)
        SpellSequence = DruidTank;
    else
        SpellSequence = DruidSpell;

    switch (SpellSequence)
    {
        case DruidTank: // Its now a tank druid!
            //ai->TellMaster("DruidTank");
            _DoNextPVECombatManeuverBear(pTarget);
            break;

        case DruidSpell:
            //ai->TellMaster("DruidSpell");
            _DoNextPVECombatManeuverSpellDPS(pTarget);
            break;

        case DruidHeal:
            //ai->TellMaster("DruidHeal");
            _DoNextPVECombatManeuverHeal(pTarget);
            break;

        case DruidCombat:
            //ai->TellMaster("DruidCombat");
            _DoNextPVECombatManeuverMeleeDPS(pTarget);
            break;
    }
} // end DoNextCombatManeuver
开发者ID:AngelX,项目名称:portalR2,代码行数:52,代码来源:PlayerbotDruidAI.cpp


示例9: GetAI

void PlayerbotWarriorAI::DoNonCombatActions()
{
    PlayerbotAI* ai = GetAI();
    Player* m_bot = GetPlayerBot();
    Player* m_master = ai->GetLeader();

    if (m_bot->getRole() == WarriorProtection && ai->Cast(DEFENSIVE_STANCE))
        return;
    else if (ai->Cast(BERSERKER_STANCE))
        return;
    else if (ai->Cast(BATTLE_STANCE))
        return;
}
开发者ID:Archives,项目名称:easy-mangos,代码行数:13,代码来源:PlayerbotWarriorAI.cpp


示例10: GetAI

bool PlayerbotMageAI::BuffPlayer(Player* target)
{
    PlayerbotAI * ai = GetAI();
    Pet * pet = target->GetPet();

    if (pet && pet->getPowerType() == POWER_MANA && ai->Buff(ARCANE_INTELLECT, pet))
        return true;

    if (ARCANE_INTELLECT)
        return ai->Buff(ARCANE_INTELLECT, target);
    else
        return false;
}
开发者ID:Archives,项目名称:portal,代码行数:13,代码来源:PlayerbotMageAI.cpp


示例11: GetPlayerBot

void PlayerbotWarriorAI::DoNonCombatActions()
{
    Player * m_bot = GetPlayerBot();
    if (!m_bot)
        return;

    // TODO (by Runsttren): check if shout aura bot has is casted by this bot, 
    // otherwise cast other useful shout
    // If the bot is protect talented, she/he needs stamina not attack power.
    // With stance change can the shout change to. 
    // Inserted line to battle shout m_bot->HasAura( COMMANDING_SHOUT, 0 )
    // Natsukawa
    if( ( (COMMANDING_SHOUT>0 && !m_bot->HasAura( COMMANDING_SHOUT, 0 )) ||
        (BATTLE_SHOUT>0 && !m_bot->HasAura( BATTLE_SHOUT, 0 )) ) && 
        GetAI()->GetRageAmount()<10 && BLOODRAGE>0 && !m_bot->HasAura( BLOODRAGE, 0 ) )
    {
        // we do have a useful shout, no rage coming but can cast bloodrage... do it
        GetAI()->CastSpell( BLOODRAGE, *m_bot );
    }
    else if( COMMANDING_SHOUT>0 && !m_bot->HasAura( COMMANDING_SHOUT, 0 ) )
    {
        // use commanding shout now
        GetAI()->CastSpell( COMMANDING_SHOUT, *m_bot );
    }
    else if( BATTLE_SHOUT>0 && !m_bot->HasAura( BATTLE_SHOUT, 0 ) && !m_bot->HasAura( COMMANDING_SHOUT, 0 ) )
    {
        // use battle shout
        GetAI()->CastSpell( BATTLE_SHOUT, *m_bot );
    }

    // hp check
    if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
        m_bot->SetStandState(UNIT_STAND_STATE_STAND);

    Item* pItem = GetAI()->FindFood();

    if (pItem != NULL && GetAI()->GetHealthPercent() < 30)
    {
        GetAI()->TellMaster("I could use some food.");
        GetAI()->UseItem(*pItem);
        GetAI()->SetIgnoreUpdateTime(30);
        return;
    }
} // end DoNonCombatActions
开发者ID:mbb1978,项目名称:mangos,代码行数:44,代码来源:PlayerbotWarriorAI.cpp


示例12: GetAI

void PlayerbotRogueAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    Player *m_bot = GetPlayerBot();
    if (!m_bot || !ai || m_bot->isDead()) { return; }

    //If Casting or Eating/Drinking return
    if (m_bot->hasUnitState(UNIT_STAT_CASTING)) { return; }
    if (m_bot->getStandState() == UNIT_STAND_STATE_SIT) { return; }

    //Buff Up
    if (ChangeWeaponEnchants()) { return; }
} //end DoNonCombatActions
开发者ID:Mferrill,项目名称:BotCore,代码行数:13,代码来源:PlayerbotRogueAI.cpp


示例13: GetAI

void PlayerbotShamanAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    Player *m_bot = GetPlayerBot();
    if (!m_bot || !ai || m_bot->isDead()) {
        return;
    }

    //If Casting or Eating/Drinking return
    if (m_bot->HasUnitState(UNIT_STATE_CASTING)) {
        return;
    }
    if (m_bot->getStandState() == UNIT_STAND_STATE_SIT) {
        return;
    }

    //buff and heal raid
    if (DoSupportRaid(m_bot)) {
        return;
    }

    //heal pets and bots
    Unit *target = DoSelectLowestHpFriendly(40, 1000);
    if (target && target->isAlive() && HealTarget(target, target->GetHealth()*100 / target->GetMaxHealth())) {
        return;
    }

    //Buffs
    if (ChangeWeaponEnchants()) {
        return;
    }
    if (CastSpell(WATER_SHIELD,m_bot)) {
        return;
    }
    if (CastSpell(EARTH_SHIELD,m_bot)) {
        return;
    }

    //mana/hp check
    //Don't bother with eating, if low on hp, just let it heal themself
    if (m_bot->getRace() == (uint8) RACE_UNDEAD_PLAYER && ai->GetHealthPercent() < 75 && CastSpell(R_CANNIBALIZE,m_bot)) {
        return;
    }
    if (m_bot->GetHealth() < m_bot->GetMaxHealth() && CastSpell(LESSER_HEAL,m_bot)) {
        return;
    }
    if (ai->GetManaPercent() < 50) {
        ai->Feast();
    }

} //end DoNonCombatActions
开发者ID:Crash911,项目名称:RaptoredSkyFire,代码行数:51,代码来源:PlayerbotShamanAI.cpp


示例14: GetAI

void PlayerbotDruidAI::DoNextCombatManeuver(Unit *pTarget)
{
    PlayerbotAI* ai = GetAI();
    if (!ai)
        return;

    switch (ai->GetScenarioType())
    {
    case PlayerbotAI::SCENARIO_DUEL:
        ai->CastSpell(MOONFIRE);
        return;
    }

    uint32 masterHP = GetMaster()->GetHealth() * 100 / GetMaster()->GetMaxHealth();

    Player *m_bot = GetPlayerBot();
    Unit* pVictim = pTarget->getVictim();

    if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_HEAL)
        SpellSequence = DruidHeal;
    else if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_ASSIST && CAT_FORM > 0)
        SpellSequence = DruidCombat;
    // No check for Dire Bear here: you must have Bear form to learn Dire Bear form.
    else if (ai->GetCombatOrder() == PlayerbotAI::ORDERS_TANK && BEAR_FORM > 0)
        SpellSequence = DruidTank;
    else
        SpellSequence = DruidSpell;

    switch (SpellSequence)
    {
    case DruidTank: // Its now a tank druid!
        //ai->TellMaster("DruidTank");
        _DoNextPVECombatManeuverBear(pTarget);
        break;

    case DruidSpell:
        //ai->TellMaster("DruidSpell");
        _DoNextPVECombatManeuverSpellDPS(pTarget);
        break;

    case DruidHeal:
        //ai->TellMaster("DruidHeal");
        _DoNextPVECombatManeuverHeal(pTarget);
        break;

    case DruidCombat:
        //ai->TellMaster("DruidCombat");
        _DoNextPVECombatManeuverMeleeDPS(pTarget);
        break;
    }
} // end DoNextCombatManeuver
开发者ID:BACKUPLIB,项目名称:Darkportalwow,代码行数:51,代码来源:PlayerbotDruidAI.cpp


示例15: UBER_ASSERT

//----------------------------------------------------------------------------
//              
//	ROUTINE:	CAIHumanStateCatch::Init()
//              
//	PURPOSE:	Handles initialization of the CAIHumanStateCatch class,
//				Retreive initialization information from the AI, and change
//				the AI state to reflect entry to this state
//              
//----------------------------------------------------------------------------
LTBOOL CAIHumanStateCatch::Init(CAIHuman* pAIHuman)
{
	LTBOOL bParentInitializationSuccess = CAIHumanState::Init(pAIHuman);
	UBER_ASSERT( bParentInitializationSuccess, "CAIHumanStateCatch::Init Failed parent class initialization"	);

	// Retrieve the max hold time from the bute file, failing if it is not
	// defined for this AI
	m_fMaxCatchDuration = pAIHuman->GetBrain()->GetAIData(kAIData_MaxCatchDuration);

	// Be sure that we retrieved a MaxCatch value..
	UBER_ASSERT( m_fMaxCatchDuration > 0.0000001, "SetupCatch: MaxCatchDuration not set" );

	// Set the incoming position to a position 48 units in front of the AI.
	m_vIncomingPosition =  GetAI()->GetPosition() + GetAI()->GetEyeForward() * 48;

	// Ensure that node tracking is disabled.
	m_pAIHuman->DisableNodeTracking();

	// Set the Catching AI to an alert state/combat type
	m_pAIHuman->SetAwareness( kAware_Alert );

	return LTTRUE;
}
开发者ID:rickyharis39,项目名称:nolf2,代码行数:32,代码来源:AIHumanStateCatch.cpp


示例16: GetAI

void PlayerbotShamanAI::HealTarget(Unit &target, uint8 hp)
{
    PlayerbotAI* ai = GetAI();

    if (hp < 30 && HEALING_WAVE > 0 && ai->GetManaPercent() >= 32)
        ai->CastSpell(HEALING_WAVE, target);
    else if (hp < 45 && LESSER_HEALING_WAVE > 0 && ai->GetManaPercent() >= 19)
        ai->CastSpell(LESSER_HEALING_WAVE, target);
    else if (hp < 55 && RIPTIDE > 0 && !target.HasAura(RIPTIDE, EFFECT_INDEX_0) && ai->GetManaPercent() >= 21)
        ai->CastSpell(RIPTIDE, target);
    else if (hp < 70 && CHAIN_HEAL > 0 && ai->GetManaPercent() >= 24)
        ai->CastSpell(CHAIN_HEAL, target);
    // end HealTarget
}
开发者ID:120239197a,项目名称:SingleCore,代码行数:14,代码来源:PlayerbotShamanAI.cpp


示例17: GetAI

bool PlayerbotShamanAI::ChangeTotems(uint32 mode)
{
    uint32 earth=0, fire=0, water=0, air=0;

    PlayerbotAI *ai = GetAI();
    if(!ai) return false;
    Player *m_bot = GetPlayerBot();
    if(!m_bot || m_bot->isDead()) return false;

    Unit *pTarget = m_bot->GetSelectedUnit();
    Unit *pVictim = NULL;
    if (m_bot->GetSelectedUnit()->IsFriendlyTo(m_bot)) pTarget = NULL;
    if (pTarget) pVictim = pTarget->getVictim();

    //Defaults
    if (!HasAuraName(m_bot,"Horn of Winter") )earth = STRENGTH_OF_EARTH_TOTEM;
    if (!earth) earth = STONESKIN_TOTEM;
    if (!earth) earth = EARTHBIND_TOTEM;
    fire = TOTEM_OF_WRATH;
    if (!fire) fire = FLAMETONGUE_TOTEM;
    if (!fire) fire = SEARING_TOTEM;
    water = MANA_SPRING_TOTEM;
    if (!water) water = HEALING_STREAM_TOTEM;
    if (TALENT_ELEMENTAL || TALENT_RESTO) air = WRATH_OF_AIR_TOTEM;
    else air = WINDFURY_TOTEM;

    //Target reactive stuff
    if (pTarget)
    {
        if (GROUNDING_TOTEM && pTarget->IsNonMeleeSpellCasted(true)) air = GROUNDING_TOTEM;
    }

    if (STONESKIN_TOTEM && isUnderAttack()) earth = STONESKIN_TOTEM;

    uint32 totz[4] = {earth, fire, water, air};

    for (int i = 0; i < 4; i++)
    {
        if (!totz[i]) continue;
        SpellEntry const *tSpell = GetSpellStore()->LookupEntry(totz[i]);
        if (!tSpell) continue;
        uint32 tEntry = (uint32) tSpell->EffectMiscValue[0];
        if (!tEntry) continue;
        CreatureTemplate const *totemEntry = sObjectMgr->GetCreatureTemplate(tEntry);
        if (!tEntry) continue;

        if (CanCast(totz[i], m_bot) && !m_bot->FindNearestCreature(tEntry,30)) { return CastSpell(totz[i],m_bot,false); }
    }
    return false;
}
开发者ID:Anonymus111,项目名称:chaoscore,代码行数:50,代码来源:PlayerbotShamanAI.cpp


示例18: _ASSERT

LTBOOL CAIHelicopterStateAttack::HandleCommand(char** pTokens, int nArgs)
{
	_ASSERT(pTokens && (nArgs >= 1));
    if (!pTokens || nArgs < 1) return LTFALSE;

	if ( CAIHelicopterState::HandleCommand(pTokens, nArgs) )
	{
        return LTTRUE;
	}

	if ( !_stricmp(pTokens[0], "ON") )
	{
		for ( int iWeapon = 0 ; iWeapon < GetAI()->GetNumWeapons() ; iWeapon++ )
		{
			if ( !_stricmp(pTokens[1], GetAI()->GetWeaponPosition(iWeapon)->GetName()) )
			{
				m_pStrategyShoot->ActivateWeapon(iWeapon);
			}
		}

        return LTTRUE;
	}
	else if ( !_stricmp(pTokens[0], "OFF") )
	{
		for ( int iWeapon = 0 ; iWeapon < GetAI()->GetNumWeapons() ; iWeapon++ )
		{
			if ( !_stricmp(pTokens[1], GetAI()->GetWeaponPosition(iWeapon)->GetName()) )
			{
				m_pStrategyShoot->DeactivateWeapon(iWeapon);
			}
		}

        return LTTRUE;
	}

    return LTFALSE;
}
开发者ID:Arc0re,项目名称:lithtech,代码行数:37,代码来源:AIVehicleState.cpp


示例19: GetAI

void PlayerbotWarriorAI::DoNonCombatActions()
{
    PlayerbotAI *ai = GetAI();
    Player * m_bot = GetPlayerBot();
    if (!m_bot)
        return;

    // TODO (by Runsttren): check if shout aura bot has is casted by this bot,
    // otherwise cast other useful shout
    // If the bot is protect talented, she/he needs stamina not attack power.
    // With stance change can the shout change to.
    // Inserted line to battle shout m_bot->HasAura( COMMANDING_SHOUT, EFFECT_INDEX_0)
    // Natsukawa
    if (((COMMANDING_SHOUT > 0 && !m_bot->HasAura(COMMANDING_SHOUT, EFFECT_INDEX_0)) ||
         (BATTLE_SHOUT > 0 && !m_bot->HasAura(BATTLE_SHOUT, EFFECT_INDEX_0))) &&
        ai->GetRageAmount() < 10 && BLOODRAGE > 0 && !m_bot->HasAura(BLOODRAGE, EFFECT_INDEX_0))
        // we do have a useful shout, no rage coming but can cast bloodrage... do it
        ai->CastSpell(BLOODRAGE, *m_bot);
    else if (COMMANDING_SHOUT > 0 && !m_bot->HasAura(COMMANDING_SHOUT, EFFECT_INDEX_0))
        // use commanding shout now
        ai->CastSpell(COMMANDING_SHOUT, *m_bot);
    else if (BATTLE_SHOUT > 0 && !m_bot->HasAura(BATTLE_SHOUT, EFFECT_INDEX_0) && !m_bot->HasAura(COMMANDING_SHOUT, EFFECT_INDEX_0))
        // use battle shout
        ai->CastSpell(BATTLE_SHOUT, *m_bot);

    // buff master with VIGILANCE
    if (VIGILANCE > 0)
        (!GetMaster()->HasAura(VIGILANCE, EFFECT_INDEX_0) && ai->CastSpell(VIGILANCE, *GetMaster()));

    // hp check
    if (m_bot->getStandState() != UNIT_STAND_STATE_STAND)
        m_bot->SetStandState(UNIT_STAND_STATE_STAND);

    Item* pItem = ai->FindFood();
    Item* fItem = ai->FindBandage();

    if (pItem != NULL && ai->GetHealthPercent() < 30)
    {
        ai->TellMaster("I could use some food.");
        ai->UseItem(pItem);
        return;
    }
    else if (pItem == NULL && fItem != NULL && !m_bot->HasAura(RECENTLY_BANDAGED, EFFECT_INDEX_0) && ai->GetHealthPercent() < 70)
    {
        ai->TellMaster("I could use first aid.");
        ai->UseItem(fItem);
        return;
    }
} // end DoNonCombatActions
开发者ID:Swockale,项目名称:portalzero,代码行数:49,代码来源:PlayerbotWarriorAI.cpp


示例20: GetAI

bool PlayerbotPriestAI::BuffPlayer(Player* target)
{
    PlayerbotAI * ai = GetAI();
    Pet * pet = target->GetPet();

    if (pet && ai->Buff(POWER_WORD_FORTITUDE, pet))
        return true;

    if (ai->Buff(POWER_WORD_FORTITUDE, target))
        return true;

    if ((target->getClass() == CLASS_DRUID || target->GetPowerType() == POWER_MANA) && ai->Buff(DIVINE_SPIRIT, target))
        return true;

    return false;
}
开发者ID:alysher,项目名称:portaltbc,代码行数:16,代码来源:PlayerbotPriestAI.cpp



注:本文中的GetAI函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetAISpellInfo函数代码示例发布时间:2022-05-30
下一篇:
C++ Get函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap