コード例 #1
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)
        {
            TaticalMovement taticalMovement = animator.GetComponent <TaticalMovement>();

            targetPosition = taticalMovement.moveLocation;
            animator.GetComponent <CharacterStateManager>().characterAction = CharacterAction.LyingDown;
        }
コード例 #2
0
 private void Start()
 {
     characterTransform = GetComponent <Transform>();
     taticalMovement    = GetComponent <TaticalMovement>();
     characterStats     = GetComponent <CharacterStats>();
     stateManager       = GetComponent <CharacterStateManager>();
     enemyController    = GetComponent <EnemyController>();
 }
コード例 #3
0
 private void Awake()
 {
     playerTransform   = GetComponent <Transform>();
     inventoryHandler  = GetComponent <InventoryHandler>();
     taticalMovement   = GetComponent <TaticalMovement>();
     characterStats    = GetComponent <CharacterStats>();
     stateManager      = GetComponent <CharacterStateManager>();
     skillSlotsHandler = GetComponent <SkillSlotsHandler>();
 }
コード例 #4
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;
 }
コード例 #5
0
        // OnStateExit is called when a transition ends and the state machine finishes evaluating this state
        override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
        {
            TaticalMovement taticalMovement = animator.GetComponent <TaticalMovement>();

            animator.transform.position = targetPosition;
            taticalMovement.UpdateGridState();
            //taticalMovement.moveLocation = Vector3.up;
            //targetPosition = Vector3.up;
            animator.GetComponent <StatusVFX>().StunVFXPlay();
        }
コード例 #6
0
 public override void Initialize()
 {
     characterStats   = GetComponent <CharacterStats>();
     stateManager     = GetComponent <CharacterStateManager>();
     taticalMovement  = GetComponent <TaticalMovement>();
     animationHandler = GetComponent <AnimationHandler>();
     skillList        = GetComponent <DogDudeSkillList>();
     skillDict        = skillList.skillDict;
     ConstructFSM();
 }
コード例 #7
0
 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;
 }
コード例 #8
0
ファイル: Move.cs プロジェクト: Tatics-Games/Tatics-Dungeon
        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);
        }
コード例 #9
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);
        }
コード例 #10
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);
        }
コード例 #11
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);
     }
 }
コード例 #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)
        {
            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);
        }
コード例 #14
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);
        }
コード例 #15
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>();
        }
コード例 #16
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);
        }
コード例 #17
0
 public abstract SkillAbstract AttachSkill(CharacterStats _characterStats, AnimationHandler _animationHandler,
                                           TaticalMovement _taticalMovement, CombatUtils _combatUtils, Skill _skill);
コード例 #18
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);
                    }
                }
            }
        }
コード例 #19
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);
        }