作者laechan (小太保)
看板mud_sanc
标题[wizs] 关於新型态区域下的 xxx.h
时间Tue Oct 30 12:22:54 2012
我们举 pal.h 为例
/u/l/laechan/area/pal/syt/pal.h
#define MOBS_DATA ({\
({"mob01",100,({"pighead monster","monster"}),"猪头人",\
-1000,1000,5,({"cape"})}),\
我打算最终型态设为
#define MOBS_DATA ({\
({"mob01",100,({"pighead monster","monster"}),"猪头人",\
-1000,1000,5,({"cape"}),({"temp","flying",1,"data","ftype","猪"})}),\
上面的意思就是说,「其它杂七杂八」的设定,通通汇到最後一
个参数里头去设。
因为锁妖塔有一只怪叫「镰刀鼬」,这只是空飘的,以上面的设
定来说就是 ({"temp","flying",1}),也就是说,只有这只怪物
跟其它只不同,所以设起来就会变成..
({"mob05",110,({"iron-fork bullhead","bullhead"}),"铁叉牛头",\
-1100,1100,5,({"cloth"})}),\
({"mob06",120,({"sickle ferret","ferret"}),"镰刀鼬",\
-1200,1200,5,({"boots"}),({"temp","flying",1})}),\
那麽,在设定上就可以这样做...
if(sizeof(datas)>8) // 代表有最後的 ({ xxx })
{
if(datas[8][0]=="data")
tmp+=" set(\""+datas[8][1]+"\","+identify(datas[8][2])+");\n";
else
tmp+=" set_temp(\""+datas[8][1]+"\","+identify(datas[8][2])+");\n";
}
这样 镰刀鼬 就会比其它 mob 多一个 set_temp("flying",1);
的设定。
然後因为这个最後的 datas 也可以支援其它的设定,所以最
终就可以将 sizeof(datas) 控制在 9 个。
({ "怪物档名",等级,({"id设定",..}),"怪物名",\
道德,金钱,只数,({"会掉的东西",..}),({其它设定...}) })
wiz 若有兴趣写新型态区域请先告知嘿,会比自己研究还快。
Laechan
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 210.61.157.53
1F:→ laechan :那还有一种做法,因为同区域下的所有mob都继承同一个 10/30 12:24
2F:→ laechan :档,所以也可以在那个档的init动手脚,只是这样较不好 10/30 12:24