Esempio n. 1
0
 public ILive Build(string name = "Warrior", int hp = 10, int mp = 4, int damage = 5, int def = 7,
     string agression = "Warrior", int Experience = 0, int Lvl = 0, int ExperienceToLvl = 0, int X = 0, int Y = 0, int x = 0, int y = 0, Eff eff=null, IBattleSkill bskill=null)
 {
     var hero = new Warrior();
     hero.SetHero(name, hp, mp, damage, def, agression, Experience, Lvl, ExperienceToLvl, X, Y, x, y,eff,bskill);
     return hero;
 }
Esempio n. 2
0
File: Fight.cs Progetto: Dieho/Hero
        public string Kick(ILive first, ILive second, IBattleSkill skill = null)
        {
            var batleRandom = new BatleCalculates();
            string result = "";
            if (first.HPCurent > 0 && second.HPCurent > 0)
            {
                bool chance = batleRandom.ChanceToHit(first);
                if (!chance)
                {
                    result = "You MISS!";
                }
                else
                {
                    if (skill == null)
                        second.HPCurent = second.HPCurent - batleRandom.Damage(first) / second.DefCurent;
                    else
                    {
                        first.skillInUse.Add(skill as Skill);
                        second.HPCurent = second.HPCurent - skill.Smash(first, second) / second.DefCurent;
                    }

                }
                if (first.HPCurent > 0 && second.HPCurent > 0)
                {
                    chance = batleRandom.ChanceToHit(second);

                    if (!chance)
                        result += "He MISS!Ha-Ha";
                    else
                    {
                        first.HPCurent = first.HPCurent - batleRandom.Damage(second) / first.DefCurent;
                    }
                }
                GoEffect(first, second);
            }

            if (first.HPCurent <= 0)
            {
                first.HPCurent = 0;
                result += "You are dead!:(";
                batleRandom.Experience(second, first);
            }
            if (second.HPCurent <= 0)
            {
                second.HPCurent = 0;
                result += "He is dead!:)";
                batleRandom.Experience(first, second);
            }

            return result;
        }
Esempio n. 3
0
 private void _ClearBattleSkill(IBattleSkill obj)
 {
     _BattleSkill = null;
 }
Esempio n. 4
0
 private void _SetBattleSkill(IBattleSkill obj)
 {
     _BattleSkill = obj;
 }
 private void _ClearBattleSkill(IBattleSkill obj)
 {
     _BattleSkill = null;
 }
 private void _SetBattleSkill(IBattleSkill obj)
 {
     _BattleSkill = obj;
 }
Esempio n. 7
0
File: Hero.cs Progetto: Dieho/Hero
 //#region DDBuild
 protected Hero SetHero(string name, int hp, int mp, int damage, int def, string agression, int Experience, int Lvl, int ExperienceToLvl, int X, int Y, int x, int y, Eff effect=null, IBattleSkill bskill=null,Skill skillInUse=null)
 {
     _location.X = x;
     _location.Y = y;
     _mapPosition.X = X;
     _mapPosition.Y = Y;
     _name = name;_HP = hp;
     _HPCurent = _HP;
     _MP = mp;
     _MPCurent = _MP;
     _Damage = damage;
     _DamageCurent = _Damage;
     _Def = def;
     _DefCurent = _Def;
     _Lvl = Lvl;
     _agression = agression;
     _experience = Experience;
     _experienceToLvl = NextLvl(_Lvl);
     if (effect!=null)
     _effects.Add(effect);
     if (bskill != null)
         _battleSkills.Add(bskill);
     if (skillInUse!=null)
         _skillInUse.Add(skillInUse);
     return this;
 }
Esempio n. 8
0
 private void _SupplyBattle(IBattleSkill obj)
 {
     _Battle = obj;
     DisarmObject.SetActive(true);
 }
Esempio n. 9
0
    private void _UnsupplyBattle(IBattleSkill obj)
    {
        _Battle = null;

        DisarmObject.SetActive(false);
    }