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.º 2
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);
        }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
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);
        }
Exemplo n.º 5
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.º 6
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);
     }
 }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                                  TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            CarrotDeath carrotDeath = _characterStats.gameObject.AddComponent <CarrotDeath>();

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

            carrotDeath.alchemicalDamage = new CombatStat(_skill.damage, CombatStatType.fireDamage);

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

            carrotDeath.alchemicalDamage.AddModifier(intScaling);
            return(carrotDeath);
        }
Exemplo n.º 9
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);
        }
Exemplo n.º 10
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);
        }
Exemplo n.º 11
0
        public override SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                                  TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill)
        {
            FlameCross flameCross = _characterStats.gameObject.AddComponent <FlameCross>();

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

            flameCross.alchemicalDamage = new CombatStat(_skill.damage, CombatStatType.fireDamage);

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

            flameCross.alchemicalDamage.AddModifier(intScaling);
            // Debug.Log(flameCross.alchemicalDamage.Value);
            return(flameCross);
        }
Exemplo n.º 12
0
 public abstract SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                           TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill);