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


C++ SetDuration函数代码示例

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


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

示例1: Update

			void Update(AuraEffect* effect)
			{
				// Xinef: Charm is removed when target is at or below 50%hp
				if (Unit* owner = GetUnitOwner())
					if (owner->GetHealthPct() <= 50)
						SetDuration(0);
			}
开发者ID:DSlayerMan,项目名称:Sunwell,代码行数:7,代码来源:boss_shirrak_the_dead_watcher.cpp

示例2: SetDuration

//-----------------------------------------------------------------------------
CHeal::CHeal(LPDIRECT3DDEVICE7 m_pd3dDevice)
{
	SetDuration(1000);
	ulCurrentTime = ulDuration + 1;

	pPS = new CParticleSystem();
}
开发者ID:OpenSourcedGames,项目名称:Arx-Fatalis,代码行数:8,代码来源:ARX_SpellFX_Lvl02.cpp

示例3: SetDataL

EXPORT_C void CLogEvent::CopyL(const CLogEvent& aEvent)
/** Makes a copy of the specified log event.

@param aEvent The log event to be copied. */
	{
	// Set data first as this is the only function that can leave
	// If this function fails nothing will be changed
	SetDataL(aEvent.Data());

	SetId(aEvent.Id());
	SetEventType(aEvent.EventType());
	SetTime(aEvent.Time());
	SetDurationType(aEvent.DurationType());
	SetDuration(aEvent.Duration());
	SetContact(aEvent.Contact());
	SetLink(aEvent.Link());
	SetDescription(aEvent.Description());
	SetRemoteParty(aEvent.RemoteParty());
	SetDirection(aEvent.Direction());
	SetStatus(aEvent.Status());
	SetSubject(aEvent.Subject());
	SetNumber(aEvent.Number());

	ClearFlags(KLogFlagsMask);
	SetFlags(aEvent.Flags());
#ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
	SetSimId(aEvent.SimId());
#endif
	}
开发者ID:cdaffara,项目名称:symbiandump-os2,代码行数:29,代码来源:LOGEVENT.CPP

示例4: CSpellFx

//-----------------------------------------------------------------------------
CMagicMissile::CMagicMissile(LPDIRECT3DDEVICE7 m_pd3dDevice) : CSpellFx()
{
	eSrc.x = 0;
	eSrc.y = 0;
	eSrc.z = 0;

	SetDuration(2000);
	ulCurrentTime = ulDuration + 1;

	tex_mm = MakeTCFromFile("Graph\\Obj3D\\textures\\(Fx)_bandelette_blue.bmp");

	if (!smissile)
	{
		smissile  = _LoadTheObj("Graph\\Obj3D\\Interactive\\Fix_inter\\fx_magic_missile\\fx_magic_missile.teo", NULL);
		EERIE_3DOBJ_RestoreTextures(smissile);
	}

	smissile_count++;

	fColor[0] = 1;
	fColor[1] = 1;
	fColor[2] = 1;

	fColor1[0] = 1;
	fColor1[1] = 1;
	fColor1[2] = 1;
	bExplo = false;
	bMove = true;
}
开发者ID:sopyer,项目名称:ArxFatalis,代码行数:30,代码来源:ARX_SpellFX_Lvl01.cpp

示例5: CSpellFx

CMagicMissile::CMagicMissile(bool mrCheat)
	: CSpellFx()
	, bExplo(false)
	, bMove(true)
	, eSrc(Vec3f_ZERO)
	, eCurPos()
	, lightIntensityFactor()
	, iLength()
	, iBezierPrecision()
	, fColor(Color3f::white)
	, fTrail()
	, fOneOnBezierPrecision()
	, tex_mm()
	, snd_loop()
	, m_mrCheat(mrCheat)
{
	SetDuration(2000);
	ulCurrentTime = ulDuration + 1;

	tex_mm = TextureContainer::Load("graph/obj3d/textures/(fx)_bandelette_blue");

	if(!smissile)
		smissile = LoadTheObj("graph/obj3d/interactive/fix_inter/fx_magic_missile/fx_magic_missile.teo");

	smissile_count++;
}
开发者ID:byouloh,项目名称:ArxLibertatis,代码行数:26,代码来源:Spells01.cpp

