Commit 22da0760 authored by unknown's avatar unknown

调整名称要素提取

Signed-off-by: default avatarunknown <37928663+mccleaner@users.noreply.github.com>
parent 48a8cc8b
......@@ -508,28 +508,46 @@ function item_extract_trait($which, $item_position)
// 判断itmk是否以'D'或'W'开头
if (strpos($itmk, 'D') === 0 || strpos($itmk, 'W') === 0) {
$itm = '';
$itmk = '';
$itme = '0';
$itms = '1';
$itmsk = '';
${$which . $item_position} = $tmp_trait;
// 将itmk替换为代码片段的itmk
$itmk = '🥚';
// 给代码片段命名
if ($which == 'itm') {
$itm = "名称" . ${$which . $item_position} . '代码片段';
} elseif ($which == 'itme') {
if ($which == 'itm') {
preg_match_all('/(改|棍棒)/u', $itm, $matches);
//var_dump($matches);
if (!empty($matches[0])) {
$itm = implode('', $matches[0]);
//转换成string
$itm = (string)$itm;
$itm = "名称" . $itm . '代码片段';
$itmk = '';
$itme = '0';
$itms = '1';
$itmsk = '';
return;
}
else {
$log .= '该物品无法转换为代码片段。<br>';
return;
}
}
elseif ($which == 'itme') {
$itm = "效果" . ${$which . $item_position} . '代码片段';
} elseif ($which == 'itms') {
$itm = "耐久" . ${$which . $item_position} . '代码片段';
} elseif ($which == 'itmsk') {
$itm = "属性" . ${$which . $item_position} . '代码片段';
}
$itmk = '';
$itme = '0';
$itms = '1';
$itmsk = '';
${$which . $item_position} = $tmp_trait;
// 将itmk替换为代码片段的itmk
$itmk = '🥚';
$log .= '成功将物品转换为代码片段。<br>';
} else {
$log .= '该物品无法转换为代码片段。<br>';
}
return;
}
//合并代码片段逻辑
......@@ -574,7 +592,7 @@ function item_add_trait($choice1, $choice2)
$itmk1 = '';
$itme1 = '0';
$itms1 = '0';
$itmsk2 = '🥚';
$itmk2 = '🥚';
$itms2 -= 1;
return;
}
......
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