示例#1
0
bool SecurityCamera::OnTrigger(HOBJECT hSender, const CParsedMsg &cMsg)
{
	static CParsedMsg::CToken s_cTok_Off(s_szOff);
	static CParsedMsg::CToken s_cTok_Reset(s_szReset);
	static CParsedMsg::CToken s_cTok_Gadget(s_szGadget);
	static CParsedMsg::CToken s_cTok_Tripped(s_szTripped);

	if (cMsg.GetArg(0) == s_cTok_Off)
	{
		SetState(eStateOff);
	}
	else if (cMsg.GetArg(0) == s_cTok_Reset)
	{
		SetState(eStateReset);
	}
	else if (cMsg.GetArg(0) == s_cTok_Gadget)
	{
		HandleGadgetMsg(cMsg);
	}
	else if (cMsg.GetArg(0) == s_cTok_Tripped)
	{
		m_bTripped = LTTRUE;
		SetLightColor(eRed);
		SetState(eStateOff);
	}
	else
		return CScanner::OnTrigger(hSender, cMsg);

	return true;
}
示例#2
0
func InitEffect()
{
	Sound("Objects::Weapons::WeaponSwing1", false, 100);
	SetLightRange(30, 70);
	SetLightColor(RGB(150, 150, 150));

	trailparticles =
	{
		Size = 5,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Front
	};
	
	var angle = Angle(0, 0, GetXDir(), GetYDir());
	
	hookprt = 
	{
		Size = 8,
		R = pR,
		G = pG,
		B = pB,
		Attach=ATTACH_Front|ATTACH_MoveRelative,
		Rotation = angle
	};
	
	
	AddEffect("Life", this, 1, LifeTime, this);
	hit = false;
}
示例#3
0
func InitEffect()
{
    Sound("Fire::Fireball", false, 100, nil, nil, nil, 200);
    Sound("Fire::FuseLoop", false, 20, nil, 1, nil, 200);
    SetLightRange(30, 70);
    SetLightColor(RGB(100, 100, 255));

    var snow =
    {
        R = 200,
        G = 200,
        B = 255,
        Alpha = PV_Linear(255, 0),
        Size = PV_Random(0, 2),
        CollisionVertex = 0,
        OnCollision = PC_Stop(),
        ForceX = PV_Random(-5, 5, 10),
        ForceY = PV_Gravity(100),
        DampingX = 900, DampingY = 900
    };

    trail_particles =
    {
        R = PV_Random(200, 255), G = PV_Random(200, 255), B = 255,
        Prototype = Particles_FireTrail(),
        Size = PV_Linear(10, 0),
        BlitMode = nil,
        Rotation = PV_Random(0, 360),
        BlitMode = GFX_BLIT_Additive
    };

    CreateParticle("StarFlash", 0, 0, PV_Random(-30, 30), PV_Random(-30, 30), 100, snow, 100);
}
示例#4
0
func ChargeStop(proplist params)
{
	SetAction("Idle");
	var angle = params.new_angle;
	SetVelocity(angle, Speed-10, 10);
	
	Sound("sawblade_launch", false, 100);
	
	AddEffect("CheckEnemies", this, 1,1, this);
	
	SetLightRange(30, 70);
	SetLightColor(RGB(150, 150, 150));
	
	AddEffect("Life", this, 20, LifeTime, this);

	/*if(GetXDir() > 0)
		SetRDir(15);
	else
		SetRDir(-15);*/
	
	SetClrModulation(RGBa(255,255,255,255));
	Sound("sawloop", false, 20, nil, 1);
	
	AddEffect("Rotate", this, 1, 1, this);
}
//----------------------------------------------------------------------------------
//
//----------------------------------------------------------------------------------
RendererImplemented::RendererImplemented( int32_t squareMaxCount )
	: m_reference	( 1 )
	, m_device	( NULL )
	, m_context	( NULL )
	, m_vertexBuffer( NULL )
	, m_indexBuffer	( NULL )
	, m_squareMaxCount	( squareMaxCount )
	, m_coordinateSystem	( ::Effekseer::CoordinateSystem::RH )
	, m_renderState		( NULL )
	, m_restorationOfStates( true )

	, m_shader(nullptr)
	, m_shader_no_texture(nullptr)
	, m_shader_distortion(nullptr)
	, m_shader_no_texture_distortion(nullptr)
	, m_standardRenderer(nullptr)

	, m_background(nullptr)
	, m_distortingCallback(nullptr)
{
	::Effekseer::Vector3D direction( 1.0f, 1.0f, 1.0f );
	SetLightDirection( direction );
	::Effekseer::Color lightColor( 255, 255, 255, 255 );
	SetLightColor( lightColor );
	::Effekseer::Color lightAmbient( 0, 0, 0, 0 );
	SetLightAmbientColor( lightAmbient );

	m_state = new OriginalState();

#ifdef __EFFEKSEER_RENDERER_INTERNAL_LOADER__
	EffekseerRenderer::PngTextureLoader::Initialize();
#endif
}
示例#6
0
void SecurityCamera::StartFocusingSound()
{
	KillAllSounds();

	// Turn on Yellow sprite...

	TurnLightOn();
	SetLightColor(eYellow);

    uint32 dwFlags = (PLAYSOUND_LOOP | PLAYSOUND_GETHANDLE);

	m_hFocusingSound = g_pServerSoundMgr->PlaySoundFromPos(m_vPos,
		FOCUSING_SOUND, m_fSoundRadius, SOUNDPRIORITY_MISC_LOW, dwFlags);
}
void Environment::NewState()
{
	envStates.push_back( new EnvironmentState );

	// If the states are greater than 2 copy the previous last element
	if( envStates.size() > 1 )
	{
		SetDuration( envStates[envStates.size()-2]->duration );
		SetSkyColor( envStates[envStates.size()-2]->skyColor );
		SetFogColor( envStates[envStates.size()-2]->fogColor );
		SetFogExponent( envStates[envStates.size()-2]->fogExp );
		SetLightColor( envStates[envStates.size()-2]->lightColor );
		SetLightPosition( envStates[envStates.size()-2]->lightPosition );
	}
}
示例#8
0
CScanner::DetectState SecurityCamera::UpdateDetect()
{
	DetectState eDS = CScanner::UpdateDetect();

	switch (eDS)
	{
		case DS_DETECTED :
		{
			SetState(eStateDetected);
		}
		break;

		case DS_FOCUSING :
		{
			SetState(eStateFocusing);
		}
		break;

		case DS_CLEAR :
		{
			// Set us back to whatever we were doing before we
			// start focusing...

			if (m_eState == eStateFocusing)
			{
				StopFocusingSound();
				SetState(m_ePreviousState);
			}

			// Turn on the green light sprite...

			if (m_eState != eStateFocusing && m_eState != eStateDetected)
			{
				TurnLightOn();
				SetLightColor(eGreen);
			}
		}
		break;

		default :
		break;
	}

	return eDS;
}
示例#9
0
func InitEffect()
{
	SetLightRange(30, 70);
	SetLightColor(RGB(255, 255, 0));
	ox=GetX();
	oy=GetY();
	
	trailparticles =
	{
		Size = PV_Linear(5,0),
		Alpha = 128,
		BlitMode = GFX_BLIT_Additive,
		R = 255,
		G = 255,
		B = 50,
	};
	
	AddEffect("Trail", this, 1, 1, this);
	AddEffect("HitCheck", this, 1,1, nil,nil, GetCrew(GetOwner()));
}
示例#10
0
func InitEffect()
{
	Sound("Fire::Fireball", false, 100);
	Sound("Fire::FuseLoop", false, 50, nil, 1);
	SetLightRange(30, 70);
	SetLightColor(RGB(255, 100, 0));
	
	if (shooter.ChampType == ComboMan)
	{
		Speed = 75;
		ParticleSize = 13;
		SpellDamage = 25;
		SetVelocity(Angle(0,0,GetXDir(), GetYDir(), 10), Speed, 10);
	}

	var lightparticle =
	{
		R = 255,
		G = 100,
		B = 0,
		Alpha = 40,
		Size = 50,
		BlitMode = GFX_BLIT_Additive,
		Rotation = PV_Step(30, 0, 1),
		Attach = ATTACH_Back | ATTACH_MoveRelative
		
	};
	CreateParticle("Shockwave", 0, 0, 0, 0, 0, lightparticle);
	
	firetrailparticles =
	{
		Prototype = Particles_FireTrail(),
		Size = PV_Linear(ParticleSize,0),
		BlitMode = GFX_BLIT_Additive,
	};
}
示例#11
0
void SecurityCamera::SetState(State eNewState)
{
	// If we are destroyed we can't go into any other state...

	if( m_eState == eStateDestroyed ) return;
	
	if (m_eState == eNewState) return;
	
	// Handle switching to the new state...

	switch (eNewState)
	{
		case eStateDestroyed:
		{
			// Turn off the sprite...

			TurnLightOn(LTFALSE);

			SetDestroyedModel();

			// Stop sensing.

			EnableSensing( LTFALSE );

			// Camera can't be disabled now...

            g_pCommonLT->SetObjectFlags(m_hObject, OFT_User, 0, USRFLG_GADGET_CAMERA_DISABLER);

			KillAllSounds();
		}
		break;

		case eStateOff:
		{
			KillAllSounds();

			// Stop sensing.

			EnableSensing( LTFALSE );

			// Leave the light on if the camera was tripped...

			if (!m_bTripped)
			{
				// Turn off the light...

				TurnLightOn(LTFALSE);
			}
		}
		break;

		case eStateDisabled:
		{
			// Stop sensing.

			EnableSensing( LTFALSE );

			SetupDisabledState();
			TurnLightOn();
			SetLightColor( eBlue );
			return;  // Don't change states...
		}
		break;

		case eStateFocusing:
		{
			// Sense.

			EnableSensing( LTTRUE );

			// If we're in the detected state, don't re-focus...

			if (m_eState == eStateDetected) return;

			StartFocusingSound();
		}
		break;

		case eStateDetected:
		{
			// Sense.

			EnableSensing( LTTRUE );

			// Turn on Red sprite...

			TurnLightOn();
			SetLightColor(eRed);
		}
		break;

		case eStateReset:
		{
			// Sense.

			EnableSensing( LTTRUE );

			m_bTripped = LTFALSE;

			// Reset the camera...

			if (m_fYaw > m_fYaw1)
			{
				m_ePreviousState = eStatePausingAt1;
				m_eState		 = eStateTurningTo2;

				UpdateSounds(m_ePreviousState);
			}
			else
			{
				m_ePreviousState = eStatePausingAt1;
				m_eState		 = eStatePausingAt1;
			}

            SetNextUpdate(UPDATE_NEXT_FRAME);

			// Make sure we processes detection...

            SetCanProcessDetection( LTTRUE );
			return;
		}
		break;

		default : break;
	}

	m_ePreviousState = m_eState;
	m_eState = eNewState;
}