Beispiel #1
0
        private void OnPlayerSpawned(GameObject player)
        {
            _playerHealth = player.GetComponent <PlayerHealth>();
            _playerWallet = player.GetComponent <PlayerWallet>();

            SetWave(_currentWaveNumber);
        }
Beispiel #2
0
 private void GatherComponents()
 {
     dialogueManager     = GetComponent <DialogueManager>();
     windowCloser        = GetComponent <CloseOpenWindows>();
     playerWallet        = GetComponent <PlayerWallet>();
     playerManager       = GetComponent <PlayerManager>();
     unitReactionManager = GetComponent <UnitReactionManager>();
 }
Beispiel #3
0
    // Start is called before the first frame update
    void Start()
    {
        billetera = new PlayerWallet();
        SM        = new StoreManager(billetera);

        SM.billetera.dineroJugador[0] = bc.goldCounterA;
        SM.billetera.dineroJugador[1] = bc.goldCounterB;
    }
Beispiel #4
0
 protected override void GatherComponents()
 {
     base.GatherComponents();
     equipmentManager = GetComponent <EquipmentManager>();
     inventory        = InventoryManager.GetInstance().GetInventory();
     wallet           = ScriptToolbox.GetInstance().GetPlayerWallet();
     myBody           = GetComponent <BodyPartController>();
     combatSkills     = GetComponent <CombatSkills>();
 }
Beispiel #5
0
        public void SetUp()
        {
            _wallet = new PlayerWallet();

            _repository = Substitute.For <WalletRepository>();
            _repository.Get().Returns(Observable.Return(_wallet));

            _walletService = new WalletService(_repository);
        }
Beispiel #6
0
 void Start()
 {
     playerWallet = ScriptToolbox.GetInstance().GetPlayerWallet();
     inv          = InventoryManager.GetInstance().GetInventory();
     shop         = InventoryManager.GetInstance().GetShopInventory();
     shopDialogue = InventoryManager.GetInstance().GetShopDialogue();
     qntyPrompt   = InventoryManager.GetInstance().GetQuantityPrompt();
     psm          = ScriptToolbox.GetInstance().GetPlayerManager().playerStateMachine;
 }
Beispiel #7
0
    public IEnumerator Start()
    {
        wallet = PlayerWallet.instance;
        wallet.savingModule.changeWalletValue += ChangeWalletValue;
        ChangeWalletValue(wallet.Wallet);
        yield return(null);

        toggle_playerPrefs.isOn = wallet.savingModule.SavingInPlayerPrefs;
        toggle_file.isOn        = wallet.savingModule.SavingInFile;
        toggle_binFile.isOn     = wallet.savingModule.SavingInBinFile;
    }
Beispiel #8
0
 private void OnTriggerEnter(Collider other)
 {
     if (other.CompareTag("Player"))
     {
         PlayerWallet currentWallet = other.GetComponent <PlayerWallet>();
         if (currentWallet)
         {
             currentWallet.AddCoin(coinCost);
             gameObject.SetActive(false);
         }
     }
 }
Beispiel #9
0
    // Start is called before the first frame update
    void Start()
    {
        if (GameOverScreen)
        {
            return;
        }

        _playerAttack = FindObjectOfType <PlayerAttack>();
        _upgradeable  = Upgradeable.GetComponent <Upgradeable>();
        // SpriteImage.sprite = _upgradeable.GetSprite();
        _playerWallet = Player.GetComponent <PlayerWallet>();
        _fadeToBlack  = GameObject.FindGameObjectWithTag("FadeToBlack").GetComponent <Animator>();
    }
Beispiel #10
0
    IEnumerator CreateNewWallet(int loadWay)
    {
        wallet.savingModule.changeWalletValue -= ChangeWalletValue;
        Destroy(wallet);

        yield return(null);

        GameObject newWallet = GameObject.Find("Wallet");

        if (newWallet == null)
        {
            newWallet = new GameObject("Wallet");
        }
        wallet = newWallet.AddComponent <PlayerWallet>();
        wallet.savingModule = new SavingWalletData(toggle_playerPrefs.isOn, toggle_file.isOn, toggle_binFile.isOn, toggle_server.isOn, (SavingWalletData.LoadingPreset)loadWay);
        wallet.savingModule.changeWalletValue += ChangeWalletValue;
        ChangeWalletValue(wallet.Wallet);

        toggle_playerPrefs.isOn = wallet.savingModule.SavingInPlayerPrefs;
        toggle_file.isOn        = wallet.savingModule.SavingInFile;
        toggle_binFile.isOn     = wallet.savingModule.SavingInBinFile;
        toggle_binFile.isOn     = wallet.savingModule.SavingOnServer;
    }
 private void Start()
 {
     playerWallet = PlayerInstant.Instance.transform.gameObject.GetComponent <PlayerWallet>();
 }
Beispiel #12
0
 void Start()
 {
     slotClickHelper = InventoryManager.GetInstance().GetSlotClickHelpers();
     playerWallet    = ScriptToolbox.GetInstance().GetPlayerWallet();
 }
 public void SetWallet()
 {
     Wallet = this;
 }
 public static void SetWallet(PlayerWallet wallet)
 {
     Wallet = wallet;
 }
Beispiel #15
0
 private void OnPlayerSpawned(GameObject player)
 {
     _playerWallet = player.GetComponent <PlayerWallet>();
     _playerWallet.MoneyChanged += OnMoneyChanged;
 }
