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
6026d5fd
Commit
6026d5fd
authored
Feb 23, 2024
by
satsuki8
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add octitem
parent
c5336dbe
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
0 deletions
+67
-0
gamedata/cache/shopitem_1.php
gamedata/cache/shopitem_1.php
+1
-0
include/game/item.func.php
include/game/item.func.php
+57
-0
include/game/itemmain.func.php
include/game/itemmain.func.php
+9
-0
No files found.
gamedata/cache/shopitem_1.php
View file @
6026d5fd
...
...
@@ -215,6 +215,7 @@
18,5,390,0,【歌单】蓝凝,Z,1,1,,
18,5,390,0,【歌单】冰炎,Z,1,1,,
18,5,390,0,【歌单】芙蓉,Z,1,1,,
18,5,20,0,棱镜八面体,Z,1,1,,
18,5,200,1,【我太帅啦!】,Z,1,1,,
18,5,200,1,【我太棒啦!】,Z,1,1,,
18,5,200,1,【我太强啦!】,Z,1,1,,
...
...
include/game/item.func.php
View file @
6026d5fd
...
...
@@ -4145,6 +4145,10 @@ function itemuse($itmn,&$data=NULL) {
$itme
=
$itms
=
0
;
# Sign
$clbpara
[
'iAmRich'
]
+=
1
;
}
elseif
(
$itm
==
'棱镜八面体'
){
$log
.=
"你使用了<span class=
\"
yellow b
\"
>
{
$itm
}
</span>。<br>"
;
$theitem
=
array
(
'itm'
=>
&
$itm
,
'itmk'
=>
&
$itmk
,
'itme'
=>
&
$itme
,
'itms'
=>
&
$itms
,
'itmsk'
=>
&
$itmsk
);
octitem_rotate
(
$theitem
,
$itmn
,
1
);
}
else
{
$log
.=
" <span class=
\"
yellow
\"
>
$itm
</span> 该如何使用呢?<br>"
;
}
...
...
@@ -4191,4 +4195,57 @@ function itemuse($itmn,&$data=NULL) {
return
;
}
function
octitem_rotate
(
&
$theitem
,
$rotpos
,
$showlog
=
0
)
{
global
$log
;
$itm
=&
$theitem
[
'itm'
];
$itmk
=&
$theitem
[
'itmk'
];
$itme
=&
$theitem
[
'itme'
];
$itms
=&
$theitem
[
'itms'
];
$itmsk
=&
$theitem
[
'itmsk'
];
$oct_colors_words
=
array
(
'<span class="red">红</span>'
,
'<span class="lime">绿</span>'
,
'<span class="clan">蓝</span>'
,
'<span class="yellow">黄</span>'
,
'<span class="gold">金</span>'
,
'<span class="linen">银</span>'
,
'<span class="mtgblack">黑</span>'
,
'<span class="mtgwhite">白</span>'
);
if
(
strlen
(
$itmsk
)
!=
16
)
{
$oct_seq
=
range
(
0
,
7
);
shuffle
(
$oct_seq
);
$oct_colors
=
range
(
0
,
7
);
shuffle
(
$oct_colors
);
}
else
{
$itmsk_arr
=
str_split
(
$itmsk
);
$oct_seq
=
array_slice
(
$itmsk_arr
,
0
,
8
);
$oct_colors
=
array_slice
(
$itmsk_arr
,
8
);
}
//改变选中面和另两个面的颜色
$oct_colors
[
$rotpos
]
=
(
$oct_colors
[
$rotpos
]
+
1
)
%
8
;
$rotpos2
=
(
$rotpos
+
1
)
%
8
;
$oct_colors
[
$rotpos2
]
=
(
$oct_colors
[
$rotpos2
]
+
1
)
%
8
;
$rotpos3
=
(
$rotpos
+
2
)
%
8
;
$oct_colors
[
$rotpos3
]
=
(
$oct_colors
[
$rotpos3
]
+
1
)
%
8
;
$itmsk
=
implode
(
''
,
$oct_seq
)
.
implode
(
''
,
$oct_colors
);
if
(
$showlog
)
{
$log
.=
"<br><span class=
\"
yellow b
\"
>
{
$itm
}
</span>八个面的颜色为:<br>"
;
foreach
(
$oct_seq
as
$v
)
{
$log
.=
$oct_colors_words
[
$oct_colors
[
$v
]]
.
' '
;
}
//$log .= "测试:真实序列为".implode('', $oct_colors);
$log
.=
"<br>"
;
}
//结果检查
$oc_count
=
count
(
array_unique
(
$oct_colors
));
if
(
$oc_count
==
1
)
{
if
(
$showlog
)
{
$log
.=
"<span class=
\"
yellow b
\"
>
{
$itm
}
</span>的形状发生了变化……<br>"
;
}
$itm
=
'★棱镜八面体模样的彩色糖果★'
;
$itmk
=
'HM'
;
$itme
=
88
;
$itms
=
8
;
$itmsk
=
'x'
;
}
}
?>
include/game/itemmain.func.php
View file @
6026d5fd
...
...
@@ -600,6 +600,15 @@ function itemdrop($item,&$data=NULL) {
$mode
=
'command'
;
return
;
}
if
((
strpos
(
$itmk
,
'Y'
)
===
0
||
strpos
(
$itmk
,
'Z'
)
===
0
)
&&
(
$itm
==
'棱镜八面体'
))
{
$theitem
=
array
(
'itm'
=>
&
$itm
,
'itmk'
=>
&
$itmk
,
'itme'
=>
&
$itme
,
'itms'
=>
&
$itms
,
'itmsk'
=>
&
$itmsk
);
$log
.=
"<span class=
\"
yellow b
\"
>
{
$itm
}
</span>似乎发生了变化……<br>"
;
include_once
GAME_ROOT
.
'./include/game/item.func.php'
;
octitem_rotate
(
$theitem
,
7
);
}
if
(
strpos
(
$itmsk
,
'v'
)
!==
false
)
{
$log
.=
"
{
$itm
}
在地上化作点点碎片,随风消逝了。<br>"
;
...
...
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