示例6: SetMap

bool AreaTrigger::CreateAreaTrigger(uint32 guidlow, uint32 triggerEntry, Unit* caster, SpellInfo const* spell, Position const& pos, float radius, uint32 duration)
{
    SetMap(caster->GetMap());
    Relocate(pos);
    if (!IsPositionValid())
    {
        sLog->outError("misc", "AreaTrigger (spell %u) not created. Invalid coordinates (X: %f Y: %f)", spell->Id, GetPositionX(), GetPositionY());
        return false;
    }

    WorldObject::_Create(guidlow, HIGHGUID_AREATRIGGER, caster->GetPhaseMask());

    SetEntry(triggerEntry);
    SetDuration(duration ? duration : spell->GetDuration());
    SetObjectScale(1);

    SetGuidValue(AREATRIGGER_FIELD_CASTER, caster->GetGUID128());
    SetUInt32Value(AREATRIGGER_FIELD_SPELL_ID, spell->Id);
    SetUInt32Value(AREATRIGGER_FIELD_SPELL_VISUAL_ID, spell->SpellVisual[0]);
    SetUInt32Value(AREATRIGGER_FIELD_DURATION, spell->GetDuration());
    SetFloatValue(AREATRIGGER_FIELD_EXPLICIT_SCALE, 1.f);

    _radius = radius;

    if (!GetMap()->AddToMap(this))
        return false;

    return true;
}
开发者ID:GlassFace,项目名称:Skyfire-6.1.2-version,代码行数:29,代码来源:AreaTrigger.cpp

示例7: StringToWaveform

void CSubtractiveInstrument::SetNote(CNote *note)
{
	// Get a list of all attribute nodes and the
	// length of that list
	CComPtr<IXMLDOMNamedNodeMap> attributes;
	note->Node()->get_attributes(&attributes);
	long len;
	attributes->get_length(&len);

	StringToWaveform(note->Waveform());

	// Loop over the list of attributes
	for (int i = 0; i < len; i++)
	{
		// Get attribute i
		CComPtr<IXMLDOMNode> attrib;
		attributes->get_item(i, &attrib);

		// Get the name of the attribute
		CComBSTR name;
		attrib->get_nodeName(&name);

		// Get the value of the attribute.  A CComVariant is a variable
		// that can have any type. It loads the attribute value as a
		// string (UNICODE), but we can then change it to an integer 
		// (VT_I4) or double (VT_R8) using the ChangeType function 
		// and then read its integer or double value from a member variable.
		CComVariant value;
		attrib->get_nodeValue(&value);

		if (name == "duration")
		{
			value.ChangeType(VT_R8);
			// number of beats * seconds per beat = seconds for note
			SetDuration(value.dblVal);
		}
		else if (name == "note")
		{
			SetFreq(NoteToFrequency(value.bstrVal));
		}

		if (name == "resonfrequency")
		{
			mResonFilter = true;
			value.ChangeType(VT_R8);
			mResonFrequency = value.dblVal;
		}

//		if (name == "resonbandwidth")
//		{
//			value.ChangeType(VT_R8);
//			mResonBandwidth = value.dblVal;
//		}
//
//		if (name == "filter-envelope")
//		{
//			mFilterEnvelope = true;
//		}
	}
}
开发者ID:ackerrk,项目名称:Cse471-Project1,代码行数:60,代码来源:SubtractiveInstrument.cpp

示例8: SetDuration

