コード例 #1
0
    public bool ApplyImmune(eImmuneType immune_type, eAttackType attack_type, short skill_level)
    {
        if (ActionInfo.value < 100000)
        {
            int value = ActionInfo.value - (skill_level - Skill.Level) * GameConfig.Get <int>("stun_level_decrease");
            if (BattleBase.Instance.Rand.NextRange(1, 10000) > value)
            {
                return(false);
            }
        }

        if (Action != null)
        {
            Action.OnHit();
        }

        m_Creature.Character.CharacterAnimation.SetShield();

        if (immune_type == eImmuneType.dot)
        {
            TextManager.Instance.PushMessage(m_Creature, GetImmuneMessage(immune_type, attack_type), eBuffColorType.Immune, eTextPushType.Dot);
        }
        else
        {
            TextManager.Instance.PushMessage(m_Creature, GetImmuneMessage(immune_type, attack_type), eBuffColorType.Immune, eTextPushType.Normal);
        }
        return(true);
    }
コード例 #2
0
    /// <summary>
    /// 지정한 위치에서 가장 가까운 적을 찾아준다.
    /// </summary>
    /// <param name="exceptTeamID">해당 팀번호를 제외한 나머지 팀에 대한 탐색</param>
    /// <param name="attackType">공격 타입.</param>
    /// <param name="point">시작점</param>
    /// <param name="radius">시작점에서 찾고자하는 반경 (최대 1000m)</param>
    /// <param name="withStructure">구조물도 함께 찾을 것인지 유무</param>
    public Unit NearestTarget(byte exceptTeamID, eAttackType attackType, Vector3 point, float radius = 1000, bool withStructure = false, Unit exceptUnit = null)
    {
        //난투장 모드에서는 SkillState 한군데서만 이 함수를 사용하고 있다.

        Unit nearest = null;

        //Debug.LogWarning("2JW : CharacterMgr NearestTarget Function In - AllTeamDic Count : " + allTeamDic.Count );
        foreach (KeyValuePair <byte, List <Unit> > pair in allTeamDic)
        {
            if (exceptTeamID == pair.Key)
            {
                continue;
            }

            nearest = NearestTargetByTeam(pair.Key, attackType, point, radius, withStructure, exceptUnit);
        }

        //for (int i = 0; i < allUnitList.Count; i++ ) //??????????????????????? 이 부분은 부하만 잡아 먹고 있고 위ㅔ 코드로 검색만으로도 충분할 텐데 이 부분을 왜?? 했을까?
        //{
        //    if (allUnitList[i].TeamID == exceptTeamID)
        //        continue;

        //    nearest = NearestTargetByTeam(allUnitList[i].TeamID, attackType, point, radius, withStructure, exceptUnit);
        //}

        return(nearest);
    }
コード例 #3
0
    // ======================================================================================
    public void StartAttack(eAttackType _attackType, float _upDirection, bool _onAir)
    {
        m_animator.SetBool(m_isAttackingBoolParam, true);
        m_animator.SetFloat(m_onAirParam, _onAir ? 1.0f : 0.0f);

        m_animator.SetFloat(m_attackTypeParam, (int)_attackType);
        m_animator.SetFloat(m_upDirectionParam, _upDirection);
    }
コード例 #4
0
ファイル: RuneInfo.cs プロジェクト: tapenjoyGame/cry
    public bool CheckEquipType(eAttackType attack_type)
    {
        if (EquipType == eRuneEquipType.all)
        {
            return(true);
        }

        return((short)EquipType == (short)attack_type);
    }
コード例 #5
0
    public void Attack(eAttackType eAttack, string tag)
    {
        GameObject tGO;

        switch (eAttack)
        {
        case eAttackType.blaster:
            //Projectile spawning
            if (tag == "Enemy")
            {
                Debug.Log("Blaster Attack Initiated");
                tGO = Instantiate(projectilePrefab, _spawnPos, Quaternion.identity);
                tGO.GetComponent <Projectile> ().xVelocity *= -1;
                tGO.GetComponent <SpriteRenderer> ().flipX  = true;
            }
            else
            {
                Debug.Log("Blaster Attack Initiated");
                tGO = Instantiate(projectilePrefab, _spawnPos, Quaternion.identity);
            }
            break;

        case eAttackType.bomb:
            // Bomb spawning
            if (tag == "Enemy")
            {
                Debug.Log("Bomb Attack Initiated");
                tGO = Instantiate(bombPrefab, _spawnPos, Quaternion.identity);
                // Grab the bomb component attached to tGO
                Bomb bomb = tGO.GetComponent <Bomb> ();
                // Set it's PanelRange value to EnemyPanelRange;
                bomb.PanelRange    = bomb.EnemyPanelRange;
                projectileXOffset *= -1;
                tGO.GetComponent <SpriteRenderer> ().flipX = true;
            }
            else
            {
                Debug.Log("Blaster Attack Initiated");
                tGO = Instantiate(bombPrefab, _spawnPos, Quaternion.identity);
                // Grab the bomb component attached to tGO
                Bomb bomb = tGO.GetComponent <Bomb> ();
                // Set it's PanelRange value to PlayerPanelRange;
                bomb.PanelRange = bomb.PlayerPanelRange;
            }
            break;

        case eAttackType.melee:
            // MeleeTrigger Spawning
            Debug.Log("Melee Attack Initiated");
            // Activate the MeleeTrigger attached to this Unit
            // Grab the Melee Script attached to meleeTrigger and call the SetLifetime function
            meleeTrigger.GetComponent <Melee> ().SetLifetime();
            break;
        }
    }
コード例 #6
0
    /// <summary>
    /// 가장 최상위 타겟을 찾아준다. (주의. Update문에서 사용하지 말것!)
    /// </summary>
    public Unit TopMostTarget()
    {
        Validate();

        eAttackType attackType = Owner.CharInfo.AttackType;

        AggroData selTargetData = aggroList.Find((aggro) => { return(G_GameInfo.CharacterMgr.CanTarget(attackType, aggro.Attacker)); });

        return(null != selTargetData ? selTargetData.Attacker : null);
        //return aggroList.Count > 0 ? aggroList[0].Attacker : null;
    }
コード例 #7
0
    public Hitbox(float xPos, float yPos, float width, float height, int damage, float xKnock, float yKnock, float hitstun, float blockstun, eAttackType type)
    {
        m_xPos   = xPos;
        m_yPos   = yPos;
        m_width  = width;
        m_height = height;

        m_damage     = damage;
        m_xKnockback = xKnock;
        m_yKnockback = yKnock;
        m_hitstun    = hitstun;
        m_blockstun  = blockstun;
        m_type       = type;
    }
コード例 #8
0
ファイル: BattleCreature.cs プロジェクト: tapenjoyGame/cry
    public int ApplyShield(eAttackType attack_type, int damage)
    {
        List <Buff> shield_buffs = Buffs.Where(b => b.IsFinish == false && b.ActionInfo.actionType == eActionType.shield && b.ActionInfo.attack_types.Contains(attack_type) == true && b.ActionInfo.value > 0).ToList();

        foreach (Buff buff in shield_buffs)
        {
            damage = buff.ApplyShield(attack_type, damage);
            if (damage == 0)
            {
                return(0);
            }
        }
        return(damage);
    }
