public override void execute(List <object> actuator, List <object> target) { controller.Possess(character); scene.Characters.Add(character); scene.GetActors().Add(character); scene.AddAiController(controller); Vector3 position = character.GetCenterPosition(); Vector3 size = character.GetSize(); //Show grass particle effects when the character appears FoliageCutParticleEffectFactory foliageCutFactory = new FoliageCutParticleEffectFactory(new Vector2(position.X, position.Y + 20), (int)size.Length(), 600, new Vector2(0.8f, 1.3f), new Vector2(-0.5f, -1.5f) /*Vector2.Zero*/, 1f, 0f, Color.ForestGreen, Color.Brown, 400, rotVel: 0.75f); ParticleEffectManager foliageCutEffectManager = new ParticleEffectManager(ParticleConfig.FOLIAGE_CUT_TEXTURE, foliageCutFactory, 30, 200, false, BlendState.NonPremultiplied, effectDuration: 600); scene.ParticleEffects.Add(foliageCutEffectManager); }
private void DespawnAi() { Path.Clear(); scene.RemoveActor(Character()); scene.Characters.Remove(Character()); scene.RemoveAiController(this); //Remove footstep particle effect for the current Ai scene.RemoveParticleEffect(Character().CharacterPhysics.FootstepEffectManager); //Show particle effects if AI disappears Vector3 position = Character().GetCenterPosition(); Vector3 size = Character().GetSize(); FoliageCutParticleEffectFactory foliageCutFactory = new FoliageCutParticleEffectFactory(new Vector2(position.X, position.Y + 20), (int)size.Length(), 600, new Vector2(0.8f, 1.3f), new Vector2(-0.5f, -10f) /*Vector2.Zero*/, 1f, 0f, Color.ForestGreen, Color.Brown, 400, rotVel: 0.75f); ParticleEffectManager foliageCutEffectManager = new ParticleEffectManager(ParticleConfig.FOLIAGE_CUT_TEXTURE, foliageCutFactory, 30, 200, false, BlendState.NonPremultiplied, effectDuration: 600); scene.ParticleEffects.Add(foliageCutEffectManager); }
public void CharacterCut(Character actuatingCharacter) { if (!Active) { return; } Active = false; CharacterCutEventList.Execute(new List <object>() { actuatingCharacter }, new List <object>() { this }); //show particle effect FoliageCutParticleEffectFactory foliageCutFactory = new FoliageCutParticleEffectFactory(new Vector2(position.X, position.Y - size.Y / 2), (int)size.Length(), 500, new Vector2(5, 5), Vector2.Zero, 1f, 0f, Color.White, Color.White, 500, rotVel: 2f); ParticleEffectManager foliageCutEffectManager = new ParticleEffectManager(ParticleConfig.FOLIAGE_CUT_TEXTURE, foliageCutFactory, 1, 128, false, BlendState.NonPremultiplied, effectDuration: 500); scene.ParticleEffects.Add(foliageCutEffectManager); }