Пример #1
0
    public static void KnifeAttack(RayGameObject o)
    {
        var checkCell3 = o.PositionIn3dSpace + 16 * o.FacingDirection;
        var checkCell  = new Point((int)(checkCell3.X / 16), (int)(checkCell3.Y / 16));
        var actor      = RayGame.Instance.ReadObjects.OfType <Actor>().FirstOrDefault(a => a.Shootable && a.GetCell() == checkCell);

        actor?.TakeDamage(1);
    }
Пример #2
0
    public static void Rocket(RayGameObject a)
    {
        var cell = (a.PositionIn3dSpace + 16 * a.FacingDirection) / 16;

        RayGame.Instance.SpawnRocket((int)cell.X, (int)cell.Y, a.FacingDirection);
    }
Пример #3
0
    public static void RayAttack(RayGameObject a)
    {
        var enemy = a.VisibleObjects().OfType <Actor>().FirstOrDefault(a => a.Shootable);

        enemy?.TakeDamage(1);
    }