コード例 #9
0
 /// <summary>
 /// 타겟으로 삼을수 있는지 검사
 /// </summary>
 /// <param name="target">검사할 대상</param>
 public bool CanTarget(eAttackType attackType, Unit target)
 {
     if (GameDefine.HelperTargetSearch)
     {
         return(null != target &&
                allUnitDic.ContainsKey(target.GetInstanceID()) &&
                target.Usable &&
                target.UnitType != UnitType.Trap &&
                !target.IsHelper);
     }
     //Debug.LogWarning("2JW : CharacterMgr In CanTarget : target - " + target + " : t_instanceId - " + target.GetInstanceID() + " : t_usable - " + target.Usable + " : t_unitType - " + target.UnitType);
     return(null != target &&
            allUnitDic.ContainsKey(target.GetInstanceID()) &&
            target.Usable &&
            target.UnitType != UnitType.Trap);
 }
コード例 #10
0
    public List <Unit> FindTargetsByTeam(byte teamID, Unit criterionUnit, float radius = 1000, float angle = 360f, bool withStructure = false)
    {
        if (!allTeamDic.ContainsKey(teamID))
        {
            return(null);
        }

        List <Unit> foundList    = new List <Unit>();
        List <Unit> unitList     = allTeamDic[teamID];
        float       casterRadius = criterionUnit.Radius;
        eAttackType attackType   = criterionUnit.CharInfo.AttackType;

        for (int i = 0; i < unitList.Count; i++)
        {
            Unit target = unitList[i];

            if (!CanTarget(attackType, target))
            {
                continue;
            }

            if (!withStructure && target.UnitType == UnitType.Prop)
            {
                continue;
            }
            else if (withStructure && target.UnitType == UnitType.Prop)
            {
                //< 프롭은 거리를 체크해야함
                float distance2 = (target.transform.position - criterionUnit.transform.position).sqrMagnitude;
                if (distance2 > PropCheckDis)
                {
                    continue;
                }
            }

            Vector3 distance = (target.transform.position - criterionUnit.transform.position);

            if (!MathHelper.IsInRange(distance, radius, criterionUnit.transform.forward, angle, casterRadius, target.Radius))
            {
                continue;
            }

            foundList.Add(target);
        }

        return(foundList);
    }
コード例 #11
0
    void SetStatusProp(uint propID)
    {
        // enthan Base Stats
        FirstAtkRange  = 1.04f;
        AtkDelay       = 1f;
        AtkRecognition = 20f;
        RushAtkRange   = 0;

        CurMoveType = OrignalMoveType = (MoveType)1;
        AttackType  = eAttackType.Melee;
        AirHeight   = 0;
        AirFlyTime  = 0;

        Mob.PropInfo propData = _LowDataMgr.instance.GetPropInfo(propID);

        Stats.Add(AbilityType.HP, new Attribute(propData.BaseHp));
        Stats.Add(AbilityType.DAMAGE, new Attribute(propData.BaseAtk));
        Stats.Add(AbilityType.HIT_RATE, new Attribute(propData.BaseHit));
        Stats.Add(AbilityType.DODGE_RATE, new Attribute(propData.BaseAvoid));
        Stats.Add(AbilityType.CRITICAL_RATE, new Attribute(propData.BaseCriticalRate));
        Stats.Add(AbilityType.CRITICAL_RES, new Attribute(propData.BaseCriticalResist));
        Stats.Add(AbilityType.CRITICAL_DAMAGE, new Attribute(propData.BaseCriticalDamage));
        Stats.Add(AbilityType.DRAIN_HP, new Attribute(propData.BaseLifeSteal));
        Stats.Add(AbilityType.DEFENCE_IGNORE, new Attribute(propData.BaseIgnoreAtk));
        Stats.Add(AbilityType.DAMAGE_DECREASE, new Attribute(propData.BaseDamageDown));
        Stats.Add(AbilityType.DAMAGE_DECREASE_RATE, new Attribute(propData.BaseDamageDownRate));
        Stats.Add(AbilityType.COOLTIME, new Attribute(0));

        Stats.Add(AbilityType.ATTACK_SPEED, new Attribute(1));
        Stats.Add(AbilityType.ATTACK_RANGE, new Attribute(2));
        Stats.Add(AbilityType.ATTACK_ANGLE, new Attribute(140));

        Stats.Add(AbilityType.MOVE_SPEED, new Attribute(7.5f));
        Stats.Add(AbilityType.DETECTED_RANGE, new Attribute(15f));

        Stats.Add(AbilityType.SUPERARMOR, new Attribute(0));
        Stats.Add(AbilityType.SUPERARMOR_RECOVERY_TIME, new Attribute(0));
        Stats.Add(AbilityType.SUPERARMOR_RECOVERY_RATE, new Attribute(0));
        Stats.Add(AbilityType.SUPERARMOR_RECOVERY, new Attribute(0));

        Stats.Add(AbilityType.WEIGHT, new Attribute(0));

        savedMaxHp = Hp = (int)Stats[AbilityType.HP].FinalValue;
        //프롭은 슈퍼아머 없음
        SuperArmor = 0;
    }
コード例 #12
0
ファイル: EquipInfo.cs プロジェクト: tapenjoyGame/cry
    public StatInfo AddStats(eEquipType type, eAttackType attack_type, int equip_grade, int enchant, StatInfo stat_info)
    {
        EquipStat stat = null;

        switch (type)
        {
        case eEquipType.weapon:
            stat = StatInfo.Weapons.Find(e => e.Grade == equip_grade && e.Enchant == enchant);
            if (stat == null)
            {
                throw new System.Exception(string.Format("Can't Find Weapon Stat Info : grade({0}), enchant({1})", equip_grade, enchant));
            }
            stat_info.AddValue(eStatType.PhysicAttack, stat.Value);
            stat_info.AddValue(eStatType.MagicAttack, stat.Value);
            stat_info.AddValue(eStatType.Heal, stat.Value);
            break;

        case eEquipType.armor:
            stat = StatInfo.Armors.Find(e => e.Grade == equip_grade && e.Enchant == enchant);
            if (stat == null)
            {
                throw new System.Exception(string.Format("Can't Find Armor Stat Info : grade({0}), enchant({1})", equip_grade, enchant));
            }
            switch (attack_type)
            {
            case eAttackType.physic:
                stat_info.AddValue(eStatType.PhysicDefense, stat.Value);
                stat_info.AddValue(eStatType.MagicDefense, (int)(stat.Value * stat.DefenseRate));
                break;

            case eAttackType.magic:
                stat_info.AddValue(eStatType.MagicDefense, stat.Value);
                stat_info.AddValue(eStatType.PhysicDefense, (int)(stat.Value * stat.DefenseRate));
                break;

            case eAttackType.heal:
                stat_info.AddValue(eStatType.PhysicDefense, (int)(stat.Value * stat.DefenseRate));
                stat_info.AddValue(eStatType.MagicDefense, (int)(stat.Value * stat.DefenseRate));
                break;
            }
            break;
        }

        return(stat_info);
    }
