Esempio n. 1
0
 public CharClass(AttackTypes style,
                  CharTypes classe,
                  RaceTypes race,
                  EntityTypes type,
                  string name,
                  string description,
                  float attackPower,
                  float defensePower,
                  float attackSpeed,
                  float attackRange,
                  float moveSpeed,
                  float maxHealth,
                  float maxMana
                  )
 {
     this.style        = style;
     this.classe       = classe;
     this.race         = race;
     this.type         = type;
     this.attackPower  = attackPower;
     this.defensePower = defensePower;
     this.attackSpeed  = attackSpeed;
     this.attackRange  = attackRange;
     this.moveSpeed    = moveSpeed;
     this.maxHealth    = maxHealth;
     this.maxMana      = maxMana;
     this.name         = name;
     this.description  = description;
 }
Esempio n. 2
0
 public void IsVampire_Test(ActFlags actFlag, RaceTypes race, ClassTypes cls, bool expectedValue)
 {
     _ch.Act.SetBit((int)actFlag);
     _ch.CurrentRace  = race;
     _ch.CurrentClass = cls;
     Assert.That(_ch.IsVampire(), Is.EqualTo(expectedValue));
 }
Esempio n. 3
0
        private string PursuitTime(RaceStats h, RaceTypes type)
        {
            StringBuilder line = new StringBuilder();

            line.Append(";");
            if (type == RaceTypes.Pursuit)
            {
                line.Append((h.Finish - h.Start).ToString(false));
            }
            line.Append(";");
            return(line.ToString());
        }
Esempio n. 4
0
 //Function called when this character is created
 private void Awake()
 {
     //Setting the references to each of the required components
     this.charRaceTypes   = this.GetComponent <RaceTypes>();
     this.charInventory   = this.GetComponent <Inventory>();
     this.charSkills      = this.GetComponent <Skills>();
     this.charPhysState   = this.GetComponent <PhysicalState>();
     this.charCombatStats = this.GetComponent <CombatStats>();
     this.charActionList  = this.GetComponent <ActionList>();
     this.charSprites     = this.GetComponent <CharacterSprites>();
     this.charPerks       = this.GetComponent <PerkList>();
 }
Esempio n. 5
0
        public string ToString(RaceTypes type)
        {
            double[] b = null;
            switch (type)
            {
            case RaceTypes.Sprint:
            case RaceTypes.Mass_Start:
                b = new double[] { 0.0, 1.1, 1.8, 2.5 };
                break;

            case RaceTypes.Individual:
                b = new double[] { 0.0, 1.2, 2.0, 3.0 };
                break;

            case RaceTypes.Pursuit:
                b = new double[] { 0.0, 1.2, 1.6, 2.0 };
                break;
            }
            StringBuilder a = new StringBuilder();

            for (int i = 0; i < TimeStamps.Laps; i++)
            {
                for (int j = 0; j < TimeStamps.Sections; j++)
                {
                    //a.AppendFormat("{0:h\\:mm\\:ss\\.ff};", TimeStamps[i][j]);
                    a.Append(TimeStamps[i, j].Value.TotalDays.ToString() + ';');
                    if (j != 0)
                    {
                        a.Append(((b[j] - b[j - 1]) / (timeStamps[i, j].Value - timeStamps[i, j - 1].Value).TotalHours).ToString("f2"));
                        a.Append(";");
                        a.Append(staminas.stamina[bib, i * (b.Length - 1) + j - 1].ToString());
                        a.Append(";");
                    }
                }
                if (i != TimeStamps.Laps - 1)
                {
                    for (int j = 0; j < Range.Shots; j++)
                    {
                        if (Range[i, j])
                        {
                            a.Append('\u25CF');
                        }
                        else
                        {
                            a.Append('\u25CB');
                        }
                    }
                    a.Append(";");
                }
            }
            return(a.ToString());
        }
Esempio n. 6
0
        public void SetRaceType(string field, string value)
        {
            RaceTypes type = Realm.Library.Common.Extensions.EnumerationExtensions.GetEnumByName <RaceTypes>(value);

            if (field.EqualsIgnoreCase("npcfoe"))
            {
                NPCFoe = type;
            }
            if (field.EqualsIgnoreCase("npcrace"))
            {
                NPCRace = type;
            }
        }
Esempio n. 7
0
        private Globals()
        {
            _random = new Random();

            GameWorld     = GameWorld.Create();
            MovementTypes = MovementTypes.Create(new List <MovementType> {
                MovementType.Create(1, "Ground")
            });
            TerrainTypes  = TerrainTypes.Create(TerrainTypesLoader.GetTerrainTypes());
            MineralTypes  = MineralTypes.Create(MineralTypesLoader.GetMineralTypes());
            UnitTypes     = UnitTypes.Create(UnitTypesLoader.GetUnitTypes(MovementTypes));
            RaceTypes     = RaceTypes.Create(RaceTypesLoader.GetRaceTypes());
            BuildingTypes = BuildingTypesLoader.GetBuildingTypes();
        }
Esempio n. 8
0
    //Function called when this character is created
    private void Awake()
    {
        //Setting the references to each of the required components
        this.charRaceTypes   = this.GetComponent <RaceTypes>();
        this.charEquipment   = this.GetComponent <CharacterEquipment>();
        this.charSkills      = this.GetComponent <Skills>();
        this.charPhysState   = this.GetComponent <PhysicalState>();
        this.charCombatStats = this.GetComponent <CombatStats>();
        this.charActionList  = this.GetComponent <ActionList>();
        this.charModels      = this.GetComponent <CharacterModelObjs>();
        this.charPerks       = this.GetComponent <PerkList>();

        if (this.GetComponent <LevelTracker>())
        {
            this.levelTracker = this.GetComponent <LevelTracker>();
        }
    }
Esempio n. 9
0
        public void SendCreateCharacter(
            string characterName,
            RaceTypes race,
            HeroTypes hero,
            ClassTypes characterClass,
            StartBonusTypes bonus)
        {
            var d = new Dictionary <byte, object>
            {
                { (byte)GameParameters.ControlCode, GameOpCode.CreateCharacter },
                { (byte)GameParameters.Name, characterName },
                { (byte)GameParameters.Race, (int)race },
                { (byte)GameParameters.Hero, (int)hero },
                { (byte)GameParameters.StartBonus, (int)bonus },
                { (byte)GameParameters.CharacterClass, (int)characterClass }
            };

            peer.OpCustom((byte)GameOpCode.CustomOp, d, true);
        }
Esempio n. 10
0
    /// <summary>
    /// Changes the background music according to the turn.
    /// </summary>
    /// <param name="index"></param>
    public void ChangeBGM(RaceTypes turn)
    {
        if (Source.clip.Equals(_bgm))
        {
            switch (turn)
            {
                case RaceTypes.Virus:
                {
                    _bgm = _virusTurnBgm;
                }
                    break;

                case RaceTypes.WhiteBloodCell:
                {
                    _bgm = _WBCTurnBgm;
                }
                    break;
            }

            Fader.Fade(_bgm, Volume, true);
        }
    }
Esempio n. 11
0
 public RaceType(RaceTypes _type)
 {
   type = _type;
   switch (_type)
   {
     case RaceTypes.Sprint:
       laps = 3;
       rangeDistr = "ps";
       break;
     case RaceTypes.Pursuit:
     case RaceTypes.Mass_Start:
       laps = 5;
       rangeDistr = "ppss";
       break;
     case RaceTypes.Individual:
       laps = 5;
       rangeDistr = "psps";
       break;
     default:
       break;
   }
 }
Esempio n. 12
0
        public Race(RaceTypes raceType)
        {
            switch (raceType)
            {
            default:
            case RaceTypes.Human:
                // Captain Average
                break;

            case RaceTypes.Elf:
                attributeChange.Add(new Attribute(AttributeTypes.Dexterity, 2));
                attributeChange.Add(new Attribute(AttributeTypes.Intelligence, 2));
                attributeChange.Add(new Attribute(AttributeTypes.Constitution, -2));
                attributeChange.Add(new Attribute(AttributeTypes.Charisma, 1));
                break;

            case RaceTypes.Halfling:
                attributeChange.Add(new Attribute(AttributeTypes.Strength, -2));
                attributeChange.Add(new Attribute(AttributeTypes.Dexterity, 2));
                break;

            case RaceTypes.Gnome:
                attributeChange.Add(new Attribute(AttributeTypes.Strength, -2));
                attributeChange.Add(new Attribute(AttributeTypes.Dexterity, 2));
                attributeChange.Add(new Attribute(AttributeTypes.Intelligence, 1));
                break;

            case RaceTypes.Dwarf:
                attributeChange.Add(new Attribute(AttributeTypes.Strength, 2));
                attributeChange.Add(new Attribute(AttributeTypes.Constitution, 2));
                break;

            case RaceTypes.Orc:
                attributeChange.Add(new Attribute(AttributeTypes.Strength, 2));
                attributeChange.Add(new Attribute(AttributeTypes.Charisma, -3));
                break;
            }
        }
Esempio n. 13
0
        //Constructors
        public Unit(UnitTypes type, RaceTypes race,
            int initialHealthLevel, int initialAttackLevel,
            int level, bool isAlive, Point currentPosition, bool isSelected)
        {
            this.Type = type;
            this.Race = race;

            //Current health level, initial health level and max health level are the same int the initialization
            this.HealthLevel = initialHealthLevel;
            this.InitialHealthLevel = initialHealthLevel;
            this.MaxHealthLevel = initialHealthLevel;
            
            //Current attack level, initial attack level and max attack level are the same int the initialization
            this.AttackLevel = initialAttackLevel;
            this.InitialAttackLevel = initialAttackLevel;
            this.MaxAttackLevel = initialAttackLevel;
            this.CounterAttackLevel = initialAttackLevel / 2;

            this.Level = level;
            this.IsAlive = isAlive;
            this.CurrentPosition = currentPosition;
            this.IsSelected = isSelected;
        }
        private void GameOver(RaceTypes winner)
        {
            Image playAgainBtn = new Image();
            var path = System.IO.Path.GetFullPath(@"..\..\Resources\Other_graphics\backtomenu_unhover.png");
            playAgainBtn.Source = new BitmapImage(new Uri(path, UriKind.Absolute));
            this.Back.Child = playAgainBtn;
            this.Back.Child.MouseEnter += new MouseEventHandler(WinButton_MouseEnter);
            this.Back.Child.MouseLeave += new MouseEventHandler(WinButton_MouseLeave);
            this.Back.Child.MouseLeftButtonDown += new MouseButtonEventHandler(WinButton_MouseLeftButtonDown);

            Canvas.SetZIndex(this.WinnerScreen, 10);

            ImageBrush img = new ImageBrush();

            if (winner == RaceTypes.Alliance)
            {
                path = System.IO.Path.GetFullPath(@"..\..\Resources\Other_graphics\alliance_wins.png");
                img.ImageSource = new BitmapImage(new Uri(path, UriKind.Absolute));
                this.WinnerScreen.Background = img;
                backgroundMusic.Stop();
                path = System.IO.Path.GetFullPath(@"..\..\Resources\Alliance\alliance_wins.mp3");
                backgroundMusic.Open(new Uri(path));
                backgroundMusic.Play();
            }
            else if (winner == RaceTypes.Horde)
            {
                path = System.IO.Path.GetFullPath(@"..\..\Resources\Other_graphics\horde_wins.png");
                img.ImageSource = new BitmapImage(new Uri(path, UriKind.Absolute));
                this.WinnerScreen.Background = img;
                backgroundMusic.Stop();
                path = System.IO.Path.GetFullPath(@"..\..\Resources\Horde\horde_wins.mp3");
                backgroundMusic.Open(new Uri(path));
                backgroundMusic.Play();
            }
            else
            {
                path = System.IO.Path.GetFullPath(@"..\..\Resources\Other_graphics\draw.png");
                img.ImageSource = new BitmapImage(new Uri(path, UriKind.Absolute));
                this.WinnerScreen.Background = img;
                backgroundMusic.Stop();
                path = System.IO.Path.GetFullPath(@"..\..\Resources\Unit_Sounds\draw.mp3");
                backgroundMusic.Open(new Uri(path));
                backgroundMusic.Play();
            }
        }
Esempio n. 15
0
 public virtual void SetRaceType(RaceTypes raceType)
 {
     this.RaceType = raceType;
 }
        private bool IsGameOver()
        {
            bool isAllianceWinner = false;
            bool isHordeWinner = false;

            if (!InitializedTeams.AllianceTeam[14].IsAlive && !InitializedTeams.AllianceTeam[15].IsAlive)
            {
                isHordeWinner = true;
            }

            if (!InitializedTeams.HordeTeam[14].IsAlive && !InitializedTeams.HordeTeam[15].IsAlive)
            {
                isAllianceWinner = true;
            }

            if (isAllianceWinner)
            {
                if (isHordeWinner)
                {
                    winner = RaceTypes.Hybrid;
                    return true;
                }
                else
                {
                    winner = RaceTypes.Alliance;
                    return true;
                }
            }
            else
            {
                if (isHordeWinner)
                {
                    winner = RaceTypes.Horde;
                    return true;
                }
                else
                {
                    return false;
                }
            }
        }
 public static RaceData GetRace(this IRepositoryManager repoManager, RaceTypes type)
 {
     return(repoManager.RACES.Values.FirstOrDefault(x => x.Type == type));
 }