Beispiel #16
0
    public void specialLandProcess(PlayMoving thePlayer, PlayerWallet theWallet, ArrayList spLand)
    {
        var tempCounter = 0;

        //railroads
        if (((int)spLand [1] == 5) || ((int)spLand [1] == 15) || ((int)spLand [1] == 25) || ((int)spLand [1] == 35))
        {
            var tempOwner = getOwner(spLand);              //checks if the railroad is owned
            if (tempOwner != null)
            {
                for (int i = 0; i < theWallet.myLandList.Count - 1; i++)
                {
                    var tempArr = (ArrayList)theWallet.myLandList [i];
                    if (tempArr [3].ToString() == "r")
                    {
                        tempCounter++;
                    }
                }
                getOwner(spLand).addMoney(tempCounter * 75);                  //probalby need to fix these lines for datastructures
                theWallet.subtractMoney(tempCounter * 75);
                print("railroad rent paid");
            }
            else if (theWallet.getWalletAmount() > 200)
            {
                monopolyGame.LocationLibrary.getLand(thePlayer.currentSpaceNum).Add(theWallet);
                theWallet.subtractMoney(200);
                print(thePlayer.getName() + "bought railroad");
            }
            else
            {
                print("player doesnt have enough money to buy railroad");
            }
        }

        //utility
        else if (((int)spLand [1] == 12) || ((int)spLand [1] == 28))
        {
            var tempOwner = getOwner(spLand);              //checks if the railroad is owned
            if (tempOwner != null)
            {
                for (int i = 0; i < theWallet.myLandList.Count - 1; i++)
                {
                    var tempArr = (ArrayList)theWallet.myLandList [i];
                    if (tempArr [3].ToString() == "u")
                    {
                        tempCounter++;
                    }
                }
                var number = Random.Range(2, 12);
                getOwner(spLand).addMoney(tempCounter * 4 * number);                  //probalby need to fix these lines for datastructures
                theWallet.subtractMoney(tempCounter * 4 * number);
                print("utilities paid");
            }
            else if (theWallet.getWalletAmount() > 150)
            {
                monopolyGame.LocationLibrary.getLand(thePlayer.currentSpaceNum).Add(theWallet);
                theWallet.subtractMoney(150);
                print(thePlayer.getName() + "bought utility");
            }
            else
            {
                print("player doesnt have enough money to buy utility");
            }
        }

        //income tax --addmoney to communityvault
        else if ((int)spLand [1] == 4)
        {
            var tempMoney = (int)(theWallet.getWalletAmount() * 0.15);
            theWallet.subtractMoney(tempMoney);
            monopolyGame.updateCV_money(tempMoney);
            print("taxes paid");
            monopolyGame.consoleText = thePlayer.getName() + " has paid taxes!";
        }

        //luxury tax
        else if ((int)spLand [1] == 38)
        {
            theWallet.subtractMoney(75);
            print("luxury tax paid");
        }

        //community chest
        else if (((int)spLand [1] == 2) || ((int)spLand [1] == 17) || ((int)spLand [1] == 33))
        {
            CCdeck.CCnumber = Random.Range(1, 7);
        }

        //chance
        else if (((int)spLand [1] == 7) || ((int)spLand [1] == 22) || ((int)spLand [1] == 36))
        {
            chanceDeck.ChanceNumber = Random.Range(1, 7);
        }
        else if ((int)spLand [1] == 20)            //landed on free parking
        {
            theWallet.addMoney(monopolyGame.getCV_money());
            monopolyGame.updateCV_money(-monopolyGame.getCV_money());
            print("player cleared the community vault");
            monopolyGame.consoleText = "Community Vault has been emptied by: " + thePlayer.getName();
        }
        else if (((int)spLand [1] == 0))
        {
            monopolyGame.consoleText = thePlayer.getName() + " is on GO! ";
            thePlayer.passedGO       = true;
        }
        else
        {
            print("merp, nothing special");
            //monopolyGame.consoleText = "Not a special place";
        }
    }
Beispiel #17
0
 void Awake()
 {
     instance = this;
 }
Beispiel #18
0
 private void Awake()
 {
     playerWallet = FindObjectOfType <PlayerWallet>();
 }
Beispiel #19
0
 /**
  * Update the texts for a wallet.
  */
 public void UpdateWallet(PlayerWallet wallet)
 {
     points.text = wallet.points.ToString();
     coins.text  = wallet.coins.ToString();
     lifes.text  = wallet.lifes.ToString();
 }
Beispiel #20
0
        public IObservable <PlayerWallet> Get()
        {
            var currencies = _playerDataRepository.GetWallet().Wait();

            return(Observable.Return(_wallet ?? (_wallet = MapWallet(currencies))));
        }
Beispiel #21
0
 private void OnDestroy()
 {
     Instance = null;
 }
Beispiel #22
0
 private void Awake()
 {
     Instance = this;
 }
Beispiel #23
0
 private void OnPlayerSpawned(GameObject player)
 {
     _playerWallet               = player.GetComponent <PlayerWallet>();
     _playerWeapons              = player.GetComponent <PlayerWeapons>();
     _playerWallet.MoneyChanged += ChangeWeaponsStatus;
 }
Beispiel #24
0
 private void Start()
 {
     betFields    = FindObjectsOfType <BetField>().ToList();
     playerWallet = FindObjectOfType <PlayerWallet>();
 }
Beispiel #25
0
 private void Start()
 {
     text         = GetComponent <Text>();
     playerWallet = PlayerInstant.Instance.GetComponent <PlayerWallet>();
 }