コード例 #13
0
ファイル: BattleCreature.cs プロジェクト: tapenjoyGame/cry
    public bool InvokeImmune(eImmuneType immune_type, eAttackType attack_type, short skill_level)
    {
        if (IsHidden() == true)
        {
            return(true);
        }

        List <Buff> shield_buffs = Buffs.Where(b => b.IsFinish == false && b.ActionInfo.actionType == eActionType.immune && b.ActionInfo.immune_types.Contains(immune_type) == true && b.ActionInfo.attack_types.Contains(attack_type) == true).ToList();

        foreach (Buff buff in shield_buffs)
        {
            if (buff.ApplyImmune(immune_type, attack_type, skill_level) == true)
            {
                return(true);
            }
        }
        return(false);
    }
コード例 #14
0
    static public StatInfo GetStatInfo(XmlNode stat_node, eAttackType AttackType)
    {
        StatInfo info = new StatInfo();

        foreach (XmlAttribute attr in stat_node.Attributes)
        {
            eStatType stat_type = StatInfo.GetStatType(attr.Name);
            int       value     = int.Parse(attr.Value);

            switch (stat_type)
            {
            case eStatType.Attack:
                info.SetValue(eStatType.PhysicAttack, value);
                info.SetValue(eStatType.MagicAttack, value);
                info.SetValue(eStatType.Heal, value);
                break;

            case eStatType.Defense:
                switch (AttackType)
                {
                case eAttackType.physic:
                    info.SetValue(eStatType.PhysicDefense, value);
                    info.SetValue(eStatType.MagicDefense, (int)(value * StatInfo.DefenseTypeRatio));
                    break;

                case eAttackType.magic:
                    info.SetValue(eStatType.PhysicDefense, (int)(value * StatInfo.DefenseTypeRatio));
                    info.SetValue(eStatType.MagicDefense, value);
                    break;

                case eAttackType.heal:
                    info.SetValue(eStatType.PhysicDefense, (int)(value * StatInfo.DefenseTypeRatio));
                    info.SetValue(eStatType.MagicDefense, (int)(value * StatInfo.DefenseTypeRatio));
                    break;
                }
                break;

            default:
                info.SetValue(stat_type, value);
                break;
            }
        }
        return(info);
    }
コード例 #15
0
ファイル: CombatShow.cs プロジェクト: kimKIKI/2DGame_Card
    int playerDamage;   //내부 세팅시 저장

    //public int Damage
    //{
    //    get { return damage; }
    //    set
    //    {
    //        damage = value;
    //        Debug.Log(" 외부에서세팅value  :"+value);
    //    }
    //}

    private void Awake()
    {
        MainCamera  = GameObject.Find("MainCamera").GetComponent <Camera>();
        playerSlot  = player.GetComponent <CombatCardSlot>();
        comSlot     = Com.GetComponent <CombatCardSlot>();
        E_comArm    = comArm.GetComponent <UIEffect>();
        E_playerArm = playerArm.GetComponent <UIEffect>();
        img_power   = powerEFF.GetComponentInChildren <Image>();
        img_destroy = DestroyEFF.GetComponentInChildren <Image>();
        A           = GameObject.Find("A").GetComponent <Transform>();
        B           = GameObject.Find("B").GetComponent <Transform>();

        anim_Power   = powerEFF.GetComponentInChildren <Animator>();
        anim_Destroy = DestroyEFF.GetComponentInChildren <Animator>();
        ef_power     = powerEFF.GetComponentInChildren <SpriteAnim>();
        ef_destroy   = DestroyEFF.GetComponentInChildren <SpriteAnim>();

        KingPlayer    = transform.Find("Panel/KingPlayer").GetComponent <Transform>();
        KingCom       = transform.Find("Panel/KingCom").GetComponent <Transform>();
        KingPlyerSlot = KingPlayer.GetComponent <CombatCardSlot>();
        KingComSlot   = KingCom.GetComponent <CombatCardSlot>();
        txPlayer      = KingPlayer.GetComponentInChildren <Text>();
        txCom         = KingCom.GetComponentInChildren <Text>();

        bg.enabled = false;
        start      = player.localPosition;
        endPos     = new Vector3(-258, player.transform.localPosition.y, 1);

        startY = playerKingTower.localPosition;

        endPosY  = new Vector3(0, -600, 1);
        firstPos = new Vector3(0, 1320, 0);

        YPosArm = comArm.localPosition.y;
        gm      = GameObject.Find("@GM").GetComponent <GameManager>();
        after   = atkType;
        //AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0);
        //EffeAnimator = Resources.LoadAll("Animation", typeof(AnimationClip));
        //EffeAnimator = Resources.LoadAll("Animation", typeof(AnimationClip)).Cast<AnimationClip>().ToArray();
    }
コード例 #16
0
    //마을등의 유닛
    void SetDefaultNoneStat(float atk = 100, float def = 100, float hp = 100, float atkDelay = 0, float atkRange = 4)
    {
        // enthan Base Stats
        FirstAtkRange  = 1.04f;
        AtkDelay       = 1f;
        AtkRecognition = 20f;
        RushAtkRange   = 0;

        CurMoveType = OrignalMoveType = (MoveType)1;
        AttackType  = eAttackType.Melee;
        AirHeight   = 0;
        AirFlyTime  = 0;

        {
            Stats.Add(AbilityType.HP, new Attribute(10000));
            Stats.Add(AbilityType.DAMAGE, new Attribute(100));
            Stats.Add(AbilityType.HIT_RATE, new Attribute(0));
            Stats.Add(AbilityType.DODGE_RATE, new Attribute(0));
            Stats.Add(AbilityType.CRITICAL_RATE, new Attribute(0));
            Stats.Add(AbilityType.CRITICAL_RES, new Attribute(0));
            Stats.Add(AbilityType.CRITICAL_DAMAGE, new Attribute(0));
            Stats.Add(AbilityType.DRAIN_HP, new Attribute(0));
            Stats.Add(AbilityType.DEFENCE_IGNORE, new Attribute(0));
            Stats.Add(AbilityType.DAMAGE_DECREASE, new Attribute(100));
            Stats.Add(AbilityType.DAMAGE_DECREASE_RATE, new Attribute(0));
            Stats.Add(AbilityType.COOLTIME, new Attribute(0));

            Stats.Add(AbilityType.ATTACK_SPEED, new Attribute(1));
            Stats.Add(AbilityType.ATTACK_RANGE, new Attribute(2));
            Stats.Add(AbilityType.ATTACK_ANGLE, new Attribute(140));

            Stats.Add(AbilityType.MOVE_SPEED, new Attribute(7.5f));
            Stats.Add(AbilityType.DETECTED_RANGE, new Attribute(15f));
            Stats.Add(AbilityType.SUPERARMOR, new Attribute(1f));


            savedMaxHp = Hp = (int)Stats[AbilityType.HP].FinalValue;
        }
    }
コード例 #17
0
    public int ApplyShield(eAttackType attack_type, int damage)
    {
        if (ActionInfo.value == -1)
        {
            return(damage);
        }

        if (Action != null)
        {
            Action.OnHit();
        }
        m_Creature.Character.CharacterAnimation.SetShield();

        AffectValue += damage;
        if (AffectValue > 0)
        {
            TextManager.Instance.PushMessage(m_Creature, GetImmuneMessage(eImmuneType.damage, attack_type), eBuffColorType.Shield, eTextPushType.Normal);

            return(0);
        }

        Finish();
        return(AffectValue);
    }
