-
Notifications
You must be signed in to change notification settings - Fork 17
Aleksandr gerasimov #81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ALeksandr13254
wants to merge
22
commits into
ISUCT:Aleksandr_Gerasimov
Choose a base branch
from
ALeksandr13254:Aleksandr_Gerasimov
base: Aleksandr_Gerasimov
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
33eaa4e
Create dotnetcore.yml
ALeksandr13254 cf7ec51
Сделал!
a5fd12e
Merge branch 'Aleksandr_Gerasimov' of https://github.com/ALeksandr132…
348daf5
...
a6b8b14
Сделал, но пока без тестов!
6919874
Add files via upload
ALeksandr13254 360f9f1
Add files via upload
ALeksandr13254 5e1d4f2
Add files via upload
ALeksandr13254 36aa054
edit site
ALeksandr13254 811f73c
Merge branch 'Aleksandr_Gerasimov'
ALeksandr13254 3cc6265
edit site
ALeksandr13254 451ecf2
Edit site
c7b80e2
Edit site
c5e2911
Edit RPG
ALeksandr13254 5b7b066
Edit RPG
ALeksandr13254 785a284
исправил РПГ и Сайт
ALeksandr13254 80a42d5
исправил РПГ и Сайт
ALeksandr13254 a97c742
Revert "исправил РПГ и Сайт"
ALeksandr13254 fc64630
Revert "Revert "исправил РПГ и Сайт""
ALeksandr13254 1704505
fix
ALeksandr13254 e7f1692
fix
ALeksandr13254 5565d20
всё исправил, посмотрите пожалуйста!
ALeksandr13254 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class Archer : Player | ||
| { | ||
| public Archer() | ||
| : this("Без имени") | ||
| { | ||
| } | ||
|
|
||
| public Archer(string name) | ||
| : this(name, null) | ||
| { | ||
| } | ||
|
|
||
| public Archer(string name, Player opponent) | ||
| : base(name, opponent) | ||
| { | ||
| Class = "Лучник"; | ||
| Usingskill = new ArcherSkill(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class ArcherSkill : IUseSkill | ||
| { | ||
| public void UseSkill(Player user) | ||
| { | ||
| if (!user.SkillUsed) | ||
| { | ||
| user.Opponent.IsDebuffed = true; | ||
| Logger.LogMessage($"({user.Class}) {user.Name} использует (Огненные стрелы) на ({user.Opponent.Class}) {user.Opponent.Name}."); | ||
| user.SkillUsed = true; | ||
| } | ||
| else | ||
| { | ||
| user.Attack(); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,53 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public static class Battle | ||
| { | ||
| public static Player BattlePlayers(Player p) | ||
| { | ||
| Random rand = new Random(); | ||
| while (p.Hp > 0 && p.Opponent.Hp > 0) | ||
| { | ||
| int useSkill1 = rand.Next(0, 2); | ||
| int useSkill2 = rand.Next(0, 2); | ||
| if (useSkill1 == 0 && p.Hp > 0) | ||
| { | ||
| p.Attack(); | ||
| } | ||
| else if (useSkill1 == 1 && p.Hp > 0) | ||
| { | ||
| p.UseSkill(); | ||
| } | ||
|
|
||
| if (useSkill2 == 0 && p.Opponent.Hp > 0) | ||
| { | ||
| p.Opponent.Attack(); | ||
| } | ||
| else if (useSkill2 == 1 && p.Opponent.Hp > 0) | ||
| { | ||
| p.Opponent.UseSkill(); | ||
| } | ||
| } | ||
|
|
||
| if (p.Hp < 1) | ||
| { | ||
| Logger.LogMessage($"({p.Class}) {p.Name} погиб!\n"); | ||
| p.Opponent.Hp = rand.Next(1, 100); | ||
| p.Opponent.IsDebuffed = false; | ||
| return p; | ||
| } | ||
| else if (p.Opponent.Hp < 1) | ||
| { | ||
| Logger.LogMessage($"({p.Opponent.Class}) {p.Opponent.Name} погиб!\n"); | ||
| p.Hp = rand.Next(1, 100); | ||
| p.IsDebuffed = false; | ||
| return p.Opponent; | ||
| } | ||
|
|
||
| throw new Exception("Ошибка!!!"); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class Game | ||
| { | ||
| public static void Main(string[] args) | ||
| { | ||
| Console.Write($"Введите кол-во игроков (1-16):"); | ||
| int kol = Convert.ToInt32(Console.ReadLine()); | ||
ALeksandr13254 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| if (kol <= 0) | ||
| { | ||
| throw new Exception("Ошибка!!!"); | ||
ALeksandr13254 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| } | ||
|
|
||
| string[] players_names = { "Игрок1", "Игрок2", "Игрок3", "Игрок4", "Игрок5", "Игрок6", "Игрок7", "Игрок8", "Игрок9", "Игрок10", "Игрок11", "Игрок12", "Игрок13", "Игрок14", "Игрок15", "Игрок16" }; | ||
| List<Player> kon_a = new List<Player>(); | ||
ALeksandr13254 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| List<Player> kon_b = new List<Player>(); | ||
| int kon = 1; | ||
| int n = 0; | ||
| Random rand = new Random(); | ||
| while (kon_a.Count < kol) | ||
| { | ||
| int r = rand.Next(0, 3); | ||
| if (r == 0) | ||
ALeksandr13254 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| { | ||
| kon_a.Add(new Knight(players_names[n])); | ||
| } | ||
|
|
||
| if (r == 1) | ||
| { | ||
| kon_a.Add(new Archer(players_names[n])); | ||
| } | ||
|
|
||
| if (r == 2) | ||
| { | ||
| kon_a.Add(new Mage(players_names[n])); | ||
| } | ||
|
|
||
| n++; | ||
| } | ||
|
|
||
| Logger.LogMessage($"{kon++}-й Кон\n"); | ||
| while (kon_a.Count + kon_b.Count > 1) | ||
| { | ||
| if (kon_a.Count > 1 && !(kon_a.Count < 2)) | ||
| { | ||
| Player tempPlayer = Battle.BattlePlayers(kon_a[PickPlayers.PickOp(kon_a)]); | ||
| kon_b.Add(tempPlayer.Opponent); | ||
| kon_a.Remove(tempPlayer.Opponent); | ||
| kon_a[kon_a.IndexOf(tempPlayer)].Opponent.Opponent = null; | ||
| kon_a.Remove(tempPlayer); | ||
| } | ||
| else | ||
| { | ||
| Logger.LogMessage($"{kon}-й Кон\n"); | ||
| kon_a.AddRange(kon_b); | ||
| kon_b.Clear(); | ||
| kon++; | ||
| } | ||
| } | ||
|
|
||
| Logger.LogMessage($"({kon_b[0].Class}) {kon_b[0].Name} Победил!!!"); | ||
| Console.ReadLine(); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public interface IUseSkill | ||
| { | ||
| void UseSkill(Player user); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class Knight : Player | ||
| { | ||
| public Knight() | ||
| : this("Без имени") | ||
| { | ||
| } | ||
|
|
||
| public Knight(string name) | ||
| : this(name, null) | ||
| { | ||
| } | ||
|
|
||
| public Knight(string name, Player opponent) | ||
| : base(name, opponent) | ||
| { | ||
| Class = "Рыцарь"; | ||
| Usingskill = new KnightSkill(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class KnightSkill : IUseSkill | ||
| { | ||
| public void UseSkill(Player user) | ||
| { | ||
| user.Opponent.Hp -= user.Strength * 1.3; | ||
| Logger.LogMessage($"({user.Class}) {user.Name} использует (Удар возмездия) и наносит урон {user.Strength * 1.3} противнику ({user.Opponent.Class}){user.Opponent.Name}."); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public static class Logger | ||
| { | ||
| public static void LogBattle(Player player) | ||
| { | ||
| Console.WriteLine($"{player.Class} {player.Name} vs {player.Opponent.Class} {player.Opponent.Name}."); | ||
| } | ||
|
|
||
| public static void LogMessage(string message) | ||
| { | ||
| Console.WriteLine(message); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class Mage : Player | ||
| { | ||
| public Mage() | ||
| : this("Без имени") | ||
| { | ||
| } | ||
|
|
||
| public Mage(string name) | ||
| : this(name, null) | ||
| { | ||
| } | ||
|
|
||
| public Mage(string name, Player opponent) | ||
| : base(name, opponent) | ||
| { | ||
| Class = "Маг"; | ||
| Usingskill = new MageSkill(); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class MageSkill : IUseSkill | ||
| { | ||
| public void UseSkill(Player user) | ||
| { | ||
| user.Opponent.IsSkipped = true; | ||
| Logger.LogMessage($"({user.Class}) {user.Name} использует (Заворожение) на ({user.Opponent.Class}) {user.Opponent.Name}."); | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Text; | ||
|
|
||
| namespace RPG | ||
| { | ||
| public class PickPlayers | ||
| { | ||
| public static int PickOp(List<Player> kon_x) | ||
| { | ||
| Random rand = new Random(); | ||
| int randPlayer1 = rand.Next(0, kon_x.Count); | ||
| int randPlayer2 = rand.Next(0, kon_x.Count); | ||
| while (randPlayer1 == randPlayer2) | ||
| { | ||
| randPlayer2 = rand.Next(0, kon_x.Count); | ||
| } | ||
|
|
||
| kon_x[randPlayer1].Opponent = kon_x[randPlayer2]; | ||
| kon_x[randPlayer2].Opponent = kon_x[randPlayer1]; | ||
| return randPlayer1; | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.