Esempio n. 1
0
        public static int GetCurrency(Mobile m, bool sendMessage = false)
        {
            switch (Configuration.CurrencyImpl)
            {
            case CurrencyType.Sovereigns:
            {
                if (m is PlayerMobile)
                {
                    return(((PlayerMobile)m).AccountSovereigns);
                }
            }
            break;

            case CurrencyType.Gold:
                return(Banker.GetBalance(m));

            case CurrencyType.PointsSystem:
            {
                var sys = PointsSystem.GetSystemInstance(Configuration.PointsImpl);

                if (sys != null)
                {
                    return((int)Math.Min(Int32.MaxValue, sys.GetPoints(m)));
                }
            }
            break;

            case CurrencyType.Custom:
                return(Configuration.GetCustomCurrency(m));
            }

            return(0);
        }
Esempio n. 2
0
        public static int GetCurrency(Mobile m, bool sendMessage = false)
        {
            switch (Configuration.CurrencyType)
            {
            case CurrencyType.None:
                return(0);

            case CurrencyType.Sovereigns:
                if (m is PlayerMobile)
                {
                    return(((PlayerMobile)m).AccountSovereigns);
                }
                return(0);

            case CurrencyType.Gold:
                return(Banker.GetBalance(m));

            case CurrencyType.PointsSystem:
                var sys = PointsSystem.GetSystemInstance(Configuration.PointsSystemCurrency);

                if (sys != null)
                {
                    return((int)sys.GetPoints(m));
                }

                return(0);

            case CurrencyType.Custom:
                return((int)Configuration.GetCustomCurrency(m));
            }

            return(0);
        }
Esempio n. 3
0
    // Start is called before the first frame update
    void Awake()
    {
        ps = GameObject.Find("PointsSystem").GetComponent <PointsSystem>();
        //check who won
        string res = ps.GetMatchResult();

        //disable/enable right images/objects
        //change win text
        if (res.Equals("P1"))
        {
            modelSelected.text  = modelWinText + res;
            modelSelected.color = Color.yellow;
            p1Win.SetActive(true);
            p2Win.SetActive(false);
            draw.SetActive(false);
        }
        else
        {
            if (res.Equals("P2"))
            {
                modelSelected.text  = modelWinText + res;
                modelSelected.color = Color.red;
                p1Win.SetActive(false);
                p2Win.SetActive(true);
                draw.SetActive(false);
            }
            else
            {
                modelSelected.text = modelDrawText;
                p1Win.SetActive(false);
                p2Win.SetActive(false);
                draw.SetActive(true);
            }
        }
    }
Esempio n. 4
0
        /// <summary>
        /// Should have already passed GetCurrency
        /// </summary>
        /// <param name="m"></param>
        /// <param name="amount"></param>
        public static void DeductCurrency(Mobile m, int amount)
        {
            switch (Configuration.CurrencyType)
            {
            case CurrencyType.None:
                break;

            case CurrencyType.Sovereigns:
                if (m is PlayerMobile)
                {
                    ((PlayerMobile)m).WithdrawSovereigns(amount);
                }
                break;

            case CurrencyType.Gold:
                Banker.Withdraw(m, amount, true);
                break;

            case CurrencyType.PointsSystem:
                var sys = PointsSystem.GetSystemInstance(Configuration.PointsSystemCurrency);
                if (sys != null)
                {
                    sys.DeductPoints(m, amount, true);
                }
                break;

            case CurrencyType.Custom:
                Configuration.DeductCustomCurrecy(m, amount);
                break;
            }
        }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     npcPointsSystem = new PointsSystem(maxAmountOfPoints, startingPoints);
 }
Esempio n. 6
0
 public Gerador1(PointsSystem sistemaPontos)
 {
     this.sistemaPontos = sistemaPontos;
     custoInicial       = 155f;
     tempo     = 2f;
     GPS       = 0.4f;
     this.nome = " Nomades";
 }
Esempio n. 7
0
    void Start()
    {
        pController  = GetComponent <CharacterController>();
        cameraMotor  = Camera.main.GetComponent <CameraMotor>();
        pointsSystem = PointsSystem.Instance;

        isDead = false;
    }
Esempio n. 8
0
    void Awake()
    {
        if (_instance == null)
        {
            _instance = this;
        }

        Application.targetFrameRate = FRAMERATE;
    }
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     pointsSystem   = new PointsSystem();
     spriteRenderer = GetComponent <SpriteRenderer>();
     animator       = GetComponent <SpriteRendererAnimator>();
 }
 public Gerador3(PointsSystem sistemaPontos)
 {
     geradorAntigo      = GameObject.Find("Gerenciador").GetComponent <HudScript>().Geradores[1];
     this.sistemaPontos = sistemaPontos;
     custoInicial       = geradorAntigo.custoInicial;
     custoInicial      += (geradorAntigo.custoInicial * Mathf.Log(2, 3)) * 2;
     tempo     = 7.0f;
     GPS       = geradorAntigo.GPS;
     GPS      += geradorAntigo.GPS * Mathf.Log(2, 3.2f);
     this.nome = " Comida";
 }
Esempio n. 11
0
 private void Awake()
 {
     upToDate();
     if (pointsSystem == null)
     {
         pointsSystem = this;
         DontDestroyOnLoad(pointsSystem);
     }
     else
     {
         Destroy(gameObject);
     }
 }
Esempio n. 12
0
 // Start is called before the first frame update
 void Awake()
 {
     //singleton pattern
     if (instance == null)
     {
         instance = this;
         DontDestroyOnLoad(gameObject);
         p1Points = 0;
         p2Points = 0;
     }
     else if (instance != this)
     {
         Destroy(gameObject);
     }
 }
    void Start()
    {
        game.SetActive(true);
        store.SetActive(false);
        txtCurrency       = GameObject.Find("txtIdeiasHud").GetComponent <TextMeshProUGUI>();
        pointsSystem      = GameObject.Find("Gerenciador").GetComponent <PointsSystem>();
        controleGeradores = GameObject.Find("Gerenciador").GetComponent <ControladorGeradores>();

        Dialogue = GameObject.Find("Gerenciador").GetComponent <DialogueTrigger>();

        Geradores.Add(new Gerador1(pointsSystem));
        Geradores.Add(new Gerador2(pointsSystem));
        Geradores.Add(new Gerador3(pointsSystem));
        Geradores.Add(new Gerador4(pointsSystem));
        Geradores.Add(new Gerador5(pointsSystem));
        Geradores.Add(new Gerador6(pointsSystem));
        Geradores.Add(new Gerador7(pointsSystem));
        Geradores.Add(new Gerador8(pointsSystem));
    }
Esempio n. 14
0
        /// <summary>
        /// Should have already passed GetCurrency
        /// </summary>
        /// <param name="m"></param>
        /// <param name="amount"></param>
        public static int DeductCurrency(Mobile m, int amount)
        {
            switch (Configuration.CurrencyImpl)
            {
            case CurrencyType.Sovereigns:
            {
                if (m is PlayerMobile && ((PlayerMobile)m).WithdrawSovereigns(amount))
                {
                    return(amount);
                }
            }
            break;

            case CurrencyType.Gold:
            {
                if (Banker.Withdraw(m, amount, true))
                {
                    return(amount);
                }
            }
            break;

            case CurrencyType.PointsSystem:
            {
                var sys = PointsSystem.GetSystemInstance(Configuration.PointsImpl);

                if (sys != null && sys.DeductPoints(m, amount, true))
                {
                    return(amount);
                }
            }
            break;

            case CurrencyType.Custom:
                return(Configuration.DeductCustomCurrecy(m, amount));
            }

            return(0);
        }
    void HighScoreMessage()
    {
        //get highscore
        int score = RankingManager.GetHighScore();

        //update highscore text
        highscore.text = "" + score;

        //check if current scores are higher!
        //then activate new highscore message
        PointsSystem ps = GameObject.FindGameObjectWithTag("PointsManager").GetComponent <PointsSystem>();

        p1 = ps.GetP1Points();
        p2 = ps.GetP2Points();

        //new highscore from p1
        if (p1 > p2 && p1 > score)
        {
            p1High.SetActive(true);
            p2High.SetActive(false);
            highscore.text = "" + p1;
        }
        else
        {
            //new highscore from p2
            if (p2 > p1 && p2 > score)
            {
                p1High.SetActive(false);
                p2High.SetActive(true);
                highscore.text = "" + p2;
            }
            else
            {
                p1High.SetActive(false);
                p2High.SetActive(false);
            }
        }
    }
Esempio n. 16
0
 // Start is called before the first frame update
 void Awake()
 {
     ps = GameObject.FindGameObjectWithTag("PointsManager").GetComponent <PointsSystem>();
     points1Text.text = "" + ps.GetP1Points();
     points2Text.text = "" + ps.GetP2Points();
 }
 private void Awake()
 {
     ps = GameObject.FindGameObjectWithTag("PointsManager").GetComponent<PointsSystem>();
     ms = GameObject.Find("SpawnPoints").GetComponent<MonsterSpawner>();
 }
 private void Awake()
 {
     ps  = GameObject.FindGameObjectWithTag("PointsManager").GetComponent <PointsSystem>();
     cog = GetComponent <DropCog>();
 }
Esempio n. 19
0
 void Awake()
 {
     Instance = this;
 }
Esempio n. 20
0
 // Start is called before the first frame update
 void Awake()
 {
     ps = GameObject.Find("PointsSystem").GetComponent <PointsSystem>();
 }
 // Start is called before the first frame update
 void Start()
 {
     pointsSystem = GameObject.Find("Gerenciador").GetComponent <PointsSystem>();
     hudScript    = GameObject.Find("Gerenciador").GetComponent <HudScript>();
 }
Esempio n. 22
0
 // Start is called before the first frame update
 void Awake()
 {
     ps = GameObject.FindGameObjectWithTag("PointsManager").GetComponent <PointsSystem>();
     ps.Reset();
 }
Esempio n. 23
0
 private void FixedUpdate()
 {
     PointsSystem.ReciveData();
 }
Esempio n. 24
0
 // Use this for initialization
 void Start()
 {
     ps = GameObject.FindGameObjectWithTag("GameController").GetComponent <PointsSystem>();
     fj = GetComponent <FixedJoint>();
 }
Esempio n. 25
0
 public void DestroyInstance()
 {
     // TODO: check agn if correct way of implementing destroy
     _instance = null;
     Destroy(this);
 }
Esempio n. 26
0
 protected void Awake()
 {
     pointsSystem = GameObject.FindGameObjectWithTag("PointsSystem")
                    .GetComponent <PointsSystem>();
 }