Ejemplo n.º 1
0
        public void CastArtifact(ReceivedArtifact receivedArtifact, Player playerReciever = null, int power = 0)
        {
            if (!Inventory.ContainsArtifact((AbstractArtifact)receivedArtifact.Target))
            {
                Console.WriteLine("There is no such artifact in inventory!");
                return;
            }

            if (!CanMove)
            {
                Console.WriteLine("Your person cant move!");
                return;
            }

            if (power < 0)
            {
                power = 0;
            }

            if (playerReciever == null)
            {
                playerReciever = this;
            }

            Inventory.Bag.Remove((AbstractArtifact)receivedArtifact.Target);

            receivedArtifact(this, playerReciever, power);
        }
Ejemplo n.º 2
0
        public void CastArtifact(ReceivedArtifact receivedArtifact, PlayerWithMagic playerReciever = null, int power = 0)
        {
            if (!Inventory.ContainsArtifact((AbstractArtifact)receivedArtifact.Target))
            {
                //message;
                return;
            }

            if (power < 0)
            {
                power = 0;
            }

            if (playerReciever == null)
            {
                playerReciever = this;
            }

            Inventory.Bag.Remove((AbstractArtifact)receivedArtifact.Target);

            receivedArtifact(this, playerReciever, power);
        }