Ejemplo n.º 1
0
    protected void Start()
    {
        currentLevel = PlayerStatsController.GetCurrentLevel();

        if (PlayerPrefs.GetString("CharClasse") == "Guerreiro")
        {
            PlayerStatsController.SetTypeCharacter(TypeCharacter.Guerreiro);

            Debug.Log("Guerreiro");
        }
        else if (PlayerPrefs.GetString("CharClasse") == "Pistoleiro")
        {
            PlayerStatsController.SetTypeCharacter(TypeCharacter.Pistoleiro);

            Debug.Log("Pistoleiro");
        }
        else if (PlayerPrefs.GetString("CharClasse") == "Bomber")
        {
            PlayerStatsController.SetTypeCharacter(TypeCharacter.Bomber);

            Debug.Log("Bomber");
        }
        else
        {
            Debug.Log("Não carregou classe");
        }


        type       = PlayerStatsController.GetTypeCharacter();
        basicStats = PlayerStatsController.instance.GetBasicStatsPlayer(type);
        MontarMissoes(); // adiciona todas missoes em um list
        base.Start();
        TipoDeSlider();
    }
Ejemplo n.º 2
0
        private void Serialize(TypeCharacter TypeCharacter)
        {
            if (TypeCharacter != TypeCharacter.None)
            {
                Dictionary <TypeCharacter, string> TypeCharacterTable = null;

                if (TypeCharacterTable == null)
                {
                    Dictionary <TypeCharacter, string> Table = new Dictionary <TypeCharacter, string>();
                    // NOTE: These have to be in the same order as the enum!
                    string[]      TypeCharacters     = { "$", "%", "&", "S", "I", "L", "!", "#", "@", "F", "R", "D", "US", "UI", "UL" };
                    TypeCharacter TableTypeCharacter = TypeCharacter.StringSymbol;

                    for (int Index = 0; Index <= TypeCharacters.Length - 1; Index++)
                    {
                        Table.Add(TableTypeCharacter, TypeCharacters[Index]);
                        TableTypeCharacter = (TypeCharacter)((int)TableTypeCharacter << 1);
                    }

                    TypeCharacterTable = Table;
                }

                Output.WriteAttributeString("typeChar", TypeCharacterTable[TypeCharacter]);
            }
        }
Ejemplo n.º 3
0
 protected void Start()
 {
     base.Start();
     currentLevel = LevelController.GetCurrentLevel();
     type         = LevelController.instance.GetTypeCharacter();
     basicStats   = LevelController.instance.GetBasicStats(type);
 }
Ejemplo n.º 4
0
	protected void Start(){
		base.Start();
		windowRect = new Rect(Screen.width /2 - 200, Screen.height /2 - 250, 400, 500);
		if (PlayerPrefs.GetInt (PlayerStatsController.CurrentSave () + "newChar") == 1)
				newChar = true;
		else if (PlayerPrefs.GetInt(PlayerStatsController.CurrentSave ()+"newChar") == 0)
				newChar = false;
		currentLevel = PlayerStatsController.GetCurrentLevel();
		type = PlayerStatsController.GetTypeCharacter();
		basicStats = PlayerStatsController.intance.GetBasicStats(type);
		if (newChar) {
			PlayerStatsController.SetTypeCharacter(TypeCharacter.Beginner);
			currentLevel = 1;
			PlayerPrefs.SetInt(PlayerStatsController.CurrentSave ()+"currentLevel",currentLevel);
			PlayerPrefs.SetInt(PlayerStatsController.CurrentSave ()+"currentXP",0);
			int xpBase = 100;
			PlayerPrefs.SetFloat (PlayerStatsController.CurrentSave ()+"maxXP",xpBase);
			PlayerPrefs.SetFloat (PlayerStatsController.CurrentSave ()+"maxHP",basicStats.startHP);
			PlayerPrefs.SetFloat (PlayerStatsController.CurrentSave ()+"maxMP",basicStats.startMP);
			PlayerPrefs.SetFloat (PlayerStatsController.CurrentSave ()+"currentHP",basicStats.startHP);
			PlayerPrefs.SetFloat (PlayerStatsController.CurrentSave ()+"currentMP",basicStats.startMP);
			PlayerPrefs.SetFloat (PlayerStatsController.CurrentSave ()+"baseHP",basicStats.startHP);
			PlayerPrefs.SetFloat (PlayerStatsController.CurrentSave ()+"baseMP",basicStats.startMP);
			PlayerPrefs.SetInt (PlayerStatsController.CurrentSave ()+"currentAP", 10);
			PlayerPrefs.SetInt(PlayerStatsController.CurrentSave ()+"newChar", 0);
			PlayerPrefs.SetInt (PlayerStatsController.CurrentSave () + "STR", 0);
			PlayerPrefs.SetInt (PlayerStatsController.CurrentSave () + "DEX", 0);
			PlayerPrefs.SetInt (PlayerStatsController.CurrentSave () + "INT", 0);
			PlayerPrefs.SetInt (PlayerStatsController.CurrentSave () + "VIT", 0);

			}
		atributos = false;
	}
Ejemplo n.º 5
0
        /// <summary>
        /// Constructs a new identifier token.
        /// </summary>
        /// <param name="type">The token type of the identifier.</param>
        /// <param name="unreservedType">The unreserved token type of the identifier.</param>
        /// <param name="identifier">The text of the identifier</param>
        /// <param name="escaped">Whether the identifier is escaped.</param>
        /// <param name="typeCharacter">The type character of the identifier.</param>
        /// <param name="span">The location of the identifier.</param>
        public IdentifierToken(TokenType type, TokenType unreservedType, string identifier, bool escaped, bool hasSpaceAfter, TypeCharacter typeCharacter, Span span) : base(type, span)
        {
            if (type != TokenType.Identifier && !IsKeyword(type))
            {
                throw new ArgumentOutOfRangeException("type");
            }

            if (unreservedType != TokenType.Identifier && !IsKeyword(unreservedType))
            {
                throw new ArgumentOutOfRangeException("unreservedType");
            }

            if (identifier == null || identifier == "")
            {
                throw new ArgumentException("Identifier cannot be empty.", "identifier");
            }

            if (typeCharacter != TypeCharacter.None && typeCharacter != TypeCharacter.DecimalSymbol && typeCharacter != TypeCharacter.DoubleSymbol && typeCharacter != TypeCharacter.IntegerSymbol && typeCharacter != TypeCharacter.LongSymbol && typeCharacter != TypeCharacter.SingleSymbol && typeCharacter != TypeCharacter.StringSymbol)
            {
                throw new ArgumentOutOfRangeException("typeCharacter");
            }

            if (typeCharacter != TypeCharacter.None && escaped)
            {
                throw new ArgumentException("Escaped identifiers cannot have type characters.");
            }

            _UnreservedType = unreservedType;
            _Identifier     = identifier;
            _Escaped        = escaped;
            _hasSpaceAfter  = hasSpaceAfter;
            _TypeCharacter  = typeCharacter;
        }
Ejemplo n.º 6
0
    //private AnimationController animationController;

    // Start is called before the first frame update
    protected void Start()
    {
        base.Start();
        currentLevel = PlayerStatsController.GetCurrentLevel();
        type         = PlayerStatsController.GetTypeCharacter();
        //animationController = GetComponent<AnimationController>();
        basicStats = PlayerStatsController.instance.GetBasicStats(type);
    }
Ejemplo n.º 7
0
        /// <summary>
        /// Constructs a new floating point literal token.
        /// </summary>
        /// <param name="literal">The literal value.</param>
        /// <param name="typeCharacter">The type character of the literal.</param>
        /// <param name="span">The location of the literal.</param>
        public FloatingPointLiteralToken(double literal, TypeCharacter typeCharacter, Span span) : base(TokenType.FloatingPointLiteral, literal, span)
        {
            if (typeCharacter != TypeCharacter.None && typeCharacter != TypeCharacter.SingleSymbol && typeCharacter != TypeCharacter.SingleChar && typeCharacter != TypeCharacter.DoubleSymbol && typeCharacter != TypeCharacter.DoubleChar)
            {
                throw new ArgumentOutOfRangeException("typeCharacter");
            }

            _TypeCharacter = typeCharacter;
        }
Ejemplo n.º 8
0
        /// <summary>
        /// Constructs a new decimal literal token.
        /// </summary>
        /// <param name="literal">The literal value.</param>
        /// <param name="typeCharacter">The literal's type character.</param>
        /// <param name="span">The location of the literal.</param>
        public DecimalLiteralToken(decimal literal, TypeCharacter typeCharacter, Span span) : base(TokenType.DecimalLiteral, literal, span)
        {
            if (typeCharacter != TypeCharacter.None && typeCharacter != TypeCharacter.DecimalChar && typeCharacter != TypeCharacter.DecimalSymbol)
            {
                throw new ArgumentOutOfRangeException("typeCharacter");
            }

            _TypeCharacter = typeCharacter;
        }
Ejemplo n.º 9
0
        private void ValidateTypeCharacter(TypeCharacter typeCharacter)
        {
            TypeCharacter[] types = new TypeCharacter[] { TypeCharacter.None };

            if (typeof(NumericType) == typeof(long))
            {
                types = new TypeCharacter[]
                {
                    TypeCharacter.None,
                    TypeCharacter.IntegerSymbol,
                    TypeCharacter.IntegerChar,
                    TypeCharacter.ShortChar,
                    TypeCharacter.LongSymbol,
                    TypeCharacter.LongChar
                }
            }
            ;
            else if (typeof(NumericType) == typeof(decimal))
            {
                types = new TypeCharacter[]
                {
                    TypeCharacter.None,
                    TypeCharacter.DecimalChar,
                    TypeCharacter.DecimalSymbol
                }
            }
            ;
            else if (typeof(NumericType) == typeof(double))
            {
                types = new TypeCharacter[]
                {
                    TypeCharacter.None,
                    TypeCharacter.SingleSymbol,
                    TypeCharacter.SingleChar,
                    TypeCharacter.DoubleSymbol,
                    TypeCharacter.DoubleChar
                }
            }
            ;

            bool found = false;

            foreach (TypeCharacter item in types)
            {
                if (item == typeCharacter)
                {
                    found = true;
                    break;
                }
            }

            if (!found)
            {
                throw new ArgumentOutOfRangeException("typeCharacter");
            }
        }
    }
Ejemplo n.º 10
0
        /// <summary>
        /// Constructs a new parse tree for an integer literal.
        /// </summary>
        /// <param name="literal">The literal value.</param>
        /// <param name="integerBase">The integer base of the literal.</param>
        /// <param name="typeCharacter">The type character on the literal.</param>
        /// <param name="span">The location of the parse tree.</param>
        public IntegerLiteralExpression(long literal, IntegerBase integerBase, TypeCharacter typeCharacter, Span span) : base(literal, typeCharacter, TreeType.IntegerLiteralExpression, span)
        {
            if (!Enum.IsDefined(typeof(IntegerBase), integerBase))
            {
                throw new ArgumentOutOfRangeException("integerBase");
            }

            _IntegerBase = integerBase;
        }
 public BasicStats GetBasicStatsPlayer(TypeCharacter type)
 {
     foreach (BasicInfoChars info in baseInfoChars)
     {
         if (info.typeChar == type)
         {
             return(info.baseInfo);
         }
     }
     return(baseInfoChars[0].baseInfo);
 }
Ejemplo n.º 12
0
 //perguntar pro rodrigo como fazer escolha da classe do player por 1 método só
 public void SetPlayerType(int aux)
 {
     if (aux == 1)
     {
         PlayerStatsController.SetTyperCharacter(TypeCharacter.Killer);
         type       = PlayerStatsController.GetTypeCharacter();
         basicStats = PlayerStatsController.instance.GetBasicStats(type);
     }
     else if (aux == 2)
     {
         PlayerStatsController.SetTyperCharacter(TypeCharacter.Achiever);
         type       = PlayerStatsController.GetTypeCharacter();
         basicStats = PlayerStatsController.instance.GetBasicStats(type);
     }
 }
Ejemplo n.º 13
0
        /// <summary>
        /// Constructs a new integer literal.
        /// </summary>
        /// <param name="literal">The literal value.</param>
        /// <param name="integerBase">The integer base of the literal.</param>
        /// <param name="typeCharacter">The type character of the literal.</param>
        /// <param name="span">The location of the literal.</param>
        public IntegerLiteralToken(long literal, IntegerBase integerBase, TypeCharacter typeCharacter, Span span) : base(TokenType.IntegerLiteral, literal, span)
        {
            if (!Enum.IsDefined(typeof(IntegerBase), integerBase))
            {
                throw new ArgumentOutOfRangeException("integerBase");
            }

            if (typeCharacter != TypeCharacter.None && typeCharacter != TypeCharacter.IntegerSymbol && typeCharacter != TypeCharacter.IntegerChar && typeCharacter != TypeCharacter.ShortChar && typeCharacter != TypeCharacter.LongSymbol && typeCharacter != TypeCharacter.LongChar)
            {
                throw new ArgumentOutOfRangeException("typeCharacter");
            }

            _IntegerBase   = integerBase;
            _TypeCharacter = typeCharacter;
        }
Ejemplo n.º 14
0
        /// <summary>
        /// Constructs a new simple name parse tree.
        /// </summary>
        /// <param name="name">The name, if any.</param>
        /// <param name="typeCharacter">The type character.</param>
        /// <param name="escaped">Whether the name is escaped.</param>
        /// <param name="span">The location of the parse tree.</param>
        public SimpleName(string name, TypeCharacter typeCharacter, bool escaped, Span span) : base(TreeType.SimpleName, span)
        {
            if (typeCharacter != TypeCharacter.None && escaped)
            {
                throw new ArgumentException("Escaped named cannot have type characters.");
            }

            if (typeCharacter != TypeCharacter.None && typeCharacter != TypeCharacter.DecimalSymbol && typeCharacter != TypeCharacter.DoubleSymbol && typeCharacter != TypeCharacter.IntegerSymbol && typeCharacter != TypeCharacter.LongSymbol && typeCharacter != TypeCharacter.SingleSymbol && typeCharacter != TypeCharacter.StringSymbol)
            {
                throw new ArgumentOutOfRangeException("typeCharacter");
            }

            if (name == null)
            {
                throw new ArgumentNullException("name");
            }

            _Name          = name;
            _TypeCharacter = typeCharacter;
            _Escaped       = escaped;
        }
Ejemplo n.º 15
0
    public void IncreaseNumerDiedCharacter(TypeCharacter typeCharacter)
    {
        StateEndGame stateEndGame = 0;

        if (typeCharacter == TypeCharacter.Enemy)
        {
            _countEnemy -= 1;
            if (_countEnemy == 0)
            {
                stateEndGame = StateEndGame.AllEnemiesFell;
                StartCoroutine(ShowResult(stateEndGame));
            }
        }
        else
        {
            _countFrend -= 1;
            if (_countFrend == 0)
            {
                stateEndGame = StateEndGame.AllFriendsFell;
                StartCoroutine(ShowResult(stateEndGame));
            }
        }
    }
Ejemplo n.º 16
0
 /// <summary>
 /// Constructs a new parse tree for a floating point literal.
 /// </summary>
 /// <param name="literal">The literal value.</param>
 /// <param name="typeCharacter">The type character on the literal.</param>
 /// <param name="span">The location of the parse tree.</param>
 public FloatingPointLiteralExpression(double literal, TypeCharacter typeCharacter, Span span) : base(literal, typeCharacter, TreeType.FloatingPointLiteralExpression, span)
 {
 }
Ejemplo n.º 17
0
        /// <summary>
        /// Constructs a new parse tree for a numeric literal.
        /// </summary>
        /// <param name="literal">The literal value.</param>
        /// <param name="typeCharacter">The type character on the literal value.</param>
        /// <param name="span">The location of the parse tree.</param>
        public NumericLiteralExpression(NumericType literal, TypeCharacter typeCharacter, TreeType treeType, Span span) : base(literal, treeType, span)
        {
            ValidateTypeCharacter(typeCharacter);

            _TypeCharacter = typeCharacter;
        }
Ejemplo n.º 18
0
 public static void SetTypeCharacter(TypeCharacter newType)
 {
     PlayerPrefs.SetInt(CurrentSave() + "TypeCharacter", (int)newType);
 }
 public static void SetTypeCharacter(TypeCharacter newType)
 {
     PlayerPrefs.SetInt("TypeCharacter", (int)newType);
 }
 /// <summary>
 /// Constructs a new parse tree for a floating point literal.
 /// </summary>
 /// <param name="literal">The literal value.</param>
 /// <param name="typeCharacter">The type character on the literal value.</param>
 /// <param name="span">The location of the parse tree.</param>
 public DecimalLiteralExpression(decimal literal, TypeCharacter typeCharacter, Span span) : base(literal, typeCharacter, TreeType.DecimalLiteralExpression, span)
 {
 }