コード例 #18
0
    void SetMonsterStat(uint npcID, uint npcLevel)
    {
        //float atkDelay = 0;
        float atkRange = 2;

        // enthan Base Stats
        FirstAtkRange  = 1.04f;
        AtkDelay       = 1f;
        AtkRecognition = 20f;
        RushAtkRange   = 0;

        CurMoveType = OrignalMoveType = (MoveType)1;
        AttackType  = eAttackType.Melee;
        AirHeight   = 0;
        AirFlyTime  = 0;

        Mob.MobInfo monsterData = _LowDataMgr.instance.GetMonsterInfo(npcID);

        if (monsterData.AiType == 1)
        {
            //밀리
            atkRange = 2;
        }
        else
        {
            //원거리
            atkRange = 8;
        }

        if (monsterData == null)
        {
            //몬스터 데이터가 없다
            Debug.LogWarning(string.Format("Not Found MonsterData:{0}", npcID));

            Stats.Add(AbilityType.HP, new Attribute(100));
            Stats.Add(AbilityType.DAMAGE, new Attribute(100));
            Stats.Add(AbilityType.HIT_RATE, new Attribute(0));
            Stats.Add(AbilityType.DODGE_RATE, new Attribute(0));
            Stats.Add(AbilityType.CRITICAL_RATE, new Attribute(0));
            Stats.Add(AbilityType.CRITICAL_RES, new Attribute(0));
            Stats.Add(AbilityType.CRITICAL_DAMAGE, new Attribute(0));
            Stats.Add(AbilityType.DRAIN_HP, new Attribute(0));
            Stats.Add(AbilityType.DEFENCE_IGNORE, new Attribute(0));
            Stats.Add(AbilityType.DAMAGE_DECREASE, new Attribute(100));
            Stats.Add(AbilityType.DAMAGE_DECREASE_RATE, new Attribute(0));
            Stats.Add(AbilityType.COOLTIME, new Attribute(0));

            Stats.Add(AbilityType.ATTACK_SPEED, new Attribute(1));
            Stats.Add(AbilityType.ATTACK_RANGE, new Attribute(atkRange));
            Stats.Add(AbilityType.ATTACK_ANGLE, new Attribute(140));

            Stats.Add(AbilityType.MOVE_SPEED, new Attribute(7.5f));
            Stats.Add(AbilityType.DETECTED_RANGE, new Attribute(15f));

            Stats.Add(AbilityType.SUPERARMOR, new Attribute(0));
            Stats.Add(AbilityType.SUPERARMOR_RECOVERY_TIME, new Attribute(0));
            Stats.Add(AbilityType.SUPERARMOR_RECOVERY_RATE, new Attribute(0));
            Stats.Add(AbilityType.SUPERARMOR_RECOVERY, new Attribute(0));

            savedMaxHp = Hp = (int)Stats[AbilityType.HP].FinalValue;
            SuperArmor = (uint)Stats[AbilityType.SUPERARMOR].FinalValue;

            Stats.Add(AbilityType.WEIGHT, new Attribute(0));
        }
        else
        {
            Stats.Add(AbilityType.HP, new Attribute((float)(monsterData.BaseHp + npcLevel * monsterData.LevelUpHp) * 0.1f));
            Stats.Add(AbilityType.DAMAGE, new Attribute((float)(monsterData.BaseAtk + npcLevel * monsterData.LevelUpAtk) * 0.1f));
            Stats.Add(AbilityType.HIT_RATE, new Attribute((float)(monsterData.BaseHit + npcLevel * monsterData.LevelHitRate) * 0.1f));
            Stats.Add(AbilityType.DODGE_RATE, new Attribute((float)(monsterData.BaseAvoid + npcLevel * monsterData.LevelAvoidRate) * 0.1f));
            Stats.Add(AbilityType.CRITICAL_RATE, new Attribute(monsterData.BaseCriticalRate * 0.1f));
            Stats.Add(AbilityType.CRITICAL_RES, new Attribute(monsterData.BaseCriticalResist * 0.1f));
            Stats.Add(AbilityType.CRITICAL_DAMAGE, new Attribute(monsterData.BaseCriticalDamage * 0.1f));
            Stats.Add(AbilityType.DRAIN_HP, new Attribute(monsterData.BaseLifeSteal * 0.1f));
            Stats.Add(AbilityType.DEFENCE_IGNORE, new Attribute(monsterData.BaseIgnoreAtk));
            Stats.Add(AbilityType.DAMAGE_DECREASE, new Attribute((monsterData.BaseDamageDown + npcLevel * monsterData.LevelupDamageDown) * 0.1f));
            Stats.Add(AbilityType.DAMAGE_DECREASE_RATE, new Attribute((monsterData.BaseDamageDownRate + npcLevel * monsterData.LevelupDamageDownRate) * 0.1f));

            Stats.Add(AbilityType.COOLTIME, new Attribute(0));

            Stats.Add(AbilityType.ATTACK_SPEED, new Attribute(1));
            Stats.Add(AbilityType.ATTACK_RANGE, new Attribute(atkRange));
            Stats.Add(AbilityType.ATTACK_ANGLE, new Attribute(140));

            Stats.Add(AbilityType.MOVE_SPEED, new Attribute(7.5f));

            Stats.Add(AbilityType.DETECTED_RANGE, new Attribute(15f));

            Stats.Add(AbilityType.SUPERARMOR, new Attribute(monsterData.BaseSuperArmor));
            Stats.Add(AbilityType.SUPERARMOR_RECOVERY_TIME, new Attribute(monsterData.SuperArmorRecoveryTime));
            Stats.Add(AbilityType.SUPERARMOR_RECOVERY_RATE, new Attribute(monsterData.SuperArmorRecoveryRate));
            Stats.Add(AbilityType.SUPERARMOR_RECOVERY, new Attribute(monsterData.SuperArmorRecovery));

            Stats.Add(AbilityType.WEIGHT, new Attribute(monsterData.Weight));

            savedMaxHp = Hp = (int)Stats[AbilityType.HP].FinalValue;
            SuperArmor = (uint)Stats[AbilityType.SUPERARMOR].FinalValue;
        }
    }
コード例 #19
0
    public Unit FindTargetByTeam(byte teamID, Unit criterionUnit, float radius = 1000, float angle = 360f, bool withStructure = false)
    {
        if (!allTeamDic.ContainsKey(teamID))
        {
            return(null);
        }

        List <Unit> unitList     = allTeamDic[teamID];
        float       casterRadius = criterionUnit.Radius;
        eAttackType attackType   = criterionUnit.CharInfo.AttackType;

        List <Unit> units = new List <Unit>();

        for (int i = 0; i < unitList.Count; i++)
        {
            Unit target = unitList[i];

            if (!CanTarget(attackType, target))
            {
                continue;
            }

            if (!withStructure && target.UnitType == UnitType.Prop)
            {
                continue;
            }
            else if (withStructure && target.UnitType == UnitType.Prop)
            {
                //< 프롭은 거리를 체크해야함
                float distance2 = (target.transform.position - criterionUnit.transform.position).sqrMagnitude;
                if (distance2 > PropCheckDis)
                {
                    continue;
                }
            }

            if (target.CurrentState == UnitState.Dying || target.CurrentState == UnitState.Dead)
            {
                continue;
            }

            Vector3 distance = (target.transform.position - criterionUnit.transform.position);

            if (!MathHelper.IsInRange(distance, radius, criterionUnit.transform.forward, angle, casterRadius, target.Radius))
            {
                continue;
            }

            units.Add(target);
        }

        /*
         * //if (SceneManager.isRTNetworkMode == GAME_MODE.FREEFIGHT)
         * if(SceneManager.instance.IsRTNetwork)
         * {
         *  if (criterionUnit.m_isOtherPc == true)
         *  {
         *      if (criterionUnit.SvTargetUnit != null)
         *      {
         *          units.Clear();
         *          units.Add(criterionUnit.SvTargetUnit);
         *      }
         *  }
         *  else //if (criterionUnit.m_isOtherPc == false)
         *  {
         *      List<Unit> MyTeamList = allTeamDic[0];
         *      for (int i = 0; i < MyTeamList.Count; i++)
         *      {
         *          Unit target = MyTeamList[i];
         *
         *          if (!CanTarget(attackType, target))
         *              continue;
         *
         *          if (criterionUnit == target)
         *              continue;
         *
         *          if (target.m_isOtherPc == false)
         *              continue;
         *
         *          //{
         *          //    //Debug.LogWarning(target.Owner.GetPlayerNickName());
         *          //}
         *
         *          if (target.CurrentState == UnitState.Dying || target.CurrentState == UnitState.Dead)
         *              continue;
         *
         *          Vector3 distance = (target.transform.position - criterionUnit.transform.position);
         *
         *          //radius == 15 //공격 유효 반경
         *          //angle  = 225 //공격 각도
         *          //Debug.LogWarning(distance.magnitude + " : " + radius + " : " + angle + " : " + casterRadius + " : " + target.Radius + " : " + Vector3.Angle(distance.normalized, criterionUnit.transform.forward));
         *
         *          radius = 1.0f; //임시적으로 강제로 근처에 있을 때만 때리도록...
         *
         *          if (!MathHelper.IsInRange(distance, radius, criterionUnit.transform.forward, angle, casterRadius, target.Radius))
         *              continue;
         *
         *          units.Add(target);
         *      }
         *  }//if (criterionUnit.m_isOtherPc == false)
         * }
         */

        //< 제일 가까운 녀석을 찾는다.
        units.Sort(delegate(Unit tmp1, Unit tmp2)
        {
            return((criterionUnit.transform.position - tmp1.transform.position).magnitude.CompareTo((criterionUnit.transform.position - tmp2.transform.position).magnitude));
        });

        if (units.Count > 0)
        {
            return(units[0]);
        }

        return(null);
    }
コード例 #20
0
    public Unit NearestTargetByTeam(byte teamID, eAttackType attackType, Vector3 point, float radius = 1000, bool withStructure = false, Unit exceptUnit = null)
    {
        if (!allTeamDic.ContainsKey(teamID))
        {
            return(null);
        }

        float       shortestDistance = radius * radius;
        Unit        nearest          = null;
        List <Unit> unitList         = allTeamDic[teamID];

        //Debug.LogWarning("2JW : " + unitList.Count);
        for (int i = 0; i < unitList.Count; i++)
        {
            Unit target = unitList[i];
            //Debug.LogWarning("2JW : for - " + i + " : " + target + " : " + attackType , target);
            if (!CanTarget(attackType, target))
            {
                continue;
            }
            if (!withStructure && target.UnitType == UnitType.Prop)
            {
                continue;
            }

            ////< 이벤트 상태라면 패스
            if (target.CurrentState == UnitState.Event)// && RaidBossAIBase.NotTargeting
            {
                continue;
            }

            if (exceptUnit != null && exceptUnit == target)
            {
                continue;
            }

            if (target.CurrentState == UnitState.Dying || target.CurrentState == UnitState.Dead)
            {
                continue;
            }

            if (target.UnitType == UnitType.Prop)
            {
                if ((target as Prop).PropInfo.AutoTarget == 0)
                {
                    continue;
                }
            }


            float distance = (target.transform.position - point).sqrMagnitude;
            if (distance < shortestDistance)
            {
                shortestDistance = distance;
                nearest          = target;
            }
        }

        //if (SceneManager.isRTNetworkMode == GAME_MODE.FREEFIGHT)

        /*
         * if(SceneManager.instance.IsRTNetwork)
         * {
         *  if (exceptUnit != null)
         *  {
         *      if (exceptUnit.m_isOtherPc == true || exceptUnit.UnitType == UnitType.Npc)
         *      {
         *          //서버로부터 중계되어 온 닉네임을 타겟으로 잡는다.
         *          if (exceptUnit.SvSkillTgUnit != null)
         *          {
         *              shortestDistance = 0.1f;
         *              nearest = exceptUnit.SvSkillTgUnit;
         *          }
         *      }
         *      else
         *      {
         *          //exceptUnit.TeamID //같은 팀중에서 OtherPc놈들만 찾는다.
         *          List<Unit> MyTeamList = allTeamDic[exceptUnit.TeamID];
         *          for (int i = 0; i < MyTeamList.Count; i++)
         *          {
         *              Unit target = MyTeamList[i];
         *
         *              if (target.m_isOtherPc == false)
         *                  continue;
         *
         *              if (!CanTarget(attackType, target))
         *                  continue;
         *
         *              if (!withStructure && target.UnitType == UnitType.Prop)
         *                  continue;
         *
         *              ////< 이벤트 상태라면 패스
         *              if (target.CurrentState == UnitState.Evnet && RaidBossAIBase.NotTargeting)
         *                  continue;
         *
         *              if (exceptUnit != null && exceptUnit == target)
         *                  continue;
         *
         *              if (target.CurrentState == UnitState.Dying || target.CurrentState == UnitState.Dead)
         *                  continue;
         *
         *              float distance = (target.transform.position - point).sqrMagnitude;
         *              if (distance < shortestDistance)
         *              {
         *                  shortestDistance = distance;
         *                  nearest = target;
         *              }
         *          }
         *
         *      }
         *  }
         * }//if (SceneManager.isRTNetworkMode == GAME_MODE.FREEFIGHT)
         */

        //Debug.LogWarning("2JW : " + nearest, nearest);
        return(nearest);
    }
コード例 #21
0
 public void SetAttackData(float appreciateDistance, float attackRange, eAttackType type)
 {
     _appreciateDistance = appreciateDistance;
     _attackRange        = attackRange;
     _attackType         = type;
 }
コード例 #22
0
 public StatInfo Stat(eAttackType AttackType)
 {
     return(GetStatInfo(stat_node, AttackType));
 }
