Example #1
0
 void OnEnable()
 {
     playerData       = DataManager.Instance.PlayerData;
     playerController = GameManager.Instance.PlayerController;
     archerController = GameManager.Instance.ArcherController;
     knightController = GameManager.Instance.KnightController;
     levelSystem      = GameManager.Instance.LevelSystem;
 }
Example #2
0
 void Start()
 {
     has            = enemy.GetComponent <HitAudioSource>();
     es             = enemy.GetComponent <EnemySkill>();
     aa             = enemy.GetComponent <ArcherArmour>();
     damaged_shield = false;
     damaged        = false;
     arCtrl         = enemy.GetComponent <ArcherController>();
 }
Example #3
0
 public void UpgradeArcher(ArcherController archer)
 {
     if (archer.level < archerMaxLevel && archerUpgradeCost[archer.level] <= currentGold)
     {
         currentGold -= archerUpgradeCost[archer.level];
         archer.LevelUp();
         uiController.ShowGold(currentGold);
         CheckArcherUpgrade();
     }
 }
 void Awake()
 {
     instance = this;
     //movementControler   = GetComponent              <CharacterController>();
     anime          = GetComponentInChildren <Animation>();
     rb             = GetComponent <Rigidbody>();
     collider       = GetComponent <CapsuleCollider>();
     archerControls = GetComponent <ArcherController>();
     health         = GetComponent <PlayerHealth>();
 }
Example #5
0
    public void InitArchers()
    {
        float posY = TopY;

        for (int i = 0; i < 7; i++)
        {
            GameObject go = Instantiate(Resources.Load("archer")) as GameObject;
            go.transform.position = new Vector3(PosX, posY, 0);

            posY -= Gap;
            ArcherController archer = go.GetComponent <ArcherController>();
            Archers.Add(archer);
        }
    }
Example #6
0
    void Start()
    {
        ac = this.GetComponent <ArcherController>();
        es = this.GetComponent <EnemySkill>();
        aa = this.GetComponent <ArcherArmour>();


        total_health = totalStartHealth = startHealth + aa.GetBreastPlate() * breastPlatePower +
                                          aa.GetTozluk() * tozlukPower +
                                          aa.GetHelmet() * helmetPower +
                                          es.GetEnemyVigor() * healthAmountPerSkill;

        startScaleX = healthLoad.transform.localScale.x;
    }
Example #7
0
    //캐릭터 스킬 저장, 실제 게임 상에서만 실행함
    public void SaveCharacterSkillData(Job _Job)
    {
        if (File.Exists(characterSkillDataPath))
        {
            File.Delete(characterSkillDataPath);
        }


        switch (_Job)
        {
        case Job.Knight:
            KnightController     knightController     = GameManager.Instance.KnightController;
            KnightSkillPointData knightSkillPointData = new KnightSkillPointData();
            knightSkillPointData.EnableSkillPoint    = knightController.EnableSkillPoint;
            knightSkillPointData.BerserkerSkillPoint = knightController.BerserkerSkillPoint;
            knightSkillPointData.DamageUpSkillPoint  = knightController.DamageUpSkillPoint;
            knightSkillPointData.HpHealSkillPoint    = knightController.HpHealSkillPoint;
            knightSkillPointData.ArmorUpSkillPoint   = knightController.ArmorUpSkillPoint;

            string     knightSkillData       = JsonUtility.ToJson(knightSkillPointData);
            FileStream knightSkillFileStream = new FileStream(characterSkillDataPath, FileMode.OpenOrCreate, FileAccess.Write);
            byte[]     bytes = Encoding.UTF8.GetBytes(knightSkillData);
            knightSkillFileStream.Write(bytes, 0, bytes.Length);
            knightSkillFileStream.Close();

            break;

        case Job.Archer:
            ArcherController     archerController     = GameManager.Instance.ArcherController;
            ArcherSkillPointData archerSkillPointData = new ArcherSkillPointData();
            archerSkillPointData.AbsenseSkillPoint    = archerController.AbsenseSkillPoint;
            archerSkillPointData.ArrowStormSkillPoint = archerController.ArrowStormSkillPoint;
            archerSkillPointData.HpHealSkillPoint     = archerController.HpHealSkillPoint;
            archerSkillPointData.MpHealSkillPoint     = archerController.MpHealSkillPoint;

            string     archerSkillData       = JsonUtility.ToJson(archerSkillPointData);
            FileStream archerSkillFileStream = new FileStream(characterSkillDataPath, FileMode.OpenOrCreate, FileAccess.Write);
            byte[]     bytes2 = Encoding.UTF8.GetBytes(archerSkillData);
            archerSkillFileStream.Write(bytes2, 0, bytes2.Length);
            archerSkillFileStream.Close();
            break;
        }
    }
Example #8
0
    public void LoadSkillDataAndSet(Job _Job)
    {
        if (!File.Exists(characterSkillDataPath))
        {
            return;
        }
        switch (_Job)
        {
        case Job.Knight:
            FileStream       knightSkillFileStream = new FileStream(characterSkillDataPath, FileMode.Open, FileAccess.Read);
            StreamReader     knightStreamReader    = new StreamReader(knightSkillFileStream);
            var              knightSkillData       = knightStreamReader.ReadToEnd();
            var              loadedKnightSkillData = JsonUtility.FromJson <KnightSkillPointData>(knightSkillData);
            KnightController knightController      = GameManager.Instance.KnightController;
            knightController.AddBerserkerSkillPoint(loadedKnightSkillData.BerserkerSkillPoint);
            knightController.AddDamageUpSkillPoint(loadedKnightSkillData.DamageUpSkillPoint);
            knightController.AddHpHealSkillPoint(loadedKnightSkillData.HpHealSkillPoint);
            knightController.AddArmorUpSkillPoint(loadedKnightSkillData.ArmorUpSkillPoint);
            //얘를 맨 마지막에 함
            knightController.AddEnableSkillPoint(loadedKnightSkillData.EnableSkillPoint, false);
            knightStreamReader.Close();
            break;

        case Job.Archer:
            FileStream       archerSkillFileStream = new FileStream(characterSkillDataPath, FileMode.Open, FileAccess.Read);
            StreamReader     archerStreamReader    = new StreamReader(archerSkillFileStream);
            var              archerSkillData       = archerStreamReader.ReadToEnd();
            var              loadedArcherSkillData = JsonUtility.FromJson <ArcherSkillPointData>(archerSkillData);
            ArcherController archerController      = GameManager.Instance.ArcherController;
            archerController.AddAbsenseSkillPoint(loadedArcherSkillData.AbsenseSkillPoint);
            archerController.AddArrowStormSkillPoint(loadedArcherSkillData.ArrowStormSkillPoint);
            archerController.AddHpHealSkillPoint(loadedArcherSkillData.HpHealSkillPoint);
            archerController.AddMpHealSkillPoint(loadedArcherSkillData.MpHealSkillPoint);
            //얘를 맨 마지막에 함
            archerController.AddEnableSkillPoint(loadedArcherSkillData.EnableSkillPoint, false);
            archerStreamReader.Close();
            break;
        }
    }
Example #9
0
    // Start is called before the first frame update
    void Start()
    {
        player = GameObject.FindGameObjectWithTag("Player");
        team   = GameObject.Find("Faction");
        UI     = player.GetComponent <UIController>();
        RM     = team.GetComponent <ResourceManager>();
        RC     = team.GetComponent <ResearchController>();

        anim          = GetComponent <Animator>();
        agent         = GetComponent <NavMeshAgent>();
        UnitSelection = GetComponent <UnitSelection>();
        archer        = GetComponent <ArcherController>();
        wizard        = GetComponent <WizardController>();
        if (archer)
        {
            arrowPrefab = archer.arrow;
        }
        if (wizard)
        {
            fireballPrefab = wizard.fireball;
        }
    }
Example #10
0
    void FindPlayer()
    {
        if (!foundPlayer)
        {
            Collider2D[] colliders = Physics2D.OverlapAreaAll(new Vector2(transform.position.x - 50f, transform.position.y + 5f),
                                                              new Vector2(transform.position.x + 50f, transform.position.y - 5f));

            int lenght = colliders.Length;

            for (int i = 0; i < lenght; i++)
            {
                if (colliders[i].gameObject.CompareTag("AchillesBody"))
                {
                    player      = colliders[i].gameObject;
                    foundPlayer = true;
                    this.transform.GetChild(0).gameObject.SetActive(true);
                    ac = transform.GetChild(0).GetComponent <ArcherController>();
                    ac.SetPlayer(player);
                    this.transform.GetChild(0).gameObject.transform.parent = null;
                    Destroy(this.gameObject);
                }
            }
        }
    }
