Пример #1
0
 // Start is called before the first frame update
 void Start()
 {
     animationHandler = GetComponent <AnimationHandler>();
     maxHealth        = SetMaxHealthFromHleathLevel();
     currentHealth    = maxHealth;
     healthBar.SetMaxHealth(maxHealth);
 }
        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);
            }
        }
 public override void Initialize()
 {
     characterStats   = GetComponent <CharacterStats>();
     stateManager     = GetComponent <CharacterStateManager>();
     taticalMovement  = GetComponent <TaticalMovement>();
     animationHandler = GetComponent <AnimationHandler>();
     skillList        = GetComponent <DogDudeSkillList>();
     skillDict        = skillList.skillDict;
     ConstructFSM();
 }
Пример #4
0
 private void Start()
 {
     characterTransform   = GetComponent <Transform>();
     characterRigidbody   = GetComponent <Rigidbody>();
     inputHandler         = GetComponent <InputHandler>();
     cameraTransfrom      = Camera.main.transform;
     animationHandler     = GetComponent <AnimationHandler>();
     capsuleCollider      = GetComponent <CapsuleCollider>();
     groundCheckLayerMask = ~(1 << 9 | 1 << 1 | 1 << 2 | 1 << 5);
 }
 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;
 }
Пример #6
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                                  TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            Move move = _characterStats.gameObject.AddComponent <Move>();

            move.characterStats   = _characterStats;
            move.animationHandler = _animationHandler;
            move.taticalMovement  = _taticalMovement;
            move.skill            = _skill;
            move.combatUtils      = _combatUtils;
            return(move);
        }
Пример #7
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                                  TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            ShieldCharge shieldCharge = _characterStats.gameObject.AddComponent <ShieldCharge>();

            shieldCharge.characterStats     = _characterStats;
            shieldCharge.animationHandler   = _animationHandler;
            shieldCharge.taticalMovement    = _taticalMovement;
            shieldCharge.characterRigidBody = _taticalMovement.GetComponent <Rigidbody>();
            shieldCharge.stateManager       = _taticalMovement.GetComponent <CharacterStateManager>();
            shieldCharge.skill       = _skill;
            shieldCharge.combatUtils = _combatUtils;
            return(shieldCharge);
        }
Пример #8
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                                  TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            RangeAttack rangeAttack = _characterStats.gameObject.AddComponent <RangeAttack>();

            rangeAttack.characterStats          = _characterStats;
            rangeAttack.animationHandler        = _animationHandler;
            rangeAttack.taticalMovement         = _taticalMovement;
            rangeAttack.skill                   = _skill;
            rangeAttack.combatUtils             = _combatUtils;
            rangeAttack.arrowHolder             = _taticalMovement.GetComponent <ArrowHolder>();
            rangeAttack.arrowHolder.rangeAttack = rangeAttack;
            return(rangeAttack);
        }
Пример #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();
        }
Пример #10
0
 public void UpdateSlot(CharacterStats characterStats, AnimationHandler animationHandler,
                        TaticalMovement taticalMovement, CombatUtils combatUtils)
 {
     if (skill == null)
     {
         slotIconPanel.GetComponent <Image>().sprite = defaultSprite;
     }
     else
     {
         slotIconPanel.GetComponent <Image>().sprite = skill.icon;
         skillScript = skill.skillScriptObject.GetComponent <SkillAbstract>();
         skillScript = skillScript.AttachSkill(characterStats, animationHandler,
                                               taticalMovement, combatUtils, skill);
     }
 }
Пример #11
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler, TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            FireStorm fireStorm = _characterStats.gameObject.AddComponent <FireStorm>();

            fireStorm.characterStats   = _characterStats;
            fireStorm.animationHandler = _animationHandler;
            fireStorm.taticalMovement  = _taticalMovement;
            fireStorm.skill            = _skill;
            fireStorm.combatUtils      = _combatUtils;

            fireStorm.alchemicalDamage = new CombatStat(_skill.damage, CombatStatType.fireDamage);
            fireStorm.intScaleValue    = skill._scaleValue * _characterStats.Intelligence.Value;
            StatModifier intScaling = new StatModifier(fireStorm.intScaleValue, StatModType.Flat);

            fireStorm.alchemicalDamage.AddModifier(intScaling);

            return(fireStorm);
        }
