示例#1
0
 public Player(string name, int hp, int attack, int deffence, RaceType type)
 {
     this.Name           = name;
     this.HitPoints      = hp;
     this.DeffencePoints = deffence;
     this.AttackPoints   = attack;
 }
示例#2
0
        private IPlayer ParsePlayer(int index)
        {
            // identifier, slottype are wrong?? weird values
            int      identifier = _input.ReadInt();
            SlotType slotType   = (SlotType)_input.ReadInt();

            PlayerType playerType = (PlayerType)_input.ReadByte();
            RaceType   raceType   = (RaceType)_input.ReadByte();
            byte       forceId    = _input.ReadByte();

            // name is missing 4 characters with UTF8 encoding means 4 bytes...
            String name = parseString(PLAYER_NAME_SIZE);

            ColourType colourType = ColourType.Unknown;
            byte       spot       = 0;

            if (index < 8)
            {
                int colourOffset = PLAYER_COLOUR_OFFSET + (index * 4);
                colourType = (ColourType)_data[colourOffset];

                int spotOffset = PLAYER_SPOT_OFFSET + index;
                spot = _data[spotOffset];
            }


            return(new Player(identifier, slotType, playerType, raceType, forceId, name, colourType, spot));
        }
示例#3
0
        public void AddChar(uint charID, string charName, RaceType charRace, uint cExp, JobType job, byte pendingDeletion)
        {
            this.numberOfChars++;

            byte[] tempdata = new byte[this.data.Length + 47];

            this.data.CopyTo(tempdata, 0);
            this.data = tempdata;
            int currentPos = 40;

            this.PutByte(this.numberOfChars, (ushort)currentPos);

            currentPos = 41 + ((this.numberOfChars - 1) * 46);

            this.PutUInt(charID, (ushort)currentPos);

            if (charName.Length > 16) charName = Global.SetStringLength(charName, 16);
            this.PutString(charName, (ushort)(currentPos + 4));

            this.PutByte((byte)charRace, (ushort)(currentPos + 4 + 34));

            this.PutUInt(cExp, (ushort)(currentPos + 4 + 34 + 1));

            this.PutByte((byte)job, (ushort)(currentPos + 4 + 34 + 1 + 4));

            this.PutByte(pendingDeletion, (ushort)(currentPos + 4 + 34 + 1 + 4 + 1));
        }
示例#4
0
    public Hero SpawnHero(RaceType raceType, Vector3 pos)
    {
        List <HeroBase> heroList = m_RaceTypeDict[raceType];
        int             ran      = Random.Range(1, heroList.Count);

        return(SpawnHero(ran, pos));
    }
        private PlayerMobile CreateCharacter(Genre genre, RaceType race)
        {
            var character = new PlayerMobile(0);

            if (genre == Genre.Female)
            {
                character.Flags |= Flags.Female;
            }

            character.Race = race;

            if (genre == Genre.Female)
            {
                character.Equipment[(int)Layer.Shoes] = CreateItem(0x1710, 0x0384);
                character.Equipment[(int)Layer.Pants] = CreateItem(0x1531, CurrentColorOption[Layer.Pants].Item2);
                character.Equipment[(int)Layer.Shirt] = CreateItem(0x1518, CurrentColorOption[Layer.Shirt].Item2);
            }
            else
            {
                character.Equipment[(int)Layer.Shoes] = CreateItem(0x1710, 0x0384);
                character.Equipment[(int)Layer.Pants] = CreateItem(0x152F, CurrentColorOption[Layer.Pants].Item2);
                character.Equipment[(int)Layer.Shirt] = CreateItem(0x1518, CurrentColorOption[Layer.Shirt].Item2);
            }

            return(character);
        }
        private IPlayer ParsePlayer(int index)
        {
            int      identifier = _input.ReadInt();
            SlotType slotType   = (SlotType)_input.ReadInt();

            PlayerType playerType = (PlayerType)_input.ReadByte();
            RaceType   raceType   = (RaceType)_input.ReadByte();
            byte       forceId    = _input.ReadByte();

            String name = parseString(PLAYER_NAME_SIZE);

            ColourType colourType = ColourType.Unknown;
            byte       spot       = 0;

            if (index < 8)
            {
                int colourOffset = PLAYER_COLOUR_OFFSET + (index * 4);
                colourType = (ColourType)_data[colourOffset];

                int spotOffset = PLAYER_SPOT_OFFSET + index;
                spot = _data[spotOffset];
            }

            return(new Player(identifier, slotType, playerType, raceType, forceId, name, colourType, spot));
        }
