Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
phpdts
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Nemo Ma
phpdts
Commits
8ee2c7f9
Commit
8ee2c7f9
authored
Jul 06, 2023
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
完善合并
parent
3def63bc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
60 additions
and
5 deletions
+60
-5
gamedata/club21cfg.php
gamedata/club21cfg.php
+14
-1
include/game/special.func.php
include/game/special.func.php
+46
-4
No files found.
gamedata/club21cfg.php
View file @
8ee2c7f9
<?php
//码语行人配置文件
//各个属性比率
$itmsk_extract_rate
=
array
(
$itmsk_extract_rate
=
array
(
'A'
=>
150
,
'a'
=>
150
,
'B'
=>
400
,
...
...
@@ -55,6 +55,19 @@ $itmsk_extract_rate=array(
'^'
=>
1200
,
'🧰'
=>
200
);
//itm
$itm_extract_rate
=
array
(
"棍棒"
=>
250
,
"改"
=>
100
,
"+"
=>
100
,
"n"
=>
10
);
//物品效果和耐久的场合:按照1:1比率消耗体力进行提取
$itms_extract_rate
=
1
;
//耐久
$itme_extract_rate
=
1
;
//效果
//插入代码片段
$insert_rate
=
50
;
//合并代码片段
$merge_rate
=
0
;
\ No newline at end of file
include/game/special.func.php
View file @
8ee2c7f9
...
...
@@ -511,14 +511,32 @@ function item_extract_trait($which, $item_position)
if
(
strpos
(
$itmk
,
'D'
)
===
0
||
strpos
(
$itmk
,
'W'
)
===
0
)
{
// 给代码片段命名
if
(
$which
==
'itm'
)
{
preg_match_all
(
'/(改|棍棒)/u'
,
$itm
,
$matches
);
preg_match_all
(
'/(改|棍棒
|\+(\\d+)
)/u'
,
$itm
,
$matches
);
if
(
!
empty
(
$matches
[
0
]))
{
$sp_cost
=
0
;
foreach
(
$matches
[
0
]
as
$match
)
{
if
(
$match
==
'改'
)
{
$sp_cost
+=
$itm_extract_rate
[
'改'
]
*
1
;
}
elseif
(
$match
==
'棍棒'
)
{
$sp_cost
+=
$itm_extract_rate
[
'棍棒'
]
*
1
;
}
else
{
preg_match
(
'/\+(\d+)/'
,
$match
,
$numberMatch
);
$number
=
isset
(
$numberMatch
[
1
])
?
(
int
)
$numberMatch
[
1
]
:
0
;
$sp_cost
+=
$itm_extract_rate
[
'+'
]
+
$itm_extract_rate
[
'n'
]
*
$number
;
}
}
if
(
$sp
<
$sp_cost
)
{
$log
.=
'体力不足,无法转换为代码片段。<br>'
;
return
;
}
$sp
-=
$sp_cost
;
$log
.=
'消耗体力'
.
$sp_cost
.
'点。<br>'
;
$itm
=
implode
(
''
,
$matches
[
0
]);
//转换成string
$itm
=
(
string
)
$itm
;
$itm
=
"名称"
.
$itm
.
'代码片段'
;
$itmk
=
''
;
$itmk
=
'
🥚
'
;
$itme
=
'0'
;
$itms
=
'1'
;
$itmsk
=
''
;
...
...
@@ -574,7 +592,7 @@ function item_extract_trait($which, $item_position)
//合并代码片段逻辑
function
item_add_trait
(
$choice1
,
$choice2
)
{
global
$log
,
$mode
,
$club
;
global
$log
,
$mode
,
$club
,
$sp
,
$rage
;
if
(
$club
!=
21
)
{
$log
.=
'你的称号不能使用该技能。'
;
$mode
=
'command'
;
...
...
@@ -616,6 +634,30 @@ function item_add_trait($choice1, $choice2)
$itms2
-=
1
;
return
;
}
if
(
$rage
<
50
)
{
$log
.=
'怒气不足,无法合并代码片段。<br>'
;
return
;
}
$rage
-=
50
;
//如果itm1是名称开头的
if
(
strpos
(
$itm1
,
'名称'
)
===
0
){
//去掉名称和代码片段后合并
$itm1
=
str_replace
(
'名称'
,
''
,
$itm1
);
$itm1
=
str_replace
(
'代码片段'
,
''
,
$itm1
);
var_dump
(
$itm1
);
$itm2
=
$itm1
.
$itm2
;
$itmk2
=
$itmk1
.
$itmk2
;
$itme2
=
(
int
)
$itme1
+
(
int
)
$itme2
;
$itms2
=
(
int
)
$itms1
+
(
int
)
$itms2
;
$itmsk2
=
$itmsk1
.
$itmsk2
;
//清空itm1
$itm1
=
''
;
$itmk1
=
''
;
$itme1
=
'0'
;
$itms1
=
'0'
;
$itmk2
=
str_replace
(
'🥚'
,
''
,
$itmk2
);
return
;
}
$itmk2
=
$itmk1
.
$itmk2
;
$itme2
=
(
int
)
$itme1
+
(
int
)
$itme2
;
$itms2
=
(
int
)
$itms1
+
(
int
)
$itms2
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment