Skip to content
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

сайт #87

Open
wants to merge 2 commits into
base: Mihail_Soldatov
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions RPG.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29306.81
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RPG", "RPG\RPG.csproj", "{9DCB304A-3927-42E8-9D29-FB0820354E4E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{9DCB304A-3927-42E8-9D29-FB0820354E4E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9DCB304A-3927-42E8-9D29-FB0820354E4E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DCB304A-3927-42E8-9D29-FB0820354E4E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DCB304A-3927-42E8-9D29-FB0820354E4E}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DA76A8FB-E2E4-4D4E-AD81-8576A401E586}
EndGlobalSection
EndGlobal
11 changes: 11 additions & 0 deletions RPG/Abilities.cs
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 Abilities
{
void Ability(Player player);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Зачем?

}
}
24 changes: 24 additions & 0 deletions RPG/Archer.cs
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
{
class Archer : Player
{
public Archer()
: this("Неизвестно")
{
}
public Archer(string name)
: this(name, null)
{
}
public Archer(string name, Player enemy)
: base(name, enemy)
{
Class = "Archer";
UseAbility.Add(new ArcherAbility());
}
}
}
15 changes: 15 additions & 0 deletions RPG/ArchertAbility.cs
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 ArcherAbility : Abilities
{
public void Ability(Player player)
{
player.Enemy.Effects.Add("Fire arrows");
Console.WriteLine("Player: {player.Class} use Fire arrows to {player.Enemy.Class}, {player.Enemy.Name}");
}
}
}
14 changes: 14 additions & 0 deletions RPG/Attack.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace RPG
{
public class Attack : Abilities
{
public void Ability(Player player)
{
player.Enemy.HP = player.Enemy.HP - player.Strong;
}
}
}
Loading