示例#1
0
    public void RevealMap(IEventArgs args)
    {
        EventArgsCoor coor = (EventArgsCoor)args;

        for (int x = coor.X - 10; x < 10 + coor.X; x++)
        {
            for (int y = coor.Y - 10; y < 10 + coor.Y; y++)
            {
                if (x < 0 || x > _width - 1 || y < 0 || y > _height - 1 || _render[y, x])
                {
                    continue;
                }

                _render[y, x] = true;
                _tile.sprite  = _mapTextureData.MiniMap[_grid[y, x] ? 0 : 1];
                Vector3Int pos = new Vector3Int(x, y, 0);
                _miniMapCam.SetTile(pos, _tile);
            }
        }
    }
示例#2
0
    public void PlayerMovingAnimation(IEventArgs args)
    {
        EventArgsCoor coor = args as EventArgsCoor;

        if (_playerData.MultiID != coor.Id && (string)Coffre.Regarder("mode") == "multi")
        {
            return;
        }
        int  speed = coor.X != 0 ? coor.X : coor.Y;
        bool dir   = coor.X == 0;

        if (speed == 0)
        {
            _a.SetInteger("Speed", 0);
            return;
        }

        _a.SetInteger("Speed", speed);
        _a.SetBool("Direction", dir);
    }
示例#3
0
    public void WeaponMovement(IEventArgs args)
    {
        if (Weapon.inPlayerInventory)
        {
            if (Weapon._class == "Warrior")
            {
                EventArgsCoor move = args as EventArgsCoor;
                if (move.X == 0 && move.Y == 0)
                {
                    return;
                }
                bool dir = Math.Abs(move.X) < Math.Abs(move.Y);
                if (dir)
                {
                    if (move.Y > 0) //up
                    {
                        PlaceWeapon(-0.258f, 0.246f, -90);
                        _sprite.sortingOrder = 101;
                    }

                    else
                    {
                        PlaceWeapon(0.261f, 0.246f, 180);
                        _sprite.sortingOrder = -10000;
                    }
                }
                else
                {
                    if (move.X < 0)
                    {
                        PlaceWeapon(0.223f, 0.353f, 195);
                        _sprite.sortingOrder = -10000;
                    }
                    else
                    {
                        PlaceWeapon(0.062f, 0.431f, 205);
                        _sprite.sortingOrder = -10000;
                    }
                }
            }


            if (Weapon._class == "Archer")
            {
                EventArgsCoor move = args as EventArgsCoor;
                if (move.X == 0 && move.Y == 0)
                {
                    return;
                }
                bool dir = Math.Abs(move.X) < Math.Abs(move.Y);
                if (dir)
                {
                    if (move.Y > 0) //up
                    {
                        PlaceWeapon(0.118f, 0.117f, 45);
                        _sprite.sortingOrder = 101;
                    }

                    else // down
                    {
                        PlaceWeapon(-0.11f, 0.178f, 135);
                        _sprite.sortingOrder = -10000;
                    }
                }
                else
                {
                    if (move.X < 0) //right
                    {
                        PlaceWeapon(-0.143f, 0.163f, 150);
                        _sprite.sortingOrder = -10000;
                    }
                    else //left
                    {
                        PlaceWeapon(-0.094f, 0.095f, 165);
                        _sprite.sortingOrder = -10000;
                    }
                }
            }

            if (Weapon._class == "Assassin")
            {
                EventArgsCoor move = args as EventArgsCoor;
                if (move.X == 0 && move.Y == 0)
                {
                    return;
                }
                bool dir = Math.Abs(move.X) < Math.Abs(move.Y);
                if (dir && move.Y > 0)
                {
                    transform.rotation = Quaternion.AngleAxis(0, Vector3.up);
                    PlaceWeapon(0f, -0.04f, 90);
                    //l_sprite.sortingOrder = 1000;
                    _sprite.sortingOrder += 1;
                }
                else
                {
                    transform.rotation = Quaternion.AngleAxis(90, Vector3.up);
                }
            }
        }
    }