示例#7
0
        private static void createRace(RaceType race)
        {
            if (!raceBank.ContainsKey(race))
            {
                switch (race)
                {
                case RaceType.Aasimar: raceBank.Add(race, new RaceAasimar()); break;

                case RaceType.Changelin: raceBank.Add(race, new RaceChangelin()); break;

                case RaceType.DemiElf: raceBank.Add(race, new RaceDemiElfe()); break;

                case RaceType.DemiOrc: raceBank.Add(race, new RaceDemiOrc()); break;

                case RaceType.Drakeide: raceBank.Add(race, new RaceDrake()); break;

                case RaceType.Drow: raceBank.Add(race, new RaceDrow()); break;

                case RaceType.ElfLune: raceBank.Add(race, new RaceElfeLune()); break;

                case RaceType.Githzerai: raceBank.Add(race, new RaceGithzerai()); break;

                case RaceType.Halfelin: raceBank.Add(race, new RaceHalfelin()); break;

                case RaceType.HautElf: raceBank.Add(race, new RaceHautElf()); break;

                case RaceType.Humain: raceBank.Add(race, new RaceHumain()); break;

                case RaceType.Tiefelin: raceBank.Add(race, new RaceTiefelin()); break;
                }
            }
        }
示例#8
0
    public static List <BuildingType> GetAllBuildingTypesOfRaceType(RaceType raceType)
    {
        List <BuildingType> result = new List <BuildingType>();

        switch (raceType)
        {
        case RaceType.Terran:
        {
            result.Add(BuildingType.Terran_Barrack);
            result.Add(BuildingType.Terran_SniperHouse);
            result.Add(BuildingType.Terran_ArtilleryLab);
            result.Add(BuildingType.Terran_MysterySchool);
            result.Add(BuildingType.Terran_Aviary);
            result.Add(BuildingType.Terran_Fortress);
            result.Add(BuildingType.Terran_Church);
            result.Add(BuildingType.Terran_Temple);
        }
        break;

        case RaceType.Orc:
        {
            result.Add(BuildingType.Orc_WarriorHall);
            result.Add(BuildingType.Orc_TrollHouse);
            result.Add(BuildingType.Orc_ThePound);
            result.Add(BuildingType.Orc_ShamanTent);
            result.Add(BuildingType.Orc_AnimalFarm);
            result.Add(BuildingType.Orc_WyvernCamp);
            result.Add(BuildingType.Orc_OrcFactory);
            result.Add(BuildingType.Orc_TheTaurenVine);
        }
        break;
        }
        return(result);
    }
        private void UpdateEquipments()
        {
            bool     isFemale = _femaleRadio.IsChecked;
            RaceType race     = GetSelectedRace();
            Layer    layer;

            CharacterCreationValues.ComboContent content;

            _character.Hue = CurrentColorOption[Layer.Invalid].Item2;

            if (!isFemale && race != RaceType.ELF)
            {
                layer   = Layer.Beard;
                content = CharacterCreationValues.GetFacialHairComboContent(race);

                Item iti = CreateItem(content.GetGraphic(CurrentOption[layer]), CurrentColorOption[layer].Item2, layer);

                _character.PushToBack(iti);
            }

            layer   = Layer.Hair;
            content = CharacterCreationValues.GetHairComboContent(isFemale, race);

            Item it = CreateItem(content.GetGraphic(CurrentOption[layer]), CurrentColorOption[layer].Item2, layer);

            _character.PushToBack(it);
        }
        private void Race_ValueChanged(object sender, EventArgs e)
        {
            CurrentColorOption.Clear();
            HandleGenreChange();
            RaceType           race  = GetSelectedRace();
            CharacterListFlags flags = World.ClientFeatures.Flags;
            LockedFeatureFlags locks = World.ClientLockedFeatures.Flags;

            bool allowElf = (flags & CharacterListFlags.CLF_ELVEN_RACE) != 0 && (locks & LockedFeatureFlags.MondainsLegacy) != 0;

            bool allowGarg = (locks & LockedFeatureFlags.StygianAbyss) != 0;

            if (race == RaceType.ELF && !allowElf)
            {
                _nextButton.IsEnabled = false;
                _nextButton.Hue       = 944;
            }
            else if (race == RaceType.GARGOYLE && !allowGarg)
            {
                _nextButton.IsEnabled = false;
                _nextButton.Hue       = 944;
            }
            else
            {
                _nextButton.IsEnabled = true;
                _nextButton.Hue       = 0;
            }
        }
