Commit e15cf1a1 authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #35 from hikawiier/waaagh

Add console & dialogue
parents f416998b 45b16bf4
......@@ -6,7 +6,8 @@ require './include/common.inc.php';
//$t_s=getmicrotime();
//require_once GAME_ROOT.'./include/JSON.php';
require GAME_ROOT.'./include/game.func.php';
require config('combatcfg',$gamecfg);
include config('combatcfg',$gamecfg);
include config('dialogue',$gamecfg);
//判断是否进入游戏
if(!$cuser||!$cpass) { gexit($_ERROR['no_login'],__file__,__line__); }
......@@ -94,7 +95,11 @@ if($hp > 0){
$rmcdtime = $nowmtime >= $cdover ? 0 : $cdover - $nowmtime;
}
if($coldtimeon && $rmcdtime > 0 && (strpos($command,'move')===0 || strpos($command,'search')===0 || (strpos($command,'itm')===0)&&($command != 'itemget') || strpos($sp_cmd,'sp_weapon')===0 || strpos($command,'song')===0)){
//执行动作前检查是否有无法跳过且未阅览过的对话框
if(isset($clbpara['noskip_dialogue']) && strpos($command,'end_dialogue')===false)
{
$dialogue_id = $clbpara['dialogue'];
}elseif($coldtimeon && $rmcdtime > 0 && (strpos($command,'move')===0 || strpos($command,'search')===0 || (strpos($command,'itm')===0)&&($command != 'itemget') || strpos($sp_cmd,'sp_weapon')===0 || strpos($command,'song')===0)){
$log .= '<span class="yellow">冷却时间尚未结束!</span><br>';
$mode = 'command';
}else{
......@@ -243,7 +248,32 @@ if($hp > 0){
} else{
teamcheck();
}
}
} elseif(strpos($command,'consle') === 0) {
if(isset($clbpara['console']))
{
$cls_cmd = substr($command,7);
include_once GAME_ROOT.'./include/game/console.func.php';
if($cls_cmd == 'wthchange'){console_wthchange($cwth);}
elseif($cls_cmd == 'dbutton'){console_dbutton();}
elseif($cls_cmd == 'radar'){
include_once GAME_ROOT.'./include/game/item2.func.php';
newradar(2);
}elseif($cls_cmd == 'search'){
$cls_cmd_kind = substr($csc,7);
console_searching($cls_cmd_kind,$csnm,$cstype);
}elseif(strpos($cls_cmd,'areactrl')===0){
$cls_cmd_kind = substr($cls_cmd,8);
console_areacontrol($cls_cmd_kind);
}
}
else{
$mode='command';
}
} elseif(strpos($command,'end_dialogue') === 0) {
//$log.="【DEBUG】关闭了对话框。";
if(isset($dialogue_log[$clbpara['dialogue']])) $log.= $dialogue_log[$clbpara['dialogue']];
unset($clbpara['dialogue']); unset($clbpara['noskip_dialogue']);
}
} elseif($mode == 'item') {
include_once GAME_ROOT.'./include/game/item2.func.php';
$item = substr($command,3);
......@@ -298,27 +328,20 @@ if($hp > 0){
else itemmix($mixlist);
}
} elseif($command == 'elementmix') {
if($club == 20)
{
if($club == 20){
$e_mixlist = Array();
foreach($elements_info as $e_key=>$e_info)
{
foreach($elements_info as $e_key=>$e_info){
global ${'element'.$e_key};
$m_e_key = $e_key + 1;//这样就不用污染原本的js了
if(isset(${'emitm'.$e_key.'_num'})) ${'emitm'.$e_key.'_num'} = round( ${'emitm'.$e_key.'_num'});
if(${'mitm'.$m_e_key}>=0 && ${'element'.$e_key} && ${'emitm'.$e_key.'_num'}>0 && ${'emitm'.$e_key.'_num'}<=${'element'.$e_key})
{
//打入参与合成的元素编号与数量
$e_mixlist[$e_key] = ${'emitm'.$e_key.'_num'};
if(${'mitm'.$m_e_key}>=0 && ${'element'.$e_key} && ${'emitm'.$e_key.'_num'}>0 && ${'emitm'.$e_key.'_num'}<=${'element'.$e_key}){
$e_mixlist[$e_key] = ${'emitm'.$e_key.'_num'}; //打入参与合成的元素编号与数量
}
}
if(count($e_mixlist)>0)
{
//echo '【DEBUG】提交阶段:值系数'.$emitme_r.'上限系数:'.$emitme_max_r.'上限勾选状态:'.$change_emax.'值勾选状态:'.$change_emr.'<br>';
if(count($e_mixlist)>0){
$er = ($lvl>=15 && $emitme_r && $change_emr>0) ? $emitme_r : NULL;
$emr = ($lvl>=5 && $emitme_max_r && $change_emax>0) ? $emitme_max_r : NULL;
include_once GAME_ROOT.'./include/game/elementmix.func.php';
//echo '【DEBUG】传入阶段:值系数'.$er.'上限系数:'.$emr.'<br>';
element_mix($e_mixlist,$emr,$er);
}
else{$log.="至少要放入一份元素。<br>";}
......@@ -326,8 +349,7 @@ if($hp > 0){
else {$log.="你挠了挠头,没搞懂自己到底要干什么。<br>";}
$mode='command';
} elseif($command == 'elementbag') {
if($club == 20)
{
if($club == 20){
include_once GAME_ROOT.'./include/game/elementmix.func.php';
print_elements_info();
}
......@@ -361,13 +383,25 @@ if($hp > 0){
} elseif($mode == 'special') {
include_once GAME_ROOT.'./include/game/special.func.php';
if(strpos($command,'pose') === 0) {
$pose = substr($command,4,1);
$log .= "基础姿态变为<span class=\"yellow\">$poseinfo[$pose]</span>。<br> ";
$mode = 'command';
$cpose = substr($command,4,1);
if(in_array($cpose,$apose)){
$pose = $cpose;
$log .= "基础姿态变为<span class=\"yellow\">$poseinfo[$pose]</span>。<br> ";
$mode = 'command';
}else{
$log .= "<span class=\"yellow\">这个姿势太奇怪了!</span><br> ";
$mode = 'command';
}
} elseif(strpos($command,'tac') === 0) {
$tactic = substr($command,3,1);
$log .= "应战策略变为<span class=\"yellow\">$tacinfo[$tactic]</span>。<br> ";
$mode = 'command';
$ctac = substr($command,3,1);
if(in_array($ctac,$atac)){
$tactic = $ctac;
$log .= "应战策略变为<span class=\"yellow\">$tacinfo[$tactic]</span>。<br> ";
$mode = 'command';
}else{
$log .= "<span class=\"yellow\">这种策略太奇怪了!</span><br> ";
$mode = 'command';
}
} elseif(strpos($command,'inf') === 0) {
$infpos = substr($command,3,1);
chginf($infpos);
......@@ -396,10 +430,7 @@ if($hp > 0){
} elseif($mode == 'combat') {
include_once GAME_ROOT.'./include/game/combat.func.php';
combat(1,$command);
include_once GAME_ROOT.'./include/game/revcombat.func.php';
combat(1,$command);
} elseif($mode == 'revcombat'){
global $action;
if(strpos($action,'enemy')===0)
{
$enemyid = str_replace('enemy','',$action);
......@@ -472,7 +503,6 @@ if($hp > 0){
include_once GAME_ROOT.'./include/game/depot.func.php';
if(in_array($pls,$depots))
{
global $name,$type;
$saveitem_list = depot_getlist($name,$type);
switch($command)
{
......@@ -567,11 +597,13 @@ if($hp > 0){
$bgm_player = init_bgm();
if(!empty($bgm_player))
{
global $volume,$bgmname;
$gamedata['innerHTML']['bgmname'] = $bgmname;
$gamedata['innerHTML']['volume_num'] = $volume.'%';
$gamedata['innerHTML']['ingamebgm'] = $bgm_player;
}
//检查执行动作后是否有对话框产生
if(isset($clbpara['dialogue']))
{
$dialogue_id = $clbpara['dialogue'];
}
//显示指令执行结果
$gamedata['innerHTML']['notice'] = ob_get_contents();
if($coldtimeon && $showcoldtimer && $rmcdtime){
......
......@@ -87,9 +87,8 @@ if($hp <= 0){
$mode = 'itemmain';
} else {
$mode = 'command';
$command = 'enter';
}
$command = 'enter';
$cmd = $main = '';
if((strpos($action,'corpse')===0 || strpos($action,'pacorpse')===0) && $gamestate<40){
$cid = strpos($action,'corpse')===0 ? str_replace('corpse','',$action) : str_replace('pacorpse','',$action);
......@@ -126,6 +125,11 @@ if ($club==0)
getclub($name,$c1,$c2,$c3);
$clubavl[0]=0; $clubavl[1]=$c1; $clubavl[2]=$c2; $clubavl[3]=$c3;
}
if(isset($clbpara['dialogue']))
{
include_once config('dialogue',$gamecfg);
$dialogue_id = $clbpara['dialogue'];
}
include template('game');
......
<?php
if(!defined('IN_GAME')) exit('Access Denied');
# 对话框相关配置文件:
# 用法:在行动中加入 $clbpara['dialogue'] = '单组对白名'; 行动后便会自动跳出对话框。默认情况下,对话框可以直接点击外侧窗口关闭(即跳过);
# 如果想要生成不能跳过(比如存在选择肢)的对话框,加入 $clbpara['noskip_dialogue'] = 1;
# 单组对白:
$dialogues = Array
(
//仅作演示用
'thiphase' => Array
(
0 => '在你唱出那单一的旋律的霎那,<br>整个虚拟世界起了翻天覆地的变化……',
1 => '世界响应着这旋律,产生了异变……<br>因为破灭之歌的作用,全部锁定被打破了!',
2 => '在下一个瞬间——像是受到电磁干扰般,<br>你的战术界面突然变得花白一片。',
3 => '<span class="grey">“……防火墙……已……<br>……请到……山丘上……来……”</span>',
4 => '什么?',
5 => '没等你反应过来,那位不速之客便已切断了通讯。<br>你呆望着恢复如常的界面,试图厘清这段语焉不详的讯息究竟有何含义……',
),
);
# 单组对白中哪一页对话会显示头像:
$dialogue_icon = Array
(
'thiphase' => Array
(
//第三页时会显示头像
3 => 'img/n_0.gif',
),
);
# 单组对白结束时关闭对话框候显示的log
$dialogue_log = Array
(
'thiphase' => "<span class='lime'>※ 权限重载完成,控制模块已解锁。</span><br>……这又是什么时候的事?<br><br>",
);
# 单组对白结束时提供选择肢:
$dialogue_branch = Array
(
);
# 单组对白结束提供特殊结束按钮(非必须、仅在结束对白会触发特殊事件时调用):
$dialogue_ending = Array
(
);
?>
This diff is collapsed.
......@@ -20,7 +20,7 @@ $mltwk = '泛用兵器';
//游戏状态描述
$gstate = Array(0 => '<font color="grey">已结束</font>',10 => '即将开始',20 => '开放激活',30 => '人数已满',40=> '<font color="yellow">连斗中</font>',50=>'<font color="red">死斗中</font>',60=>'<font color="red">紧急状态!</font>');
$gstate = Array(0 => '<font color="grey">已结束</font>',10 => '即将开始',20 => '开放激活',30 => '停止激活',40=> '<font color="yellow">连斗中</font>',50=>'<font color="red">死斗中</font>',60=>'<font color="red">紧急状态!</font>');
$gwin = Array(0 => '程序故障', 1 => '全部死亡',2 => '最后幸存',3 => '锁定解除',4 => '无人参加',5 => '核爆全灭',6 => 'GM中止',7=>'幻境解离');
$week = Array('日','一','二','三','四','五','六');
$clubinfo = Array(
......@@ -55,12 +55,15 @@ $rswtharr = Array(0,2,3,4,7);
$wthinfo = Array('晴天','大晴','多云','小雨','暴雨','台风','雷雨','下雪','起雾','浓雾','<span class="yellow">瘴气</span>','<span class="red">龙卷风</span>','<span class="clan">暴风雪</span>','<span class="blue">冰雹</span>','<span class="linen">离子暴</span>','<span class="green">辐射尘</span>','<span class="purple">臭氧洞</span>','<span class="gold">极光</span>');
$sexinfo = Array(0=> '未定', 'm' => '男生', 'f' => '女生');
$raceinfo = Array(0=> '人类', 1=> '兽人', 2=> '妖精', 3=> '龙', 4=> '鱼人', 5=> 'AI');
$hpinfo = Array('并无大碍','伤痕累累','生命危险','已经死亡');
$hpinfo = Array('<span class="clan">并无大碍</span>','<span class="yellow">伤痕累累</span>','<span class="red">生命危险</span>','<span class="red">已经死亡</span>');
$spinfo = Array('精力充沛','略有疲惫','精疲力尽','已经死亡');
$rageinfo = Array('平静','愤怒','暴怒','已经死亡');
$wepeinfo = Array('不值一提','略有威胁','威力可观','无敌神器');
$poseinfo = Array('通常','作战姿态','强袭姿态','探物姿态','偷袭姿态','治疗姿态','✧狂飙姿态✧');
$poseinfo = Array('通常','作战姿态','强袭姿态','探物姿态','偷袭姿态','治疗姿态','✧狂飙姿态✧','哨戒姿态');
$tacinfo = Array('通常','','重视防御','重视反击','重视躲避');
//可供玩家选择的姿态、策略
$apose = Array(0,1,3,4,5,6);
$atac = Array(0,2,3,4);
//不会生成在危险地图的NPC(女主)
$hidding_typelist = Array(14);
//不会因躲避禁区、追杀玩家等原因离开地图的NPC(红暮、■、执行官、英灵(没有巫师)、SCP、种火)
......@@ -1207,7 +1210,7 @@ $title_desc = Array
(
# class-样式 title-提示悬浮框 img-图片url,会覆盖样式与悬浮框
'参展者' => Array('title'=>"参展者就是参加会展的人……你还记得自己是来参加动漫展的吧?"),
'补给掠夺者' => Array('class'=>'yellow', 'title'=>"你是真能吃啊!"),
'补给掠夺者' => Array('class'=>'', 'title'=>"你是真能吃啊!"),
'弱子' => Array('img'=>"img/nicktest.png",)
);
......
......@@ -110,8 +110,12 @@ table.dialogue {
.evergreen{color:#98fb98;font: bold 10pt "微软雅黑" serif;line-height:16px}
.evergreen2{color:#98fb98;font:18pt "微软雅黑" serif;}
.lightgreen{color:#8AE234;font: bold 10pt "微软雅黑" serif;line-height:16px}
.magenta{color:#FF00FF;font: bold 10pt "微软雅黑" serif;line-height:16px}
.magenta{color:#FF1493;font: bold 10pt "微软雅黑" serif;line-height:16px}
.sienna{color:#EE7942;font: bold 10pt "微软雅黑" serif;line-height:16px}
.orange{color:#FFA500;font: bold 10pt "微软雅黑" serif;line-height:16px}
.darkviolet{color:#9400D3;font: bold 10pt "微软雅黑" serif;line-height:16px}
.darkcyan{color:#008B8B;font: bold 10pt "微软雅黑" serif;line-height:16px}
.seagreen{color:#4EEE94;font: bold 10pt "微软雅黑" serif;line-height:16px}
.dmg {color:#ff0000;font: bold 10pt "微软雅黑" serif;}
.grey{color:#999; font: bold 10pt "微软雅黑" serif;line-height:16px}
.linen{color:rgb(200,192,184); font: bold 10pt "微软雅黑" serif;line-height:16px}
......@@ -358,7 +362,7 @@ background-image: url("../../img/footer_line.gif");
border-width: 0px;
}
/*==========tooltip样式 摆脱title了!==========*/
/* tooltip样式 摆脱title了! */
span[tooltip] {
position: relative;
}
......@@ -373,7 +377,7 @@ span[tooltip]:hover:before {
width: 160px; max-width: 160px; z-index: 3; position: absolute; z-index: 5;
}
/*==========下拉菜单样式==========*/
/* 下拉菜单样式 */
.headerlink{
font-family: "微软雅黑";
}
......@@ -407,7 +411,7 @@ span.drop:hover .dropdown-menu{
font: bold 10pt "微软雅黑" serif; color: white; overflow-x:hidden; overflow-y:auto; text-shadow:3px 3px 3px #231e1e; text-align: center;
}
/*==========在小头像上悬浮显示大头像==========*/
/* 在小头像上悬浮显示大头像 */
.icon{
position: relative;
......@@ -430,7 +434,7 @@ span.drop:hover .dropdown-menu{
display: none;
}
/*==========用dialog实现的气泡框==========*/
/* 用dialog实现的气泡框 */
dialog{
position: fixed;
max-width: 50%;
......@@ -458,7 +462,7 @@ dialog::backdrop{
z-index:-2;
}
/*==========滑动选择器(半废弃)==========*/
/* 滑动选择器(半废弃) */
input.range{
margin: 5px;
width: 100%;
......@@ -468,7 +472,7 @@ input.range{
box-shadow:0 0 5px 1px rgba(0, 0, 0, 0.5);
}
/*==========EmojiIcon==========*/
/* EmojiIcon */
.eicon{
filter: grayscale(100%) brightness(133%) blur(0px);
font-size: 125%;
......@@ -481,4 +485,37 @@ input.range{
background-color: rgba(153, 153, 153, 0.5);
border-radius: 5%;
box-shadow: 0px 2px 6px #999;
}
.blurtext{
align-self: center;
filter: opacity(75%) blur(2px);
}
.lockmap {
background:url("../../img/lock.png") center;background-color:rgba(17,17,17,0.5);
filter:opacity(75%) brightness(75%);BORDER: #111 1px solid;text-align: center;font: bold 10pt "微软雅黑" serif;
transition: 0.5s;
}
.lockmap:hover{
filter: opacity(100%) brightness(100%);
}
.dangerbutton{
padding: 2rem 2rem;
border: 0;
border-radius: 50%;
box-shadow: 0px 0px 40px 0px rgba(255, 0, 0, 0.45);
text-align: center;
font: bold 10pt "微软雅黑";
text-shadow:2px 2px 2px #000000;
color: rgb(166, 166, 166);
background-color: rgba(255, 0, 0, 0.45);
letter-spacing: .1rem;
transition: 1s;
}
.dangerbutton:hover {
filter: brightness(130%);
box-shadow: 0px 0px 40px 0px red;
background-color: rgba(255, 0, 0, 0.75);
}
\ No newline at end of file
......@@ -78,7 +78,7 @@ CREATE TABLE `acbra2_game` (
`weather` tinyint(3) unsigned NOT NULL DEFAULT '0',
`hack` tinyint(1) unsigned NOT NULL DEFAULT '0',
`combonum` smallint(5) unsigned NOT NULL DEFAULT '0',
`gamevars` int(10) unsigned NOT NULL DEFAULT '0',
`gamevars` text NOT NULL,
`rdown` tinyint(1) unsigned NOT NULL DEFAULT '0',
`bdown` tinyint(1) unsigned NOT NULL DEFAULT '0',
`ldown` tinyint(1) unsigned NOT NULL DEFAULT '0',
......@@ -361,6 +361,7 @@ CREATE TABLE `acbra2_users` (
`achievement` text NOT NULL,
`nick` text NOT NULL,
`nicks` text NOT NULL,
`volume` smallint(3) unsigned NOT NULL default '20',
`validgames` smallint(5) unsigned NOT NULL DEFAULT '0',
`wingames` smallint(5) unsigned NOT NULL DEFAULT '0',
`gender` char(1) NOT NULL DEFAULT '0',
......@@ -385,6 +386,7 @@ CREATE TABLE `acbra2_winners` (
`gid` smallint(5) unsigned NOT NULL DEFAULT '0',
`type` tinyint(3) unsigned NOT NULL DEFAULT '0',
`nick` text NOT NULL,
`skillpoint` smallint unsigned NOT NULL default '0',
`name` char(15) NOT NULL DEFAULT '',
`pass` char(32) NOT NULL DEFAULT '',
`gd` char(1) NOT NULL DEFAULT 'm',
......
......@@ -41,11 +41,24 @@ if($gamestate >= 20){
//$db->query("ALTER TABLE {$tablepre}users ADD validgames smallint unsigned NOT NULL default '0' AFTER credits");
//$db->query("ALTER TABLE {$tablepre}users ADD wingames smallint unsigned NOT NULL default '0' AFTER validgames");
//哇 还是老祖宗留下的方法好啊
//UNCOMMENT THOSE WHEN YELLOWLIFE IS PUSHED TO MOMOBAKO-SERIES
//$db->query("ALTER TABLE {$tablepre}winners ADD nick text not null AFTER type");
//$db->query("ALTER TABLE {$tablepre}winners ADD ss smallint unsigned NOT NULL default '0' AFTER msp");
//$db->query("ALTER TABLE {$tablepre}winners ADD mss smallint unsigned NOT NULL default '0' AFTER ss");
//winner表新增字段
$result = $db->query("DESCRIBE {$tablepre}winners nick");
if(!$db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}winners ADD nick text not null AFTER type");
$result = $db->query("DESCRIBE {$tablepre}winners ss");
if(!$db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}winners ADD ss mediumint unsigned NOT NULL default '0' AFTER msp");
$result = $db->query("DESCRIBE {$tablepre}winners mss");
if(!$db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}winners ADD mss smallint unsigned NOT NULL default '0' AFTER ss");
$result = $db->query("DESCRIBE {$tablepre}winners skillpoint");
if(!$db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}winners ADD skillpoint smallint unsigned NOT NULL default '0' AFTER nick");
//user表新增字段
$result = $db->query("DESCRIBE {$tablepre}users volume");
if(!$db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}users ADD volume smallint(3) unsigned NOT NULL default '20' AFTER nicks");
//game表结构变动
$db->query("ALTER TABLE {$tablepre}game DROP gamevars");
$db->query("ALTER TABLE {$tablepre}game ADD gamevars text NOT NULL AFTER combonum");
include template('admin_menu');
......
......@@ -6,7 +6,7 @@ if(!defined('IN_GAME')) {
function init_playerdata(){
global $lvl,$baseexp,$exp,$gd,$icon,$arbe,$arhe,$arae,$arfe,$weather,$fog,$weps,$arbs,$log,$upexp,$lvlupexp,$iconImg,$iconImgB,$ardef;
global $clbpara;
global $pls,$weather,$pose,$tactic,$clbpara;
$upexp = round(($lvl*$baseexp)+(($lvl+1)*$baseexp));
$lvlupexp = $upexp - $exp;
......@@ -38,8 +38,8 @@ function init_profile(){
global $nospk,$wepsk_words,$arbsk_words,$arhsk_words,$arask_words,$arfsk_words,$artsk_words,$itmsk0_words,$itmsk1_words,$itmsk2_words,$itmsk3_words,$itmsk4_words,$itmsk5_words,$itmsk6_words;
global $wepk_words,$arbk_words,$arhk_words,$arak_words,$arfk_words,$artk_words,$itmk0_words,$itmk1_words,$itmk2_words,$itmk3_words,$itmk4_words,$itmk5_words,$itmk6_words;
global $wep,$arb,$arh,$ara,$arf,$art,$itm0,$itm1,$itm2,$itm3,$itm4,$itm5,$itm6;
global $definfo,$atkinfo,$pdata;
global $clbpara,$weather,$definfo,$atkinfo,$pdata;
include_once GAME_ROOT.'./include/game/revattr.func.php';
$atkinfo = get_base_att($pdata,$pdata,1,1);
$definfo = get_base_def($pdata,$pdata,1,1);
......@@ -185,6 +185,8 @@ function init_profile(){
$newsppre = 5+floor(151*(1-$sp/$msp));
$newspimg = '<img src="img/yellow2.gif" style="position:absolute; clip:rect('.$newsppre.'px,55px,160px,0px);">';
$clbpara = get_clbpara($clbpara);
return;
}
......@@ -477,11 +479,10 @@ function init_rev_battle($ismeet = 0)
function init_bgm($force_update=0)
{
global $volume,$bgmname,$bgmlink,$bgmtype,$gamecfg;
global $pls,$command,$clbpara;
global $pls,$command,$clbpara,$gamecfg;
include config('audio',$gamecfg);
$clbpara = get_clbpara($clbpara);
//$clbpara = get_clbpara($clbpara);
# 初始化
$event_flag = 0;
......@@ -543,7 +544,7 @@ function init_bgm($force_update=0)
$bgmlink = $bgmarr[0]['url'];
$bgmtype = $bgmarr[0]['type'];
#初始化默认音量
$volume = isset($player_volume) ? $player_volume : $default_volume;
$volume = isset($clbpara['volume']) ? $clbpara['volume'] : $default_volume;
$volume_r = round($volume/100,2);
# 生成播放器与播放队列 太野蛮了……嘻嘻……
if(!empty($bgmlink) && !empty($bgmtype))
......
......@@ -20,7 +20,7 @@ function aievent($rate){
//echo "进入AIEVENT";
//TESTCASE: IF GOLDEN MINION SURVIVES: DO NOTHING.
if(!$gamevars['sanmaact']){//$sanmaact = 0表示静流没放出,需要判断小兵状态,$sanmaact = 1表示静流已放出
if(!isset($gamevars['sanmaact']) && !isset($gamevars['sanmadead'])){//$sanmaact = 0表示静流没放出,需要判断小兵状态,$sanmaact = 1表示静流已放出
$checkMinionSurvive = "SELECT * FROM {$tablepre}players WHERE `type` =91 AND `name` = 'AC专业职人'";
$ifMinionSurvive = $db->query($checkMinionSurvive);
$minionHP = $db->fetch_array($ifMinionSurvive);
......@@ -37,7 +37,7 @@ function aievent($rate){
$gamevars['sanmaact'] = 1;
save_gameinfo();
}
}elseif(!$gamevars['sanmadead']){
}elseif(!isset($gamevars['sanmadead'])){
//echo "静流已放出。";
$checkSanma = $db->query("SELECT * FROM {$tablepre}players WHERE type = 15 AND name = '【SANMA_TK】'");
......
<?php
if(!defined('IN_GAME')) {
exit('Access Denied');
}
include_once GAME_ROOT . './include/game/titles.func.php';
include_once GAME_ROOT . './include/system.func.php';
# 子面板 —— 控制模块
$console_tips = Array
(
0 => "<span class='red'>※ 警告:",
1 => "<span class='lime'>※ 反馈:",
2 => "<span class='grey'>※ 维持该效果将占用一条信道</span>",
);
# 天气控制
function console_wthchange($w)
{
global $clbpara,$gamevars,$now,$log,$weather,$wthinfo,$name,$nick,$mode;
global $console_tips;
if(!isset($clbpara['console']))
{
$log.= "输入了无效的指令。<br>";
return;
}
elseif(empty($gamevars['api']))
{
$log.= "{$console_tips[0]}可用信道不足,无法执行指令。</span><br>";
return;
}
elseif(!array_key_exists($w,$wthinfo))
{
$log.= "{$console_tips[0]}输入了非法的天气参数,请检查你提交的指令。</span><br>";
return;
}
else
{
$weather = $w;
$log .= "提交了检索指令后,你眼前的数据流开始闪烁。<br>与此同时,整处虚拟空间也开始发生变化……<br>
{$console_tips[1]}已将天气转变为【{$wthinfo[$weather]}】</span><br>
{$console_tips[2]}<br><br>";
$gamevars['api'] --;
save_gameinfo();
addnews($now, 'csl_wthchange', get_title_desc($nick).' '.$name, $weather);
}
return;
}
# 检索道具、陷阱、NPC
function console_searching($kind,$nm,$ntype)
{
global $db,$tablepre,$clbpara,$gamevars,$typeinfo,$plsinfo,$hpinfo,$log,$mode;
global $console_tips;
$skind = Array(0=>'itm',1=>'trap',2=>'pc');
//过滤输入名称中的非法字符
$nm = preg_replace('/[,\#;\p{Cc}]+|锋利的|电气|毒性|[\r\n]|-改|<|>|\"/u','',$nm);
//过滤输入名称首尾的空格
$nm = preg_replace('/^\s+|\s+$/m','', $nm);
//过滤类别
$kind = (int)$kind; $ntype = (int)$ntype;
if(!isset($clbpara['console']))
{
$log.= "输入了无效的指令。<br>";
return;
}
elseif(empty($gamevars['api']))
{
$log.= "{$console_tips[0]}可用信道不足,无法执行指令。</span><br>";
return;
}
elseif(empty($nm) || ($kind == 2 && !array_key_exists($ntype,$typeinfo)))
{
$log.= "{$console_tips[0]}输入了非法的命名或类别参数,请检查你提交的指令。</span><br>";
return;
}
elseif(!isset($skind[$kind]))
{
$log.= "{$console_tips[0]}输入了非法的检索类别,请检查你提交的指令。</span><br>";
return;
}
if($skind[$kind] == 'pc')
{
$result = $db->query("SELECT * FROM {$tablepre}players WHERE name = '$nm' AND type = '$ntype' AND hp>0 ");
$log.="提交了检索指令后,你眼前的数据流开始闪烁……<br>片刻后,稳定下来的数据流";
if(!$db->num_rows($result))
{
$log.="给出了一个令人失望的结果:<br><br>
{$console_tips[1]}检索对象【{$typeinfo[$ntype]} {$nm}】并不存在于系统中,或是ta已经死了。</span><br><br>";
return;
}
else
{
$spnums = $db->num_rows($result);
$log.="打印出了一组数据:<br><br>
{$console_tips[1]}检索到<span class='clan'>{$spnums}</span>位符合条件的对象,如下所示:</span><br><br>";
}
if($db->num_rows($result) > 1)
{
$sparr = $spdata = Array();
while($spdata = $db->fetch_array($result))
{
$sparr[$spdata['pls']] = isset($sparr[$spdata['pls']]) ? $sparr[$spdata['pls']]+1 : 1;
}
foreach($sparr as $spls => $snums)
{
$log .="·于<span class='yellow'>【{$plsinfo[$spls]}】</span>检索到<span class='yellow'>【{$snums}】</span>名目标对象;<br>";
}
}
else
{
$spdata = $db->fetch_array($result);
$snm = $typeinfo[$spdata['type']].' '.$spdata['name']; $spls = $spdata['pls'];
if($spdata['hp'] < $spdata['mhp']*0.5){$shp = ($spdata['hp'] < $spdata['mhp']*0.2) ? 2 : 1;} else{$shp = 0;}
$log .="·于<span class='yellow'>【{$plsinfo[$spls]}】</span>检索到目标【{$snm}】<br>目标当前状态:【{$hpinfo[$shp]}】<br>";
}
}
elseif($skind[$kind] == 'itm' || $skind[$kind] == 'trap')
{
$tablename = $skind[$kind] == 'itm' ? 'mapitem' : 'maptrap';
$tipdesc = $skind[$kind] == 'itm' ? '被放置在' : '被埋设于';
$result = $db->query("SELECT * FROM {$tablepre}{$tablename} WHERE itm = '$nm'");
$log.="提交了检索指令后,你眼前的数据流开始闪烁……<br>片刻后,稳定下来的数据流";
if(!$db->num_rows($result))
{
$log.="给出了一个令人失望的结果:<br><br>
{$console_tips[1]}检索对象【{$nm}】并不存在于系统中。</span><br><br>";
return;
}
else
{
$inums = $db->num_rows($result);
$log.="打印出了一组数据:<br><br>
{$console_tips[1]}检索到<span class='clan'>【{$inums}】</span>份符合条件的对象,如下所示:</span><br><br>";
}
$sumidata = $idata = Array();
while($idata = $db->fetch_array($result))
{
$sumidata[$idata['pls']] = isset($sumidata[$idata['pls']]) ? $sumidata[$idata['pls']]+1 : 1;
}
foreach($sumidata as $ipls => $inums)
{
$log .="
<span class='yellow'>【{$inums}】</span>份{$nm}{$tipdesc}<span class='yellow'>【{$plsinfo[$ipls]}】</span>;<br>";
}
}
$log .= "<br>{$console_tips[2]}<br><br>";
$gamevars['api'] --;
save_gameinfo();
return;
}
# 禁区控制模块
function console_areacontrol($kind)
{
global $log,$clbpara,$gamevars,$hack,$now,$name,$nick,$areatime,$areawarn;
global $console_tips;
$kind = (int)$kind;
$skind = Array(0=>'hack',1=>'addarea');
if(!isset($clbpara['console']))
{
$log.= "输入了无效的指令。<br>";
return;
}
elseif(!isset($skind[$kind]))
{
$log.= "{$console_tips[0]}提交了无效的禁区控制指令,请检查你提交的指令。</span><br>";
return;
}
elseif(empty($gamevars['api']) && $skind[$kind] !== 'hack')
{
$log.="{$console_tips[0]}可用信道不足,无法执行指令。</span><br>";
return;
}
if($skind[$kind] == 'hack')
{
if(!$hack)
{
$log .= "提交指令后,你眼前的数据流开始闪烁。<br>与此同时,整处虚拟空间也开始发生变化……<br>{$console_tips[1]}已解除全部禁区</span><br>";
$hack = 1;
movehtm();
storyputchat($now,'hack');
addnews($now,'csl_hack',get_title_desc($nick).' '.$name);
save_gameinfo();
}
else
{
$log .= "{$console_tips[0]}当前禁区已被解除,无法重复执行指令。</span><br>";
}
}
elseif($skind[$kind] == 'addarea')
{
if(!$areawarn)
{
$log .= "提交指令后,你眼前的数据流开始闪烁。<br>与此同时,整处虚拟空间也开始发生变化……<br>{$console_tips[1]}已将下回禁区到来时间调整至5秒后</span><br>{$console_tips[2]}<br><br>";
$areatime = $now+5;
addnews($now,'csl_addarea',get_title_desc($nick).' '.$name);
areawarn();
save_gameinfo();
}
else
{
$log .= "{$console_tips[0]}新一回禁区即将到来,目前无法执行添加禁区指令。</span><br>";
}
}
return;
}
# 别按那个按钮!
function console_dbutton()
{
global $log,$clbpara;
if(!isset($clbpara['console']) || isset($clbpara['nobutton']))
{
$log.= "输入了无效的指令。<br>";
return;
}
include_once GAME_ROOT . './include/game/dice.func.php';
$button_dice = diceroll(99);
$log .= "这么大个按钮摆在这!哪会有人能忍住不按呢?<br>你果断出手按下了按钮!<br>……<br>";
if ($button_dice < 75)
{
$log .= "但是好像什么也没有发生……?<br><br>";
}
elseif($button_dice < 95)
{
global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
$log .= "<span class='yellow'>但是因为你按的太过用力,按钮直接从界面上掉了出来!</span><br>等等……这不对吧!?<br><br>";
$itm0 = '奇怪的按钮';$itmk0 = 'Z';
$itme0 = $itms0 = 1;$itmsk0 = '';
$clbpara['nobutton'] = 1;
include_once GAME_ROOT . './include/game/itemmain.func.php';
itemget();
}
else
{
include_once GAME_ROOT . './include/state.func.php';
$log .= '<span class="red">呜哇,按钮爆炸了!</span><br><br>';
death ( 'button', '', 0, 'dangerbutton');
}
return;
}
?>
......@@ -1441,8 +1441,10 @@ function itemuse($itmn) {
$itm = $itmk = $itmsk = '';
$itme = $itms = 0;
} elseif ($itm == '破灭之诗') {
global $hack,$rp;
global $hack,$rp,$clbpara,$gamevars;
$rp = 0;
$clbpara['dialogue'] = 'thiphase';
$clbpara['console'] = 1;
include_once GAME_ROOT . './include/system.func.php';
$log .= '在你唱出那单一的旋律的霎那,<br>整个虚拟世界起了翻天覆地的变化……<br>';
addnpc ( 4, 0,1);
......@@ -1451,8 +1453,8 @@ function itemuse($itmn) {
wthchange( $itm,$itmsk);
addnews ($now , 'thiphase',$nickinfo.' '.$name);
$hack = 1;
$gamevars['apis'] = $gamevars['api'] = 5;
$log .= '因为破灭之歌的作用,全部锁定被打破了!<br>';
//include_once GAME_ROOT.'./include/system.func.php';
movehtm();
addnews($now,'hack2',$nickinfo.' '.$name);
save_gameinfo();
......
......@@ -60,7 +60,7 @@ function poison($itmn = 0) {
return;
}
function wthchange($itm,$itmsk){
function wthchange($itm,$itmsk,$wlog=1){
global $now,$log,$weather, $wthinfo, $name,$nick;
$weathertd = $weather;
if($weather >= 14 && $weather <= 17){
......@@ -103,7 +103,7 @@ function wthchange($itm,$itmsk){
include_once GAME_ROOT . './include/system.func.php';
save_gameinfo ();
addnews ( $now, 'wthchange', get_title_desc($nick).' '.$name, $weather, $itm );
$log .= "你使用了<span class=\"yellow\">{$itm}</span>。<br />天气突然转变成了<span class=\"red\">$wthinfo[$weather]</span>!<br />";
if($wlog) $log .= "你使用了<span class=\"yellow\">{$itm}</span>。<br />天气突然转变成了<span class=\"red\">$wthinfo[$weather]</span>!<br />";
}
}
return;
......
......@@ -453,22 +453,22 @@
//获取pa的攻击力修正
function get_base_att_modifier(&$pa,&$pd,$active,$base_att,$tooltip=0)
{
global $weather,$log,$gamecfg;
include config('combatcfg',$gamecfg);
# 计算天气、姿态、策略、地点对pa攻击力的修正
global $weather,$weather_attack_modifier,$pose_attack_modifier,$tactic_attack_modifier,$pls_attack_modifier,$log;
global $pose_attack_active,$tactic_attack_active;
$base_atk_per = 100;
//天气修正
$wth_atk_per = $weather_attack_modifier[$weather] ?: 0 ;
$wth_atk_per = isset($weather_attack_modifier[$weather]) ? $weather_attack_modifier[$weather] : 0 ;
//地点修正
$pls_atk_per = $pls_attack_modifier[$pa['pls']] ?: 0;
$pls_atk_per = isset($pls_attack_modifier[$pa['pls']]) ? $pls_attack_modifier[$pa['pls']] : 0;
//姿态修正只在先制攻击阶段生效? //pa身上没有反击标记 代表这是一次先制攻击
if(!isset($pa['is_counter']) && $pose_attack_active) $pose_atk_per = $pose_attack_modifier[$pa['pose']] ?: 0 ;
if(!isset($pa['is_counter']) && $pose_attack_active) $pose_atk_per = isset($pose_attack_modifier[$pa['pose']]) ? $pose_attack_modifier[$pa['pose']] : 0 ;
//姿态修正始终生效
elseif(!$pose_attack_active) $pose_atk_per = $pose_attack_modifier[$pa['pose']] ?: 0 ;
elseif(!$pose_attack_active) $pose_atk_per = isset($pose_attack_modifier[$pa['pose']]) ? $pose_attack_modifier[$pa['pose']] : 0 ;
//策略修正只在反击阶段生效? //pa身上没有反击标记 代表这是一次先制攻击
if(!empty($pa['is_counter']) && $tactic_attack_active) $tac_atk_per = $tactic_attack_modifier[$pa['tactic']] ?: 0;
if(!empty($pa['is_counter']) && $tactic_attack_active) $tac_atk_per = isset($tactic_attack_modifier[$pa['tactic']]) ? $tactic_attack_modifier[$pa['tactic']] : 0;
//策略修正始终生效
elseif(!$tactic_attack_active) $tac_atk_per = $tactic_attack_modifier[$pa['tactic']] ?: 0;
elseif(!$tactic_attack_active) $tac_atk_per = isset($tactic_attack_modifier[$pa['tactic']]) ? $tactic_attack_modifier[$pa['tactic']] : 0;
//上述系数修正最低不低于1%
$base_atk_per += $wth_atk_per+$pls_atk_per+$pose_atk_per+$tac_atk_per;
$base_atk_per = $base_atk_per > 0 ? $base_atk_per : 1;
......@@ -554,22 +554,22 @@
//获取pd的防御力修正
function get_base_def_modifier(&$pa,&$pd,$active,$total_def,$tooltip=0)
{
global $weather,$log,$gamecfg;
include config('combatcfg',$gamecfg);
# 计算天气、姿态、策略、地点对pd防御力的修正
global $weather,$weather_defend_modifier,$pose_defend_modifier,$tactic_defend_modifier,$pls_defend_modifier,$log;
global $pose_defend_active,$tactic_defend_active;
$base_def_per = 100;
//天气修正
$wth_def_per = $weather_defend_modifier[$weather] ?: 0 ;
$wth_def_per = isset($weather_defend_modifier[$weather]) ? $weather_defend_modifier[$weather] : 0 ;
//地点修正
$pls_def_per = $pls_defend_modifier[$pd['pls']] ?: 0;
$pls_def_per = isset($pls_defend_modifier[$pd['pls']]) ? $pls_defend_modifier[$pd['pls']] : 0;
//姿态修正只在受到先制攻击时生效? //pa身上没有反击标记 代表这是一次先制攻击
if(!isset($pa['is_counter']) && $pose_defend_active) $pose_def_per = $pose_defend_modifier[$pd['pose']] ?: 0 ;
if(!isset($pa['is_counter']) && $pose_defend_active) $pose_def_per = isset($pose_defend_modifier[$pd['pose']]) ? $pose_defend_modifier[$pd['pose']] : 0 ;
//姿态修正始终生效
elseif(!$pose_defend_active) $pose_def_per = $pose_defend_modifier[$pd['pose']] ?: 0 ;
elseif(!$pose_defend_active) $pose_def_per = isset($pose_defend_modifier[$pd['pose']]) ? $pose_defend_modifier[$pd['pose']] : 0 ;
//策略修正只在反击阶段生效? //pa身上有反击标记 代表这是一次反击攻击
if(!empty($pa['is_counter']) && $tactic_defend_active) $tac_def_per = $tactic_defend_modifier[$pd['tactic']] ?: 0;
if(!empty($pa['is_counter']) && $tactic_defend_active) $tac_def_per = isset($tactic_defend_modifier[$pd['tactic']]) ? $tactic_defend_modifier[$pd['tactic']] : 0;
//策略修正始终生效
elseif(!$tactic_defend_active) $tac_def_per = $tactic_defend_modifier[$pd['tactic']] ?: 0;
elseif(!$tactic_defend_active) $tac_def_per = isset($tactic_defend_modifier[$pd['tactic']]) ? $tactic_defend_modifier[$pd['tactic']] : 0;
//上述各项系数修正最低不低于1%
$base_def_per += $wth_def_per+$pls_def_per+$pose_def_per+$tac_def_per;
$base_def_per = $base_def_per > 0 ? $base_def_per : 1;
......
......@@ -27,7 +27,17 @@
extract($edata,EXTR_PREFIX_ALL,'w'); extract($sdata,EXTR_PREFIX_ALL,'s');
init_rev_battle();
$log .= "你发现了敌人<span class=\"red\">{$w_name}</span>!<br>对方好像完全没有注意到你!<br>";
//检查是敌对或中立单位
if($edata['pose'] == 7)
{
$log.="你发现了<span class=\"lime\">{$w_name}</span>!<br>对方看起来对你没有敌意。<br>";
$neut_flag = 1;
}
else
{
$log.="你发现敌人了<span class=\"red\">{$w_name}</span>!<br>对方好像完全没有注意到你!<br>";
$neut_flag = 0;
}
//初始化玩家攻击方式信息
$w1 = substr($s_wepk,1,1);
......
......@@ -7,7 +7,7 @@ if(!defined('IN_GAME')) {
function move($moveto = 99) {
global $lvl,$log,$pls,$pgroup,$plsinfo,$hplsinfo,$inf,$hp,$mhp,$sp,$def,$club,$arealist,$areanum,$hack,$areainfo,$gamestate,$pose,$weather;
global $gamestate,$gamecfg;
$plsnum = sizeof($plsinfo);
if($pls == $moveto)
......@@ -29,7 +29,7 @@ function move($moveto = 99) {
else
{
//玩家位于标准地点组内
if(($moveto == 'main')||($moveto < 0 )||($moveto >= $plsnum))
if((!array_key_exists($moveto,$plsinfo))||($moveto == 'main')||($moveto < 0 )||($moveto >= $plsnum))
{
$log .= '请选择正确的移动地点。<br>';
return;
......@@ -382,7 +382,7 @@ function search(){
function discover($schmode = 0) {
global $art,$pls,$now,$log,$mode,$command,$cmd,$event_obbs,$weather,$pls,$club,$pose,$tactic,$inf,$item_obbs,$enemy_obbs,$trap_min_obbs,$trap_max_obbs,$bid,$db,$tablepre,$gamestate,$corpseprotect,$action,$skills,$rp,$aidata;
global $clbpara;
global $clbpara,$gamecfg;
$event_dice = rand(0,99);
if(($event_dice < $event_obbs)||(($art!="Untainted Glory")&&($pls==34)&&($gamestate != 50))){
//echo "进入事件判定<br>";
......@@ -583,6 +583,7 @@ function discover($schmode = 0) {
else
{
//直接略过决斗者
global $artk;
if ((!$edata['type'])&&($artk=='XX')&&(($edata['artk']!='XX')||($edata['art']!=$name))&&($gamestate<50)) continue;
if (($artk!='XX')&&($edata['artk']=='XX')&&($gamestate<50)) continue;
//计算活人发现率
......@@ -610,7 +611,7 @@ function discover($schmode = 0) {
return;
}
//发现中立NPC或友军 TODO:把这里条件判断挪到一个函数里
elseif($edata['clbpara']['post'] == $pid)
elseif(isset($edata['clbpara']['post']) && $edata['clbpara']['post'] == $pid)
{
$bid = $edata['pid'];
$action = 'neut'.$edata['pid'];
......
......@@ -281,6 +281,14 @@ function showData(sdata){
{
window.location.reload();
}
if($('nowbgm'))
{
getBgmVolume();
}
if($('dialogue'))
{
$('dialogue').showModal();
}
}
var refchat = null;
......@@ -396,4 +404,19 @@ function changeBGM(mode=1){
$('gamebgm').play();
}
function getBgmVolume(){
var nowid = $('nowbgm').innerHTML;
var bname = 'bnm' + nowid;
$('bgmname').innerHTML = $(bname).innerHTML;
$('volume_num').innerHTML = $('gamebgm').volume*100 + '%';
}
function changePages(nowpage,nextpage)
{
var np = 'd'+nowpage;
var pp = 'd'+nextpage;
$(np).style.display="none";
$(pp).style.display="block";
}
//1
......@@ -296,7 +296,8 @@ function load_gameinfo() {
$weather = $gameinfo['weather'];
$hack = $gameinfo['hack'];
$gamevars = $gameinfo['gamevars'];
$gamevars = Array('sanmaact' => $gamevars & 1, 'sanmadead' => $gamevars & 2);
$gamevars = json_decode($gamevars,true);
if(isset($gamevars['sanmaact']) && isset($gamevars['sanmadead'])) unset($gamevars['sanmaact']);
$combonum = $gameinfo['combonum'];
return;
}
......@@ -326,8 +327,8 @@ function save_gameinfo() {
$gameinfo['afktime'] = $afktime;
$gameinfo['optime'] = $optime;
$gameinfo['weather'] = $weather;
$gamevars0 = ($gamevars['sanmaact'] ? 1 : 0) + ($gamevars['sanmadead'] ? 2 : 0);
$gameinfo['gamevars'] = $gamevars0;
//$gamevars0 = ($gamevars['sanmaact'] ? 1 : 0) + ($gamevars['sanmadead'] ? 2 : 0);
$gameinfo['gamevars'] = json_encode($gamevars);
$gameinfo['hack'] = $hack;
$gameinfo['combonum'] = $combonum;
$db->array_update("{$tablepre}game",$gameinfo,1);
......
......@@ -308,7 +308,13 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
} elseif($news == 'loot_depot') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"grey\">{$a}{$b}生前存放在安全箱里的东西转移到了自己的名下。哇……真是世风日下,道德沦丧啊!</span><br>\n";
} elseif($news == 'cdestroy') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"red b\">{$a}{$b}的尸体销毁了</span><br>\n";
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"red\">{$a}{$b}的尸体销毁了</span><br>\n";
} elseif($news == 'csl_wthchange') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"orange\">{$a}发送了控制指令,战场的天气变成了{$wthinfo[$b]}!</span><br>\n";
} elseif($news == 'csl_hack') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"orange\">{$a}发送了控制指令,全部禁区解除!</span><br>\n";
} elseif($news == 'csl_addarea') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"orange\">{$a}发送了控制指令,下一回禁区提前到来了!</span><br>\n";
} else {
$newsinfo .= "<li>$time,$news,$a,$b,$c,$d<br>\n";
}
......
......@@ -257,6 +257,7 @@ function kill($death, $dname, $dtype = 0, $dpid = 0, $annex = '', &$revival_flag
{
if($dtype == 15){//静流AI
global $gamevars;
unset($gamevars['act']);
$gamevars['sanmadead'] = 1;
save_gameinfo();
}
......
......@@ -41,7 +41,7 @@ function rs_game($mode = 0) {
//重设连斗判断死亡数
$combonum = $deathlimit;
//重设游戏剧情开关
$gamevars = 0;
$gamevars = Array();
save_gameinfo();
......@@ -301,7 +301,7 @@ function rs_sttime() {
function add_once_area($atime) {
//实际上GAMEOVER的判断是在common.inc.php里
global $db,$tablepre,$now,$gamestate,$areaesc,$arealist,$areanum,$arealimit,$areaadd,$plsinfo,$weather,$hack,$validnum,$alivenum,$deathnum;
global $deepzones,$sentinel_typelist,$npc_away_from_deepzones;
global $gamevars,$deepzones,$sentinel_typelist,$npc_away_from_deepzones;
if (($gamestate > 10)&&($now > $atime)) {
$plsnum = sizeof($plsinfo) - 1;
......@@ -337,10 +337,11 @@ function add_once_area($atime) {
} else {
$weather = rand(0,9);
if($hack > 0){$hack--;}
//重置控制面板可用次数
if(isset($gamevars['apis']) && isset($gamevars['api'])) $gamevars['api'] = $gamevars['apis'];
$areaaddlist = array_slice($arealist,$areanum+1,$areaadd);
$areanum += $areaadd;
movehtm();
//addnews($atime,'addarea',$areaaddlist,$weather);
addnews($atime, 'addarea',$areaaddlist,$weather);
storyputchat($now,'areaadd');
systemputchat($atime,'areaadd',$areaaddlist);
......
......@@ -2,8 +2,24 @@
向对手大喊:<br><input size="30" type="text" name="message" maxlength="60"><br><br>
<input type="hidden" name="mode" value="revcombat">
<input type="hidden" id="command" name="command" value="back">
<input type="button" class="cmdbutton" style="width:100" name="w1" value="{$attinfo[$w1]}" onclick="$('command').value='$w1';postCmd('gamecmd','command.php');this.disabled=true;"><br>
<!--{if $w2}-->
<input type="button" class="cmdbutton" style="width:100" name="w2" value="{$attinfo[$w2]}" onclick="$('command').value='$w2';postCmd('gamecmd','command.php');this.disabled=true;"><br>
<!--{if $neut_flag}-->
<div id="neut">
<input type="button" class="cmdbutton" style="width:100" name="w1" value="{$attinfo[$w1]}" onclick="showModalDialog($('attack_warning'));this.disabled=true;"><br>
</div>
<!--{else}-->
<div id="enemy">
<input type="button" class="cmdbutton" style="width:100" name="w1" value="{$attinfo[$w1]}" onclick="$('command').value='$w1';postCmd('gamecmd','command.php');this.disabled=true;"><br>
<!--{if $w2}-->
<input type="button" class="cmdbutton" style="width:100" name="w2" value="{$attinfo[$w2]}" onclick="$('command').value='$w2';postCmd('gamecmd','command.php');this.disabled=true;"><br>
<!--{/if}-->
</div>
<!--{/if}-->
<br><input type="button" class="cmdbutton" name="back" value="逃跑" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<br><input type="button" class="cmdbutton" name="back" value="逃跑" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
<dialog id="attack_warning" style="max-width: 50%;max-height: 50%;">
<center>
<span class="red">警告:对方可能会被你激怒!真的要攻击吗?</span><br><br>
<input type="button" class="cmdbutton" style="width:100" name="w1" value="先下手为强!" onclick="$('command').value='$w1';postCmd('gamecmd','command.php');this.disabled=true;"><br>
</center>
<img class="dialog-background" src="img/profile.gif" onclick="closeDialog($('attack_warning'));postCmd('gamecmd','command.php');this.disabled=true;">
</dialog>
......@@ -82,4 +82,15 @@
<input type="button" class="cmdbutton" id="sp_pbomb" name="sp_pbomb" value="X 按钮" onclick="$('command').value='special';$('subcmd').name='sp_cmd';$('subcmd').value='sp_pbomb';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{/if}-->
<br />
<input type="button" class="cmdbutton" id="sp_terminal" name="sp_terminal" value="子面板" onclick="showModalDialog($('terminal'));postCmd('gamecmd','command.php');this.disabled=true;">
<!-- 对话框 -->
<!--{if isset($dialogue_id)}-->
{template dialogue}
<!--{/if}-->
<!-- 子面板 -->
<input type="button" class="cmdbutton" id="sp_terminal" name="sp_terminal" value="子面板" onclick="showModalDialog($('terminal'));">
{template sp_terminal}
<!--{if isset($gamevars['apis'])}-->
{template sp_console_search}
<!--{/if}-->
\ No newline at end of file
<dialog id="dialogue" style="width: 460px; max-width: 90%;max-height: 80%;">
<p><center>
<!--{eval $maxdkey = count($dialogues[$dialogue_id]);}-->
<!-- 对白分段显示 -->
<!--{loop $dialogues[$dialogue_id] $dkey $dinfo}-->
<div id="d{$dkey}" <!--{if $dkey == 0}--> style="" <!--{else}--> style="display: none;" <!--{/if}-->>
<table class="map" border="1" style="text-align: center;"><tr>
<!-- 带头像对白 -->
<!--{if isset($dialogue_icon[$dialogue_id][$dkey])}-->
<td>
<img style="width:140px;height:80px;" src="$dialogue_icon[$dialogue_id][$dkey]">
</td>
<td style="border: 1px; width:280px;height:80px;text-align: left; padding: 3% 6%;">
$dinfo
</td>
<!-- 无头像对白 -->
<!--{else}-->
<td class="" style="width:320px;height:80px;text-align: center; padding: 3% 6%;">
$dinfo
</td>
<!--{/if}-->
</tr></table>
<br>
<!--{if $dkey > 0}-->
<input type="button" class="cmdbutton" style="margin-right: 5%;" value="上一页" onclick="changePages($dkey,$dkey-1);">
<!--{/if}-->
<!--{if (($dkey < ($maxdkey-1)) || (isset($dialogue_branch[$dialogue_id])))}-->
<input type="button" class="cmdbutton" value="下一页" onclick="changePages($dkey,$dkey+1);">
<!--{elseif isset($dialogue_end[$dialogue_id])}-->
$dialogue_end[$dialogue_id]
<!--{/if}-->
</div>
<!--{/loop}-->
<!-- 选择肢显示 -->
<!--{if isset($dialogue_branch[$dialogue_id])}-->
<div id="d{$maxdkey}" style="display: none;">
<table border="0" style="text-align: center;"><tr><td style="width:280px;height:80px; text-align: center; padding: 3% 6%;">
<!--{loop $dialogue_branch[$dialogue_id] $bkey $binfo}-->
$binfo
<!--{/loop}-->
</td></tr></table>
</div>
<!--{/if}-->
</center></p>
<!--{if (isset($dialogue_branch[$dialogue_id]) || isset($dialogue_end[$dialogue_id]))}-->
<img class="dialog-background" src="img/profile.gif" onclick="">
<!--{else}-->
<img class="dialog-background" src="img/profile.gif" onclick="closeDialog($('dialogue'));$('command').value='end_dialogue';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{/if}-->
</dialog>
<script>
$('dialogue').showModal();
</script>
\ No newline at end of file
......@@ -4,9 +4,6 @@
<!--{eval $bgm = init_bgm(1)}-->
$bgm
</div>
<div id="hoverinfo">
{template sp_terminal}
</div>
<table border="0" cellspacing="10" cellpadding="0" align="center">
<tr valign=top>
......
......@@ -126,10 +126,8 @@
<td class="b3">
<span>
<select id="pose" name="pose" onchange="$('mode').value='special';$('command').value=$('pose').value;postCmd('gamecmd','command.php');return false;" <!--{if CURSCRIPT != 'game' || $mode != 'command'}-->disabled<!--{/if}-->>
<!--{loop $poseinfo $key $value}-->
<!--{if ($value)&&($value!='强袭姿态')}-->
<option value="pose$key"<!--{if $pose == $key}-->selected<!--{/if}-->>$value
<!--{/if}-->
<!--{loop $apose $key}-->
<option value="pose$key"<!--{if $pose == $key}-->selected<!--{/if}-->>$poseinfo[$key]
<!--{/loop}-->
</select>
</span>
......@@ -144,10 +142,8 @@
<td class="b3">
<span>
<select id="tactic" name="tactic" onchange="$('mode').value='special';$('command').value=$('tactic').value;postCmd('gamecmd','command.php');return false;" <!--{if CURSCRIPT != 'game' || $mode != 'command'}-->disabled<!--{/if}-->>
<!--{loop $tacinfo $key $value}-->
<!--{if $value}-->
<option value="tac$key"<!--{if $tactic == $key}-->selected<!--{/if}-->>$value
<!--{/if}-->
<!--{loop $atac $key}-->
<option value="tac$key"<!--{if $tactic == $key}-->selected<!--{/if}-->>$tacinfo[$key]
<!--{/loop}-->
</select>
</span>
......
<dialog id="consle_search" style="max-width: 90%;max-height: 80%;">
<center>
<span class="grey">提交指令后,你眼前的数据流开始闪烁……<br>
片刻后,你的战术界面上显现出了几行额外的选项。<br>
你打算怎么做呢?</span><br><br>
<input type="radio" name="csc" id="csearch2" value="csearch2" checked><a onclick="sl('csearch2'); $('cstype').style.display='';">【查找角色/NPC位置】</a><br>
<input type="radio" name="csc" id="csearch0" value="csearch0"><a onclick="sl('csearch0'); $('cstype').style.display='none';">【查找物品数量及位置】</a><br>
<input type="radio" name="csc" id="csearch1" value="csearch1"><a onclick="sl('csearch1'); $('cstype').style.display='none';">【查找陷阱数量及位置】</a><br>
<br><span class="grey">※ 请在此输入查找的道具/陷阱/人物/NPC的完整名称<br>
(不支持关键字搜索)</span><br>
<select id="cstype" name="cstype" style="display;">
<!--{loop $typeinfo $nt $ntnm}-->
<!--{if !empty($ntnm)}--><option value="$nt">$ntnm<!--{/if}-->
<!--{/loop}-->
</select>
<input size="20" type="text" name="csnm" list="vsnamelist" maxlength="20"><br>
<!--{eval include_once config('itmlist',$gamecfg);}-->
<datalist id="vsnamelist">
<!--{loop $item_namelist $in}-->
<option value="$in"></option>
<!--{/loop}-->
</datalist>
<br><br>
<input type="button" class="cmdbutton" name="submit" value="开始检索" onclick="$('command').value='consle_search';postCmd('gamecmd','command.php');this.disabled=true;">
</center>
<img class="dialog-background" src="img/profile.gif" onclick="closeDialog($('consle_search'))">
</dialog>
\ No newline at end of file
......@@ -2,10 +2,8 @@
<input type="hidden" name="mode" value="special">
<input type="radio" name="command" id="menu" value="menu" checked><a onclick=sl('menu'); href="javascript:void(0);" >返回</a><br><br>
<!--{loop $poseinfo $key $value}-->
<!--{if $value}-->
<input type="radio" name="command" id="pose$key" value="pose$key"><a onclick=sl('pose$key'); href="javascript:void(0);" >$value </a><br>
<!--{/if}-->
<!--{loop $apose $key}-->
<input type="radio" name="command" id="pose$key" value="pose$key"><a onclick=sl('pose$key'); href="javascript:void(0);" >$poseinfo[$key]</a><br>
<!--{/loop}-->
......
......@@ -2,10 +2,8 @@
<input type="hidden" name="mode" value="special">
<input type="radio" name="command" id="menu" value="menu" checked><a onclick=sl('menu'); href="javascript:void(0);" >返回</a><br><br>
<!--{loop $tacinfo $key $value}-->
<!--{if $value}-->
<input type="radio" name="command" id="tac$key" value="tac$key"><a onclick=sl('tac$key'); href="javascript:void(0);" >$value </a><br>
<!--{/if}-->
<!--{loop $atac $key}-->
<input type="radio" name="command" id="tac$key" value="tac$key"><a onclick=sl('tac$key'); href="javascript:void(0);" >$tacinfo[$key]</a><br>
<!--{/loop}-->
......
<dialog id="terminal" style="max-width: 90%;max-height: 80%;">
<div><span class="grey">正在播放:~ <span id="bgmname">$bgmname</span></span></div>
<center>
<div><span class="grey">正在播放:~ <span id="bgmname"></span></span></div>
<!-- 战场地图 -->
<!--{eval $mapdata = init_mapdata();}-->
$mapdata
<!--站场地图:单格width:42;height:36;-->
<!-- 控制菜单 -->
<table border="1" cellspacing="0" cellpadding="0" width="120px" height="24px" style="padding-left: 10px; padding-right: 5px; padding-bottom: 5px;float:right;position:relative;">
<!-- 音乐控制指令 -->
<tr align="center">
<TD colspan="2" width="84" height="24" class=b1 align=center>播放控制</TD>
<TD colspan="2" width="84" height="24" class="b1" align=center>播放控制</TD>
</tr>
<tr width="84" height="36" class="map">
<td td colspan="2">
......@@ -16,27 +18,80 @@
<span class="eicon" onclick="changeBGM();">⏭️</span>
</td>
</tr>
<tr width="84" height="12" style="border: none;"></tr>
<!-- <tr width="84" height="12" style="border: none;"></tr> -->
<tr>
<TD colspan="2" width="84" height="24" class=b1 align=center>音量调节</TD>
</tr>
<tr width="84" height="36" class="map">
<td colspan="2">
<span class="eicon" onmousedown="downVolume();showVolume();"></span>
<span id="volume_num">{$volume}%</span>
<span id="volume_num">{$clbpara['volume']}%</span>
<span class="eicon" onmousedown="upVolume();showVolume();"></span>
</td>
</tr>
<tr width="84" height="12" style="border: none;"></tr>
<!--<tr class="map">
<td height="200" rowspan="11">
<!-- 战场控制指令 -->
<!--{if isset($clbpara['console'])}-->
<tr>
<TD colspan="2" width="84" height="24" class=b1 align=center>可用信道</TD>
</tr>
<tr width="84" height="28" class="map">
<td colspan="2">
<span class="<!--{if $gamevars['api'] == 0}-->red<!--{else}-->lime<!--{/if}-->">$gamevars['api']/$gamevars['apis']</span>
</td>
</tr>
<tr>
<TD colspan="2" width="84" height="24" class=b1 align=center>天气控制</TD>
</tr>
<tr width="84" height="30" class="map">
<td colspan="2">
<select id="cwth" name="cwth" style="width:72px" onchange="closeDialog($('terminal'));$('mode').value='command';$('command').value='consle_wthchange';postCmd('gamecmd','command.php');">
<!--{loop $wthinfo $n $wth}-->
<option value="$n"<!--{if $weather == $n}--> selected<!--{/if}-->> {$wth} </option>
<!--{/loop}-->
</select>
</td>
</tr>
<tr>
<TD colspan="2" width="84" height="24" class=b1 align=center>数据控制</TD>
</tr>
<tr width="84" height="36" class="map">
<td width="42">
<input type="button" value="数据检索" onclick="closeDialog($('terminal'));showModalDialog($('consle_search'));">
</td>
<td width="42">
<input type="button" value="生命探测" onclick="closeDialog($('terminal'));$('command').value='consle_radar';postCmd('gamecmd','command.php');this.disabled=true;">
</td>
</tr>
<tr>
<TD colspan="2" width="84" height="24" class=b1 align=center>禁区控制</TD>
</tr>
<tr width="84" height="36" class="map">
<td width="42">
<input type="button" value="增设禁区" onclick="closeDialog($('terminal'));$('command').value='consle_areactrl1';postCmd('gamecmd','command.php');this.disabled=true;">
</td>
<td width="42">
<input type="button" value="解除禁区" onclick="closeDialog($('terminal'));$('command').value='consle_areactrl0';postCmd('gamecmd','command.php');this.disabled=true;">
</td>
<td height="200" rowspan="11">
<input type="range" class="range" min="0" max="100" value="100" style="position: absolute;left: -6%;top: 76%; width:180px;transform: rotate(-90deg);">
</tr>
<tr width="84" height="84" class="map">
<td colspan="2">
<!--{if !isset($clbpara['nobutton'])}-->
<div class="dangerbutton" onclick="closeDialog($('terminal'));$('command').value='consle_dbutton';postCmd('gamecmd','command.php');this.disabled=true;">DON'T PUSH<br>危险勿触</div>
<!--{else}-->
<div class="lockmap"><img src="img/lock.png" ></div>
<!--{/if}-->
</td>
</tr> -->
</tr>
<!--{else}-->
<tr width="84" height="318" rowspan="7" class="lockmap">
<TD colspan="2" width="72" height="300" align=center class="blurtext"></TD>
</tr>
<!--{/if}-->
</table>
</center>
<script>
getBgmVolume();
</script>
<img class="dialog-background" src="img/profile.gif" onclick="closeDialog($('terminal'))">
</dialog>
......@@ -51,11 +51,13 @@ $language = array
'killmsg' => '杀人宣言',
'lastword' => '遗言',
'usertitle' => '头衔',
'bgmvolume' => '背景音量',
'username_comment' => '最长15个英文字符或者汉字,不能出现半角符号',
'password_comment' => '最长24个字符,留空为不修改',
'motto_comment' => '写下彰显个性的台词,30个字以内。',
'killmsg_comment' => '写下你杀死对手的留言,30个字以内',
'lastword_comment' => '写下你不幸被害时的台词,30个字以内',
'bgmvolume_comment' => '设置游戏内背景音乐的默认音量,下局游戏生效',
'credits' => '战斗力',
'credits2' => '切糕',
'lastgame' => '最后游戏',
......
......@@ -42,4 +42,8 @@
</select>
</td>
</tr>
<tr>
<td>{lang bgmvolume}</td>
<td><input style="width: 45px;" size="2" type="number" name="volume" min="0" max="100" value="{$volume}">% {lang bgmvolume_comment}</td>
</tr>
</table>
\ No newline at end of file
......@@ -73,7 +73,8 @@ if($mode == 'edit') {
}
}
if ($icon>$iconlimit) $icon=0;
$db->query("UPDATE {$tablepre}users SET gender='$gender', icon='$icon',{$passqry}motto='$motto', killmsg='$killmsg', lastword='$lastword', credits='$credits', credits2='$credits2' ,nick='$nick' WHERE username='$cuser'");
$volume = round(min(100,max(0,$volume)));
$db->query("UPDATE {$tablepre}users SET gender='$gender', icon='$icon',{$passqry}motto='$motto', killmsg='$killmsg', lastword='$lastword', credits='$credits', credits2='$credits2' ,nick='$nick', volume='$volume' WHERE username='$cuser'");
if($db->affected_rows()){
$gamedata['innerHTML']['info'] .= $_INFO['data_success'];
}else{
......
......@@ -202,6 +202,7 @@ if($mode == 'enter') {
include_once config('audio',$gamecfg);
$clbpara['valid_bgmbook'] = $regular_bgm;
$clbpara['bgmbook'] = $clbpara['valid_bgmbook'];
$clbpara['volume'] = isset($udata['volume']) ? $udata['volume'] : 20;
//$nick=$udata['nick'];
$nicks=$udata['nicks'];
if (($nicks=='')||($nick=='')){
......
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