예제 #1
0
        public static Scene ReadFromStrings(string[] strings, Func <char, MapCell> mapCellFactory, float startPlayerDirectionAngle)
        {
            var      objects = new HashSet <IMapObject>();
            MyPlayer player  = null;

            for (var y = 0; y < strings.Length; y++)
            {
                for (var x = 0; x < strings[y].Length; x++)
                {
                    var c         = strings[y][x];
                    var mapObject = GetObjectByChar(c, y, x);

                    if (mapObject != null)
                    {
                        objects.Add(mapObject);
                    }

                    if (player == null && c == 'P')
                    {
                        player = new MyPlayer(new Vector2(x + 0.5f, y + 0.5f), new Vector2(0.3f, 0.3f), startPlayerDirectionAngle, 10);
                        var sword = Sword.Create(ResourceCachedLoader.Instance);
                        var bow   = Bow.Create(ResourceCachedLoader.Instance);
                        player.Weapons = new Weapon[] { bow, sword };
                        player.Spells  = new Spells[] { Spells.FireBall, Spells.ShockBall };
                    }
                }
            }

            var map = Map.FromStrings(strings, mapCellFactory);

            if (player == null)
            {
                throw new NotImplementedException("Scene has no player");
            }

            return(new Scene(player, map, objects));
        }
예제 #2
0
        static void Main(string[] args)
        {
            Axe        DurinAxe      = new Axe("Durin's Axe", 120, 5);
            Chestplate CitadelPlate  = new Chestplate("Citadel Plate", 0, 80);
            Dwarf      Thorin        = new Dwarf("Thorin Oakenshield", 150, DurinAxe, CitadelPlate, 10, 60, 15);
            Bow        RivendellBow  = new Bow("Rivendell Bow", 140, 0);
            Shield     RoundShield   = new Shield("Round Shield", 5, 65);
            Elf        Legolas       = new Elf("Legolas", 80, RivendellBow, RoundShield, 60, 20, 30);
            Staff      RadagastStaff = new Staff("Radagast's Staff", 30, 50, 40);
            Robe       BrownRobe     = new Robe("BrownRobe", 0, 20, 60);
            Spell      ForceOfNature = new Spell("Force of Nature", 0, 0, 20);
            Spell      WindShield    = new Spell("Wind Shield", 0, 60, 0);
            Spell      Firestorm     = new Spell("Firestorm", 120, 0, 0);
            ArrayList  SpellList     = new ArrayList();
            SpellBook  RadagastBook  = new SpellBook("Radagast's SpellBook", SpellList);
            Wizard     Radagast      = new Wizard("Radagast the Brown", 100, RadagastStaff, BrownRobe, RadagastBook, 10, 10, 30);

            Console.WriteLine("Radagast está aprendiendo Force Of Nature");
            Radagast.LearnSpell(ForceOfNature);
            Console.WriteLine("Radagast aprendió Force Of Nature");
            Console.WriteLine("Radagast está aprendiendo WindShield");
            Radagast.LearnSpell(WindShield);
            Console.WriteLine("Radagast aprendió WindShield");
            Console.WriteLine("Radagast está aprendiendo Firestorm");
            Radagast.LearnSpell(Firestorm);
            Console.WriteLine("Radagast aprendió Firestorm");
            Console.WriteLine($"La vida de Legolas es {Legolas.GetHP()}");
            Console.WriteLine($"La vida de Thorin es {Thorin.GetHP()}");
            Legolas.AttackDwarf(Thorin);
            Console.WriteLine($"Legolas ataca a Thorin, la vida de Thorin ahora es {Thorin.GetHP()}");
            Thorin.AttackElf(Legolas);
            Console.WriteLine($"Thorin le devuelve el golpe a Legolas, la vida de Legolas ahora es {Legolas.GetHP()}");
            Radagast.HealDwarf(Thorin);
            Radagast.HealElf(Legolas);
            Console.WriteLine($"Radagast cura a Thorin, la vida de Thorin es {Thorin.GetHP()}");
            Console.WriteLine($"Radagast cura a Legolas, la vida de Legolas es {Legolas.GetHP()}");
        }
예제 #3
0
        public ArcherPeacemaker() : base(AIType.AI_Archer, 8)
        {
            SetStr(70, 90);
            SetDex(100, 150);
            SetInt(20, 35);

            Item weapon;

            switch (Utility.Random(4))
            {
            case 0:
                weapon = new BarbedLongbow();
                break;

            case 1:
                weapon = new CompositeBow();
                break;

            case 2:
                weapon = new JukaBow();
                break;

            default:
                weapon = new Bow();
                break;
            }
            AddItem(weapon);

            SetSkill(SkillName.Tactics, 70, 95);
            SetSkill(SkillName.Archery, 70, 100);
            SetSkill(SkillName.Fencing, 65, 100);
            SetSkill(SkillName.MagicResist, 80, 110);
            SetSkill(SkillName.Macing, 75, 100);
            SetSkill(SkillName.Wrestling, 65, 100);
            SetSkill(SkillName.Healing, 65, 75);
            SetSkill(SkillName.Anatomy, 80, 90);
        }
    void SpawnStartScene()
    {
        Grass grass = new Grass();

        SpawnDefault(grass, "Grass");

        Player player = new Player();

        SpawnDefault(player, "Amigo");

        Bow bow = new Bow();

        SpawnDefault(bow, "Bow");
        player.AddWeapon(bow);

        Sword sword = new Sword();

        SpawnDefault(sword, "Sword");
        player.AddWeapon(sword);

        BadGuy badGuy = new BadGuy();

        SpawnDefault(badGuy, "BadGuy");
    }
예제 #5
0
        public ArcherPeacemaker() : base(AIType.AI_Archer, 8)
        {
            SetStr(70, 90);
            SetDex(100, 150);
            SetInt(20, 35);

            Item weapon;

            switch (Utility.Random(4))
            {
            case 0: weapon = new BarbedLongbow(); break;

            case 1: weapon = new CompositeBow(); break;

            case 2: weapon = new JukaBow(); break;

            default: weapon = new Bow(); break;
            }
            AddItem(weapon);

            AddItem(new Quiver());

            Container pack = new Backpack();

            pack.Movable = false;
            pack.DropItem(new Arrow(50));

            SetSkill(SkillName.Tactics, 70.1, 95.0);
            SetSkill(SkillName.Archery, 70.1, 100.0);
            SetSkill(SkillName.Fencing, 65.1, 100.0);
            SetSkill(SkillName.MagicResist, 80.1, 110.0);
            SetSkill(SkillName.Macing, 75.1, 100.0);
            SetSkill(SkillName.Wrestling, 65.1, 100.0);
            SetSkill(SkillName.Healing, 65.1, 75.0);
            SetSkill(SkillName.Anatomy, 80.1, 90.0);
        }
예제 #6
0
        public Guardian() : base(AIType.AI_Archer, FightMode.Aggressor, 10, 1, 0.2, 0.4)
        {
            InitStats(100, 125, 25);
            Title = "the guardian";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
            }

            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
            }

            Bow bow = new Bow();

            bow.Movable = false;

            AddItem(bow);

            PackItem(new Arrow(250));
            PackGold(250, 500);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Archery].Base      = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;
        }
예제 #7
0
 private void Awake()
 {
     playerCombat = playerObject.GetComponent <PlayerCombat>();
     playerBow    = playerObject.GetComponent <Bow>();
 }
예제 #8
0
    void Update()
    {
        // 좌클릭하면 회전시작
        if (isPlay)
        {
            if (Input.GetKeyDown(KeyCode.Mouse0))
            {
                isRotating = true;
                RotateInit();
            }

            // 변, 각, 무기 Effect
            ClearWeaponEffect();
            if (!isRotating)
            {
                ClearTri();
                switch (Tstate)
                {
                case 0:
                    if (onHypo)
                    {
                        HypoEffect.SetActive(true);
                    }
                    else if (onHeight && isCo)
                    {
                        HeightEffect.SetActive(true);
                    }
                    else if (onBase && !isCo)
                    {
                        BaseEffect.SetActive(true);
                    }
                    break;

                case 1:
                    if (onHypo)
                    {
                        HypoDeleteEffect.SetActive(true);
                    }
                    else if (onHeight && !isCo)
                    {
                        BowEffect.SetActive(true);
                        ArrowEffect.SetActive(true);
                        BaseLineEffect.SetActive(true);
                    }
                    else if (onBase && isCo)
                    {
                        CoBowEffect.SetActive(true);
                        CoArrowEffect.SetActive(true);
                        HeightLineEffect.SetActive(true);
                    }
                    break;

                case 2:
                    if (onHeight)
                    {
                        HeightDeleteEffect.SetActive(true);
                    }
                    else if (onHypo && isCo)
                    {
                        CoSpearEffect.SetActive(true);
                        HypoCoLineEffect.SetActive(true);
                    }
                    else if (onBase && isCo)
                    {
                        CoShieldEffect.SetActive(true);
                    }
                    break;

                case 3:
                    if (onBase)
                    {
                        BaseDeleteEffect.SetActive(true);
                    }
                    else if (onHypo && !isCo)
                    {
                        SpearEffect.SetActive(true);
                        HypoIdleLineEffect.SetActive(true);
                    }
                    else if (onHeight && !isCo)
                    {
                        ShieldEffect.SetActive(true);
                    }
                    break;
                }
                if (onCoAngle)
                {
                    if (isCo)
                    {
                        CoAngleDeleteEffect.SetActive(true);
                    }
                    else if (!isCo)
                    {
                        CoAngleEffect.SetActive(true);
                    }
                }
                if (onIdleAngle && isCo)
                {
                    CoAngleDeleteEffect.SetActive(true);
                    IdleAngleEffect.SetActive(true);
                }
            }

            // 키보드'space' or CoAngle 클릭시
            if (Input.GetKeyDown(KeyCode.Space) || (Input.GetKeyDown(KeyCode.Mouse0) && onCoAngle))
            {
                isCo = !isCo;
            }

            // Co상태에서 IdleAngle 클릭시
            if (isCo && Input.GetKeyDown(KeyCode.Mouse0) && onIdleAngle)
            {
                isCo = false;
            }

            if (isCo)
            {
                CoAngle.SetActive(true);
            }
            else
            {
                CoAngle.SetActive(false);
            }

            // 키보드'w' or Hypo 클릭시
            if (Input.GetKeyDown(KeyCode.W) || (Input.GetKeyDown(KeyCode.Mouse0) && onHypo))
            {
                switch (Tstate)
                {
                case 0:
                    Tstate = 1;
                    if (!isCo)
                    {
                        MakeCircle(HypoIdleCircle);
                    }
                    else
                    {
                        MakeCircle(HypoCoCircle);
                    }
                    break;

                case 1:
                    Tstate = 0;
                    HypoIdleCircle.SetActive(false);
                    HypoCoCircle.SetActive(false);
                    break;

                case 2:
                    if (isCo)
                    {
                        if (Input.GetKeyDown(KeyCode.W))
                        {
                            SetAnimationParameters(0, 1);
                            StartCoroutine("Cosec");
                            RotateFinish();
                        }
                        else
                        {
                            CoSpear.SetActive(true);
                            isLaunching = 5;
                        }
                    }
                    break;

                case 3:
                    if (!isCo)
                    {
                        if (Input.GetKeyDown(KeyCode.W))
                        {
                            SetAnimationParameters(0, 1);
                            StartCoroutine("Sec");
                            RotateFinish();
                        }
                        else
                        {
                            Spear.SetActive(true);
                            isLaunching = 2;
                        }
                    }
                    break;
                }
            }

            // 키보드'd' or Height 클릭시
            if (Input.GetKeyDown(KeyCode.D) || (Input.GetKeyDown(KeyCode.Mouse0) && onHeight))
            {
                switch (Tstate)
                {
                case 0:
                    MakeCircle(HeightCircle);
                    Tstate = 2;
                    break;

                case 1:
                    if (!isCo)
                    {
                        if (Input.GetKeyDown(KeyCode.D))
                        {
                            SetAnimationParameters(0, 1);
                            StartCoroutine("Sin");
                            RotateFinish();
                        }
                        else
                        {
                            Bow.SetActive(true);
                            Arrow.SetActive(true);
                            isLaunching = 1;
                        }
                    }
                    break;

                case 2:
                    Tstate = 0;
                    HeightCircle.SetActive(false);
                    break;

                case 3:
                    if (!isCo)
                    {
                        if (Input.GetKeyDown(KeyCode.D))
                        {
                            SetAnimationParameters(0, 1);
                            StartCoroutine("Tan");
                            RotateFinish();
                        }
                        else
                        {
                            Shield.SetActive(true);
                            isLaunching = 3;
                        }
                    }
                    break;
                }
            }

            // 키보드'a' or Base 클릭시
            if (Input.GetKeyDown(KeyCode.A) || (Input.GetKeyDown(KeyCode.Mouse0) && onBase))
            {
                switch (Tstate)
                {
                case 0:
                    MakeCircle(BaseCircle);
                    Tstate = 3;
                    break;

                case 1:
                    if (isCo)
                    {
                        if (Input.GetKeyDown(KeyCode.A))
                        {
                            SetAnimationParameters(0, 1);
                            StartCoroutine("Cos");
                            RotateFinish();
                        }
                        else
                        {
                            CoBow.SetActive(true);
                            CoArrow.SetActive(true);
                            isLaunching = 4;
                        }
                    }
                    break;

                case 2:
                    if (isCo)
                    {
                        if (Input.GetKeyDown(KeyCode.A))
                        {
                            SetAnimationParameters(0, 1);
                            StartCoroutine("Cotan");
                            RotateFinish();
                        }
                        else
                        {
                            CoShield.SetActive(true);
                            isLaunching = 6;
                        }
                    }
                    break;

                case 3:
                    Tstate = 0;
                    BaseCircle.SetActive(false);
                    break;
                }
            }

            ClearEdgeActivated();
            switch (Tstate)
            {
            case 0:
                Tri.transform.localScale = StandardScale;
                break;

            case 1:
                HypoActivated.SetActive(true);
                HypoLength.SetActive(true);
                Tri.transform.localScale = StandardScale * 0.807f;
                break;

            case 2:
                HeightActivated.SetActive(true);
                HeightLength.SetActive(true);
                Tri.transform.localScale = StandardScale * 1.365f;
                break;

            case 3:
                BaseActivated.SetActive(true);
                BaseLength.SetActive(true);
                Tri.transform.localScale = StandardScale;
                break;
            }

            // 마우스 떼면 회전종료
            if (Input.GetKeyUp(KeyCode.Mouse0))
            {
                isRotating = false;
                if (isLaunching != 0)
                {
                    switch (isLaunching)
                    {
                    case 1:
                        StartCoroutine("Sin");
                        break;

                    case 2:
                        StartCoroutine("Sec");
                        break;

                    case 3:
                        StartCoroutine("Tan");
                        break;

                    case 4:
                        StartCoroutine("Cos");
                        break;

                    case 5:
                        StartCoroutine("Cosec");
                        break;

                    case 6:
                        StartCoroutine("Cotan");
                        break;
                    }
                    RotateFinish();
                }
            }

            if (isRotating)
            {
                MousePresentPosition = Camera.main.ScreenToWorldPoint(Input.mousePosition) - CoR;   // 마우스 현재위치는 깨다 기준 상대적 위치
                RotateAngle          = Vector2.Angle(MouseStartPosition, MousePresentPosition);     // RotateAngle 계산
                                                                                                    // Vertor2.Angle은 항상 0<=Angle<180이므로 외적을 이용해서 반환
                if (Vector3.Cross(MouseStartPosition, MousePresentPosition).z < 0)
                {
                    RotateAngle = 360f - RotateAngle;
                }
                // 회전 및 삼각형 중심 - 회전 중심 위치 조정
                Tri.transform.rotation = TriStartRotation * Quaternion.Euler(Vector3.forward * RotateAngle);
                // Hypo, Height, Base Length 같이 회전 (역방향)
                HypoLength.transform.rotation   = Quaternion.Euler(-(Tri.transform.rotation * Vector3.forward));
                HeightLength.transform.rotation = Quaternion.Euler(-(Tri.transform.rotation * Vector3.forward));
                BaseLength.transform.rotation   = Quaternion.Euler(-(Tri.transform.rotation * Vector3.forward));

                Tri.transform.position = Quaternion.Euler(Vector3.forward * RotateAngle) * TriStartPosition + CoR;
            }

            if (Input.GetKeyDown(KeyCode.Mouse1))
            {
                Reset();
            }                                                  // 우클릭 시 초기화
        }
    }
예제 #9
0
        public ArcherGuard(Mobile target)
            : base(target)
        {
            InitStats(100, 125, 25);
            Title = "the guard";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
            }

            new Horse().Rider = this;

            AddItem(new StuddedChest());
            AddItem(new StuddedArms());
            AddItem(new StuddedGloves());
            AddItem(new StuddedGorget());
            AddItem(new StuddedLegs());
            AddItem(new Boots());
            AddItem(new SkullCap());

            Bow bow = new Bow();

            bow.Movable     = false;
            bow.Crafter     = this;
            bow.Exceptional = true;

            AddItem(bow);

            Container pack = new Backpack();

            pack.Movable = false;

            Arrow arrows = new Arrow(250);

            arrows.LootType = LootType.Newbied;

            pack.DropItem(arrows);
            pack.DropItem(new Gold(10, 25));

            AddItem(pack);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Archery].Base      = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;

            this.NextCombatTime = DateTime.Now + TimeSpan.FromSeconds(0.5);
            this.Focus          = target;
        }
예제 #10
0
 // Use this for initialization
 void Start()
 {
     bow = (Bow) GetComponent<Bow>();
     bow.target = target;
     InvokeRepeating("Fire", 1, 1);
 }
예제 #11
0
 public void UpgradeBow(int UpgradeIndex)
 {
     BowUpgradeIndex = UpgradeIndex;
         bow = BowUpgraes[BowUpgradeIndex];
 }
예제 #12
0
        public Guardian() : base(AIType.AI_Archer, FightMode.Aggressor, 10, 1, 0.2, 0.4)
        {
            InitStats(100, 125, 25);
            Title = "the guardian";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
            }

            new ForestOstard().Rider = this;

            PlateChest chest = new PlateChest
            {
                Hue = 0x966
            };

            AddItem(chest);
            PlateArms arms = new PlateArms
            {
                Hue = 0x966
            };

            AddItem(arms);
            PlateGloves gloves = new PlateGloves
            {
                Hue = 0x966
            };

            AddItem(gloves);
            PlateGorget gorget = new PlateGorget
            {
                Hue = 0x966
            };

            AddItem(gorget);
            PlateLegs legs = new PlateLegs
            {
                Hue = 0x966
            };

            AddItem(legs);
            PlateHelm helm = new PlateHelm
            {
                Hue = 0x966
            };

            AddItem(helm);


            Bow bow = new Bow
            {
                Movable = false,
                Crafter = this,
                Quality = ItemQuality.Exceptional
            };

            AddItem(bow);

            PackItem(new Arrow(250));
            PackGold(250, 500);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Archery].Base      = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;
        }
예제 #13
0
        public Guardian() : base(AIType.AI_Archer, FightMode.Aggressor)
        {
            InitStats(100, 125, 25);
            Title = "the guardian";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Race.Human.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
            }

            new ForestOstard().Rider = this;

            var chest = new PlateChest();

            chest.Hue = 0x966;
            AddItem(chest);
            var arms = new PlateArms();

            arms.Hue = 0x966;
            AddItem(arms);
            var gloves = new PlateGloves();

            gloves.Hue = 0x966;
            AddItem(gloves);
            var gorget = new PlateGorget();

            gorget.Hue = 0x966;
            AddItem(gorget);
            var legs = new PlateLegs();

            legs.Hue = 0x966;
            AddItem(legs);
            var helm = new PlateHelm();

            helm.Hue = 0x966;
            AddItem(helm);

            var bow = new Bow();

            bow.Movable = false;
            bow.Crafter = this;
            bow.Quality = WeaponQuality.Exceptional;

            AddItem(bow);

            PackItem(new Arrow(250));
            PackGold(250, 500);

            Skills.Anatomy.Base      = 120.0;
            Skills.Tactics.Base      = 120.0;
            Skills.Archery.Base      = 120.0;
            Skills.MagicResist.Base  = 120.0;
            Skills.DetectHidden.Base = 100.0;
        }
        public static void BattleSetup()
        {
            int num_figths;

            Console.Write("Number of Fights: > ");

            var was_number = int.TryParse(Console.ReadLine(), out num_figths);

            if (!was_number)
            {
                Console.WriteLine("Error: Type a number:");
                Console.Write("Number of Fights: > ");
                if (!int.TryParse(Console.ReadLine(), out num_figths))
                {
                    Console.WriteLine("Error: Setting default to 1 match:");
                    num_figths = 1;
                }
            }

            Console.Write("You want Verbose Output? > ");
            string awnser = Console.ReadLine();

            if (awnser[0] == 'y' || awnser[0] == 'Y')
            {
                Logger.Verblog = true;
            }
            else
            {
                Logger.Verblog = false;
            }

            //creating a Archer
            var player1 = new Player { Name = "Archer", Ac = 7, Thac0 = 16, Hp = 12 };
            Logger.LogTrue(string.Format("Player1 created: Name: {0} Armour: {1}, Health Points: {2}", player1.Name, player1.Ac, player1.Hp), ConsoleColor.Green);

            Console.Write("Create random weapon? > ");
            awnser = Console.ReadLine();

            if (awnser[0] == 'y' || awnser[0] == 'Y')
            {
                int DmgNum = rn.Next(1, 3);
                int DmgSize = rn.Next(1, 6);
                var bow = new Bow { Name = string.Format("Bow {0}d{1}",DmgNum,DmgSize), DamageNum = DmgNum, DamageSize = DmgSize };
                player1.Wp = bow;
                Logger.LogTrue(string.Format("{0} equipped\n", bow.Name), ConsoleColor.Cyan);
            }
            else
            {
                var bow = new Bow { Name = "Bow 2d4", DamageNum = 2, DamageSize = 4 };
                player1.Wp = bow;
                Logger.LogTrue(string.Format("{0} equipped\n", bow.Name), ConsoleColor.Cyan);
            }
            //creating a 2d4 bow

            //creating an enemy
            var enemy = new Enemy { Name = "Wolf", Ac = 6, Hp = 10, Thac0 = 10, Wp = null };
            var claw = new Weapon { Name = "Claw", DamageNum = 1, DamageSize = 6 };
            enemy.Wp = claw;
            Logger.LogTrue(string.Format("{0} with damage {1}d{2} created", enemy.Name, claw.DamageNum, claw.DamageSize), ConsoleColor.Green);

            Console.WriteLine("Press Any Key to start Simulation!!!");
            Console.ReadKey();
            Attack(player1, enemy, num_figths);

            Console.ReadLine();
        }
예제 #15
0
파일: Level1.cs 프로젝트: rkhapov/simple3d
        public static void StartOnEngine(IEngine engine)
        {
            var resourceLoader = ResourceCachedLoader.Instance;
            var player         = new MyPlayer(new Vector2(2.0f, 2.0f), new Vector2(0.3f, 0.3f), MathF.PI / 2, 0);
            var wallTexture    = Sprite.Load("./sprites/greystone.png");
            var floorTexture   = Sprite.Load("./sprites/colorstone.png");
            var windowTexture  = Sprite.Load("./sprites/window.png");
            var ceilingTexture = Sprite.Load("./sprites/wood.png");
            var bedTexture     = Sprite.Load("./sprites/bed.png");
            var lichSprite     = Sprite.Load("./animations/lich/static/1.png");
            var sword          = Sword.Create(resourceLoader);
            var bow            = Bow.Create(resourceLoader);
            var doorAnimation  = resourceLoader.GetAnimation("./animations/door");

            player.Weapons = new Weapon[] { sword, bow };
            var backGroundMusic = resourceLoader.GetMusic(MusicResourceHelper.EnvironmentDungeonMusic);

            backGroundMusic.Play(-1);
            var storage = new MapTextureStorage(ceilingTexture, wallTexture, floorTexture, windowTexture, bedTexture, doorAnimation);
            var scene   = SceneReader.ReadFromStrings(
                new[]
            {
                "#################################################@@@@@@@",
                "#P..A#...#H.....R.R#........#......#.......M...R#@.AAA.@",
                "#....#...#.........#........#......#..z........A#@.HHH.@",
                "#.1..#...#a........##ooooooo#....g.#.........9.H#@.....@",
                "##d#######d##........z.....z.......#.....####d######d###",
                "#......#AHz@#......................#.R.R.#..........e..#",
                "#.z....oAMA@#......................#.....#.H@......@M..#",
                "#......#AHA@#.....ooo..............#..z..#........R....#",
                "#......#o###.....zo.oz.......%######.....#[email protected].#",
                "#......#..R#......ooo......p.d8...R......#...A..R......#",
                "#....z.....#.AA..............%######.....#............A#",
                "#......#############............o..#..z..#..@......@...#",
                "#.2....#.HHH..R.AAA#..........z.o..#A...H#..H........c.#",
                "##d###########d#######################.##############d##",
                "#.....z..AM#R.5..R..RH#.H..#######.............#.......#",
                "#........HA#.....o....#.......%M.....@...@.....#.......#",
                "#...@@.....#.....o....#....#.....@...@[email protected].#####",
                "#.z..@@....#..z..o...7d....#.....@R..@...@.....#.....R.#",
                "#.........3d.....o....#....o...................#.....f.#",
                "#.R.......H#....4....M#...R##########################d##",
                "############o###d###########@J......z........z.......z.#",
                "#.....H..............R#AAHH########..###################",
                "#..%.......R..........#....%...........#....M..........#",
                "#H......$........%R...#.............z..#.z....######..H#",
                "#.....................$.........AA.....#..#.....#RH#...#",
                "$R.......$.......oH..@#..z.............#..#..z..#..#.z.#",
                "######...............@#HMH.............#...........#RgR#",
                "@....#......$.........#$$$$$$$$.....z..#.z..#########d##",
                "@.HA.#......R........#$.AAAMMH$........#....#R...#.HH..@",
                "@@MA.d6..............#$.......$.......A##d###..z.#.zMM.@",
                "@.HAz#....@@@........#$.k....dl..........i.......oAAHHt@",
                "@@@@@###$##%###$##%###$$E$$$$$$$##################@@@@@@",
            }, storage.GetCellByChar, MathF.PI / 2);

            scene.Map.At(4, 2).SetTag("startDoor");
            Trigger.AddTrigger(new Vector2(2f, 3f), (scene) =>
            {
                Console.WriteLine("OPPEEEN THE DOOOOR");
                scene.Player.CurrentMonologue = new Monologue(
                    new[] {
                    ("Хмм... открыто", 2000)
                }
예제 #16
0
        public ArcherGuard(Mobile target)
            : base(target)
        {
            InitStats(150, 150, 150);
            Title = "the guard";

            SpeechHue = Utility.RandomDyedHue();

            Hue = Utility.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
            }

            new Horse().Rider = this;

            AddItem(new StuddedChest());
            AddItem(new StuddedArms());
            AddItem(new StuddedGloves());
            AddItem(new StuddedGorget());
            AddItem(new StuddedLegs());
            AddItem(new Boots());
            AddItem(new SkullCap());

            Bow bow = new Bow
            {
                Movable = false,
                Crafter = this,
                Quality = ItemQuality.Exceptional
            };

            AddItem(bow);

            Container pack = new Backpack
            {
                Movable = false
            };

            Arrow arrows = new Arrow(250)
            {
                LootType = LootType.Newbied
            };

            pack.DropItem(arrows);

            AddItem(pack);

            Skills[SkillName.Anatomy].Base      = 120.0;
            Skills[SkillName.Tactics].Base      = 120.0;
            Skills[SkillName.Archery].Base      = 120.0;
            Skills[SkillName.MagicResist].Base  = 120.0;
            Skills[SkillName.DetectHidden].Base = 100.0;

            NextCombatTime = Core.TickCount + 500;
            Focus          = target;
        }
예제 #17
0
 public void Start()
 {
     bow = GameObject.Find("WaterBalloonBow").GetComponent <Bow>();
     StartCoroutine(DeactivateCallback());
 }
예제 #18
0
 public void UpgradeBow(int UpgradeIndex)
 {
     BowUpgradeIndex = UpgradeIndex;
     bow = BowUpgrades[BowUpgradeIndex];
     player.BowAttack = bow.Attack;
 }
예제 #19
0
    // Use this for initialization
    void Start()
    {
        //Initialize Abilities - TODO Should this be done statically?
        tumble = new Tumble();
        tumble.setScript(this);
        silverBolts = new Silver_Bolts();
        silverBolts.setScript(this);
        condemn = new Condemn();
        condemn.setScript(this);
        finalHour = new Final_Hour();
        finalHour.setScript(this);
        shadowBolt = new ShadowBolt();
        shadowBolt.setScript(this);

        IconWidth = tumbleTexture.width;
        IconHeight = tumbleTexture.height;

        level = 1;

        //Initially not running
        running = false;

        idling = true;

        a = gameObject.GetComponent(typeof(Animation)) as Animation;

        originalRotation = transform.localRotation;

        alive = true;

        inventory = new Item[inventorySize];

        Bow startingBow = new Bow();
        startingBow.randomizeWeapon(1, 1);
        awardItem(startingBow);

        Helm startingHelm = new Helm();
        startingHelm.randomizeArmor(1, 1);
        awardItem(startingHelm);

        Chest startingChest = new Chest();
        startingChest.randomizeArmor(1, 1);
        awardItem(startingChest);

        Gloves startingGloves = new Gloves();
        startingGloves.randomizeArmor(1, 1);
        awardItem(startingGloves);

        Boots startingBoots = new Boots();
        startingBoots.randomizeArmor(1, 1);
        awardItem(startingBoots);

        checkpointTexture = Resources.Load("CheckpointTexture/CheckpointMaybe") as Texture2D;
        playerPortrait = Resources.Load("CheckpointTexture/vayne_circle") as Texture2D;
        playerManaTexture = Resources.Load("PlayerTextures/mana") as Texture2D;
        swiftDeathTexture = Resources.Load("VayneTextures/swiftDeath") as Texture2D;
        shadowBoltTexture = Resources.Load("VayneTextures/ShadowBolt") as Texture2D;

        leftClickOverlay = Resources.Load("InstructionPage/leftclick") as Texture2D;
        rightClickOverlay = Resources.Load("InstructionPage/rightclick") as Texture2D;

        winTexture = Resources.Load("GUITextures/victoryFull") as Texture2D;
        lossTexture = Resources.Load("GUITextures/defeatFull") as Texture2D;
        continueButton = Resources.Load("InstructionPage/Continue") as Texture2D;
        continueButtonHighlighted = Resources.Load("InstructionPage/Continue2") as Texture2D;

        equipment = new Item[6]; //TODO decide on size

        equipmentRect = new Rect(50, 50, 300, 300);
        inventoryRect = new Rect(Screen.width - 350, 50, 300, Mathf.Ceil(inventorySize / 6) * 50 + 20);
        confirmRect = new Rect((Screen.width / 2) - 150, Screen.height / 4, 300, 300);
        continueRect = new Rect((Screen.width / 2) - (continueButton.width / 2), Screen.height * (3.0f/4.0f), continueButton.width, continueButton.height);

        movementSpeed = 1;

        recalculateStats();

        if(PlayerPrefs.GetString("IsSaveGame") == "true"){
            name = PlayerPrefs.GetString("SaveFileName");
            Load();
        }

        currentHealth = maxHealth;
        currentMana = maxMana;

        Save();
    }
예제 #20
0
        private static void InvokeReward(Mobile from, SkillInfo skillInfo)
        {
            //Gump is problematic, would need to track if they have recieved their
            //reward for each skill, and recheck each login incase they closed the gump without accepting etc
            //Just give them a reward directly for now.
            Item rewardItem = null;

            switch (skillInfo.SkillID)
            {
            case 0:     // alchemy
                rewardItem = new MortarPestle();
                break;

            case 7:     // Blacksmithy
                rewardItem = new SmithHammer();
                break;

            case 8:     // Bowcraft/fletching
                rewardItem = new Bow();
                break;

            case 11:     // Carpentry
                rewardItem = new SmoothingPlane();
                break;

            case 23:     // Inscription
                rewardItem = new ScribesPen();
                break;

            case 25:     // Magery
                rewardItem = new Spellbook();
                (rewardItem as Spellbook).Content = ulong.MaxValue;
                break;

            case 34:     // Tailoring
                rewardItem = new SewingKit();
                break;

            case 35:     // Animal Taming
                rewardItem = new ShepherdsCrook();
                break;

            /* case 44: //Lumberjacking
             *   rewardItem = new Hatchet();
             *   break;
             * case 45: // Mining
             *   rewardItem = new Pickaxe();
             *   break;*/

            //Bardic skills
            case 9:
            case 15:
            case 22:
            case 29:
                rewardItem = new Drums();
                break;

            //"Thieving" skills
            case 21:
            case 28:
            case 33:
            case 47:
                rewardItem = new Cloak();
                break;
            }
            if (rewardItem != null)
            {
                rewardItem.Hue      = MythikStaticValues.GetGMRewardHue();
                rewardItem.LootType = LootType.Blessed;
                if (rewardItem.DefaultName != null)
                {
                    rewardItem.Name = from.RawName + "'s " + rewardItem.DefaultName;
                }
                from.PlaceInBackpack(rewardItem);
                from.SendAsciiMessage("You have recieved an item for becoming a Grand Master.");
            }
            else
            {
                from.SendAsciiMessage("You have recieved nothing but a sense of self worth for your efforts becoming a Grand Master.");
            }
        }
예제 #21
0
 private void Start()
 {
     ReferenceWeapon = new Bow(this.gameObject);
 }
예제 #22
0
 public void Start()
 {
     Bow = GetComponent <Bow>();
 }
예제 #23
0
    void CreateNewItem(ItemCreator creator)
    {
        Item newItem = null;

        if(index1==0){
            if(index2==0){ //One Handed Melee
                OneHandedMelee ohm = new OneHandedMelee();
                newItem = ohm as Item;
            }
            else if(index2==1){ //Two Handed Melee
                TwoHandedMelee thm = new TwoHandedMelee();
                newItem = thm as Item;
            }
            else if(index2==2){ //Bow
                Bow b = new Bow();
                newItem = b as Item;
            }
            else if(index2==3){ //Staff
                Staff s = new Staff();
                newItem = s as Item;
            }
            else if(index2==4){ //Shield
                Shield s = new Shield();
                newItem = s as Item;
            }
        }
        else if(index1==1){
            if(index2==0){ //Head
                HeadArmor ha = new HeadArmor();
                newItem = ha as Item;
            }
            else if(index2==1){ //Body
                BodyArmor ba = new BodyArmor();
                newItem = ba as Item;
            }
            else if(index2==2){ //Hand
                HandArmor ha = new HandArmor();
                newItem = ha as Item;
            }
            else if(index2==3){ //Leg
                LegArmor la = new LegArmor();
                newItem = la as Item;
            }
        }
        else if(index1==2){

        }

        newItem.ID = creator.itemID;

        creator._Item = newItem;
        creator.Save();

        creator.AddSpriteManager(sm);

        creator.isEditing = true;
        creator.isCreating = false;
    }
예제 #24
0
        public override void GenerateItems()
        {
            int colorTheme  = Utility.RandomDyedHue();
            int customTheme = 0;

            m_Items.Add(new Boots()
            {
                LootType = LootType.Blessed
            });
            m_Items.Add(new PlateChest()
            {
                LootType = LootType.Blessed
            });
            m_Items.Add(new RingmailGloves()
            {
                LootType = LootType.Blessed
            });

            m_Items.Add(new ShortPants(Utility.RandomNeutralHue())
            {
                LootType = LootType.Blessed
            });
            m_Items.Add(new SkullCap(colorTheme)
            {
                LootType = LootType.Blessed
            });

            switch (Utility.RandomMinMax(1, 4))
            {
            case 1: { m_Items.Add(new VikingSword()
                    {
                        LootType = LootType.Blessed
                    }); m_Items.Add(new MetalShield()
                    {
                        Hue = customTheme, LootType = LootType.Blessed
                    }); break; }

            case 2: { m_Items.Add(new WarMace()
                    {
                        LootType = LootType.Blessed
                    }); m_Items.Add(new MetalShield()
                    {
                        Hue = customTheme, LootType = LootType.Blessed
                    }); break; }

            case 3: { m_Items.Add(new Bardiche()
                    {
                        LootType = LootType.Blessed
                    }); break; }

            case 4: { m_Items.Add(new WarHammer()
                    {
                        LootType = LootType.Blessed
                    }); break; }
            }

            Bow bow = new Bow();

            bow.LootType = LootType.Blessed;
            m_Items.Add(bow);

            Utility.AssignRandomHair(this, Utility.RandomHairHue());
        }
예제 #25
0
    void Start()
    {
        merchantPanel = transform.Find("MerchantUI").gameObject;
        buyPanel      = transform.Find("BuyPanel").gameObject;
        panelTitle    = buyPanel.transform.Find("Title").GetComponent <Text>();
        panelDesc     = buyPanel.transform.Find("Description").GetComponent <Text>();

        btns   = transform.Find("MerchantUI/").GetComponentsInChildren(typeof(Button));
        buyBtn = buyPanel.transform.Find("Buy Button").GetComponent <Button>();

        cancelBtn = buyPanel.transform.Find("Cancel Button").GetComponent <Button>();
        cancelBtn.onClick.AddListener(delegate { HidePanel(); });

        transform.Find("MerchantUI/Potion/Button/Text").GetComponent <UnityEngine.UI.Text>().text = "" + Witch.Instance.PotionPrice;

        for (int i = 0; i < btns.Length; i++)
        {
            Button btn = (Button)btns[i];

            if (btn.transform.parent.name == "Strength")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Strength.itemName, Strength.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Strength.Buy(); HidePanel(); });
                });
            }
            else if (btn.transform.parent.name == "Helm")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Helm.itemName, Helm.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Helm.Buy(); HidePanel(); });
                });
            }
            else if (btn.transform.parent.name == "Telescope")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Telescope.itemName, Telescope.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Telescope.Buy(); HidePanel(); });
                });
            }
            else if (btn.transform.parent.name == "Wineskin")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Wineskin.itemName, Wineskin.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Wineskin.Buy(); HidePanel(); });
                });
            }
            else if (btn.transform.parent.name == "Shield")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Shield.itemName, Shield.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Shield.Buy(); HidePanel(); });
                });
            }
            else if (btn.transform.parent.name == "Bow")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Bow.itemName, Bow.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Bow.Buy(); HidePanel(); });
                });
            }
            else if (btn.transform.parent.name == "Falcon")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Falcon.itemName, Falcon.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Falcon.Buy(); HidePanel(); });
                });
            }
            else if (btn.transform.parent.name == "Potion")
            {
                btn.onClick.AddListener(() => {
                    ShowPanel(Potion.itemName, Potion.desc);
                    buyBtn.onClick.RemoveAllListeners();
                    buyBtn.onClick.AddListener(() => { Potion.Buy(); HidePanel(); });
                });
            }
        }
    }
예제 #26
0
        /// <summary>
        /// Initializes character renderers with selected sprites.
        /// </summary>
        private void TryInitialize()
        {
            HeadRenderer.sprite          = Head;
            HairRenderer.sprite          = Hair;
            HairRenderer.maskInteraction = HelmetMask == null ? SpriteMaskInteraction.None : SpriteMaskInteraction.VisibleOutsideMask;
            HairMask.sprite             = HelmetMask;
            EarsRenderer.sprite         = Ears;
            EyebrowsRenderers[0].sprite = Eyebrows;
            EyesRenderers[0].sprite     = Eyes;
            MouthRenderers[0].sprite    = Mouth;
            BeardRenderer.sprite        = Beard;
            EarsRenderer.sprite         = Ears;
            MapSprites(BodyRenderers, Body);
            HelmetRenderer.sprite   = Helmet;
            GlassesRenderer.sprite  = Glasses;
            MaskRenderer.sprite     = Mask;
            EarringsRenderer.sprite = Earrings;
            MapSprites(ArmorRenderers, Armor);
            CapeRenderer.sprite = Cape;
            BackRenderer.sprite = Back;
            PrimaryMeleeWeaponRenderer.sprite       = PrimaryMeleeWeapon;
            SecondaryMeleeWeaponRenderer.sprite     = SecondaryMeleeWeapon;
            BowRenderers.ForEach(i => i.sprite      = Bow.SingleOrDefault(j => j != null && i.name.Contains(j.name)));
            FirearmsRenderers.ForEach(i => i.sprite = Firearms.SingleOrDefault(j => j != null && i.name.Contains(j.name)));
            ShieldRenderer.sprite = Shield;

            PrimaryMeleeWeaponRenderer.enabled   = WeaponType != WeaponType.Bow;
            SecondaryMeleeWeaponRenderer.enabled = WeaponType == WeaponType.MeleePaired;
            BowRenderers.ForEach(i => i.enabled  = WeaponType == WeaponType.Bow);

            switch (HairMaskType)
            {
            case HairMaskType.None:
                HairRenderer.maskInteraction = SpriteMaskInteraction.None;
                HairMask.sprite = null;
                break;

            case HairMaskType.HelmetMask:
                HairRenderer.maskInteraction = HelmetMask == null ? SpriteMaskInteraction.None : SpriteMaskInteraction.VisibleOutsideMask;
                HairMask.sprite = HelmetMask;
                break;

            case HairMaskType.HeadMask:
                HairRenderer.maskInteraction = Head == null ? SpriteMaskInteraction.None : SpriteMaskInteraction.VisibleInsideMask;
                HairMask.sprite = HeadMask;
                break;
            }

            if (Hair != null && Hair.name.Contains("[HideEars]"))
            {
                EarsRenderer.sprite = null;
            }

            if (Hair != null && Hair.name.Contains("[HideHelm]"))
            {
                HairRenderer.maskInteraction = SpriteMaskInteraction.None;
                HelmetRenderer.sprite        = null;
            }

            switch (WeaponType)
            {
            case WeaponType.Firearms1H:
            case WeaponType.Firearms2H:
                Firearm.AmmoShooted = 0;
                BuildFirearms(Firearm.Params);
                break;
            }
        }
예제 #27
0
파일: Archer.cs 프로젝트: Sarxdan/ResPaw
 void Start()
 {
     bow      = GetComponent <Bow>();
     anim     = GetComponent <Animator>();
     lastTime = Time.time;
 }
예제 #28
0
        public MerchantCrew()
            : base(AIType.AI_Paladin, FightMode.Aggressor, 10, 1, .2, .4)
        {
            Title = "the merchant";
            Hue   = Race.RandomSkinHue();

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
                AddItem(new Skirt(Utility.RandomNeutralHue()));
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
                AddItem(new ShortPants(Utility.RandomNeutralHue()));
            }

            bool magery = 0.33 > Utility.RandomDouble();

            SetStr(100, 125);
            SetDex(125, 150);
            SetInt(250, 400);
            SetHits(250, 400);
            SetDamage(15, 25);

            if (magery)
            {
                ChangeAIType(AIType.AI_Mage);
                SetSkill(SkillName.Magery, 100.0, 120.0);
                SetSkill(SkillName.EvalInt, 100.0, 120.0);
                SetSkill(SkillName.Meditation, 100.0, 120.0);
                SetSkill(SkillName.MagicResist, 100.0, 120.0);
            }

            SetSkill(SkillName.Archery, 100.0, 120.0);
            SetSkill(SkillName.Chivalry, 100.0, 120.0);
            SetSkill(SkillName.Focus, 100.0, 120.0);
            SetSkill(SkillName.Tactics, 100.0, 120.0);
            SetSkill(SkillName.Wrestling, 100.0, 120.0);
            SetSkill(SkillName.Anatomy, 100.0, 120.0);

            SetDamageType(ResistanceType.Physical, 70);
            SetResistance(ResistanceType.Physical, 45, 55);
            SetResistance(ResistanceType.Fire, 45, 55);
            SetResistance(ResistanceType.Cold, 45, 55);
            SetResistance(ResistanceType.Poison, 45, 55);
            SetResistance(ResistanceType.Energy, 45, 55);

            Item bow;

            switch (Utility.Random(4))
            {
            default:
            case 0: bow = new CompositeBow(); PackItem(new Arrow(25)); break;

            case 1: bow = new Crossbow(); PackItem(new Bolt(25)); break;

            case 2: bow = new Bow(); PackItem(new Arrow(25)); break;

            case 3: bow = new HeavyCrossbow(); PackItem(new Bolt(25)); break;
            }

            AddItem(bow);

            AddItem(new TricorneHat());
            AddItem(new FancyShirt());
            AddItem(new Boots(Utility.RandomNeutralHue()));
            AddItem(new GoldEarrings());

            Fame  = 8000;
            Karma = 8000;
        }
예제 #29
0
        static void Main(string[] args)
        {
            Shield shield = new Shield("Golden Shield", 75, "Escudo Protector");
            Sword  sword  = new Sword("Katana", 125, "Corte Fugaz");

            Orc orc = new Orc("Grom", 25, "Tanque");

            orc.Equip(sword);
            orc.Equip(shield);


            Axe       axe       = new Axe("Verdugo", 70, "Juicio final");
            Warhammer warhammer = new Warhammer("Mjölnir", 90, "Aplastar y machacar");

            Dwarf dwarf = new Dwarf("Thorin", 35, "Luchador");

            dwarf.Equip(axe);
            dwarf.Equip(warhammer);

            Bow   bow   = new Bow("Arco gigante", 75, "Tira fuego");
            Cloak cloak = new Cloak("Capa maxima", 85, "Invisibilidad");

            Elf elf = new Elf("Galardiel", 15, "Escurridizo");

            elf.Equip(bow);
            elf.Equip(cloak);

            SpellBook  spellBook  = new SpellBook("Libro de Hechizos Oscuros", "Hechizos oscuros");
            Spell      spell      = new Spell("Lumos", "La varita enciende luz", 65, 0);
            MagicStaff magicStaff = new MagicStaff("Baculo Oscuro", 150, "Baculo perdido de Toran");

            Wizard wizard = new Wizard("Harry", "Mago De Apoyo", spellBook);

            dwarf.Attack(orc);
            Console.WriteLine("👳 " + dwarf.Name + " cura a 🤢 " + orc.Name);
            dwarf.HealCharacter(orc);
            Console.WriteLine();

            orc.Attack(wizard);
            wizard.Respawn();
            Console.WriteLine(wizard.Name + " ha respawneado");
            Console.WriteLine("La vida actual de 🧙 " + wizard.Name + " ahora es: " + wizard.Health + " ❤");
            Console.WriteLine();

            elf.UnEquip(bow);
            elf.Equip(sword);
            Console.WriteLine("El daño total que causa 🧝‍♀️ " + elf.Name + " es: " + elf.TotalDamage() + " 🗡");
            Console.WriteLine("La protección total de 🧝‍♀️ " + elf.Name + " es: " + elf.TotalProtection() + " 🛡");
            Console.WriteLine();

            orc.UnEquip(sword);
            orc.Equip(axe);
            Console.WriteLine("El daño total que causa 🤢 " + orc.Name + " es: " + orc.TotalDamage() + " 🗡");
            Console.WriteLine("La protección total de 🤢 " + orc.Name + " es: " + orc.TotalProtection() + " 🛡");
            Console.WriteLine();

            dwarf.UnEquip(axe);
            dwarf.Equip(shield);
            Console.WriteLine("El daño total que causa 👳 " + dwarf.Name + " es: " + dwarf.TotalDamage() + " 🗡");
            Console.WriteLine("La protección total de 👳 " + dwarf.Name + " es: " + dwarf.TotalProtection() + " 🛡");
            Console.WriteLine();

            wizard.Equip(magicStaff);
            wizard.Equip(spellBook);
            wizard.LearnSpell(spell);
            Console.WriteLine();

            Console.WriteLine("El daño total que causa 🧙 " + wizard.Name + " es: " + wizard.TotalDamage() + " 🗡");
            Console.WriteLine("La protección total de 🧙 " + wizard.Name + " es: " + wizard.TotalProtection() + " 🛡");
            Console.WriteLine();

            wizard.UnEquip(magicStaff);
            Console.WriteLine();
            wizard.Equip(sword);
            wizard.Equip(shield);
            Console.WriteLine("Se añadieron los items: " + sword.Name + " y " + shield.Name + " al inventario de " + wizard.Name);
            Console.WriteLine("El daño total que causa 🧙 " + wizard.Name + " ahora es: " + wizard.TotalDamage() + " 🗡");
            Console.WriteLine("La protección total de 🧙 " + wizard.Name + " ahora es: " + wizard.TotalProtection() + " 🛡");
        }
예제 #30
0
    private void AddList(IReadOnlyList <string> data)
    {
        if (string.IsNullOrEmpty(data[1]))
        {
            return;
        }

        Item i = null;

        switch ((eItemType)int.Parse(data[2]))
        {
        // Weapon
        case eItemType.Sword:                   i = new OneHandSword(); break;

        case eItemType.TwoHandSword:            i = new TwoHandSword(); break;

        case eItemType.Spear:                   i = new Spear();        break;

        case eItemType.Shield:                  i = new Shield();       break;

        case eItemType.Bow:                     i = new Bow();          break;

        // Armour
        case eItemType.Helmet:                  i = new Helmet();       break;

        case eItemType.BodyArmour:              i = new BodyArmour();   break;
        }

        if (i == null)
        {
            return;
        }

        if (i.AniType == eItemType.None)
        {
            return;
        }

        int index = int.Parse(data[1]);

        switch (i.AniType)
        {
        case eItemType.None:        LogMessage.LogError("Item Error" + i.Name); break;

        case eItemType.Helmet:      _codeList[(int)eCodeType.Helmet].Add(_codeList[(int)eCodeType.Helmet].Count, index); break;

        case eItemType.BodyArmour:  _codeList[(int)eCodeType.Bodyarmour].Add(_codeList[(int)eCodeType.Bodyarmour].Count, index); break;

        default:                    _codeList[(int)eCodeType.Weapon].Add(_codeList[(int)eCodeType.Weapon].Count, index); break;
        }

        i.Init(data);

        int abilNum;

        int.TryParse(data[14], out abilNum);

        if (abilNum != 0)
        {
            i.Ability = _abilMgr.GetAbility(abilNum);
        }

        _itemList.Add(index, i);
    }
예제 #31
0
 public void Setup()
 {
     this.bow = new Bow(0, 50);
 }
예제 #32
0
        public Raider()
            : base(AIType.AI_Melee, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Title = "the raider";
            Hue   = Utility.RandomSkinHue();
            Utility.AssignRandomHair(this);

            SetStr(150, 200);
            SetDex(125, 150);
            SetInt(95, 110);

            SetHits(400, 650);
            SetDamage(21, 28);

            if (Female = Utility.RandomBool())
            {
                Body = 0x191;
                Name = NameList.RandomName("female");
                EquipItem(new Skirt(Utility.RandomNeutralHue()));
            }
            else
            {
                Body = 0x190;
                Name = NameList.RandomName("male");
                EquipItem(new ShortPants(Utility.RandomNeutralHue()));
            }

            SetDamageType(ResistanceType.Physical, 100);

            SetResistance(ResistanceType.Physical, 45, 55);
            SetResistance(ResistanceType.Fire, 45, 55);
            SetResistance(ResistanceType.Cold, 45, 55);
            SetResistance(ResistanceType.Poison, 45, 55);
            SetResistance(ResistanceType.Energy, 45, 55);

            SetSkill(SkillName.MagicResist, 50.0, 75.5);
            SetSkill(SkillName.Archery, 90.0, 105.5);
            SetSkill(SkillName.Tactics, 90.0, 105.5);
            SetSkill(SkillName.Anatomy, 90.0, 105.5);

            Fame  = 7500;
            Karma = -7500;

            SetWearable(new TricorneHat());
            SetWearable(new LeatherArms());
            SetWearable(new FancyShirt());
            SetWearable(new Cutlass());
            SetWearable(new Boots(Utility.RandomNeutralHue()));
            SetWearable(new GoldEarrings());

            Item bow;

            switch (Utility.Random(4))
            {
            default:
            case 0: bow = new CompositeBow(); PackItem(new Arrow(25)); break;

            case 1: bow = new Crossbow(); PackItem(new Bolt(25)); break;

            case 2: bow = new Bow(); PackItem(new Arrow(25)); break;

            case 3: bow = new HeavyCrossbow(); PackItem(new Bolt(25)); break;
            }

            SetWearable(bow);

            ControlSlots = 0;
        }
예제 #33
0
파일: Player.cs 프로젝트: futureforge/Rohde
 void Start()
 {
     instance = this;
     bow      = transform.Find("Bow").GetComponent <Bow>();
 }
예제 #34
0
        public override void GenerateLoot()
        {
            AddLoot(LootPack.FilthyRich, 5);
            AddLoot(LootPack.HighScrolls, 3);
            AddLoot(LootPack.MedScrolls, 4);
            AddLoot(LootPack.LowScrolls, 6);
            AddLoot(LootPack.Gems, 5);

            if (Utility.RandomDouble() < 0.20)
            {
                BaseWeapon weapon = Loot.RandomWeapon(true);
                switch (Utility.Random(33))
                {
                case 0: weapon = new BattleAxe(); break;

                case 1: weapon = new ExecutionersAxe(); break;

                case 2: weapon = new LargeBattleAxe(); break;

                case 3: weapon = new WarAxe(); break;

                case 4: weapon = new Bow(); break;

                case 5: weapon = new Crossbow(); break;

                case 6: weapon = new HeavyCrossbow(); break;

                case 7: weapon = new WarHammer(); break;

                case 8: weapon = new WarMace(); break;

                case 9: weapon = new Bardiche(); break;

                case 10: weapon = new Halberd(); break;

                case 11: weapon = new Spear(); break;

                case 12: weapon = new QuarterStaff(); break;

                case 13: weapon = new Katana(); break;

                case 14: weapon = new Longsword(); break;

                case 15: weapon = new VikingSword(); break;

                case 16: weapon = new CompositeBow(); break;

                case 17: weapon = new CrescentBlade(); break;

                case 18: weapon = new DoubleBladedStaff(); break;

                case 19: weapon = new Lance(); break;

                case 20: weapon = new PaladinSword(); break;

                case 21: weapon = new Scythe(); break;

                case 22: weapon = new Daisho(); break;

                case 23: weapon = new Lajatang(); break;

                case 24: weapon = new NoDachi(); break;

                case 25: weapon = new Tetsubo(); break;

                case 26: weapon = new Yumi(); break;

                case 27: weapon = new ElvenCompositeLongbow(); break;

                case 28: weapon = new OrnateAxe(); break;

                case 29: weapon = new RadiantScimitar(); break;

                case 30: weapon = new WarCleaver(); break;

                case 31: weapon = new WildStaff(); break;

                default: weapon = new DiamondMace(); break;
                }

                BaseRunicTool.ApplyAttributesTo(weapon, 5, 35, 50);
                weapon.Hue = 1461;

                PackItem(weapon);
            }

            if (Utility.RandomDouble() < 0.20)
            {
                BaseArmor armor = Loot.RandomArmor(true);
                switch (Utility.Random(5))
                {
                case 0: armor = new CrusaderGauntlets(); break;

                case 1: armor = new CrusaderGorget(); break;

                case 2: armor = new CrusaderLeggings(); break;

                case 3: armor = new CrusaderSleeves(); break;

                default: armor = new CrusaderBreastplate(); break;
                }

                BaseRunicTool.ApplyAttributesTo(armor, 5, 35, 50);
                armor.Hue = 1461;

                PackItem(armor);
            }

            if (Utility.RandomDouble() < 0.20)
            {
                BaseClothing clothing = Loot.RandomClothing(true);
                BaseRunicTool.ApplyAttributesTo(clothing, 5, 35, 50);
                clothing.Hue = 1461;

                PackItem(clothing);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseShield shield = new MetalKiteShield();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(shield, 5, 35, 50);
                }
                shield.Hue = 1461;

                PackItem(shield);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel bracelet = new GoldBracelet();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(bracelet, 5, 35, 50);
                }
                bracelet.Hue = 1461;

                PackItem(bracelet);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel earrings = new GoldEarrings();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(earrings, 5, 35, 50);
                }
                earrings.Hue = 1461;

                PackItem(earrings);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel necklace = new GoldNecklace();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(necklace, 5, 35, 50);
                }
                necklace.Hue = 1461;

                PackItem(necklace);
            }

            if (Utility.RandomDouble() < 0.10)
            {
                BaseJewel ring = new GoldRing();
                if (Core.AOS)
                {
                    BaseRunicTool.ApplyAttributesTo(ring, 5, 35, 50);
                }
                ring.Hue = 1461;

                PackItem(ring);
            }
        }
예제 #35
0
        public override void BuildEquipment()
        {
            Item weapon = null;

            switch (TribeType)
            {
            default:
            case EodonTribe.Jukari:
                weapon     = new Pickaxe();
                weapon.Hue = 1175;
                if (Female)
                {
                    SetWearable(new LeatherShorts(), 1175);
                    SetWearable(new LeatherBustierArms(), 1175);
                }
                else
                {
                    SetWearable(new LeatherLegs(), 1175);
                    SetWearable(new BodySash(), 1175);
                }
                SetWearable(new Torch());
                break;

            case EodonTribe.Kurak:
                weapon = new Tekagi();
                SetWearable(new LeatherDo());
                SetWearable(new PlateMempo(), 1192);
                SetWearable(new ShortPants(), 1192);
                SetWearable(new Sandals(), 1192);
                break;

            case EodonTribe.Barrab:
                weapon = new Spear();
                SetWearable(new PlateDo(), 1828);
                SetWearable(new Obi(), 1828);
                SetWearable(new PlateSuneate(), 1828);
                SetWearable(new DecorativePlateKabuto(), 1834);
                SetWearable(new SilverEarrings());
                SetWearable(new Sandals(), 1828);
                break;

            case EodonTribe.Barako:
                if (Female)
                {
                    weapon = new Maul();
                    SetWearable(new DeerMask(), 2414);
                }
                else
                {
                    weapon = new WarMace();
                    SetWearable(new BearMask(), 2414);
                }
                weapon.Hue = 2414;
                SetWearable(new StuddedChest(), 2414);
                SetWearable(new StuddedArms(), 2414);
                SetWearable(new StuddedLegs(), 2414);
                SetWearable(new StuddedGorget(), 2414);
                SetWearable(new LeatherNinjaMitts(), 2414);
                SetWearable(new Boots(), 2414);
                break;

            case EodonTribe.Urali:
                SetWearable(new DragonChest(), 2576);
                SetWearable(new LeatherJingasa(), 2576);
                SetWearable(new MetalShield(), 2576);
                SetWearable(new Waraji(), 2576);
                SetWearable(new ChainLegs(), 2576);
                break;

            case EodonTribe.Sakkhra:
                weapon     = new Bow();
                weapon.Hue = 2125;
                if (Female)
                {
                    SetWearable(new LeatherBustierArms(), 2128);
                    SetWearable(new LeatherSkirt(), 2125);
                }
                else
                {
                    SetWearable(new LeatherChest(), 2128);
                    SetWearable(new SkullCap(), 2125);
                    SetWearable(new Kilt(), 2125);
                }
                SetWearable(new ThighBoots(), 2129);
                break;
            }

            if (weapon != null)
            {
                weapon.LootType = LootType.Blessed;
                SetWearable(weapon);
            }
        }
예제 #36
0
        public GrimmochDrummel() : base(AIType.AI_Archer, FightMode.Closest, 10, 1, 0.2, 0.4)
        {
            Title = "the Cursed";

            Hue  = 0x8596;
            Body = 0x190;
            Name = "Grimmoch Drummel";

            HairItemID = 0x204A;                //Krisna

            Bow bow = new Bow();

            bow.Movable = false;
            AddItem(bow);

            AddItem(new Boots(0x8A4));
            AddItem(new BodySash(0x8A4));

            Backpack backpack = new Backpack();

            backpack.Movable = false;
            AddItem(backpack);

            LeatherGloves gloves = new LeatherGloves();
            LeatherChest  chest  = new LeatherChest();

            gloves.Hue = 0x96F;
            chest.Hue  = 0x96F;

            AddItem(gloves);
            AddItem(chest);

            SetStr(111, 120);
            SetDex(151, 160);
            SetInt(41, 50);

            SetHits(180, 207);
            SetMana(0);

            SetDamage(13, 16);

            SetResistance(ResistanceType.Physical, 35, 45);
            SetResistance(ResistanceType.Fire, 25, 30);
            SetResistance(ResistanceType.Cold, 45, 55);
            SetResistance(ResistanceType.Poison, 30, 40);
            SetResistance(ResistanceType.Energy, 20, 25);

            SetSkill(SkillName.Archery, 90.1, 110.0);
            SetSkill(SkillName.Swords, 60.1, 70.0);
            SetSkill(SkillName.Tactics, 90.1, 100.0);
            SetSkill(SkillName.MagicResist, 60.1, 70.0);
            SetSkill(SkillName.Anatomy, 90.1, 100.0);

            Fame  = 5000;
            Karma = -1000;

            PackItem(new Arrow(40));

            if (3 > Utility.Random(100))
            {
                PackItem(new FireHorn());
            }

            if (1 > Utility.Random(3))
            {
                PackItem(Loot.RandomGrimmochJournal());
            }
        }
예제 #37
0
파일: Arrow.cs 프로젝트: toth3max/PodVR
    void OnTriggerEnter(Collider other)
    {
		Debug.Log ("other: "+other.name);

        if (other.GetComponent<Bow>() && !aiming)
        {
            Bow bow = other.GetComponent<Bow>();
			myBow = bow;

			if (isPickedUp && bow.isPickedUp)
            {
				bow.currentArrow = this;
                aiming = true;
				targetToLookAt = transform.parent;
				transform.parent = bow.transform;
				attachPoint = transform.localPosition;
				transform.localPosition = Vector3.zero;
				myBowsPicker = myBow.myTransform.parent.GetComponent<ObjectPicker> ();
            }
        }
    }