下面是引用 史来姆 于 2010-07-27 19:55 发表的 :
为甚么都是不行
复制程式
else if ((get_playersnum() <= 10 && fnGetZombies() <= 1) || (10 < get_playersnum() <= 20 && fnGetZombies() <= 2) || (20< get_playersnum()<=32 && fnGetZombies() <= 3))
我设成31bot,加上我 = 32人
20秒后,只有一只而已.......
后来有测试过了…那写法只是满足「依照人数来决定有几个尸王」的内容…
如果想要倒数结束后出现你想要的人数的话…需要再多写其他内容:
寻找「make_a_zombie(mode, id)」里的:
// Single Infection Mode
g_lastmode = MODE_INFECTION
// Turn player into the first zombie
zombieme(id, 0, 0, 0)
改成
复制程式
// Single Infection Mode
g_lastmode = MODE_INFECTION
// Turn player into the first zombie
if (get_playersnum() <= 10)
{
zombieme(id, 0, 0, 0)
}
else if (10 < get_playersnum() <= 20)
{
static id_next
do
{
id_next = random_num(1, iPlayersnum)
}
while(id_next == id)
zombieme(id, 0, 0, 0)
zombieme(id_next, 0, 0, 0)
}
else
{
static id_next, id_last
do
{
id_next = random_num(1, iPlayersnum)
}
while(id_next == id)
do
{
id_last = random_num(1, iPlayersnum)
}
while(id_last == id || id_last == id_next)
zombieme(id, 0, 0, 0)
zombieme(id_next, 0, 0, 0)
zombieme(id_last, 0, 0, 0)
}
不过这样改的缺点是:
如果假设你用32人…即是会出现3只尸王时…
如果僵尸的数量一直没超过3只的话…
这段时间任何人变成僵尸都会是尸王…
如果看不懂我想表达的…就进入游戏里测试就知道了…