Example #11
0
 private void Awake()
 {
     enemyParent = GetComponentInParent <ArcherController>();
 }
Example #12
0
 public void AddPlayer(ArcherController player) => players.Add(player);
 // Use this for initialization
 void Start()
 {
     theArcher = GetComponentInParent<ArcherController>();
 }
Example #14
0
 void Awake()
 {
     _rigidbody  = GetComponent <Rigidbody>();
     _controller = GetComponent <ArcherController>();
 }
Example #15
0
 void Start()
 {
     Score  = GameObject.Find("ScoreText").GetComponent <TMP_Text>();
     archer = GameObject.FindObjectOfType <ArcherController>();
     PlayAgain.SetActive(false);
 }
 // Use this for initialization
 void Start()
 {
     theArcher = GetComponentInParent <ArcherController>();
 }
 void Awake()
 {
     instance = this;
 }
Example #18
0
 // Start is called before the first frame update
 void Start()
 {
     archer   = GameObject.FindObjectOfType <ArcherController>();
     animator = GetComponent <Animator>();
 }
 private void Start()
 {
     ac = GetComponentInParent <ArcherController>();
 }
Example #20
0
 void Start()
 {
     parent     = gameObject.GetComponentInParent <ArcherController>();
     max        = parent.lives;
     localScale = transform.localScale;
 }
 void Awake()
 {
     _animator   = GetComponent <Animator>();
     _controller = GetComponent <ArcherController>();
 }
 void Start()
 {
     archer = GameObject.FindObjectOfType <ArcherController>();
 }
 // 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)
 {
     archer            = GameObject.FindObjectOfType <ArcherController>();
     archer.isShooting = false;
 }
