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
48a8cc8b
Commit
48a8cc8b
authored
Jun 28, 2023
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复
Signed-off-by:
unknown
<
37928663+mccleaner@users.noreply.github.com
>
parent
87a87a3a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
46 deletions
+63
-46
command.php
command.php
+2
-1
include/game/special.func.php
include/game/special.func.php
+55
-39
templates/default/sp_add_trait.htm
templates/default/sp_add_trait.htm
+6
-6
No files found.
command.php
View file @
48a8cc8b
...
...
@@ -319,10 +319,11 @@ if($hp > 0){
}
else
{
$choice
=
(
int
)(
$choice
);
$choice2
=
(
int
)(
$choice2
);
//$choice = (int)$choice;
var_dump
(
$choice
);
if
(
$choice
<
1
||
$choice
>
6
||
$choice2
<
1
||
$choice2
>
6
)
$log
.=
'<span class="red">无此物品。</span><br />'
;
elseif
(
$choice
==
$choice2
)
$log
.=
'<span class="red">你选择了相同的代码片段。</span><br />'
;
else
{
include_once
GAME_ROOT
.
'./include/game/special.func.php'
;
item_add_trait
(
$choice
,
$choice2
);
...
...
include/game/special.func.php
View file @
48a8cc8b
...
...
@@ -479,31 +479,32 @@ function press_bomb(){
}
//提取代码片段逻辑
function
item_extract_trait
(
$which
,
$item_position
){
function
item_extract_trait
(
$which
,
$item_position
)
{
//去掉string which的最后一位
$which
=
substr
(
$which
,
0
,
-
1
);
global
$log
,
$mode
,
$club
;
if
(
$club
!=
21
)
{
global
$log
,
$mode
,
$club
;
if
(
$club
!=
21
)
{
$log
.=
'你的称号不能使用该技能。'
;
$mode
=
'command'
;
return
;
}
if
(
$item_position
<
1
||
$item_position
>
6
)
{
if
(
$item_position
<
1
||
$item_position
>
6
)
{
$log
.=
'此道具不存在,请重新选择。'
;
$mode
=
'command'
;
return
;
}
global
$
{
'itm'
.
$item_position
},
$
{
'itmk'
.
$item_position
},
$
{
'itme'
.
$item_position
},
$
{
'itms'
.
$item_position
},
$
{
'itmsk'
.
$item_position
};
$itm
=
&
$
{
'itm'
.
$item_position
};
$itmk
=
&
$
{
'itmk'
.
$item_position
};
$itme
=
&
$
{
'itme'
.
$item_position
};
$itms
=
&
$
{
'itms'
.
$item_position
};
$itmsk
=
&
$
{
'itmsk'
.
$item_position
};
global
$
{
'itm'
.
$item_position
},
$
{
'itmk'
.
$item_position
},
$
{
'itme'
.
$item_position
},
$
{
'itms'
.
$item_position
},
$
{
'itmsk'
.
$item_position
};
$itm
=
&
$
{
'itm'
.
$item_position
};
$itmk
=
&
$
{
'itmk'
.
$item_position
};
$itme
=
&
$
{
'itme'
.
$item_position
};
$itms
=
&
$
{
'itms'
.
$item_position
};
$itmsk
=
&
$
{
'itmsk'
.
$item_position
};
$tmp_trait
=
$
{
$which
.
$item_position
};
$tmp_trait
=
$
{
$which
.
$item_position
};
// 判断itmk是否以'D'或'W'开头
if
(
strpos
(
$itmk
,
'D'
)
===
0
||
strpos
(
$itmk
,
'W'
)
===
0
)
{
...
...
@@ -512,56 +513,71 @@ function item_extract_trait($which, $item_position){
$itme
=
'0'
;
$itms
=
'1'
;
$itmsk
=
''
;
$
{
$which
.
$item_position
}
=
$tmp_trait
;
$
{
$which
.
$item_position
}
=
$tmp_trait
;
// 将itmk替换为代码片段的itmk
$itmk
=
'🥚'
;
// 给代码片段命名
if
(
$which
==
'itm'
)
{
$itm
=
"名称"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
$itm
=
"名称"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
}
elseif
(
$which
==
'itme'
)
{
$itm
=
"效果"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
$itm
=
"效果"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
}
elseif
(
$which
==
'itms'
)
{
$itm
=
"耐久"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
$itm
=
"耐久"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
}
elseif
(
$which
==
'itmsk'
)
{
$itm
=
"属性"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
$itm
=
"属性"
.
$
{
$which
.
$item_position
}
.
'代码片段'
;
}
$log
.=
'成功将物品转换为代码片段。<br>'
;
}
else
{
$log
.=
'该物品无法转换为代码片段。<br>'
;
}
}
//合并代码片段逻辑
function
item_add_trait
(
$choice1
,
$choice2
){
global
$log
,
$mode
,
$club
;
if
(
$club
!=
21
){
function
item_add_trait
(
$choice1
,
$choice2
)
{
global
$log
,
$mode
,
$club
;
if
(
$club
!=
21
)
{
$log
.=
'你的称号不能使用该技能。'
;
$mode
=
'command'
;
return
;
}
//获取choice1和choice2的itm itmk itme itms itmsk
global
$
{
'itm'
.
$choice1
},
$
{
'itmk'
.
$choice1
},
$
{
'itme'
.
$choice1
},
$
{
'itms'
.
$choice1
},
$
{
'itmsk'
.
$choice1
};
global
$
{
'itm'
.
$choice2
},
$
{
'itmk'
.
$choice2
},
$
{
'itme'
.
$choice2
},
$
{
'itms'
.
$choice2
},
$
{
'itmsk'
.
$choice2
};
$itm1
=
&
$
{
'itm'
.
$choice1
};
$itmk1
=
&
$
{
'itmk'
.
$choice1
};
$itme1
=
&
$
{
'itme'
.
$choice1
};
$itms1
=
&
$
{
'itms'
.
$choice1
};
$itmsk1
=
&
$
{
'itmsk'
.
$choice1
};
$itm2
=
&
$
{
'itm'
.
$choice2
};
$itmk2
=
&
$
{
'itmk'
.
$choice2
};
$itme2
=
&
$
{
'itme'
.
$choice2
};
$itms2
=
&
$
{
'itms'
.
$choice2
};
$itmsk2
=
&
$
{
'itmsk'
.
$choice2
};
//检查itmk1是否为🥚,itmk2是否为D或W开头
var_dump
(
$itmk1
);
if
(
$itmk1
!=
'🥚'
||
(
strpos
(
$itmk2
,
'D'
)
!==
0
&&
strpos
(
$itmk2
,
'W'
)
!==
0
))
{
global
$
{
'itm'
.
$choice1
},
$
{
'itmk'
.
$choice1
},
$
{
'itme'
.
$choice1
},
$
{
'itms'
.
$choice1
},
$
{
'itmsk'
.
$choice1
};
global
$
{
'itm'
.
$choice2
},
$
{
'itmk'
.
$choice2
},
$
{
'itme'
.
$choice2
},
$
{
'itms'
.
$choice2
},
$
{
'itmsk'
.
$choice2
};
$itm1
=
&
$
{
'itm'
.
$choice1
};
$itmk1
=
&
$
{
'itmk'
.
$choice1
};
$itme1
=
&
$
{
'itme'
.
$choice1
};
$itms1
=
&
$
{
'itms'
.
$choice1
};
$itmsk1
=
&
$
{
'itmsk'
.
$choice1
};
$itm2
=
&
$
{
'itm'
.
$choice2
};
$itmk2
=
&
$
{
'itmk'
.
$choice2
};
$itme2
=
&
$
{
'itme'
.
$choice2
};
$itms2
=
&
$
{
'itms'
.
$choice2
};
$itmsk2
=
&
$
{
'itmsk'
.
$choice2
};
//检查itmk1是否为🥚,itmk2是否为D或W开头
或者是否为🥚
if
(
$itmk1
!=
'🥚'
||
(
strpos
(
$itmk2
,
'D'
)
!==
0
&&
strpos
(
$itmk2
,
'W'
)
!==
0
&&
(
$itmk2
!==
'🥚'
)))
{
var_dump
(
$itmk2
);
$log
.=
'该物品无法合并。<br>'
;
return
;
}
var_dump
(
$itm1
);
//让itm2属性合并itm1
$itm2
=
$itm1
.
$itm2
;
//如果都是🥚,则去掉$itm的所有“代码片段”四个字,然后itm相加
if
(
$itmk1
==
'🥚'
&&
$itmk2
==
'🥚'
)
{
$itm1
=
str_replace
(
'代码片段'
,
''
,
$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'
;
$itmsk2
=
'🥚'
;
$itms2
-=
1
;
return
;
}
$itmk2
=
$itmk1
.
$itmk2
;
$itme2
=
(
int
)
$itme1
+
(
int
)
$itme2
;
$itms2
=
(
int
)
$itms1
+
(
int
)
$itms2
;
...
...
templates/default/sp_add_trait.htm
View file @
48a8cc8b
...
...
@@ -20,12 +20,12 @@
<br><br>
<select
name=
"choice2"
onclick=
sl('choice2');
href=
"javascript:void(0);"
>
<option
value=
"0"
>
■ 道具二 ■
<br
/>
<!--{if (strpos ( $itmk1, 'D' ) === 0 ) || (strpos ( $itmk1, 'W' ) === 0) }-->
<option
value=
"1"
>
$itm1/$itme1/$itms1
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk2, 'D' ) === 0 ) || (strpos ( $itmk2, 'W' ) === 0) }-->
<option
value=
"2"
>
$itm2/$itme2/$itms2
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk3, 'D' ) === 0 ) || (strpos ( $itmk3, 'W' ) === 0) }-->
<option
value=
"3"
>
$itm3/$itme3/$itms3
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk4, 'D' ) === 0 ) || (strpos ( $itmk4, 'W' ) === 0) }-->
<option
value=
"4"
>
$itm4/$itme4/$itms4
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk5, 'D' ) === 0 ) || (strpos ( $itmk5, 'W' ) === 0) }-->
<option
value=
"5"
>
$itm5/$itme5/$itms5
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk6, 'D' ) === 0 ) || (strpos ( $itmk6, 'W' ) === 0) }-->
<option
value=
"6"
>
$itm6/$itme6/$itms6
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk1, 'D' ) === 0 ) || (strpos ( $itmk1, 'W' ) === 0)
|| (strpos ( $itmk1, '🥚' ) === 0)
}-->
<option
value=
"1"
>
$itm1/$itme1/$itms1
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk2, 'D' ) === 0 ) || (strpos ( $itmk2, 'W' ) === 0)
|| (strpos ( $itmk2, '🥚' ) === 0)
}-->
<option
value=
"2"
>
$itm2/$itme2/$itms2
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk3, 'D' ) === 0 ) || (strpos ( $itmk3, 'W' ) === 0)
|| (strpos ( $itmk3, '🥚' ) === 0)
}-->
<option
value=
"3"
>
$itm3/$itme3/$itms3
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk4, 'D' ) === 0 ) || (strpos ( $itmk4, 'W' ) === 0)
|| (strpos ( $itmk4, '🥚' ) === 0)
}-->
<option
value=
"4"
>
$itm4/$itme4/$itms4
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk5, 'D' ) === 0 ) || (strpos ( $itmk5, 'W' ) === 0)
|| (strpos ( $itmk5, '🥚' ) === 0)
}-->
<option
value=
"5"
>
$itm5/$itme5/$itms5
<br
/>
<!--{/if}-->
<!--{if (strpos ( $itmk6, 'D' ) === 0 ) || (strpos ( $itmk6, 'W' ) === 0)
|| (strpos ( $itmk6, '🥚' ) === 0)
}-->
<option
value=
"6"
>
$itm6/$itme6/$itms6
<br
/>
<!--{/if}-->
</select>
</div>
...
...
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