Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
ST-Chara committed Feb 18, 2024
1 parent f8f3fd8 commit ba2abe5
Show file tree
Hide file tree
Showing 11 changed files with 599 additions and 505 deletions.
1 change: 1 addition & 0 deletions maps/Area-51.map.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sv_timelimit 3
1 change: 1 addition & 0 deletions maps/Ice-house.map.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sv_timelimit 5
1 change: 1 addition & 0 deletions maps/Pharao-Pyramid.map.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sv_timelimit 4
1 change: 1 addition & 0 deletions maps/THE_WORLD.map.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sv_timelimit 3
1 change: 1 addition & 0 deletions maps/xPanic life.map.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sv_timelimit 4
14 changes: 7 additions & 7 deletions src/game/server/entities/character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ bool CCharacter::Spawn(CPlayer *pPlayer, vec2 Pos)
m_Core.m_ActiveWeapon = WEAPON_GUN;

m_Core.m_Jumps = 2 + pPlayer->m_JumpsShop;
if (pPlayer->m_AccData.m_Level >= 50 && pPlayer->m_AccData.m_Level <= 99)
if (pPlayer->m_AccData.m_Level >= 10 && pPlayer->m_AccData.m_Level <= 20)
m_mAmmo = 20 + pPlayer->m_AccData.m_Ammo;
else if (pPlayer->m_AccData.m_Level >= 100)
else if (pPlayer->m_AccData.m_Level >= 20)
m_mAmmo = 30 + pPlayer->m_AccData.m_Ammo;
else
m_mAmmo = 10 + pPlayer->m_AccData.m_Ammo;
Expand Down Expand Up @@ -217,7 +217,7 @@ void CCharacter::FireWeapon()

bool FullAuto = false;
if (m_Core.m_ActiveWeapon == WEAPON_GRENADE || m_Core.m_ActiveWeapon == WEAPON_SHOTGUN || m_Core.m_ActiveWeapon == WEAPON_GUN ||
m_Core.m_ActiveWeapon == WEAPON_HAMMER && m_pPlayer->m_AccData.m_Level >= 10 || m_Core.m_ActiveWeapon == WEAPON_GUN)
m_Core.m_ActiveWeapon == WEAPON_HAMMER && m_pPlayer->m_AccData.m_Level >= 5 || m_Core.m_ActiveWeapon == WEAPON_GUN)
FullAuto = true;

// check if we gonna fire
Expand Down Expand Up @@ -279,7 +279,7 @@ void CCharacter::FireWeapon()
{
CCharacter *pTarget = apEnts[i];

if (pTarget == this || (pTarget->IsAlive() && GameServer()->Collision()->IntersectLine(ProjStartPos, pTarget->m_Pos, NULL, NULL, false)) || pTarget->m_pPlayer->GetTeam() == TEAM_RED)
if (pTarget == this || (pTarget->IsAlive() && GameServer()->Collision()->IntersectLine(ProjStartPos, pTarget->m_Pos, NULL, NULL, false) && !GetPlayer()->m_RangeShop) || pTarget->m_pPlayer->GetTeam() == TEAM_RED)
continue;

if (length(pTarget->m_Pos - ProjStartPos) > 0.0f)
Expand Down Expand Up @@ -333,10 +333,10 @@ void CCharacter::FireWeapon()

case WEAPON_SHOTGUN:
{
int ShotSpread = 5 + m_pPlayer->m_AccData.m_Level / 10;
int ShotSpread = 5 + m_pPlayer->m_AccData.m_Level / 4;
if (ShotSpread > 15)
{
ShotSpread = 15 + m_pPlayer->m_AccData.m_Level / 70;
ShotSpread = 15 + m_pPlayer->m_AccData.m_Level / 8;
if (ShotSpread > 36)
ShotSpread = 36;
}
Expand Down Expand Up @@ -798,7 +798,7 @@ bool CCharacter::TakeDamage(vec2 Force, int Dmg, int From, int Weapon)
{
if (From >= 0 && m_pPlayer->GetCID() != From && GameServer()->m_apPlayers[From])
{
ExperienceAdd(3 + m_pPlayer->m_AccData.m_Level / 40 * g_Config.m_SvExpBonus, From);
ExperienceAdd(3 + m_pPlayer->m_AccData.m_Level / 10 * g_Config.m_SvExpBonus, From);
GameServer()->m_apPlayers[From]->m_KillingSpree++;
if (GameServer()->m_apPlayers[From]->m_KillingSpree == g_Config.m_SvKillingSpree)
{
Expand Down
39 changes: 31 additions & 8 deletions src/game/server/entities/cmds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void CCmd::ChatCmd(CNetMsg_Cl_Say *Msg)
if (m_pPlayer->m_AccData.m_Ammoregen >= 60)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("子弹恢复已达到最高级 (60)."));
if (m_pPlayer->m_AccData.m_Money <= 0)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("穷逼 (1点都出不起)."));
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("哥们以为他真的有点数升级."));

m_pPlayer->m_AccData.m_Money--, m_pPlayer->m_AccData.m_Ammoregen++;
str_format(andg, sizeof(andg), "当前子弹恢复等级: %d, 当前升级点: %d", m_pPlayer->m_AccData.m_Ammoregen, m_pPlayer->m_AccData.m_Money);
Expand Down Expand Up @@ -246,7 +246,7 @@ void CCmd::ChatCmd(CNetMsg_Cl_Say *Msg)
if (m_pPlayer->m_AccData.m_TurretSpeed >= 500)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("已达到炮塔最高速度"));
if (m_pPlayer->m_AccData.m_TurretMoney <= 0)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("你个穷逼"));
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("哥们以为他真的有点数升级"));

