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
87a87a3a
Commit
87a87a3a
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
88bafccc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
2 deletions
+112
-2
command.php
command.php
+35
-0
include/game/special.func.php
include/game/special.func.php
+45
-2
templates/default/sp_add_trait.htm
templates/default/sp_add_trait.htm
+32
-0
No files found.
command.php
View file @
87a87a3a
...
...
@@ -293,6 +293,41 @@ if($hp > 0){
item_extract_trait
(
$choice
,
$choice_position
);
}
$mode
=
'command'
;
}
//码语行人插入
}
elseif
(
$sp_cmd
==
'sp_add_trait'
)
{
$position
=
0
;
if
(
$club
==
21
)
{
foreach
(
array
(
1
,
2
,
3
,
4
,
5
,
6
)
as
$imn
)
//遍历所有武器装备
if
(
strpos
(
$
{
'itmk'
.
$imn
},
'🥚'
)
===
0
)
{
$position
=
$imn
;
break
;
}
if
(
!
$position
)
{
$log
.=
'<span class="red">你没有代码片段,无法插入代码片段!</span><br />'
;
$mode
=
'command'
;
}
else
$mode
=
'sp_add_trait'
;
}
else
{
$log
.=
'<span class="red">你不懂得如何插入代码片段!</span><br />'
;
$mode
=
'command'
;
}
}
elseif
(
$sp_cmd
==
'sp_add_trait_selected'
)
{
if
(
!
isset
(
$choice
)
||
$choice
==
'menu'
)
{
var_dump
(
$choice
);
$mode
=
'command'
;
}
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 />'
;
else
{
include_once
GAME_ROOT
.
'./include/game/special.func.php'
;
item_add_trait
(
$choice
,
$choice2
);
}
$mode
=
'command'
;
}
}
elseif
(
$sp_cmd
==
'sp_pbomb'
){
$mode
=
'sp_pbomb'
;
...
...
include/game/special.func.php
View file @
87a87a3a
...
...
@@ -532,6 +532,51 @@ function item_extract_trait($which, $item_position){
}
//合并代码片段逻辑
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
))
{
$log
.=
'该物品无法合并。<br>'
;
return
;
}
var_dump
(
$itm1
);
//让itm2属性合并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'
;
//去除itm2重复的属性
$itmsk2
=
implode
(
array_unique
(
str_split
(
$itmsk2
)));
//去除itm2属性里的🥚
$itmk2
=
str_replace
(
'🥚'
,
''
,
$itmk2
);
}
function
shoplist
(
$sn
,
$getlist
=
NULL
)
{
global
$gamecfg
,
$mode
,
$itemdata
,
$areanum
,
$areaadd
,
$iteminfo
,
$itemspkinfo
,
$club
;
global
$db
,
$tablepre
;
...
...
@@ -587,5 +632,3 @@ function shoplist($sn,$getlist=NULL) {
return
;
}
?>
templates/default/sp_add_trait.htm
0 → 100644
View file @
87a87a3a
<input
type=
"hidden"
name=
"mode"
value=
"command"
/>
<input
type=
"hidden"
name=
"command"
value=
"special"
/>
<input
type=
"hidden"
name=
"sp_cmd"
value=
"sp_add_trait_selected"
/>
<input
type=
"hidden"
id=
"choice"
name=
"choice"
value=
"menu"
/>
<input
type=
"hidden"
id=
"choice2"
name=
"choice"
value=
"menu"
/>
你打算怎么插入代码片段?
<br>
<div
style=
"padding: 5px;"
>
<select
name=
"choice"
onclick=
sl('choice');
href=
"javascript:void(0);"
>
<option
value=
"0"
>
■ 道具一 ■
<br
/>
<!--{if (strpos($itmk1, '🥚') === 0)}-->
<option
value=
"1"
>
$itm1/$itme1/$itms1
<br
/>
<!--{/if}-->
<!--{if (strpos($itmk2, '🥚') === 0)}-->
<option
value=
"2"
>
$itm2/$itme2/$itms2
<br
/>
<!--{/if}-->
<!--{if (strpos($itmk3, '🥚') === 0)}-->
<option
value=
"3"
>
$itm3/$itme3/$itms3
<br
/>
<!--{/if}-->
<!--{if (strpos($itmk4, '🥚') === 0)}-->
<option
value=
"4"
>
$itm4/$itme4/$itms4
<br
/>
<!--{/if}-->
<!--{if (strpos($itmk5, '🥚') === 0)}-->
<option
value=
"5"
>
$itm5/$itme5/$itms5
<br
/>
<!--{/if}-->
<!--{if (strpos($itmk6, '🥚') === 0)}-->
<option
value=
"6"
>
$itm6/$itme6/$itms6
<br
/>
<!--{/if}-->
</select>
<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}-->
</select>
</div>
<input
type=
"button"
class=
"cmdbutton"
id=
"zz"
name=
"submit"
value=
"[Z]提交"
onclick=
"postCmd('gamecmd','command.php');this.disabled=true;"
>
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