Ejemplo n.º 1
0
    public AdventurerData(GameObject input) : base(input)
    {
        Adventurer inputAdventurer = input.GetComponent <Adventurer>();

        battleStat = inputAdventurer.GetBattleStat();

        if (inputAdventurer.GetEnemy() != null)
        {
            enemy = new CombatantPtr(inputAdventurer.GetEnemy());
        }
        if (inputAdventurer.curHuntingArea != null)
        {
            curHuntingArea = inputAdventurer.curHuntingArea.index;
        }

        //Debug.Log("name : " + inputAdventurer.name);
        if (inputAdventurer.GetSkills() != null)
        {
            skills = inputAdventurer.GetSkills().Keys.ToList();
        }

        temporaryEffects = new Dictionary <string, TemporaryEffectData>();
        Dictionary <string, TemporaryEffect> tempEffectsOrigin = inputAdventurer.GetTemporaryEffects();

        if (tempEffectsOrigin != null)
        {
            foreach (string key in tempEffectsOrigin.Keys.ToList())
            {
                temporaryEffects.Add(key, new TemporaryEffectData(tempEffectsOrigin[key]));
            }
        }
        //if (!isActive && stat == null)
        //    Debug.Log("stat is null");
    }
Ejemplo n.º 2
0
    public void UpdateBattleStat()
    {
        if (!(curCharacter is Adventurer))
        {
            return;
        }
        Adventurer adv = (Adventurer)curCharacter;
        BattleStat bs  = adv.GetBattleStat();

        characterLevelText.text          = bs.Level.ToString();
        characterHealthText.text         = bs.Health.ToString("F0") + " / " + bs.HealthMax.ToString("F0");
        characterAttackText.text         = bs.Attack.ToString("F0");
        characterAttackSpeedText.text    = bs.AttackSpeed.ToString("F0");
        characterDefenseText.text        = bs.Defence.ToString("F0");
        characterPenetrationText.text    = bs.PenetrationFixed.ToString("F0") + " / " + bs.PenetrationMult.ToString("F0");
        characterCriticalChanceText.text = bs.CriticalChance.ToString("F0");
        characterCriticalAttackText.text = bs.CriticalDamage.ToString("F0");
        characterAvoidText.text          = bs.BaseAvoid.ToString("F0");
        characterAttackRangeText.text    = bs.Range.ToString("F0");
    }