Commit 20fcfc0f authored by hisuinohoshi's avatar hisuinohoshi

rev combat phase 1

add&update&change{...};

新增 战斗系统革新 阶段1:
在保留原战斗系统的基础上,新增以下文件:
revbattle.func.php(接敌相关);
revcombat.func.php(战斗流程相关);
revarrt.func.php(伤害计算相关);
玩家先制发现敌人调用findenemy_rev($edata);
玩家被动遇敌调用rev_combat_prepare($edata,NULL,0);
指定2个任意单位战斗调用rev_combat_prepare($sdata,$edata,1);

修改:
全系&属性防御非受贯穿影响失效的情况下,可触发单系防御;
触发复活不会再让灵魂绑定装备消失;
主界面、战斗界面背景的判定逻辑;

phase 2 土豆:
补完战斗函数说明文档、补完NPC战斗中特判效果、补完属性伤害系数与固定变化阶段、补完复活阶段、增加属性克制与传染效果、增加双系武器自动切换判定、增加玩家用副武器槽。
parent a62529c6
...@@ -405,23 +405,48 @@ if($hp > 0){ ...@@ -405,23 +405,48 @@ if($hp > 0){
} elseif($mode == 'combat') { } elseif($mode == 'combat') {
include_once GAME_ROOT.'./include/game/combat.func.php'; include_once GAME_ROOT.'./include/game/combat.func.php';
combat(1,$command); combat(1,$command);
include_once GAME_ROOT.'./include/game/revcombat.func.php';
combat(1,$command);
} elseif($mode == 'revcombat'){ } elseif($mode == 'revcombat'){
//NPC vs NPC: global $action;
if($command == 'enter' && (strpos($action,'corpse')===0 || strpos($action,'pacorpse')===0)) if(strpos($action,'enemy')===0)
{ {
$cid = strpos($action,'corpse')===0 ? str_replace('corpse','',$action) : str_replace('pacorpse','',$action); $enemyid = str_replace('enemy','',$action);
if($cid) }
{ if(!$enemyid || (strpos($action,'enemy')===false))
global $db,$tablepre; {
$result = $db->query("SELECT * FROM {$tablepre}players WHERE pid='$cid' AND hp=0"); $log .= "<span class=\"yellow b\">你没有遇到敌人,或已经离开战场!</span>{$enemyid}<br>";
if($db->num_rows($result)>0) goto back_flag;
{ }
$edata = $db->fetch_array($result); $result = $db->query ( "SELECT * FROM {$tablepre}players WHERE pid='$enemyid'" );
extract($edata,EXTR_PREFIX_ALL,'w'); if (! $db->num_rows ( $result )) {
include_once GAME_ROOT.'./include/game/battle.func.php'; $log .= "对方不存在!<br>";
findcorpse($edata); goto back_flag;
} }
}
$edata = $db->fetch_array($result);
if ($edata ['pls'] != $pls)
{
$log .= "<span class=\"yellow b\">" . $edata ['name'] . "</span>已经离开了<span class=\"yellow b\">$plsinfo[$pls]</span>。<br>";
}
elseif ($edata ['hp'] <= 0)
{
$log .= "<span class=\"red b\">" . $edata ['name'] . "</span>已经死亡,不能被攻击。<br>";
include_once GAME_ROOT . './include/game/battle.func.php';
$action = 'corpse'.$edata['pid'];
findcorpse($edata);
}
elseif ($command == 'back')
{
$log .= "你逃跑了。";
$action = '';
back_flag:
$mode = 'command';
}
else
{
include_once GAME_ROOT . './include/game/revcombat.func.php';
rev_combat_prepare($pdata,$edata,1,$command);
} }
} elseif($mode == 'rest') { } elseif($mode == 'rest') {
include_once GAME_ROOT.'./include/state.func.php'; include_once GAME_ROOT.'./include/state.func.php';
......
...@@ -17,18 +17,55 @@ $dmg_fluc = Array('N' => 15, 'P' => 15, 'K' => 40, 'G' => 20, 'C' => 5, 'D' => 2 ...@@ -17,18 +17,55 @@ $dmg_fluc = Array('N' => 15, 'P' => 15, 'K' => 40, 'G' => 20, 'C' => 5, 'D' => 2
//熟练度对伤害的影响,每点熟练度增加的伤害 //熟练度对伤害的影响,每点熟练度增加的伤害
$skill_dmg = Array('N' => 0.6, 'P' => 0.6, 'K' => 0.65, 'G' => 0.6, 'C' => 0.4, 'D' => 0.75, 'F'=> 0.4, 'J'=>0.7); $skill_dmg = Array('N' => 0.6, 'P' => 0.6, 'K' => 0.65, 'G' => 0.6, 'C' => 0.4, 'D' => 0.75, 'F'=> 0.4, 'J'=>0.7);
//$skill_dmg = Array('N' => 0.5, 'P' => 0.5, 'K' => 0.5, 'G' => 0.6, 'C' => 0.3, 'D' => 0.4, 'F'=> 1.2); //$skill_dmg = Array('N' => 0.5, 'P' => 0.5, 'K' => 0.5, 'G' => 0.6, 'C' => 0.3, 'D' => 0.4, 'F'=> 1.2);
//各攻击方式对应的防御属性
$def_kind = Array(
'P' => 'P',
'K' => 'K',
'G' => 'G', 'J' => 'G',
'C' => 'C',
'D' => 'D',
'F' => 'F',
);
//天气对攻击力的影响(单位:百分比加算)
$weather_attack_modifier = Array(10,10,0,-5,-10,-20,-15,0,0,7,20,-7,-20,-5,-10,-10,-10,10);
//天气对防御力的影响(单位:百分比加算)
$weather_defend_modifier = Array(10,30,0,0,-3,-15,-10,0,-20,-30,-50,-5,-20,-3,-20,5,-30,30);
//姿态对攻击力的影响(单位:百分比加算)
$pose_attack_modifier = Array(0,100,0,-25,25,-50,50);
//姿态对防御力的影响(单位:百分比加算)
$pose_defend_modifier = Array(0,25,0,-25,-50,-50,-466);
//应战策略对攻击力的加成(单位:百分比加算)
$tactic_attack_modifier = Array(0,20,-25,25,-50);
//应战策略对防御力的加成(单位:百分比加算)
$tactic_defend_modifier = Array(0,-20,50,-25,0);
//场景对攻击力的加成(单位:百分比加算)
$pls_attack_modifier = Array(0,0,0,0,0,0,10,0,0,-10,0,0,0,0,-10,0,0,0,10,0,0,0);
//场景对防御力的加成(单位:百分比加算)
$pls_defend_modifier = Array(0,-10,10,0,0,0,0,0,0,0,0,-10,10,0,0,0,0,0,0,0,10,0);
//各种攻击方式可能导致受伤的部位 //各种攻击方式可能导致受伤的部位
$infatt = Array('N' => 'bhaf', 'P' => 'bhaf', 'K' =>'bhaf', 'G' =>'bhaf', 'C'=> 'bhaf', 'D' => 'bhaf', 'F'=> 'bhaf', 'J'=> 'bhaf'); $infatt = Array('N' => 'bhaf', 'P' => 'bhaf', 'K' =>'bhaf', 'G' =>'bhaf', 'C'=> 'bhaf', 'D' => 'bhaf', 'F'=> 'bhaf', 'J'=> 'bhaf');
//各种攻击方式可能导致受伤的部位
$infatt_rev = Array('N' => Array('b','h','a','f'), 'P' => Array('b','h','a','f'), 'K' => Array('b','h','a','f'), 'G' => Array('b','h','a','f'), 'C'=> Array('b','h','a','f'), 'D' => Array('b','h','a','f'), 'F'=> Array('b','h','a','f'), 'J'=> Array('b','h','a','f'),);
//各种攻击方式的致伤率 //各种攻击方式的致伤率
$infobbs = Array('N' => 5, 'P' => 15, 'K' => 55, 'G' => 20, 'C' => 10, 'D' => 45, 'F' => 30, 'J'=> 100); $infobbs = Array('N' => 5, 'P' => 15, 'K' => 55, 'G' => 20, 'C' => 10, 'D' => 45, 'F' => 30, 'J'=> 100);
//$infobbs = Array('N' => 5, 'P' => 15, 'K' => 30, 'G' => 30, 'C' => 15, 'D' => 40, 'F' => 30); //$infobbs = Array('N' => 5, 'P' => 15, 'K' => 30, 'G' => 30, 'C' => 15, 'D' => 40, 'F' => 30);
//各种攻击方式的武器损伤概率 //各种攻击方式的武器损伤概率
$wepimprate = Array('N' => -1, 'P' => 12, 'K' => 30, 'G' => -1, 'C' => -1, 'D' => -1, 'F' => -1, 'J'=> -1); $wepimprate = Array('N' => -1, 'P' => 12, 'K' => 30, 'G' => -1, 'C' => -1, 'D' => -1, 'F' => -1, 'J'=> -1);
//特殊效果发生的概率,这里指属性,跟武器系别无关 //特殊效果发生的概率,这里指属性,跟武器系别无关
$specialrate = Array('N' => 40, 'n' => 30, 'B' => 95 ,'b' => 95); $specialrate = Array('N' => 40, 'n' => 30, 'y' => 30, 'B' => 95 ,'b' => 95);
//属性攻击登录 //属性攻击登录
$ex_attack = Array('p', 'u', 'i', 'd', 'e','w','f','k'); $ex_attack = Array('p', 'u', 'i', 'd', 'e','w','f','k');
//各属性攻击对应的防御属性
$ex_def_kind = Array(
'p' => 'q',
'u' => 'U', 'f' => 'U',
'i' => 'I', 'k' => 'I',
'e' => 'E',
'w' => 'W',
'd' => 'D',
);
//各种属性攻击的得意武器( 伤害2倍) //各种属性攻击的得意武器( 伤害2倍)
$ex_good_wep = Array('p' => 'K','u' => 'G','i'=> 'C','d' => 'D', 'e' => 'P', 'w' => 'D'); $ex_good_wep = Array('p' => 'K','u' => 'G','i'=> 'C','d' => 'D', 'e' => 'P', 'w' => 'D');
//各种属性攻击的得意社团(致伤命中率+20) //各种属性攻击的得意社团(致伤命中率+20)
......
...@@ -50,7 +50,7 @@ $clubinfo = Array( ...@@ -50,7 +50,7 @@ $clubinfo = Array(
98=>'换装迷宫', 98=>'换装迷宫',
99=>'决死结界' 99=>'决死结界'
); );
$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>'); $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' => '女生'); $sexinfo = Array(0=> '未定', 'm' => '男生', 'f' => '女生');
$raceinfo = Array(0=> '人类', 1=> '兽人', 2=> '妖精', 3=> '龙', 4=> '鱼人', 5=> 'AI'); $raceinfo = Array(0=> '人类', 1=> '兽人', 2=> '妖精', 3=> '龙', 4=> '鱼人', 5=> 'AI');
$hpinfo = Array('并无大碍','伤痕累累','生命危险','已经死亡'); $hpinfo = Array('并无大碍','伤痕累累','生命危险','已经死亡');
...@@ -1144,6 +1144,7 @@ $itemspkinfo_tooltip = Array ...@@ -1144,6 +1144,7 @@ $itemspkinfo_tooltip = Array
'w' => Array('title' => "攻击对手时,将产生额外的音波属性伤害。也有可能让对手陷入混乱异常状态。",), 'w' => Array('title' => "攻击对手时,将产生额外的音波属性伤害。也有可能让对手陷入混乱异常状态。",),
'X' => Array('title' => "可能会一击必杀。",), 'X' => Array('title' => "可能会一击必杀。",),
'x' => Array('title' => "人类,可以挑战神么?",), 'x' => Array('title' => "人类,可以挑战神么?",),
'y' => Array('title' => "攻击对手时,一定几率无效属性抹消类与属性防御类属性,并增加让对手陷入异常状态的概率。",),
'Z' => Array('title' => "该物品可以使用特定物品进行强化。",), 'Z' => Array('title' => "该物品可以使用特定物品进行强化。",),
'z' => Array('title' => "那么,这个有什么用呢……?",), 'z' => Array('title' => "那么,这个有什么用呢……?",),
'-' => Array('title' => "战斗时无效双方的防具效果。",), '-' => Array('title' => "战斗时无效双方的防具效果。",),
...@@ -1196,6 +1197,7 @@ $itemspkinfo = Array( ...@@ -1196,6 +1197,7 @@ $itemspkinfo = Array(
'w' => '音波', 'w' => '音波',
'X' => '直死', //NPC专用 'X' => '直死', //NPC专用
'x' => '奇迹', 'x' => '奇迹',
'y' => '破格', //属穿
'Z' => '菁英', 'Z' => '菁英',
'z' => '天然', 'z' => '天然',
'-' => '精神抽取', '-' => '精神抽取',
......
...@@ -91,6 +91,7 @@ table.admin td.tdtitle { ...@@ -91,6 +91,7 @@ table.admin td.tdtitle {
.clit {color: #feea23; font:18pt "微软雅黑" serif; } .clit {color: #feea23; font:18pt "微软雅黑" serif; }
.yellow{color:#ffff00; font: bold 10pt "微软雅黑" serif;line-height:16px} .yellow{color:#ffff00; font: bold 10pt "微软雅黑" serif;line-height:16px}
.gold{color:rgb(255,215,0);font: bold 10pt "微软雅黑" serif;line-height:16px}
.clan{color: #00ffff;font: bold 10pt "微软雅黑" serif;line-height:16px} .clan{color: #00ffff;font: bold 10pt "微软雅黑" serif;line-height:16px}
.blue{color: #0060ff;font: bold 10pt "微软雅黑" serif;line-height:16px} .blue{color: #0060ff;font: bold 10pt "微软雅黑" serif;line-height:16px}
.red{color: #ff0000;font: bold 10pt "微软雅黑" serif;line-height:16px} .red{color: #ff0000;font: bold 10pt "微软雅黑" serif;line-height:16px}
......
img/n_63.gif

6.95 KB | W: | H:

img/n_63.gif

6.95 KB | W: | H:

img/n_63.gif
img/n_63.gif
img/n_63.gif
img/n_63.gif
  • 2-up
  • Swipe
  • Onion skin
img/n_64.gif

5.66 KB | W: | H:

img/n_64.gif

5.7 KB | W: | H:

img/n_64.gif
img/n_64.gif
img/n_64.gif
img/n_64.gif
  • 2-up
  • Swipe
  • Onion skin
...@@ -359,27 +359,120 @@ function init_battle($ismeet = 0){ ...@@ -359,27 +359,120 @@ function init_battle($ismeet = 0){
return; return;
} }
//function get_pstate($pid){//玩家状态储存在内存表里,读取之前先判断是否存在 function init_rev_battle($ismeet = 0)
// global $db,$tablepre,$now; {
// $result=$db->query("SELECT * FROM {$tablepre}pstate WHERE pid = '$pid'"); global $fog,$hpinfo,$spinfo,$rageinfo,$wepeinfo,$typeinfo,$sexinfo,$infinfo;
// if($db->num_rows($result)){ $ui_data = Array('hpstate','spstate','ragestate','wepestate','wepk_words','wep_words','infdata','iconImg','iconImgB','sNoinfo');
// $psdata = $db->fetch_array($result); $init_data = update_db_player_structure();
// }else{ foreach(Array('w_','s_') as $p)
// $psdata = false; {
// } foreach ($init_data as $i)
// return $psdata; {
//} global ${$p.$i};
}
//function set_pstate($psdata){//玩家状态储存在内存表里,若存在则更新记录,否则创建记录 foreach($ui_data as $u)
// global $db,$tablepre; {
// $pid = $psdata['pid']; global ${$p.$u};
// $result=$db->query("SELECT * FROM {$tablepre}pstate WHERE pid = '$pid'"); }
// if($db->num_rows($result)){ //更新血量、体力、怒气显示
// return $db->array_update("{$tablepre}pstate",$psdata," pid = '$pid'"); if(${$p.'hp'} <= 0)
// }else{ {
// return $db->array_insert("{$tablepre}pstate",$psdata); ${$p.'hpstate'} = "<span class=\"red\">$hpinfo[3]</span>";
// } ${$p.'spstate'} = "<span class=\"red\">$spinfo[3]</span>";
//} ${$p.'ragestate'} = "<span class=\"red\">$rageinfo[3]</span>";
}
else
{
if(${$p.'hp'} < ${$p.'mhp'}*0.2) {
${$p.'hpstate'} = "<span class=\"red\">$hpinfo[2]</span>";
} elseif(${$p.'hp'} < ${$p.'mhp'}*0.5) {
${$p.'hpstate'} = "<span class=\"yellow\">$hpinfo[1]</span>";
} else {
${$p.'hpstate'} = "<span class=\"clan\">$hpinfo[0]</span>";
}
if(${$p.'sp'} < ${$p.'msp'}*0.2) {
${$p.'spstate'} = "$spinfo[2]";
} elseif(${$p.'sp'} < ${$p.'msp'}*0.5) {
${$p.'spstate'} = "$spinfo[1]";
} else {
${$p.'spstate'} = "$spinfo[0]";
}
if(${$p.'rage'} >= 100) {
${$p.'ragestate'} = "<span class=\"red\">$rageinfo[2]</span>";
} elseif(${$p.'rage'} >= 30) {
${$p.'ragestate'} = "<span class=\"yellow\">$rageinfo[1]</span>";
} else {
${$p.'ragestate'} = "$rageinfo[0]";
}
}
//更新武器效果情报
switch(${$p.'wepe'})
{
case ${$p.'wepe'}>= 400:
${$p.'wepestate'} = "$wepeinfo[3]";
break;
case ${$p.'wepe'}>= 200:
${$p.'wepestate'} = "$wepeinfo[2]";
break;
case ${$p.'wepe'}>= 60:
${$p.'wepestate'} = "$wepeinfo[1]";
break;
default :
${$p.'wepestate'} = "$wepeinfo[0]";
}
//更新武器名、武器类别情报
${$p.'wep_words'} = parse_itm_desc(${$p.'wep'},'m');
${$p.'wepk_words'} = parse_itm_desc(${$p.'wepk'},'k');
//更新编号情报
${$p.'sNoinfo'} = $typeinfo[${$p.'type'}]."(".$sexinfo[${$p.'gd'}].${$p.'sNo'}."号)";
//更新头像情报
$itype = ${$p.'type'} > 0 ? 'n' : ${$p.'gd'};
$iname = $itype.'_'.${$p.'icon'};
if(file_exists('img/'.$iname.'a.gif'))
{
${$p.'iconImgB'}= $iname.'a.gif';
}
else
{
${$p.'iconImg'} = $iname.'.gif';
unset(${$p.'iconImgB'});
}
//更新受伤状态
if(${$p.'inf'})
{
${$p.'infdata'} = '';
foreach ($infinfo as $inf_ky => $inf_nm)
{
if(strpos(${$p.'inf'},$inf_ky) !== false) ${$p.'infdata'} .= $inf_nm;
}
}
else
{
${$p.'infdata'} = '';
}
}
if($fog && !$ismeet)
{
//雾天显示???
$w_wep_words = '???';
$w_wepk_words = '???';
$w_sNoinfo = '???';
$w_iconImg = 'question.gif';
$w_iconImgB = '';
$w_name = '???';
$w_wep = '???';
$w_infdata = '???';
$w_pose = -1;
$w_tactic = -1;
$w_lvl = '?';
$w_hpstate = '???';
$w_spstate = '???';
$w_ragestate = '???';
$w_wepestate = '???';
$w_wepk = '';
}
return;
}
function get_remaincdtime($pid){ function get_remaincdtime($pid){
$psdata = get_pstate($pid); $psdata = get_pstate($pid);
...@@ -393,8 +486,23 @@ function get_remaincdtime($pid){ ...@@ -393,8 +486,23 @@ function get_remaincdtime($pid){
} }
} }
//用于将当前玩家数据保存至数据库
function current_player_save(){
global $db,$tablepre;
$pdata = Array();
$data = update_db_player_structure();
foreach($data as $key)
{
global $$key;
$pdata[$key]= $$key;
}
$db->array_update("{$tablepre}players",$pdata,"pid='$pid'");
return $pdata;
}
//用于将指定player数据存回数据库
function player_save($data){ function player_save($data){
global $db,$tablepre; global $db,$tablepre;
$ndata = Array();
if(isset($data['pid'])){ if(isset($data['pid'])){
$pid = $data['pid']; $pid = $data['pid'];
$ndata = player_format_with_db_structure($data); $ndata = player_format_with_db_structure($data);
...@@ -403,6 +511,7 @@ function player_save($data){ ...@@ -403,6 +511,7 @@ function player_save($data){
} }
return; return;
} }
//用于刷新当前玩家数据
function player_load($data) function player_load($data)
{ {
$ndata = player_format_with_db_structure($data); $ndata = player_format_with_db_structure($data);
......
...@@ -17,7 +17,7 @@ $tacinfo = Array('通常','','重视防御','重视反击','重视躲避',); ...@@ -17,7 +17,7 @@ $tacinfo = Array('通常','','重视防御','重视反击','重视躲避',);
function get_find_r($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf = ''){ function get_find_r($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf = ''){
$_FIND = Array $_FIND = Array
( (
'weather' => array(10,20,0,-2,-3,-10,-7,5,-10,-20,0,-7,-5,-30,-5,-20,0), 'weather' => array(10,20,0,-2,-3,-10,-7,5,-10,-20,0,-7,-5,-30,-5,-20,0,20),
//'weather' => array(10,20,0,-2,-3,-7,-10,-5,10,0,0,-7,-5,-30), //'weather' => array(10,20,0,-2,-3,-7,-10,-5,10,0,0,-7,-5,-30),
'pls' => array(10,0,0,10,-10,10,0,10,-10,0,10,0,0,-10,0,-10,-10,-10,0,10,0,10), 'pls' => array(10,0,0,10,-10,10,0,10,-10,0,10,0,0,-10,0,-10,-10,-10,0,10,0,10),
'pose' => array(0,0,0,25,-10,-25,85), 'pose' => array(0,0,0,25,-10,-25,85),
...@@ -52,7 +52,7 @@ function get_active_r($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf ...@@ -52,7 +52,7 @@ function get_active_r($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf
global $active_obbs,$inf_active_p; global $active_obbs,$inf_active_p;
$_ACTIVE = Array $_ACTIVE = Array
( (
'weather' => array(10,20,0,-5,-10,-20,-15,0,-7,-10,-10,-5,0,-5,-20,-5,0), 'weather' => array(10,20,0,-5,-10,-20,-15,0,-7,-10,-10,-5,0,-5,-20,-5,0,20),
//'weather' => array(20,10,0,-3,-5,-5,-7,10,-10,-10,-10,-5,0,-5), //'weather' => array(20,10,0,-3,-5,-5,-7,10,-10,-10,-10,-5,0,-5),
'pls' => array(), 'pls' => array(),
'pose' => array(0,0,0,0,25,-25,5), 'pose' => array(0,0,0,0,25,-25,5),
...@@ -106,7 +106,7 @@ function get_attack_p($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf ...@@ -106,7 +106,7 @@ function get_attack_p($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf
global $inf_att_p; global $inf_att_p;
$_ATTACK = Array $_ATTACK = Array
( (
'weather' => array(10,10,0,-5,-10,-20,-15,0,0,7,20,-7,-20,-5,-10,-10,-10), 'weather' => array(10,10,0,-5,-10,-20,-15,0,0,7,20,-7,-20,-5,-10,-10,-10,10),
'pls' => array(0,0,0,0,0,0,10,0,0,-10,0,0,0,0,-10,0,0,0,10,0,0,0), 'pls' => array(0,0,0,0,0,0,10,0,0,-10,0,0,0,0,-10,0,0,0,10,0,0,0),
'pose' => array(0,100,0,-25,25,-50,50), 'pose' => array(0,100,0,-25,25,-50,50),
'tactic' => array(0,20,-25,25,-50), 'tactic' => array(0,20,-25,25,-50),
...@@ -131,7 +131,7 @@ function get_defend_p($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf ...@@ -131,7 +131,7 @@ function get_defend_p($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf
global $inf_def_p; global $inf_def_p;
$_DEFEND = Array $_DEFEND = Array
( (
'weather' => array(10,30,0,0,-3,-15,-10,0,-20,-30,-50,-5,-20,-3,-20,5,-30), 'weather' => array(10,30,0,0,-3,-15,-10,0,-20,-30,-50,-5,-20,-3,-20,5,-30,30),
'pls' => array(0,-10,10,0,0,0,0,0,0,0,0,-10,10,0,0,0,0,0,0,0,10,0), 'pls' => array(0,-10,10,0,0,0,0,0,0,0,0,-10,10,0,0,0,0,0,0,0,10,0),
'pose' => array(0,25,0,-25,-50,-50,-466), 'pose' => array(0,25,0,-25,-50,-50,-466),
'tactic' => array(0,-20,50,-25,0), 'tactic' => array(0,-20,50,-25,0),
......
...@@ -79,7 +79,7 @@ function findteam(&$w_pdata){ ...@@ -79,7 +79,7 @@ function findteam(&$w_pdata){
function findcorpse(&$w_pdata){ function findcorpse(&$w_pdata){
global $log,$mode,$main,$battle_title,$cmd,$iteminfo,$itemspkinfo; global $log,$mode,$main,$battle_title,$cmd,$iteminfo,$itemspkinfo;
global $w_type,$w_name,$w_gd,$w_sNo,$w_icon,$w_hp,$w_mhp,$w_wep,$w_wepk,$w_wepe,$w_lvl,$w_pose,$w_tactic,$w_inf;//,$itmsk0; global $w_type,$w_name,$w_gd,$w_sNo,$w_icon,$w_hp,$w_mhp,$w_wep,$w_wepk,$w_wepe,$w_lvl,$w_pose,$w_tactic,$w_inf,$w_rp;//,$itmsk0;
global $club; global $club;
$battle_title = '发现尸体'; $battle_title = '发现尸体';
...@@ -114,7 +114,7 @@ function findcorpse(&$w_pdata){ ...@@ -114,7 +114,7 @@ function findcorpse(&$w_pdata){
$log .= '你发现了<span class="red">'.$w_name.'</span>的尸体!<br>'; $log .= '你发现了<span class="red">'.$w_name.'</span>的尸体!<br>';
foreach (Array('wep','arb','arh','ara','arf','art','itm0','itm1','itm2','itm3','itm4','itm5','itm6') as $w_value) foreach (Array('wep','arb','arh','ara','arf','art','itm0','itm1','itm2','itm3','itm4','itm5','itm6') as $w_value)
{ {
${$w_value} = parse_itm_desc(${$w_value},'m'); if(isset(${$w_value})) ${$w_value} = parse_itm_desc(${$w_value},'m');
} }
foreach (Array('w_wepk','w_arbk','w_arhk','w_arak','w_arfk','w_artk','w_itmk0','w_itmk1','w_itmk2','w_itmk3','w_itmk4','w_itmk5','w_itmk6') as $w_k_value) { foreach (Array('w_wepk','w_arbk','w_arhk','w_arak','w_arfk','w_artk','w_itmk0','w_itmk1','w_itmk2','w_itmk3','w_itmk4','w_itmk5','w_itmk6') as $w_k_value) {
if(${$w_k_value}){ if(${$w_k_value}){
......
...@@ -3,6 +3,8 @@ if (! defined ( 'IN_GAME' )) { ...@@ -3,6 +3,8 @@ if (! defined ( 'IN_GAME' )) {
exit ( 'Access Denied' ); exit ( 'Access Denied' );
} }
include_once GAME_ROOT.'./include/game/dice.func.php';
function getskills(&$arr) function getskills(&$arr)
{ {
$arr=Array( $arr=Array(
...@@ -777,6 +779,248 @@ function upgradeclubskills($cmd) ...@@ -777,6 +779,248 @@ function upgradeclubskills($cmd)
} }
} }
#适配新版战斗函数的社团技能判定函数:
function rev_get_clubskill_bonus_hitrate($aclub,$askl,$pa,$bclub,$bskl,$pd)
{
//命中率系数
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$r=1;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==3 && $pa['wep_kind']=="K") //见敌必斩称号
{
$r*=(1+$clskl[3][${'a'.$i}][1]/100);
}
if ($alearn['learn'.$i]==5 && ($pa['wep_kind']=="G" || $pa['wep_kind']=="J")) //狙击鹰眼称号
{
$r*=(1+$clskl[5][${'a'.$i}][1]/100);
}
if ($blearn['learn'.$i]==12) //宛如疾风称号
{
$r*=(1-$clskl[12][${'b'.$i}][1]/100);
}
}
return $r;
}
function rev_get_clubskill_bonus_imfrate($aclub,$askl,$pa,$bclub,$bskl,$pd)
{
//防具损坏率系数
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$r=1;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==6 && ($pa['wep_kind']=="G" || $pa['wep_kind']=="J")) //狙击鹰眼称号
{
$r*=(1+$clskl[6][${'a'.$i}][1]/100);
}
}
return $r;
}
function rev_get_clubskill_bonus_imftime($aclub,$askl,$pa,$bclub,$bskl,$pd)
{
//防具损坏效果系数
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$r=1;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==6 && ($pa['wep_kind']=="G" || $pa['wep_kind']=="J")) //狙击鹰眼称号
{
$r+=$clskl[6][${'a'.$i}][2];
}
}
return $r;
}
function rev_get_clubskill_bonus_imprate($aclub,$askl,$pa,$bclub,$bskl,$pd)
{
//武器损坏率系数
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$r=1;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==4 && $pa['wep_kind']=="K") //见敌必斩称号
{
$r*=(1-$clskl[4][${'a'.$i}][1]/100);
}
}
return $r;
}
function rev_get_clubskill_bonus($aclub,$askl,$pa,$bclub,$bskl,$pd,&$att,&$def)
{
//攻击防御力加成
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$att=0; $def=0;
for ($i=1; $i<=2; $i++)
{
if ($blearn['learn'.$i]==1 && $pd['wep_kind']=="P") //铁拳无敌称号
{
$dup=$clskl[1][${'b'.$i}][1]/100*$pd['wepe'];
if ($dup>2000) $dup=2000;
$def+=$dup;
}
}
}
function rev_get_clubskill_bonus_p($aclub,$askl,$pa,$bclub,$bskl,$pd,&$att,&$def)
{
//攻击防御加成系数
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$att=1; $def=1;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==2 && $pa['wep_kind']=="P") //铁拳无敌称号
{
$att*=(1+$clskl[2][${'a'.$i}][1]/100);
if (rand(0,99)<$clskl[2][${'a'.$i}][2]) $def*=(1-$clskl[2][${'a'.$i}][3]/100);
}
if ($alearn['learn'.$i]==8 && $pa['wep_kind']=="C") //灌篮高手称号
{
$att*=(1+$clskl[8][${'a'.$i}][1]/100);
}
if ($alearn['learn'.$i]==6 && ($pa['wep_kind']=="G" || $pa['wep_kind']=="J")) //狙击鹰眼称号
{
if (rand(0,99)<$clskl[6][${'a'.$i}][3]) $att*=(1+$clskl[6][${'a'.$i}][4]/100);
}
}
}
function rev_get_clubskill_bonus_fluc($aclub,$askl,$pa,$bclub,$bskl,$pd)
{
//伤害浮动值
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$r=0;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==8 && $pa['wep_kind']=="C") //灌篮高手称号
{
$r+=$clskl[8][${'a'.$i}][2];
}
}
return $r;
}
function rev_get_clubskill_bonus_counter($aclub,$askl,$pa,$bclub,$bskl,$pd)
{
//反击率加成
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$r=1;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==7 && $pa['wep_kind']=='C') //灌篮高手称号
{
$r*=(1+$clskl[7][${'a'.$i}][1]/100);
}
if ($alearn['learn'.$i]==11) //宛如疾风称号
{
$r*=(1+$clskl[11][${'a'.$i}][3]/100);
}
if ($blearn['learn'.$i]==13 && $pd['wep_kind']=='F') //超能力者称号
{
$r*=(1-$clskl[13][${'b'.$i}][2]/100);
}
}
return $r;
}
function rev_get_clubskill_bonus_dmg_rate($aclub,$askl,$pa,$bclub,$bskl,$pd)
{
//最终伤害加成/减成,a为攻击方,b为防御方
getskills2($clskl);
getlearnt($alearn,$aclub,$askl);
getlearnt($blearn,$bclub,$bskl);
$a1=((int)($askl/10))%10; $a2=$askl%10;
$b1=((int)($bskl/10))%10; $b2=$bskl%10;
$ar=100;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==14) //攻击方有晶莹技能,伤害大幅下降
{
$ar-=$clskl[14][${'a'.$i}][1];
}
}
$br=100;
for ($i=1; $i<=2; $i++)
{
if ($blearn['learn'.$i]==14) //防御方有晶莹技能,伤害下降
{
$br-=$clskl[14][${'b'.$i}][2];
}
}
$r = round($ar*$br)/10000*100; //高端的算法往往以低调的姿态示人
return $r;
}
function rev_get_clubskill_bonus_dmg_val($club,$skl,$pa,$pd)
{
//最终伤害增加值
getskills2($clskl);
getlearnt($learn,$club,$skl);
$a1=((int)($skl/10))%10; $a2=$skl%10;
$rate = 0;
for ($i=1; $i<=2; $i++)
{
if ($learn['learn'.$i]==15) //攻击方有剔透技能,得到概率
{
$rate=$clskl[15][${'a'.$i}][1];
}
}
$rate -= round($pa['rp']/20);
if($rate < 0){$rate = 0;}
$rpdmg = $pd['rp'] - $pa['rp'];
$dice = diceroll(99);
if($rpdmg > 0 && $dice < $rate){
return $rpdmg;
}
return 0;
}
function rev_get_clubskill_rp_dec($clb,$skl)
{
//RP增长率下降
getskills2($clskl);
getlearnt($alearn,$clb,$skl);
$a1=((int)($skl/10))%10; $a2=$skl%10;
$r=0;
for ($i=1; $i<=2; $i++)
{
if ($alearn['learn'.$i]==14) $r=$clskl[14][${'a'.$i}][3]; //晶莹剔透1
}
//echo $r;
return $r;
}
#### 原社团技能函数:
function get_clubskill_bonus_p($aclub,$askl,$prefix1,$bclub,$bskl,$prefix2,&$att,&$def) function get_clubskill_bonus_p($aclub,$askl,$prefix1,$bclub,$bskl,$prefix2,&$att,&$def)
{ {
//攻击防御加成系数 //攻击防御加成系数
......
...@@ -12,6 +12,7 @@ function combat($active = 1, $wep_kind = '') { ...@@ -12,6 +12,7 @@ function combat($active = 1, $wep_kind = '') {
global $w_wep, $w_wepk, $w_wepe, $w_weps, $w_arb, $w_arbk, $w_arbe, $w_arbs, $w_arh, $w_arhk, $w_arhe, $w_arhs, $w_ara, $w_arak, $w_arae, $w_aras, $w_arf, $w_arfk, $w_arfe, $w_arfs, $w_art, $w_artk, $w_arte, $w_arts, $w_itm0, $w_itmk0, $w_itme0, $w_itms0, $w_itm1, $w_itmk1, $w_itme1, $w_itms1, $w_itm2, $w_itmk2, $w_itme2, $w_itms2, $w_itm3, $w_itmk3, $w_itme3, $w_itms3, $w_itm4, $w_itmk4, $w_itme4, $w_itms4, $w_itm5, $w_itmk5, $w_itme5, $w_itms5,$w_itm6, $w_itmk6, $w_itme6, $w_itms6, $w_wepsk, $w_arbsk, $w_arhsk, $w_arask, $w_arfsk, $w_artsk, $w_itmsk0, $w_itmsk1, $w_itmsk2, $w_itmsk3, $w_itmsk4, $w_itmsk5, $w_itmsk6; global $w_wep, $w_wepk, $w_wepe, $w_weps, $w_arb, $w_arbk, $w_arbe, $w_arbs, $w_arh, $w_arhk, $w_arhe, $w_arhs, $w_ara, $w_arak, $w_arae, $w_aras, $w_arf, $w_arfk, $w_arfe, $w_arfs, $w_art, $w_artk, $w_arte, $w_arts, $w_itm0, $w_itmk0, $w_itme0, $w_itms0, $w_itm1, $w_itmk1, $w_itme1, $w_itms1, $w_itm2, $w_itmk2, $w_itme2, $w_itms2, $w_itm3, $w_itmk3, $w_itme3, $w_itms3, $w_itm4, $w_itmk4, $w_itme4, $w_itms4, $w_itm5, $w_itmk5, $w_itme5, $w_itms5,$w_itm6, $w_itmk6, $w_itme6, $w_itms6, $w_wepsk, $w_arbsk, $w_arhsk, $w_arask, $w_arfsk, $w_artsk, $w_itmsk0, $w_itmsk1, $w_itmsk2, $w_itmsk3, $w_itmsk4, $w_itmsk5, $w_itmsk6;
global $infinfo, $w_combat_inf; global $infinfo, $w_combat_inf;
global $rp,$w_rp,$action,$w_action,$achievement,$w_achievement,$skills,$w_skills,$skillpoint,$w_skillpoint; global $rp,$w_rp,$action,$w_action,$achievement,$w_achievement,$skills,$w_skills,$skillpoint,$w_skillpoint;
global $clubpara,$w_clubpara;
$battle_title = '战斗发生'; $battle_title = '战斗发生';
...@@ -158,7 +159,8 @@ function combat($active = 1, $wep_kind = '') { ...@@ -158,7 +159,8 @@ function combat($active = 1, $wep_kind = '') {
$w_wep_kind = $w_w1; $w_wep_kind = $w_w1;
} }
$def_dmg = defend ( $w_wep_kind, 1 ); $def_dmg = defend ( $w_wep_kind, 1 );
if (($hp > 0) && ($tactic != 4) && ($pose != 5)) { if(get_single_clbpara($clbpara,'revival_flag')) $revival_flag = get_single_clbpara($clbpara,'revival_flag');
if (($hp > 0) && ($tactic != 4) && ($pose != 5) && !$revival_flag) {
global $rangeinfo; global $rangeinfo;
if ($rangeinfo [$wep_kind] >= $rangeinfo [$w_wep_kind] && $rangeinfo [$w_wep_kind] !== 0) { if ($rangeinfo [$wep_kind] >= $rangeinfo [$w_wep_kind] && $rangeinfo [$w_wep_kind] !== 0) {
$counter = get_counter ( $wep_kind, $tactic, $club, $inf ); $counter = get_counter ( $wep_kind, $tactic, $club, $inf );
...@@ -176,9 +178,12 @@ function combat($active = 1, $wep_kind = '') { ...@@ -176,9 +178,12 @@ function combat($active = 1, $wep_kind = '') {
} else { } else {
$log .= "<span class=\"red\">你攻击范围不足,不能反击,逃跑了!</span><br>"; $log .= "<span class=\"red\">你攻击范围不足,不能反击,逃跑了!</span><br>";
} }
} elseif($hp > 0) { } elseif($revival_flag) {
//复活后不会反击,不发log
} else {
$log .= "<span class=\"red\">你逃跑了!</span><br>"; $log .= "<span class=\"red\">你逃跑了!</span><br>";
} }
} }
if($hp == 0 && !$w_action){$w_action = 'pacorpse'.$pid;} if($hp == 0 && !$w_action){$w_action = 'pacorpse'.$pid;}
...@@ -207,9 +212,27 @@ function combat($active = 1, $wep_kind = '') { ...@@ -207,9 +212,27 @@ function combat($active = 1, $wep_kind = '') {
//include_once GAME_ROOT.'./include/game/achievement.func.php'; //include_once GAME_ROOT.'./include/game/achievement.func.php';
//check_battle_achievement($w_achievement,$w_type,$name); //check_battle_achievement($w_achievement,$w_type,$name);
} }
if($revival_flag)
{
$w_log .= "<span class=\"yellow\">$name</span><span class=\"red\">被你杀死了!</span><br>";
if($revival_flag == 99)
{
$w_log .= "<span class=\"lime\">但由于及时按下了BOMB键,{$name}原地满血复活了!</span><br>";
}
elseif($revival_flag == 17)
{
$w_log .= "<span class=\"lime\">但是,空气中弥漫着的奥罗拉让{$name}重新站了起来!</span><br>";
}
}
logsave ( $w_pid, $now, $w_log ,'b'); logsave ( $w_pid, $now, $w_log ,'b');
} }
//注销复活标记
if($revival_flag)
{
unset($revival_flag);
$clbpara = del_clbpara($clbpara,'revival_flag');
}
if (($att_dmg > $hdamage) && ($att_dmg >= $def_dmg)) { if (($att_dmg > $hdamage) && ($att_dmg >= $def_dmg)) {
$hdamage = $att_dmg; $hdamage = $att_dmg;
...@@ -223,80 +246,94 @@ function combat($active = 1, $wep_kind = '') { ...@@ -223,80 +246,94 @@ function combat($active = 1, $wep_kind = '') {
//$bid = $w_pid; //$bid = $w_pid;
if ($w_hp <= 0 && $w_club != 99) { if ($w_hp <= 0)
$w_bid = $pid; {
$w_hp = 0; //二形态最优先判断
if ($w_type==0){$killnum ++;}; if ($w_club == 99 && $w_type)
{
include_once GAME_ROOT . './include/state.func.php'; $log .= npc_chat ( $w_type,$w_name, 'death' );
$killmsg = kill ( $wep_kind, $w_name, $w_type, $w_pid, $wep_temp ); include_once GAME_ROOT . './include/system.func.php';
check_kill_events($pid,$w_pid); $npcdata = evonpc ($w_type,$w_name);
$log .= npc_chat ( $w_type,$w_name, 'death' ); $log .= '<span class="yellow">'.$w_name.'却没死去,反而爆发出真正的实力!</span><br>';
if($npcdata){
include_once GAME_ROOT.'./include/game/achievement.func.php'; addnews($now , 'evonpc',$w_name, $npcdata['name'], $name);
check_battle_achievement($name,$w_type,$w_name,$wep_temp); foreach($npcdata as $key => $val){
${'w_'.$key} = $val;
$log .= "<span class=\"red\">{$w_name}被你杀死了!</span><br>"; }
//$rp = $rp + 20 ; }
if(!$w_type){
if($w_rp < 80){
$rpup = 80;
}else{$rpup = $w_rp;}
}
else{$rpup = 20;}
if($club == 19){
$rpdec = 30;
$rpdec += get_clubskill_rp_dec($club,$skills);
$rp += round($rpup*(100-$rpdec)/100);
}
else{
$rp += $rpup;
} }
else
if($killmsg){$log .= "<span class=\"yellow\">你对{$w_name}说:“{$killmsg}”</span><br>";} {
include_once GAME_ROOT . './include/game/battle.func.php'; $w_bid = $pid;
$result = $db->query ( "SELECT * FROM {$tablepre}players WHERE pid='$w_pid'" ); $w_hp = 0;
$cdata = $db->fetch_array ( $result );
$action = 'corpse'.$edata['pid']; $log .= "<span class=\"red\">{$w_name}被你杀死了!</span><br>";
findcorpse ( $cdata ); //进行复活判定
return; include_once GAME_ROOT . './include/state.func.php';
} else { $killmsg = kill ( $wep_kind, $w_name, $w_type, $w_pid, $wep_temp ,$revival_flag);
if($w_hp <= 0){//有第二阶段 if($revival_flag)
if ($w_type)
{ {
$log .= npc_chat ( $w_type,$w_name, 'death' ); if($revival_flag == 99)
include_once GAME_ROOT . './include/system.func.php'; {
$npcdata = evonpc ($w_type,$w_name); $log .= '<span class="yellow">'.$w_name.'由于其及时按了BOMB键而原地满血复活了!</span><br>';
$log .= '<span class="yellow">'.$w_name.'却没死去,反而爆发出真正的实力!</span><br>'; }
if($npcdata){ elseif($revival_flag == 17)
addnews($now , 'evonpc',$w_name, $npcdata['name'], $name); {
foreach($npcdata as $key => $val){ $log .= '<span class="yellow">但是,空气中弥漫着的奥罗拉让敌人重新站了起来!</span><br>';
${'w_'.$key} = $val;
}
} }
} }
//没有复活 继续击杀判定
else else
{ {
include_once GAME_ROOT . './include/state.func.php'; if ($w_type==0){$killnum ++;};
$killmsg = kill ( $wep_kind, $w_name, $w_type, $w_pid, $wep_temp ); check_kill_events($pid,$w_pid);
$log .= '<span class="yellow">'.$w_name.'由于其及时按了BOMB键而原地满血复活了!</span><br>'; $log .= npc_chat ( $w_type,$w_name, 'death' );
include_once GAME_ROOT.'./include/game/achievement.func.php';
check_battle_achievement($name,$w_type,$w_name,$wep_temp);
if(!$w_type){
if($w_rp < 80){
$rpup = 80;
}else{$rpup = $w_rp;}
}
else{$rpup = 20;}
if($club == 19){
$rpdec = 30;
$rpdec += get_clubskill_rp_dec($club,$skills);
$rp += round($rpup*(100-$rpdec)/100);
}
else{
$rp += $rpup;
}
if($killmsg){$log .= "<span class=\"yellow\">你对{$w_name}说:“{$killmsg}”</span><br>";}
include_once GAME_ROOT . './include/game/battle.func.php';
$result = $db->query ( "SELECT * FROM {$tablepre}players WHERE pid='$w_pid'" );
$cdata = $db->fetch_array ( $result );
$action = 'corpse'.$edata['pid'];
findcorpse ( $cdata );
return;
} }
} }
$main = 'battle'; }
init_battle ( 1 );
//再注销一次复活标记
if (CURSCRIPT !== 'botservice') if($revival_flag) unset($revival_flag);
{
include template('battleresult'); $main = 'battle';
//$cmd = '<br><br><input type="hidden" name="mode" value="command"><input type="radio" name="command" id="back" value="back" checked><a onclick=sl("back"); href="javascript:void(0);" >确定</a><br>'; init_battle ( 1 );
$cmd = ob_get_contents();
ob_clean(); if (CURSCRIPT !== 'botservice')
//$bid = $hp <= 0 ? $bid : 0; {
} include template('battleresult');
$action = ''; //$cmd = '<br><br><input type="hidden" name="mode" value="command"><input type="radio" name="command" id="back" value="back" checked><a onclick=sl("back"); href="javascript:void(0);" >确定</a><br>';
return; $cmd = ob_get_contents();
} ob_clean();
//$bid = $hp <= 0 ? $bid : 0;
}
$action = '';
return;
} }
function attack($wep_kind = 'N', $active = 0) { function attack($wep_kind = 'N', $active = 0) {
...@@ -1390,8 +1427,19 @@ function defend($w_wep_kind = 'N', $active = 0) { ...@@ -1390,8 +1427,19 @@ function defend($w_wep_kind = 'N', $active = 0) {
include_once GAME_ROOT . './include/state.func.php'; include_once GAME_ROOT . './include/state.func.php';
$killmsg = death ( $w_wep_kind, $w_name, $w_type, $w_wep_temp ); $killmsg = death ( $w_wep_kind, $w_name, $w_type, $w_wep_temp );
$log .= npc_chat ( $w_type,$w_name, 'kill' ); $log .= npc_chat ( $w_type,$w_name, 'kill' );
if ($tmp_club==99) global $clbpara;
$log .= '<span class="yellow">由于你及时按了BOMB键,你原地满血复活了!</span><br>'; if($hp>0 && get_single_clbpara($clbpara,'revival_flag'))
{
$revival_flag = get_single_clbpara($clbpara,'revival_flag');
if ($revival_flag == 99)
{
$log .= '<span class="yellow">由于你及时按了BOMB键,你原地满血复活了!</span><br>';
}
elseif ($revival_flag == 17)
{
$log .= "<span class=\"lime b\">但是,空气中弥漫着的奥罗拉让你重新站了起来!</span><br>";
}
}
} }
} else { } else {
$damage = 0; $damage = 0;
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
global ${'element'.$e_key}; global ${'element'.$e_key};
if(${'element'.$e_key}) if(${'element'.$e_key})
{ {
$log.="<span title=\"".print_elements_tags($e_key)."\">"; $log.="<span tooltip=\"".print_elements_tags($e_key)."\">";
$log.="◆ {$e_info}{${'element'.$e_key}} 份;"; $log.="◆ {$e_info}{${'element'.$e_key}} 份;";
$log.="</span><br>"; $log.="</span><br>";
} }
......
...@@ -61,7 +61,7 @@ function poison($itmn = 0) { ...@@ -61,7 +61,7 @@ function poison($itmn = 0) {
function wthchange($itm,$itmsk){ function wthchange($itm,$itmsk){
global $now,$log,$weather, $wthinfo, $name,$nick; global $now,$log,$weather, $wthinfo, $name,$nick;
$weathertd = $weather; $weathertd = $weather;
if($weather >= 14 && $weather <= 16){ if($weather >= 14 && $weather <= 17){
addnews ( $now, 'wthfail', $nick.' '.$name, $weather, $itm ); addnews ( $now, 'wthfail', $nick.' '.$name, $weather, $itm );
$log .= "你使用了{$itm}。<br /><span class=\"red\">但是恶劣的天气并未发生任何变化!</span><br />"; $log .= "你使用了{$itm}。<br /><span class=\"red\">但是恶劣的天气并未发生任何变化!</span><br />";
}else{ }else{
...@@ -69,6 +69,7 @@ function wthchange($itm,$itmsk){ ...@@ -69,6 +69,7 @@ function wthchange($itm,$itmsk){
elseif($itmsk==98){$weather = rand ( 10, 13 );}//随机恶劣天气 elseif($itmsk==98){$weather = rand ( 10, 13 );}//随机恶劣天气
elseif($itmsk==97){$weather = rand ( 0, 9 );}//随机一般天气 elseif($itmsk==97){$weather = rand ( 0, 9 );}//随机一般天气
elseif($itmsk==96){$weather = rand ( 8, 9 );}//随机起雾天气 elseif($itmsk==96){$weather = rand ( 8, 9 );}//随机起雾天气
elseif($itmsk==95){$weather = 17;}//极光天气
elseif(!empty($itmsk) && is_numeric($itmsk)){ elseif(!empty($itmsk) && is_numeric($itmsk)){
if($itmsk >=0 && $itmsk < count($wthinfo)){ if($itmsk >=0 && $itmsk < count($wthinfo)){
$weather = $itmsk; $weather = $itmsk;
......
...@@ -1106,7 +1106,104 @@ function getcorpse($item){ ...@@ -1106,7 +1106,104 @@ function getcorpse($item){
return; return;
} }
//武器损耗&消耗计算:
function weapon_loss(&$pa)
{
global $log,$wepimprate;
if(isset($pa['wep_imp_times']) && $pa['wep_imp_times']>0)
{
$wep_loss_flag = 0;
//获取武器损耗类型
$wep_imp = $wepimprate[$pa['wep_kind']];
//损耗型武器
if($wep_imp > 0)
{
if($pa['weps'] == $nosta)
{
$pa['wepe'] -= $pa['wep_imp_times'];
$log.= "{$pa['nm']}{$pa['wep']}的攻击力下降了{$pa['wep_imp_times']}。<br>";
}
else
{
$pa['weps'] -= $pa['wep_imp_times'];
$log.= "{$pa['nm']}{$pa['wep']}的耐久度下降了{$pa['wep_imp_times']}。<br>";
}
if($pa['weps']<=0 || $pa['wepe']<=0)
{
$log .= "{$pa['nm']}的<span class=\"red\">{$pa['wep']}</span>使用过度,已经损坏,无法再装备了!<br>";
$wep_loss_flag = 1;
}
}
//消耗型武器
else
{
if($pa['weps'] != $nosta)
{
$pa['weps'] -= $pa['wep_imp_times'];
if($pa['wep_kind'] == 'C' || $pa['wep_kind'] == 'D' || $pa['wep_kind'] == 'F')
{
$log .= "{$pa['nm']}用掉了{$pa['wep_imp_times']}{$pa['wep']}。<br>";
if($pa['weps']<=0)
{
$log .= "{$pa['nm']}的<span class=\"red\">{$pa['wep']}</span>用光了!<br>";
$wep_loss_flag = 1;
}
}
elseif($pa['wep_kind'] == 'G' || $pa['wep_kind'] == 'J')
{
$log .= "{$pa['nm']}{$pa['wep']}的弹药数减少了{$pa['wep_imp_times']}。<br>";
if($pa['weps']<=0)
{
$log .= "{$pa['nm']}的<span class=\"red\">{$pa['wep']}</span>弹药用光了!<br>";
$wep_loss_flag = 1;
}
}
}
}
if($wep_loss_flag)
{
$pa['wep'] = '拳头'; $pa['wep_kind'] = 'N'; $pa['wepk'] = 'WN';
$pa['wepe'] = 0; $pa['weps'] = $nosta; $pa['wepsk'] = '';
}
}
return;
}
//扣除指定装备的耐久。$hurtkind 0=装备损坏文本 1=灵魂绑定消失文本
function armor_hurt(&$pa,$which,$hurtvalue,$hurtkind=0)
{
global $log,$nosta;
if(isset($pa[$which.'s']))
{
//无限耐久的防具可以抵挡1次任意点损耗
if ($pa[$which.'s'] == $nosta)
{
$pa[$which.'s'] = $hurtvalue;
}
//扣除耐久
$x = min($pa[$which.'s'], $hurtvalue);
$pa[$which.'s'] = $pa[$which.'s']-$x;
$log .= "{$pa['nm']}的".$pa[$which]."的耐久度下降了{$x}!<br>";
//耐久为0 装备损坏
if($pa[$which.'s'] <= 0)
{
$log .= "{$pa['nm']}的<span class=\"red b\">".$pa[$which]."</span>受损过重,无法再装备了!<br>";
if($which == 'arb')
{
$pa[$which] = '内衣'; $pa[$which.'k'] = 'DN';
$pa[$which.'e'] = 0; $pa[$which.'s'] = $nosta; $pa[$which.'sk'] = '';
}
else
{
$pa[$which] = $pa[$which.'k'] = $pa[$which.'sk'] = '';
$pa[$which.'e'] = $pa[$which.'s'] = 0;
}
}
}
return;
}
?> ?>
This diff is collapsed.
<?php
if(!defined('IN_GAME')) {
exit('Access Denied');
}
//发现敌人
function findenemy_rev($edata)
{
global $db,$tablepre;
global $fog,$pid,$log,$mode,$main,$cmd,$battle_title,$attinfo,$skillinfo;
$battle_title = '发现敌人';
//保存当前玩家数据,返回当前玩家数据组
$sdata = current_player_save();
//格式化对战双方数据
$init_data = update_db_player_structure();
foreach(Array('w_','s_') as $p)
{
foreach ($init_data as $i) global ${$p.$i};
}
extract($edata,EXTR_PREFIX_ALL,'w'); extract($sdata,EXTR_PREFIX_ALL,'s');
init_rev_battle();
$log .= "你发现了敌人<span class=\"red\">$w_name</span>!<br>对方好像完全没有注意到你!<br>";
//初始化玩家攻击方式信息
$w1 = substr($s_wepk,1,1);
$w2 = substr($s_wepk,2,1);
if ($w2=='0'||$w2=='1') $w2='';
if (($w1 == 'G'||$w1=='J')&&($s_weps==$nosta)) $w1 = 'P';
include template('battlecmd_rev');
$cmd = ob_get_contents();
ob_clean();
$main = 'battle_rev';
return;
}
//发现中立NPC $kind 0=中立单位 1=友军
function findneut(&$edata,$kind=0)
{
global $log,$action,$mode,$name,$main,$cmd,$battle_title,$pid,$db,$tablepre;
global $w_type,$w_name,$w_gd,$w_sNo,$w_icon,$w_hp,$w_mhp,$w_sp,$w_msp,$w_rage,$w_wep,$w_wepk,$w_wepe,$w_lvl,$w_pose,$w_tactic,$w_inf;
$battle_title = $kind ? '发现朋友' : '发现敌人?';
extract($edata,EXTR_PREFIX_ALL,'w');
init_battle(1);
if(!is_array($edata['clbpara'])) $edata['clbpara']=get_clbpara($edata['clbpara']);
$log .= "你发现了<span class=\"yellow\">$w_name</span>!<br>";
if(!$kind) $log .= "对方看起来没有敌意。<br>";
//TODO:把这一段挪到一个独立函数里
if($edata['clbpara']['post'] == $pid)
{
$log.="对方一看见你,便猛地朝你扑了过来!<br>
<br><span class='sienna'>“老板!有你的快递喔!”</span><br>
<br>你被这突然袭击吓了一跳!<br>
但对方只是从身上摸出了一个包裹样的东西扔给了你。然后又急匆匆地转身离开了。<br>
<br>……这是在搞啥……?<br><br>";
$action='';
global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
$iid=$edata['clbpara']['postid'];
$itm0=$edata['itm'.$iid];$itmk0=$edata['itmk'.$iid];$itmsk0=$edata['itmsk'.$iid];
$itme0=$edata['itme'.$iid];$itms0=$edata['itms'.$iid];
//发一条news 表示快递已送达
$sponsorid = $edata['clbpara']['sponsor'];
$result = $db->query("SELECT * FROM {$tablepre}gambling WHERE uid = '$sponsorid'");
$sordata = $db->fetch_array($result);
addnews($now,'gpost_success',$sordata['uname'],$itm0,$name);
//再见了~快递员!
unset($edata['clbpara']['post']);unset($edata['clbpara']['postid']);unset($edata['clbpara']['sponsor']);
destory_corpse($edata);
//解除快递锁
$db->query("UPDATE {$tablepre}gambling SET bnid=0 WHERE uid='$sponsorid'");
}
include template('findneut');
$cmd = ob_get_contents();
ob_clean();
$main = 'battle';
return;
}
?>
\ No newline at end of file
This diff is collapsed.
...@@ -609,8 +609,10 @@ function discover($schmode = 0) { ...@@ -609,8 +609,10 @@ function discover($schmode = 0) {
if($active_dice < $active_r) if($active_dice < $active_r)
{ {
$action = 'enemy'.$edata['pid']; $action = 'enemy'.$edata['pid'];
include_once GAME_ROOT.'./include/game/battle.func.php'; //include_once GAME_ROOT.'./include/game/battle.func.php';
findenemy($edata); //findenemy($edata);
include_once GAME_ROOT.'./include/game/revbattle.func.php';
findenemy_rev($edata);
return; return;
} }
//挨打 //挨打
...@@ -623,8 +625,10 @@ function discover($schmode = 0) { ...@@ -623,8 +625,10 @@ function discover($schmode = 0) {
echo "passive_w_type={$edata['type']}\n"; echo "passive_w_type={$edata['type']}\n";
echo "passive_w_sNo={$edata['sNo']}\n"; echo "passive_w_sNo={$edata['sNo']}\n";
} }
include_once GAME_ROOT.'./include/game/combat.func.php'; //include_once GAME_ROOT.'./include/game/combat.func.php';
combat(0); //combat(0);
include_once GAME_ROOT.'./include/game/revcombat.func.php';
rev_combat_prepare($edata,NULL,0);
return; return;
} }
} }
......
...@@ -662,8 +662,24 @@ function get_clbpara($para) ...@@ -662,8 +662,24 @@ function get_clbpara($para)
return json_decode($para,true); return json_decode($para,true);
} }
function set_clbpara($para) function get_single_clbpara($para,$key)
{ {
$para = get_clbpara($para);
if(isset($para[$key])) return $para[$key];
return;
}
function del_clbpara($para,$key)
{
$para = get_clbpara($para);
if(isset($para[$key])) unset($para[$key]);
return json_encode($para);
}
function set_clbpara($para,$key,$value)
{
$para = get_clbpara($para);
$para[$key] = $value;
return json_encode($para); return json_encode($para);
} }
......
...@@ -90,6 +90,8 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') { ...@@ -90,6 +90,8 @@ function nparse_news($start = 0, $range = 0 ){//$type = '') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"red\">本局游戏被GM中止</span><br>\n"; $newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"red\">本局游戏被GM中止</span><br>\n";
} elseif($news == 'revival') { } elseif($news == 'revival') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"lime\">{$a}因为及时按了BOMB键而原地满血复活了!</span><br>\n"; $newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"lime\">{$a}因为及时按了BOMB键而原地满血复活了!</span><br>\n";
} elseif($news == 'aurora_revival') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"lime\">{$a}在奥罗拉的作用下原地复活了!</span></li>";
} elseif(strpos($news,'death') === 0) { } elseif(strpos($news,'death') === 0) {
if($news == 'death11') { if($news == 'death11') {
$newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"yellow\">$a</span>因滞留在<span class=\"red\">禁区【{$plsinfo[$c]}】</span>死亡"; $newsinfo .= "<li>{$hour}{$min}{$sec}秒,<span class=\"yellow\">$a</span>因滞留在<span class=\"red\">禁区【{$plsinfo[$c]}】</span>死亡";
......
...@@ -6,6 +6,7 @@ if (! defined ( 'IN_GAME' )) { ...@@ -6,6 +6,7 @@ if (! defined ( 'IN_GAME' )) {
function death($death, $kname = '', $ktype = 0, $annex = '') { function death($death, $kname = '', $ktype = 0, $annex = '') {
global $now, $db, $tablepre, $alivenum, $deathnum, $name, $state, $deathtime, $type, $lvl, $bid, $killmsginfo, $typeinfo, $hp, $mhp, $wp, $wk, $wg, $wc, $wd, $wf, $sp, $msp, $club, $pls , $nick; global $now, $db, $tablepre, $alivenum, $deathnum, $name, $state, $deathtime, $type, $lvl, $bid, $killmsginfo, $typeinfo, $hp, $mhp, $wp, $wk, $wg, $wc, $wd, $wf, $sp, $msp, $club, $pls , $nick;
global $weather,$clbpara;
if (! $death) { if (! $death) {
return; return;
} }
...@@ -94,23 +95,42 @@ function death($death, $kname = '', $ktype = 0, $annex = '') { ...@@ -94,23 +95,42 @@ function death($death, $kname = '', $ktype = 0, $annex = '') {
$knname = isset($knick) ? $knick.' '.$kname : $kname; $knname = isset($knick) ? $knick.' '.$kname : $kname;
addnews ( $now, 'death' . $state, $name, $type, $knname, $annex, $lastword ); addnews ( $now, 'death' . $state, $name, $type, $knname, $annex, $lastword );
//$alivenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}players WHERE hp>0 AND type=0"), 0); //$alivenum = $db->result($db->query("SELECT COUNT(*) FROM {$tablepre}players WHERE hp>0 AND type=0"), 0);
if ($type==0 && $club==99 && ($death=="N" || $death=="P" || $death=="K" || $death=="G" || $death=="C" || $death=="D" || $death=="F" || $death=="J" || $death=="trap")) $revival_flag = false;
//依次判定复活效果
if (!$revival_flag && $weather == 17)
{
include_once GAME_ROOT.'./include/game/dice.func.php';
$aurora_rate = 10; //玩家10%概率复活
$aurora_dice = diceroll(100);
if($aurora_dice<=$aurora_rate)
{
//奥罗拉复活效果
addnews($now,'aurora_revival',$name);
$hp += min($mhp,max($aurora_dice,1)); $sp += min($msp,max($aurora_dice,1));
$alivenum++; $state=0;
$clbpara = set_clbpara($clbpara,'revival_flag','17');
$revival_flag = true;
}
}
if (!$revival_flag && $type==0 && $club==99 && ($death=="N" || $death=="P" || $death=="K" || $death=="G" || $death=="C" || $death=="D" || $death=="F" || $death=="J" || $death=="trap"))
{ {
addnews($now,'revival',$name); //玩家春哥附体称号的处理 addnews($now,'revival',$name); //玩家春哥附体称号的处理
$hp=$mhp; $sp=$msp; $hp=$mhp; $sp=$msp;
$club=17; $state=0; $club=17; $state=0;
$clbpara = set_clbpara($clbpara,'revival_flag','99');
$alivenum++; $alivenum++;
} }
//PORT if(!$revival_flag)
//死亡时灵魂绑定的道具也会消失 {
global $wep,$arb,$arh,$ara,$arf,$art,$itm1,$itm2,$itm3,$itm4,$itm5,$itm6; //死亡时灵魂绑定的道具也会消失 嗨呀 死了没复活才会消失
global $weps,$arbs,$arhs,$aras,$arfs,$arts,$itms1,$itms2,$itms3,$itms4,$itms5,$itms6; global $wep,$arb,$arh,$ara,$arf,$art,$itm1,$itm2,$itm3,$itm4,$itm5,$itm6;
global $wepe,$arbe,$arhe,$arae,$arfe,$arte,$itme1,$itme2,$itme3,$itme4,$itme5,$itme6; global $weps,$arbs,$arhs,$aras,$arfs,$arts,$itms1,$itms2,$itms3,$itms4,$itms5,$itms6;
global $wepk,$arbk,$arhk,$arak,$arfk,$artk,$itmk1,$itmk2,$itmk3,$itmk4,$itmk5,$itmk6; global $wepe,$arbe,$arhe,$arae,$arfe,$arte,$itme1,$itme2,$itme3,$itme4,$itme5,$itme6;
global $wepsk,$arbsk,$arhsk,$arask,$arfsk,$artsk,$itmsk1,$itmsk2,$itmsk3,$itmsk4,$itmsk5,$itmsk6; global $wepk,$arbk,$arhk,$arak,$arfk,$artk,$itmk1,$itmk2,$itmk3,$itmk4,$itmk5,$itmk6;
global $log; global $wepsk,$arbsk,$arhsk,$arask,$arfsk,$artsk,$itmsk1,$itmsk2,$itmsk3,$itmsk4,$itmsk5,$itmsk6;
global $log;
for($i = 1;$i <= 6;$i++){ for($i = 1;$i <= 6;$i++){
if(strpos(${'itmsk'.$i},'v')!==false){ if(strpos(${'itmsk'.$i},'v')!==false){
$log .= "伴随着你的死亡,<span class=\"yellow\">${'itm'.$i}</span>也化作灰烬消散了。<br>"; $log .= "伴随着你的死亡,<span class=\"yellow\">${'itm'.$i}</span>也化作灰烬消散了。<br>";
...@@ -149,17 +169,17 @@ function death($death, $kname = '', $ktype = 0, $annex = '') { ...@@ -149,17 +169,17 @@ function death($death, $kname = '', $ktype = 0, $annex = '') {
$arts=$arte = 0; $arts=$arte = 0;
} }
} }
$alivenum --;
$alivenum --; $deathnum ++;
$deathnum ++; }
save_gameinfo (); save_gameinfo ();
return $killmsg; return $killmsg;
} }
function kill($death, $dname, $dtype = 0, $dpid = 0, $annex = '') { function kill($death, $dname, $dtype = 0, $dpid = 0, $annex = '', &$revival_flag=0) {
global $now, $db, $tablepre, $alivenum, $deathnum, $name, $w_state, $type, $pid, $typeinfo, $pls, $lwinfo, $w_achievement; global $now, $db, $tablepre, $alivenum, $deathnum, $name, $w_state, $type, $pid, $typeinfo, $pls, $lwinfo, $w_achievement;
global $weather;
if (! $death || ! $dname) { if (! $death || ! $dname) {
return; return;
...@@ -199,11 +219,6 @@ function kill($death, $dname, $dtype = 0, $dpid = 0, $annex = '') { ...@@ -199,11 +219,6 @@ function kill($death, $dname, $dtype = 0, $dpid = 0, $annex = '') {
if ($dtype) { if ($dtype) {
if($dtype == 15){//静流AI
global $gamevars;
$gamevars['sanmadead'] = 1;
save_gameinfo();
}
$lwname = $typeinfo [$dtype] . ' ' . $dname; $lwname = $typeinfo [$dtype] . ' ' . $dname;
if (is_array ( $lwinfo [$dtype] )) { if (is_array ( $lwinfo [$dtype] )) {
$lastword = $lwinfo [$dtype] [$dname]; $lastword = $lwinfo [$dtype] [$dname];
...@@ -225,30 +240,48 @@ function kill($death, $dname, $dtype = 0, $dpid = 0, $annex = '') { ...@@ -225,30 +240,48 @@ function kill($death, $dname, $dtype = 0, $dpid = 0, $annex = '') {
$result = $db->query("SELECT * FROM {$tablepre}players WHERE pid=$dpid" ); $result = $db->query("SELECT * FROM {$tablepre}players WHERE pid=$dpid" );
$res=$db->fetch_array($result); $res=$db->fetch_array($result);
$revivaled=false; $revivaled=false;
if ($res['type']==0 && $res['club']==99 && ($death=="N" || $death=="P" || $death=="K" || $death=="G" || $death=="C" ||$death=="D" || $death=="F" || $death=="J" || $death=="trap")) //依次判定复活效果
if (!$revival_flag && $weather == 17)
{
include_once GAME_ROOT.'./include/game/dice.func.php';
$aurora_rate = $dtype ? 1 : 10; //NPC概率1% 玩家概率10%
$aurora_dice = diceroll(100);
if($aurora_dice<=$aurora_rate)
{
//奥罗拉复活效果
addnews($now,'aurora_revival',$res['name']);
$res['hp'] += min($res['mhp'],max($aurora_dice,1)); $res['sp'] += min($res['msp'],max($aurora_dice,1));
$res['state']=0;
$alivenum++;
$revival_flag = 17;
}
}
if (!$revival_flag && $res['type']==0 && $res['club']==99 && ($death=="N" || $death=="P" || $death=="K" || $death=="G" || $death=="C" ||$death=="D" || $death=="F" || $death=="J" || $death=="trap"))
{ {
addnews($now,'revival',$res['name']); //玩家春哥附体称号的处理 addnews($now,'revival',$res['name']); //玩家春哥附体称号的处理
$db->query ( "UPDATE {$tablepre}players SET hp=mhp WHERE pid=$dpid" ); $res['hp'] = $res['mhp']; $res['sp'] = $res['msp'];
$res['club'] = 17; $res['state'] = 0;
/*$db->query ( "UPDATE {$tablepre}players SET hp=mhp WHERE pid=$dpid" );
$db->query ( "UPDATE {$tablepre}players SET sp=msp WHERE pid=$dpid" ); $db->query ( "UPDATE {$tablepre}players SET sp=msp WHERE pid=$dpid" );
$db->query ( "UPDATE {$tablepre}players SET club=17 WHERE pid=$dpid" ); $db->query ( "UPDATE {$tablepre}players SET club=17 WHERE pid=$dpid" );
$db->query ( "UPDATE {$tablepre}players SET state=0 WHERE pid=$dpid" ); $db->query ( "UPDATE {$tablepre}players SET state=0 WHERE pid=$dpid" );*/
$alivenum++; $alivenum++;
$revivaled=true; $revivaled = 99;
} }
if (!$revivaled) $db->query ( "UPDATE {$tablepre}players SET hp='0',endtime='$now',deathtime='$now',bid='$pid',state='$w_state' WHERE pid=$dpid" ); if (!$revivaled)
// if($dtype == 1 || $dtype == 9){ {
// global $rdown,$bdown; if($dtype == 15){//静流AI
// if($dtype == 1){ global $gamevars;
// $rdown = 1; $gamevars['sanmadead'] = 1;
// storyputchat($now,'rdown'); save_gameinfo();
// }elseif($dtype == 9){ }
// $bdown = 1; //$db->query ( "UPDATE {$tablepre}players SET hp='0',endtime='$now',deathtime='$now',bid='$pid',state='$w_state' WHERE pid=$dpid" );
// storyputchat($now,'bdown'); }
// }
// } player_save($res);
save_gameinfo();
save_gameinfo ();
return $killmsg; return $killmsg;
} }
......
<!--{if (CURSCRIPT == 'game' && $pls=='0')}--> <!--{loop $plsinfo $places $info}-->
<style> <!--{if (CURSCRIPT == 'game' && $pls==$places)}-->
body {background-image: url("../../img/location/0.jpg");background-position: center;} <!--{eval $bgurl = "img/location/".$places.".jpg"}-->
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='1')}-->
<style>
body {background-image: url("../../img/location/1.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='2')}-->
<style> <style>
body {background-image: url("../../img/location/2.jpg");background-position: center;} body {background-image: url("$bgurl");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='3')}-->
<style>
body {background-image: url("../../img/location/3.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='4')}-->
<style>
body {background-image: url("../../img/location/4.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='5')}-->
<style>
body {background-image: url("../../img/location/5.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='6')}-->
<style>
body {background-image: url("../../img/location/6.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='7')}-->
<style>
body {background-image: url("../../img/location/7.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='8')}-->
<style>
body {background-image: url("../../img/location/8.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='9')}-->
<style>
body {background-image: url("../../img/location/9.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='10')}-->
<style>
body {background-image: url("../../img/location/10.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='11')}-->
<style>
body {background-image: url("../../img/location/11.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='12')}-->
<style>
body {background-image: url("../../img/location/12.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='13')}-->
<style>
body {background-image: url("../../img/location/13.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='14')}-->
<style>
body {background-image: url("../../img/location/14.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='15')}-->
<style>
body {background-image: url("../../img/location/15.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='16')}-->
<style>
body {background-image: url("../../img/location/16.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='17')}-->
<style>
body {background-image: url("../../img/location/17.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='18')}-->
<style>
body {background-image: url("../../img/location/18.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='19')}-->
<style>
body {background-image: url("../../img/location/19.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='20')}-->
<style>
body {background-image: url("../../img/location/20.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='21')}-->
<style>
body {background-image: url("../../img/location/21.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='22')}-->
<style>
body {background-image: url("../../img/location/22.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='23')}-->
<style>
body {background-image: url("../../img/location/23.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='24')}-->
<style>
body {background-image: url("../../img/location/24.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='25')}-->
<style>
body {background-image: url("../../img/location/25.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='26')}-->
<style>
body {background-image: url("../../img/location/26.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='27')}-->
<style>
body {background-image: url("../../img/location/27.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='28')}-->
<style>
body {background-image: url("../../img/location/28.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='29')}-->
<style>
body {background-image: url("../../img/location/29.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='30')}-->
<style>
body {background-image: url("../../img/location/30.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='31')}-->
<style>
body {background-image: url("../../img/location/31.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='32')}-->
<style>
body {background-image: url("../../img/location/32.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='33')}-->
<style>
body {background-image: url("../../img/location/33.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='34')}-->
<style>
body {background-image: url("../../img/location/34.jpg");background-position: center;}
</style> </style>
<!--{/if}--> <!--{/if}-->
<!--{/loop}-->
<TABLE border="0" width=720px height=430px align="center" cellspacing="0" cellpadding="0" class="battle"> <TABLE border="0" width=720px height=430px align="center" cellspacing="0" cellpadding="0" class="battle">
<tr> <tr>
<td class="b8" valign="top" rowspan=2> <td class="b8" valign="top" rowspan=2>
......
<!--{loop $plsinfo $places $info}-->
<!--{if (CURSCRIPT == 'game' && $s_pls==$places)}-->
<!--{eval $bgurl = "img/location/".$places.".jpg"}-->
<style>
body {background-image: url("$bgurl");background-position: center;}
</style>
<!--{/if}-->
<!--{/loop}-->
<TABLE border="0" width=720px height=430px align="center" cellspacing="0" cellpadding="0" class="battle">
<tr>
<td class="b8" valign="top" rowspan=2>
<div style="position:relative;width:140px;height:340px;">
<!--{if $w_iconImgB}-->
<IMG src="img/$w_iconImgB" style="border:0;height:340px;position:absolute;left:0px;top:0px;<!--{if $w_hp==0}-->filter: grayscale(100%)<!--{/if}-->" />
<!--{else}-->
<IMG src="img/$w_iconImg" style="border:0;height:80px;<!--{if $w_hp==0}-->filter: grayscale(100%)<!--{/if}-->" />
<!--{/if}-->
</div>
</td>
<td colspan=2 width=580px>
<table border="0" cellspacing="0" height=75px width=580px cellpadding="0" width="100%" valign="middle">
<tr>
<td class="b1" colspan=2 height=20px><span>Lv. $w_lvl</span></td>
<td class="b1" colspan=2><span>$w_name</span></td>
<td class="b1" colspan=2><span>$w_sNoinfo</span><!--{if $s_club==19}--><span class="lime">报应点数:<span id="anum">$w_rp</span></span><!--{/if}--></td>
</tr>
<tr>
<td class="b2" width=70px height=20px><span>{lang rage}</span></td>
<td class="b3" width=95px><span>$w_ragestate</span></td>
<td class="b2" width=70px><span>{lang sp}</span></td>
<td class="b3" width=105px><span>$w_spstate</span></td>
<td class="b2" width=70px><span>{lang hp}</span></td>
<td class="b3" width=170px><span>$w_hpstate</span></td>
</tr>
<tr>
<td class="b2" height=20px><span>{lang wep}{lang effect}</span></td>
<td class="b3"><span>$w_wepestate</span></td>
<td class="b2"><span>{lang wep}{lang kind1}</span></td>
<td class="b3"><span><!--{if $w_wepk != ''}-->$w_wepk_words<!--{else}-->???<!--{/if}--></span></td>
<td class="b2"><span>{lang wep}</span></td>
<td class="b3"><span>$w_wep_words</span></td>
</tr>
<tr>
<td class="b2" height=20px><span>{lang tactic}</span></td>
<td class="b3"><span><!--{if $w_tactic >= 0}-->$tacinfo[$w_tactic]<!--{else}-->???<!--{/if}--></span></td>
<td class="b2"><span>{lang pose}</span></td>
<td class="b3"><span><!--{if $w_pose >= 0}-->$poseinfo[$w_pose]<!--{else}-->???<!--{/if}--></span></td>
<td height="20px" class="b2"><span>{lang inf}</span></td>
<td class="b3"><span><!--{if $w_infdata}-->$w_infdata<!--{else}--><!--{/if}--></span></td>
</tr>
</table>
</td>
</tr>
<tr>
<TD class="b8" height=270px width=440px>
<div style="position:relative;height:268px;width:438px;display: flex;align-items:center;justify-content: center;">
<span><B><FONT color="#ff0000" size="5" face="黑体">$battle_title</FONT></B></span>
</div>
</TD>
<td class="b8" width=140px rowspan="2" valign="bottom">
<div style="position:relative;width:140px;height:350px;">
<!--{if $iconImgB}-->
<IMG src="img/$iconImgB" style="border:0;height:340px;position:absolute;left:0px;bottom:-10px;<!--{if $hp==0}-->filter: grayscale(100%)<!--{/if}-->" />
<!--{else}-->
<IMG src="img/$iconImg" style="border:0;height:80px;position:absolute;left:0;bottom:0;<!--{if $hp==0}-->filter: grayscale(100%)<!--{/if}-->" />
<!--{/if}-->
</div>
</td>
</TR>
<tr>
<td colspan=2 width=580px>
<table border="0" width=580px height=80px cellspacing="0" cellpadding="0" valign="middle">
<tr>
<td class="b1" colspan=2 height=20px><span>$typeinfo[$s_type]({$sexinfo[$s_gd]}{$s_sNo}号)</span></td>
<td class="b1" colspan=2><span>$s_name</span></td>
<td class="b1" colspan=2><span>Lv. $s_lvl</span></td>
</tr>
<tr>
<td class="b2" width=70px height=20px><span>{lang hp}</span></td>
<td class="b3" width=170px><span><span class="$hpcolor">$s_hp / $s_mhp</span></span></td>
<td class="b2" width=70px><span>{lang sp}</span></td>
<td class="b3" width=105px><span>$s_sp / $s_msp</span></td>
<td class="b2" width=70px><span>{lang rage}</span></td>
<td class="b3" width=95px><span><!--{if $s_rage >=30}--><span class="yellow">$s_rage</span><!--{else}-->$s_rage<!--{/if}--></span></td>
</tr>
<tr>
<td class="b2" height=20px><span>{lang wep}</span></td>
<td class="b3"><span>$s_wep_words</span></td>
<td class="b2"><span>{lang wep}{lang kind1}</span></td>
<td class="b3"><span>$s_wepk_words</span></td>
<td class="b2"><span>{lang wep}{lang effect}</span></td>
<td class="b3"><span>$s_wepe</span></td>
</tr>
<tr>
<td class="b2" height=20px><span>{lang inf}</span></td>
<td class="b3">
<span>
<!--{if $inf}-->
<!--{loop $infinfo $key $val}-->
<!--{if strpos($s_inf,$key)!==false}-->
$val
<!--{/if}-->
<!--{/loop}-->
<!--{else}-->
<!--{/if}-->
</span>
</td>
<td class="b2"><span>{lang pose}</span></td>
<td class="b3"><span>$poseinfo[$s_pose]</span></td>
<td class="b2"><span>{lang tactic}</span></td>
<td class="b3"><span>$tacinfo[$s_tactic]</span></td>
</tr>
</table>
</td>
</tr>
</TABLE>
现在想要做什么?<br><br>
向对手大喊:<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}-->
<br><input type="button" class="cmdbutton" name="back" value="逃跑" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
<!--{if (CURSCRIPT == 'game' && $pls=='0')}--> <!--{loop $plsinfo $places $info}-->
<style> <!--{if (CURSCRIPT == 'game' && $pls==$places)}-->
body {background-image: url("../../img/location/0.jpg");background-position: center;} <!--{eval $bgurl = "img/location/".$places.".jpg"}-->
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='1')}-->
<style>
body {background-image: url("../../img/location/1.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='2')}-->
<style> <style>
body {background-image: url("../../img/location/2.jpg");background-position: center;} body {background-image: url("$bgurl");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='3')}-->
<style>
body {background-image: url("../../img/location/3.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='4')}-->
<style>
body {background-image: url("../../img/location/4.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='5')}-->
<style>
body {background-image: url("../../img/location/5.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='6')}-->
<style>
body {background-image: url("../../img/location/6.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='7')}-->
<style>
body {background-image: url("../../img/location/7.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='8')}-->
<style>
body {background-image: url("../../img/location/8.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='9')}-->
<style>
body {background-image: url("../../img/location/9.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='10')}-->
<style>
body {background-image: url("../../img/location/10.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='11')}-->
<style>
body {background-image: url("../../img/location/11.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='12')}-->
<style>
body {background-image: url("../../img/location/12.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='13')}-->
<style>
body {background-image: url("../../img/location/13.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='14')}-->
<style>
body {background-image: url("../../img/location/14.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='15')}-->
<style>
body {background-image: url("../../img/location/15.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='16')}-->
<style>
body {background-image: url("../../img/location/16.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='17')}-->
<style>
body {background-image: url("../../img/location/17.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='18')}-->
<style>
body {background-image: url("../../img/location/18.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='19')}-->
<style>
body {background-image: url("../../img/location/19.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='20')}-->
<style>
body {background-image: url("../../img/location/20.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='21')}-->
<style>
body {background-image: url("../../img/location/21.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='22')}-->
<style>
body {background-image: url("../../img/location/22.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='23')}-->
<style>
body {background-image: url("../../img/location/23.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='24')}-->
<style>
body {background-image: url("../../img/location/24.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='25')}-->
<style>
body {background-image: url("../../img/location/25.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='26')}-->
<style>
body {background-image: url("../../img/location/26.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='27')}-->
<style>
body {background-image: url("../../img/location/27.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='28')}-->
<style>
body {background-image: url("../../img/location/28.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='29')}-->
<style>
body {background-image: url("../../img/location/29.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='30')}-->
<style>
body {background-image: url("../../img/location/30.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='31')}-->
<style>
body {background-image: url("../../img/location/31.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='32')}-->
<style>
body {background-image: url("../../img/location/32.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='33')}-->
<style>
body {background-image: url("../../img/location/33.jpg");background-position: center;}
</style>
<!--{/if}-->
<!--{if (CURSCRIPT == 'game' && $pls=='34')}-->
<style>
body {background-image: url("../../img/location/34.jpg");background-position: center;}
</style> </style>
<!--{/if}--> <!--{/if}-->
<!--{/loop}-->
<table border="0" width="720" height="100%" cellspacing="0" cellpadding="0" valign="middle"> <table border="0" width="720" height="100%" cellspacing="0" cellpadding="0" valign="middle">
<tr> <tr>
<td> <td>
......
This diff is collapsed.
<input type="hidden" name="mode" value="revcombat">
<input type="hidden" name="command" value="enter">
<input type="button" class="cmdbutton" name="submit" value="确定" onclick="postCmd('gamecmd','command.php');this.disabled=true;">
\ No newline at end of file
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