This repository has been archived by the owner on Aug 10, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored the code base and made it easier to maintain. New features: Colored bodies Better logs system Added /roles command for admins Start working on configuration Started rebuilding the Shop
- Loading branch information
Showing
110 changed files
with
3,759 additions
and
3,104 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,60 +1,60 @@ | ||
## cs2TTT | ||
|
||
## Contributing | ||
TTT is in heavy development and I want you to know that contributions are always welcome. Please follow Microsoft's dependency injection system. | ||
|
||
> [!TIP] | ||
> Microsoft has some good documentation on dependency injection here: | ||
> [Overview](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection), | ||
> [Using Dependency Injection](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-usage), | ||
> [Dependency Injection Guidelines](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-guidelines). | ||
## Creating items | ||
|
||
Creating new items or modifying existing ones is easy. Create a new class in the correct directory, mod/TTT.Shop/Items/{group}. Then create it to your liking. Afterwards, compile the plugin and it's all set. The plugin handles loading all the items. | ||
|
||
> [!TIP] | ||
> Available groups are [All, Detective, Traitor]. <br> | ||
> SimpleName is used for /buy {name} | ||
#### Example Item | ||
```c# | ||
namespace TTT.Shop.Items.Traitor; | ||
|
||
public class AwpItem : IShopItem | ||
{ | ||
public string Name() | ||
{ | ||
return "AWP"; | ||
} | ||
|
||
public string SimpleName() | ||
{ | ||
return "awp"; | ||
} | ||
|
||
public int Price() | ||
{ | ||
return 2000; | ||
} | ||
|
||
public BuyResult OnBuy(GamePlayer player) | ||
{ | ||
if (player.Credits() < Price()) return BuyResult.NotEnoughCredits; | ||
if (player.PlayerRole() != Role.Traitor) return BuyResult.IncorrectRole; | ||
player.RemoveCredits(Price()); | ||
player.Player().GiveNamedItem(CsItem.AWP); | ||
return BuyResult.Successful; | ||
} | ||
} | ||
``` | ||
|
||
## Road Map | ||
- [✅] Role assignment | ||
- [✅] DNA Scanner | ||
- [✅] Tazer | ||
- [ ] Configuration | ||
- [ ] Karma system | ||
- [ ] Shop | ||
- [ ] RDM Manager | ||
- [ ] Add database support for logs and stats | ||
## cs2TTT | ||
|
||
## Contributing | ||
TTT is in heavy development and I want you to know that contributions are always welcome. Please follow Microsoft's dependency injection system. | ||
|
||
> [!TIP] | ||
> Microsoft has some good documentation on dependency injection here: | ||
> [Overview](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection), | ||
> [Using Dependency Injection](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-usage), | ||
> [Dependency Injection Guidelines](https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection-guidelines). | ||
## Creating items | ||
|
||
Creating new items or modifying existing ones is easy. Create a new class in the correct directory, mod/TTT.Shop/Items/{group}. Then create it to your liking. Afterwards, compile the plugin and it's all set. The plugin handles loading all the items. | ||
|
||
> [!TIP] | ||
> Available groups are [All, Detective, Traitor]. <br> | ||
> SimpleName is used for /buy {name} | ||
#### Example Item | ||
```c# | ||
namespace TTT.Shop.Items.Traitor; | ||
|
||
public class AwpItem : IShopItem | ||
{ | ||
public string Name() | ||
{ | ||
return "AWP"; | ||
} | ||
|
||
public string SimpleName() | ||
{ | ||
return "awp"; | ||
} | ||
|
||
public int Price() | ||
{ | ||
return 2000; | ||
} | ||
|
||
public BuyResult OnBuy(GamePlayer player) | ||
{ | ||
if (player.Credits() < Price()) return BuyResult.NotEnoughCredits; | ||
if (player.PlayerRole() != Role.Traitor) return BuyResult.IncorrectRole; | ||
player.RemoveCredits(Price()); | ||
player.Player().GiveNamedItem(CsItem.AWP); | ||
return BuyResult.Successful; | ||
} | ||
} | ||
``` | ||
|
||
## Road Map | ||
- [✅] Role assignment | ||
- [✅] DNA Scanner | ||
- [✅] Tazer | ||
- [ ] Configuration | ||
- [ ] Karma system | ||
- [ ] Shop | ||
- [ ] RDM Manager | ||
- [ ] Add database support for logs and stats |
This file contains 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 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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
| ||
# Repository build files | ||
build/ | ||
bin/ | ||
obj/ | ||
|
||
Debug/ | ||
Release/ | ||
|
||
# IDE files | ||
.idea/ | ||
.vs/ | ||
| ||
# Repository build files | ||
build/ | ||
bin/ | ||
obj/ | ||
Debug/ | ||
Release/ | ||
# IDE files | ||
.idea/ | ||
.vs/ |
This file contains 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
{ | ||
"sdk": { | ||
"version": "8.0.0", | ||
"rollForward": "latestMajor", | ||
"allowPrerelease": false | ||
} | ||
{ | ||
"sdk": { | ||
"version": "8.0.0", | ||
"rollForward": "latestMajor", | ||
"allowPrerelease": false | ||
} | ||
} |
This file contains 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,7 @@ | ||
namespace TTT.Detective; | ||
|
||
public class DetectiveConfig | ||
{ | ||
public bool DNAScannerEnabled { get; } = true; | ||
|
||
} |
This file contains 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
Oops, something went wrong.