Exemplo n.º 1
0
        public EFExclamation(Player owner, IPair pos) : base(60, false)
        {
            DrawId = 10;

            Owner = owner;
            Pos.Clone(pos);
            Pos.Y -= 60 * GameDef.PIXEL_SCALE;
            GameDef.AdjustCollisionWall(Pos, 60);
        }
Exemplo n.º 2
0
 public Matrix4D GetTranslationMatrix()
 {
     /*var temp = new Matrix4D(
      *      800/2, 0, 0, -Pos.X,
      *      0, 600/2, 0, -Pos.Y,
      *      0, 0, 1, -Pos.Z,
      *      0, 0, 0, 1
      *  );*/
     return(Matrix4D.GetTranslation(Pos.Clone().Reverse()));
 }
Exemplo n.º 3
0
        public override void Update()
        {
            if (Owner.FocusUnit != null)
            {
                Pos.Clone(Owner.FocusUnit.Pos);
                Pos.Y -= 60 * GameDef.PIXEL_SCALE;
                GameDef.AdjustCollisionWall(Pos, 60);
            }

            base.Update();
        }
Exemplo n.º 4
0
        public const int STRENGTH = 50;  //  as 50 damage spell
        public MIHealBall(Unit caster, IPair destination) : base(80, caster)
        {
            radius_ = RADIUS;
            damage_ = -10;
            speed_  = 350;

            hurt_self_             = true;
            explode_enemy_         = false;
            explode_enemy_missile_ = false;

            Unit target = null;
            bool used = false;
            long min_distance = 0, temp_distance;

            foreach (Unit unit in Game.Unit_List)
            {
                if (unit == caster)
                {
                    continue;
                }
                if (used == false)
                {
                    used         = true;
                    target       = unit;
                    min_distance = (unit.Pos - Pos).LengthSquare();
                }
                else
                {
                    temp_distance = (unit.Pos - Pos).LengthSquare();
                    if (temp_distance < min_distance)
                    {
                        target       = unit;
                        min_distance = temp_distance;
                    }
                }
            }
            if (target != null)
            {
                destination.Clone(target.Pos);
            }

            IPair delta = destination - caster.Pos;

            move_vector_ = delta.Clone();
            move_vector_.ChangeLength(speed_);
            delta.ChangeLength(GameDef.UNIT_RADIUS * GameDef.PIXEL_SCALE);
            Pos.Clone(caster.Pos);
            Pos.Add(delta);
        }
Exemplo n.º 5
0
        public const int STRENGTH = 60;  //  as 50 damage spell
        public MIGravity(Unit caster, IPair destination) : base(80, caster)
        {
            radius_ = RADIUS;
            damage_ = 0;
            speed_  = 450;

            hurt_self_             = false;
            explode_enemy_         = false;
            explode_enemy_missile_ = false;

            IPair delta = destination - caster.Pos;

            move_vector_ = delta.Clone();
            move_vector_.ChangeLength(speed_);
            delta.ChangeLength(GameDef.UNIT_RADIUS * GameDef.PIXEL_SCALE);
            Pos.Clone(caster.Pos);
            Pos.Add(delta);
        }
Exemplo n.º 6
0
        public MIFireBall(Unit caster, IPair destination) : base(66, caster)
        {
            radius_ = RADIUS;
            damage_ = 700;
            speed_  = 900;  //  x100

            hurt_self_             = false;
            explode_enemy_         = true;
            explode_enemy_missile_ = true;

            IPair delta = destination - caster.Pos;

            move_vector_ = delta.Clone();
            move_vector_.ChangeLength(speed_);
            delta.ChangeLength(GameDef.UNIT_RADIUS * GameDef.PIXEL_SCALE);
            Pos.Clone(caster.Pos);
            Pos.Add(delta);
        }
Exemplo n.º 7
0
        public object Clone()
        {
            var bone = (Bone)MemberwiseClone();

            bone.Pivot    = (float[])Pivot?.Clone();
            bone.Pos      = (float[])Pos?.Clone();
            bone.Rotation = (float[])Rotation?.Clone();

            if (Cubes != null)
            {
                bone.Cubes = new List <Cube>();
                foreach (var cube in Cubes)
                {
                    bone.Cubes.Add((Cube)cube.Clone());
                }
            }

            return(bone);
        }
Exemplo n.º 8
0
        public MITraceBall(Unit caster) : base(270, caster)
        {
            radius_ = RADIUS;
            damage_ = 400;
            speed_  = 600;

            hurt_self_             = false;
            explode_enemy_         = true;
            explode_enemy_missile_ = true;

            Pos.Clone(caster.Pos);

            bool used = false;
            long min_distance = 0, temp_distance;

            target_ = null;
            foreach (Unit unit in Game.Unit_List)
            {
                if (unit == caster)
                {
                    continue;
                }
                if (used == false)
                {
                    used         = true;
                    target_      = unit;
                    min_distance = (unit.Pos - Pos).LengthSquare();
                }
                else
                {
                    temp_distance = (unit.Pos - Pos).LengthSquare();
                    if (temp_distance < min_distance)
                    {
                        target_      = unit;
                        min_distance = temp_distance;
                    }
                }
            }
        }
Exemplo n.º 9
0
 public Vertex Clone()
 {
     return(new Vertex(Pos.Clone(), Normal.Clone()));
 }
Exemplo n.º 10
0
 public override void Update()
 {
     Pos.Clone(unit_.Pos);
     Pos.Add(offset_);
     base.Update();
 }