public override void execute(List <object> actuator, List <object> target) { foreach (object act in actuator) { DefaultCharacter currentCharacter; if (act.GetType().GetTypeInfo().IsSubclassOf(typeof(DefaultCharacter)) || act.GetType() == typeof(DefaultCharacter)) { currentCharacter = (DefaultCharacter)act; if (trap.Active && trap.Loaded) { scene.MatchSoundManager.PlaySoundEffect(SoundEffectEnumeration.Trap); trap.Close(); // Stun the player currentCharacter.CharacterPhysics.CurrentStunTime = ItemsConfig.TRAP_STUN_TIME; currentCharacter.CharacterPhysics.IsStunned = true; trap.TrapCollectEventList.EventList.Add(new TrapCollectEvent(scene, trap)); trap.Loaded = false; } } } }