public void Explode(Entity entity) { #if COMBAT_CLIENT if (m_collision_sound_cfgid > 0) { PlaySoundMessage sound_msg = RenderMessage.Create <PlaySoundMessage>(); sound_msg.Construct(GetOwnerEntityID(), m_collision_sound_cfgid, FixPoint.MinusOne); GetLogicWorld().AddRenderMessage(sound_msg); } #endif ApplyGenerator(entity); if (entity == null || !m_pierce_entity) { #if COMBAT_CLIENT LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStopMoving(ParentObject.ID, true); GetLogicWorld().AddRenderMessage(msg); #endif if (m_task != null) { m_task.Cancel(); LogicTask.Recycle(m_task); m_task = null; } EntityUtil.KillEntity((Entity)ParentObject, ParentObject.ID); } }
void ProcessRenderMessage_StopMoving(LocomoteRenderMessage msg) { RenderEntity render_entity = m_render_entity_manager.GetObject(msg.EntityID); if (render_entity == null) { return; } ModelComponent model_component = render_entity.GetComponent(ModelComponent.ID) as ModelComponent; if (model_component == null) { return; } m_render_world.UnregisterMovingEntity(model_component); if (msg.m_block_animation) { return; } PredictLogicComponent predic_component = render_entity.GetComponent(PredictLogicComponent.ID) as PredictLogicComponent; if (msg.m_reason == LocomoteRenderMessage.NotFromCommand || predic_component == null || !predic_component.HasMovementPredict) { PlayIdleAnimation(render_entity); } }
public void InitParam(ProjectileParameters param) { m_param = param; if (m_trajectory_type == TrajectoryTypeBezier) { m_param.m_bezier_b = (m_param.m_start_position + m_param.m_target_position) / FixPoint.Two; m_param.m_bezier_b.y += m_extra_hight; } if (m_param.m_life_time <= FixPoint.Zero) { m_param.m_life_time = m_life_time; } PositionComponent position_component = ParentObject.GetComponent(PositionComponent.ID) as PositionComponent; GridGraph grid_graph = position_component.GetGridGraph(); GridNode node = grid_graph.Position2Node(position_component.CurrentPosition); m_previous_walkable = (node != null && node.Walkable); if (m_task == null) { m_task = LogicTask.Create <UpdateProjectileTask>(); } m_task.Construct(this, m_param.m_life_time); var schedeler = GetLogicWorld().GetTaskScheduler(); schedeler.Schedule(m_task, GetCurrentTime(), LOGIC_UPDATE_INTERVAL, LOGIC_UPDATE_INTERVAL); #if COMBAT_CLIENT LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStartMoving(ParentObject.ID, true); GetLogicWorld().AddRenderMessage(msg); #endif }
public override void Apply() { if (m_task == null) { m_task = LogicTask.Create <ComponentCommonTaskWithLastingTime>(); } EffectDefinitionComponent definition_component = ((Effect)ParentObject).GetDefinitionComponent(); Entity entity = GetLogicWorld().GetEntityManager().GetObject(definition_component.SourceEntityID); if (entity != null) { PositionComponent position_component = entity.GetComponent(PositionComponent.ID) as PositionComponent; if (position_component != null) { m_direction = position_component.Facing3D; } } m_task.Construct(this, m_time); var schedeler = GetLogicWorld().GetTaskScheduler(); schedeler.Schedule(m_task, GetCurrentTime(), LOGIC_UPDATE_INTERVAL, LOGIC_UPDATE_INTERVAL); #if COMBAT_CLIENT LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStartMoving(GetOwnerEntityID(), true, LocomoteRenderMessage.NotLocomotion); GetLogicWorld().AddRenderMessage(msg); #endif }
protected void OnMovementStopped(bool from_command) { ParentObject.SendSignal(SignalType.StopMoving); #if COMBAT_CLIENT LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStopMoving(ParentObject.ID, IsAnimationBlocked, from_command ? 0 : LocomoteRenderMessage.NotFromCommand); GetLogicWorld().AddRenderMessage(msg); #endif }
public override void Unapply() { m_task.Cancel(); LogicTask.Recycle(m_task); m_task = null; #if COMBAT_CLIENT LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStopMoving(GetOwnerEntityID(), false, LocomoteRenderMessage.NotFromCommand); GetLogicWorld().AddRenderMessage(msg); #endif }
public void UnblockAnimation() { --m_animation_block_cnt; #if COMBAT_CLIENT if (m_animation_block_cnt == 0 && m_is_moving) { LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStartMoving(ParentObject.ID, IsAnimationBlocked, LocomoteRenderMessage.UnblockAnimation); GetLogicWorld().AddRenderMessage(msg); } #endif }
protected override void OnActionUpdate(FixPoint delta_time) { LogicWorld logic_world = GetLogicWorld(); var schedeler = logic_world.GetTaskScheduler(); schedeler.Schedule(m_task, logic_world.GetCurrentTime(), LOGIC_UPDATE_INTERVAL, LOGIC_UPDATE_INTERVAL); m_remain_time = m_time; #if COMBAT_CLIENT Skill skill = GetOwnerSkill(); LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStartMoving(skill.GetOwnerEntityID(), true, LocomoteRenderMessage.NotLocomotion); GetLogicWorld().AddRenderMessage(msg); #endif }
void StopSpurt() { if (m_task == null) { return; } m_task.Cancel(); LogicTask.Recycle(m_task); m_task = null; #if COMBAT_CLIENT LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStopMoving(GetOwnerEntityID(), false, LocomoteRenderMessage.NotFromCommand); GetLogicWorld().AddRenderMessage(msg); #endif }
void ProcessRenderMessage_StartMoving(LocomoteRenderMessage msg) { RenderEntity render_entity = m_render_entity_manager.GetObject(msg.EntityID); if (render_entity == null) { return; } ModelComponent model_component = render_entity.GetComponent(ModelComponent.ID) as ModelComponent; if (model_component == null) { return; } m_render_world.RegisterMovingEntity(model_component); PredictLogicComponent predic_component = render_entity.GetComponent(PredictLogicComponent.ID) as PredictLogicComponent; if (msg.m_reason == LocomoteRenderMessage.NotLocomotion || msg.m_block_animation) { model_component.UpdateAngle(); if (predic_component != null) { predic_component.OnLogicMove(); } } else if (msg.m_reason == LocomoteRenderMessage.NotFromCommand) { model_component.UpdateAngle(); PlayLocomotorAnimation(render_entity); if (predic_component != null) { predic_component.OnLogicMove(); } } else if (msg.m_reason == LocomoteRenderMessage.UnblockAnimation) { model_component.UpdateAngle(); PlayLocomotorAnimation(render_entity); } else if (predic_component == null || !predic_component.HasMovementPredict) { model_component.UpdateAngle(); PlayLocomotorAnimation(render_entity); } }
void StopSpurt() { if (m_collision_target_generator != null) { m_collision_target_generator.Deactivate(); } if (m_task != null) { m_task.Cancel(); } #if COMBAT_CLIENT Skill skill = GetOwnerSkill(); LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStopMoving(skill.GetOwnerEntityID(), false, LocomoteRenderMessage.NotFromCommand); GetLogicWorld().AddRenderMessage(msg); #endif if (m_collided_targets != null) { m_collided_targets.Clear(); } m_remain_time = FixPoint.Zero; }
public override void Inflict(FixPoint start_time) { Skill owner_skill = GetOwnerSkill(); SkillDefinitionComponent definition_component = owner_skill.GetDefinitionComponent(); m_actual_distance = m_distance; if (m_distance == FixPoint.Zero) { if (definition_component.ExternalDataType == SkillDefinitionComponent.NeedExternalOffset) { m_actual_distance = definition_component.ExternalVector.Length(); } } m_actual_time = m_time; if (definition_component.NormalAttack) { m_actual_time = m_time / owner_skill.GetSkillManagerComponent().AttackSpeedRate; } if (m_task == null) { m_task = LogicTask.Create <ComponentCommonTaskWithLastingTime>(); } m_task.Construct(this, m_actual_time); var schedeler = GetLogicWorld().GetTaskScheduler(); schedeler.Schedule(m_task, GetCurrentTime(), LOGIC_UPDATE_INTERVAL, LOGIC_UPDATE_INTERVAL); #if COMBAT_CLIENT LocomoteRenderMessage msg = RenderMessage.Create <LocomoteRenderMessage>(); msg.ConstructAsStartMoving(GetOwnerEntityID(), true, LocomoteRenderMessage.NotLocomotion); GetLogicWorld().AddRenderMessage(msg); #endif if (m_enable_hide) { GetLogicWorld().AddSimpleRenderMessage(RenderMessageType.Hide, GetOwnerEntityID()); } }