Example #24
0
    void OnTriggerEnter2D(Collider2D other)
    {
        // for infantry
        if (other.gameObject.CompareTag("EnemiesBody"))
        {
            eh = other.transform.parent.gameObject.GetComponent <EnemyHealth>();
            ic = other.transform.parent.gameObject.GetComponent <InfantryController>();

            if ((ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                 ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack")) &&
                !ic.GetDefenseStatus())
            {
                ic.SetIsAttacked(true);

                if (eh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    eh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if ((ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                 ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack")) &&
                !ic.GetDefenseStatus())
            {
                ic.SetIsAttacked(true);

                if (eh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    eh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }


        if (other.gameObject.CompareTag("EnemyShield"))
        {
            ic = other.transform.parent.parent.parent.parent.parent.GetComponent <InfantryController>();
            eh = other.transform.parent.parent.parent.parent.parent.gameObject.GetComponent <EnemyHealth>();

            if (ic.GetDefenseStatus())
            {
                if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
                {
                    if (eh.GetEnemyShieldHealth() > 0 && !damaged_shield)
                    {
                        CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsSmall);

                        eh.ReceiveShieldDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                        damaged_shield = true;

                        if (other.transform.parent.parent.parent.parent.parent.GetComponent <EnemyArmour>().GetShield() > 2)
                        {
                            has.RandomizeSfxShieldIron(shieldhit_iron_0, shieldhit_iron_1, shieldhit_iron_2);
                        }
                        else
                        {
                            has.RandomizeSfxShieldWood(shieldhit_wood_0, shieldhit_wood_1, shieldhit_wood_2);
                        }


                        if (GameController.Instance.hotParticles)
                        {
                            HotParticlesForShield(other.transform);
                        }
                        else
                        {
                            DestroyParticles(other.transform);
                        }
                    }
                }
            }
        }


        // for archer

        if (other.gameObject.CompareTag("ArcherBody"))
        {
            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
            {
                ah = other.transform.parent.gameObject.GetComponent <ArcherHealth>();
                ac = other.transform.parent.gameObject.GetComponent <ArcherController>();
                ac.SetIsAttacked(true);

                if (ah.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    ah.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack"))
            {
                ah = other.transform.parent.gameObject.GetComponent <ArcherHealth>();
                ac = other.transform.parent.gameObject.GetComponent <ArcherController>();
                ac.SetIsAttacked(true);

                if (ah.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    ah.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }

        // For Cursed

        if (other.gameObject.CompareTag("CursedBody"))
        {
            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
            {
                cp = other.transform.parent.gameObject.GetComponent <CursedPower>();
                cc = other.transform.parent.gameObject.GetComponent <CursedController>();

                cc.SetIsAttacked(true);

                if (cp.GetTotalHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfxShieldWood(shieldhit_wood_0, shieldhit_wood_1, shieldhit_wood_2);
                    cp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;

                    DestroyParticles(other.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack"))
            {
                cp = other.transform.parent.gameObject.GetComponent <CursedPower>();
                cc = other.transform.parent.gameObject.GetComponent <CursedController>();

                cc.SetIsAttacked(true);

                if (cp.GetTotalHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfxShieldWood(shieldhit_wood_0, shieldhit_wood_1, shieldhit_wood_2);
                    cp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;

                    DestroyParticles(other.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }
        // For CursedBoss

        if (other.gameObject.CompareTag("CursedBossBody"))
        {
            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
            {
                cbp = other.transform.parent.gameObject.GetComponent <CursedBossPower>();
                cbc = other.transform.parent.gameObject.GetComponent <CursedBossCtrl>();

                cbc.SetIsAttacked(true);

                if (cbp.GetTotalHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfxShieldWood(shieldhit_wood_0, shieldhit_wood_1, shieldhit_wood_2);
                    cbp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;

                    DestroyParticles(other.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack"))
            {
                cbp = other.transform.parent.gameObject.GetComponent <CursedBossPower>();
                cbc = other.transform.parent.gameObject.GetComponent <CursedBossCtrl>();

                cbc.SetIsAttacked(true);

                if (cbp.GetTotalHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfxShieldWood(shieldhit_wood_0, shieldhit_wood_1, shieldhit_wood_2);
                    cbp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;

                    DestroyParticles(other.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }

        // For Brigand

        if (other.gameObject.CompareTag("BrigandBody"))
        {
            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
            {
                bh = other.transform.parent.gameObject.GetComponent <BrigandHealth>();
                bc = other.transform.parent.gameObject.GetComponent <BrigandController>();

                bc.SetIsAttacked(true);

                if (bh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    bh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack"))
            {
                bh = other.transform.parent.gameObject.GetComponent <BrigandHealth>();
                bc = other.transform.parent.gameObject.GetComponent <BrigandController>();

                bc.SetIsAttacked(true);

                if (bh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    bh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }

        // For Spearman

        if (other.gameObject.CompareTag("SpearmanBody"))
        {
            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
            {
                sh = other.transform.parent.gameObject.GetComponent <SpearmanHealth>();
                sc = other.transform.parent.gameObject.GetComponent <SpearmanController>();

                sc.SetIsAttacked(true);

                if (sh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    sh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack"))
            {
                sh = other.transform.parent.gameObject.GetComponent <SpearmanHealth>();
                sc = other.transform.parent.gameObject.GetComponent <SpearmanController>();

                sc.SetIsAttacked(true);

                if (sh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    sh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }

        // Cyclops

        if (other.gameObject.CompareTag("CyclopsBody"))
        {
            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
            {
                coh = other.transform.parent.gameObject.GetComponent <CyclopsHealth>();
                coc = other.transform.parent.gameObject.GetComponent <CyclopsController>();

                coc.SetIsAttacked(true);

                if (coh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    coh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack"))
            {
                coh = other.transform.parent.gameObject.GetComponent <CyclopsHealth>();
                coc = other.transform.parent.gameObject.GetComponent <CyclopsController>();

                coc.SetIsAttacked(true);

                if (coh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    coh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }

        // HeavyHead

        if (other.gameObject.CompareTag("HeavyHeadBody"))
        {
            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
            {
                hhh = other.transform.parent.parent.gameObject.GetComponent <HeavyHeadHealth>();
                hhc = other.transform.parent.parent.gameObject.GetComponent <HeavyHeadController>();

                hhc.SetIsAttacked(true);

                if (hhh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    hhh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack"))
            {
                hhh = other.transform.parent.parent.gameObject.GetComponent <HeavyHeadHealth>();
                hhc = other.transform.parent.parent.gameObject.GetComponent <HeavyHeadController>();

                hhc.SetIsAttacked(true);

                if (hhh.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    hhh.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }

        // Last Boss

        if (other.gameObject.CompareTag("BossBody"))
        {
            lbp = other.transform.parent.gameObject.GetComponent <LastBossPower>();
            lbc = other.transform.parent.gameObject.GetComponent <LastBossCtrl>();

            if ((ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                 ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack")) &&
                !lbc.GetDefenseStatus())
            {
                lbc.SetIsAttacked(true);

                if (lbp.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    lbp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if ((ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                 ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack")) &&
                !lbc.GetDefenseStatus())
            {
                lbc.SetIsAttacked(true);

                if (lbp.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    lbp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }


        if (other.gameObject.CompareTag("BossShield"))
        {
            lbc = other.transform.parent.parent.parent.parent.parent.GetComponent <LastBossCtrl>();
            lbp = other.transform.parent.parent.parent.parent.parent.gameObject.GetComponent <LastBossPower>();

            if (lbc.GetDefenseStatus())
            {
                if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
                {
                    if (lbp.GetEnemyShieldHealth() > 0 && !damaged_shield)
                    {
                        CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsSmall);

                        lbp.ReceiveShieldDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                        damaged_shield = true;

                        has.RandomizeSfxShieldIron(shieldhit_iron_0, shieldhit_iron_1, shieldhit_iron_2);

                        if (GameController.Instance.hotParticles)
                        {
                            HotParticlesForShield(other.transform);
                        }
                        else
                        {
                            DestroyParticles(other.transform);
                        }
                    }
                }
            }
        }

        //  For SpearBoss

        if (other.gameObject.CompareTag("SpearBossBody"))
        {
            sbp = other.transform.parent.gameObject.GetComponent <SpearBossPower>();
            sbc = other.transform.parent.gameObject.GetComponent <SpearBossCtrl>();

            if ((ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                 ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack")) &&
                !sbc.GetDefenseStatus())
            {
                sbc.SetIsAttacked(true);

                if (sbp.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(stab0, stab1, stab2, stab3);
                    sbp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }

            if ((ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                 ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack")) &&
                !sbc.GetDefenseStatus())
            {
                sbc.SetIsAttacked(true);

                if (sbp.GetEnemyHealth() > 0 && !damaged)
                {
                    CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsBig);
                    has.RandomizeSfx(swing0, swing1, swing2);
                    sbp.ReceiveDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                    damaged = true;
                    BloodEffect(other.transform.parent.transform);

                    if (GameController.Instance.hotParticles)
                    {
                        HotParticles(other.transform.parent.transform);
                    }
                }
            }
        }


        if (other.gameObject.CompareTag("SpearBossShield"))
        {
            sbc = other.transform.parent.parent.parent.parent.parent.GetComponent <SpearBossCtrl>();
            sbp = other.transform.parent.parent.parent.parent.parent.gameObject.GetComponent <SpearBossPower>();

            if (sbc.GetDefenseStatus())
            {
                if (ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("QuickAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("JumpAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("WalkingAttack") ||
                    ps.GetAnim().GetCurrentAnimatorStateInfo(0).IsName("StrongAttack"))
                {
                    if (sbp.GetEnemyShieldHealth() > 0 && !damaged_shield)
                    {
                        CameraShaker.Instance.ShakeOnce(GameController.Instance.magnitudeValsSmall);

                        sbp.ReceiveShieldDamage(Utility.GetWeaponDamageAmountPlayer(pState.GetWeaponCategoryAndIndex(), GameController.Instance.player_power, GameController.Instance.player_sharpening, GameController.Instance.player_weaponEmber));
                        damaged_shield = true;

                        has.RandomizeSfxShieldIron(shieldhit_iron_0, shieldhit_iron_1, shieldhit_iron_2);

                        if (GameController.Instance.hotParticles)
                        {
                            HotParticlesForShield(other.transform);
                        }
                        else
                        {
                            DestroyParticles(other.transform);
                        }
                    }
                }
            }
        }


        ///////
    }