📄 matlib.java
字号:
shoes[6].setMinLv(50);
shoes[6].setDesc("防御力+45,等级要求50");
shoes[6].setPrice(8500);
shoes[7]=new Mat();
shoes[7].setType(Mat.TYPE_EQUIP);
shoes[7].setName("踏雪无痕");
shoes[7].setPart(Mat.PART_FOOT);
shoes[7].setDefenceAdd(60);
shoes[7].setMinLv(60);
shoes[7].setDesc("防御力+60,等级要求60");
shoes[7].setPrice(10000);
matVC.addElement(shoes);
//盾牌
shells=new Mat[7];
shells[0]=new Mat();
shells[0].setType(Mat.TYPE_EQUIP);
shells[0].setName("木盾");
shells[0].setPart(Mat.PART_LHAND);
shells[0].setDefenceAdd(5);
shells[0].setDesc("防御力+5");
shells[0].setPrice(200);
shells[1]=new Mat();
shells[1].setType(Mat.TYPE_EQUIP);
shells[1].setName("皮盾");
shells[1].setPart(Mat.PART_LHAND);
shells[1].setDefenceAdd(10);
shells[1].setMinLv(5);
shells[1].setDesc("防御力+10,等级要求5");
shells[1].setPrice(500);
shells[2]=new Mat();
shells[2].setType(Mat.TYPE_EQUIP);
shells[2].setName("青铜盾");
shells[2].setPart(Mat.PART_LHAND);
shells[2].setDefenceAdd(20);
shells[2].setMinLv(10);
shells[2].setDesc("防御力+20,等级要求10");
shells[2].setPrice(1200);
shells[3]=new Mat();
shells[3].setType(Mat.TYPE_EQUIP);
shells[3].setName("铁甲盾");
shells[3].setPart(Mat.PART_LHAND);
shells[3].setDefenceAdd(40);
shells[3].setMinLv(20);
shells[3].setDesc("防御力+40,等级要求20");
shells[3].setPrice(2500);
shells[4]=new Mat();
shells[4].setType(Mat.TYPE_EQUIP);
shells[4].setName("钢盾");
shells[4].setPart(Mat.PART_LHAND);
shells[4].setDefenceAdd(80);
shells[4].setMinLv(30);
shells[4].setDesc("防御力+80,等级要求30");
shells[4].setPrice(5000);
shells[5]=new Mat();
shells[5].setType(Mat.TYPE_EQUIP);
shells[5].setName("乌金盾");
shells[5].setPart(Mat.PART_LHAND);
shells[5].setDefenceAdd(120);
shells[5].setMinLv(40);
shells[5].setDesc("防御力+120,等级要求40");
shells[5].setPrice(10000);
shells[6]=new Mat();
shells[6].setType(Mat.TYPE_EQUIP);
shells[6].setName("龙鳞盾");
shells[6].setPart(Mat.PART_LHAND);
shells[6].setDefenceAdd(160);
shells[6].setMinLv(50);
shells[6].setDesc("防御力+160,等级要求50");
shells[6].setPrice(20000);
matVC.addElement(shells);
//药
items=new Mat[14];
items[0]=new Mat();
items[0].setType(Mat.TYPE_USED);
items[0].setName("草药");
items[0].setLifeAdd(20);
items[0].setDesc("恢复20点气血");
items[0].setPrice(20);
items[1]=new Mat();
items[1].setType(Mat.TYPE_USED);
items[1].setName("山药");
items[1].setLifeAdd(40);
items[1].setDesc("使用后恢复40点气血");
items[1].setPrice(50);
items[2]=new Mat();
items[2].setType(Mat.TYPE_USED);
items[2].setName("七叶莲");
items[2].setLifeAdd(60);
items[2].setDesc("恢复60点气血");
items[2].setPrice(80);
items[3]=new Mat();
items[3].setType(Mat.TYPE_USED);
items[3].setName("金疮药");
items[3].setLifeAdd(120);
items[3].setDesc("恢复120点气血");
items[3].setPrice(180);
items[4]=new Mat();
items[4].setType(Mat.TYPE_USED);
items[4].setName("鹿茸");
items[4].setLifeAdd(150);
items[4].setDesc("恢复150点气血");
items[4].setPrice(250);
items[5]=new Mat();
items[5].setType(Mat.TYPE_USED);
items[5].setName("熊胆");
items[5].setLifeAdd(200);
items[5].setDesc("恢复200点气血");
items[5].setPrice(300);
items[6]=new Mat();
items[6].setType(Mat.TYPE_USED);
items[6].setName("黑玉断续膏");
items[6].setLifeAdd(400);
items[6].setDesc("恢复400点气血");
items[6].setPrice(650);
items[7]=new Mat();
items[7].setType(Mat.TYPE_USED);
items[7].setName("月见草");
items[7].setLifeAdd(40);
items[7].setMagicAdd(30);
items[7].setDesc("恢复40点气血,30点精神");
items[7].setPrice(90);
items[8]=new Mat();
items[8].setType(Mat.TYPE_USED);
items[8].setName("佛手");
items[8].setMagicAdd(20);
items[8].setDesc("恢复20点精神");
items[8].setPrice(30);
items[9]=new Mat();
items[9].setType(Mat.TYPE_USED);
items[9].setName("百色花");
items[9].setMagicAdd(30);
items[9].setDesc("恢复30点精神");
items[9].setPrice(50);
items[10]=new Mat();
items[10].setType(Mat.TYPE_USED);
items[10].setName("鬼切草");
items[10].setMagicAdd(40);
items[10].setDesc("恢复40点精神");
items[10].setPrice(70);
items[11]=new Mat();
items[11].setType(Mat.TYPE_USED);
items[11].setName("灵芝");
items[11].setMagicAdd(100);
items[11].setDesc("恢复100点精神");
items[11].setPrice(190);
items[12]=new Mat();
items[12].setType(Mat.TYPE_USED);
items[12].setName("麝香");
items[12].setMagicAdd(120);
items[12].setDesc("恢复120点精神");
items[12].setPrice(240);
items[13]=new Mat();
items[13].setType(Mat.TYPE_USED);
items[13].setName("天龙水");
items[13].setMagicAdd(150);
items[13].setDesc("恢复150点精神");
items[13].setPrice(320);
matVC.addElement(items);
}
public static Mat getMatByName(String name)
{
/*
if (name.equals(""))
return null;
Mat tmp = null;
if (tmp==null)
tmp = getItemByName(name);
else
return tmp;
if (tmp==null)
tmp = getWeaponByName(name);
else
return tmp;
return tmp;
*/
for(int i=0;matVC!=null && i<matVC.size();i++)
{
Mat[] mats=(Mat[])matVC.elementAt(i);
for(int j=0;mats!=null && j<mats.length;j++)
{
if(mats[j].getName().equals(name))
{
Mat mat=new Mat();
mat.setName(mats[j].getName());
mat.setExpAdd(mats[j].getExpAdd());
mat.setLifeAdd(mats[j].getLifeAdd());
mat.setMagicAdd(mats[j].getMagicAdd());
mat.setMaxLifeAdd(mats[j].getMaxLifeAdd());
mat.setMaxMagicAdd(mats[j].getMaxMagicAdd());
mat.setMinLv(mats[j].getMinLv());
mat.setPart(mats[j].getPart());
mat.setType(mats[j].getType());
mat.setPowerAdd(mats[j].getPowerAdd());
mat.setDefenceAdd(mats[j].getDefenceAdd());
mat.setSpeedAdd(mats[j].getSpeedAdd());
mat.setDesc(mats[j].getDesc());
mat.setPrice(mats[j].getPrice());
mat.setAmount(1);
return mat;
}
}
}
return null;
}
public static Mat getWeaponByName(String name)
{
for(int i=0;weapons!=null && i<weapons.length;i++)
{
if(weapons[i].getName().equals(name))
{
return getWeaponByIndex(i);
}
}
return null;
}
public static Mat getItemByName(String name)
{
for(int i=0;items!=null && i<items.length;i++)
{
if(items[i].getName().equals(name))
{
return getItemByIndex(i);
}
}
return null;
}
public static Mat getItemByIndex(int i)
{
if(i<0 || i>items.length-1)return null;
Mat mat=new Mat();
mat.setName(items[i].getName());
mat.setExpAdd(items[i].getExpAdd());
mat.setLifeAdd(items[i].getLifeAdd());
mat.setMagicAdd(items[i].getMagicAdd());
mat.setMaxLifeAdd(items[i].getMaxLifeAdd());
mat.setMaxMagicAdd(items[i].getMaxMagicAdd());
mat.setMinLv(items[i].getMinLv());
mat.setPart(items[i].getPart());
mat.setType(items[i].getType());
mat.setPowerAdd(items[i].getPowerAdd());
mat.setDefenceAdd(items[i].getDefenceAdd());
mat.setSpeedAdd(items[i].getSpeedAdd());
mat.setDesc(items[i].getDesc());
mat.setPrice(items[i].getPrice());
mat.setAmount(1);
return mat;
}
public static Mat getWeaponByIndex(int i)
{
if(i<0 || i>weapons.length-1)return null;
Mat mat=new Mat();
mat.setName(weapons[i].getName());
mat.setExpAdd(weapons[i].getExpAdd());
mat.setLifeAdd(weapons[i].getLifeAdd());
mat.setMagicAdd(weapons[i].getMagicAdd());
mat.setMaxLifeAdd(weapons[i].getMaxLifeAdd());
mat.setMaxMagicAdd(weapons[i].getMaxMagicAdd());
mat.setMinLv(weapons[i].getMinLv());
mat.setPart(weapons[i].getPart());
mat.setType(weapons[i].getType());
mat.setPowerAdd(weapons[i].getPowerAdd());
mat.setDefenceAdd(weapons[i].getDefenceAdd());
mat.setSpeedAdd(weapons[i].getSpeedAdd());
mat.setDesc(weapons[i].getDesc());
mat.setPrice(weapons[i].getPrice());
mat.setAmount(1);
return mat;
}
public static Mat getCapByIndex(int i)
{
if(i<0 || i>caps.length-1)return null;
Mat mat=new Mat();
mat.setName(caps[i].getName());
mat.setExpAdd(caps[i].getExpAdd());
mat.setLifeAdd(caps[i].getLifeAdd());
mat.setMagicAdd(caps[i].getMagicAdd());
mat.setMaxLifeAdd(caps[i].getMaxLifeAdd());
mat.setMaxMagicAdd(caps[i].getMaxMagicAdd());
mat.setMinLv(caps[i].getMinLv());
mat.setPart(caps[i].getPart());
mat.setType(caps[i].getType());
mat.setPowerAdd(caps[i].getPowerAdd());
mat.setDefenceAdd(caps[i].getDefenceAdd());
mat.setSpeedAdd(caps[i].getSpeedAdd());
mat.setDesc(caps[i].getDesc());
mat.setPrice(caps[i].getPrice());
mat.setAmount(1);
return mat;
}
public static Mat getClothByIndex(int i)
{
if(i<0 || i>cloths.length-1)return null;
Mat mat=new Mat();
mat.setName(cloths[i].getName());
mat.setExpAdd(cloths[i].getExpAdd());
mat.setLifeAdd(cloths[i].getLifeAdd());
mat.setMagicAdd(cloths[i].getMagicAdd());
mat.setMaxLifeAdd(cloths[i].getMaxLifeAdd());
mat.setMaxMagicAdd(cloths[i].getMaxMagicAdd());
mat.setMinLv(cloths[i].getMinLv());
mat.setPart(cloths[i].getPart());
mat.setType(cloths[i].getType());
mat.setPowerAdd(cloths[i].getPowerAdd());
mat.setDefenceAdd(cloths[i].getDefenceAdd());
mat.setSpeedAdd(cloths[i].getSpeedAdd());
mat.setDesc(cloths[i].getDesc());
mat.setPrice(cloths[i].getPrice());
mat.setAmount(1);
return mat;
}
public static Mat getShoeByIndex(int i)
{
if(i<0 || i>shoes.length-1)return null;
Mat mat=new Mat();
mat.setName(shoes[i].getName());
mat.setExpAdd(shoes[i].getExpAdd());
mat.setLifeAdd(shoes[i].getLifeAdd());
mat.setMagicAdd(shoes[i].getMagicAdd());
mat.setMaxLifeAdd(shoes[i].getMaxLifeAdd());
mat.setMaxMagicAdd(shoes[i].getMaxMagicAdd());
mat.setMinLv(shoes[i].getMinLv());
mat.setPart(shoes[i].getPart());
mat.setType(shoes[i].getType());
mat.setPowerAdd(shoes[i].getPowerAdd());
mat.setDefenceAdd(shoes[i].getDefenceAdd());
mat.setSpeedAdd(shoes[i].getSpeedAdd());
mat.setDesc(shoes[i].getDesc());
mat.setPrice(shoes[i].getPrice());
mat.setAmount(1);
return mat;
}
public static Mat getShellByIndex(int i)
{
if(i<0 || i>shells.length-1)return null;
Mat mat=new Mat();
mat.setName(shells[i].getName());
mat.setExpAdd(shells[i].getExpAdd());
mat.setLifeAdd(shells[i].getLifeAdd());
mat.setMagicAdd(shells[i].getMagicAdd());
mat.setMaxLifeAdd(shells[i].getMaxLifeAdd());
mat.setMaxMagicAdd(shells[i].getMaxMagicAdd());
mat.setMinLv(shells[i].getMinLv());
mat.setPart(shells[i].getPart());
mat.setType(shells[i].getType());
mat.setPowerAdd(shells[i].getPowerAdd());
mat.setDefenceAdd(shells[i].getDefenceAdd());
mat.setSpeedAdd(shells[i].getSpeedAdd());
mat.setDesc(shells[i].getDesc());
mat.setPrice(shells[i].getPrice());
mat.setAmount(1);
return mat;
}
public static Mat getJewelryByIndex(int i)
{
if(i<0 || i>jewelrys.length-1)return null;
Mat mat=new Mat();
mat.setName(jewelrys[i].getName());
mat.setExpAdd(jewelrys[i].getExpAdd());
mat.setLifeAdd(jewelrys[i].getLifeAdd());
mat.setMagicAdd(jewelrys[i].getMagicAdd());
mat.setMaxLifeAdd(jewelrys[i].getMaxLifeAdd());
mat.setMaxMagicAdd(jewelrys[i].getMaxMagicAdd());
mat.setMinLv(jewelrys[i].getMinLv());
mat.setPart(jewelrys[i].getPart());
mat.setType(jewelrys[i].getType());
mat.setPowerAdd(jewelrys[i].getPowerAdd());
mat.setDefenceAdd(jewelrys[i].getDefenceAdd());
mat.setSpeedAdd(jewelrys[i].getSpeedAdd());
mat.setDesc(jewelrys[i].getDesc());
mat.setPrice(jewelrys[i].getPrice());
mat.setAmount(1);
return mat;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -