// Update is called once per frame
    void Update()
    {
        if (_target != null)
        {
            _EnemyDistance = Vector3.Distance(_target.position, _Position.position);
        }

//		Enemies = GameObject.FindGameObjectsWithTag ("MobEnemey");
//		Equipment_type =PlayerUIManager.Equiped_Weapon.Equipment_Slot;
        if (Input.GetButtonDown("Pause_Toggle"))
        {
            if (!CameraManipulation.x)
            {
                CameraManipulation.z     = true;
                CameraManipulation.pause = true;
            }
            if (CameraManipulation.x)
            {
                CameraManipulation.z = true;
            }
        }
        switch (Equipment_type)
        {
        case EQType.Axe:
            break;

        case EQType.Blade:
            _LightAttack  = 1f;
            _ChargeAttack = 50f;
            _blade        = true;
            x             = _Blade;
            if (_target != null)
            {
                if (Input.GetButtonDown("Light"))
                {
                    _Animator.SetTrigger("Light");
                    if (_LightAttack > _EnemyDistance)
                    {
                        _target.GetComponentInParent <Enemy> ().Hit(Random.Range(PlayerUIManager.Equiped_Weapon.Min_Damage, PlayerUIManager.Equiped_Weapon.Min_Damage + GameInformation.Aim * GameInformation.Strength));
                    }
                }
                else
                {
                    _Animator.ResetTrigger("Light");
                }
                if (Input.GetButtonDown("Heavy"))
                {
                    _Animator.SetTrigger("Heavy");
                    if (_ChargeAttack > _EnemyDistance)
                    {
                        _target.GetComponentInParent <Enemy> ().Hit(Random.Range(PlayerUIManager.Equiped_Weapon.Min_Damage, PlayerUIManager.Equiped_Weapon.Min_Damage + GameInformation.Aim * GameInformation.Strength));
                    }
                }
                else
                {
                    _Animator.ResetTrigger("Heavy");
                }
            }
            break;

        case EQType.Cannon:
            break;

        case EQType.Wand:
            _wand = true;
            x     = _Wand;
            break;

        case EQType.Bullet:
            break;

        case EQType.Bow:
            break;

        case EQType.ChainBlade:
            break;

        case EQType.Cannon_Spear:
            break;

        case EQType.Cards:
            break;

        case EQType.ChainBlade_Talisman:
            break;

        case EQType.Claw:
            break;

        case EQType.Dagger:
            break;

        case EQType.Fan:
            break;

        case EQType.Arrow:
            break;

        default:
            if (Input.GetButtonDown("Light"))
            {
                _Animator.SetTrigger("Light");
            }
            else
            {
                _Animator.ResetTrigger("Light");
            }
            break;
        }

        if (!Flying)
        {
            //Movement Commands Rotation
            if (Mathf.Abs(Input.GetAxis("Horizontal")) > 0)
            {
                _Position.Rotate(0, Input.GetAxis("Horizontal") * Time.deltaTime * _TurnAmount, 0);
                _Turn = Input.GetAxis("Horizontal");
            }
            //Movement Commands Moving Forward and Backward
            if (Mathf.Abs(Input.GetAxis("Vertical")) > 0)
            {
                _Position.Translate(Vector3.forward * Input.GetAxis("Vertical") * Time.deltaTime * _ForwardAmount);
                _Forward = Input.GetAxis("Vertical");
            }
        }
        //Jumping Command Going up

        if (PlayerUIManager.Stamina > 0)
        {
            if (Mathf.Abs(Input.GetAxis("Jump")) > 0)
            {
                InvokeRepeating("Jump", 0.3f, 3);
            }
            //Flying Command
            if (Mathf.Abs(Input.GetAxis("Ascend")) > 0)
            {
                Invoke("Ascension", 0.3f);
            }
        }
        //Flying Command Ascension
//		if (Flying) {
//			if (Mathf.Abs (Input.GetAxis ("Horizontal")) > 0) {
//				_Position.Rotate (0, Input.GetAxis ("Horizontal") * Time.deltaTime * _TurnAmount, 0);
//				_Turn = Input.GetAxis ("Horizontal");
//			}
//			//Movement Commands Moving Forward and Backward
//			if (Mathf.Abs (Input.GetAxis ("Vertical")) > 0) {
//				_Position.Translate (Vector3.forward * Input.GetAxis ("Vertical") * Time.maximumDeltaTime *0.65f);
//				_Forward = Input.GetAxis ("Vertical");
//			}
//
//			if (Mathf.Abs (Input.GetAxis ("Jump")) > 0) {
//				_Position.Translate (Vector3.up*Input.GetAxis("Jump")*Time.maximumDeltaTime*_Jump_Amount*0.3f);
//          }
//
//			//Descending Command Going Down
//			if (Mathf.Abs (Input.GetAxis ("Descend")) > 0) {
//				_Position.Translate(Vector3.down*_Jump_Amount*Time.maximumDeltaTime*0.3f);
//
//			}
//
//		}
        //Targeting system


        //Combo Variables


//			if (Input.GetButtonDown ("Heavy")) {
//				_Animator.SetTrigger ("Heavy");
//				if (_EnemyDistance > _LightAttack) {
//					_target.GetComponentInParent<Enemy> ().Hit (Random.Range (PlayerUIManager.Equiped_Weapon.Min_Damage, PlayerUIManager.Equiped_Weapon.Min_Damage + GameInformation.Aim * GameInformation.Strength + GameInformation.Intellect));
//				}
//			} else {
//				_Animator.ResetTrigger ("Heavy");
//			}
        //Resting
        if (_Rest)
        {
            Invoke("Regeneration", 0.5f);
        }

        //Weapon Switching Schematic as Well as Instantiating the weapon
        if (Input.GetButtonDown("Weapon_Switch_R"))
        {
            if (!w1)
            {
                _blade = false;
                _wand  = false;
                x.SetActive(false);
                PlayerUIManager.Equiped_Weapon = PlayerUIManager.weapon1;
//				x= Instantiate (PauseMenu.WDB.Get (PlayerUIManager.Equiped_Weapon.ItemID).Prefab,_Blade.transform.position,_Blade.transform.rotation) as GameObject;
                Weapon myWeapon = x.AddComponent <Weapon>();
                myWeapon.ItemID                = PlayerUIManager.Equiped_Weapon.ItemID;
                myWeapon.Name                  = PlayerUIManager.Equiped_Weapon.Name;
                myWeapon.Burden                = PlayerUIManager.Equiped_Weapon.Burden;
                myWeapon.Equipment_Slot        = PlayerUIManager.Equiped_Weapon.Equipment_Slot;
                myWeapon.Min_Damage            = PlayerUIManager.Equiped_Weapon.Min_Damage;
                myWeapon.Durability            = PlayerUIManager.Equiped_Weapon.Durability;
                myWeapon.Max_Durability        = PlayerUIManager.Equiped_Weapon.Max_Durability;
                myWeapon.Value                 = PlayerUIManager.Equiped_Weapon.Value;
                myWeapon.Equipment_Element     = PlayerUIManager.Equiped_Weapon.Equipment_Element;
                myWeapon.Equipment_Type        = PlayerUIManager.Equiped_Weapon.Equipment_Type;
                myWeapon.Equipment_Range       = PlayerUIManager.Equiped_Weapon.Equipment_Range;
                Equipment_type                 = PlayerUIManager.Equiped_Weapon.Equipment_Type;
                PlayerUIManager.Equipment_Slot = PlayerUIManager.Equiped_Weapon.Equipment_Slot;
                x.SetActive(true);
                x.tag = "Weapon";
//				x.transform.position = new Vector3 (_Blade.transform.position.x,_Blade.transform.position.y,_Blade.transform.position.z);
                Debug.Log("R_Wep_");
                w1 = true;
                w2 = false;
                w3 = false;
            }
        }
//		x.transform.position = new Vector3 (_Blade.transform.position.x,_Blade.transform.position.y,_Blade.transform.position.z);
//		x.transform.rotation = _Blade.transform.rotation;
        if (Input.GetButtonDown("Weapon_Switch_M"))
        {
            x.SetActive(false);
            _blade         = false;
            _wand          = false;
            Equipment_type = EQType.None;
            PlayerUIManager.Equiped_Weapon = PlayerUIManager.weapon3;
        }
        if (Input.GetButtonDown("Weapon_Switch_L"))
        {
            if (!w2)
            {
                x.SetActive(false);
                _blade = false;
                _wand  = false;

                PlayerUIManager.Equiped_Weapon = PlayerUIManager.weapon2;

//				x = Instantiate (PauseMenu.WDB.Get (PlayerUIManager.Equiped_Weapon.ItemID).Prefab,_Blade.transform.position,_Blade.transform.rotation) as GameObject;
                Weapon myWeapon = x.AddComponent <Weapon>();
                myWeapon.ItemID                = PlayerUIManager.Equiped_Weapon.ItemID;
                myWeapon.Name                  = PlayerUIManager.Equiped_Weapon.Name;
                myWeapon.Burden                = PlayerUIManager.Equiped_Weapon.Burden;
                myWeapon.Equipment_Slot        = PlayerUIManager.Equiped_Weapon.Equipment_Slot;
                myWeapon.Min_Damage            = PlayerUIManager.Equiped_Weapon.Min_Damage;
                myWeapon.Durability            = PlayerUIManager.Equiped_Weapon.Durability;
                myWeapon.Max_Durability        = PlayerUIManager.Equiped_Weapon.Max_Durability;
                myWeapon.Value                 = PlayerUIManager.Equiped_Weapon.Value;
                myWeapon.Equipment_Element     = PlayerUIManager.Equiped_Weapon.Equipment_Element;
                myWeapon.Equipment_Type        = PlayerUIManager.Equiped_Weapon.Equipment_Type;
                myWeapon.Equipment_Range       = PlayerUIManager.Equiped_Weapon.Equipment_Range;
                PlayerUIManager.Equipment_Slot = PlayerUIManager.Equiped_Weapon.Equipment_Slot;
                PlayerUIManager.WeaponTypes    = PlayerUIManager.Equiped_Weapon.Equipment_Type;
                x.SetActive(true);
                x.tag = "Weapon";
                Debug.Log("L_Wep_");
                w1 = false;
                w3 = false;
                w2 = true;
            }
        }



        //-------------Animator Variables----------//
        //Movement Variables
        _Animator.SetFloat("Move", Input.GetAxis("Vertical"));
        _Animator.SetFloat("Turn", Input.GetAxis("Horizontal"));
        _Animator.SetFloat("Jump", Input.GetAxis("Jump"));
        _Animator.SetBool("Flying", Flying);
        _Animator.SetBool("OnGround", _IsGrounded);
        _Animator.SetBool("Awakened", _Awakened);
        _Animator.SetBool("Blade", _blade);
        _Animator.SetBool("Wand", _wand);
    }
Beispiel #2
0
    void Update()
    {
        if (Health < 1)
        {
            Respawn();
        }
//
        //Weapon Equiping Updates
        if (AlphaMenu.NewGame)
        {
            Equiped_Weapon    = weapon1;
            weapon1           = GameInformation.InventoryWeapons [0];
            weapon2           = GameInformation.InventoryWeapons [1];
            weapon3           = GameInformation.InventoryWeapons [2];
            AlphaMenu.NewGame = false;
            WeaponTypes       = EQType.None;
        }
        if (AlphaMenu.HaveLoaded)
        {
            Equiped_Weapon       = weapon1;
            weapon1              = GameInformation.InventoryWeapons [0];
            weapon2              = GameInformation.InventoryWeapons [1];
            weapon3              = GameInformation.InventoryWeapons [2];
            AlphaMenu.HaveLoaded = false;
            WeaponTypes          = EQType.None;
        }

        //Expertise Functions
        if (GameInformation.PlayerLevel == 1)
        {
            GameInformation.Max_Expertise_Points = 1000;
        }
        if (GameInformation.PlayerLevel == 10)
        {
            GameInformation.Max_Expertise_Points = 2500;
        }
        if (GameInformation.PlayerLevel == 20)
        {
            GameInformation.Max_Expertise_Points = 3500;
        }
        if (GameInformation.PlayerLevel == 30)
        {
            GameInformation.Max_Expertise_Points = 5500;
        }
        if (GameInformation.PlayerLevel == 40)
        {
            GameInformation.Max_Expertise_Points = 9000;
        }
        if (GameInformation.PlayerLevel == 50)
        {
            GameInformation.Max_Expertise_Points = 19000;
        }
        //Adjusts stats whenever the character levels up or equips items
//		AdjustStats ();
        ScaleAdjustment();
        switch (WeaponTypes)
        {
        case EQType.Axe:
            Moveset("Axe");
            break;

        case EQType.Blade:
            Moveset("Blade");
            break;

        case EQType.Cannon:
            Moveset("Cannon");
            break;

        case EQType.Wand:
            Moveset("Wand");
            break;

        case EQType.Bullet:
            Moveset("Bullet");
            break;

        case EQType.Bow:
            Moveset("Bow");
            break;

        case EQType.ChainBlade:
            Moveset("ChainBlade");
            break;

        case EQType.Cannon_Spear:
            Moveset("Cannon_Spear");
            break;

        case EQType.Cards:
            Moveset("Cards");
            break;

        case EQType.ChainBlade_Talisman:
            Moveset("ChainBlade_Talisman");
            break;

        case EQType.Claw:
            Moveset("Claw");
            break;

        case EQType.Dagger:
            Moveset("Dagger");
            break;

        case EQType.Fan:
            Moveset("Fan");
            break;

        default:
            break;
        }



        if (AlphaMenu.HaveLoaded)
        {
            LoadLocation();
            StatAdjustment();
            AlphaMenu.HaveLoaded = false;
        }
        StoreLocation();

        if (Health <= 0)
        {
            Respawn();
        }
    }
Beispiel #3
0
 public void DisplayEquipmentType()
 {
     EquipmentType = (EQType)EditorGUILayout.EnumPopup("Equipment Type", EquipmentType);
 }