public void Start()
        {
            slots      = slotHolder.GetComponentsInChildren <InventorySlot>();
            first_slot = slots[0];

            foreach (InventorySlot slot in slots)
            {
                if (slot.item == null)
                {
                    slot.empty = true;
                }
            }

            inventoryUI.SetActive(false);
            itemUseDropDown.gameObject.SetActive(false);

            stateManager  = GetComponent <CharacterStateManager>();
            playerManager = GetComponent <PlayerManager>();
            UIcam         = Camera.main.GetComponentsInChildren <Camera>()[1];
            UIcamLight    = UIcam.GetComponentInChildren <Light>();

            //test script for equiping items
            testInventoryItemScript = GetComponent <TestInventoryItemScript>();
            testInventoryItemScript.AddItem();
        }
        public void Start()
        {
            skillPanel = Instantiate(skillPanelPrefab) as GameObject;
            skillPanel.transform.SetParent(skillPanelBack.transform, false);
            slots        = skillPanel.GetComponentsInChildren <SkillSlot>();
            addNewSkills = GetComponent <TestAddNewSkills>();
            combatUtils  = GetComponent <CombatUtils>();

            foreach (SkillSlot slot in slots)
            {
                if (slot.skill == null)
                {
                    slot.empty = true;
                }
            }

            stateManager     = GetComponent <CharacterStateManager>();
            playerManager    = GetComponent <PlayerManager>();
            animationHandler = GetComponent <AnimationHandler>();

            AddSkill(Move);
            AddSkill(NormalAttack);
            addNewSkills.addSkill(this);

            if (playerManager.isCurrentPlayer)
            {
                skillPanel.SetActive(true);
            }
            else
            {
                skillPanel.SetActive(false);
            }
        }
Exemplo n.º 3
0
 public void ApplyCellToPlayer(CellAlchemyState cell, CharacterStateManager character)
 {
     if (cell.isDry)
     {
         return;
     }
     if (cell.gasState == GasPhaseState.Poison)
     {
         character.ApplyPoison();
     }
     if (cell.gasState == GasPhaseState.Water)
     {
         character.ApplyWet();
     }
     if (cell.shockState == ShockState.Shocked)
     {
         character.ApplyShock();
     }
     if (cell.fireState == FireState.Chill)
     {
         character.ApplyChill();
     }
     if (cell.fireState == FireState.Burning)
     {
         character.ApplyHeat();
     }
     if (cell.fireState == FireState.Inferno)
     {
         character.ApplyInferno();
     }
 }
Exemplo n.º 4
0
 private void Start()
 {
     characterTransform = GetComponent <Transform>();
     taticalMovement    = GetComponent <TaticalMovement>();
     characterStats     = GetComponent <CharacterStats>();
     stateManager       = GetComponent <CharacterStateManager>();
     enemyController    = GetComponent <EnemyController>();
 }
Exemplo n.º 5
0
 private void Awake()
 {
     playerTransform   = GetComponent <Transform>();
     inventoryHandler  = GetComponent <InventoryHandler>();
     taticalMovement   = GetComponent <TaticalMovement>();
     characterStats    = GetComponent <CharacterStats>();
     stateManager      = GetComponent <CharacterStateManager>();
     skillSlotsHandler = GetComponent <SkillSlotsHandler>();
 }
Exemplo n.º 6
0
 // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
 override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     stateManager    = animator.GetComponent <CharacterStateManager>();
     shieldCharge    = animator.GetComponent <ShieldCharge>();
     taticalMovement = animator.GetComponent <TaticalMovement>();
     stateManager.characterAction = CharacterAction.ShieldCharge;
     stateManager.characterState  = CharacterState.IsInteracting;
     shieldCharge.GetComponent <Collider>().isTrigger = true;
 }
 public override void Initialize()
 {
     characterStats   = GetComponent <CharacterStats>();
     stateManager     = GetComponent <CharacterStateManager>();
     taticalMovement  = GetComponent <TaticalMovement>();
     animationHandler = GetComponent <AnimationHandler>();
     skillList        = GetComponent <DogDudeSkillList>();
     skillDict        = skillList.skillDict;
     ConstructFSM();
 }
 public AggressiveState(CharacterStats stats,
                        CharacterStateManager states, TaticalMovement tatical, AnimationHandler animation,
                        Dictionary <SkillType, Skill> skills)
 {
     stateID          = FSMStateID.Aggressive;
     characterStats   = stats;
     stateManager     = states;
     taticalMovement  = tatical;
     animationHandler = animation;
     skillDict        = skills;
 }
Exemplo n.º 9
0
        // Start is called before the first frame update
        void Start()
        {
            combatUtils           = GetComponent <CombatUtils>();
            stateManager          = GetComponent <CharacterStateManager>();
            characterTransform    = transform;
            isometricCamera       = Camera.main;
            animationHandler      = GetComponent <AnimationHandler>();
            characterRigidBody    = GetComponent <Rigidbody>();
            characterStats        = GetComponent <CharacterStats>();
            characterRigidbody    = GetComponent <Rigidbody>();
            characterStateManager = GetComponent <CharacterStateManager>();
            playerManager         = GetComponent <PlayerManager>();

            SetCurrentCell();
        }
Exemplo n.º 10
0
        // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
        //override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        //{
        //
        //}

        // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks
        override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            CharacterStateManager stateManager = animator.GetComponent <CharacterStateManager>();

            if (animator.GetFloat("MovementThreshold") >= .5f)
            {
                stateManager.characterState    = CharacterState.IsInteracting;
                GameManager.instance.gameState = GameState.ResolvingInteraction;
            }
            else
            {
                stateManager.characterState    = CharacterState.Ready;
                GameManager.instance.gameState = GameState.Ready;
            }
        }
Exemplo n.º 11
0
        // Start is called before the first frame update
        void Start()
        {
            healthBar      = statusPanel.GetComponentInChildren <HealthBar>();
            apBar          = statusPanel.GetComponentInChildren <APFill>();
            panelName      = statusPanel.GetComponentInChildren <Text>();
            panelName.text = characterName;

            maxHealth     = SetMaxHealthFromVitality();
            currentHealth = maxHealth;
            healthBar.SetMaxHealth(maxHealth);

            maxAP     = SetMaxAPFromStamina();
            currentAP = maxAP;
            apBar.SetMaxAP(maxAP);

            stateManager     = GetComponent <CharacterStateManager>();
            animationHandler = GetComponent <AnimationHandler>();
            taticalMovement  = GetComponent <TaticalMovement>();
        }
Exemplo n.º 12
0
        // OnStateEnter is called when a transition starts and the state machine starts to evaluate this state
        override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            CharacterStateManager stateManager = animator.GetComponent <CharacterStateManager>();

            stateManager.characterState = CharacterState.IsInteracting;
        }
Exemplo n.º 13
0
 public void Start()
 {
     stateManager = GetComponent <CharacterStateManager>();
     animator     = GetComponent <Animator>();
     inputHandler = InputHandler.instance;
 }