public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { var playerEntity = entity as PlayerEntity; playerEntity.WeaponController().AddAuxEffect(XmlConfig.EClientEffectType.PullBolt); playerEntity.WeaponController().PlayPullBoltAudio(); }
public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { var playerEntity = entity as PlayerEntity; if (playerEntity != null) { playerEntity.weaponLogic.WeaponEffect.PlayMuzzleSparkEffect(playerEntity.weaponLogic.State); GameAudioMedium.PerformOnGunFire(playerEntity.weaponLogic.State); } }
public virtual void DoEventServer(Entitas.IContexts contexts, IEntity entity, IEvent e) { var playerEntity = entity as PlayerEntity; if (playerEntity != null) { var v = EventInfos.Instance.Allocate(e.EventType, true); v.RewindTo(e); playerEntity.remoteEvents.Events.AddEvent(v); } }
public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { var playerEntity = entity as PlayerEntity; Contexts c = contexts as Contexts; HitPlayerEvent ev = e as HitPlayerEvent; if (playerEntity != null) { ClientEffectFactory.CreateHitPlayerEffect(c, playerEntity.entityKey.Value, ev); } }
public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { var playerEntity = entity as PlayerEntity; Contexts c = contexts as Contexts; HitEnvironmentEvent ev = e as HitEnvironmentEvent; if (playerEntity != null) { ClientEffectFactory.CreateHitEnvironmentEffect(c.clientEffect, c.session.commonSession.EntityIdGenerator, ev.HitPoint, ev.Offset, playerEntity.entityKey.Value, ev.EnvironmentType); } }
/// <summary> /// /// </summary> /// <param name="contexts"></param> /// <param name="entity"></param> /// <param name="e"></param> public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { if ((entity as PlayerEntity).isFlagSelf) { return; } // var controller = (entity as PlayerEntity).AudioController(); AudioEvent audioEvent = e as AudioEvent; // DebugUtil.MyLog("Play event :"+audioEvent.EventType); switch (audioEvent.EventType) { case EEventType.AFootstep: GameAudioMedia.PlayFootstepAudio(audioEvent as AudioFootstepEvent); break; case EEventType.AJumpstep: GameAudioMedia.PlayJumpstepAudio(audioEvent as AudioJumpstepEvent); break; case EEventType.AWeaponFire: GameAudioMedia.PlayWeaponFireAudio(audioEvent as AudioWeaponFireEvent); break; case EEventType.ADefault: GameAudioMedia.PlayUniqueEventAudio(audioEvent as AudioDefaultEvent); break; case EEventType.APullbolt: GameAudioMedia.PlayWeaponReloadAudio(audioEvent as AudioPullboltEvent); break; default: break; } // GameAudioMedium.ProcessWeaponAudio(playerEntity,allContexts,(item)=>item.Fire); // if (playerEntity.appearanceInterface.Appearance.IsFirstPerson) // { // } // else // { //// GameAudioMedium.PerformOnGunFire(); // } }
public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { var controller = (entity as PlayerEntity).WeaponController(); if (controller != null) { controller.PlayFireAudio(); controller.EffectList.Add(XmlConfig.EClientEffectType.MuzzleSpark); // GameAudioMedium.ProcessWeaponAudio(playerEntity,allContexts,(item)=>item.Fire); // if (playerEntity.appearanceInterface.Appearance.IsFirstPerson) // { // } // else // { //// GameAudioMedium.PerformOnGunFire(); // } } }
/// <summary> /// /// </summary> /// <param name="contexts"></param> /// <param name="entity"></param> /// <param name="e"></param> public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { FireEvent evt = e as FireEvent; if (evt != null) { if ((entity as PlayerEntity).isFlagSelf) { return; } // var weaponGo = (entity as PlayerEntity).appearanceInterface.Appearance.GetWeaponP1InHand(); // GameAudioMedia.PlayWeaponFireAudio(evt.fireWeaponId, evt.audioFirePos, (AudioGrp_ShotMode)evt.audioFireMode); } // GameAudioMedium.ProcessWeaponAudio(playerEntity,allContexts,(item)=>item.Fire); // if (playerEntity.appearanceInterface.Appearance.IsFirstPerson) // { // } // else // { //// GameAudioMedium.PerformOnGunFire(); // } }
/// <summary> /// /// </summary> /// <param name="contexts"></param> /// <param name="entity"></param> /// <param name="e"></param> public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { if (SharedConfig.IsMute) { return; } //var controller = (entity as PlayerEntity).AudioController(); var targetPlayerEntity = entity as PlayerEntity; int cmrEntityId = (contexts as Contexts).player.flagSelfEntity.gamePlay.CameraEntityId; // foreach(PlayerEntity playerEntity in (contexts as Contexts).player.GetEntities()) // { // if(playerEntity.gamePlay.CameraEntityId == player.entityKey.Value.EntityId) // { // //TODO // observePlayer = playerEntity; // break; // } // } AudioEvent audioEvent = e as AudioEvent; //DebugUtil.MyLog("Play other event :"+audioEvent.EventType); switch (audioEvent.EventType) { case EEventType.AFootstep: GameAudioMedia.PlayFootstepAudio(audioEvent as AudioFootstepEvent); break; case EEventType.AJumpstep: GameAudioMedia.PlayJumpstepAudio(audioEvent as AudioJumpstepEvent); break; case EEventType.AWeaponFire: GameAudioMedia.PlayWeaponFireAudio(audioEvent as AudioWeaponFireEvent); break; case EEventType.ADefault: if (cmrEntityId == targetPlayerEntity.entityKey.Value.EntityId) { float RTPCvalue = 1; GameAudioMedia.PlayUniqueEventAudio(audioEvent as AudioDefaultEvent, RTPCvalue); break; } else { float RTPCvalue = 0; GameAudioMedia.PlayUniqueEventAudio(audioEvent as AudioDefaultEvent, RTPCvalue); break; } case EEventType.APullbolt: GameAudioMedia.PlayWeaponReloadAudio(audioEvent as AudioPullboltEvent); break; case EEventType.AMeleeAttack: GameAudioMedia.PlayMeleeAttackAudio(audioEvent as AudioMeleeAtkEvent); break; default: break; } // GameAudioMedium.ProcessWeaponAudio(playerEntity,allContexts,(item)=>item.Fire); // if (playerEntity.appearanceInterface.Appearance.IsFirstPerson) // { // } // else // { //// GameAudioMedium.PerformOnGunFire(); // } }
public abstract void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e);
public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { HitEnvironmentEvent hitEvent = e as HitEnvironmentEvent; ClientEffectFactory.CreateHitEnvironmentEffect(hitEvent); }
public override void DoEventClient(Entitas.IContexts contexts, IEntity entity, IEvent e) { var playerEntity = entity as PlayerEntity; playerEntity.weaponLogic.WeaponEffect.PlayPullBoltEffect(playerEntity.weaponLogic.State); }