Commit 366fc4b8 authored by Nemo Ma's avatar Nemo Ma

add itmpara - 1

The update that may break the world - Part 1
parent e72b6735
......@@ -38,6 +38,22 @@ if($gamestate == 0) {
$gametype = 0;
$pdata['clbpara'] = get_clbpara($pdata['clbpara']);
//Also copying for $weppara, $itmpara and such.
$pdata['weppara'] = get_itmpara($pdata['weppara']);
$pdata['wep2para'] = get_itmpara($pdata['wep2para']);
$pdata['itm0para'] = get_itmpara($pdata['itm0para']);
$pdata['itm1para'] = get_itmpara($pdata['itm1para']);
$pdata['itm2para'] = get_itmpara($pdata['itm2para']);
$pdata['itm3para'] = get_itmpara($pdata['itm3para']);
$pdata['itm4para'] = get_itmpara($pdata['itm4para']);
$pdata['itm5para'] = get_itmpara($pdata['itm5para']);
$pdata['itm6para'] = get_itmpara($pdata['itm6para']);
$pdata['arbpara'] = get_itmpara($pdata['arbpara']);
$pdata['arhpara'] = get_itmpara($pdata['arhpara']);
$pdata['arapara'] = get_itmpara($pdata['arapara']);
$pdata['arfpara'] = get_itmpara($pdata['arfpara']);
$pdata['artpara'] = get_itmpara($pdata['artpara']);
extract($pdata,EXTR_REFS);
init_playerdata();
init_profile();
......
打多多10分,WK,500,20,uiwor,{"AddDamagePercentage":10},
打多多20分,WK,500,20,uiwor,{"AddDamagePercentage":20},
打多多30分,WK,500,20,uiwor,{"AddDamagePercentage":30},
打多多100,WK,500,20,uiwor,{"AddDamageRaw":100},
打多多300,WK,500,20,uiwor,{"AddDamageRaw":300},
打多多500,WK,500,20,uiwor,{"AddDamageRaw":500},
打多多10分100,WK,500,20,uiwor,{"AddDamageRaw":100,"AddDamagePercentage":10},
打多多30分300,WK,500,20,uiwor,{"AddDamageRaw":300,"AddDamagePercentage":30},
打多多50分500,WK,500,20,uiwor,{"AddDamageRaw":500,"AddDamagePercentage":50},
防多多10分100,DB,500,50,,{"DecreaseDamageRaw":100,"DecreaseDamagePercentage":10},
防多多30分300,DH,500,50,,{"DecreaseDamageRaw":300,"DecreaseDamagePercentage":30},
防多多50分500,DA,500,50,,{"DecreaseDamageRaw":500,"DecreaseDamagePercentage":50},
防多多10分100,DF,500,50,,{"DecreaseDamageRaw":100,"DecreaseDamagePercentage":10},
防多多30分,A,500,50,,{"DecreaseDamagePercentage":30},
防多多50分,A,500,50,,{"DecreaseDamagePercentage":50},
防多多10分打多多10分,A,500,50,,{"AddDamagePercentage":10, "DecreaseDamagePercentage":10},
\ No newline at end of file
......@@ -1030,6 +1030,7 @@ $iteminfo = Array(//注意顺序,AB必须在A的前面,以此类推
'PB' => '命体恢复',
'p' => '礼物',
'fy' => '全地图唯一的野生浮云礼物盒',
'f99' => '【测】新格式福袋', # For test / Debug, uses new format that has $itmpara - will eventually be merged into existing formats.
'ygo' => '卡包',
//'R' => '探测仪器',
'ss' => '歌词卡片',
......
......@@ -11,6 +11,7 @@ CREATE TABLE bra_mapitem (
itme mediumint unsigned NOT NULL default '0',
itms char(5) not null default '0',
itmsk char(5) not null default '',
itmpara text not null,
pls tinyint unsigned not null default '0',
PRIMARY KEY (iid)
......
......@@ -11,6 +11,7 @@ CREATE TABLE bra_maptrap (
itme smallint unsigned NOT NULL default '0',
itms char(5) not null default '0',
itmsk char(5) not null default '',
itmpara text not null,
pls tinyint unsigned not null default '0',
PRIMARY KEY (tid)
......
......@@ -67,71 +67,85 @@ CREATE TABLE bra_players (
wepe int(10) unsigned NOT NULL DEFAULT '0',
weps char(10) not null default '0',
wepsk char(40) not null default '',
weppara text not null,
wep2 char(30) NOT NULL default '',
wep2k char(40) not null default '',
wep2e int(10) unsigned NOT NULL DEFAULT '0',
wep2s char(10) not null default '0',
wep2sk char(40) not null default '',
wep2para text not null,
arb char(30) NOT NULL default '',
arbk char(40) not null default '',
arbe int(10) unsigned NOT NULL DEFAULT '0',
arbs char(10) not null default '0',
arbsk char(40) not null default '',
arbpara text not null,
arh char(30) NOT NULL default '',
arhk char(40) not null default '',
arhe int(10) unsigned NOT NULL DEFAULT '0',
arhs char(10) not null default '0',
arhsk char(40) not null default '',
arhpara text not null,
ara char(30) NOT NULL default '',
arak char(40) not null default '',
arae int(10) unsigned NOT NULL DEFAULT '0',
aras char(10) not null default '0',
arask char(40) not null default '',
arapara text not null,
arf char(30) NOT NULL default '',
arfk char(40) not null default '',
arfe int(10) unsigned NOT NULL DEFAULT '0',
arfs char(10) not null default '0',
arfsk char(40) not null default '',
arfpara text not null,
art char(30) NOT NULL default '',
artk char(40) not null default '',
arte int(10) unsigned NOT NULL DEFAULT '0',
arts char(10) not null default '0',
artsk char(40) not null default '',
artpara text not null,
itm0 char(30) NOT NULL default '',
itmk0 char(40) not null default '',
itme0 int(10) unsigned NOT NULL DEFAULT '0',
itms0 char(10) not null default '0',
itmsk0 char(40) not null default '',
itmpara0 text not null,
itm1 char(30) NOT NULL default '',
itmk1 char(40) not null default '',
itme1 int(10) unsigned NOT NULL DEFAULT '0',
itms1 char(10) not null default '0',
itmsk1 char(40) not null default '',
itmpara1 text not null,
itm2 char(30) NOT NULL default '',
itmk2 char(40) not null default '',
itme2 int(10) unsigned NOT NULL DEFAULT '0',
itms2 char(10) not null default '0',
itmsk2 char(40) not null default '',
itmpara2 text not null,
itm3 char(30) NOT NULL default '',
itmk3 char(40) not null default '',
itme3 int(10) unsigned NOT NULL DEFAULT '0',
itms3 char(10) not null default '0',
itmsk3 char(40) not null default '',
itmpara3 text not null,
itm4 char(30) NOT NULL default '',
itmk4 char(40) not null default '',
itme4 int(10) unsigned NOT NULL DEFAULT '0',
itms4 char(10) not null default '0',
itmsk4 char(40) not null default '',
itmpara4 text not null,
itm5 char(30) NOT NULL default '',
itmk5 char(40) not null default '',
itme5 int(10) unsigned NOT NULL DEFAULT '0',
itms5 char(10) not null default '0',
itmsk5 char(40) not null default '',
itmpara5 text not null,
itm6 char(30) NOT NULL default '',
itmk6 char(40) not null default '',
itme6 int(10) unsigned NOT NULL DEFAULT '0',
itms6 char(10) not null default '0',
itmsk6 char(40) not null default '',
itmpara6 text not null,
flare int(10) NOT NULL default '0',
dcloak int(10) NOT NULL default '0',
auraa int(10) NOT NULL default '0',
......
......@@ -45,6 +45,7 @@ CREATE TABLE bra_mapitem (
itme int(10) unsigned NOT NULL DEFAULT '0',
itms char(10) not null default '0',
itmsk char(40) not null default '',
itmpara text not null,
pls tinyint unsigned not null default '0',
PRIMARY KEY (iid)
......@@ -63,6 +64,7 @@ CREATE TABLE bra_maptrap (
itme int(10) unsigned NOT NULL DEFAULT '0',
itms char(10) not null default '0',
itmsk char(40) not null default '',
itmpara text not null,
pls tinyint unsigned not null default '0',
PRIMARY KEY (tid)
......@@ -119,6 +121,7 @@ CREATE TABLE bra_itemdepot (
itme int(10) unsigned NOT NULL default '0',
itms char(10) not null default '0',
itmsk varchar(40) not null default '',
itmpara text not null,
itmowner char(15) NOT NULL DEFAULT '',
itmpw char(5) NOT NULL DEFAULT '',
......
......@@ -14,6 +14,7 @@ CREATE TABLE bra_shopitem (
itme int(10) unsigned NOT NULL DEFAULT '0',
itms char(10) not null default '0',
itmsk char(40) not null default '',
itmpara text not null,
PRIMARY KEY (sid),
INDEX KIND (kind, area)
......
......@@ -171,6 +171,7 @@ function senditem()
$itme = & ${'itme'.$itmn};
$itms = & ${'itms'.$itmn};
$itmsk = & ${'itmsk'.$itmn};
$itmpara = & ${'itmpara'.$itmn};
# 诅咒道具不能赠予,不准祸水东引!
if(in_array('V',get_itmsk_array($itmsk)))
......@@ -192,6 +193,7 @@ function senditem()
$edata['itme'.$i] = $itme;
$edata['itms'.$i] = $itms;
$edata['itmsk'.$i] = $itmsk;
$edata['itmpara'.$i] = $itmpara;
$log .= "你将<span class=\"yellow\">{$edata['itm'.$i]}</span>送给了<span class=\"yellow\">$w_name</span>。<br>";
$w_log = "<span class=\"yellow\">$name</span>将<span class=\"yellow\">{$edata['itm'.$i]}</span>送给了你。";
if(!$w_type){logsave($w_pid,$now,$w_log,'t');}
......@@ -199,7 +201,7 @@ function senditem()
addnews($now,'senditem',$name,$w_name,$itm,$nick);
//w_save($w_pid);
player_save($edata);
$itm = $itmk = $itmsk = '';
$itm = $itmk = $itmsk = $itmpara = '';
$itme = $itms = 0;
$action = ''; $bid = 0;
return;
......
......@@ -58,7 +58,7 @@
global $db,$tablepre,$arealist,$areanum,$hack;
global $log,$pls,$name,$type,$money;
global $max_saveitem_num,$saveitem_cost,$loaditem_cost,$depots;
global ${'itm'.$i},${'itmk'.$i},${'itme'.$i},${'itms'.$i},${'itmsk'.$i};
global ${'itm'.$i},${'itmk'.$i},${'itme'.$i},${'itms'.$i},${'itmsk'.$i},${'itmpara'.$i};
$i = (int)$i;
if(!in_array($pls,$depots))
......@@ -103,11 +103,11 @@
$money -= $saveitem_cost;
$log.="你成功将道具<span class='yellow'>{${'itm'.$i}}</span>存进了安全箱内!<br>同时被迫支付了手续费<span class='yellow'>{$saveitem_cost}</span>元。<br>";
$itm=&${'itm'.$i};$itmk=&${'itmk'.$i};$itmsk=&${'itmsk'.$i};
$itm=&${'itm'.$i};$itmk=&${'itmk'.$i};$itmsk=&${'itmsk'.$i};$itmpara=${'itmpara'.$i};
$itme=&${'itme'.$i};$itms=&${'itms'.$i};
addnews($now,'depot_save',$name,${'itm'.$i});
$db->query("INSERT INTO {$tablepre}itemdepot (itm, itmk, itme, itms, itmsk ,itmowner, itmpw) VALUES ('$itm', '$itmk', '$itme', '$itms', '$itmsk', '$name', '$type')");
$itm='';$itmk='';$itmsk='';
$db->query("INSERT INTO {$tablepre}itemdepot (itm, itmk, itme, itms, itmsk , itmpara ,itmowner, itmpw) VALUES ('$itm', '$itmk', '$itme', '$itms', '$itmsk', '$itmpara', '$name', '$type')");
$itm='';$itmk='';$itmsk='';$itmpara='';
$itme=0;$itms=0;
}
......@@ -116,7 +116,7 @@
global $db,$tablepre,$arealist,$areanum,$hack;
global $log,$pls,$name,$type,$money;
global $max_saveitem_num,$saveitem_cost,$loaditem_cost,$depots;
global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
global $itm0,$itmk0,$itme0,$itms0,$itmsk0,$itmpara0;
$i = (int)$i;
if(!in_array($pls,$depots))
......@@ -148,6 +148,7 @@
$itme0= $idpt[$i]['itme'];
$itms0= $idpt[$i]['itms'];
$itmsk0= $idpt[$i]['itmsk'];
$itmpara0= $idpt[$i]['itmpara'];
$iid = $idpt[$i]['iid'];
addnews($now,'depot_load',$name,$itm0);
$log.="你成功将道具<span class='yellow'>{$itm0}</span>从安全箱中取了出来!<br>同时被迫支付了保管费<span class='yellow'>{$loaditem_cost}</span>元……你感觉自己的心在滴血。<br>";
......
......@@ -31,12 +31,14 @@ function itemuse($itmn,&$data=NULL) {
}
////global ${'itm' . $itmn}, ${'itmk' . $itmn}, ${'itme' . $itmn}, ${'itms' . $itmn}, ${'itmsk' . $itmn};
//2024-07-19: I'm mad enough to add $itmpara, with me luck.
$itm = & ${'itm' . $itmn};
$itmk = & ${'itmk' . $itmn};
$itme = & ${'itme' . $itmn};
$itms = & ${'itms' . $itmn};
$itmsk = & ${'itmsk' . $itmn};
$i=$itm;$ik=$itmk;$ie=$itme;$is=$itms;$isk=$itmsk;
$itmpara = & ${'itmpara' . $itmn};
$i=$itm;$ik=$itmk;$ie=$itme;$is=$itms;$isk=$itmsk;$ipara=$itmpara;
if (($itms <= 0) && ($itms != $nosta)) {
$itm = $itmk = $itmsk = '';
......@@ -121,8 +123,9 @@ function itemuse($itmn,&$data=NULL) {
${$eqp.'e'} = $itme;
${$eqp.'s'} = $itms;
${$eqp.'sk'} = $itmsk;
${$eqp.'para'} = $itmpara;
$log .= "装备了<span class=\"yellow\">$itm</span>。<br>";
$itm = $itmk = $itmsk = '';
$itm = $itmk = $itmsk = $itmpara = '';
$itme = $itms = 0;
} else {
......@@ -138,16 +141,19 @@ function itemuse($itmn,&$data=NULL) {
$itmet = ${$eqp.'e'};
$itmst = ${$eqp.'s'};
$itmskt = ${$eqp.'sk'};
$itmparat = ${$eqp.'para'};
${$eqp} = $itm;
${$eqp.'k'} = $itmk;
${$eqp.'e'} = $itme;
${$eqp.'s'} = $itms;
${$eqp.'sk'} = $itmsk;
${$eqp.'para'} = $itmpara;
$itm = $itmt;
$itmk = $itmkt;
$itme = $itmet;
$itms = $itmst;
$itmsk = $itmskt;
$itmpara = $itmparat;
$log .= "卸下了<span class=\"red\">$itm</span>,装备了<span class=\"yellow\">{${$eqp}}</span>。<br>";
}
} elseif (strpos ( $itmk, 'HS' ) === 0) {
......@@ -1091,6 +1097,21 @@ function itemuse($itmn,&$data=NULL) {
$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;
addnews($now,'present',$name,$oitm,$in,$nick);
include_once GAME_ROOT.'./include/game/itemmain.func.php';
itemget($data);
} elseif(strpos ( $itmk, 'f99' ) === 0){ // Debug Box for testing $itmpara
$log.="你打开了<span class=\"yellow\">$itm</span>。<br>";
$itms--; $oitm = $itm;
if($itms <= 0) destory_single_item($data,$itmn,1);
$file1 = config('f99',$gamecfg);
$plist1 = openfile($file1);
$rand1 = rand(0,count($plist1)-1);
list($in,$ik,$ie,$is,$isk,$ipara) = explode(',',$plist1[$rand1]);
//global $itm0,$itmk0,$itme0,$itms0,$itmsk0,$mode;
$itm0 = $in;$itmk0=$ik;$itme0=$ie;$itms0=$is;$itmsk0=$isk;$itmpara0=$ipara;
addnews($now,'present',$name,$oitm,$in,$nick);
include_once GAME_ROOT.'./include/game/itemmain.func.php';
itemget($data);
}elseif ($itmk=='U') {
......@@ -1268,6 +1289,7 @@ function itemuse($itmn,&$data=NULL) {
$itme1 = $itme2 = $itme3 = $itme4 = $itme5 = $itme6 = 1;
$itms1 = $itms2 = $itms3 = $itms4 = $itms5 = $itms6 = 1;
$itmsk1 = $itmsk2 = $itmsk3 = $itmsk4 = $itmsk5 = $itmsk6 = '';
$itmpara0 = $itmpara1 = $itmpara2 = $itmpara3 = $itmpara4 = $itmpara5 = $itmpara6 = '';
}else{
//Otherwise, we swap every item in player's bag with random items at player's location.
$log .= '一道白光闪过,你背包中的物品都消失了,但是……<br>';
......@@ -1368,6 +1390,7 @@ function itemuse($itmn,&$data=NULL) {
$itme1 = $itme2 = $itme3 = $itme4 = $itme5 = $itme6 = 1;
$itms1 = $itms2 = $itms3 = $itms4 = $itms5 = $itms6 = 1;
$itmsk1 = $itmsk2 = $itmsk3 = $itmsk4 = $itmsk5 = $itmsk6 = '';
$itmpara1 = $itmpara2 = $itmpara3 = $itmpara4 = $itmpara5 = $itmpara6 = '';
}else{
//Otherwise, we swap every item in player's bag with random items at player's location.
$log .= '一道白光闪过,你背包中的物品都消失了,但是……<br>';
......@@ -1563,6 +1586,7 @@ function itemuse($itmn,&$data=NULL) {
$itme1 = $itme2 = $itme3 = $itme4 = $itme5 = $itme6 = 1;
$itms1 = $itms2 = $itms3 = $itms4 = $itms5 = $itms6 = 1;
$itmsk1 = $itmsk2 = $itmsk3 = $itmsk4 = $itmsk5 = $itmsk6 = '';
$itmpara1 = $itmpara2 = $itmpara3 = $itmpara4 = $itmpara5 = $itmpara6 = 0;
}else{
//Otherwise, we swap every item in player's bag with random items at player's location.
$log .= '一道白光闪过,你背包中的物品都消失了,但是……<br>';
......@@ -3357,6 +3381,7 @@ function itemuse($itmn,&$data=NULL) {
$itme0 = 0;
$itms0 = 0;
$itmsk0 = '';
$itmpara = '';
//Par 低维生物's suggestion, the explode-rate will be stored in its $itmsk.
$log.="你下定决心,打开了这个可疑的<span class='yellow'>$itm</span>,开始翻找起来……<br>";
......@@ -3727,6 +3752,20 @@ function itemuse($itmn,&$data=NULL) {
$pa = fetch_playerdata_by_pid(1);
$pd = fetch_playerdata_by_pid(2);
\revcombat\rev_combat_prepare($pa,$pd,1);
} elseif ($itm == '显现战斗测试仪'){
//Mod the above item, YOU'll enter fight with a player entry matching the item's $itme value.
global $pid;
include_once GAME_ROOT.'./include/game/revcombat.func.php';
$pa = fetch_playerdata_by_pid($pid);
$pd = fetch_playerdata_by_pid($itme);
\revcombat\rev_combat_prepare($pa,$pd,1);
} elseif ($itm == '战斗显现测试仪'){
//Mod the above item, A player entry matching item's $itme value will enter a fight with YOU.
global $pid;
include_once GAME_ROOT.'./include/game/revcombat.func.php';
$pa = fetch_playerdata_by_pid($itme);
$pd = fetch_playerdata_by_pid($pid);
\revcombat\rev_combat_prepare($pa,$pd,1);
} elseif ($itm == '对话测试器'){
//???
$clbpara['dialogue'] = 'testingDialog';
......
......@@ -22,21 +22,23 @@ function use_func_item($usemode,$item)
function poison($itmn = 0) {
global $mode,$log,$nosta,$art,$club,$pid;
global $itmp,${'itm'.$itmp},${'itms'.$itmp},${'itmk'.$itmp},${'itme'.$itmp},${'itmsk'.$itmp};
global $itmp,${'itm'.$itmp},${'itms'.$itmp},${'itmk'.$itmp},${'itme'.$itmp},${'itmsk'.$itmp}, ${'itmpara'. $itmp};
$poison = & ${'itm'.$itmp};
$poisonk = & ${'itmk'.$itmp};
$poisone = & ${'itme'.$itmp};
$poisons = & ${'itms'.$itmp};
$poisonsk = & ${'itmsk'.$itmp};
$poisonpara = & ${'itmpara'. $itmp};
if ( $itmn < 1 || $itmn > 6 ) {
$log .= '此道具不存在,请重新选择。';
$mode = 'command';
return;
}
global ${'itm'.$itmn},${'itmk'.$itmn},${'itmsk'.$itmn};
global ${'itm'.$itmn},${'itmk'.$itmn},${'itmsk'.$itmn}, ${'itmpara'. $itmn};
$itm = & ${'itm'.$itmn};
$itmk = & ${'itmk'.$itmn};
$itmsk = & ${'itmsk'.$itmn};
$itmpara = & ${'itmpara'. $itmn};
if(($poison != '毒药') || (strpos($itmk, 'H') !==0 && strpos($itmk, 'P') !== 0)) {
$log .= '道具选择错误,请重新选择。<br>';
$mode = 'command';
......@@ -113,12 +115,14 @@ function wthchange($itm,$itmsk,$wlog=1){
function hack($itmn = 0) {
global $log,$hack,$hack_obbs,$club,$clbpara,$now,$name,$alivenum,$deathnum,$hp,$state,$nick;
global ${'itm'.$itmn},${'itmk'.$itmn},${'itme'.$itmn},${'itms'.$itmn},${'itmsk'.$itmn};
global ${'itm'.$itmn},${'itmk'.$itmn},${'itme'.$itmn},${'itms'.$itmn},${'itmsk'.$itmn}, ${'itmpara'. $itmn};
$itm = & ${'itm'.$itmn};
$itmk = & ${'itmk'.$itmn};
$itme = & ${'itme'.$itmn};
$itms = & ${'itms'.$itmn};
$itmsk = & ${'itmsk'.$itmn};
$itmpara = & ${'itmpara'. $itmn};
if(!$itms) {
$log .= '此道具不存在,请重新选择。<br>';
......@@ -392,12 +396,13 @@ function divining2($u) {
function deathnote($sfn,$itmd=0,$dnname='',$dndeath='',$dngender='m',$dnicon=1) {
global $db,$tablepre,$log,$killnum,$mode,$achievement,$pdata;
global ${'itm'.$itmd},${'itms'.$itmd},${'itmk'.$itmd},${'itme'.$itmd},${'itmsk'.$itmd};
global ${'itm'.$itmd},${'itms'.$itmd},${'itmk'.$itmd},${'itme'.$itmd},${'itmsk'.$itmd},${'itmpara'. $itmd};
$dn = & ${'itm'.$itmd};
$dnk = & ${'itmk'.$itmd};
$dne = & ${'itme'.$itmd};
$dns = & ${'itms'.$itmd};
$dnsk = & ${'itmsk'.$itmd};
$dnpara = & ${'itmpara'. $itmd};
$mode = 'command';
......@@ -405,7 +410,7 @@ function deathnote($sfn,$itmd=0,$dnname='',$dndeath='',$dngender='m',$dnicon=1)
$log .= '道具使用错误!<br>';
return;
} elseif($dns <= 0) {
$dn = $dnk = $dnsk = '';
$dn = $dnk = $dnsk = $dnpara = '';
$dne = $dns = 0;
$log .= '道具不存在!<br>';
return;
......@@ -458,7 +463,7 @@ function deathnote($sfn,$itmd=0,$dnname='',$dndeath='',$dngender='m',$dnicon=1)
$dns--;
if($dns<=0){
$log .= '■DeathNote■突然燃烧起来,转瞬间化成了灰烬。<br>';
$dn = $dnk = $dnsk = '';
$dn = $dnk = $dnsk = $dnpara = '';
$dne = $dns = 0;
}
return;
......@@ -467,23 +472,25 @@ function deathnote($sfn,$itmd=0,$dnname='',$dndeath='',$dngender='m',$dnicon=1)
function qianghua($itmn = 0) {
global $mode,$log,$nosta,$name,$nick;
global $club;
global $itmp,${'itm'.$itmp},${'itms'.$itmp},${'itmk'.$itmp},${'itme'.$itmp},${'itmsk'.$itmp};
global $itmp,${'itm'.$itmp},${'itms'.$itmp},${'itmk'.$itmp},${'itme'.$itmp},${'itmsk'.$itmp}, ${'itmpara'. $itmp};
$baoshi = & ${'itm'.$itmp};
$baoshie = & ${'itme'.$itmp};
$baoshis = & ${'itms'.$itmp};
$baoshik = & ${'itmk'.$itmp};
$baoshisk = & ${'itmsk'.$itmp};
$baoshipara = & ${'itmpara'. $itmp};
if ( $itmn < 1 || $itmn > 6 ) {
$log .= '此道具不存在,请重新选择。';
$mode = 'command';
return;
}
global ${'itm'.$itmn},${'itme'.$itmn},${'itms'.$itmn},${'itmk'.$itmn},${'itmsk'.$itmn};
global ${'itm'.$itmn},${'itme'.$itmn},${'itms'.$itmn},${'itmk'.$itmn},${'itmsk'.$itmn}, ${'itmpara'. $itmn};
$itm = & ${'itm'.$itmn};
$itme = & ${'itme'.$itmn};
$itms = & ${'itms'.$itmn};
$itmk = & ${'itmk'.$itmn};
$itmsk = & ${'itmsk'.$itmn};
$itmpara = & ${'itmpara'. $itmn};
if($baoshis <= 0 || ($baoshi != '『灵魂宝石』' && $baoshi != '『祝福宝石』')) {
$log .= '强化道具选择错误,请重新选择。<br>';
$mode = 'command';
......@@ -590,7 +597,7 @@ function qianghua($itmn = 0) {
$baoshis--;
if($baoshis <= 0){
$log .= "<span class=\"red\">$baoshi</span> 用光了。<br>";
$baoshi = $baoshik = $baoshisk = '';$baoshie = $baoshis = 0;
$baoshi = $baoshik = $baoshisk = $baoshipara = '';$baoshie = $baoshis = 0;
}
$mode = 'command';
return;
......@@ -598,7 +605,7 @@ function qianghua($itmn = 0) {
function nametag($item){
global $rename,$ntitm,$log,$now,$command,$mode,$nosta;
global ${'itm'.$ntitm},${'itms'.$ntitm},${'itmk'.$ntitm},${'itme'.$ntitm},${'itmsk'.$ntitm};
global ${'itm'.$ntitm},${'itms'.$ntitm},${'itmk'.$ntitm},${'itme'.$ntitm},${'itmsk'.$ntitm}, ${'itmpara'.$ntitm};
if(${'itm'.$ntitm} != '残响兵器' || ${'itmk'.$ntitm} != 'Y' || !${'itms'.$ntitm}){
$log .= "<span class=\"yellow\">道具不存在!</span><br>";
$mode = 'command';
......@@ -611,19 +618,21 @@ function nametag($item){
}
if(strpos($item,'itm')===0){
$i = str_replace('itm','',$item);
global ${'itm'.$i},${'itms'.$i},${'itmk'.$i},${'itme'.$i},${'itmsk'.$i};
global ${'itm'.$i},${'itms'.$i},${'itmk'.$i},${'itme'.$i},${'itmsk'.$i}, ${'itmpara'.$i};
$rn = & ${'itm'.$i};
$rnk = & ${'itmk'.$i};
$rne = & ${'itme'.$i};
$rns = & ${'itms'.$i};
$rnsk = & ${'itmsk'.$i};
$rnpara = & ${'itmpara'.$i};
}else{
global ${$item},${$item.'k'}, ${$item.'e'}, ${$item.'s'},${$item.'sk'};
global ${$item},${$item.'k'}, ${$item.'e'}, ${$item.'s'},${$item.'sk'}, ${$item.'para'};
$rn = & ${$item};
$rnk = & ${$item.'k'};
$rne = & ${$item.'e'};
$rns = & ${$item.'s'};
$rnsk = & ${$item.'sk'};
$rnpara = & ${$item.'para'};
}
......@@ -654,7 +663,7 @@ function nametag($item){
${'itms'.$ntitm} --;
if(${'itms'.$ntitm} <= 0){
$log .= "<span class=\"yellow\">{${'itm'.$ntitm}}用完了。</span><br>";
${'itm'.$ntitm} = ${'itmk'.$ntitm} = ${'itmsk'.$ntitm} = '';
${'itm'.$ntitm} = ${'itmk'.$ntitm} = ${'itmsk'.$ntitm} = ${'itmpara'.$ntitm} = '';
${'itms'.$ntitm} = ${'itme'.$ntitm} = 0;
}
}
......
......@@ -106,27 +106,28 @@ function item_info(){
function item_encase($ilist){
global $log,$getitem,$itmnum,$itmnumlimit;
foreach($ilist as $i){
global ${'itm'.$i},${'itmk'.$i},${'itme'.$i},${'itms'.$i},${'itmsk'.$i};
global ${'itm'.$i},${'itmk'.$i},${'itme'.$i},${'itms'.$i},${'itmsk'.$i}, ${'itmpara'.$i};
$git_list = decode_item($getitem);
$itm = &${'itm'.$i};
$itmk = &${'itmk'.$i};
$itme = &${'itme'.$i};
$itms = &${'itms'.$i};
$itmsk = &${'itmsk'.$i};
$itmpara = &${'itmpara'.$i};
if(strpos($itmsk,'V')!==false || strpos($itmsk,'v')!==false){
$log.="诅咒和灵魂绑定的装备无法存放在背包内。<br>";
}elseif(round(sizeof($git_list)+1+$itmnum) > $itmnumlimit){
$log.="背包已满,无法继续放入道具。<br>";
}else{
item_find($itm,$itmk,$itme,$itms,$itmsk);
$itm = $itmk = $itmsk = '';
item_find($itm,$itmk,$itme,$itms,$itmsk, $itmpara);
$itm = $itmk = $itmsk = $itmpara = '';
$itme = $itms = 0;
}
}
item_get();
}
//发现道具
function item_find($itm,$itmk,$itme,$itms,$itmsk){
function item_find($itm,$itmk,$itme,$itms,$itmsk, $itmpara){
global $getitem;
$git_list = decode_item($getitem);
$gitarr = Array(
......@@ -135,6 +136,7 @@ function item_find($itm,$itmk,$itme,$itms,$itmsk){
'itme' => $itme,
'itms' => $itms,
'itmsk' => $itmsk,
'itmpara' => $itmpara,
);
array_push($git_list,$gitarr);
$getitem = json_encode_comp($git_list);
......@@ -152,6 +154,7 @@ function item_get(){
$gite = $git_list[$gid]['itme'];
$gits = $git_list[$gid]['itms'];
$gitsk = $git_list[$gid]['itmsk'];
$gitpara = $git_list[$gid]['itmpara'];
if(!$gits || !$gitk || !$git){
$log.="获取道具的相关信息失败。<br>";
}else{
......@@ -222,6 +225,7 @@ function item_get(){
'itme' => $gite,
'itms' => $gits,
'itmsk' => $gitsk,
'itmpara' => $gitpara,
);
array_push($item_list,$gitarr);
$log.="你向背包中存入了<span class=\"yellow\">{$git}</span>。<br>";
......@@ -236,7 +240,7 @@ function item_get(){
//处理取出道具
function item_out($iid){
global $itembag,$itmnum;
global $log,$itm0,$itmk0,$itme0,$itms0,$itmsk0;
global $log,$itm0,$itmk0,$itme0,$itms0,$itmsk0, $itmpara0;
$item_list = decode_item($itembag);
if(!in_array($iid,array_keys($item_list))){
$log .= '此道具不存在,请重新选择。<br>';
......@@ -251,6 +255,7 @@ function item_out($iid){
$itme0 = $item_list[$iid]['itme'];
$itms0 = $item_list[$iid]['itms'];
$itmsk0 = $item_list[$iid]['itmsk'];
$itmpara0 = $item_list[$iid]['itmpara'];
unset($item_list[$iid]);
$itmnum = sizeof(array_keys($item_list));
$itembag = json_encode_comp($item_list);
......@@ -284,7 +289,8 @@ function drop_itembag(){
$itme = $item_list[$iid]['itme'];
$itms = $item_list[$iid]['itms'];
$itmsk = $item_list[$iid]['itmsk'];
$db->query("INSERT INTO {$tablepre}mapitem (itm, itmk, itme, itms, itmsk ,pls) VALUES ('$itm', '$itmk', '$itme', '$itms', '$itmsk', '$pls')");
$itmpara = $item_list[$iid]['itmpara'];
$db->query("INSERT INTO {$tablepre}mapitem (itm, itmk, itme, itms, itmsk ,itmpara, pls) VALUES ('$itm', '$itmk', '$itme', '$itms', '$itmsk', '$itmpara', '$pls')");
}
$log.="你将背包连同里面的道具一同丢掉了。<br>";
$itmnum = $itmnumlimit = 0;
......@@ -293,7 +299,7 @@ function drop_itembag(){
}
//拾取背包时对是否替换进行判断
function replace_itembag(&$keep){
global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
global $itm0,$itmk0,$itme0,$itms0,$itmsk0,$itmpara0;
global $arb,$arbk,$arbe,$arbs,$arbsk;
global $itmnumlimit,$log,$mode;
global $pls,$db,$tablepre;
......@@ -315,7 +321,8 @@ function replace_itembag(&$keep){
$arbe = $itme0;
$arbs = $itms0;
$arbsk = $itmsk0;
$itm0 = $itmk0 = $itmsk0 = '';
$arbpara = $itmpara0;
$itm0 = $itmk0 = $itmsk0 = $itmpara0 = '';
$itme0 = $itms0 = 0;
}else{
$i = $r_flag;
......@@ -326,13 +333,14 @@ function replace_itembag(&$keep){
${'itme'.$i} = $itme0;
${'itms'.$i} = $itms0;
${'itmsk'.$i} = $itmsk0;
$itm0 = $itmk0 = $itmsk0 = '';
${'itmpara'.$i} = $itmpara0;
$itm0 = $itmk0 = $itmsk0 = $itmpara0 = '';
$itme0 = $itms0 = 0;
}
$log.="由于只能携带一个背包,你用拾到的品质较高的背包替换掉了身上的背包。<br>";
}elseif($r_flag){
$db->query("INSERT INTO {$tablepre}mapitem (itm, itmk, itme, itms, itmsk ,pls) VALUES ('$itm0', '$itmk0', '$itme0', '$itms0', '$itmsk0', '$pls')");
$itm0 = $itmk0 = $itmsk0 = '';
$itm0 = $itmk0 = $itmsk0 = $itmpara0 = '';
$itme0 = $itms0 = 0;
$log.="由于只能携带一个背包,你扔掉了这个品质较差的背包。<br>";
}else{
......
This diff is collapsed.
......@@ -69,6 +69,7 @@ function itemmix_get_result($mlist,&$data=NULL)
'itme' => ${'itme'.$val},
'itms' => ${'itms'.$val},
'itmsk' => ${'itmsk'.$val},
'itmpara' => ${'itmpara'.$val},
);
}
//常规合成
......@@ -365,6 +366,7 @@ function itemmix_proc($mlist, $minfo, $itmstr, &$data=NULL)
else{
$itmsk0 = '';
}
$itmpara0 = $minfo['result'][5];
$uip['mixcls'] = !empty($minfo['class']) ? $minfo['class'] : '';
$uip['mixtp'] = $minfo['type'];
//合成成功
......@@ -475,7 +477,7 @@ function itemmix_events(&$data=NULL)
if($itm0 == 'Untainted Glory'){
$log .= "<span class='minirainbow'>一道强光闪过——<br>
你背包中的物品一瞬间全部消失了!<br>这是获得无毁荣光的必要代价!</span><br>";
$itm1 = $itmk1 = $itmsk1 = $itm2 = $itmk2 = $itmsk2 = $itm3 = $itmk3 = $itmsk3 = $itm4 = $itmk4 = $itmsk4 = $itm5 = $itmk5 = $itmsk5 = $itm6 = $itmk6 = $itmsk6 = '';
$itm1 = $itmk1 = $itmsk1 = $itm2 = $itmk2 = $itmsk2 = $itm3 = $itmk3 = $itmsk3 = $itm4 = $itmk4 = $itmsk4 = $itm5 = $itmk5 = $itmsk5 = $itm6 = $itmk6 = $itmsk6 = $itmpara0= $itmpara1 =$itmpara2 =$itmpara3 =$itmpara4 =$itmpara5 = $itmpara6 =0;'';
$itme1 = $itms1 = $itme2 = $itms2 = $itme3 = $itms3 = $itme4 = $itms4 = $itme5 = $itms5 = $itme6 = $itms6 = 0;
}
return;
......
I added ``$itmpara`` and all related logics and databased fields on 24-07-20, this field works the same as ``$clbpara`` but are on individual items instead.
With this field, an item can have special properties controlled by variable keys tied to an instance of the specific item.
Here I'll document all current ``$itmpara`` keys used / planned to use as of now:
``lore`` - Additional tooltips that'll shown alongside the existing ``gamedata/cache/tooltip_X.php`` - Not implemented for now. Applies to all items.
``AddDamagePercentage`` - Add a damage percentage multiplier, only works on weapons and talisman.
``AddDamageRaw`` - Add an amount of raw damage on the last part of damage calculation, only works on weapons and talisman.
``DecreaseDamagePercentage`` - Add a damage decrease percentage multiplier, only works on defense items and talisman.
``DecreaseDamageRaw`` - Add an amount of raw damage to decrease on the last part of damage calculation, only works on defense items and talisman.
``AddPlayerXXInCombat`` - Add an amount of raw stats XX when player is in combat.
``AddPlayerXXInSearchMove`` - Add an amount of raw stats XX when player conducting searching / moving.
XX => ``mhp``, ``msp``, ``mss``, ``att``, ``def``, ``wp/k/g/c/d/f``, ``money``, ``rage``, etc.
【May consider using just a minus value for decreasing those values, and do a check in Move/Search/Combat logic instead...?】
``IsPlatformItem`` - Denotes if the item is used as an "NPC-Platform" type item - Still implementing (24-07-21) - only works on usable item.
> A "NPC-Platform" item is an item that stores a series of prebuilt stats, it'll replace your stats with those stats when used - it can be temporary or prementant.
The following keys will apply:
> ``PlatformPlayerMode`` - ``0`` - Uses the values builtin ``$itmpara``, ``1`` - Unused for now. ``2`` - Grab values from player table by matching ``PlatformPlayerName`` and populate them.
>
> ``PlatformPlayerName`` - players.sql -> ``name``.
>
> ``PlatformPlayerLvl`` - players.sql -> ``lvl``.
>
> ``PlatformPlayerMhp`` - players.sql -> ``mhp``.
>
> ``PlatformPlayerMsp`` - players.sql -> ``msp``.
>
> Etc. The basic structure of these key names remains the same. It'll cover all needed values to copy a player/NPC value to another player.
>
> ``PlatformIsTimed`` - If this item is timed - Timed NPC-Platforms will have an internal charge value that'll decrease with searching/moving.
>
> ``PlatformChargeBaseValue`` - The additional base value of a Timed Platform's charge value.
The following functions are still implementing (24-07-21)
``IsQuestItem`` - Denotes if the item is related to a Quest - When a Quest spawns this item, this key will be spawn alongside it.
``QuestOwnerID`` - Denotes the ``pid`` of the player that "owns" the quest, when a player accepts a quest that will result in a quest item, this key will spawn alongside it - conduct checks when processing those item logics to check if the user's ``pid`` matches with this key value.
\ No newline at end of file
......@@ -1129,6 +1129,21 @@ namespace revattr
$dmg_p[]= $p;
$log.="<span class='yellow'>{$pa['nm']}耻于使用武器战斗!造成的物理伤害降低了{$sk_p}%!</span><br>";
}
# Additional $weppara + $artpara check - Additional Damage Percentage
if(isset($pa['weppara']['AddDamagePercentage']) && $pa['weppara']['AddDamagePercentage'] > 0){
$p = 1 + ($pa['weppara']['AddDamagePercentage'] / 100);
$dmg_p[]= $p;
$log .= "<span class='yellow'>{$pa['nm']}的武器的特殊效应让造成的伤害增加了{$p}倍!</span><br>";
}
# Additional $artpara check - Additional Damage Percentage
if(isset($pa['artpara']['AddDamagePercentage']) && $pa['artpara']['AddDamagePercentage'] > 0){
$p = 1 + ($pa['artpara']['AddDamagePercentage'] / 100);
$dmg_p[]= $p;
$log .= "<span class='yellow'>{$pa['nm']}的饰品的特殊效应让造成的伤害增加了{$p}倍!</span><br>";
}
return $dmg_p;
}
......@@ -1842,6 +1857,33 @@ namespace revattr
$fin_dmg_p[] = $p;
}
}
# pd $arXPara check - Damage Decrease percentage
if(isset($pd['arbpara']['DecreaseDamagePercentage']) && ($pd['arbpara']['DecreaseDamagePercentage'] > 0) ){
$p = 1 - ($pd['arbpara']['DecreaseDamagePercentage'] / 100);
$log.="<span class=\"yellow\">在身体装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arbpara']['DecreaseDamagePercentage']}%! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['arhpara']['DecreaseDamagePercentage']) && ($pd['arhpara']['DecreaseDamagePercentage'] > 0) ){
$p = 1 - ($pd['arhpara']['DecreaseDamagePercentage'] / 100);
$log.="<span class=\"yellow\">在头部装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arhpara']['DecreaseDamagePercentage']}%! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['arapara']['DecreaseDamagePercentage']) && ($pd['arapara']['DecreaseDamagePercentage'] > 0) ){
$p = 1 - ($pd['arapara']['DecreaseDamagePercentage'] / 100);
$log.="<span class=\"yellow\">在手部装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arapara']['DecreaseDamagePercentage']}%! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['arfpara']['DecreaseDamagePercentage']) && ($pd['arfpara']['DecreaseDamagePercentage'] > 0) ){
$p = 1 - ($pd['arfpara']['DecreaseDamagePercentage'] / 100);
$log.="<span class=\"yellow\">在足部装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arfpara']['DecreaseDamagePercentage']}%! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['artpara']['DecreaseDamagePercentage']) && ($pd['artpara']['DecreaseDamagePercentage'] > 0) ){
$p = 1 - ($pd['artpara']['DecreaseDamagePercentage'] / 100);
$log.="<span class=\"yellow\">在饰品装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['artpara']['DecreaseDamagePercentage']}%! </span><br>";
$fin_dmg_p[] = $p;
}
return $fin_dmg_p;
}
......@@ -2141,6 +2183,44 @@ namespace revattr
$log .= "<span class=\"yellow\">{$pa['nm']}的攻击直接将{$pd['nm']}爆头!</span><br>";
}
# Additional $weppara check - Additional Raw Damage
if(isset($pa['weppara']['AddDamageRaw']) && $pa['weppara']['AddDamageRaw'] > 0){
$fin_dmg += $pa['weppara']['AddDamageRaw'];
$log .= "<span class=\"yellow\">{$pa['nm']}的武器的特殊效应让造成的伤害增加了{$pa['weppara']['AddDamageRaw']}点!</span><br>";
}
# Additional pa $artpara check - Additional Raw Damage
if(isset($pa['artpara']['AddDamageRaw']) && $pa['artpara']['AddDamageRaw'] > 0){
$fin_dmg += $pa['artpara']['AddDamageRaw'];
$log .= "<span class=\"yellow\">{$pa['nm']}的饰品的特殊效应让造成的伤害增加了{$pa['artpara']['AddDamageRaw']}点!</span><br>";
}
# Additional pd $arXPara check - Damage Decrease Raw
if(isset($pd['arbpara']['DecreaseDamageRaw']) && ($pd['arbpara']['DecreaseDamageRaw'] > 0) ){
$fin_dmg -= $pd['arbpara']['DecreaseDamageRaw'];
$log.="<span class=\"yellow\">在身体装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arbpara']['DecreaseDamageRaw']}! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['arhpara']['DecreaseDamageRaw']) && ($pd['arhpara']['DecreaseDamageRaw'] > 0) ){
$fin_dmg -= $pd['arhpara']['DecreaseDamageRaw'];
$log.="<span class=\"yellow\">在头部装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arhpara']['DecreaseDamageRaw']}! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['arapara']['DecreaseDamageRaw']) && ($pd['arapara']['DecreaseDamageRaw'] > 0) ){
$fin_dmg -= $pd['arapara']['DecreaseDamageRaw'];
$log.="<span class=\"yellow\">在手部装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arapara']['DecreaseDamageRaw']}! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['arfpara']['DecreaseDamageRaw']) && ($pd['arfpara']['DecreaseDamageRaw'] > 0) ){
$fin_dmg -= $pd['arfpara']['DecreaseDamageRaw'];
$log.="<span class=\"yellow\">在足部装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['arfpara']['DecreaseDamageRaw']}! </span><br>";
$fin_dmg_p[] = $p;
}
if(isset($pd['artpara']['DecreaseDamageRaw']) && ($pd['artpara']['DecreaseDamageRaw'] > 0) ){
$fin_dmg -= $pd['artpara']['DecreaseDamageRaw'];
$log.="<span class=\"yellow\">在饰品装备的特殊作用下,{$pa['nm']}造成的最终伤害降低了{$pd['artpara']['DecreaseDamageRaw']}! </span><br>";
$fin_dmg_p[] = $p;
}
return $fin_dmg;
}
......
......@@ -26,6 +26,16 @@ namespace revcombat
# 格式化双方clbpara:最后保存角色数据的时候会自动转写clbpara,所以想改什么直接改就行了
$pa['clbpara'] = get_clbpara($pa['clbpara']); $pd['clbpara'] = get_clbpara($pd['clbpara']);
# Also Format weppara + arXpara:
$pa['weppara'] = get_itmpara($pa['weppara']); $pd['weppara'] = get_itmpara($pd['weppara']);
$pa['wep2para'] = get_itmpara($pa['wep2para']); $pd['wep2para'] = get_itmpara($pd['wep2para']);
$pa['arbpara'] = get_itmpara($pa['arbpara']); $pd['arbpara'] = get_itmpara($pd['arbpara']);
$pa['arhpara'] = get_itmpara($pa['arhpara']); $pd['arhpara'] = get_itmpara($pd['arhpara']);
$pa['arapara'] = get_itmpara($pa['arapara']); $pd['arapara'] = get_itmpara($pd['arapara']);
$pa['arfpara'] = get_itmpara($pa['arfpara']); $pd['arfpara'] = get_itmpara($pd['arfpara']);
$pa['artpara'] = get_itmpara($pa['artpara']); $pd['artpara'] = get_itmpara($pd['artpara']);
# 是否显示战斗界面
if($log_print)
{
......
......@@ -629,6 +629,7 @@ function discover($schmode = 0,&$data=NULL)
$itme0=$fstrp['itme'];
$itms0=$fstrp['itms'];
$itmsk0=$fstrp['itmsk'];
$itmpara0 = $fstrp['itmpara'];
$tid = $fstrp['tid'];
$db->query("DELETE FROM {$tablepre}maptrap WHERE tid='$tid'");
itemfind($data);
......@@ -855,6 +856,7 @@ function focus_item(&$data=NULL,$id=NULL)
$itme0=$mi['itme'];
$itms0=$mi['itms'];
$itmsk0=$mi['itmsk'];
$itmpara0=$mi['itmpara'];
$iid=$mi['iid'];
$db->query("DELETE FROM {$tablepre}mapitem WHERE iid='$iid'");
if($itms0)
......
......@@ -161,7 +161,7 @@ function adtsk(){
if($club == 7){//电脑社,电气改造
$position = 0;
foreach(Array(1,2,3,4,5,6) as $imn){
global ${'itm'.$imn},${'itmk'.$imn},${'itme'.$imn},${'itms'.$imn},${'itmsk'.$imn};
global ${'itm'.$imn},${'itmk'.$imn},${'itme'.$imn},${'itms'.$imn},${'itmsk'.$imn}, ${'itmpara'.$imn};
if(strpos(${'itmk'.$imn},'B')===0 && ${'itme'.$imn} > 0 ){
$position = $imn;
break;
......@@ -186,7 +186,7 @@ function adtsk(){
$wepsk .= 'e';
if(${'itms'.$position} == 0){
$log .= "<span class=\"red\">$itm</span>用光了。<br />";
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = '';
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = ${'itmpara'.$position} = '';
${'itme'.$position} =${'itms'.$position} =0;
}
$mode = 'command';
......@@ -199,7 +199,7 @@ function adtsk(){
}elseif($club == 8){//带毒改造
$position = 0;
foreach(Array(1,2,3,4,5,6) as $imn){
global ${'itm'.$imn},${'itmk'.$imn},${'itme'.$imn},${'itms'.$imn},${'itmsk'.$imn};
global ${'itm'.$imn},${'itmk'.$imn},${'itme'.$imn},${'itms'.$imn},${'itmsk'.$imn},${'itmpara'.$imn};
if(${'itm'.$imn} == '毒药' && ${'itmk'.$imn} == 'Y' && ${'itme'.$imn} > 0 ){
$position = $imn;
break;
......@@ -222,7 +222,7 @@ function adtsk(){
$itm = ${'itm'.$position};
if(${'itms'.$position} == 0){
$log .= "<span class=\"red\">$itm</span>用光了。<br />";
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = '';
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = ${'itmpara'.$position}= '';
${'itme'.$position} =${'itms'.$position} =0;
}
$mode = 'command';
......@@ -240,7 +240,7 @@ function adtsk(){
}
function trap_adtsk($which){
global $log,$mode,$club,${'itm'.$which},${'itmk'.$which},${'itme'.$which},${'itms'.$which};
global $log,$mode,$club,${'itm'.$which},${'itmk'.$which},${'itme'.$which},${'itms'.$which},${'itmpara'.$which};
if(strpos(${'itmk'.$which},'T')!==0){
$log .= '<span class="red">这个物品不是陷阱,无法改造!</span><br />';
$mode = 'command';
......@@ -272,7 +272,7 @@ function trap_adtsk($which){
${'itm'.$which} = '电气'.${'itm'.$which};
if(${'itms'.$position} == 0){
$log .= "<span class=\"red\">$itm</span>用光了。<br />";
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = '';
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = ${'itmpara'.$position} = '';
${'itme'.$position} =${'itms'.$position} =0;
}
$mode = 'command';
......@@ -303,7 +303,7 @@ function trap_adtsk($which){
${'itm'.$which} = '毒性'.${'itm'.$which};
if(${'itms'.$position} == 0){
$log .= "<span class=\"red\">$itm</span>用光了。<br />";
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = '';
${'itm'.$position} = ${'itmk'.$position} = ${'itmsk'.$position} = ${'itmpara'.$position} = '';
${'itme'.$position} =${'itms'.$position} =0;
}
$mode = 'command';
......@@ -334,7 +334,7 @@ function syncro($sb){
return;
}
function weaponswap(){
global $log,$mode,$club,$wep,$wepk,$wepe,$weps,$wepsk,$gamecfg;
global $log,$mode,$club,$wep,$wepk,$wepe,$weps,$wepsk,$weppara,$gamecfg;
if (strpos($wepsk,'j')===false){
$log.='你的武器不能变换。<br>';
$mode = 'command';
......@@ -345,9 +345,9 @@ function weaponswap(){
$wlist = openfile($file);
$wnum = count($wlist)-1;
for ($i=0;$i<=$wnum;$i++){
list($on,$nn,$nk,$ne,$ns,$nsk) = explode(',',$wlist[$i]);
list($on,$nn,$nk,$ne,$ns,$nsk,$npara) = explode(',',$wlist[$i]);
if ($wep==$on){
$wep=$nn;$wepk=$nk;$wepe=$ne;$weps=$ns;$wepsk=$nsk;
$wep=$nn;$wepk=$nk;$wepe=$ne;$weps=$ns;$wepsk=$nsk;$weppara=$npara;
$log.="<span class=\"yellow\">{$oldw}</span>变换成了<span class=\"yellow\">{$wep}</span>。<br>";
return;
}
......
......@@ -915,6 +915,36 @@ function set_clbpara($para,$key,$value)
return $para;
}
//let's just copy the above...
//将itmpara转为数组
function get_itmpara($para)
{
if(empty($para)) $para = Array();
if(!is_array($para)) return json_decode($para,true);
else return $para;
}
//获取itmpara中指定键
function get_single_itmpara($para,$key)
{
if(!is_array($para)) $para = get_itmpara($para);
if(isset($para[$key])) return $para[$key];
return;
}
//删除itmpara中指定键
function del_single_itmpara($para,$key)
{
if(!is_array($para)) $para = get_itmpara($para);
if(isset($para[$key])) unset($para[$key]);
return $para;
}
//修改itmpara中指定键
function set_itmpara($para,$key,$value)
{
if(!is_array($para)) $para = get_itmpara($para);
if(isset($para[$key])) $para[$key] = $value;
return $para;
}
// 正态分布
function generate_ndnumbers($min, $max, $count = 10)
{
......
......@@ -156,6 +156,7 @@ function rs_game($mode = 0) {
}
if ($mode & 16) {
//echo " - 地图道具/陷阱初始化 - ";
//2024-07-19 No itmpara is intended to initially spawn in the map, thus this is unchanged for now - will change if a need arises.
//感谢 Martin1994 提供地图道具数据库化的源代码
$plsnum = sizeof($plsinfo);
$iqry = $tqry = '';
......@@ -240,16 +241,17 @@ function rs_game($mode = 0) {
{
foreach($nd_arr['itm'] as $nd_itm_arr)
{
$ditm = $nd_itm_arr['itm'];$ditmk = $nd_itm_arr['itmk'];$ditmsk = $nd_itm_arr['itmsk'];
$ditm = $nd_itm_arr['itm'];$ditmk = $nd_itm_arr['itmk'];$ditmsk = $nd_itm_arr['itmsk'];$ditmpara = $nd_itm_arr['itmpara'];
$ditme = $nd_itm_arr['itme'];$ditms = $nd_itm_arr['itms'];
$dname = $nd_arr['name'];$dtype = $nd_arr['type'];
$db->query("INSERT INTO {$tablepre}itemdepot (itm, itmk, itme, itms, itmsk ,itmowner, itmpw) VALUES ('$ditm', '$ditmk', '$ditme', '$ditms', '$ditmsk', '$dname', '$dtype')");
$db->query("INSERT INTO {$tablepre}itemdepot (itm, itmk, itme, itms, itmsk , itmpara, itmowner, itmpw) VALUES ('$ditm', '$ditmk', '$ditme', '$ditms', '$ditmsk', '$ditmpara', '$dname', '$dtype')");
}
}
}
}
if ($mode & 32) {
//echo " - 商店初始化 - ";
//2024-07-19 No itmpara is intended to initially spawn in the shop, thus this is unchanged for now - will change if a need arises.
$sql = file_get_contents("{$sqldir}shopitem.sql");
$sql = str_replace("\r", "\n", str_replace(' bra_', ' '.$tablepre, $sql));
$db->queries($sql);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment