Beispiel #1
0
        public Adventure Create(int id, int level)
        {
            if (_userAdventures.Count >= MaxAdventures)
            {
                return(null);
            }

            var adventure = new Adventure();

            adventure.Id = id;
            //PRZYGODY(NR,P_X)=ARMIA(A,0,TNOGI)-70
            adventure.Y         = GlobalUtils.Rand(9) + 1;
            adventure.Direction = null;
            adventure.Level     = level;

            switch (id)
            {
            case 1:
            {
                // kopalnia
                adventure.Price   = 20 * level;
                adventure.Terrain = 8;
                adventure.AddReward(RewardType.Money, level * 10000);
            }
            break;

            case 2:
            {
                // kurhan
                adventure.Price         = GlobalUtils.Rand(20 * level);
                adventure.Terrain       = 9;
                adventure.RelatedPerson = NamesGenerator.Generate();
                adventure.AddReward(RewardType.Money, level * 100);

                /*
                 *  adventures.AddReward(RewardType.Weapon, weapon);
                 *  Repeat
                 *      BRON=Rnd(MX_WEAPON)
                 *      BTYP=BRON(BRON,B_TYP)
                 *  Until BRON(BRON,B_CENA)>=1000 and BRON(BRON,BCENA)<100+LEVEL*1000 and BTYP<>5 and BTYP<>8 and BTYP<>13 and BTYP<>14 and BTYP<16
                 *  PRZYGODY(NR,P_BRON)=BRON
                 */
            }
            break;

            case 3:
            {
                // bandyci
                adventure.Price = 0;
                adventure.AddReward(RewardType.Money, 4000 + GlobalUtils.Rand(2000) + level * 100);
            }
            break;

            case 4:
            {
                // córa
                adventure.Price         = 0;
                adventure.RelatedPerson = NamesGenerator.Generate();

                /*
                 *  adventure.AddReward(RewardType.City, city.Id);
                 *  Repeat : MIASTO=Rnd(49) : Until MIASTA(MIASTO,0,M_CZYJE)<>1
                 */
            }
            break;

            default:
                break;
            }

            _userAdventures.Add(adventure);
            return(adventure);
        }