From 4fc9071ecd8c50f972beb65adda9160c83bcc6b9 Mon Sep 17 00:00:00 2001 From: ChillerDragon Date: Thu, 1 Aug 2019 18:11:35 +0200 Subject: [PATCH] Version 0001 --- src/engine/client/client.cpp | 4 +++- src/game/client/components/chat.cpp | 21 +++++++++++++++++++++ src/game/client/components/chat.h | 1 + src/game/version.h | 1 + 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/engine/client/client.cpp b/src/engine/client/client.cpp index 6117102546..713eb7c03b 100644 --- a/src/engine/client/client.cpp +++ b/src/engine/client/client.cpp @@ -1820,7 +1820,9 @@ void CClient::Run() GameClient()->OnInit(); char aBuf[256]; - str_format(aBuf, sizeof(aBuf), "version %s", GameClient()->NetVersion()); + str_format(aBuf, sizeof(aBuf), "teeworlds version %s", GameClient()->NetVersion()); + m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "client", aBuf); + str_format(aBuf, sizeof(aBuf), "chillerbot-h7 version %s", CHILLERBOT_VERSION); m_pConsole->Print(IConsole::OUTPUT_LEVEL_STANDARD, "client", aBuf); if(str_comp(GameClient()->NetVersionHashUsed(), GameClient()->NetVersionHashReal())) { diff --git a/src/game/client/components/chat.cpp b/src/game/client/components/chat.cpp index 14d3ee7b20..ad15f82e0b 100644 --- a/src/game/client/components/chat.cpp +++ b/src/game/client/components/chat.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "chat.h" #include "binds.h" @@ -230,12 +231,32 @@ void CChat::ClearInput() m_pCommands->Reset(); } +void CChat::ChillerbotMessage(const char *pMsg) +{ + if(str_find_nocase(pMsg, "bot?") || + str_find_nocase(pMsg, "info();") || + str_find_nocase(pMsg, "version();") || + str_find_nocase(pMsg, "help();") || + str_find_nocase(pMsg, "!help") || + str_find_nocase(pMsg, "!info")) + { + char aBuf[128]; + str_format(aBuf, sizeof(aBuf), "[chillerbot-h7] chillerbot.png headless (v%s)", CHILLERBOT_VERSION); + Say(CHAT_ALL, aBuf); + } + else if(str_find_nocase(pMsg, "I was a faithful friend from the start. The best friend? No. But I was a faithful friend. From map to map, I helped jao get across hard barriers. We talked and talked, about the future, what teeworlds could hold. We had wonderful moments together, ...")) + { + Say(CHAT_ALL, "... memories that would last a lifetime. Whenever I would see him on a server, a new journey would spark up as we explored the wonders of each map. And now? he won't fucking transfer my points"); + } +} + void CChat::OnMessage(int MsgType, void *pRawMsg) { if(MsgType == NETMSGTYPE_SV_CHAT) { CNetMsg_Sv_Chat *pMsg = (CNetMsg_Sv_Chat *)pRawMsg; AddLine(pMsg->m_ClientID, pMsg->m_Mode, pMsg->m_pMessage, pMsg->m_TargetID); + ChillerbotMessage(pMsg->m_pMessage); } } diff --git a/src/game/client/components/chat.h b/src/game/client/components/chat.h index d7ecf81a24..125e12dfc9 100644 --- a/src/game/client/components/chat.h +++ b/src/game/client/components/chat.h @@ -149,5 +149,6 @@ class CChat : public CComponent virtual void OnRelease(); virtual void OnMessage(int MsgType, void *pRawMsg); virtual bool OnInput(IInput::CEvent Event); + void ChillerbotMessage(const char *pMsg); }; #endif diff --git a/src/game/version.h b/src/game/version.h index 06b2e117a2..89b184e28c 100644 --- a/src/game/version.h +++ b/src/game/version.h @@ -7,5 +7,6 @@ #define GAME_NETVERSION_HASH_FORCED "802f1be60a05665f" #define GAME_NETVERSION "0.7 " GAME_NETVERSION_HASH_FORCED #define CLIENT_VERSION 0x0703 +#define CHILLERBOT_VERSION "0001" static const char GAME_RELEASE_VERSION[8] = "0.7.3.1"; #endif