Example #1
0
func Script162()
{
	if (GetAction(FindObject(ELEC))!="Drill") return(goto(162));
	RemoveEffect("StayNearElev",constructor_clnk,0,0);
	RemoveEffect("StayNearCata",catapult_clnk,0,0);
	SetPlrShowControl(0,"0_2345678_012345678 __________");
}
Example #2
0
func ClearEffects()
{
	RemoveEffect("FollowMaster", this);
	RemoveEffect("MoveTo", this);
	RemoveEffect("HomeCall", this);
	RemoveEffect("Idle", this);
}
Example #3
0
func Attack_5()
{
	if (this.planes[0]->GetX() > 880) return ScheduleSame(5);
	MessageBoxAll("$Attack3$", npc_lara, true); // oh god!
	for (var i=0; i<3; ++i)
	{
		this.planes[i]->StartInstantFlight(270, 15);
		this.planes[i]->SetXDir(-15);
		this.planes[i]->SetYDir(0);
	}
	SetViewTarget(g_flagpole);
	// NPCs go nuts
	RemoveEffect("NewtonHammering", npc_newton);
	RemoveEffect("LaraWalking", npc_lara);
	RemoveEffect("WoodyWalking", npc_woody);
	AddEffect("Attack_Panic", npc_newton, 1, 30, this);
	AddEffect("Attack_Panic", npc_lara, 1, 35, this);
	AddEffect("Attack_Panic", npc_woody, 1, 40, this);
	AddEffect("Attack_Panic", npc_lisa, 1, 45, this);
	// Update dialogues; remove attention markers
	for (var npc in [npc_newton, npc_lara, npc_woody, npc_lisa, npc_rocky])
	{
		var dlg = Dialogue->FindByTarget(npc);
		if (dlg)
		{
			dlg->RemoveAttention();
			dlg->SetDialogueProgress(100);
		}
	}
	// Start dropping bombs immediately
	return CallNext();
}
Example #4
0
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects)
{
    ALCdevice *device;
    ALCcontext *context;
    ALeffect *effect;
    ALsizei i;

    context = GetContextRef();
    if(!context) return;

    if(!(n >= 0))
        SET_ERROR_AND_GOTO(context, AL_INVALID_VALUE, done);

    device = context->Device;
    for(i = 0;i < n;i++)
    {
        if(effects[i] && LookupEffect(device, effects[i]) == NULL)
            SET_ERROR_AND_GOTO(context, AL_INVALID_NAME, done);
    }
    for(i = 0;i < n;i++)
    {
        if((effect=RemoveEffect(device, effects[i])) == NULL)
            continue;
        FreeThunkEntry(effect->id);

        memset(effect, 0, sizeof(*effect));
        free(effect);
    }

done:
    ALCcontext_DecRef(context);
}
Example #5
0
func HitByHook(hook)
{
	if(!snapped)
		return;
		
	Unstuck();
	snapped = 0;
	var fx = GetEffect("Travel", this);
	RemoveEffect("Travel", this);
	SetAction("Idle");
	
	/*
	var dir;
	if(GetX() > hook->GetX())
		dir = 1;
	else
		dir = -1;*/
		
	var angle = Angle(hook->GetX(), hook->GetY(), GetX(), GetY());
	
	//var angle = fx.angle - 45 * -fx.dir;
	var xdir = Sin(angle, Speed);
	var ydir = -Cos(angle, Speed);
	//var xdir = Cos(angle, Speed);
	//var ydir = Sin(angle, Speed);
	Bounce(xdir, ydir);
}
Example #6
0
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects)
{
    ALCcontext *Context;
    ALeffect *Effect;
    ALsizei i;

    Context = GetContextRef();
    if(!Context) return;

    al_try
    {
        ALCdevice *device = Context->Device;
        CHECK_VALUE(Context, n >= 0);
        for(i = 0;i < n;i++)
        {
            if(effects[i] && LookupEffect(device, effects[i]) == NULL)
                al_throwerr(Context, AL_INVALID_NAME);
        }

        for(i = 0;i < n;i++)
        {
            if((Effect=RemoveEffect(device, effects[i])) == NULL)
                continue;
            FreeThunkEntry(Effect->id);

            memset(Effect, 0, sizeof(*Effect));
            free(Effect);
        }
    }
    al_endtry;

    ALCcontext_DecRef(Context);
}
Example #7
0
global func StopAttaching(object pObj) {
	// Kein Objekt vorhanden?
	if (!pObj && !(pObj = this))
		return;
	
	return RemoveEffect("Attach", pObj);
}
int32_t C4SoundSystem::LoadEffects(C4Group &hGroup, const char *namespace_prefix, bool group_is_root)
{
	// Local definition sounds: If there is a Sound.ocg in the group, load the sound from there
	if(group_is_root && hGroup.FindEntry(C4CFN_Sound))
	{
		C4Group g;
		g.OpenAsChild(&hGroup, C4CFN_Sound, false, false);
		return LoadEffects(g, namespace_prefix, false);
	}
	int32_t iNum=0;
	char szFilename[_MAX_FNAME+1];
	char szFileType[_MAX_FNAME+1];
	C4SoundEffect *nsfx;
	// Process segmented list of file types
	for (int32_t i = 0; SCopySegment(C4CFN_SoundFiles, i, szFileType, '|', _MAX_FNAME); i++)
	{
		// Search all sound files in group
		hGroup.ResetSearch();
		while (hGroup.FindNextEntry(szFileType, szFilename))
			// Create and load effect
			if ((nsfx = new C4SoundEffect))
			{
				if (nsfx->Load(szFilename, hGroup, namespace_prefix))
				{
					// Overload same name effects
					RemoveEffect(nsfx->Name);
					// Add effect
					nsfx->Next=FirstSound;
					FirstSound=nsfx;
					iNum++;
				}
				else
					delete nsfx;
			}
	}
	// Load subgroups from Sound.ocg and other subgroups
	if (!group_is_root)
	{
		hGroup.ResetSearch();
		while (hGroup.FindNextEntry(C4CFN_SoundSubgroups, szFilename))
		{
			// Load from subgroup as a sub-namespace
			// get namespace name
			StdStrBuf sub_namespace;
			if (namespace_prefix)
			{
				sub_namespace.Copy(namespace_prefix);
				sub_namespace.Append("::");
			}
			sub_namespace.Append(szFilename, strlen(szFilename) - strlen(C4CFN_SoundSubgroups) + 1);
			// load from child group
			C4Group subgroup;
			if (subgroup.OpenAsChild(&hGroup, szFilename, false, false))
			{
				iNum += LoadEffects(subgroup, sub_namespace.getData(), false);
			}
		}
	}
	return iNum;
}
Example #9
0
int32_t C4SoundSystem::LoadEffects(C4Group &hGroup, BOOL fStatic) {
  int32_t iNum = 0;
  char szFilename[_MAX_FNAME + 1];
  char szFileType[_MAX_FNAME + 1];
  C4SoundEffect *nsfx;
  // Process segmented list of file types
  for (int32_t i = 0;
       SCopySegment(C4CFN_SoundFiles, i, szFileType, '|', _MAX_FNAME); i++) {
    // Search all sound files in group
    hGroup.ResetSearch();
    while (hGroup.FindNextEntry(szFileType, szFilename))
      // Create and load effect
      if (nsfx = new C4SoundEffect)
        if (nsfx->Load(szFilename, hGroup, fStatic)) {
          // Overload same name effects
          RemoveEffect(szFilename);
          // Add effect
          nsfx->Next = FirstSound;
          FirstSound = nsfx;
          iNum++;
        } else
          delete nsfx;
  }
  return iNum;
}
Example #10
0
func FxProducePowerStop(target, effect, reason, temp)
{
	if(temp) return;
	MakePowerProducer(0);
	
	if(GetEffect("Sparkle", this))
		RemoveEffect("Sparkle", this);
}
Example #11
0
global func RemoveRemoveNotification(int id, object target)
{
	if(!target)
	{
		return;
	}
	return RemoveEffect(0, target, id);
}
Example #12
0
global func FxRenaniteTimer(object pTarget)
{
  if(GetEffect("Genuced",pTarget))
  {
   RemoveEffect("Genuced",pTarget);
   SetClrModulation(0,pTarget);
  }
  return(1);
}
Example #13
0
func OnNotEnoughPower()
{
	// not enough power to sustain a battery - turn off
	if(GetEffect("ConsumePower", this))
		RemoveEffect("ConsumePower", this);
	
	ScheduleCall(this, "UnmakePowerConsumer", 1, 0);
	return _inherited(...);
}
Example #14
0
global func FxFireStop(object obj, int iNumber, int iReason, bool fTemp)
  {
  if (!fTemp)
    {
    // Das Objekt wurde gelöscht (entweder durch den Löscheffekt, oder anderswie): Löcheffekt entfernen
    RemoveEffect("IntExtinguisher", obj, 0, true);
    }
  return(inherited(obj, iNumber, iReason, fTemp));
  }