示例#11
0
 public Character(string name, RaceType race, ClassType charClass, int worldLocationID)
 {
     _name            = name;
     _race            = race;
     _charClass       = charClass;
     _worldLocationID = worldLocationID;
 }
示例#12
0
 public Player(string name, RaceType raceType, Position position)
 {
     this.Name        = name;
     this.RaceType    = raceType;
     this.Position    = position;
     this.GameObjects = new List <IGameObject>();
 }
 protected NPCS(int id, string name, RaceType race, string description)
 {
     Id          = id;
     Name        = name;
     Race        = race;
     Description = description;
 }
示例#14
0
        public static List <RaceType> GetRaceTypes()
        {
            var raceTypes = new List <RaceType>();

            IEnumerable <string> lines = File.ReadLines("RaceTypes.txt");

            foreach (string line in lines)
            {
                if (line.StartsWith("--"))
                {
                    continue;
                }
                string[] splitLine            = line.Split(',');
                int      id                   = splitLine[0].ToInt32();
                string   name                 = splitLine[1];
                float    farmingRate          = splitLine[2].ToFloat();
                int      growthRateModifier   = splitLine[3].ToInt32();
                float    workerProductionRate = splitLine[4].ToFloat();
                float    farmerProductionRate = splitLine[5].ToFloat();
                RaceType raceType             = RaceType.Create(id, name, farmingRate, growthRateModifier, workerProductionRate, farmerProductionRate);
                raceTypes.Add(raceType);
            }

            return(raceTypes);
        }
示例#15
0
        /// <summary>
        /// 通过传递参数创建实例类型
        /// </summary>
        /// <param name="raceType"></param>
        /// <returns></returns>
        public static IRace GetRace(RaceType raceType)
        {
            IRace race = null;

            switch (raceType)
            {
            case RaceType.Human:
                race = new Human();
                break;

            case RaceType.NE:
                race = new NE();
                break;

            case RaceType.ORC:
                race = new ORC();
                break;

            case RaceType.Undead:
                race = new Undead();
                break;

            default:
                throw new Exception($"种族{raceType}不存在");
            }
            return(race);
        }
        public static IRace CreateRace(IConfigurationRoot config)
        {
            var      raceConfig = config["RaceType"];
            RaceType raceType   = (RaceType)Enum.Parse(typeof(RaceType), raceConfig);

            return(CreateRace(raceType));
        }
示例#17
0
        public async Task <EntityState> Update(string id, RaceType raceType)
        {
            using (ApplicationDbContext db = new ApplicationDbContext())
            {
                db.Entry(raceType).State = EntityState.Modified;

                try
                {
                    await db.SaveChangesAsync();
                }
                catch (DbUpdateConcurrencyException)
                {
                    if (db.RaceTypes.Count(e => e.Id == id) == 0)
                    {
                        return(EntityState.Unchanged);
                    }
                    else
                    {
                        throw;
                    }
                }

                return(db.Entry(raceType).State);
            }
        }
示例#18
0
        public static IRace CreateInstance(RaceType type)
        {
            IRace iRace = null;

            switch (type)
            {
            case RaceType.Human:
                iRace = new Human("123");
                break;

            case RaceType.NE:
                iRace = new NE();
                break;

            case RaceType.ORC:
                iRace = new ORC();
                break;

            case RaceType.Undead:
                iRace = new Undead();
                break;

            case RaceType.Five:
                iRace = new Five();
                break;

            default:
                throw new Exception("wrong RaceType");
            }
            return(iRace);
        }
        public static IRace CreateRaceConfig()
        {
            RaceType raceType = (RaceType)Enum.Parse(typeof(RaceType), IRacTypeConfig);

            IRace iRace = null;

            switch (raceType)
            {
            case RaceType.Human:
                iRace = new Human();
                break;

            case RaceType.Undead:
                iRace = new Undead();
                break;

            case RaceType.ORC:
                iRace = new ORC();
                break;

            case RaceType.NE:
                iRace = new NE();
                break;

            default:
                throw new Exception("wrong raceType");
            }
            return(iRace);
        }
