Skip to content

Commit

Permalink
高级人机分数平衡,text插件增加生还满人自动关闭高级人机功能
Browse files Browse the repository at this point in the history
刷特仁慈一点,有tank的时候或者倒地或死亡的人数过半刷特时间不小于设置时间*1.25(16s就是20s)
  • Loading branch information
fantasylidong committed Jan 5, 2023
1 parent d2ab13f commit 0da8124
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 4 deletions.
5 changes: 4 additions & 1 deletion Update_log.md
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ witchparty 和 allcharger模式在普通药役的基础上小僵尸再减少17-2
- 自动增加时间效果为,当特感数量低于特感上限/4向下取整+1的数量,或者猴子猎人牛全死或者达到刷特间隔/2时间后,再开启刷特,杀的越快,刷的波数越多,鼓励玩家更有变化的玩,而不是死站桩,站桩依旧有效,但是会面临更多的波数(相当于保底是以前的刷特难度)
- 固定时间效果为: 刷特间隔1.5倍后刷特,16s的话,和原来难度是一样的,24s刷特(原来是小于9s+4s,否则加8s)
- 两种模式可以投票选择,默认自动时间刷特
- 刷特仁慈一点,有tank的时候刷特时间不小于设置时间*1.25(16s就是20s)
- 刷特仁慈一点,有tank的时候或者倒地或死亡的人数过半刷特时间不小于设置时间*1.25(16s就是20s)

#### text插件
- 适配新版刷特,提示为固定6特16秒或者自动6特16秒
Expand Down Expand Up @@ -271,6 +271,9 @@ witchparty 和 allcharger模式在普通药役的基础上小僵尸再减少17-2
- 基于 1.0 版本改造更新,精简代码,优化部分逻辑,增加被控目标优先级功能
- ai_SpitterPinnedPr:6,3,1,5 被控目标的优先级,口水会优先吐优先级高的目标,如果看不到目标则使用默认目标(特感编号,逗号分割)

#### text
- text插件增加生还满人自动关闭高级人机功能

#### 其他
- 修改特感增强里检测是否在地面的方式
- 修正一点翻译错误
Binary file modified addons/sourcemod/plugins/extend/l4d_stats.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/extend/rpg.smx
Binary file not shown.
Binary file removed addons/sourcemod/plugins/extend/text.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/AnneHappy/infected_control.smx
Binary file not shown.
Binary file modified addons/sourcemod/plugins/optional/AnneHappy/text.smx
Binary file not shown.
19 changes: 18 additions & 1 deletion addons/sourcemod/scripting/AnneHappy/infected_control.sp
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ public Action CheckShouldSpawnOrNot(Handle timer)
g_iLastSpawnTime ++;
if(!g_bIsLate) return Plugin_Stop;
if(!g_bShouldCheck && g_hSpawnProcess != INVALID_HANDLE) return Plugin_Continue;
if(IsAnyTankAlive() && g_iLastSpawnTime < RoundToFloor(g_fSiInterval / 2)) return Plugin_Continue;
if((IsAnyTankAlive()|| IsAboveHalfSurvivorDownOrDied()) && g_iLastSpawnTime < RoundToFloor(g_fSiInterval / 2)) return Plugin_Continue;
if(!g_bAutoSpawnTimeControl)
{
g_bShouldCheck = false;
Expand Down Expand Up @@ -1670,3 +1670,20 @@ stock void Debug_Print(char[] format, any ...)
#endif
}

stock bool IsAboveHalfSurvivorDownOrDied()
{
int count = 0;
for(int i = 1; i <= MaxClients; i ++)
{
if(IsValidSurvivor(i) && (L4D_IsPlayerIncapacitated(i) || !IsPlayerAlive(i)))
{
count ++;
}
}
if(count >= RoundToCeil(FindConVar("survivor_limit").IntValue / 2.0))
{
return true;
}
return false;
}