コード例 #23
0
    string GetImmuneMessage(eImmuneType immune_type, eAttackType attack_type)
    {
        bool shield = ActionInfo.actionType == eActionType.shield;

        string message = "";

        if (attack_type == eAttackType.heal)
        {
            message = Localization.Get("ImmuneHeal");
        }
        else
        {
            bool immune_damage = shield == true || ActionInfo.immune_types.Contains(eImmuneType.damage);
            bool immune_dot    = shield == false && ActionInfo.immune_types.Contains(eImmuneType.dot);
            bool immune_debuff = shield == false && ActionInfo.immune_types.Contains(eImmuneType.debuff);
            bool immune_cc     = shield == false && ActionInfo.immune_types.Contains(eImmuneType.cc);

            if (immune_damage && immune_dot && immune_debuff && immune_cc)
            {
                message = Localization.Get("ImmuneAll");
            }
            else
            {
                switch (immune_type)
                {
                case eImmuneType.damage:
                case eImmuneType.dot:
                    if (immune_damage && immune_dot)
                    {
                        message = Localization.Get("ImmuneDamageDotDamage");
                    }
                    else if (immune_damage)
                    {
                        message = Localization.Get("ImmuneDamage");
                    }
                    else
                    {
                        message = Localization.Get("ImmuneDotDamage");
                    }
                    break;

                case eImmuneType.debuff:
                case eImmuneType.cc:
                    if (immune_debuff && immune_cc)
                    {
                        message = Localization.Get("ImmuneDebuffCC");
                    }
                    else if (immune_debuff)
                    {
                        message = Localization.Get("ImmuneDebuff");
                    }
                    else
                    {
                        message = Localization.Get("ImmuneCC");
                    }
                    break;
                }
            }

            bool immune_attack_type_physic = ActionInfo.attack_types.Contains(eAttackType.physic);
            bool immune_attack_type_magic  = ActionInfo.attack_types.Contains(eAttackType.magic);

            if (immune_attack_type_physic == true && immune_attack_type_magic == false)
            {
                message = Localization.Format("ImmunePhysicFormat", message);
            }
            else if (immune_attack_type_physic == false && immune_attack_type_magic == true)
            {
                message = Localization.Format("ImmuneMagicFormat", message);
            }
        }

        if (shield)
        {
            return(Localization.Format("ShieldFormat", message));
        }
        else
        {
            return(Localization.Format("ImmuneFormat", message));
        }
    }
コード例 #24
0
ファイル: Npc.cs プロジェクト: yonghoKim365/myProject_2020_05
    public override int TakeDamage(Unit attacker, float damageRatio, float damage, float AddDamage, eAttackType atkType, bool isSkillDamage, AbilityData _ability, bool through = false, bool projecttile = false)
    {
        int resultDmg = base.TakeDamage(attacker, damageRatio, damage, AddDamage, atkType, isSkillDamage, _ability, through, projecttile);

        //< 인게임 상태가 아니라면 패스
        if (G_GameInfo.GameInfo.GameMode == GAME_MODE.NONE)
        {
            return(resultDmg);
        }

        if (G_GameInfo.GameMode == GAME_MODE.SINGLE)
        {
            int count = SingleGameState.StageQuestList.Count;
            for (int i = 0; i < count; i++)
            {
                //if (SingleGameState.StageQuestList[i].Type != ClearQuestType.MAX_DAMAGE)
                //    continue;
                //else if (SingleGameState.StageQuestList[i].IsClear)//이미 클리어
                //    continue;

                if (SingleGameState.StageQuestList[i].CheckCondition(ClearQuestType.MAX_DAMAGE, resultDmg))
                {
                    UIBasePanel panel = UIMgr.GetHUDBasePanel();
                    if (panel != null)
                    {
                        (panel as InGameHUDPanel).SetQuestStringColor(i, true);
                    }

                    break;
                }
            }
        }

        /*
         * if (G_GameInfo.GameMode == GAME_MODE.TUTORIAL)
         * {
         *  if ((G_GameInfo.GameInfo as TutorialGameInfo).DummyUnitNum == SpawnUnitNum)
         *  {
         *      if(IsDie)
         *      {
         *          (G_GameInfo.GameInfo as TutorialGameInfo).EndDummyUnit();//더미 교육 끝
         *      }
         *      //if (attacker.CurrentState == UnitState.Attack
         *      //    || attacker.CurrentState == UnitState.ManualAttack)
         *      //    (G_GameInfo.GameInfo as TutorialGameInfo).AddCondition(InGameTutorialType.Attack);
         *      //else if (attacker.CurrentState == UnitState.Skill)
         *      //{
         *      //    CharInfo.Hp = CharInfo.MaxHp;
         *      //    if (attacker.UseSkillSlot == 1)
         *      //        (G_GameInfo.GameInfo as TutorialGameInfo).AddCondition(InGameTutorialType.Skill_01);
         *      //    else if (attacker.UseSkillSlot == 2)
         *      //        (G_GameInfo.GameInfo as TutorialGameInfo).AddCondition(InGameTutorialType.Skill_02);
         *      //    else if (attacker.UseSkillSlot == 3)
         *      //        (G_GameInfo.GameInfo as TutorialGameInfo).AddCondition(InGameTutorialType.Skill_03);
         *      //    else if (attacker.UseSkillSlot == 4)
         *      //    {
         *      //        //IsDie = true;
         *      //        CharInfo.Hp = 0;
         *      //        Die(attacker);
         *      //        (G_GameInfo.GameInfo as TutorialGameInfo).AddCondition(InGameTutorialType.Skill_04);
         *      //    }
         *      //}
         *
         *      //base.TakeDamage(attacker, 0, 0, 0, atkType, isSkillDamage, 0, pushPower, through, projecttile);
         *      //return 0;
         *  }
         * }
         */
        //< 이미 한번 호출을 해줬다면 패스한다.
        if (AllyCheck)
        {
            return(resultDmg);
        }

        //if (SceneManager.isRTNetworkMode == GAME_MODE.FREEFIGHT) //네트웍모드에서는 동맹에게 나를 공격한 공격자를 알려주지 않는다.
        if (SceneManager.instance.IsRTNetwork)
        {
            return(resultDmg);
        }


        // 동맹들에게 나를 공격한 공격자를 알려주도록 한다.
        if (G_GameInfo.CharacterMgr.unitGroupDic.ContainsKey(GroupNo))
        {
            List <Unit> allyList = G_GameInfo.CharacterMgr.unitGroupDic[GroupNo];
            for (int i = 0; i < allyList.Count; i++)
            {
                Unit ally = allyList[i];
                if (null == ally || !ally.Usable || !ally.UsableNavAgent)
                {
                    continue;
                }

                if (ally.TargetID == GameDefine.unassignedID)
                {
                    Vector3 targetDist = attacker.cachedTransform.position - ally.cachedTransform.position;
                    float   distance   = Mathf.Clamp(targetDist.magnitude - (1f + ally.Radius + CharInfo.FirstAtkRange), 0, 100f);
                    Vector3 addPos     = targetDist.normalized * distance;
                    ally.MovePosition(ally.cachedTransform.position + addPos);
                    ally.TargetID = attacker.GetInstanceID();
                }

                if ((ally is Npc))
                {
                    (ally as Npc).AllyCheck = true;
                }
            }
        }

        return(resultDmg);
    }