示例#20
0
        public void AddChar(uint charID, string charName, RaceType charRace, uint cExp, JobType job, byte pendingDeletion)
        {
            this.numberOfChars++;

            byte[] tempdata = new byte[this.data.Length + 47];

            this.data.CopyTo(tempdata, 0);
            this.data = tempdata;
            int currentPos = 40;

            this.PutByte(this.numberOfChars, (ushort)currentPos);

            currentPos = 41 + ((this.numberOfChars - 1) * 46);

            this.PutUInt(charID, (ushort)currentPos);

            if (charName.Length > 16)
            {
                charName = Global.SetStringLength(charName, 16);
            }
            this.PutString(charName, (ushort)(currentPos + 4));

            this.PutByte((byte)charRace, (ushort)(currentPos + 4 + 34));

            this.PutUInt(cExp, (ushort)(currentPos + 4 + 34 + 1));

            this.PutByte((byte)job, (ushort)(currentPos + 4 + 34 + 1 + 4));

            this.PutByte(pendingDeletion, (ushort)(currentPos + 4 + 34 + 1 + 4 + 1));
        }
    private void Awake()
    {
        this.LoadGlobalConfig();

        CustomTypes.Register();
        this.MyRaceType = RaceType.Terran;
    }
示例#22
0
 public Character(string name, RaceType race, int locationID)
 {
     Name       = name;
     _race      = race;
     LocationID = locationID;
     _inventory = new List <InanimateObject>();
 }
        /// <summary>
        /// 细节没有消失  只是转移
        /// 转移了矛盾,并没有消除矛盾
        ///
        /// 集中了矛盾
        /// </summary>
        /// <param name="raceType"></param>
        /// <returns></returns>
        public static IRace CreateRace(RaceType raceType)
        {
            IRace iRace = null;

            switch (raceType)
            {
            case RaceType.Human:
                iRace = new Human();
                break;

            case RaceType.Undead:
                iRace = new Undead();
                break;

            case RaceType.ORC:
                iRace = new ORC();
                break;

            case RaceType.NE:
                iRace = new NE();
                break;

            //增加一个分支
            default:
                throw new Exception("wrong raceType");
            }
            return(iRace);
        }
        public static IRace CreateInstance(RaceType raceType)
        {
            IRace race = null;

            switch (raceType)
            {
            case RaceType.Human:
                race = new Human();
                break;

            case RaceType.NE:
                race = new NE();
                break;

            case RaceType.ORC:
                race = new ORC();
                break;

            case RaceType.Undead:
                race = new Undead();
                break;

            default:
                throw new Exception("wrong raceType");
            }

            return(race);
        }
示例#25
0
        private void MapToTimeTrial(Calendar dbentity, CalendarViewModel model)
        {
            RaceType raceTypeEntity = _context.RaceType.FirstOrDefault(a => a.Name == "Training");

            if (dbentity.TimeTrials.Any())
            {
                dbentity.TimeTrials
                .ToList()
                .ForEach(a =>
                {
                    a.RaceTypeId       = raceTypeEntity.Id;
                    a.UpdatedTimestamp = DateTime.Now;
                    a.UpdatedUserId    = model.SessionUserId;
                }
                         );
            }
            else
            {
                dbentity.TimeTrials.Add(new TimeTrial
                {
                    RaceTypeId    = raceTypeEntity.Id,
                    CalendarId    = dbentity.Id,
                    CreatedUserId = model.SessionUserId
                });
            }
        }
示例#26
0
 public Coach(string firstName, string lastName, int id, int age, int heigth, int weigth,
              RaceType raceType, ReligionType religionType, EyeColorType eyeColorType,
              FaceShapeType faceShape, HairColorType hairColor, BodyShapeType bodyShape, int coachCapability)
     : base(firstName, lastName, id, age, heigth, weigth, raceType, religionType, eyeColorType, faceShape, hairColor, bodyShape)
 {
     this.CoachCapability = coachCapability;
 }
示例#27
0
    public List <HeroBase> GetRaceHeroList(RaceType raceType)
    {
        List <HeroBase> list = null;

        m_RaceTypeDict.TryGetValue(raceType, out list);
        return(list);
    }
