본문 바로가기

C#/수업 과제

과제2

1. 리그오브레전드 - 가렌

https://leagueoflegends.fandom.com/wiki/Garen/LoL

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        
        static void Main(string[] args)
        {
            //변수 선언과 값 할당//
            int minHealth = 620;
            int maxHealth = 2048;
            int minHealthRege = 8;
            float maxHealthRege = 16.5f;
            int minArmor = 36;
            int maxArmor = 87;
            int minMagicResist = 32;
            float maxMagicResist = 44.75f;
            int moveSpeed = 340;
            string resource = "N/A";
            string resourceRegen = "N/A";
            int minAttackDamage = 66;
            float maxAttackDamage = 142.5f;
            int critDamage = 175;
            int attackRange = 175;

            //출력//
            Console.WriteLine("Base statistics");
            Console.WriteLine("Health : {0} - {1}", minHealth, maxHealth);
            Console.WriteLine("Health regen. (per 5s) : {0} - {1}", minHealthRege, maxHealthRege);
            Console.WriteLine("Armor : {0} - {1}", minArmor, maxArmor);
            Console.WriteLine("Magic resist. : {0} - {1}", minMagicResist, maxMagicResist);
            Console.WriteLine("Move. speed : {0}", moveSpeed);
            Console.WriteLine("Resource : {0}", resource);
            Console.WriteLine("Resource regen. : {0}", resourceRegen);
            Console.WriteLine("Attack damage : {0} - {1}", minAttackDamage, maxAttackDamage);
            Console.WriteLine("Crit. damage : {0}%", critDamage);
            Console.WriteLine("Attack range : {0}", attackRange);
        }
    }
}

 

-----------------------------------------------------------------------------------------------------------------------------------

 

2. 스타크래프트 - 드라군

https://starcraft.fandom.com/wiki/Dragoon_(StarCraft)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        enum eState
        {
            Idle, Run, Attack, Disappear
        }

        static void Main(string[] args)
        {
            string race = "Protoss";
            int sight = 8;
            char hotKey = 'D';
            float speed = 5.25f;
            eState state = eState.Idle;
            bool isDie = false;

            //출력
            Console.WriteLine("Dragoon");
            Console.WriteLine("Race : {0}", race);
            Console.WriteLine("Sight : {0}", sight);
            Console.WriteLine("Hotkey : {0}", hotKey);
            Console.WriteLine("Speed : {0}", speed);
            Console.WriteLine("state : {0}", state);
            Console.WriteLine("isDie : {0}", isDie);
        }
    }
}

 

-----------------------------------------------------------------------------------------------------------------------------------

 

3. 오토체스 - 인첸트리스

https://dotaautochess.fandom.com/wiki/Enchantress

//에러 나서 알게된점
class를 변수로 선언할수없다. -> 문자하나를 대문자로 변경하는것만으로 해결이됨.
'숫자' 또는 '숫자로 시작하는 문자열'을 변수로 선언할수 없다.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        
        static void Main(string[] args)
        {
            //변수 설정 및 값 할당
            string name = "Enchantress";
            string species = "Beast";
            string Class = "Druid";
            int cost = 1;
            int Lv1Health = 400;
            int Lv2Health = 800;
            int Lv3Health = 1500;
            int armor = 5;
            int magical = 0;
            object resistance = "N/A";
            int Lv1MinAttackDamage = 50;
            int Lv1MaxAttackDamage = 60;
            int Lv2MinAttackDamage = 100;
            int Lv2MaxAttackDamage = 120;
            int Lv3MinAttackDamage = 200;
            int Lv3MaxAttackDamage = 240;
            float baseAttackTime = 1.5f;
            int bassAttack = 400;
            object range = "N/A";
            
            //출력
            Console.WriteLine(name);
            Console.WriteLine("Species : {0}", species);
            Console.WriteLine("Class : {0}", Class);
            Console.WriteLine("Cost : {0}", cost);
            Console.WriteLine("Health : {0}/{1}/{2}", Lv1Health, Lv2Health, Lv3Health);
            Console.WriteLine("Armor : {0}", armor);
            Console.WriteLine("Magical : {0}", magical);
            Console.WriteLine("Resistance : {0}", resistance);
            Console.WriteLine("Attack Damage : {0}-{1}/{2}-{3}/{4}-{5}", Lv1MinAttackDamage, Lv1MaxAttackDamage, Lv2MinAttackDamage, Lv2MaxAttackDamage, Lv3MinAttackDamage, Lv3MaxAttackDamage);
            Console.WriteLine("Base Attack Time : {0}", baseAttackTime);
            Console.WriteLine("Bass Attack : {0}", bassAttack);
            Console.WriteLine("Range : {0}", range);

        }
    }
}

 

4. HOMM2 - 워 트롤

https://mightandmagic.fandom.com/wiki/War_troll_(H2)

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        enum eState
        {
            Idle, Move, Attack, Hit, Die
        }

        static void Main(string[] args)
        {
            //변수선언 및 값 할당
            string name = "War troll";
            object index = "Stats";
            int attack = 10;
            int defense = 5;
            int hp = 40;
            int minDamage = 7;
            int maxDamage = 9;
            string speed = "Fast";
            int ammo = 16;
            int growth = 3;
            bool isDie = false;
            eState state = eState.Idle;

            //출력
            Console.WriteLine(name);
            Console.WriteLine(index);
            Console.WriteLine("Attack : {0}", attack);
            Console.WriteLine("Defense : {0}", defense);
            Console.WriteLine("Hit Points : {0}", hp);
            Console.WriteLine("Damage : {0}-{1}", minDamage, maxDamage);
            Console.WriteLine("Speed : {0}", speed);
            Console.WriteLine("Ammo : {0}", ammo);
            Console.WriteLine("Growth : {0}", growth);
            Console.WriteLine("IsDie : {0}", isDie);
            Console.WriteLine("State : {0}", state);

        }
    }
}

 

5. 메이플스토리 - 발록

https://maplestory.fandom.com/wiki/Balrog#Monster

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HelloWorld
{
    class Program
    {
        
        static void Main(string[] args)
        {
            //변수 선언 및 값 할당

            string name = "Balrog (Boss)";
            const int level = 45;
            int hp = 2400000;
            int mp = 30000;
            const int exp = 0;
            int ambitionExp = 17;
            object speed = "Stationary";
            int attack = 322;
            int physicalDefense = 200;
            int magicDefense = 320;
            int pdrDefenseRate = 25;
            int mdrDefenseRate = 25;

            //출력
            Console.WriteLine(name);
            Console.WriteLine("Level : {0}", level);
            Console.WriteLine("HP : {0}", hp);
            Console.WriteLine("MP : {0}", mp);
            Console.WriteLine("EXP : {0}", exp);
            Console.WriteLine("Additional Points : Ambition EXP : {0}", ambitionExp);
            Console.WriteLine("Speed : {0}", speed);
            Console.WriteLine("Attack : {0}", attack);
            Console.WriteLine("Defense : Physical : {0}, Magic : {1}", physicalDefense, magicDefense);
            Console.WriteLine("Defense Rate : PDR : {0}%, MDR : {1}%", pdrDefenseRate, mdrDefenseRate);

        }
    }
}