Manual Gun Mode Source 1.5Gunz The Duel
Manual para agregar a tu código fuente el nuevo modo de juego para Gunz. El GunMode hasta ahora ha sido presentado por algunos servidores con 2 distintos sistemas lógicos.
- El Gun Mode consiste en que durante una ronda, los personajes tienes un cierto rango de Niveles los cuales se aumentan matando a otros personajes, y por cada Kill recibirán de forma ALEATORIA un paquetes de armas(espada,arma primaria, arma secundaria).
- El Gun Mode consiste en que durante una ronda, los personajes tienes un cierto rango de Niveles los cuales se aumentan matando a otros personajes, mediante un sistema que promedia los Kills y requiere por cada nivel mayor cantidad de Kills para poder pasar al siguiente nivel y premiar con un paquetes de armas(espada,arma primaria, arma secundaria) las cuales son de mejor nivel según el nivel del Gun Mode.
----------------------------
Aclaración: Este modo de juego a sido programado y codeado en base a mi lógica y conocimiento de programación, no es extraído de algún código fuente de otros servidores.
Datos:
Este modo de juego se codeo en base a los sources de (Gunz 1.5 Repack By jur13n).
CSCommon\Include\MBaseGameType.h:
//Buscar esta linea: MMATCH_GAMETYPE_CTF =12, //Pegar esta debajo: MMATCH_GAMETYPE_GUNMODE =13,CSCommon\Include\MMatchRule.h:
//Buscar esta linea: (nGameType == MMATCH_GAMETYPE_DEATHMATCH_SOLO) || //Pegar esta debajo: (nGameType == MMATCH_GAMETYPE_GUNMODE) ||CSCommon\Include\MMatchRuleDeathMatch.h:
Buscar:
//Buscar esta linea:
class MMatchRuleSoloDeath : public MMatchRule {
protected:
bool CheckKillCount(MMatchObject* pOutObject);
virtual void OnBegin();
virtual void OnEnd();
virtual void OnRoundTimeOut();
virtual bool OnCheckRoundFinish();
virtual bool RoundCount();
public:
MMatchRuleSoloDeath(MMatchStage* pStage);
virtual ~MMatchRuleSoloDeath() { }
virtual MMATCH_GAMETYPE GetGameType() { return MMATCH_GAMETYPE_DEATHMATCH_SOLO; }
};
//Pegar esta debajo:
class MMatchRuleGunMode : public MMatchRule {
protected:
bool CheckKillCount(MMatchObject* pOutObject);
virtual void OnBegin();
virtual void OnEnd();
virtual void OnRoundTimeOut();
virtual bool OnCheckRoundFinish();
virtual bool RoundCount();
public:
MMatchRuleGunMode(MMatchStage* pStage);
virtual ~MMatchRuleGunMode() { }
virtual MMATCH_GAMETYPE GetGameType() { return MMATCH_GAMETYPE_GUNMODE; }
};
CSCommon\Source\MBaseGameType.cpp:
//Buscar esta linea: #define MMATCH_GAMETYPE_CTF_STR "Capture the Flag" //Pegar esta debajo: #define MMATCH_GAMETYPE_GUNMODE_STR "GUN MODE" //Buscar esta linea: _InitGameType(MMATCH_GAMETYPE_CTF, MMATCH_GAMETYPE_CTF, MMATCH_GAMETYPE_CTF_STR, 1.0f, 0.6f, 0.5f); //pegar debajo: _InitGameType(MMATCH_GAMETYPE_GUNMODE, MMATCH_GAMETYPE_GUNMODE, MMATCH_GAMETYPE_GUNMODE_STR, 1.0f, 1.0f, 0.0f); //Buscar esta linea: "CTF", //CAPTURE THE FLAG //Pegar debajo "GM", //GUNMODECSCommon\Source\MMatchRuleDeathMatch.cpp:
//Buscar esta linea:
void MMatchRuleSoloDeath::OnRoundTimeOut()
{
SetRoundArg(MMATCH_ROUNDRESULT_DRAW);
}
//pegar debajo:
//////////////////////////////////////////////////////////////////////////////////
// MMatchRuleGunMode ///////////////////////////////////////////////////////////
MMatchRuleGunMode::MMatchRuleGunMode(MMatchStage* pStage) : MMatchRule(pStage)
{
}
void MMatchRuleGunMode::OnBegin()
{
}
void MMatchRuleGunMode::OnEnd()
{
}
bool MMatchRuleGunMode::RoundCount()
{
if (++m_nRoundCount < 1) return true;
return false;
}
bool MMatchRuleGunMode::CheckKillCount(MMatchObject* pOutObject)
{
MMatchStage* pStage = GetStage();
for (MUIDRefCache::iterator i=pStage->GetObjBegin(); i!=pStage->GetObjEnd(); i++)
{
MMatchObject* pObj = (MMatchObject*)(*i).second;
if (pObj->GetEnterBattle() == false) continue;
if (pObj->GetKillCount() >= (unsigned int)pStage->GetStageSetting()->GetRoundMax())
{
pOutObject = pObj;
return true;
}
}
return false;
}
bool MMatchRuleGunMode::OnCheckRoundFinish()
{
MMatchObject* pObject = NULL;
if (CheckKillCount(pObject))
{
return true;
}
return false;
}
void MMatchRuleGunMode::OnRoundTimeOut()
{
SetRoundArg(MMATCH_ROUNDRESULT_DRAW);
}
CSCommon\Source\MMatchStage.cpp:
//Buscar esta linea:
case MMATCH_GAMETYPE_CTF:
{
return (new MMatchRuleTeamCTF(this));
}
break;
//pegar debajo
case MMATCH_GAMETYPE_GUNMODE:
{
return (new MMatchRuleGunMode(this));
}
break;
Gunz\ZCombatInterface.cpp:
//Buscar esta linea:
m_nBulletCurrMagazine = 0;
//pegar debajo
m_nGunLevel = 1;
//Buscar esta linea:
DrawMyWeaponPont(pDC);
//pegar debajo
if (ZGetGame()->GetMatch()->GetMatchType()== MMATCH_GAMETYPE_GUNMODE)
{
char buffer[256];
sprintf(buffer,"[Level %d / %d ]", m_nGunLevel, ZGetGame()->GetMatch()->GetRoundCount());
TextRelative(pDC,660.f/800.f,480.f/600.f,buffer);
}
//Este codigo sirve para imprimir en pantalla el nivel de Gunz Mode que tiene el personaje
//Buscar esta linea:
UpdateCombo(pCharacter);
//pegar debajo
m_nGunLevel = AddGunLevel();
//Buscar esta linea:
void ZCombatInterface::ShowInfo(bool bVisible)
{
MWidget* pWidget;
char szTemp[256];
for (int i = 0; i < 9; i++)
{
sprintf(szTemp, "%s%d", ZIITEM_COMBAT_INFO, i);
pWidget = m_pIDLResource->FindWidget(szTemp);
if (pWidget!=NULL)
{
pWidget->Show(bVisible);
}
}
pWidget = m_pIDLResource->FindWidget(ZIITEM_COMBAT_CHATFRAME);
if (pWidget!=NULL)
{
pWidget->Show(bVisible);
}
}
//pegar debajo
void ZCombatInterface::GunMode(ZCharacter* pCharacter,const int Level){
// ZGetScreenEffectManager()->AddRoundStart(Level);
//este es un efecto predeterminado que trae el gunz.
//No es necesario que sea agregado es opcional.
int nItemMelee = 0;
int nItemPistol = 0;
int nItemSecun = 0;
//Apartir de aqui se generan los items aleatorios, es un código básico de c++,
// luego lo modificaré para que esto se conecte con XML o SQL, pero por ahora usen este
int aleatorio = rand()%3;
if(aleatorio == 0)
{
nItemMelee = 7;
nItemPistol= 505005;
nItemSecun= 5019;
}
if(aleatorio == 1)
{
nItemMelee = 502013;
nItemPistol= 504006;
nItemSecun= 506009;
}
if(aleatorio == 2)
{
nItemMelee = 18;
nItemPistol = 506007;
nItemSecun=6006; //braker 8
}
pCharacter->GetItems()->EquipItem(MMCIP_PRIMARY, nItemPistol); // Rocket
pCharacter->ChangeWeapon(MMCIP_PRIMARY);
pCharacter->ChangeWeapon(MMCIP_PRIMARY);
pCharacter->GetItems()->EquipItem(MMCIP_SECONDARY, nItemSecun); // grenade
pCharacter->ChangeWeapon(MMCIP_SECONDARY);
pCharacter->GetItems()->EquipItem(MMCIP_MELEE, nItemMelee); // dagger
pCharacter->ChangeWeapon(MMCIP_MELEE);
pCharacter->ChangeWeapon(MMCIP_CUSTOM1);
pCharacter->ChangeWeapon(MMCIP_CUSTOM2);
pCharacter->InitItemBullet();
}
/*Aqui esta el sistema logico para poder alternar la entrega de armas, en este caso el sistema pide que se genere
un numero aleatorio entre 0 y 2 (Rango: 0,1,2) es decir tiene 3 posibilidades, con esto generamos las condiciones
en las cuales se configura el ID del arma o item que se le entregará al personaje.
*/
Gunz\ZCombatInterface.h: //Buscar esta linea:
int m_nMagazine;
//pegar debajo:
int m_nGunLevel;
//Buscar esta linea:
bool IsMenuVisible() { return m_bMenuVisible; }
//pegar debajo:
void GunMode(ZCharacter* pCharacter, int GunLevel);
int AddGunLevel(){return m_nGunLevel++;};
Gunz\ZGame.cpp: //Buscar esta linea:
if (!bSuicide)
pAttacker->GetStatus().Ref().AddKills();
//reemplazar por:
if (!bSuicide)
{
pAttacker->GetStatus().Ref().AddKills();
if (GetMatch()->GetMatchType() == MMATCH_GAMETYPE_GUNMODE && pVictim != m_pMyCharacter)
{
ZGetCombatInterface()->GunMode(pAttacker,pAttacker->GetKils());
ZGetCombatInterface()->AddGunLevel();
}
}
//Buscar esta linea:
bool IsMenuVisible() { return m_bMenuVisible; }
//pegar debajo:
void GunMode(ZCharacter* pCharacter, int GunLevel);
int AddGunLevel(){return m_nGunLevel++;};
Gunz\ZGameInterface.cpp:
//Buscar esta linea: ZGetGameTypeManager()->SetGameTypeStr( MMATCH_GAMETYPE_CTF, ZMsg( MSG_MT_CTF)); //pegar debajo: ZGetGameTypeManager()->SetGameTypeStr( MMATCH_GAMETYPE_GUNMODE, "GunMode");Gunz\ZRule.cpp:
//Buscar esta linea:
case MMATCH_GAMETYPE_DEATHMATCH_SOLO:
{
return (new ZRuleSoloDeathMatch(pMatch));
}
break;
//pegar debajo:
case MMATCH_GAMETYPE_GUNMODE:
{
return (new ZRuleGunMode(pMatch));
}
break;
Gunz\ZRuleDeathMatch.cpp:
//Buscar esta linea:
ZRuleSoloDeathMatch::ZRuleSoloDeathMatch(ZMatch* pMatch) : ZRule(pMatch)
{
}
ZRuleSoloDeathMatch::~ZRuleSoloDeathMatch()
{
}
//pegar debajo:
/////////////////////////////////////////////////////////////////////////////////////////
ZRuleGunMode::ZRuleGunMode(ZMatch* pMatch) : ZRule(pMatch)
{
}
ZRuleGunMode::~ZRuleGunMode()
{
}
Gunz\ZRuleDeathMatch.h:
//Buscar esta linea:
class ZRuleSoloDeathMatch : public ZRule
{
public:
ZRuleSoloDeathMatch(ZMatch* pMatch);
virtual ~ZRuleSoloDeathMatch();
};
//pegar debajo:
class ZRuleGunMode : public ZRule
{
public:
ZRuleGunMode(ZMatch* pMatch);
virtual ~ZRuleGunMode();
};
Gunz\ZStageInterface.cpp:
//Buscar esta linea:
case MMATCH_GAMETYPE_DEATHMATCH_SOLO:
color = SDM_COLOR;
break;
//pegar debajo:
case MMATCH_GAMETYPE_GUNMODE:
color = SDM_COLOR;
break;
//Buscar esta linea:
ZApplication::GetGameInterface()->UpdateBlueRedTeam();
// °ÔÀÓ ¹æ½Ä¿¡ µû¶ó¼ UI¸¦ º¯°æÇÑ´Ù
MAnimation* pAniMapImg = (MAnimation*)pResource->FindWidget( "Stage_MapNameBG");
bool bQuestUI = false;
if ( (pSetting->nGameType == MMATCH_GAMETYPE_DEATHMATCH_SOLO) ||
//pegar debajo:
(pSetting->nGameType == MMATCH_GAMETYPE_GUNMODE) ||
//Buscar esta linea:
MWidget* pWidget = ZApplication::GetGameInterface()->GetIDLResource()->FindWidget( "StageRoundCountLabel");
if ( pWidget)
{
if ((pSetting->nGameType == MMATCH_GAMETYPE_DEATHMATCH_SOLO) ||
//pegar debajo:
(pSetting->nGameType == MMATCH_GAMETYPE_GUNMODE) ||
Historial:
- Nivel inicial = 1 [Corregido]
- Efecto Round * [Removido]
- Conexión a SQL Serv [Proceso]
queria saber si fuera tan amable de arreglar el cambio de armas, ya que solo se ve para uno mismo pero para los demas no se les ve el cambio que se hace seria tan amable por favor.
ResponderEliminarI Have Problem with "_InitGameType(MMATCH_GAMETYPE_GUNMODE, MMATCH_GAMETYPE_GUNMODE, MMATCH_GAMETYPE_GUNMODE_STR, 1.0f, 1.0f, 0.0f);"
ResponderEliminareasy problem add me!
ResponderEliminarhttps://www.facebook.com/ArenNay
Amigo Yo tengo esas mismas files que tu me podrias ayudar a agregar ese gunmode me gustaria aplicarlo aqui mi face por favor si puedes ayudame https://www.facebook.com/TeAmoCarve?ref=tn_tnmn
ResponderEliminarhave 1 error
ResponderEliminarno found :
zgame.cpp
bool IsMenuVisible() { return m_bMenuVisible; }
:S help me
How to fix 1/0 level
ResponderEliminar