m_pPlayer->m_AccData.m_TurretMoney--, m_pPlayer->m_AccData.m_TurretSpeed++;
str_format(andg, sizeof(andg), "你的炮塔速度提升了, 现在是: %d", m_pPlayer->m_AccData.m_TurretSpeed);
Expand Down Expand Up @@ -522,33 +522,40 @@ void CCmd::ChatCmd(CNetMsg_Cl_Say *Msg)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("只能在活着的时候使用!"));
if (GameServer()->m_World.m_Paused)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("稍等片刻."));
if (m_pPlayer->m_Score < 3)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("你没有足够的分数 (3分)."));
if (m_pPlayer->m_Score < 5)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("你没有足够的分数 (5分)."));

GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("完成!"));
m_pPlayer->m_JumpsShop++;
m_pPlayer->m_Score -= 3;
m_pPlayer->m_Score -= 5;
GameServer()->GetPlayerChar(m_pPlayer->GetCID())->m_Core.m_Jumps += 1;
return;
}
else if (!strcmp(Msg->m_pMessage, "/range"))
{
LastChat();

if (!m_pPlayer->m_AccData.m_UserID)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("你还没有登录!"));

if (!GameServer()->GetPlayerChar(m_pPlayer->GetCID()))
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("只能活着的时候用!"));

if (GameServer()->m_World.m_Paused)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("等回合结束."));

if (m_pPlayer->GetTeam() != TEAM_RED)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("只能僵尸用!"));
if (m_pPlayer->m_Score < 10)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("你没有足够的分数 (10分)."));

if (m_pPlayer->m_Score < 25)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("你没有足够的分数 (25分)."));

if (m_pPlayer->m_RangeShop)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("只能购买一次!(生效直到切换地图)"));

GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("完成!"));
m_pPlayer->m_RangeShop = true;
m_pPlayer->m_Score -= 10;
m_pPlayer->m_Score -= 25;
return;
}
else if (!strncmp(Msg->m_pMessage, "/prefix", 7) && m_pPlayer->m_AccData.m_UserID &&
Expand Down Expand Up @@ -629,6 +636,22 @@ void CCmd::ChatCmd(CNetMsg_Cl_Say *Msg)
GameServer()->m_apPlayers[cid2]->m_pAccount->Apply();
return;
}
else if (!strncmp(Msg->m_pMessage, "/setscore", 9) && GameServer()->Server()->IsAuthed(m_pPlayer->GetCID()))
{
LastChat();
int id, size;
if ((sscanf(Msg->m_pMessage, "/setscore %d %d", &id, &size)) != 2)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("Please use: /setscore <id> <score>"));

int cid2 = clamp(id, 0, (int)MAX_CLIENTS - 1);
if (!GameServer()->m_apPlayers[cid2])
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("There is no such player!'"));
if (!GameServer()->m_apPlayers[cid2]->m_AccData.m_UserID)
return GameServer()->SendChatTarget(m_pPlayer->GetCID(), _("The player is not logged in account!"));
GameServer()->SendChatTarget(cid2, _("Your score changed!'"));
GameServer()->m_apPlayers[cid2]->m_Score = size;
return;
}
else if (!strncmp(Msg->m_pMessage, "/freeze", 6) && (m_pPlayer->m_AccData.m_PlayerState == 1 || GameServer()->Server()->IsAuthed(m_pPlayer->GetCID())))
{
LastChat();
Expand Down
Loading

0 comments on commit ba2abe5

Please sign in to comment.