示例#28
0
    public CommonStat(int _id, RaceType _race, WealthType _wealth, string _name, string _explanation, int _gender, int _gold,
                      float _thirstyTick, float _hungryTick, float _sleepTick, float _tourTick, float _funTick, float _convenienceTick, float _equipmentTick,
                      float _tickAllMult, float _tickTime, Traveler _owner)
    {
        id          = _id;
        race        = _race;
        wealth      = _wealth;
        name        = _name;
        explanation = _explanation;
        gender      = _gender;
        gold        = _gold;

        thirsty     = 0.0f;
        hungry      = 0.0f;
        sleep       = 0.0f;
        tour        = 0.0f;
        fun         = 0.0f;
        convenience = 0.0f;
        equipment   = 0.0f;
        health      = 0.0f;
        ///desire

        thirstyTick     = _thirstyTick;
        hungryTick      = _hungryTick;
        sleepTick       = _sleepTick;
        tourTick        = _tourTick;
        funTick         = _funTick;
        convenienceTick = _convenienceTick;
        equipmentTick   = _equipmentTick;
        ///desireTick

        tickAllMult = _tickAllMult;
        tickTime    = _tickTime;
        owner       = _owner;
    }
    public void StartGame()
    {
        Transform raceSelect = GameObject.Find("HomePage").transform.FindChild("RaceSelect");

        if (raceSelect != null)
        {
            UIPopupList popupList = raceSelect.gameObject.GetComponent <UIPopupList>();
            if (popupList.value == "人族")
            {
                this.MyRaceType = RaceType.Terran;
            }
            else if (popupList.value == "兽族")
            {
                this.MyRaceType = RaceType.Orc;
            }
        }
        this.ViewController.DestroyHomePage(true);
        this.ViewController.DestroyShadowCover(true);
        GameObject gameSceneCtrl = (GameObject)Instantiate(Resources.Load("GameScene/GameSceneController"));

        gameSceneCtrl.transform.localPosition = new Vector3(0, 0, 0);
        gameSceneCtrl.name       = "GameSceneController";
        this.GameSceneController = gameSceneCtrl.GetComponent <GameSceneController>();
        this.GameSceneController.GameController = this;
        this.GameSceneController.MyFactionType  = this.MyFactionType;
        this.GameSceneController.MyRaceType     = this.MyRaceType;
    }
示例#30
0
        /// <summary>
        /// Updates or creates a resource based on the resource identifier. The PUT operation is used to update or create a resource by identifier.  If the resource doesn't exist, the resource will be created using that identifier.  Additionally, natural key values cannot be changed using this operation, and will not be modified in the database.  If the resource &quot;id&quot; is provided in the JSON body, it will be ignored as well.
        /// </summary>
        /// <param name="id">A resource identifier specifying the resource to be updated.</param>
        /// <param name="IfMatch">The ETag header value used to prevent the PUT from updating a resource modified by another consumer.</param>
        /// <param name="body">The JSON representation of the &quot;raceType&quot; resource to be updated.</param>
        /// <returns>A RestSharp <see cref="IRestResponse"/> instance containing the API response details.</returns>
        public IRestResponse PutRaceType(string id, string IfMatch, RaceType body)
        {
            var request = new RestRequest("/raceTypes/{id}", Method.PUT);

            request.RequestFormat = DataFormat.Json;

            request.AddUrlSegment("id", id);
            // verify required params are set
            if (id == null || body == null)
            {
                throw new ArgumentException("API method call is missing required parameters");
            }
            request.AddHeader("If-Match", IfMatch);
            request.AddBody(body);
            request.Parameters.First(param => param.Type == ParameterType.RequestBody).Name = "application/json";
            var response = client.Execute(request);

            var location = response.Headers.FirstOrDefault(x => x.Name == "Location");

            if (location != null && !string.IsNullOrWhiteSpace(location.Value.ToString()))
            {
                body.id = location.Value.ToString().Split('/').Last();
            }
            return(response);
        }
示例#31
0
    //反撃不可フラグは「天狗のカメラ」の武器名だけで判定する

    //コンストラクタ
    public Weapon(string name, string annotation, string feature, WeaponType type,
                  SkillLevel skillLevel, int[] parameter, int range, bool nfs, bool yuusha, bool isCloseAttack,
                  bool isPrivate, string ownerName, StatusType statusType, int amount, RaceType slayer, bool isChaseInvalid)
    {
        this.name           = name;
        this.annotationText = annotation;
        this.featureText    = feature;
        this.type           = type;
        this.skillLevel     = skillLevel;

        this.attack       = parameter[0];
        this.hitRate      = parameter[1];
        this.criticalRate = parameter[2];
        this.delay        = parameter[3];
        this.endurance    = parameter[4];
        this.maxEndurance = parameter[4];
        this.price        = parameter[5];
        this.range        = range;

        this.isNfs         = nfs;
        this.isYuusha      = yuusha;
        this.isCloseAttack = isCloseAttack;

        this.isPrivate = isPrivate;
        this.ownerName = ownerName;

        this.statusType = statusType;
        this.amount     = amount;

        this.slayer = slayer;

        this.isChaseInvalid = isChaseInvalid;
    }
示例#32
0
 /// <summary>
 /// instantiate a guest and set intial properties
 /// </summary>
 /// <param name="name">guest name</param>
 /// <param name="gender">guest gender</param>
 /// <param name="race">guest race</param>
 /// <param name="currentRoomNumber">room location as an index of the hall array</param>
 public Staff(
     string name,
     GenderType gender,
     RaceType race,
     int currentRoomNumber)
     : base(name, gender, race, currentRoomNumber)
 {
 }
示例#33
0
 /// <summary>
 /// instantiate a player and set initial properties
 /// </summary>
 /// <param name="name">player name</param>
 /// <param name="gender">player gender</param>
 /// <param name="race">player race</param>
 /// <param name="currentRoomNumber">room location as an index of the hall array</param>
 public Player(
     string name,
     GenderType gender,
     RaceType race,
     int currentRoomNumber)
     : base(name, gender, race, currentRoomNumber)
 {
     _lives = 1;
 }
示例#34
0
文件: Player.cs 项目: hjjohny/szfgy1
 //private List<Town> _towns { get; set; }
 public Player(String name_,RaceType race_,
               Int32 startMoney_,Int32 startIncome_)
 {
     _name = name_;
     _race = race_;
     _money = startMoney_;
     _income = startIncome_;
     _points = 0;
     _units = new List<Unit>();
     //_towns = new List<Town>();
 }
示例#35
0
 /// <summary>
 /// instantiate a character and set intial properties
 /// </summary>
 /// <param name="name">character name</param>
 /// <param name="gender">character gender</param>
 /// <param name="race">character race</param>
 /// <param name="currentRoomNumber">room location as an index of the hall array</param>
 public Character(
     string name,
     GenderType gender,
     RaceType race,
     int currentRoomNumber)
 {
     _name = name;
     _gender = gender;
     _race = race;
     _currentRoomNumber = currentRoomNumber;
 }
示例#36
0
 public SoftwareEngineer(
     string name,
     int age,
     HairColorType hairColor,
     EyesColorType eyesColor,
     FaceShapeType faceShape,
     RaceType race,
     GenderType gender,
     ReligionType religion)
     : base(name, age, hairColor, eyesColor, faceShape, race, gender, religion)
 {
 }
示例#37
0
        public bool AddNomination(Dog dog, RaceType raceType, int distanceInMetres)
        {
            if (!isValidDistanceForTrack())
            {
                return false;
            }

            var raceEvent = GetExistingRaceEvent(raceType, distanceInMetres) ??
                            new RaceEvent(this, identityGenerator.NewId(), raceType, distanceInMetres);

            nominations.Add(new Nomination(this, identityGenerator.NewId(), dog, raceEvent));
            return true;
        }
 public Waiter(
     string name, 
     int age, 
     HairColorType hairColor, 
     EyesColorType eyesColor, 
     FaceShapeType faceShape, 
     RaceType race, 
     GenderType gender, 
     ReligionType religion)
     : base(name, age, hairColor, eyesColor, faceShape, race, gender, religion)
 {
     this.isAvailable = true;
     this.orders = new Dictionary<IHuman, IRestaurantOrder>();
 }
示例#39
0
        private List<Weapon> _weapons; // TODO Sprint 3 Mod 21 - add a field/property to hold the player's weapons

        #endregion Fields

        #region Constructors

        /// <summary>
        /// instantiate a player and set intial properties
        /// </summary>
        /// <param name="name">player name</param>
        /// <param name="gender">player gender</param>
        /// <param name="race">player race</param>
        /// <param name="currentRoomNumber">room location as an index of the hall array</param>
        public Player(
            string name,
            GenderType gender,
            RaceType race,
            int currentRoomNumber)
            : base(name, gender, race, currentRoomNumber)
        {
            _lives = 1;

            // TODO Sprint 3 Mod 07b - instantiate the player's coin group list
            _coins = new List<CoinGroup>();

            // TODO Sprint 3 Mod 22 - instantiate the player's weapons list
            _weapons = new List<Weapon>();
        }
        public Human(
            string name,
            int age,
            HairColorType hairColor,
            EyesColorType eyesColor,
            FaceShapeType faceShape,
            RaceType race,
            GenderType gender,
            ReligionType religion)
            : this()
        {
            this.id = DataGenerator.GenerateUniqueId();

            this.name = name;
            this.age = age;
            this.hairColor = hairColor;
            this.faceShape = faceShape;
            this.eyesColor = eyesColor;
            this.religion = religion;
            this.gender = gender;
            this.race = race;
        }
