Exemple #1
0
        public bool StartStage(Player player, List <Monster> monsters, MonsterRepository instanceofmonster, List <Item> items, List <Dialogue> allDialogue)
        {
            var dialogue  = allDialogue;
            var Dialogues = new DialogueRepository();

            allDialogue = Dialogues.ShowDialogue("Transition", allDialogue, Utils.random);


            var monster = instanceofmonster.MonsterChoosen(monsters, Utils.random);
            var battle  = new Battle();
            var win     = battle.BattleResult(player, monster);

            Utils.SlowConsoleWriter(win ? "vous avez gagné !!" : "Vous avez perdu ... ");

            if (win)
            {
                var lootphase     = new Lootphase();
                var itemlootphase = lootphase.DroppedItems(items, Utils.random);
                player.Item = itemlootphase;
                return(true);
            }
            else
            {
                return(false);
            }
        }
 public DialogueNodeComponent(
     DialogueEditor editor,
     DialogueEditorFactory guiFactory,
     DialogueEditorStyles styles,
     DialogueRepository repository,
     DialogueNode node
     )
 {
     this.editor     = editor;
     this.guiFactory = guiFactory;
     this.styles     = styles;
     this.repository = repository;
     this.node       = node;
 }
Exemple #3
0
 public StartItemDialogueService(
     StartDialogueEventRepository startDialogueEventRepository,
     DialogueRepository dialogueRepository,
     string itemId,
     Sprite iconForDialogue,
     IconForDialogueRepository iconForDialogueRepository,
     Dialogue dialogue)
 {
     this.startDialogueEventRepository = startDialogueEventRepository ?? throw new ArgumentNullException(nameof(startDialogueEventRepository));
     this.dialogueRepository           = dialogueRepository ?? throw new ArgumentNullException(nameof(dialogueRepository));
     this.itemId                    = itemId ?? throw new ArgumentNullException(nameof(itemId));
     this.iconForDialogue           = iconForDialogue;
     this.iconForDialogueRepository = iconForDialogueRepository ?? throw new ArgumentNullException(nameof(iconForDialogueRepository));
     this.dialogue                  = dialogue;
 }
Exemple #4
0
        public void StartGame()
        {
            var item  = new ItemRepository();
            var items = item.GetItems();

            var lootphase = new Lootphase();

            Console.WriteLine("Heuh j'ai affaire à qui la ?? (Entrez votre nom) :");
            var playerName = Console.ReadLine();

            var dialogue = new DialogueRepository();

            dialogue.ShowDialogue("Intro", dialogue.GetDialogue(), Utils.random);

            var playerItem = lootphase.DroppedItems(items, Utils.random);
            var player     = new Player(0, playerName, Utils.random.Next(25, 100), playerItem.IdItem, playerItem, Utils.random.Next(5, 25));
            var monster    = new MonsterRepository();
            var monsters   = monster.GetMonsters();
            var stage      = new Stage();
            var dialogues  = dialogue.GetDialogue();

            var resultstage = stage.StartStage(player, monsters, monster, items, dialogues);

            if (resultstage == true)
            {
                int i = 0;
                do
                {
                    resultstage = stage.StartStage(player, monsters, monster, items, dialogues);
                    i++;
                }while (resultstage == true && i < 4);
                if (resultstage == true)
                {
                    var  bossbattle       = new BossBattle();
                    var  enigma           = new EnigmaRepository();
                    var  ramdomEnigma     = new Enigma();
                    bool bossbatlleresult = bossbattle.BossBattleResult(player, monster.MonsterChoosen(monsters, Utils.random), enigma.GetEnigma());
                }
            }
            else
            {
                Console.WriteLine("Vous avez perdu !");
            }
        }
        public bool TryAddDialogue(Dialogue dialogue)
        {
            Expression <Func <User, bool> > recipientUserSearchCriteria = x =>
                                                                          x.Login == dialogue.RecipientUser.Login;
            var recipientUserId = GetEntityId(recipientUserSearchCriteria, UserRepository);

            Expression <Func <User, bool> > senderUserSearchCriteria = x =>
                                                                       x.Login == dialogue.SenderUser.Login;
            var senderUserId = GetEntityId(senderUserSearchCriteria, UserRepository);

            DialogueRepository.Add(new EF.Dialogue
            {
                Message     = dialogue.Message,
                DateTime    = dialogue.DateTime,
                RecipientId = recipientUserId,
                SenderId    = senderUserId
            });
            DialogueRepository.Save();
            return(true);
        }
 public DisplayDialogueService(DialogueRepository dialogueRepository, NewTextEventRepository newTextEventRepository, DialogueModel dialogueModel)
 {
     this.dialogueRepository     = dialogueRepository ?? throw new ArgumentNullException(nameof(dialogueRepository));
     this.newTextEventRepository = newTextEventRepository ?? throw new ArgumentNullException(nameof(newTextEventRepository));
     this.dialogueModel          = dialogueModel ?? throw new ArgumentNullException(nameof(dialogueModel));
 }