Ejemplo n.º 1
0
    private IEnumerator ReturnFromPoseidon()
    {
        yield return(Say("Hello again! *squeek*"));

        yield return(Say($"I did it! *squeek*"));

        yield return(Say($"Right after you gave me the {OwnedItems.Last().Name} I rushed to the underwater city."));

        yield return(Say("I found there Poseidon, the ruthless ruler who wishes no good upon his city's people."));

        yield return(Say("*sqeeeek* This is when I challenged him!"));

        yield return(Say("We faught for hours."));

        yield return(Say("I was beginning to lose hope, but then..."));

        yield return(Say("... The staff you gave me, it started glowing red hot. *squeek*"));

        yield return(Say("I rushed towards Poseidon with all I had left and impaled his heart."));

        yield return(Say("*squeek* and here I am now!"));

        yield return(Say("The staff you gave me saved me!"));

        yield return(Say("As a thank you, I want to give you this"));

        GiveItem(PoseidonsCrownPrefab);
        AchivementBadge.Achieved("poseidon");
        yield return(Say("It's Poseidon's crown. Do what you want with it hehe. *sqeeek*"));

        yield return(Say("Bye and see ya! *squek*"));

        RemoveFromClients();
    }
Ejemplo n.º 2
0
        public void OnTick()
        {
            if (!OwnedItems.Contains(thisItem))
            {
                return;
            }
            Chat.Print("2");
            if (!Initialized)
            {
                Chat.Print("3");
                InitializeItem();
                Initialized = true;
            }
            Chat.Print("4");
            thisTarget = Misc.Extensions.GetBestItemTarget(thisItem);
            var menuValue = MyMenu.OffensiveMenu.GetCheckBoxValue("check" + (int)thisItem.Id);

            Chat.Print("5");
            if (!thisItem.IsReady() || !menuValue || thisTarget == null)
            {
                return;
            }
            Chat.Print("6");
            Execute();
        }
Ejemplo n.º 3
0
 public static void MoveItemToOwned(GameItem item)
 {
     if (!ReservedItems.Contains(item))
     {
         return;
     }
     ReservedItems.Remove(item);
     OwnedItems.Add(item);
 }
Ejemplo n.º 4
0
 public void Buy(AItem Item)
 {
     if (this.Coins - Item.Price >= 0)
     {
         OwnedItems.Add(Item);
     }
     else
     {
         throw new NotEnoughCoinsException();
     }
 }
 // Start is called before the first frame update
 void Start()
 {
     animator = sink.GetComponent <Animator>();
     if (OwnedItems.ifOwnSink() == true)
     {
         animator.runtimeAnimatorController = Resources.Load <RuntimeAnimatorController>("UpgradedSink");
     }
     else
     {
         animator.runtimeAnimatorController = Resources.Load <RuntimeAnimatorController>("Sink");
     }
 }
Ejemplo n.º 6
0
 public void Buy(BaseItem itemToBuy)
 {
     if (GetItem(itemToBuy) != null)
     {
         throw new InvalidOperationException(itemToBuy.GetNameCases(Game.MainSettings.Language)[3] + " можно покупать только один раз за игру.");
     }
     if (DbUser.TotalPoints < itemToBuy.Cost)
     {
         throw new InvalidOperationException("Недостаточно очков для покупки " + itemToBuy.GetNameCases(Game.MainSettings.Language)[1]);
     }
     OwnedItems.Add(itemToBuy);
     AddPoints(-itemToBuy.Cost);
 }
Ejemplo n.º 7
0
 public void buySink()
 {
     if (money >= sinkPrice)
     {
         OwnedItems.doesOwnSink();
         money = money - sinkPrice;
         CareerStats.spentMoney(sinkPrice);
     }
     else
     {
         Debug.Log("Not enough money");
     }
     Debug.Log(money);
     sinkPurchaseConfirmation.SetActive(false);
 }
Ejemplo n.º 8
0
 public void buyCan()
 {
     if (money >= canPrice)
     {
         OwnedItems.doesOwnCan();
         money = money - canPrice;
         CareerStats.spentMoney(canPrice);
     }
     else
     {
         Debug.Log("Not enough money");
     }
     Debug.Log(money);
     canPurchaseConfirmation.SetActive(false);
 }
Ejemplo n.º 9
0
 void Update()
 {
     if (money < shoesPrice || OwnedItems.ifOwnShoes() == true)
     {
         _button.interactable = false;
     }
     if (money < canPrice || OwnedItems.ifOwnCan() == true)
     {
         _button1.interactable = false;
     }
     if (money < sinkPrice || OwnedItems.ifOwnSink() == true)
     {
         _button2.interactable = false;
     }
 }
Ejemplo n.º 10
0
    private IEnumerator GiveDragonHead()
    {
        Global.Dragon = "defeated";
        yield return(Say("Hi, me again! Guess what..."));

        AchivementBadge.Achieved("dragon");
        yield return(Say("I slayed the dragon! But uhm..."));

        yield return(Say($"The {OwnedItems.Last().Name} was broken in the process *quack*"));

        yield return(Say($"I got you dragon's head though! So no hard feelings ok?"));

        GiveItem(DragonHeadPrefab);
        yield return(Say("Bye and sorry again for the item.", 3));

        RemoveFromClients();
    }
Ejemplo n.º 11
0
    private IEnumerator AskForGearAgain()
    {
        yield return(Say("Hi, again. *quack*"));

        if (OwnedItems.Count > 0)
        {
            yield return(Say($"Uhm... A {OwnedItems.Last().Name} wasn't enough to beat a dragon."));
        }
        else
        {
            yield return(Say($"I really need better items."));
        }
        yield return(Say("Almost got myself killed fighting dragon *quack*"));

        yield return(Ask("Can you give me some better gear? I promise to slay a dragon."));

        yield return(HandleItem());
    }
    // Update is called once per frame
    void Update()
    {
        //Shoes
        if (OwnedItems.ifOwnShoes() == true)
        {
            WASDMove.shoesMovespeed();
        }
        else
        {
            WASDMove.normalMovespeed();
        }

        //Can
        if (OwnedItems.ifOwnCan() == true)
        {
            canSprite.sprite = upgradedCan;
            CanStatus.setUpgradedCan();
        }
        else
        {
            canSprite.sprite = normalCan;
            CanStatus.setNormalCan();
        }

        //Sink
        if (OwnedItems.ifOwnSink() == true)
        {
            sinkSprite.sprite = upgradedSink;
            CanStatus.setUpgradedFill();
        }
        else
        {
            sinkSprite.sprite = normalSink;
            CanStatus.setNormalFill();
        }
    }
Ejemplo n.º 13
0
        public BaseItem GetItem(BaseItem item, bool onlyActive = false)
        {
            var result = OwnedItems.Find(i => item.GetType() == i.GetType() && (i.IsActive || !onlyActive));

            return(result);
        }
Ejemplo n.º 14
0
 void Start()
 {
     OwnedItems.resetOwnedItems();
     Global.resetMoney();
     CareerStats.resetCareerStats();
 }