示例#41
0
        public BaseRace(string name, string subraceName, int age, float height, int weight, int speed, 
		                 Size size, RaceType type, Gender gender)
        {
            abilityBonuses = new Dictionary<AbilityName, int> ();
            languages = new List<Language> ();
            bonusLanguages = new List<Language> ();
            traits = new List<TraitName> ();

            this.name = name;
            this.subraceName = subraceName;
            this.age = age;
            this.height = height;
            this.weight = weight;
            this.baseSpeed = speed;
            this.size = size;
            this.type = type;
            this.gender = gender;
            abilityBonuses.Add (AbilityName.Strength, 0);
            abilityBonuses.Add (AbilityName.Dexterity, 0);
            abilityBonuses.Add (AbilityName.Constitution, 0);
            abilityBonuses.Add (AbilityName.Intelligence, 0);
            abilityBonuses.Add (AbilityName.Wisdom, 0);
            abilityBonuses.Add (AbilityName.Charisma, 0);
        }
示例#42
0
 public Race(String name, RaceType raceType)
 {
     Name = name;
     RaceType = raceType;
 }
示例#43
0
文件: Unit.cs 项目: hjjohny/szfgy1
 //idő hiányában ...
 private UnitLvlDependentStats loadStats(UnitType type_,RaceType raceType_)
 {
     UnitLvlDependentStats newUnit = null;
     switch(raceType_)
     {
         case RaceType.HUMAN:
         {
             switch(type_)
             {
                 case UnitType.ATTACKER:
                 {
                     newUnit= new UnitLvlDependentStats("Kardos",7,1,30,1,18,4,0,30);
                     break;
                 }
                 case UnitType.DEFENDER:
                 {
                      newUnit= new UnitLvlDependentStats("Számszeríjász",5,4,20,1,16,5,0,30);
                     break;
                 }
                 case UnitType.SUPPORT:
                 {
                      newUnit= new UnitLvlDependentStats("Pap",3,2,15,1,12,5,5,30);
                     break;
                 }
                 case UnitType.SCOUT:
                 {
                      newUnit= new UnitLvlDependentStats("Huszár",5,2,25,1,17,7,0,30);
                     break;
                 }
             }
             break;
         }
         case RaceType.ELF:
         {
             switch (type_)
             {
                 case UnitType.ATTACKER:
                     {
                         newUnit = new UnitLvlDependentStats("Ranger", 6, 1, 27, 1, 15, 5, 0, 30);
                         break;
                     }
                 case UnitType.DEFENDER:
                     {
                         newUnit = new UnitLvlDependentStats("LombIjasz", 7, 5, 18, 1, 15, 6, 0, 30);
                         break;
                     }
                 case UnitType.SUPPORT:
                     {
                         newUnit = new UnitLvlDependentStats("Druida", 2, 1, 15, 2, 20, 6, 7, 30);
                         break;
                     }
                 case UnitType.SCOUT:
                     {
                         newUnit = new UnitLvlDependentStats("Hirnok", 4, 3, 22, 2, 25, 8, 0, 30);
                         break;
                     }
             }
             break;
         }
         case RaceType.ORC:
         {
             switch(type_)
             {
                 case UnitType.ATTACKER:
                 {
                     newUnit= new UnitLvlDependentStats("Bunkós",8,2,38,1,18,4,0,30);
                     break;
                 }
                 case UnitType.DEFENDER:
                 {
                      newUnit= new UnitLvlDependentStats("Lándzsás Goblin",3,3,25,1,16,5,0,30);
                     break;
                 }
                 case UnitType.SUPPORT:
                 {
                      newUnit= new UnitLvlDependentStats("OrkPap",5,1,15,1,12,5,4,30);
                     break;
                 }
                 case UnitType.SCOUT:
                 {
                      newUnit= new UnitLvlDependentStats("Farkas Lovas",7,1,28,1,17,6,0,30);
                     break;
                 }
             }
             break;
         }
         default:
             throw new Exception();
     }
     return newUnit;
 }
示例#44
0
文件: Unit.cs 项目: hjjohny/szfgy1
 public Unit(UnitType type_,RaceType raceType_)
 {
     InitUnit(type_, raceType_);
 }
