コード例 #1
0
ファイル: Poring.cs プロジェクト: Fablelie/Prototype-DiceGame
 public void Init(PoringProperty baseProperty)
 {
     Property = ScriptableObject.CreateInstance <PoringProperty>();
     Property.Init(baseProperty);
     JobImage.sprite = Property.JobImage;
     // Debug.Log("Current hp : " + Property.CurrentHp);
 }
コード例 #2
0
    public void Init(PoringProperty baseProperty)
    {
        BaseHp       = baseProperty.BaseHp;
        CurrentMaxHp = baseProperty.BaseHp;
        CurrentHp    = baseProperty.BaseHp;
        BasePAtk     = baseProperty.BasePAtk;
        CurrentPAtk  = baseProperty.BasePAtk;
        BaseMAtk     = baseProperty.BaseMAtk;
        CurrentMAtk  = baseProperty.BaseMAtk;
        AttackRange  = baseProperty.AttackRange;

        GrowupHp        = baseProperty.GrowupHp;
        GrowupPAtk      = baseProperty.GrowupPAtk;
        GrowupMAtk      = baseProperty.GrowupMAtk;
        MaxHp           = baseProperty.MaxHp;
        MaxMAtk         = baseProperty.MaxMAtk;
        MaxPAtk         = baseProperty.MaxPAtk;
        MaxPoint        = baseProperty.MaxPoint;
        MoveDices       = baseProperty.MoveDices;
        DeffensiveDices = baseProperty.DeffensiveDices;
        OffensiveDices  = baseProperty.OffensiveDices;

        CurrentLevel      = 1;
        CurrentRequestExp = baseProperty.StartRequestExp;
        MaxLevel          = baseProperty.MaxLevel;
        StartRequestExp   = baseProperty.StartRequestExp;
        MultiplyPerLevel  = baseProperty.MultiplyPerLevel;

        // normal skill
        baseProperty.SkillList.ForEach(baseSkill =>
        {
            Type type = baseSkill.GetType();

            var skill = ScriptableObject.CreateInstance(type.ToString()) as BaseSkill;
            skill.Init(baseSkill);
            SkillList.Add(skill);
        });

        // Ultimate skill
        Type t = baseProperty.UltimateSkill.GetType();
        var  s = ScriptableObject.CreateInstance(t.ToString()) as BaseSkill;

        s.Init(baseProperty.UltimateSkill);
        UltimateSkill = s;

        NormalAttackEffect = baseProperty.NormalAttackEffect;
        JobImage           = baseProperty.JobImage;
    }
コード例 #3
0
    public BaseSkill GetSkillOfPoring(string skillName, int poringIndex)
    {
        PoringProperty property = m_player[poringIndex].Property;

        foreach (BaseSkill skill in property.SkillList)
        {
            if (skill.name == skillName)
            {
                return(skill);
            }
        }

        if (skillName == property.UltimateSkill.name)
        {
            return(property.UltimateSkill);
        }
        return(null);
    }
コード例 #4
0
    private bool CaculateLevelUp(PoringProperty p)
    {
        if (p.CurrentPoint >= p.CurrentRequestExp)
        {
            // level up!!
            if (p.CurrentLevel < p.MaxLevel)
            {
                p.CurrentLevel = p.CurrentLevel + 1;
            }

            p.CurrentPoint      -= p.CurrentRequestExp;
            p.CurrentRequestExp += p.MultiplyPerLevel;
            CaculateLevelUp(p);
            // TODO active effect.
            return(true);
        }
        else
        {
            // skip!! not think happen.
            return(false);
        }
    }