Example #15
0
func Departure(object container)
{
	// Always end the movement impairing effect when exiting
	if (movement_effect)
	{
		RemoveEffect(nil, container, movement_effect);
		movement_effect = nil;
	}
}
Example #16
0
global func StopFading(object pObject) {
	if (!pObject) {
		pObject = this;
	}
	var eff = GetEffectCount("*Fade*",pObject);
	for (eff; eff; eff--) {
		RemoveEffect("*Fade*",pObject);
	}
}
Example #17
0
public func ControlUp(object clonk)
{
	if(GetEffect("SparklingAttention",this)) RemoveEffect("SparklingAttention",this);
	if (GetAction() == "Still" && targetdoor)
	{
		targetdoor->OpenDoor();
		SetAction("SpinLeft");
		Sound("Chain");
	}
}
Example #18
0
func StartJump()
{
	// Reset jump acceleration
	var fx = GetEffect("JumpingSpeedAdjustment", this);
	if (fx) RemoveEffect(nil, this, fx);
	this.ActMap.Jump.Accel = this.ActMap.Jump.Prototype.Accel;
	this.ActMap.Jump.Decel = this.ActMap.Jump.Prototype.Decel;
	AddEffect("JumpingSpeedAdjustment", this, 1, 2, this);
	return inherited(...);
}
Example #19
0
global func FxNaniteTimer(object pTarget)
{
  if(GetEffect("Genuced",pTarget))
  {
   RemoveEffect("Genuced",pTarget);
   SetClrModulation(0,pTarget);
  }
  
  if(GetAction(pTarget) eq "Lie")
  {
   RemoveEffect("Nanite",pTarget);
   RemoveEffect("Renanite",pTarget);
   ResetPhysical(pTarget);
   return(-1);
  }

  pTarget -> DoEnergy(1);
  SetPhysical("Energy", 300000, PHYS_StackTemporary, pTarget);
  return(1);
}
Example #20
0
func Clear()
{
	// timer
	RemoveEffect("IntExecute", this);
	// helper objects
	for (var i=0; i<n_streams; ++i)
		if (streams[i].debug) streams[i].debug->RemoveObject();
	streams = nil;
	n_streams = 0;
	map = nil;
}
Example #21
0
global func ClearScheduleCall(object pObj, string strFunction)
{
  var i, iEffect;
  // Von Effektzahl abwärts zählen, da Effekte entfernt werden
  i = GetEffectCount("IntScheduleCall", pObj);
  while (i--)
    // Alle ScheduleCall-Effekte prüfen
    if (iEffect = GetEffect("IntScheduleCall", pObj, i))
      // Gesuchte Zielfunktion
      if (EffectVar(0, pObj, iEffect) S= strFunction)      
        // Effekt löschen
        RemoveEffect(0, pObj, iEffect);
}
void URPGAttributeComponent::SetPeriodicEffect(class URPGEffectPeriodic* newEffect)
{

	//if effect has been found on array
	//we will check if it have special properties
	//some effects will not be appiled multiple times
	//instead they can have their duration extended
	//or can be reseted. depends on designer choices.
	if (PeriodicEffectsList.Num() > 0)
	{
		URPGEffectPeriodic* firstMatch = NULL;
		for (auto it = PeriodicEffectsList.CreateIterator(); it; ++it)
		{
			URPGEffectPeriodic* match = PeriodicEffectsList[it.GetIndex()];
			if (match->OwnedTags == newEffect->OwnedTags)
			{
				firstMatch = match;
				break;
			}
		}

		if (firstMatch)
		{
			//if effect have stackable duration
			if (firstMatch->StackDuration == true)
			{
				//we simply get duration of current effect on array
				//and add new duration to total pool.
				firstMatch->TotalDuration += newEffect->TotalDuration;
				return;
			}

			/*
			Default behavior
			if the effect is on the list
			we remove it from it
			and then apply it again.
			This way we reset current effect, so we won't end up with multiple effects doing
			the same thing.
			*/
			RemoveEffect(firstMatch);
			PeriodicEffectsList.Add(newEffect);
		}
	}



	//GetWorld()->GetTimerManager().SetTimer(newEffect->EffectTimerDel, newEffect->PeriodLenght, true);

	PeriodicEffectsList.Add(newEffect);
}
Example #23
0
func Attack_8()
{
	// NPCs return to center of village at regular speed
	for (var npc in [npc_newton, npc_lara, npc_lisa, npc_woody])
	{
		RemoveEffect("Attack_Panic", npc);
		npc.ActMap = Clonk.ActMap;
		npc->SetAction("Walk");
	}
	npc_newton->SetCommand("MoveTo", 0, 422, 342);
	npc_lara->SetCommand("MoveTo", 0, 455, 358);
	npc_lisa->SetCommand("MoveTo", 0, 474, 358);
	npc_woody->SetCommand("MoveTo", 0, 493, 358);
	return ScheduleNext(150);
}
Example #24
0
// Removes invincibility from object
global func ClearInvincible()
{
	if (!this) return nil;
	var fx = GetEffect("IntInvincible", this);
	if (fx)
	{
		this.OnShockwaveHit = fx.OnShockwaveHit;
		this.RejectWindbagForce = fx.RejectWindbagForce;
		this.QueryCatchBlow = fx.QueryCatchBlow;
	} else { // just to be sure
		this.OnShockwaveHit = this->GetID().OnShockwaveHit;
		this.RejectWindbagForce = this->GetID().RejectWindbagForce;
		this.QueryCatchBlow = this->GetID().QueryCatchBlow;
	}
	return RemoveEffect("IntInvincible", this);
}
void CEffectsList::Flush( void )
{
	int i;
	CClientSideEffect *effect;

	// Go backwards so deleting effects doesn't screw up
	for ( i = m_nEffects - 1 ; i >= 0; i-- )
	{
		effect = m_rgEffects[ i ];
		
		if ( effect == NULL )
			continue;

		RemoveEffect( i );
	}
}
Example #26
0
AL_API ALvoid AL_APIENTRY alDeleteEffects(ALsizei n, const ALuint *effects)
{
    ALCcontext *Context;
    ALCdevice *device;
    ALeffect *ALEffect;
    ALsizei i;

    Context = GetContextRef();
    if(!Context) return;

    device = Context->Device;
    if(n < 0)
        alSetError(Context, AL_INVALID_VALUE);
    else
    {
        // Check that all effects are valid
        for(i = 0;i < n;i++)
        {
            if(!effects[i])
                continue;

            if(LookupEffect(device, effects[i]) == NULL)
            {
                alSetError(Context, AL_INVALID_NAME);
                n = 0;
                break;
            }
        }

        for(i = 0;i < n;i++)
        {
            // Recheck that the effect is valid, because there could be duplicated names
            if((ALEffect=RemoveEffect(device, effects[i])) == NULL)
                continue;
            FreeThunkEntry(ALEffect->effect);

            memset(ALEffect, 0, sizeof(ALeffect));
            free(ALEffect);
        }
    }

    ALCcontext_DecRef(Context);
}
Example #27
0
    void ParticleManager::AddPreLoadedEffect( Effect* e, int frames, int layer /*= 0*/ )
    {
        if (layer >= _effectLayers)
            layer = 0;

        float tempTime = _currentTime;
        _currentTime -= frames * EffectsLibrary::GetUpdateTime();
        e->ChangeDoB(_currentTime);

        for (int i = 0; i < frames; ++i)
        {
            _currentTime = (frames + 1) * EffectsLibrary::GetUpdateTime();
            e->Update();
            if (e->IsDestroyed())
                RemoveEffect(e);
        }
        _currentTime = tempTime;
        e->SetEffectLayer(layer);
        _effects[layer].insert(e);
    }