示例#45
0
文件: Unit.cs 项目: hjjohny/szfgy1
        private void InitUnit(UnitType type_, RaceType raceType_, Point pos_=new Point())
        {
            _stats=loadStats(type_,raceType_);

            _raceType = raceType_;
            _type = type_;
            _currentLevel = 1;
            _currentHealPoint=_stats._maxHealPoint;
            _position=pos_;
            _canMove = false;
            _xp=0;
        }
 double GetWinPercent(RaceType rt)
 {
     var sc = _startersForSpecifiedBitMask.Filter((int) rt);
     int starters = sc.Count;
     int winnerCount = sc.Count(s => { return s.FinishPosition == 1; });
     return starters > 0 ? (double)winnerCount / (double)starters : 0.0;
 }
示例#47
0
 public void SetRace(RaceType race)
 {
     this.PutByte((byte)race, 58);
 }
示例#48
0
        private void generuj_Click(object sender, EventArgs e)
        {
            WholeRace wholeRace = new WholeRace();
            // skryj prvni form
            RaceType typeOfRace = new RaceType();

            var radio = getCheckedRadio();
            if (radio.Name.Equals("radioButtonFreeRace"))
            {
                typeOfRace = RaceType.freeRace;
            }
            else if (radio.Name.Equals("radioButtonTimeRace"))
            {
                typeOfRace = RaceType.timeRace;
            }
            else
            {
                typeOfRace = RaceType.lapRace;
            }
            wholeRace.minimalLapTimeInSeconds = Decimal.ToInt32(numericUpDownMinimalSeconds.Value);
            wholeRace.typOfRace = typeOfRace;
            wholeRace.numberOfLaps = Decimal.ToInt32(NumericUpDownNumberOfLaps.Value);
            wholeRace.numberOfMinutes = Decimal.ToInt32(numericUpDownNumberOfMinutes.Value);
            wholeRace.numberOfRacers = Decimal.ToInt32(numericUpDownNumberOfRacers.Value);

            this.Hide();
            // vytvor form a predej mu pocet jezdcu
            Form2 f2 = new Form2(wholeRace);
            f2.StartPosition = FormStartPosition.CenterScreen;
            f2.Width = 1333;
            f2.Height = 768;
            // zobraz tento form
            f2.ShowDialog();
        }
示例#49
0
文件: RaceRules.cs 项目: tgoyer/LORE
 public static void AssignRace(this CharacterBase character, RaceType type)
 {
     character.Race = type;
     AssignRacialSkills(character);
 }
        public Character(long AIID, int CharacterClass, int CharacterRace, int CharacterGender)
        {
            Random rng = new Random();

            // Create a random AI controlled character
            this._id = -AIID;
            this.Class = (ClassType)CharacterClass;
            this._name = ((ClassType)this.Class).ToString() + " " + AIID.ToString();
            this.Race = (RaceType)CharacterRace;
            this.Gender = (GenderType)CharacterGender;
            this.Guild = 0;
            this.Gold = 0;
            this.Team = 0;
            this.X = 0;
            this.Y = 0;
            this.Direction = 0;
            this.Health = 100;
            this.Resource = 100;
        }
示例#51
0
 /// <summary>
 /// This will retrieve an existing race event with the same raceType, distanceInMetres and share an aggregate root.        
 /// </summary>
 /// <param name="raceType"></param>
 /// <param name="distanceInMetres"></param>
 /// <returns>The race event if it exists, otherwise null</returns>
 public RaceEvent GetExistingRaceEvent(RaceType raceType, int distanceInMetres)
 {
     throw new NotImplementedException();
 }
        public Character(string ConstructionString)
        {
            string[] c = ConstructionString.Split(new string[] { "," }, StringSplitOptions.None);

            if (c.Length == 13)
            {
                this._id = long.Parse(c[0]);
                this._name = c[1];
                this.Class = (ClassType)int.Parse(c[2]);
                this.Race = (RaceType)int.Parse(c[3]);
                this.Gender = (GenderType)int.Parse(c[4]);
                this.Guild = long.Parse(c[5]);
                this.Gold = long.Parse(c[6]);
                this.Team = int.Parse(c[7]);
                this.X = int.Parse(c[8]);
                this.Y = int.Parse(c[9]);
                this.Direction = int.Parse(c[10]);
                this.Health = int.Parse(c[11]);
                this.Resource = int.Parse(c[12]);
            }
            else
            {
                throw new Exception("Badly formatted construction string");
            }
        }