作者justinj (闇冥)
看板mud_sanc
标题[wizs] 镶篏+头衔
时间Tue Apr 27 11:03:03 2010
基本上是打不下去了......(被那一堆变态小兵搞)
所以po出来给别人来帮忙想一下好了..avert
------------------------------------------------------------------------------
#include "../dark.h"
inherit ARMOR;
mixed title_head=({
({HIR"力量的"NOR,"stat-str",5}),
({HIY"体力的"NOR,"stat-con",5}),
({HIR"魔力的"NOR,"stat-mag",5}),
({HIC"敏捷的"NOR,"stat-dex",5}),
({HIG"理智的"NOR,"stat-int",5}),
({HIB"气劲的"NOR,"stat-air",5}),
({HIM"感性的"NOR,"stat-fel",5}),
({HIR"炎热的"NOR,"fire",5}),
({HIC"寒冷的"NOR,"ice",5}),
({HIR"暴风的"NOR,"wind",5}),
({HIR"圣洁的"NOR,"light",5}),
({HIP"闇黑的"NOR,"dark",5}),
});
int base_effect() //tile的显示
{
int r;
if(!query("num")) set("num",random(sizeof(title_head)));
r=query("num");
set("short",title_head[r][0]+query("short"));
add("effect/"+title_head[r][1],title_head[r][2]);
return 1;
}
int hole_view(mixed hole) //孔的显示模式
{
int i=sizeof(hole);
string str;
switch(i)
{
case 1:
str="\n "+hole[0]+"\n";
break;
case 2:
str="\n "+hole[0]+" "+hole[1]+"\n";
break;
case 3:
str="\n "+hole[0]+
"\n "+hole[1]+" "+hole[2]+"\n";
break;
case 4:
str="\n "+hole[0]+" "+hole[1]+
str="\n "+hole[2]+" "+hole[3]+"\n";
break;
default:return notify_fail("目前没有那麽多孔\n");
}
set("long",query("long")+str);
return 1;
}
int insert_effect(string path,string hole) //卡片的影响{卡片路径,第X孔}
{
object ob=find_object_or_load(path);
int j,value;
mixed key1,key2;
string name2;
name2=ob->query("name"); //卡片名字
set("hole/"+hole,path); //插入第X孔
set("holev/"+hole,name2); //暂时显示名字的
hole_view(values(query("holev")));//放入显示
key1=keys(query("effect"));
key2=keys(ob->query("effect"));
foreach(string key in key2)
{
value=ob->query("effect/"+key);
if(member_array(key,key1)!=-1)
{
j=query("effect/"+key);
j+=value;
set("effect/"+key,j);
}
else
{
set("effect/"+key,value);
}
}
ob->remove();
return 1;
}
int insert_card(string name,string hole) //插入卡片
{
object ob,ppl=this_player();
string path;
if(!hole||!name)
return notify_fail(HIC"insert 物品 in 第几个孔\n"NOR);
if(query(hole)!="空的")
return notify_fail(HIR"这个孔已经插过了!\n"NOR);
if(!ob=present(name,ppl))
return notify_fail(HIB"你身上没有这个物品!\n"NOR);
path=base_name(ob->query("name"));//卡片基本位置
set("hole/"+hole,path);
write(HIR"你将"+ob->query("name")+HIR"插入了"+query("name")+HIR"之中了\n"NOR);
insert_effect(path,hole);
}
--------------------------------------------------------------------------
还缺未监定的物品,显示要怎样才比较好,title_head还要可以加的不止单属性
等.....(ps.内容总觉得有那些出问题...avert)
这个是想拿来给其它eq inherit用的.....
--
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.129.141.105