11 changes: 11 additions & 0 deletions addons/sourcemod/scripting/AnneHappy/text.sp
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,12 @@ public void OnClientPutInServer(int Client)
L4D_LobbyUnreserve();
ServerCommand("sm_cvar sv_allow_lobby_connect_only 0");
}
if(MaxPlayers == getBotLimit())
{
ConVar gjrj = FindConVar("sb_fix_enabled");
if(gjrj != null && gjrj.BoolValue)
SetConVarInt(gjrj, false);
}
printinfo(Client, false);
}
}
Expand Down Expand Up @@ -275,4 +281,9 @@ stock bool Incapacitated(int client)
if (!IsPlayerAlive(client)) bIsIncapped = true;
}
return bIsIncapped;
}

stock int getBotLimit()
{
return FindConVar("survivor_limit").IntValue;
}
24 changes: 24 additions & 0 deletions addons/sourcemod/scripting/extend/l4d_stats.sp
Original file line number Diff line number Diff line change
Expand Up @@ -4454,6 +4454,11 @@ public Action:event_CampaignWin(Handle:event, const String:name[], bool:dontBroa
Score = RoundToFloor(Score * (4.0 / getSurvivorNum()));
}

if(IsGaoJiRenJiEnabled())
{
Score = RoundToFloor(Score * 0.5);
}

if (Mode && Score > 0)
{
StatsPrintToChatTeam(TEAM_SURVIVORS, "\x03所有幸存者 \x01获得了 \x04%i \x01分 by \x05%i 幸存者\x01完成了 \x04救援关 \x01!", Score, SurvivorCount);
Expand Down Expand Up @@ -9895,6 +9900,11 @@ public CheckSurvivorsWin()
Score = RoundToFloor(Score * (4.0 / getSurvivorNum()));
}

if(IsGaoJiRenJiEnabled())
{
Score = RoundToFloor(Score * 0.5);
}

if (Mode && Score > 0)
{
StatsPrintToChatTeam(TEAM_SURVIVORS, "\x03所有幸存者 \x01获得 \x04%i \x01分 by \x05%i 死亡到达安全门!", Score, Deaths);
Expand Down Expand Up @@ -11848,3 +11858,17 @@ public ReadDbMotdCallback(Handle:owner, Handle:hndl, const String:error[], any:d
SQL_FetchString(hndl, 0, MessageOfTheDay, sizeof(MessageOfTheDay));
}
}

stock bool IsGaoJiRenJiEnabled()
{
ConVar gjrj = FindConVar("sb_fix_enabled");
if(gjrj == null)
{
return false;
}
else if(gjrj.BoolValue)
{
return true;
}
return false;
}
19 changes: 17 additions & 2 deletions addons/sourcemod/scripting/extend/rpg.sp
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ public void RewardScore(){
if(FindConVar("l4d_ready_cfg_name"))
{
int renji=0;
if(GaoJiRenJi != null && GaoJiRenJi.IntValue == 1){
GaoJiRenJi = FindConVar("sb_fix_enabled");
if(GaoJiRenJi != null && GaoJiRenJi.BoolValue){
PrintToChatAll("\x01[\x04RANK\x01]\x04由于开启了高级人机,不能获得额外过关积分");
return;
}
Expand Down Expand Up @@ -776,7 +777,8 @@ public Action L4D_OnFirstSurvivorLeftSafeArea(int client)
}
}
}
if(GaoJiRenJi != null && GaoJiRenJi.IntValue == 1){
GaoJiRenJi = FindConVar("sb_fix_enabled");
if(GaoJiRenJi != null && GaoJiRenJi.BoolValue){
PrintToChatAll("\x01[\x04RANK\x01]\x04由于开启了高级人机,不能获得额外积分,也不会更新地图记录");
valid = false;
}
Expand Down Expand Up @@ -2160,4 +2162,17 @@ stock int getSurvivorNum()
}
}
return count;
}
stock bool IsGaoJiRenJiEnabled()
{
ConVar gjrj = FindConVar("sb_fix_enabled");
if(gjrj == null)
{
return false;
}
else if(gjrj.BoolValue)
{
return true;
}
return false;
}

0 comments on commit 0da8124

Please sign in to comment.