当前位置: 首页>>代码示例>>C++>>正文


C++ IEntity::GetEntityClass方法代码示例

本文整理汇总了C++中IEntity::GetEntityClass方法的典型用法代码示例。如果您正苦于以下问题:C++ IEntity::GetEntityClass方法的具体用法?C++ IEntity::GetEntityClass怎么用?C++ IEntity::GetEntityClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IEntity的用法示例。


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

示例1: createSkillAttackEffect


//.........这里部分代码省略.........
	{
		nActionId = 0;
	}

	ac.actionId = nActionId;

	ac.loops = context.loops;
	ac.fAnimateSpeed = getFloat(context.id, SkillViewProperty_AttackActSpeed);
	ac.isSpellAttack = context.isSpellSkill;
    //  冲锋技能是在瞬移效果完成后再做攻击动作;
	ulong effectType = getInt(context.id, SkillViewProperty_EffectType);
	if ( effectType != EffectType_Jump
		/*&& effectType != EffectType_RapidMove*/) // modify by zjp;冲锋的过程中做动作
	{
		if (ac.actionId!=0)		
		{
			//bool bMounted = false;
			//pSourceEntityView->onCommand(EntityCommand_GetMount, (ulong)&bMounted);
			//if (bMounted)
			{
				pSourceEntityView->onCommand(EntityCommand_SetMount, 0);
			}
			pSourceEntityView->onCommand(EntityCommand_Attack, (ulong)&ac);
		}
	}
    //  捆仙索在完成后也不需要做动作  
	if (effectType == EffectType_DestRapidMove || effectType == EffectType_SrcDestRapidMove)
    {
        ac.actionId = 0;
    }

    //  施法光效;
    int nAttackMagicID = getInt(context.id, SkillViewProperty_AttackMagicId);
    if (nAttackMagicID != 0)
    {
        EffectContext_General ec;
        ec.magicId = nAttackMagicID;
        ec.loops = 1;
        ec.angle = magicAngle;
		//  读取一下光效是否绑定在源上;
		int nAttackMagicAttachToSource = getInt(context.id, SkillViewProperty_AttackMagicAttachToSource);
		if (nAttackMagicAttachToSource == 1)
		{
			ec.owner = context.src;
		}
		else
		{
			ec.owner = 0;
		}
		// modify by zjp.修改特效释放的位置
		//ec.tile = pSourceEntityView->getTile();
		ec.tile = context.ptCenter;

        EffectControl_General* ctrl = new EffectControl_General();
        if (!ctrl->create(ec))
        {
            delete ctrl;
            return false;
        }
        ctrl->setSrc(context.src);
        ctrl->setViewId(context.id);
        EffectControlManager::getInstance().add(ctrl);
    }

	//播放攻击声效
	const IntArray & nSoundIDArray = getIntArray(context.id,SkillViewProperty_SoundIDAttack);
	int nSoundCount = nSoundIDArray.count;
	int nSoundID = 0;
	if (nSoundCount == 1)
	{
		nSoundID = nSoundIDArray.data[0];
	}
	else if (nSoundCount > 1)
	{
		IEntity* pEntity = (IEntity*)pSourceEntityView->getUserData();
		if (pEntity && pEntity->GetEntityClass()->IsPerson())
		{
			int PersonSex = pEntity->GetNumProp(CREATURE_PROP_SEX);
			if (PersonSex == PERSON_SEX_MALE)
			{
				nSoundID = nSoundIDArray.data[0];
			}
			else if(PersonSex == PERSON_SEX_FEMALE)
			{
				nSoundID = nSoundIDArray.data[1];
			}
		}
	}
	int nSoundLoop = getInt(context.id,SkillViewProperty_bSoundLoopeAttack);
	if (nSoundID>1000)
	{
		IFormManager* pFormManger = gGlobalClient->getFormManager();
		if (pFormManger)
		{
			pFormManger->PlaySound(nSoundID,nSoundLoop,0.8,SOUNDRES_TYPE_SOUND);
		}
	}

	return true;
}
开发者ID:lorichen,项目名称:xgame,代码行数:101,代码来源:EntityFactory.cpp


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