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

Commit

Permalink
Minor QoL changes (v0.1.7)
Browse files Browse the repository at this point in the history
  • Loading branch information
KiwifruitDev committed Oct 22, 2020
1 parent 5ed3e7a commit 899a5b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 14 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ This gamemode has yet to be fully released and is currently in early testing.

[TF2Items](https://builds.limetech.io/?p=tf2items)

[TF2Items Give Weapon](https://forums.alliedmods.net/showthread.php?t=141962)

## References
[Sort Numbers](https://forums.alliedmods.net/showthread.php?t=187237) (References code for sorting votes)

[Sapper Immunity](https://forums.alliedmods.net/showthread.php?p=1329948) (Sapper functionality)

[Freak Fortess 2](https://forums.alliedmods.net/showthread.php?t=229013) (Version checking, phrases, config generation)

[Show fog to a specific client](https://forums.alliedmods.net/showthread.php?t=205788) (not yet implemented but will be used for fog if enabled by server)
[Show fog to a specific client](https://forums.alliedmods.net/showthread.php?t=205788) (Will be used for fog if enabled by server)

[TF2 Events Need Help](https://forums.alliedmods.net/showpost.php?p=862230&postcount=6) (Used to detect TF2 round state)

[Map Trigger Condition](https://forums.alliedmods.net/showthread.php?t=257579) (Will be used to detect map triggers)

## Credits
[TeamPopplio](https://github.com/TeamPopplio/) (Main development)

Expand Down
26 changes: 15 additions & 11 deletions addons/sourcemod/scripting/amongus.sp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ ambitous project for myself and others.
Original Concept - IceboundCat6
Lead Development - MouseDroidPoW
SourcePawn Help - puntero
(Feel free to add your name here)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Expand All @@ -19,7 +21,6 @@ Lead Development - MouseDroidPoW
#include <morecolors>
#include <sdkhooks>
#include <tf2items>
#include <tf2items_giveweapon>
#include <stocksoup/entity_prefabs>
#include <steamtools> //should we still undef extensions? no documentation...

Expand All @@ -37,7 +38,7 @@ Lead Development - MouseDroidPoW

#define MAJOR_REVISION "0"
#define MINOR_REVISION "1"
#define STABLE_REVISION "6"
#define STABLE_REVISION "7"
#define PLUGIN_VERSION MAJOR_REVISION..."."...MINOR_REVISION..."."...STABLE_REVISION

enum PlayerState
Expand Down Expand Up @@ -578,21 +579,21 @@ public Action VoteTimer(Handle timer)
{
if(IsValidClient(i))
{
if(playerState[i] == State_Impostor)
g_knifeCount[i] = knifeConVarCount.IntValue;
switch(playerState[i])
{
case State_Impostor:
g_knifeCount[i] = knifeConVarCount.IntValue;
case State_Ghost:
SetEntityMoveType(firstVote, MOVETYPE_NOCLIP);
SetEntityMoveType(i, MOVETYPE_NOCLIP);
case State_ImpostorGhost:
SetEntityMoveType(firstVote, MOVETYPE_NOCLIP);
SetEntityMoveType(i, MOVETYPE_NOCLIP);
default:
SetEntityMoveType(i, MOVETYPE_WALK);
}
voteCounter[i] = 0;
}
}
if(GetNonGhostTeamCount(TFTeam_Red)-activeImpostors <= 2)
if(GetNonGhostTeamCount(TFTeam_Red)-activeImpostors <= 1)
RoundWon(State_Impostor);
else if(activeImpostors == 0)
RoundWon(State_Crewmate);
Expand Down Expand Up @@ -626,10 +627,12 @@ public Action GameStart(Handle event, char[] name, bool:Broadcast) {
if(GetClientCount(true) >= requiredToStart.IntValue)
{
int iSkin = 0; //0 - 11
char iSkinName[MAX_NAME_LENGTH];
for(new Client = 1; Client <= MaxClients; Client++)
{
if(IsValidClient(Client))
{
SkinSwitch(Client, Skin_Name, iSkinName);
g_knifeCount[Client] = -3; //crewmates shouldn't have a knife count
SetClientListeningFlags(Client, VOICE_NORMAL);
TF2_ChangeClientTeam(Client,TFTeam_Red);
Expand All @@ -640,7 +643,7 @@ public Action GameStart(Handle event, char[] name, bool:Broadcast) {
TF2_RemoveWeaponSlot(Client,5); //there seven
TF2_RemoveWeaponSlot(Client,6); //weapon slots
EmitSoundToClient(Client, SPAWN_SOUND);
PrintCenterText(Client,"%t","state_crewmate");
PrintCenterText(Client,"%t (%s)","state_crewmate",iSkinName);
voteStorage[Client] = 0;
playerState[Client] = State_Crewmate;
SDKUnhook(Client, SDKHook_OnTakeDamage, OnTakeDamage);
Expand Down Expand Up @@ -682,8 +685,9 @@ public Action GameStart(Handle event, char[] name, bool:Broadcast) {
randomClient = GetRandomInt(1, MaxClients); //absolutely sucks
}
while(!IsClientInGame(randomClient) || TF2_GetClientTeam(randomClient) != TFTeam_Red || playerState[randomClient] == State_Impostor);
SkinSwitch(randomClient, Skin_Name, iSkinName);
playerState[randomClient] = State_Impostor;
PrintCenterText(randomClient,"%t","state_impostor");
PrintCenterText(randomClient,"%t (%s)","state_impostor",iSkinName);
int glow = TF2_AttachBasicGlow(randomClient, TFTeam_Red); //impostors get a nice glow effect
SetEntityRenderColor(glow, 255, 0, 0, 0);
SDKHook(glow,SDKHook_SetTransmit,Hook_SetTransmitImpostor);
Expand Down Expand Up @@ -803,9 +807,9 @@ public Action UITimer(Handle timer, int userid)
case (State_Impostor):
{
SetHudTextParams(0.15, 0.15, 3.0, 255, 0, 0, 255, 1, 6.0, 0.1, 0.1);
if (g_knifeCount[client] > 1)
if (g_knifeCount[client] > 1 || g_knifeCount[client] == 0)
ShowSyncHudText(client, g_hHud, "%t\n%t\n%t","knifedelayplural",g_knifeCount[client],"impostor_description","faketasks");
else if (g_knifeCount[client] > 0)
else if (g_knifeCount[client] >= 0)
ShowSyncHudText(client, g_hHud, "%t\n%t\n%t","knifedelay",g_knifeCount[client],"impostor_description","faketasks");
else
ShowSyncHudText(client, g_hHud, "%t\n%t","impostor_description","faketasks");
Expand Down

0 comments on commit 899a5b2

Please sign in to comment.