Skip to content
This repository has been archived by the owner on Aug 10, 2024. It is now read-only.

Commit

Permalink
Merge pull request #8 from edgegamers/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
ntm5 authored Jul 12, 2024
2 parents 772d65c + f7cae66 commit 1fa1504
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 45 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
post_webhook:
needs: build
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/dev'
if: github.ref == 'refs/heads/aaaa'

steps:
- name: POST Webhook
Expand All @@ -40,4 +40,4 @@ jobs:
--fail \
-F token=${{ secrets.GITLAB_SECRET_TOKEN }} \
-F ref=dev \
https://gitlab.edgegamers.io/api/v4/projects/2640/trigger/pipeline
https://gitlab.edgegamers.io/api/v4/projects/2640/trigger/pipeline
40 changes: 0 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,46 +9,6 @@ TTT is in heavy development and I want you to know that contributions are always
> [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
Expand Down
4 changes: 2 additions & 2 deletions mod/TTT.Player/KarmaManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info)
if (killerRole == killedRole)
{
gpKiller.RemoveKarma(5);
return HookResult.Stop;
return HookResult.Continue;
}

if (killedRole == Role.Traitor)
Expand All @@ -40,4 +40,4 @@ public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info)
}
return HookResult.Continue;
}
}
}
2 changes: 1 addition & 1 deletion mod/TTT.Roles/RoleBehavior.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public HookResult OnPlayerConnect(EventPlayerConnectFull @event, GameEventInfo i
return HookResult.Continue;
}

[GameEventHandler]
[GameEventHandler(HookMode.Pre)]
public HookResult OnPlayerDeath(EventPlayerDeath @event, GameEventInfo info)
{
info.DontBroadcast = true;
Expand Down

0 comments on commit 1fa1504

Please sign in to comment.