Exemple #1
0
 void IStage.Enter()
 {
     _DatumPosition = _Player.GetPosition();
     _Player.Aid();
     _Caster = SkillCaster.Build(ACTOR_STATUS_TYPE.AID);
     _TimeCounter.Reset();
 }
Exemple #2
0
        private TICKRESULT _GetDistance(Guid target, out float distance)
        {
            distance = 0f;
            var entity = _FieldOfVision.Find((e) => e.Id == target);

            if (entity == null)
            {
                return(TICKRESULT.FAILURE);
            }

            var mesh = _BuildMesh(entity);

            float   dis;
            Vector2 point;
            Vector2 normal;

            if (RayPolygonIntersect(
                    _Entiry.GetPosition(),
                    Vector2.AngleToVector(_Entiry.Direction),
                    mesh.Points,
                    out dis,
                    out point,
                    out normal))
            {
                distance = dis - _Entiry.GetDetectionRange();
                return(TICKRESULT.SUCCESS);
            }
            return(TICKRESULT.FAILURE);
        }
        void IStage.Enter()
        {
            _Binder.Bind <ICastSkill>(this);
            _Player.SetSkillVelocity(_Caster.GetShiftDirection(), _Caster.GetShiftSpeed());
            _Player.CastBegin(_Caster.Data.Id);

            _MoveController.Backward   = _Caster.GetBackward();
            _MoveController.Forward    = _Caster.GetForward();
            _MoveController.RunForward = _Caster.GetRunForward();
            _MoveController.TurnLeft   = _Caster.GetTurnLeft();
            _MoveController.TurnRight  = _Caster.GetTurnRight();

            _Binder.Bind <IMoveController>(_MoveController);

            if (_Caster.CanDisarm())
            {
                _Binder.Bind <IBattleSkill>(this);
            }

            _CastTimer.Reset();

            _DatumPosition = _Player.GetPosition();
            var strength = _Player.Strength(-_Caster.Data.StrengthCost);

            _Overdraft = strength < 0.0f;
        }
 private void _OnWaitEntity(Guid id)
 {
     if (_Contestants.Any(contestant => contestant == id))
     {
         _Gate.Pass(_Owner.GetPosition(), id);
     }
 }
        private void _Kick(IEnumerable <IIndividual> onlookers)
        {
            var position = _Exit.GetPosition();

            foreach (var o in onlookers)
            {
                o.SetPosition(position.X, position.Y);
            }
        }
        private TICKRESULT _Pass(float arg)
        {
            bool success = false;

            success = _Ids.Count > 0;
            while (_Ids.Count > 0)
            {
                var id = _Ids.Dequeue();
                _Gate.Pass(_Owner.GetPosition(), id);
            }
            if (success)
            {
                return(TICKRESULT.SUCCESS);
            }
            return(TICKRESULT.FAILURE);
        }
        private TICKRESULT _Pass(float arg)
        {
            _Gate.Pass(_Owner.GetPosition(), _Types);

            return(TICKRESULT.SUCCESS);
        }