コード例 #25
0
    /// <summary>
    /// 공격자가 대상에 가할 데미지 계산
    /// </summary>
    /// <remarks>
    /// 대미지 공식 적용
    /// A. 기본 스탯(능력) + 아이템(절대치) + 아이템 옵션(절대치)
    /// B. {A} * ( 1+ (아이템% + 패시브% + 아이템 옵션%))
    /// C. 버프 적용 : {B} * (1 + (건물 버프 + 스킬 버프))
    /// D. 대상 속성 공격 적용 : {C} * ( 1 +( 속성 수치 )) 대상 속성 비교
    /// E. 액티브 적용 : {C or D} * ( 1 + (액티브 적용))
    /// G. 크리티컬 대미지 적용 : {C or D or E } * (1+ (크.확 - 크.확 감소 디버프) * (크.댐 - 크.댐 감소 디버프))
    /// H. 방어력 무시 % 확률 계산

    /// 방어력 공식 적용
    /// A. 기본 스탯(능력) + 아이템(절대치) + 아이템 옵션(절대치)
    /// B. {A} * (1+ (아이템% + 패시브% + 아이템 옵션%))
    /// C. 버프 적용 : {B} * (1+ (건물 버프% + 스킬 버프%))
    /// D. 총 방어력 / ((총방어력+Defense_DefendVariable)+((레벨-1)*Defense_LevelVariable))
    /// </remarks>
    /// <param name="attacker">공격자</param>
    /// <param name="target">대상</param>
    /// <param name="damage">초기정해진 데미지</param>
    /// <param name="atkType">공격종류</param>
    /// <returns>대상에게 적용되어야할 실 데미지</returns>
    static public int CalcDamage(Unit attacker, Unit target, float damage, float AddDamage, bool isCritical, eAttackType atkType)
    {
        //GameCharacterInfo CharInfo = target.CharInfo;

        // ======== 공격력 계수가 적용된 초기 데미지 ========
        float calcDamage = damage;

        /*
         * //공식
         * //=========================================================================================
         * // 치명타 일경우 = 방어력 무시+[(공격력-데미지 감소)-((공격력-데미지 감소)*대미지 감소율*0.01*%)]*(2+치명타 대미지*0.01*%)
         * // 치명타가 아닐경우 = 방어력 무시+[(공격력-데미지 감소)-((공격력-데미지 감소)*대미지 감소율*0.01*%)]
         * //=========================================================================================
         * // *방어력 무시 공격력
         * float DefIgnoreDam = attacker.CharInfo.DefIgnoreAtk;
         * // **공격력 = 데미지 감소 수치가 적용된 공격력
         * float CalcDamageDec = (calcDamage - CharInfo.Def);
         * // ***감소될 공격력 = 데미지 감소율에 의해 나온 수치
         * float CalcDamageDecRate = CalcDamageDec * CharInfo.DefRate *0.01f;
         * // 최종 공격력 = (*방무공) + (**공격력) + (***감소될공격력)
         * float totalDam = DefIgnoreDam + (CalcDamageDec - CalcDamageDecRate);
         *
         * if( isCritical )
         * {
         * totalDam = totalDam * ( 2 + attacker.CharInfo.CriticalDmgRate * 0.01f);
         * }
         * calcDamage = Mathf.Clamp(totalDam, 1, calcDamage);
         * return (int)calcDamage;
         */

        float targetDefRate = target.CharInfo.DefRate * 0.001f;

        if (targetDefRate > 1)
        {
            targetDefRate = 1f;
        }

        if (isCritical)
        {
            //크리시
            if (damage - target.CharInfo.Def > 0)
            {
                float totalDam = (attacker.CharInfo.DefIgnoreAtk + AddDamage + (damage - target.CharInfo.Def) - ((damage - target.CharInfo.Def) * targetDefRate));
                totalDam   = totalDam * (2 + attacker.CharInfo.CriticalDmgRate * 0.001f);
                calcDamage = Mathf.Clamp(totalDam, 0, totalDam);
                return((int)calcDamage);
            }
            else
            {
                float totalDam = (attacker.CharInfo.DefIgnoreAtk + AddDamage + 0);
                totalDam   = totalDam * (2 + attacker.CharInfo.CriticalDmgRate * 0.001f);
                calcDamage = Mathf.Clamp(totalDam, 0, totalDam);
                return((int)calcDamage);
            }
        }
        else
        {
            //크리가 아닐시
            if (damage - target.CharInfo.Def > 0)
            {
                float totalDam = attacker.CharInfo.DefIgnoreAtk + AddDamage + (damage - target.CharInfo.Def) - ((damage - target.CharInfo.Def) * targetDefRate);
                calcDamage = Mathf.Clamp(totalDam, 0, totalDam);
                return((int)calcDamage);
            }
            else
            {
                float totalDam = attacker.CharInfo.DefIgnoreAtk + AddDamage + 0;
                calcDamage = Mathf.Clamp(totalDam, 0, totalDam);
                return((int)calcDamage);
            }
        }
    }
コード例 #26
0
 public StatInfo StatIncrease(eAttackType AttackType)
 {
     return(GetStatInfo(statIncrease_node, AttackType));
 }
コード例 #27
0
 public int AddHitbox(float xPos, float yPos, float width, float height, int damage, float xKnock, float yKnock, float hitstun, float blockstun, eAttackType type)
 {
     return(m_hitboxManager.addHitbox(xPos, yPos, width, height, damage, xKnock, yKnock, hitstun, blockstun, type));
 }