Example #28
0
void CHuiFxEngine::NotifyEffectEndObservers()
    {
    for ( TInt i = iActiveEffects.Count() - 1; i >= 0; i-- )
        {
        CHuiFxEffect* effect = iActiveEffects[i];
        if (!(effect->EffectFlags() & KHuiFadeEffectFlag) && !effect->Changed())
            {
#ifdef HUIFX_TRACE
            RDebug::Printf("void CHuiFxEngine::NotifyEffectEndObservers() calling NotifyEffectEndObserver");
#endif
            if (!effect->NotifyEffectEndObserver())
                {
				// this effect is not in effect cleanupstack and does not have end observer on coretoolkit
				// side. However, it might have observer on alf side, that is notified from RemoveEffect.
				// Alf clients are responsible for destroying their own effects
                RemoveEffect(effect);
                }
            }
        }    
    }
//-----------------------------------------------------------------------------
// Purpose: Iterate through list and simulate/draw stuff
// Input  : frametime - 
//-----------------------------------------------------------------------------
void CEffectsList::DrawEffects( double frametime )
{
	VPROF_BUDGET( "CEffectsList::DrawEffects", VPROF_BUDGETGROUP_PARTICLE_RENDERING );
	int i;
	CClientSideEffect *effect;

	// Go backwards so deleting effects doesn't screw up
	for ( i = m_nEffects - 1 ; i >= 0; i-- )
	{
		effect = m_rgEffects[ i ];
		if ( !effect )
			continue;

		// Simulate
		effect->Draw( frametime );

		// Remove it if needed
		if ( !effect->IsActive() )
		{
			RemoveEffect( i );
		}
	}
}
Example #30
0
func Intro_Start()
{
	// Intro starts high up in the clouds
	Music("TheSkylands");
	LoadScenarioSection("Intro");
	SetWind(-100);
	this.intro_skyscroll_xdir = -10;
	SetSkyParallax(0, 20, 20, this.intro_skyscroll_xdir, 0);
	
	this.plane = CreateObjectAbove(Airplane, 500, 200);
	this.plane->SetColor(0xa04000);
	this.pilot = CreateObjectAbove(Clonk, 100, 100, NO_OWNER);
	this.pilot->MakeInvincible();
	this.pilot->SetSkin(2);
	this.pilot->Enter(this.plane);
	this.pilot->SetAction("Walk");

	this.pilot->SetName("Pyrit");
	this.pilot->SetColor(0xff0000);
	this.pilot->SetAlternativeSkin("MaleBrownHair");
	this.pilot->SetDir(DIR_Left);
	this.pilot->SetObjectLayer(this.pilot);
	this.pilot->AttachMesh(Hat, "skeleton_head", "main", Trans_Translate(5500, 0, 0)); // Hat is seen in the cockpit!

	this.plane->PlaneMount(this.pilot);
	this.plane.FxIntPlaneTimer = this.Intro_PlaneTimer;
	RemoveEffect("IntPlane", this.plane);
	AddEffect("IntPlane",this.plane,1,1,this.plane);
	this.plane->FaceRight();
	this.plane->StartInstantFlight(90, 0);
	g_intro_sky_moving = true;
	

	SetViewTarget(this.plane);

	return ScheduleNext(100, 1);
}