//-----------------------------------------------------------------------------
void CMagicMissile::Create(EERIE_3D aeSrc, EERIE_3D angles)
{
	int i;
	EERIE_3D s, e;

	SetDuration(ulDuration);
	SetAngle(angles.b);

	Vector_Copy(&this->angles, &angles);
	eCurPos.x = eSrc.x = aeSrc.x;
	eCurPos.y = eSrc.y = aeSrc.y;
	eCurPos.z = eSrc.z = aeSrc.z;


	fSize = 1;
	bDone = true;

	s.x = eSrc.x;
	s.y = eSrc.y;
	s.z = eSrc.z;
	e.x = eSrc.x;
	e.y = eSrc.y;
	e.z = eSrc.z;

	i = 0;

	i = 40;
	e.x -= fBetaRadSin * 50 * i;
	e.y += sin(DEG2RAD(MAKEANGLE(this->angles.a))) * 50 * i;
	e.z += fBetaRadCos * 50 * i;

	pathways[0].sx = eSrc.x;
	pathways[0].sy = eSrc.y;
	pathways[0].sz = eSrc.z;
	pathways[5].sx = e.x;
	pathways[5].sy = e.y;
	pathways[5].sz = e.z;
	Split(pathways, 0, 5, 50, 0.5f);

	for (i = 0; i < 6; i++)
	{
		if (pathways[i].sy >= eSrc.y + 150)
		{
			pathways[i].sy = eSrc.y + 150;
		}
	}

	fTrail = 0;

	iLength = 50;
	fOneOnLength = 1.0f / (float) iLength;
	iBezierPrecision = BEZIERPrecision;
	fOneOnBezierPrecision = 1.0f / (float) iBezierPrecision;
	bExplo = false;
	bMove = true;

	ARX_SOUND_PlaySFX(SND_SPELL_MM_CREATE, &eCurPos);
	ARX_SOUND_PlaySFX(SND_SPELL_MM_LAUNCH, &eCurPos);
	snd_loop = ARX_SOUND_PlaySFX(SND_SPELL_MM_LOOP, &eCurPos, 1.0F, ARX_SOUND_PLAY_LOOPED);
}
开发者ID:sopyer,项目名称:ArxFatalis,代码行数:61,代码来源:ARX_SpellFX_Lvl01.cpp

示例9: SetDuration

void CLevitate::Create(int def, float rbase, float rhaut, float hauteur, Vec3f * pos, unsigned long _ulDuration)
{
	SetDuration(_ulDuration);

	if (def < 3) return;

	this->CreateConeStrip(rbase, rhaut, hauteur, def, 0);
	this->CreateConeStrip(rbase, rhaut * 1.5f, hauteur * 0.5f, def, 1);

	this->key = 0;
	this->pos = *pos;
	this->rbase = rbase;
	this->rhaut = rhaut;
	this->hauteur = hauteur;
	this->currdurationang = 0;
	this->scale = 0.f;
	this->ang = 0.f;
	this->def = (short)def;
	this->tsouffle = TextureContainer::Load("graph/obj3d/textures/(fx)_sebsouffle");

	this->timestone = 0;
	this->nbstone = 0;


	this->stone[0] = stone0;
	this->stone[1] = stone1;

	int nb = 256;

	while (nb--)
	{
		this->tstone[nb].actif = 0;
	}
}
开发者ID:Eli2,项目名称:ArxLibertatis,代码行数:34,代码来源:Spells05.cpp

示例10: SetDuration

//-----------------------------------------------------------------------------
CSummonCreature::CSummonCreature(LPDIRECT3DDEVICE7 m_pd3dDevice)
{
    eSrc.x = 0;
    eSrc.y = 0;
    eSrc.z = 0;

    SetDuration(1000);
    ulCurrentTime = ulDurationIntro + ulDurationRender + ulDurationOuttro + 1;

    iSize = 100;
    fOneOniSize = 1.0f / ((float) iSize);

    fColorBorder[0] = 1;
    fColorBorder[1] = 1;
    fColorBorder[2] = 1;

    fColorRays1[0] = 1;
    fColorRays1[1] = 1;
    fColorRays1[2] = 1;

    fColorRays2[0] = 0;
    fColorRays2[1] = 0;
    fColorRays2[2] = 0;

    tex_light = MakeTCFromFile("Graph\\Obj3D\\textures\\(Fx)_tsu4.bmp");
}
开发者ID:tramboi,项目名称:ArxFatalis,代码行数:27,代码来源:ARX_SpellFX_Lvl09.cpp

示例11: ConstructPSPoll

