Exemple #1
0
        public bool CalcAttackerDir(out VInt3 dir, PoolObjHandle <ActorRoot> attacker)
        {
            if (attacker == 0)
            {
                dir = VInt3.forward;
                return(false);
            }
            dir = attacker.handle.forward;
            switch (this.AppointType)
            {
            case SkillRangeAppointType.Auto:
            case SkillRangeAppointType.Target:
                if (this.TargetActor == 0)
                {
                    return(false);
                }
                dir   = this.TargetActor.handle.location;
                dir  -= attacker.handle.location;
                dir.y = 0;
                break;

            case SkillRangeAppointType.Pos:
                dir   = this.UseVector;
                dir  -= attacker.handle.location;
                dir.y = 0;
                break;

            case SkillRangeAppointType.Directional:
                dir   = this.UseVector;
                dir.y = 0;
                break;

            case SkillRangeAppointType.Track:
            {
                VInt3 num = this.EndVector + this.UseVector;
                dir   = num.DivBy2() - attacker.handle.location;
                dir.y = 0;
                break;
            }
            }
            return(true);
        }