本文整理汇总了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);
}
示例2: SetDuration
//-----------------------------------------------------------------------------
CHeal::CHeal(LPDIRECT3DDEVICE7 m_pd3dDevice)
{
SetDuration(1000);
ulCurrentTime = ulDuration + 1;
pPS = new CParticleSystem();
}
示例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
}
示例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;
}
示例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++;
}
示例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;
}
示例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;
// }
}
}
示例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);
}
示例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;
}
}
示例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");
}
示例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;
}
示例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;
}
示例13: SetDuration
CHeal::CHeal()
{
SetDuration(1000);
ulCurrentTime = ulDuration + 1;
pPS = new ParticleSystem();
}
示例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 );
}
示例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);
}