Esempio n. 1
0
 public void setGraph(int sI, int statIndex, int wildLevels, int domLevels, bool tamed, double TE, double imprinting)
 {
     if (sI >= 0 && sI < Values.V.speciesNames.Count && statIndex >= 0 && statIndex < 7)
     {
         CreatureStat stat = Values.V.species[sI].stats[statIndex];
         serie.Points.Clear();
         serie.Points.AddXY("Base", stat.BaseValue);
         serie.Points.AddXY("Wild", Stats.calculateValue(sI, statIndex, wildLevels, 0, false, 0, 0));
         serie.Points.AddXY("Tamed", Stats.calculateValue(sI, statIndex, wildLevels, 0, true, TE, 0));
         serie.Points.AddXY("Dom", Stats.calculateValue(sI, statIndex, wildLevels, domLevels, true, TE, 0));
         serie.Points.AddXY("Impr", Stats.calculateValue(sI, statIndex, wildLevels, domLevels, true, TE, imprinting));
     }
 }
    void OnHitEvent()
    {
        if (_lockTarget != null)
        {
            // 데미지 처리는 공격을 받는 대상이 하는게 훨씬 좋다. (각종 버프같은 것들 때문에)
            CreatureStat targetStat = _lockTarget.GetComponent <CreatureStat>();

            if (targetStat != null)
            {
                targetStat.OnAttacked(Stat);
            }
        }
    }
Esempio n. 3
0
    public override void OnAttacked(CreatureStat attackerStat)
    {
        int damage = Mathf.Max(0, attackerStat.Attack - Defense);

        Hp -= damage;

        HUD_Damage HUDDamage = Managers.UI.MakeWorldSpaceUI <HUD_Damage>();

        HUDDamage.transform.position = HUD_DamagePos.position;
        HUDDamage.GetComponent <TextMeshPro>().text = damage.ToString();

        if (Hp <= 0)
        {
            Hp = 0;
            OnDead(attackerStat);
        }
    }
Esempio n. 4
0
    public override void OnDead(CreatureStat attackerStat)
    {
        CharacterStat playerStat = attackerStat as CharacterStat;

        if (playerStat != null)
        {
            playerStat.CurrentExp += Exp;
            HUD_Exp HUDExp = Managers.UI.MakeWorldSpaceUI <HUD_Exp>();
            HUDExp.transform.position = HUD_ExpPos.position;
            HUDExp.GetComponent <TextMeshPro>().text = "+" + Exp.ToString();

            playerStat.Gold += Gold;
            HUD_Gold HUDGold = Managers.UI.MakeWorldSpaceUI <HUD_Gold>();
            HUDGold.transform.position = HUD_GoldPos.position;
            HUDGold.GetComponent <TextMeshPro>().text = "+" + Gold.ToString();
        }

        Managers.Game.DeSpawn(gameObject);
    }
 public override void OnDead(CreatureStat attackerStat)
 {
     Debug.Log("Player Dead!");
 }
Esempio n. 6
0
    public BattleCreature(MapCreatureInfo map_creature_info, CharacterContainer character_container, float attack_next_time, GameObject hpBarPrefab, GameObject skillPrefab)
    {
        MapStageDifficulty stage_info = Network.BattleStageInfo;

        IsTeam      = false;
        Info        = map_creature_info.CreatureInfo;
        SkinName    = map_creature_info.SkinName;
        MapCreature = map_creature_info;

        Grade        = map_creature_info.Grade;
        Level        = map_creature_info.Level;
        GradePercent = map_creature_info.GradePercent;
        Enchant      = map_creature_info.Enchant;

        if (map_creature_info.UseLeaderSkillType != pe_UseLeaderSkillType.Manual && Info.TeamSkill != null)
        {
            SetLeader(map_creature_info.UseLeaderSkillType, BattleStage.Instance.OnUseEnemyLeaderSkill);
        }

        switch (map_creature_info.CreatureType)
        {
        case eMapCreatureType.Elite:
            Scale = 1.2f;
            break;

        case eMapCreatureType.Boss:
            Scale = 1.4f;

            if (stage_info.MapInfo.MapType == "boss")
            {
                Level        = Boss.CalculateLevel(Level, stage_info);
                Grade        = Boss.CalculateGrade(Level);
                Enchant      = Boss.CalculateEnchant(Level);
                GradePercent = CreatureInfoManager.Instance.Grades[Grade].enchants[Enchant].stat_percent * GameConfig.Get <float>("boss_grade_percent");
            }
            Battle.Instance.m_BossHP.Init(this);

            break;

        case eMapCreatureType.WorldBoss:
            Scale = 2.5f;
            BattleWorldboss.Instance.m_BossHP.Init(this, true);
            IgnoreTween = true;
            TextOffset  = -20f;
//                IsShowText = false;
            break;
        }
        Stat = new CreatureStat(map_creature_info.GetStat(Level, GradePercent, Enchant));

        AutoSkillIndex = map_creature_info.AutoSkillIndex;
        InitCommon(character_container, attack_next_time, hpBarPrefab, skillPrefab);

        if (map_creature_info.CreatureType == eMapCreatureType.WorldBoss)
        {
            HPBar.gameObject.SetActive(false);
        }

        foreach (SkillInfo skill_info in Info.Skills)
        {
            if (skill_info.Type != eSkillType.active)
            {
                continue;
            }
            Skills.Add(new BattleSkill(skill_info, this, map_creature_info.Level));
        }

        if (map_creature_info.PassiveInfos.Count > 0)
        {
            foreach (var passive_info in map_creature_info.PassiveInfos)
            {
                bool first        = true;
                var  battle_skill = new BattleSkill(passive_info.SkillInfo, this, map_creature_info.Level);
                foreach (var action in passive_info.SkillInfo.Actions)
                {
                    ISkillBuff buff = SkillTarget.DoBuff(action, this, this, battle_skill, 0, null);
                    if (first == true && string.IsNullOrEmpty(passive_info.SkillInfo.ActionName) == false)
                    {
                        first = false;
                        var comp = AssetManager.GetCharacterPrefab("PassiveEtc_" + passive_info.SkillInfo.ActionName).GetComponent <CharacterActionBuffComponent>();
//                         comp.data.InitEffect();
                        CharacterActionBuff new_action = comp.data.CreateAction(comp, PlaybackTime, Character, 999f, false, 1f);
                        buff.Action = new_action;
                    }
                }
            }
            var buff_worldboss = Buffs.Find(b => b.ActionInfo.actionType == eActionType.worldboss);
            if (buff_worldboss != null)
            {
                Stat.HP = Stat.MaxHP = buff_worldboss.ActionInfo.value;
            }
            else
            {
                Stat.HP = Stat.MaxHP = Stat.Stat.MaxHP;
            }
            Stat.MP = Stat.Stat.ManaInit;
        }
    }
Esempio n. 7
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Stat"/> class.
 /// </summary>
 /// <param name="statType">The stat type.</param>
 /// <param name="currentValue">The current stat value.</param>
 /// <param name="maxValue">The maximum value that the stat can reach.</param>
 public Stat(CreatureStat statType, uint currentValue, uint maxValue)
 {
     this.Type    = statType;
     this.Current = currentValue;
     this.Maximum = maxValue;
 }
Esempio n. 8
0
 public float GetStatModifier(CreatureStat stat)
 {
     return(_statModifier[stat]);
 }
Esempio n. 9
0
 public virtual void OnDead(CreatureStat attackerStat)
 {
 }