예제 #1
0
파일: Skill.cs 프로젝트: drawpixel/DHunter
    public void Create(InfoSkill info, Creature crt)
    {
        m_info = info;
        m_owner_crt = crt;

        m_effects = new EffectBase[Proto.ProtoEffects.Length];
        for (int i = 0; i < m_effects.Length; ++i)
        {
            ProtoEffect proto = Proto.ProtoEffects[i];
            m_effects[i] = proto.NewInstance(); ;
        }
    }
예제 #2
0
파일: Skill.cs 프로젝트: drawpixel/Assets
    public void Create(InfoSkill info, Creature crt)
    {
        m_info      = info;
        m_owner_crt = crt;

        m_effects = new EffectBase[Proto.ProtoEffects.Length];
        for (int i = 0; i < m_effects.Length; ++i)
        {
            ProtoEffect proto = Proto.ProtoEffects[i];
            EffectBase  eb    = proto.NewInstance();
            eb.Create(proto, this, i);
            eb.OnActiveOver += OnEffectActiveOver;
            m_effects[i]     = eb;
        }
    }
예제 #3
0
    public static InfoSkill GetSkillB(SkillNameB name, int level)
    {
        InfoSkill iS = new InfoSkill();

        switch (name)
        {
        case SkillNameB.none:
            iS.damageTypeB = DamageType.Default;
            iS.delay       = 0;
            switch (level)
            {
            case 1:

                break;

            case 2:

                break;
            }
            break;

        case SkillNameB.skillB0:
            iS.damageTypeB = DamageType.Boom;
            iS.delay       = 2;
            iS.img         = ResManager.instance.imgSkill[3];
            switch (level)
            {
            case 1:

                break;

            case 2:

                break;
            }
            break;
        }
        return(iS);
    }
예제 #4
0
    public static InfoSkill GetSkill(SkillName name, int level)
    {
        InfoSkill iS = new InfoSkill();

        switch (name)
        {
        case SkillName.none:
            iS.damageType = DamageType.Default;
            iS.delay      = 0;
            switch (level)
            {
            case 1:

                break;

            case 2:

                break;

            case 3:

                break;
            }
            break;

        case SkillName.skill0:
            iS.damageType = DamageType.Link;
            iS.delay      = 2;
            iS.img        = ResManager.instance.imgSkill[0];
            switch (level)
            {
            case 1:

                break;

            case 2:

                break;

            case 3:

                break;
            }
            break;

        case SkillName.skill1:
            iS.damageType = DamageType.Rebound;
            iS.delay      = 2;
            iS.img        = ResManager.instance.imgSkill[1];
            switch (level)
            {
            case 1:

                break;

            case 2:

                break;

            case 3:

                break;
            }
            break;

        case SkillName.skill2:
            iS.damageType = DamageType.Row;
            iS.delay      = 2;
            iS.img        = ResManager.instance.imgSkill[2];
            switch (level)
            {
            case 1:

                break;

            case 2:

                break;

            case 3:

                break;
            }
            break;
        }
        return(iS);
    }
예제 #5
0
파일: Combat.cs 프로젝트: Zombach/Project-X
    public static List <CombatResult> Attack(TurnBase attackerIn, TurnBase attackedIn, SkillName skillNameIn, SkillNameB skillNameBIn, List <TurnBase> enemyesIn, List <TurnBase> unitsIn, int skill_lvlIn)
    {
        InfoSkill infoSkill = SkillInfo.GetSkill(skillNameIn, skill_lvlIn);

        damageType = infoSkill.damageType;
        InfoSkill infoSkillB = SkillInfo.GetSkillB(skillNameBIn, skill_lvlIn);

        damageTypeB = infoSkillB.damageTypeB;
        targets.Clear();
        selectedCells.Clear();
        combatResults.Clear();
        attacker   = attackerIn;
        attacked   = attackedIn;
        skillName  = skillNameIn;
        skillNameB = skillNameBIn;
        enemyes.Clear();
        units.Clear();
        enemyes   = enemyesIn;
        units     = unitsIn;
        skill_lvl = skill_lvlIn;
        CheckList();

        float damage = 0;

        if (skillName == SkillName.none && skillNameB == SkillNameB.none)
        {
            damage = attacker.general.PARAMS[GENERAL_DAMAGE_CURRENT] - attacked.general.PARAMS[GENERAL_DEFENSE_CURRENT];
            if (damage <= 0)
            {
                damage = 0;
            }
            else if (Random.Range(0, 100) < attacker.general.PARAMS[GENERAL_CRIT_CHANGE_CURRENT])
            {
                damage += attacker.general.PARAMS[GENERAL_CRIT_DAMAGE_CURRENT];
            }
            CombatResult cr = new CombatResult();
            cr.target = attacked;
            cr.damage = damage;
            combatResults.Add(cr);
        }
        else
        {
            if (damageType != DamageType.Default && skillName != SkillName.none)
            {
                switch (damageType)
                {
                case DamageType.Link:
                    Link();
                    break;

                case DamageType.Rebound:
                    Rebound();
                    break;

                case DamageType.Row:
                    Row();
                    break;

                case DamageType.Boom:
                    Boom();
                    break;

                case DamageType.Dot:

                    break;

                case DamageType.Buff:

                    break;

                case DamageType.Debuff:

                    break;
                }
            }
            else if (damageTypeB != DamageType.Default && skillNameB != SkillNameB.none)
            {
                switch (damageTypeB)
                {
                case DamageType.Link:
                    Link();
                    break;

                case DamageType.Rebound:
                    Rebound();
                    break;

                case DamageType.Row:
                    Row();
                    break;

                case DamageType.Boom:
                    Boom();
                    break;

                case DamageType.Dot:

                    break;

                case DamageType.Buff:

                    break;

                case DamageType.Debuff:

                    break;
                }
            }
            else
            {
            }
            CombatResult crs = new CombatResult();
            crs.target = attacked;
            if (DamageType.Boom == damageType)
            {
                //crs.damage = DamageBoom();
            }
            crs.damage = 20;
            combatResults.Add(crs);
            foreach (TurnBase target in targets)
            {
                CombatResult crss = new CombatResult();
                crss.target = target;
                crss.damage = 15;
                combatResults.Add(crss);
            }
        }
        return(combatResults);
    }