void C_WeaponPortalgun::OnDataChanged( DataUpdateType_t updateType ) { BaseClass::OnDataChanged( updateType ); if ( updateType == DATA_UPDATE_CREATED ) { // Start thinking (Baseclass stops it) SetNextClientThink( CLIENT_THINK_ALWAYS ); { C_BaseAnimating::AutoAllowBoneAccess boneaccess( true, true ); StartEffects(); } DoEffect( m_EffectState ); } // Update effect state when out of parity with the server else if ( m_nOldEffectState != m_EffectState || m_bOldCanFirePortal1 != m_bCanFirePortal1 || m_bOldCanFirePortal2 != m_bCanFirePortal2 ) { DoEffect( m_EffectState ); m_nOldEffectState = m_EffectState; m_bOldCanFirePortal1 = m_bCanFirePortal1; m_bOldCanFirePortal2 = m_bCanFirePortal2; } }
void DoStart (GPtr globals) { ValidateParameters (globals); /* if stuff hasn't been initialized that we need, do it, then go check if we've got scripting commands to override our settings */ // update our parameters with the scripting parameters, if available ReadScriptParams (globals); // always reset the global document descriptor for safety gDocDesc = gDocInfo; if (gQueryForParameters) { DoUI (globals); // Show the UI gQueryForParameters = FALSE; } // Delete the memory we used for the Proxy view ReleaseProxyMemory(globals); if (gResult != noErr) return; // Do the actual filtering operation on the original image DoEffect(globals); }
IPTR mDraw(Class *cl, Object *obj, struct MUIP_Draw *msg) { mybug(0, ("mDraw gets called\n")); struct InstData *data = INST_DATA(cl, obj); WORD y; IPTR retval; static ULONG sec=0, mic=0, lastTick=0, currTick=0; retval = DoSuperMethodA(cl, obj, (Msg)msg); if (!(msg->flags & (MADF_DRAWOBJECT | MADF_DRAWUPDATE))) return 0; if(data->ps3eye_ep1pipe) { for(y= 0; y < _mheight(obj); y++) { WORD col; col = ((y + data->pos) / 8) % 2; SetAPen(_rp(obj), _pens(obj)[col ? MPEN_SHADOW : MPEN_SHINE]); RectFill(_rp(obj), _mleft(obj), _mtop(obj) + y, _mright(obj), _mtop(obj) + y); } data->pos++; } else { /* Add static distortion or old crt-monitor effect */ if(data->resolutionvga) { DoEffect(kitty640_pure, kitty, 640, 480); WritePixelArray(kitty, 0, 0, 640*4, _rp(obj), _mleft(obj), _mtop(obj), _mwidth(obj), _mheight(obj), RECTFMT_RGB032); // WritePixelArray(kitty640_pure, 0, 0, 640*4, _rp(obj), _mleft(obj), _mtop(obj), _mwidth(obj), _mheight(obj), RECTFMT_RGB032); //+(rand() % (10)) } else { DoEffect(kitty320_pure, kitty, 320, 240); WritePixelArray(kitty, 0, 0, 320*4, _rp(obj), _mleft(obj), _mtop(obj), _mwidth(obj), _mheight(obj), RECTFMT_RGB032); } } //lastTick = currTick; //CurrentTime(&sec, &mic); //currTick = ((sec * 1000) + (mic / 1000)); //mybug(-1, ("Delta %d mS\n", currTick-lastTick)); return retval; }
void ParticleSys::Update() { if (effect != NONE) { for (int i = 0; i < numParticles; i++) { particles[i]->SetColor(sysColor); particles[i]->Update(); } DoEffect(effect); } }
void CWeaponPortalgun::OpenProngs( bool bOpenProngs ) { if ( m_bOpenProngs == bOpenProngs ) { return; } m_bOpenProngs = bOpenProngs; DoEffect( ( m_bOpenProngs ) ? ( EFFECT_HOLDING ) : ( EFFECT_READY ) ); SendWeaponAnim( ( m_bOpenProngs ) ? ( ACT_VM_PICKUP ) : ( ACT_VM_RELEASE ) ); }
void APowerup::Tick () { if (Owner == NULL) { Destroy (); } else if (EffectTics > 0) { DoEffect (); if (--EffectTics == 0) { Destroy (); } } }
void CWeaponCombatCannon::CombatHealIncrement( void ) { CBasePlayer *pPlayer = ToBasePlayer( GetOwner() ); // Find and check the player's punch angle for // a block in sight CBlockBase *pBlock = FindTraceBlock(); if( !pBlock ) { ResetHealing(); return; } if ( pBlock->GetHealth() + lf_heal_increment_combat.GetFloat() >= pBlock->GetMaxHealth() ) { return; } else if ( pPlayer->GetTeamNumber() != pBlock->GetTeamNumber() ) { // You may not heal a block not belonging to your team return; } m_vecPlayerHealPosition = m_tr.endpos; // Check if the player has moved too far back from the freezing point float healDistance = fabs( ( pPlayer->GetAbsOrigin() - m_vecPlayerHealPosition ).Length() ); if ( healDistance > lf_heal_distance_combat.GetFloat() ) { ResetHealing(); return; } // First time heaing, so start the sound if ( m_flLastHeal <= 0.0f ) { // Play our repairing noise pBlock->EmitSound( "Luminousforts.Repair" ); m_pLastBlock = pBlock; } // Start healing the block if ( m_flLastHeal + lf_heal_delay_combat.GetFloat() <= gpGlobals->curtime ) { pBlock->SetHealth( pBlock->GetHealth() + lf_heal_increment_combat.GetFloat() ); SendWeaponAnim( ACT_VM_PRIMARYATTACK ); DoEffect( EFFECT_HOLDING ); float health = pBlock->GetHealth(); float maxHealth = pBlock->GetMaxHealth(); float percentage = ( health / maxHealth ) * 100; // Send a message with information on the amount frozen. CSingleUserRecipientFilter user( ToBasePlayer( GetOwner() ) ); // Send our stuff over the wire UserMessageBegin( user, "UpdateFreezeProgress" ); WRITE_BYTE( 1 ); // Letting the HUD know it's time to turn on WRITE_LONG( SFH_FREEZEPROGRESS_HEALING ); WRITE_FLOAT( percentage ); MessageEnd(); m_bHealing = true; m_flLastHeal = gpGlobals->curtime; } }