예제 #1
0
파일: Game.cs 프로젝트: edumbell/stakeout
 public DayInstruction(Game game, DayFormModel model)
 {
     Actor     = game.Players.Where(p => p.Id == model.ActorId).Single();
     JailVote  = game.Players.Where(p => p.Id == model.JailWhom).SingleOrDefault();
     StakeVote = game.Players.Where(p => p.Id == model.KillWhom).SingleOrDefault();
     Weight    = Actor.IsMayor ? 1.1 : 1;
 }
예제 #2
0
파일: AI.cs 프로젝트: edumbell/stakeout
        public DayFormModel GetDayInstruction(List <string> ids, int turnId)
        {
            Daily();
            var otherIds = ids.Where(x => x != Me.Id).ToList();
            var d        = new DayFormModel()
            {
                ActorId = Me.Id,
                TurnId  = turnId
            };

            if (otherIds.Any())
            {
                d.JailWhom = RandomId(ids);
                d.KillWhom = PickEnemy(.9);
            }

            //if (r.Next(10)  < 5 - (turnId / 2))
            //{
            //	d.KillWhom = null;
            //}

            if (r.NextDouble() * 10 - 1 < SuspicionAgainstMe)
            {
                d.JailWhom = Me.Id;
            }
            ;
            if (d.KillWhom != null)
            {
                SuspicionAgainstMe += .1;
            }
            return(d);
        }