コード例 #28
0
    //void SetStatusNoneData(Unit unit)
    //{


    //    SetLevel(1);

    //CanDashAttack = false;// null != GetAnimData(eAnimName.Anim_dash) && RushAtkRange > 0f;
    //}

    // PC 기본 스탯 정보 대입
    //void SetStatusPC(Pc pc)
    //{
    //    startExp = pc.syncData.Exp;
    //    Stats = pc.syncData.Stats;

    //    SetDefaultStat( LowDataMgr.GetCompositionDataOfUnit( pc.syncData.LowID, pc.syncData.Grade, pc.syncData.AwakenType ) );

    //    int level = DataManager.GetUnitLevel( pc.syncData.Grade, pc.syncData.Exp );

    //    SetLevel( level );

    //CanDashAttack = false;// null != GetAnimData(eAnimName.Anim_dash) && RushAtkRange > 0f;   // Dash 애니가 있으면 attack_f
    //}

    // Npc에 맞는 스탯정보 셋팅
    //void SetStatusNpc(Npc npc)
    //{
    //    LowDataMgr.NpcCompositionData comData = LowDataMgr.GetCompositionDataOfNpc( npc.NpcLowID );

    //    startExp = (uint)0;
    //    Stats = GK_StatGenerator.GenerateDefaultStats( comData );

    //    SetDefaultStat( comData );
    //    SetLevel( 1 );

    //CanDashAttack = false;// null != GetAnimData(eAnimName.Anim_dash) && RushAtkRange > 0f;
    //}

    // Prop 기본 스탯 정보 대입
    //void SetStatusProp(Prop prop)
    //{
    //    LowDataMgr.NpcCompositionData comData = LowDataMgr.GetCompositionDataOfNpc(prop.NpcLowID);

    //    Stats = GK_StatGenerator.GenerateDefaultStats(comData);
    //    startExp = 0;
    //    Level = 1;
    //    SetDefaultStat(comData);

    //    CanDashAttack = false;
    //}

    // Trap 기본 스탯 정보 대입
    //void SetStatusTrap()
    //{
    //    Stats = GK_StatGenerator.GenerateDefaultStats();

    //    startExp = 0;
    //    Level = 1;

    //    CanDashAttack = false;
    //}


    //PC일경우 셋팅용
    void SetStatPC(Pc pc)
    {
        FirstAtkRange = 1.04f;
        AtkDelay      = 0;
        //AtkRecognition = 20f;
        RushAtkRange = 0;

        CurMoveType = OrignalMoveType = (MoveType)1;
        AttackType  = eAttackType.Melee;
        AirHeight   = 0;
        AirFlyTime  = 0;

        UnitName  = pc.syncData._Name;
        CharIndex = pc.IsPartner ? pc.syncData._partnerID : pc.syncData._charIdx;

        //장착정보
        EquipCostume = pc.syncData._HideCostume ? 0 : pc.syncData._CostumeItem;
        EquipCloth   = pc.syncData._ClothItem;
        EquipWeapon  = pc.syncData._WeaponItem;
        EquipHead    = pc.syncData._HeadItem;
        SkillSetId   = pc.syncData._SkillSetId;

        float atkRange = 2;

        if (pc.IsPartner)
        {
            //파트너일경우
            if (_LowDataMgr.instance.GetPartnerInfo(pc.syncData._partnerID).AiType == 1)
            {
                //밀리
                atkRange = 2;
            }
            else
            {
                //원거리
                atkRange = 5;
            }
        }

        if (G_GameInfo.GameMode == GAME_MODE.SPECIAL_EXP || G_GameInfo.GameMode == GAME_MODE.SPECIAL_GOLD)
        {
            AtkRecognition = 40f;
        }
        else
        {
            AtkRecognition = 20f;
        }

        float value = pc.syncData.GetStats(AbilityType.HP);

        Stats.Add(AbilityType.HP, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.DAMAGE);
        Stats.Add(AbilityType.DAMAGE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.HIT_RATE);
        Stats.Add(AbilityType.HIT_RATE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.DODGE_RATE);
        Stats.Add(AbilityType.DODGE_RATE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.CRITICAL_RATE);
        Stats.Add(AbilityType.CRITICAL_RATE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.CRITICAL_RES);
        Stats.Add(AbilityType.CRITICAL_RES, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.CRITICAL_DAMAGE);
        Stats.Add(AbilityType.CRITICAL_DAMAGE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.DRAIN_HP);
        Stats.Add(AbilityType.DRAIN_HP, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.DEFENCE_IGNORE);
        Stats.Add(AbilityType.DEFENCE_IGNORE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.DAMAGE_DECREASE);
        Stats.Add(AbilityType.DAMAGE_DECREASE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.DAMAGE_DECREASE_RATE);
        Stats.Add(AbilityType.DAMAGE_DECREASE_RATE, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.COOLTIME);
        Stats.Add(AbilityType.COOLTIME, new Attribute(value));

        value = pc.syncData.GetStats(AbilityType.ATTACK_SPEED);
        Stats.Add(AbilityType.ATTACK_SPEED, new Attribute(value));

        //value = pc.syncData.GetStats(AbilityType.ATTACK_RANGE);
        Stats.Add(AbilityType.ATTACK_RANGE, new Attribute(atkRange));

        //value = pc.syncData.GetStats(AbilityType.ATTACK_ANGLE);
        Stats.Add(AbilityType.ATTACK_ANGLE, new Attribute(140));

        //value = pc.syncData.GetStats(AbilityType.MOVE_SPEED);
        Stats.Add(AbilityType.MOVE_SPEED, new Attribute(7.5f));

        //value = pc.syncData.GetStats(AbilityType.DETECTED_RANGE);
        Stats.Add(AbilityType.DETECTED_RANGE, new Attribute(15f));

        Stats.Add(AbilityType.SUPERARMOR, new Attribute(pc.syncData.GetStats(AbilityType.SUPERARMOR)));
        Stats.Add(AbilityType.SUPERARMOR_RECOVERY_TIME, new Attribute(pc.syncData.GetStats(AbilityType.SUPERARMOR_RECOVERY_TIME)));
        Stats.Add(AbilityType.SUPERARMOR_RECOVERY_RATE, new Attribute(pc.syncData.GetStats(AbilityType.SUPERARMOR_RECOVERY_RATE)));
        Stats.Add(AbilityType.SUPERARMOR_RECOVERY, new Attribute(pc.syncData.GetStats(AbilityType.SUPERARMOR_RECOVERY)));

        Stats.Add(AbilityType.WEIGHT, new Attribute(pc.syncData.GetStats(AbilityType.WEIGHT)));

        savedMaxHp = Hp = (int)Stats[AbilityType.HP].FinalValue;
        SuperArmor = (uint)Stats[AbilityType.SUPERARMOR].FinalValue;
    }
コード例 #29
0
ファイル: CombatShow.cs プロジェクト: kimKIKI/2DGame_Card
 // player 의 ATK_Type 타입을 이펙트 타입에 적용한다.
 void SetATKType(int num)
 {    //num은 승패결정이므로 3,2,1 의 값임
      //temp[0] 컴정보 , temp[1]player
     if (num == 3)
     { //player승리
       //카드의 정보를 받아서 이펙트를 변경시켜준다.
       //temp 0:player,1:com 슬롯
         if (temp[1] == null)
         {
             Debug.Log(" 카드가 없을때 작동합니다.");
         }
         else if (temp[1].atk_type == "Ground")
         {
             atkType = eAttackType.LAZER;
         }
         else if (temp[1].atk_type == "Lazer")
         {
             atkType = eAttackType.LAZER;
         }
         else if (temp[1].atk_type == "the air")
         {
             atkType = eAttackType.LAZER;
         }
         else if (temp[1].atk_type == "Top")
         {
             atkType = eAttackType.GROUND;
         }
         else if (temp[1].atk_type == "bullet")
         {
             atkType = eAttackType.BULLET;
         }
     }
     else if (num == 1)
     {//com 승리
      //카드의 정보를 받아서 이펙트를 변경시켜준다.
         if (temp[0] == null)
         {
             Debug.Log(" 카드가 없을때 작동합니다.");
         }
         else if (temp[0].atk_type == "Ground")
         {
             atkType = eAttackType.LAZER;
         }
         else if (temp[0].atk_type == "Lazer")
         {
             atkType = eAttackType.LAZER;
         }
         else if (temp[0].atk_type == "the air")
         {
             atkType = eAttackType.LAZER;
         }
         else if (temp[0].atk_type == "Top")
         {
             atkType = eAttackType.GROUND;
         }
         else if (temp[0].atk_type == "bullet")
         {
             atkType = eAttackType.BULLET;
         }
     }
     else if (num == 2)
     { //무승부
       //카드의 정보를 받아서 이펙트를 변경시켜준다.
       //if (temp[1] == null)
       //{
       //    Debug.Log(" 카드가 없을때 작동합니다.");
       //}
       //else if (temp[1].atk_type == "Ground")
       //{
       //    atkType = eAttackType.GROUND;
       //}
       //else if (temp[1].atk_type == "Lazer")
       //{
       //    atkType = eAttackType.LAZER;
       //}
       //else if (temp[1].atk_type == "the air")
       //{
       //    atkType = eAttackType.LAZER;
       //}
       //else if (temp[1].atk_type == "Top")
       //{
       //    atkType = eAttackType.GROUND;
       //}
     }
 }
コード例 #30
0
    public void Damage(int damage, float xKnock, float yKnock, float hitstun, float blockstun, eAttackType type, float xPos, float yPos)
    {
        //Debug.Log("Hit receved");

        if (!m_guarding || CheckBlockSide(xPos) || (type == eAttackType.THROW))
        {
            Debug.Log("Hit registered");

            m_wasHit   = true;
            m_health  -= damage;
            m_stunTime = hitstun;

            m_velocity[0] = xKnock;
            m_velocity[1] = yKnock;
        }
        else
        {
            Debug.Log("Hit blocked");

            m_stunTime = blockstun;
        }
    }