Пример #12
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                                  TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            HealingHands healingHands = _characterStats.gameObject.AddComponent <HealingHands>();

            healingHands.characterStats   = _characterStats;
            healingHands.animationHandler = _animationHandler;
            healingHands.taticalMovement  = _taticalMovement;
            healingHands.skill            = _skill;
            healingHands.combatUtils      = _combatUtils;
            healingHands.HealValue        = new Stat(_skill.damage);
            healingHands.scaleValue       = _characterStats.Vitality.Value * _skill._scaleValue;

            StatModifier scaleMod = new StatModifier(healingHands.scaleValue, StatModType.Flat);

            healingHands.HealValue.AddModifier(scaleMod);

            return(healingHands);
        }
Пример #13
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                                  TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            EnergyBall energyBall = _characterStats.gameObject.AddComponent <EnergyBall>();

            energyBall.characterStats   = _characterStats;
            energyBall.animationHandler = _animationHandler;
            energyBall.taticalMovement  = _taticalMovement;
            energyBall.skill            = _skill;
            energyBall.combatUtils      = _combatUtils;

            energyBall.alchemicalDamage = new CombatStat(_skill.damage, CombatStatType.shockDamage);

            energyBall.intScaleValue = skill._scaleValue * _characterStats.Intelligence.Value;
            StatModifier intScaling = new StatModifier(intScaleValue, StatModType.Flat);

            energyBall.alchemicalDamage.AddModifier(intScaling);
            return(energyBall);
        }
Пример #14
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>();
        }
Пример #15
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats,
                                                  AnimationHandler _animationHandler, TaticalMovement _taticalMovement,
                                                  CombatUtils _combatUtils, Skill _skill)
        {
            IceBomb iceBomb = _characterStats.gameObject.AddComponent <IceBomb>();

            iceBomb.characterStats   = _characterStats;
            iceBomb.animationHandler = _animationHandler;
            iceBomb.taticalMovement  = _taticalMovement;
            iceBomb.skill            = _skill;
            iceBomb.combatUtils      = _combatUtils;

            iceBomb.alchemicalDamage = new CombatStat(_skill.damage, CombatStatType.waterDamage);
            iceBomb.intScaleValue    = skill._scaleValue * _characterStats.Intelligence.Value;
            StatModifier intScaling = new StatModifier(intScaleValue, StatModType.Flat);

            iceBomb.alchemicalDamage.AddModifier(intScaling);

            return(iceBomb);
        }
Пример #16
0
        public static void Activate(CharacterStats characterStats, AnimationHandler animationHandler, TaticalMovement taticalMovement, Skill skill, float delta)
        {
            IntVector2 index = taticalMovement.GetMouseIndex();

            GridManager.Instance.HighlightCastableRange(taticalMovement.currentIndex, index, skill);
            int distance = taticalMovement.GetRequiredMoves(index, taticalMovement.path);

            if (index.x >= 0 && characterStats.currentAP >= skill.APcost)
            {
                if (Input.GetMouseButtonDown(0) || InputHandler.instance.tacticsXInput)
                {
                    InputHandler.instance.tacticsXInput = false;

                    animationHandler.PlayTargetAnimation("Attack");
                    characterStats.UseAP(skill.APcost);
                    GridManager.Instance.RemoveAllHighlights();
                    List <GridCell> cells = CastableShapes.GetCastableCells(skill, index);
                    foreach (GridCell cell in cells)
                    {
                        AlchemyManager.Instance.ApplyLiquid(cell.alchemyState, LiquidPhaseState.Oil);
                    }
                }
            }
        }
Пример #17
0
 public abstract SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                           TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill);
Пример #18
0
 public void Start()
 {
     animationHandler = GetComponentInParent <AnimationHandler>();
 }