void ConstructPSPoll(_adapter *padapter, u8 *pframe, u32 *pLength)
{
	struct rtw_ieee80211_hdr	*pwlanhdr;
	u16					*fctrl;
	struct mlme_ext_priv	*pmlmeext = &(padapter->mlmeextpriv);
	struct mlme_ext_info	*pmlmeinfo = &(pmlmeext->mlmext_info);

	//DBG_871X("%s\n", __FUNCTION__);

	pwlanhdr = (struct rtw_ieee80211_hdr *)pframe;

	// Frame control.
	fctrl = &(pwlanhdr->frame_ctl);
	*(fctrl) = 0;
	SetPwrMgt(fctrl);
	SetFrameSubType(pframe, WIFI_PSPOLL);

	// AID.
	SetDuration(pframe, (pmlmeinfo->aid| 0xc000));

	// BSSID.
	_rtw_memcpy(pwlanhdr->addr1, get_my_bssid(&(pmlmeinfo->network)), ETH_ALEN);

	// TA.
	_rtw_memcpy(pwlanhdr->addr2, myid(&(padapter->eeprompriv)), ETH_ALEN);

	*pLength = 16;
}
开发者ID:kozmo2k4,项目名称:linux-amlogic,代码行数:28,代码来源:rtl8192d_cmd.c

示例12: m_pos

CLightning::CLightning()
	: m_pos(Vec3f_ZERO)
	, m_beta(0.f)
	, m_alpha(0.f)
	, m_caster(EntityHandle::Invalid)
	, m_level(1.f)
	, m_fDamage(1)
	, m_isMassLightning(false),
	m_nbtotal(0),
	m_lNbSegments(40),
	m_invNbSegments(1.0f / 40.0f),
	m_fSize(100.0f),
	m_fLengthMin(5.0f),  
	m_fLengthMax(40.0f),  
	m_fAngleMin(5.0f, 5.0f, 5.0f),
	m_fAngleMax(32.0f, 32.0f, 32.0f)
	, m_iTTL(0)
{
	SetDuration(2000);
	ulCurrentTime = ulDuration + 1;
	
	m_tex_light = NULL;
	fTotoro = 0;
	fMySize = 2;
}
开发者ID:HustLion,项目名称:ArxLibertatis,代码行数:25,代码来源:Lightning.cpp

示例13: SetDuration

CHeal::CHeal()
{
	SetDuration(1000);
	ulCurrentTime = ulDuration + 1;

	pPS = new ParticleSystem();
}
开发者ID:lemmel,项目名称:ArxLibertatis,代码行数:7,代码来源:Spells02.cpp

示例14: SetAmplitude

void CShake::KeyValue( KeyValueData *pkvd )
{
	if (FStrEq(pkvd->szKeyName, "amplitude"))
	{
		SetAmplitude( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else if (FStrEq(pkvd->szKeyName, "frequency"))
	{
		SetFrequency( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else if (FStrEq(pkvd->szKeyName, "duration"))
	{
		SetDuration( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else if (FStrEq(pkvd->szKeyName, "radius"))
	{
		SetRadius( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else
		CPointEntity::KeyValue( pkvd );
}
开发者ID:NoFreeWill,项目名称:MultiplayerSource,代码行数:25,代码来源:effects.cpp

示例15: SetDuration

void CPoisonProjectile::Create(Vec3f _eSrc, float _fBeta)
{
	SetDuration(m_duration);
	
	float fBetaRad = glm::radians(_fBeta);
	fBetaRadCos = glm::cos(fBetaRad);
	fBetaRadSin = glm::sin(fBetaRad);

	eSrc = _eSrc;

	bOk = false;
	
	eMove = Vec3f(-fBetaRadSin * 2, 0.f, fBetaRadCos * 2);
	
	Vec3f rayEnd = eSrc;
	rayEnd.x -= fBetaRadSin * (50 * 20);
	rayEnd.z += fBetaRadCos * (50 * 20);
	
	RaycastResult ray = RaycastLine(eSrc, rayEnd);
	Vec3f dest = ray.hit ? ray.pos : rayEnd;
	
	pathways[0] = eSrc;
	pathways[9] = dest;
	
	Split(pathways, 0, 9, Vec3f(10 * fBetaRadCos, 10, 10 * fBetaRadSin));
	
	fTrail = -1;
	
	ParticleParams pp = g_particleParameters[ParticleParam_Poison2];
	pp.m_direction *= -eMove;
	
	pPS.SetParams(pp);
	pPS.SetPos(eSrc);
	pPS.Update(0);
}
开发者ID:arx,项目名称:ArxLibertatis,代码行数:35,代码来源:Spells05.cpp


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