예제 #1
0
        public void Tick()
        {
            Vector = Vector.GetVectorAt(1);
            char trackValue = Thirteen.Tracks[Vector.Position];

            TurnActions[trackValue]();
        }
예제 #2
0
 public Unit()
 {
     this.characterName    = "0";
     this.characterMoniker = "Null";
     this.uType            = UnitType.Soldier;
     turnActions           = new TurnActionsBasicUnit();
 }
예제 #3
0
 public void StartTurn()
 {
     // Clear the actions for each player
     TurnActions.Clear();
     TurnOutcomes.Clear();
     IsMidTurn        = true;
     UnreadiedPlayers = 0;
 }
예제 #4
0
 public UnitEdit()
 {
     currentClass     = "HumanBaseMage";
     characterName    = "0";
     characterMoniker = "Null";
     uType            = UnitType.Soldier;
     skills           = new string[0];
     turnActions      = new TurnActionsBasicUnit();
 }
예제 #5
0
파일: Unit.cs 프로젝트: BradZzz/EldersTale
 public Unit()
 {
     this.characterName    = "0";
     this.characterMoniker = "Null";
     this.uType            = UnitType.Soldier;
     this.skills           = new string[0];
     skillBuffs            = new string[] { };
     turnActions           = new TurnActionsBasicUnit();
 }
예제 #6
0
 void Setup(string cName, string cMonik, int cLvl, int team, int mxHlth, int atk, int moveSpeed, int atkRange,
            int trnMvs, int trnAtks, UnitType uType = UnitType.Soldier)
 {
     this.characterName    = cName + UnityEngine.Random.Range(0, 1).ToString();
     this.characterMoniker = cMonik;
     this.team             = team;
     this.mxHlth           = cHlth = mxHlth;
     this.atk         = atk;
     this.moveSpeed   = moveSpeed;
     this.atkRange    = atkRange;
     this.lvl         = cLvl;
     this.uType       = uType;
     this.trnAtks     = trnAtks;
     this.trnMvs      = trnMvs;
     this.turnActions = new TurnActionsBasicUnit(trnMvs, trnAtks);
 }
예제 #7
0
파일: Unit.cs 프로젝트: BradZzz/EldersTale
 void Setup(string cName, string cMonik, int cLvl, int team, int mxHlth, int atk, int moveSpeed, int atkRange,
            int trnMvs, int trnAtks, string[] skills, string currentClass, UnitType uType = UnitType.Soldier, FactionType fType = FactionType.Human)
 {
     this.characterName    = cName + UnityEngine.Random.Range(0, 1).ToString();
     this.characterMoniker = cMonik;
     this.team             = team;
     this.mxHlth           = cHlth = mxHlth;
     this.atk          = atk;
     this.moveSpeed    = moveSpeed;
     this.atkRange     = atkRange;
     this.lvl          = cLvl;
     this.currentClass = currentClass;
     this.uType        = uType;
     this.fType        = fType;
     this.trnAtks      = trnAtks;
     this.trnMvs       = trnMvs;
     this.skills       = skills;
     skillBuffs        = new string[] { };
     this.turnActions  = new TurnActionsBasicUnit(trnMvs, trnAtks);
     Debug.Log("init");
 }
예제 #8
0
 private void load()
 {
     TurnActions.BindTo(project.Turns);
 }
예제 #9
0
 private void load()
 {
     TurnActions.BindTo(project.PreparationTurn);
 }
예제 #10
0
        public PokerHand ToXmlHand()
        {
            PokerHand hand = new PokerHand()
            {
                Hero = players[Hero].Name
            };

            #region Convert blinds
            var blindPostings = predealActions.Where(s =>
                                                     s.ActionType == Action.ActionTypes.PostSmallBlind ||
                                                     s.ActionType == Action.ActionTypes.PostBigBlind ||
                                                     s.ActionType == Action.ActionTypes.PostAnte);


            hand.Blinds = new Blind[blindPostings.Count()];
            for (int i = 0; i < hand.Blinds.Length; i++)
            {
                var blindPosting = blindPostings.ElementAt(i);
                hand.Blinds[i] = new Blind()
                {
                    AllIn  = blindPosting.AllIn,
                    Amount = (decimal)blindPosting.Amount,
                    Player = blindPosting.Name,
                    Type   = blindPosting.ActionType == Action.ActionTypes.PostBigBlind ? BlindType.BigBlind
                                                : blindPosting.ActionType == Action.ActionTypes.PostSmallBlind ? BlindType.SmallBlind
                                                : blindPosting.ActionType == Action.ActionTypes.PostAnte ? BlindType.Ante
                                                : BlindType.None
                };
            }
            #endregion

            #region Context
            hand.Context      = new Context();
            hand.Context.Ante = (decimal)Ante;

            #region Betting Structure
            if (BettingStructure == holdem_engine.BettingStructure.None)
            {
                throw new Exception("Unknown betting structure");
            }
            hand.Context.BettingType = this.BettingStructure == holdem_engine.BettingStructure.Limit ? BettingType.FixedLimit
                                                                        : BettingStructure == holdem_engine.BettingStructure.NoLimit ? BettingType.NoLimit
                                                                        : BettingType.PotLimit;
            #endregion

            hand.Context.BigBlind           = (decimal)BigBlind;
            hand.Context.Button             = (int)Button;
            hand.Context.CapAmount          = 0;    // no caps supported
            hand.Context.CapAmountSpecified = false;
            hand.Context.Capped             = false;
            hand.Context.Currency           = "$";
            hand.Context.Format             = GameFormat.CashGame;
            hand.Context.ID           = HandNumber.ToString();
            hand.Context.Online       = false;
            hand.Context.PokerVariant = PokerVariant.TexasHoldEm;
            hand.Context.Site         = "SimulatedPokerSite";
            hand.Context.SmallBlind   = (decimal)SmallBlind;
            hand.Context.Table        = TableName;
            hand.Context.TimeStamp    = DateTime.Now;
            #endregion

            #region HoleCards
            hand.HoleCards = HoldemHand.Hand.Cards(HoleCards[Hero])
                             .Select(c => new PokerHandHistory.Card(c))
                             .ToArray();
            #endregion

            hand.Rake    = 0m;
            hand.Players = this.Players.Select((s, i) => new Player()
            {
                Name = s.Name, Seat = s.SeatNumber, Stack = (decimal)StartingChips[i]
            }).ToArray();

            #region Rounds (actions and community cards)
            hand.Rounds = new PokerHandHistory.Round[Math.Min(4, (int)this.CurrentRound)];
            if (CurrentRound >= Round.Preflop)
            {
                hand.Rounds[0]         = new PokerHandHistory.Round();
                hand.Rounds[0].Actions = PreflopActions.Select(a => convertActionToXml(a)).ToArray();
                if (CurrentRound >= Round.Flop)
                {
                    hand.Rounds[1]                = new PokerHandHistory.Round();
                    hand.Rounds[1].Actions        = FlopActions.Select(a => convertActionToXml(a)).ToArray();
                    hand.Rounds[1].CommunityCards = HoldemHand.Hand.Cards(Flop)
                                                    .Select(c => new PokerHandHistory.Card(c))
                                                    .ToArray();

                    if (CurrentRound >= Round.Turn)
                    {
                        hand.Rounds[2]                = new PokerHandHistory.Round();
                        hand.Rounds[2].Actions        = TurnActions.Select(a => convertActionToXml(a)).ToArray();
                        hand.Rounds[2].CommunityCards = HoldemHand.Hand.Cards(Turn)
                                                        .Select(c => new PokerHandHistory.Card(c))
                                                        .ToArray();

                        if (CurrentRound >= Round.River)
                        {
                            hand.Rounds[3]                = new PokerHandHistory.Round();
                            hand.Rounds[3].Actions        = RiverActions.Select(a => convertActionToXml(a)).ToArray();
                            hand.Rounds[3].CommunityCards = HoldemHand.Hand.Cards(River)
                                                            .Select(c => new PokerHandHistory.Card(c))
                                                            .ToArray();
                        }
                    }
                }
            }
            #endregion

            #region Results
            if (Winners != null && Winners.Count() > 0)
            {
                hand.Results = new HandResult[players.Length];
                //int potNum = 0;
                for (int i = 0; i < hand.Results.Length; i++)
                {
                    HandResult hr = new HandResult(players[i].Name);
                    hr.HoleCards = HoldemHand.Hand.Cards(HoleCards[i])
                                   .Select(c => new PokerHandHistory.Card(c))
                                   .ToArray();
                    var wins = winners.Where(w => w.Player == hr.Player);
                    if (wins != null)
                    {
                        hr.WonPots = wins.Select(w => new PokerHandHistory.Pot()
                        {
                            Amount = (decimal)w.Amount,
                            //Number = potNum++ // not able to handle this properly currently.
                        }).ToArray();
                    }

                    hand.Results[i] = hr;
                }
            }
            #endregion

            return(hand);
        }
예제 #11
0
파일: Unit.cs 프로젝트: BradZzz/EldersTale
 public void SetMoveTrnBuff(int buff)
 {
     this.moveTrnBuff = buff;
     this.turnActions = new TurnActionsBasicUnit(GetTurnMoves(), GetTurnAttacks());
     Debug.Log("SetMoveTrnBuff");
 }
예제 #12
0
파일: Unit.cs 프로젝트: BradZzz/EldersTale
 public void SetTurnAttackBuff(int buff)
 {
     this.trnAtkBuff  = buff;
     this.turnActions = new TurnActionsBasicUnit(GetTurnMoves(), GetTurnAttacks());
     Debug.Log("set turn attack buff");
 }
예제 #13
0
 void Awake()
 {
     instance = this;
 }