Commit 5aeb0772 authored by hisuinohoshi's avatar hisuinohoshi

rev combat phase 3

新增 战斗系统革新 阶段3:

- 追击&鏖战战斗机制:
PVE专属机制,仅会在玩家与NPC对战时触发;
当玩家使用非爆系武器对敌人进行先制攻击,敌人无法反击时,有55%的概率进入追击状态,敌人对玩家作出同样攻击时,则玩家会进入被追击状态;
当玩家对敌人进行攻击,且敌人作出反击,或相反情况时,玩家与敌人有65%概率进入鏖战状态;
在追击/鏖战状态下,玩家在点击战斗结果页面的确认按钮后,会再次跳转到发现敌人的页面,玩家不能通过提交“逃跑”指令以外的方式跳过战斗。在被追击/鏖战的情况下,“逃跑”有概率失败,并会大概率致使玩家被NPC先制攻击;
在追击/鏖战状态下,玩家在提交攻击指令时,会重新判断是否先制攻击。该先制率不受姿态、天气影响,基础为50%。作为追击者的玩家/NPC的先制率提高(10+战场距离*)%;
在追击/鏖战状态下,玩家与NPC会获得一个“战斗回合”计数器,每次在追击/鏖战状态下的战斗都会使战斗回合+1,当玩家与NPC脱离追击/鏖战状态时,计数器会归零;
在追击/鏖战状态下,存在“战场距离”的概念,战场距离等于双方武器射程差值减去当前进行的战斗回合。当战场距离为0时,双方视为短兵相接,基础反击率提升至100%,并会将“追击”转变为“鏖战”状态;

- 副武器:
玩家现在拥有一个副武器槽位,可以在战斗界面即时更换主/副武器;

- 多重属性:
现在同一件装备上带有多个相同的攻击性属性时,可以触发多次相同的属性伤害;

phase 3 土豆:
为追击/鏖战机制添加特殊过滤,指定类型NPC不会应用该机制;增加属性传染性;
parent 496acbff
......@@ -30,7 +30,7 @@ while($apdata = $db->fetch_array($result)) {
$alivedata[$apdata['pid']] = $apdata;
}
$adata = Array();
$adata = Array(); if(!isset($gbmode)) $gbmode = 'none';
if($gamblingon){
global $gshoplist,$credits2_values,$no_self_sponsored,$sponsor_title,$gnpctype,$gnpcsub;
//初始化赌局变量
......@@ -121,7 +121,7 @@ if($gamblingon){
if($gbmode == 'gsponsor')
{
//使用切糕点外卖
if ($gbudata['bitm'] || $gbudata['bnid'] )
if (!empty($gbudata['bitm']) || !empty($gbudata['bnid']) )
{
$gbinfo .= '你派出去的快递员还没回来,耐心等等吧!<br>';
goto gb_result;
......@@ -248,7 +248,7 @@ if($gamblingon){
}
}
}
$adata['innerHTML']['gbinfo'] .= $gbinfo;
$adata['innerHTML']['gbinfo'] = $gbinfo;
}else{
$gbinfo .= $_ERROR['no_login'];
}
......
......@@ -95,7 +95,7 @@ if($hp > 0){
$rmcdtime = $nowmtime >= $cdover ? 0 : $cdover - $nowmtime;
}
//执行动作前,身上存在追击标记时,直接进入追击判定
if(strpos($action,'chase')!==false && $mode !== 'revcombat')
if((strpos($action,'chase')!==false || strpos($action,'dfight')!==false) && $mode !== 'revcombat')
{
$command = 'chase';
goto chase_flag;
......@@ -109,12 +109,12 @@ if($hp > 0){
$mode = 'command';
}else{
//进入指令判断
if(strpos($action,'chase')===false && $mode !== 'combat' && $mode !== 'revcombat' && $mode !== 'corpse' && strpos($action,'pacorpse')===false && $mode !== 'senditem'){
if(strpos($action,'chase')===false && strpos($action,'dfight')===false && $mode !== 'combat' && $mode !== 'revcombat' && $mode !== 'corpse' && strpos($action,'pacorpse')===false && $mode !== 'senditem'){
$action = '';
}
if($command == 'menu') {
$mode = 'command';
$action = '';
//$action = '';
} elseif($mode == 'command') {
if($command == 'move') {
include_once GAME_ROOT.'./include/game/search.func.php';
......@@ -384,6 +384,10 @@ if($hp > 0){
}else{
$log.="<span class='red'>你身上没有背包,或是没有将背包装备上!<br>";
}
} elseif(strpos($command,'changewep') !==false) {
include_once GAME_ROOT.'./include/game/revbattle.func.php';
change_wep_in_battle();
$mode = 'command';
}
} elseif($mode == 'special') {
include_once GAME_ROOT.'./include/game/special.func.php';
......@@ -440,6 +444,8 @@ if($hp > 0){
$enemyid = NULL;
if(strpos($action,'enemy')===0) $enemyid = str_replace('enemy','',$action);
if(strpos($action,'chase')===0) $enemyid = str_replace('chase','',$action);
if(strpos($action,'pchase')===0) $enemyid = str_replace('pchase','',$action);
if(strpos($action,'dfight')===0) $enemyid = str_replace('dfight','',$action);
if(!$enemyid)
{
$log .= "<span class=\"yellow b\">你没有遇到敌人,或已经离开战场!</span>{$enemyid}<br>";
......@@ -463,6 +469,12 @@ if($hp > 0){
$action = 'corpse'.$edata['pid'];
findcorpse($edata);
}
elseif ($command == 'changewep')
{
include_once GAME_ROOT.'./include/game/revbattle.func.php';
change_wep_in_battle();
findenemy_rev($edata);
}
elseif ($command == 'chase')
{
include_once GAME_ROOT.'./include/game/revbattle.func.php';
......@@ -470,15 +482,25 @@ if($hp > 0){
}
elseif ($command == 'back')
{
$log .= "你逃跑了。";
$action = '';
back_flag:
$mode = 'command';
//$log .= "你逃跑了。";
include_once GAME_ROOT . './include/game/revbattle.func.php';
$flag = escape_from_enemy($pdata,$edata);
if($flag)
{
back_flag:
$mode = 'command';
}
else
{
include_once GAME_ROOT . './include/game/revcombat.func.php';
rev_combat_prepare($pdata,$edata,0);
}
}
else
{
if(!empty($message)) $pdata['message'] = $message;
include_once GAME_ROOT . './include/game/revcombat.func.php';
rev_combat_prepare($pdata,$edata,1,$command,$message);
rev_combat_prepare($pdata,$edata,1,$command);
}
} elseif($mode == 'rest') {
include_once GAME_ROOT.'./include/state.func.php';
......
......@@ -105,8 +105,10 @@ if((strpos($action,'corpse')===0 || strpos($action,'pacorpse')===0) && $gamestat
}
}
}
elseif((strpos($action,'chase')!==false)){
$enemyid = str_replace('chase','',$action);
elseif(strpos($action,'chase')!==false || strpos($action,'dfight')!==false){
if(strpos($action,'chase')===0) $enemyid = str_replace('chase','',$action);
if(strpos($action,'pchase')===0) $enemyid = str_replace('pchase','',$action);
if(strpos($action,'dfight')===0) $enemyid = str_replace('dfight','',$action);
$result = $db->query("SELECT * FROM {$tablepre}players WHERE pid='$enemyid' AND hp>0 AND pls='$pls'");
if($db->num_rows($result)>0){
$edata = $db->fetch_array($result);
......
<?php
if(!defined('IN_GAME')) exit('Access Denied');
# 成就登记列表:
$ach_list = Array
(
0 => Array(
# 成就各阶段名称
'name' => Array('永恒世界的住人','幻想世界的往人','永恒的覆唱'),
# 达成阶段成就的头衔奖励
'title' => Array('','幻想','流星'),
# 达成阶段成就的积分奖励
'c1' => Array(0,200,700),
# 达成阶段成就的切糕奖励
'c2' => Array(10,0,0),
),
1 => Array(
'name' => Array('清水池之王'),
'title' => Array('KEY男'),
'c1' => Array(30),
'c2' => Array(16),
),
2 => Array(
'name' => Array('Run With Wolves','Day Game','Thousand Enemies'),
'title' => Array('','二度打','G.D.M'),
'c1' => Array(10,500,0),
'c2' => Array(0,0,200),
),
3 => Array(
),
4 => Array(
),
5 => Array(
),
6 => Array(
),
7 => Array(
),
8 => Array(
),
9 => Array(
),
10 => Array(
),
11 => Array(
),
12 => Array(
),
13 => Array(
),
14 => Array(
),
15 => Array(
),
16 => Array(
),
17 => Array(
),
18 => Array(
),
19 => Array(
),
20 => Array(
),
21 => Array(
),
22 => Array(
),
23 => Array(
),
24 => Array(
),
25 => Array(
),
26 => Array(
),
27 => Array(
),
28 => Array(
),
29 => Array(
),
30 => Array(
),
31 => Array(
),
32 => Array(
),
33 => Array(
),
34 => Array(
),
35 => Array(
),
36 => Array(
),
37 => Array(
),
38 => Array(
),
39 => Array(
),
40 => Array(
),
41 => Array(
),
42 => Array(
),
43 => Array(
),
44 => Array(
),
45 => Array(
),
46 => Array(
),
47 => Array(
),
48 => Array(
),
49 => Array(
),
50 => Array(
),
51 => Array(
),
52 => Array(
),
53 => Array(
),
54 => Array(
),
55 => Array(
),
56 => Array(
),
57 => Array(
),
999 => Array(''),
);
?>
......@@ -19,7 +19,7 @@ $skill_dmg = Array('N' => 0.6, 'P' => 0.6, 'K' => 0.65, 'G' => 0.6, 'C' => 0.4,
//$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',
'P' => 'P', 'N' => 'P',
'K' => 'K',
'G' => 'G', 'J' => 'G',
'C' => 'C',
......
......@@ -2,7 +2,7 @@
/*Game Config*/
//禁区间隔时间,单位 小时
$areahour = 35;
$areahour = 25;
//每次间隔增加的禁区数量
$areaadd = 4;
//聊天记录里的禁区提示时间,单位秒
......@@ -102,6 +102,14 @@ $corpse_obbs = 50;
$active_obbs = 50;
//基础反击率
$counter_obbs = 50;
//(仅PVE触发)基础追击率 (等于0时为不启用追击机制)
$chase_obbs = 55;
//(仅PVE触发)鏖战状态维持率 (等于0时为不启用鏖战机制)
$dfight_obbs = 65;
//(仅PVE触发)追击&鏖战状态默认先制率 (鏖战/追击的基础先制率不受姿态与天气影响)
$chase_active_obbs = 50;
//(仅PVE触发)被追击&鏖战状态下默认逃跑成功率(鏖战/追击的基础先制率不受姿态与天气影响)
$chase_escape_obbs = 50;
//受伤状态的设定
//h-头部受伤,b-身体受伤,a-手腕受伤,f-足部受伤,p-中毒,u-烧伤,i-冻结,e-麻痹
......
......@@ -225,70 +225,75 @@ CREATE TABLE `acbra2_players` (
itmnum smallint unsigned NOT NULL default '0',
itmnumlimit smallint unsigned NOT NULL default '0',
wep char(30) NOT NULL default '',
wepk char(5) not null default '',
wepe mediumint unsigned NOT NULL default '0',
weps char(5) not null default '0',
wepsk char(5) not null default '',
wepk char(40) not null default '',
wepe int(10) unsigned NOT NULL DEFAULT '0',
weps char(10) not null default '0',
wepsk char(40) not null default '',
wep2 char(30) NOT NULL default '',
wep2k char(40) not null default '',
wep2e int(10) unsigned NOT NULL DEFAULT '0',
wep2s char(10) not null default '0',
wep2sk char(40) not null default '',
arb char(30) NOT NULL default '',
arbk char(5) not null default '',
arbe mediumint unsigned NOT NULL default '0',
arbs char(5) not null default '0',
arbsk char(5) not null default '',
arbk char(40) not null default '',
arbe int(10) unsigned NOT NULL DEFAULT '0',
arbs char(10) not null default '0',
arbsk char(40) not null default '',
arh char(30) NOT NULL default '',
arhk char(5) not null default '',
arhe mediumint unsigned NOT NULL default '0',
arhs char(5) not null default '0',
arhsk char(5) not null default '',
arhk char(40) not null default '',
arhe int(10) unsigned NOT NULL DEFAULT '0',
arhs char(10) not null default '0',
arhsk char(40) not null default '',
ara char(30) NOT NULL default '',
arak char(5) not null default '',
arae mediumint unsigned NOT NULL default '0',
aras char(5) not null default '0',
arask char(5) not null default '',
arak char(40) not null default '',
arae int(10) unsigned NOT NULL DEFAULT '0',
aras char(10) not null default '0',
arask char(40) not null default '',
arf char(30) NOT NULL default '',
arfk char(5) not null default '',
arfe mediumint unsigned NOT NULL default '0',
arfs char(5) not null default '0',
arfsk char(5) not null default '',
arfk char(40) not null default '',
arfe int(10) unsigned NOT NULL DEFAULT '0',
arfs char(10) not null default '0',
arfsk char(40) not null default '',
art char(30) NOT NULL default '',
artk char(5) not null default '',
arte mediumint unsigned NOT NULL default '0',
arts char(5) not null default '0',
artsk char(5) not null default '',
artk char(40) not null default '',
arte int(10) unsigned NOT NULL DEFAULT '0',
arts char(10) not null default '0',
artsk char(40) not null default '',
itm0 char(30) NOT NULL default '',
itmk0 char(5) not null default '',
itme0 mediumint unsigned NOT NULL default '0',
itms0 char(5) not null default '0',
itmsk0 char(5) not null default '',
itmk0 char(40) not null default '',
itme0 int(10) unsigned NOT NULL DEFAULT '0',
itms0 char(10) not null default '0',
itmsk0 char(40) not null default '',
itm1 char(30) NOT NULL default '',
itmk1 char(5) not null default '',
itme1 mediumint unsigned NOT NULL default '0',
itms1 char(5) not null default '0',
itmsk1 char(5) not null default '',
itmk1 char(40) not null default '',
itme1 int(10) unsigned NOT NULL DEFAULT '0',
itms1 char(10) not null default '0',
itmsk1 char(40) not null default '',
itm2 char(30) NOT NULL default '',
itmk2 char(5) not null default '',
itme2 mediumint unsigned NOT NULL default '0',
itms2 char(5) not null default '0',
itmsk2 char(5) not null default '',
itmk2 char(40) not null default '',
itme2 int(10) unsigned NOT NULL DEFAULT '0',
itms2 char(10) not null default '0',
itmsk2 char(40) not null default '',
itm3 char(30) NOT NULL default '',
itmk3 char(5) not null default '',
itme3 mediumint unsigned NOT NULL default '0',
itms3 char(5) not null default '0',
itmsk3 char(5) not null default '',
itmk3 char(40) not null default '',
itme3 int(10) unsigned NOT NULL DEFAULT '0',
itms3 char(10) not null default '0',
itmsk3 char(40) not null default '',
itm4 char(30) NOT NULL default '',
itmk4 char(5) not null default '',
itme4 mediumint unsigned NOT NULL default '0',
itms4 char(5) not null default '0',
itmsk4 char(5) not null default '',
itmk4 char(40) not null default '',
itme4 int(10) unsigned NOT NULL DEFAULT '0',
itms4 char(10) not null default '0',
itmsk4 char(40) not null default '',
itm5 char(30) NOT NULL default '',
itmk5 char(5) not null default '',
itme5 mediumint unsigned NOT NULL default '0',
itms5 char(5) not null default '0',
itmsk5 char(5) not null default '',
itmk5 char(40) not null default '',
itme5 int(10) unsigned NOT NULL DEFAULT '0',
itms5 char(10) not null default '0',
itmsk5 char(40) not null default '',
itm6 char(30) NOT NULL default '',
itmk6 char(5) not null default '',
itme6 mediumint unsigned NOT NULL default '0',
itms6 char(5) not null default '0',
itmsk6 char(5) not null default '',
itmk6 char(40) not null default '',
itme6 int(10) unsigned NOT NULL DEFAULT '0',
itms6 char(10) not null default '0',
itmsk6 char(40) not null default '',
flare int(10) NOT NULL default '0',
dcloak int(10) NOT NULL default '0',
auraa int(10) NOT NULL default '0',
......
......@@ -7,7 +7,7 @@ DROP TABLE IF EXISTS bra_players;
CREATE TABLE bra_players (
pid smallint unsigned NOT NULL auto_increment,
type tinyint NOT NULL default '0',
name char(15) NOT NULL default '',
name char(40) not null default '',
pass char(32) NOT NULL default '',
gd char(1) NOT NULL default 'm',
race char(32) NOT NULL default '0',
......@@ -25,22 +25,22 @@ CREATE TABLE bra_players (
skills smallint unsigned NOT NULL default '0',
cdsec int(10) unsigned NOT NULL default '0',
cdmsec smallint(3) unsigned NOT NULL default '0',
cdtime mediumint unsigned NOT NULL default '0',
cdtime int(10) unsigned NOT NULL DEFAULT '0',
action char(12) NOT NULL default '',
hp mediumint unsigned NOT NULL default '0',
mhp mediumint unsigned NOT NULL default '0',
sp mediumint unsigned NOT NULL default '0',
msp mediumint unsigned NOT NULL default '0',
ss mediumint unsigned NOT NULL default '0',
mss mediumint unsigned NOT NULL default '0',
att mediumint unsigned NOT NULL default '0',
def mediumint unsigned NOT NULL default '0',
hp int(10) unsigned NOT NULL DEFAULT '0',
mhp int(10) unsigned NOT NULL DEFAULT '0',
sp int(10) unsigned NOT NULL DEFAULT '0',
msp int(10) unsigned NOT NULL DEFAULT '0',
ss int(10) unsigned NOT NULL DEFAULT '0',
mss int(10) unsigned NOT NULL DEFAULT '0',
att int(10) unsigned NOT NULL DEFAULT '0',
def int(10) unsigned NOT NULL DEFAULT '0',
pgroup tinyint unsigned NOT NULL DEFAULT '0',
pls tinyint unsigned NOT NULL default '0',
lvl tinyint unsigned NOT NULL default '0',
`exp` smallint unsigned NOT NULL default '0',
money mediumint unsigned NOT NULL default '0',
rp mediumint unsigned NOT NULL default '0',
money int(10) unsigned NOT NULL DEFAULT '0',
rp int(10) unsigned NOT NULL DEFAULT '0',
bid smallint unsigned NOT NULL default '0',
`inf` char(10) not null default '',
rage tinyint unsigned NOT NULL default '0',
......@@ -54,77 +54,82 @@ CREATE TABLE bra_players (
`wc` smallint unsigned not null default '0',
`wd` smallint unsigned not null default '0',
`wf` smallint unsigned not null default '0',
`teamID` char(15) not null default '',
`teamPass` char(15) not null default '',
`teamID` char(40) not null default '',
`teamPass` char(40) not null default '',
getitem text NOT NULL default '',
itembag text NOT NULL default '',
itmnum smallint unsigned NOT NULL default '0',
itmnumlimit smallint unsigned NOT NULL default '0',
wep char(250) NOT NULL default '',
wepk char(5) not null default '',
wepe mediumint unsigned NOT NULL default '0',
weps char(5) not null default '0',
wepsk char(5) not null default '',
arb char(250) NOT NULL default '',
arbk char(5) not null default '',
arbe mediumint unsigned NOT NULL default '0',
arbs char(5) not null default '0',
arbsk char(5) not null default '',
arh char(250) NOT NULL default '',
arhk char(5) not null default '',
arhe mediumint unsigned NOT NULL default '0',
arhs char(5) not null default '0',
arhsk char(5) not null default '',
ara char(250) NOT NULL default '',
arak char(5) not null default '',
arae mediumint unsigned NOT NULL default '0',
aras char(5) not null default '0',
arask char(5) not null default '',
arf char(250) NOT NULL default '',
arfk char(5) not null default '',
arfe mediumint unsigned NOT NULL default '0',
arfs char(5) not null default '0',
arfsk char(5) not null default '',
art char(250) NOT NULL default '',
artk char(5) not null default '',
arte mediumint unsigned NOT NULL default '0',
arts char(5) not null default '0',
artsk char(5) not null default '',
itm0 char(250) NOT NULL default '',
itmk0 char(5) not null default '',
itme0 mediumint unsigned NOT NULL default '0',
itms0 char(5) not null default '0',
itmsk0 char(5) not null default '',
itm1 char(250) NOT NULL default '',
itmk1 char(5) not null default '',
itme1 mediumint unsigned NOT NULL default '0',
itms1 char(5) not null default '0',
itmsk1 char(5) not null default '',
itm2 char(250) NOT NULL default '',
itmk2 char(5) not null default '',
itme2 mediumint unsigned NOT NULL default '0',
itms2 char(5) not null default '0',
itmsk2 char(5) not null default '',
itm3 char(250) NOT NULL default '',
itmk3 char(5) not null default '',
itme3 mediumint unsigned NOT NULL default '0',
itms3 char(5) not null default '0',
itmsk3 char(5) not null default '',
itm4 char(250) NOT NULL default '',
itmk4 char(5) not null default '',
itme4 mediumint unsigned NOT NULL default '0',
itms4 char(5) not null default '0',
itmsk4 char(5) not null default '',
itm5 char(250) NOT NULL default '',
itmk5 char(5) not null default '',
itme5 mediumint unsigned NOT NULL default '0',
itms5 char(5) not null default '0',
itmsk5 char(5) not null default '',
itm6 char(250) NOT NULL default '',
itmk6 char(5) not null default '',
itme6 mediumint unsigned NOT NULL default '0',
itms6 char(5) not null default '0',
itmsk6 char(5) not null default '',
wep char(30) NOT NULL default '',
wepk char(40) not null default '',
wepe int(10) unsigned NOT NULL DEFAULT '0',
weps char(10) not null default '0',
wepsk char(40) not null default '',
wep2 char(30) NOT NULL default '',
wep2k char(40) not null default '',
wep2e int(10) unsigned NOT NULL DEFAULT '0',
wep2s char(10) not null default '0',
wep2sk char(40) not null default '',
arb char(30) NOT NULL default '',
arbk char(40) not null default '',
arbe int(10) unsigned NOT NULL DEFAULT '0',
arbs char(10) not null default '0',
arbsk char(40) not null default '',
arh char(30) NOT NULL default '',
arhk char(40) not null default '',
arhe int(10) unsigned NOT NULL DEFAULT '0',
arhs char(10) not null default '0',
arhsk char(40) not null default '',
ara char(30) NOT NULL default '',
arak char(40) not null default '',
arae int(10) unsigned NOT NULL DEFAULT '0',
aras char(10) not null default '0',
arask char(40) not null default '',
arf char(30) NOT NULL default '',
arfk char(40) not null default '',
arfe int(10) unsigned NOT NULL DEFAULT '0',
arfs char(10) not null default '0',
arfsk char(40) not null default '',
art char(30) NOT NULL default '',
artk char(40) not null default '',
arte int(10) unsigned NOT NULL DEFAULT '0',
arts char(10) not null default '0',
artsk char(40) not null default '',
itm0 char(30) NOT NULL default '',
itmk0 char(40) not null default '',
itme0 int(10) unsigned NOT NULL DEFAULT '0',
itms0 char(10) not null default '0',
itmsk0 char(40) not null default '',
itm1 char(30) NOT NULL default '',
itmk1 char(40) not null default '',
itme1 int(10) unsigned NOT NULL DEFAULT '0',
itms1 char(10) not null default '0',
itmsk1 char(40) not null default '',
itm2 char(30) NOT NULL default '',
itmk2 char(40) not null default '',
itme2 int(10) unsigned NOT NULL DEFAULT '0',
itms2 char(10) not null default '0',
itmsk2 char(40) not null default '',
itm3 char(30) NOT NULL default '',
itmk3 char(40) not null default '',
itme3 int(10) unsigned NOT NULL DEFAULT '0',
itms3 char(10) not null default '0',
itmsk3 char(40) not null default '',
itm4 char(30) NOT NULL default '',
itmk4 char(40) not null default '',
itme4 int(10) unsigned NOT NULL DEFAULT '0',
itms4 char(10) not null default '0',
itmsk4 char(40) not null default '',
itm5 char(30) NOT NULL default '',
itmk5 char(40) not null default '',
itme5 int(10) unsigned NOT NULL DEFAULT '0',
itms5 char(10) not null default '0',
itmsk5 char(40) not null default '',
itm6 char(30) NOT NULL default '',
itmk6 char(40) not null default '',
itme6 int(10) unsigned NOT NULL DEFAULT '0',
itms6 char(10) not null default '0',
itmsk6 char(40) not null default '',
flare int(10) NOT NULL default '0',
dcloak int(10) NOT NULL default '0',
auraa int(10) NOT NULL default '0',
......@@ -153,12 +158,12 @@ CREATE TABLE bra_players (
nikstatusc int(10) NOT NULL default '0',
nikstatusd int(10) NOT NULL default '0',
nikstatuse int(10) NOT NULL default '0',
element0 mediumint unsigned NOT NULL default '0',
element1 mediumint unsigned NOT NULL default '0',
element2 mediumint unsigned NOT NULL default '0',
element3 mediumint unsigned NOT NULL default '0',
element4 mediumint unsigned NOT NULL default '0',
element5 mediumint unsigned NOT NULL default '0',
element0 int(10) unsigned NOT NULL DEFAULT '0',
element1 int(10) unsigned NOT NULL DEFAULT '0',
element2 int(10) unsigned NOT NULL DEFAULT '0',
element3 int(10) unsigned NOT NULL DEFAULT '0',
element4 int(10) unsigned NOT NULL DEFAULT '0',
element5 int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (pid),
INDEX TYPE (type, sNo),
......
......@@ -52,9 +52,91 @@ if(!$db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}winners ADD mss s
$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");
//以下内容均为chatGPT生成,让我们对新时代的赛博苦力致以敬意:
$db->query("ALTER TABLE {$tablepre}winners MODIFY wep char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY wepk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY wepe int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY weps char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY wepsk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arb char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arbk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arbe int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arbs char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arbsk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arh char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arhk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arhe int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arhs char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arhsk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY ara char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arak char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arae int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY aras char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arask char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arf char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arfk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arfe int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arfs char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arfsk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY art char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY artk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arte int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY arts char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY artsk char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itm0 char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmk0 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itme0 int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itms0 char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmsk0 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itm1 char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmk1 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itme1 int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itms1 char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmsk1 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itm2 char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmk2 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itme2 int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itms2 char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmsk2 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itm3 char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmk3 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itme3 int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itms3 char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmsk3 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itm4 char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmk4 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itme4 int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itms4 char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmsk4 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itm5 char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmk5 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itme5 int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itms5 char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmsk5 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itm6 char(30) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmk6 char(40) NOT NULL default ''");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itme6 int(10) unsigned NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itms6 char(10) NOT NULL DEFAULT '0'");
$db->query("ALTER TABLE {$tablepre}winners MODIFY itmsk6 char(40) NOT NULL default ''");
//user表结构变动
$result = $db->query("DESCRIBE {$tablepre}users volume");
if($db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}users DROP volume");
$result = $db->query("DESCRIBE {$tablepre}users achrev");
if(!$db->num_rows($result)) $db->query("ALTER TABLE {$tablepre}users ADD achrev text NOT NULL default '' AFTER achievement");
//game表结构变动
$db->query("ALTER TABLE {$tablepre}game DROP gamevars");
......
......@@ -47,24 +47,8 @@
function get_wep_range(&$pa)
{
global $rangeinfo;
$range = isset($rangeinfo[$pa['wep_kind']]) ? $rangeinfo[$pa['wep_kind']] : -1;
return $range;
}
//获取战斗轮次:仅供追击/鏖战机制使用
function get_battle_turns(&$pa,&$pd,$active)
{
$turns = $pa['clbpara']['battle_turns'] == $pd['clbpara']['battle_turns'] ? $pa['clbpara']['battle_turns'] : max($pa['clbpara']['battle_turns'],$pd['clbpara']['battle_turns']);
return $turns;
}
//计算战场距离:仅供追击/鏖战机制使用
function get_battle_range(&$pa,&$pd,$active)
{
//战场距离 = (双方射程差值 - 战斗回合数) * 10
$range = abs($pa['wep_range'] - $pd['wep_range']);
$turns = get_battle_turns($pa,$pd,$active);
$range = max(0,$range-$turns);
if(empty($pa['wep_kind'])) $pa['wep_kind'] = get_wep_kind($pa);
$range = isset($rangeinfo[$pa['wep_kind']]) ? $rangeinfo[$pa['wep_kind']] : NULL;
return $range;
}
......@@ -706,7 +690,7 @@
$sp_cost_max = $sp_cost_r*$pa['wepe'];
//获取实际消耗体力:
$sp_cost = min($sp_cost_max,$pa['sp']-1);
$log_sp_cost = round($sp_cost);
$log_sp_cost = ceil($sp_cost);
$log .= "消耗{$log_sp_cost}点体力,";
}
else
......@@ -717,7 +701,7 @@
$factor = $pa['type'] ? 0.5 : 0.5+round(($sp_cost/$sp_cost_max)/2,1);
//获取伤害变化倍率并扣除体力
$dmg_p[]= round($factor,2);
$pa['sp'] -= $sp_cost;
if(isset($log_sp_cost)) $pa['sp'] -= $log_sp_cost;
//输出log
$f = round ( 100 * $factor );
$log .= "发挥了灵力武器{$f}%的威力!<br>";
......@@ -932,12 +916,12 @@
{
global $ex_attack;
$ex_keys =Array();
foreach($ex_attack as $ex)
foreach($pa['ex_keys'] as $ex)
{
if(in_array($ex,$pa['ex_keys']))
if(in_array($ex,$ex_attack))
{
//去除该条件后不会过滤重复属性 即可以造成多次同属性伤害
if(!in_array($ex,$ex_keys)) $ex_keys[]= $ex;
//把$ex_attack和$pa['ex_keys']位置调换可过滤重复属性,现在不会过滤
$ex_keys[]= $ex;
}
}
return $ex_keys;
......@@ -1266,7 +1250,54 @@
return 0;
}
//判断pd是否满足反击pa的基础条件(姿态)
//获取pa对pd的先制攻击概率,
// $mode 0-标准战斗 1-鏖战 2-追击(追击&鏖战基础先制率不受天气姿态影响)
function get_active_r_rev(&$pa,&$pd,$mode=0)
{
global $active_obbs,$weather,$gamecfg,$chase_active_obbs;
include config('combatcfg',$gamecfg);
if(!$mode)
{
# 获取基础先攻率:
$active_r = $active_obbs;
# 计算天气对先攻率的修正:
$wth_ar = $weather_active_r[$weather] ?: 0;
# 计算pa姿态对于先攻率的修正:
$a_pose_ar = $pose_active_modifier[$pa['pose']] ?: 0;
# 计算pd姿态对于先攻率的修正:
$d_pose_ar = $pose_active_modifier[$pd['pose']] ?: 0;
# 基础汇总:
$active_r += $wth_ar + $a_pose_ar - $d_pose_ar;
}
else
{
$active_r = $chase_active_obbs;
# 计算追击状态下pa对pd的先攻加成。默认:战场距离*10%
if($mode == 2) $range_ar += get_battle_range($pa,$pd,1) * 10;
}
# 计算pa身上的异常状态对先攻率的修正:(pd身上的异常状态不会影响pa的先制率,这个机制以后考虑改掉)
$inf_ar = 1;
if(!empty($pa['inf']))
{
foreach ($inf_active_p as $inf_ky => $value)
{
if(strpos($pa['inf'], $inf_ky)!==false){$inf_ar *= $value;}
}
}
# 计算社团技能对于先攻率的修正:
include_once GAME_ROOT.'./include/game/clubskills.func.php';
$clbskill_ar = 1;
$clbskill_ar *= get_clubskill_bonus_active($pa['club'],$pa['skills'],$pd['club'],$pd['skills']);
# 修正汇总:
$active_r = round($active_r * $clbskill_ar * $inf_ar);
# 计算先攻率上下限:
$active_r = max(min($active_r,96),4);
//echo 'active:'.$active_r.' <br>';
return $active_r;
}
// 判断pd是否满足反击pa的基础条件(最高优先级)
function check_can_counter(&$pa,&$pd,$active)
{
# 治疗姿态、哨戒姿态、躲避策略不能反击
......@@ -1275,14 +1306,16 @@
return 1;
}
//判断pa是否处于pd的反击射程内
// 判断pa是否处于pd的反击射程内(次优先级)
function check_in_counter_range(&$pa,&$pd,$active)
{
if($pd['wep_range'] >= $pa['wep_range'] && $pa['wep_range'] != 0) return 1;
if(!empty($pa['wep_range']) && $pd['wep_range'] >= $pa['wep_range']) return 1;
# 鏖战状态下无视射程反击(爆系武器除外)
if((isset($pd['is_dfight']) || isset($pa['is_dfight'])) && !empty($pd['wep_range'])) return 1;
return 0;
}
//获取pd成功对pa发起反击的概率
// 获取pd成功对pa发起反击的概率
function get_counter_rev(&$pa,&$pd,$active)
{
global $counter_obbs,$inf_counter_p,$pose_counter_modifier,$tactic_counter_modifier;
......@@ -1301,6 +1334,9 @@
$counter = max(8,$counter);
}
# 鏖战状态下,将基础反击率修正为100
if(isset($pd['is_dfight']) || isset($pa['is_dfight'])) $counter = 100;
# 获取社团技能对反击率的修正
$counter *= rev_get_clubskill_bonus_counter($pd['club'],$pd['skills'],$pd,$pa['club'],$pa['skills'],$pa);
......@@ -1317,4 +1353,58 @@
return $counter;
}
//计算战场距离:仅供追击/鏖战机制使用
function get_battle_range(&$pa,&$pd,$active)
{
//战场距离 = (双方射程差值 - 战斗回合数) * 10
if(!isset($pa['wep_range'])) $pa['wep_range'] = get_wep_range($pa);
if(!isset($pd['wep_range'])) $pd['wep_range'] = get_wep_range($pd);
$range = abs($pa['wep_range'] - $pd['wep_range']);
$turns = get_battle_turns($pa,$pd,$active);
$range = max(0,$range-$turns);
return $range;
}
//获取战斗轮次:仅供追击/鏖战机制使用
function get_battle_turns(&$pa,&$pd,$active)
{
if(!isset($pa['clbpara']['battle_turns']) || !isset($pd['clbpara']['battle_turns']))
{
change_battle_turns($pa,$pd,$active);
}
# 如果敌我双方记录的战斗轮次不同步,选择其中更小的一方……这是因为逃跑时可能不会重置NPC的战斗轮次。
# 或许本来也不用重置NPC的战斗轮次……?
$turns = $pa['clbpara']['battle_turns'] == $pd['clbpara']['battle_turns'] ? $pa['clbpara']['battle_turns'] : min($pa['clbpara']['battle_turns'],$pd['clbpara']['battle_turns']);
return $turns;
}
//战斗轮步进
function change_battle_turns(&$pa,&$pd,$active)
{
if(!isset($pa['clbpara']['battle_turns']))
{
$pa['clbpara']['battle_turns'] = 0;
}
else
{
$pa['clbpara']['battle_turns'] ++;
}
if(!isset($pd['clbpara']['battle_turns']))
{
$pd['clbpara']['battle_turns'] = 0;
}
else
{
$pd['clbpara']['battle_turns'] ++;
}
return;
}
//重置战斗回合
function rs_battle_turns(&$pa,&$pd)
{
if(isset($pa['clbpara']['battle_turns'])) unset($pa['clbpara']['battle_turns']);
if(isset($pd['clbpara']['battle_turns'])) unset($pd['clbpara']['battle_turns']);
return;
}
?>
\ No newline at end of file
......@@ -4,41 +4,72 @@
exit('Access Denied');
}
//获取pa对pd的先制攻击概率
function get_active_r_rev(&$pa,&$pd)
//战斗中切换武器
function change_wep_in_battle($s=2)
{
global $active_obbs,$weather,$gamecfg;
include config('combatcfg',$gamecfg);
# 获取基础先攻率:
$active_r = $active_obbs;
# 计算天气对先攻率的修正:
$wth_ar = $weather_active_r[$weather] ?: 0;
# 计算pa姿态对于先攻率的修正:
$a_pose_ar = $pose_active_modifier[$pa['pose']] ?: 0;
# 计算pd姿态对于先攻率的修正:
$d_pose_ar = $pose_active_modifier[$pd['pose']] ?: 0;
# 基础汇总:
$active_r += $wth_ar + $a_pose_ar - $d_pose_ar;
# 计算pa身上的异常状态对先攻率的修正:(pd身上的异常状态不会影响pa的先制率,这个机制以后考虑改掉)
$inf_ar = 1;
if(!empty($pa['inf']))
global $log,$nosta;
global $wep,$wepk,$wepe,$weps,$wepsk;
global $wep2,$wep2k,$wep2e,$wep2s,$wep2sk;
# 初始化主武器名
$eqp = 'wep';
# 初始化副武器名
$seqp = 'wep'.$s;
$seqpk = $seqp.'k';
$seqpe = $seqp.'e';
$seqps = $seqp.'s';
$seqpsk = $seqp.'sk';
# 保存副武器数据
$swep=${$seqp}; $swepk=${$seqpk};
$swepe=${$seqpe}; $sweps=${$seqps}; $swepsk=${$seqpsk};
# 主武器为空、副武器不为空的情况下,直接替换为副武器
if(($wepk == 'WN' || !$weps) && ($swepk != 'WN'))
{
foreach ($inf_active_p as $inf_ky => $value)
${$eqp} = $swep; ${$seqp} = '拳头';
${$eqp.'k'} = $swepk; ${$seqpk} = 'WN';
${$eqp.'e'} = $swepe; ${$seqpe} = 0;
${$eqp.'s'} = $sweps; ${$seqps} = $nosta;
${$eqp.'sk'} = $swepsk; ${$seqpsk} = '';
$log.="你将{$wep}拿在了手上。<br>";
}
# 主武器不为空的情况下,副武器替换为主武器
elseif($wepk != 'WN')
{
${$seqp} = ${$eqp}; ${$eqp} = $swep;
${$seqpk} = ${$eqp.'k'}; ${$eqp.'k'} = $swepk;
${$seqpe} = ${$eqp.'e'}; ${$eqp.'e'} = $swepe;
${$seqps} = ${$eqp.'s'}; ${$eqp.'s'} = $sweps;
${$seqpsk} = ${$eqp.'sk'}; ${$eqp.'sk'} = $swepsk;
$log.="你将{$wep2}收了起来";
if($wepk != 'WN') $log .=",将{$wep}拿在了手上";
$log.="。<br>";
}
else
{
$log.="你没有装备副武器!去给自己找一个吧!<br>";
}
return;
}
//战斗中逃跑
function escape_from_enemy(&$pa,&$pd)
{
global $action,$clbpara,$chase_escape_obbs,$log;
include_once GAME_ROOT.'./include/game/dice.func.php';
# 在受追击/鏖战状态下逃跑有概率失败
if(strpos($action,'pchase')===0 || strpos($action,'dfight')===0)
{
$escape_dice = diceroll(99);
if($escape_dice < $chase_escape_obbs)
{
if(strpos($pa['inf'], $inf_ky)!==false){$inf_ar *= $value;}
$log .= "你尝试逃跑,但是敌人在你身后紧追不舍!<br>";
$pa['fail_escape'] = 1;
return 0;
}
}
# 计算社团技能对于先攻率的修正:
include_once GAME_ROOT.'./include/game/clubskills.func.php';
$clbskill_ar = 1;
$clbskill_ar *= get_clubskill_bonus_active($pa['club'],$pa['skills'],$pd['club'],$pd['skills']);
# 修正汇总:
$active_r = round($active_r * $clbskill_ar * $inf_ar);
# 计算先攻率上下限:
$active_r = max(min($active_r,96),4);
//echo 'active:'.$active_r.' <br>';
return $active_r;
$log .= "你逃跑了。";
$action = '';
unset($clbpara['battle_turns']);
return 1;
}
//发现敌人
......@@ -61,7 +92,7 @@
//初始化界面与log
$battle_title = init_battle_title($sdata,$edata);
$log .= init_battle_log($sdata,$edata);
if(strpos($sdata['action'],'chase')!==false) init_rev_battle(1);
if(strpos($sdata['action'],'chase')!==false || strpos($sdata['action'],'dfight')!==false) init_rev_battle(1);
else init_rev_battle();
//检查是敌对或中立单位
......@@ -143,9 +174,13 @@
{
if(strpos($pa['action'],'chase')!==false)
{
if(strpos($pa['action'],'pchase')!==false) $title = '陷入鏖战';
if(strpos($pa['action'],'pchase')!==false) $title = '遭到追击';
else $title = '乘胜追击';
}
if(strpos($pa['action'],'dfight')!==false)
{
$title = '陷入鏖战';
}
else
{
$title = '发现敌人';
......@@ -167,6 +202,10 @@
$battle_log = "你再度锁定了<span class=\"red\">{$pd['name']}</span>!<br>";
}
}
elseif(strpos($pa['action'],'dfight')!==false)
{
$battle_log = "你与<span class=\"red\">{$pd['name']}</span>相互对峙着!<br>";
}
else
{
if($pd['pose'] == 7)
......
......@@ -9,11 +9,107 @@
include_once GAME_ROOT.'./include/game/combat.func.php';
include_once GAME_ROOT.'./include/game/titles.func.php';
// 判断追击/鏖战/协战机制下双方的先制顺序、并注册对应状态
// *追击先制率补正:原始先制率+(战场距离x10)%
function check_revcombat_status(&$pa,&$pd,$active)
{
# 初始化先攻参数
$active_r = 0;
$active_dice = diceroll(99);
# 计算战场距离
$range = get_battle_range($pa,$pd,$active);
# pa或pd身上存在鏖战标记、或战场距离为0
if(strpos($pa['action'],'dfight')===0 || strpos($pd['action'],'dfight')===0 || !$range)
{
# 添加鏖战状态
$pa['is_dfight'] = $pd['is_dfight'] = 1;
# 获取鏖战状态下pa对pd的先制率
$active_r = get_active_r_rev($pa,$pd,1);
# 如果pa身上存在逃跑失败的标记,则pa先制率降低50……这是偷懒行为,未来的你记得改掉
if(isset($pa['fail_escape'])) $active_r -= 50;
# 判断是否先制
$active = $active_dice < $active_r ? 1 : 0 ;
}
# pa为玩家,身上存在追击标记 或 pd为玩家,身上存在受追击标记
elseif(strpos($pa['action'],'chase')===0 || strpos($pd['action'],'pchase')===0)
{
# 添加追击状态
$pa['is_chase'] = 1; $pd['is_pchase'] = 1;
# 获取追击状态下pa对pd的先制率
$active_r = get_active_r_rev($pa,$pd,2);
# 如果pd身上存在逃跑失败的标记,则pa先制率提升50
if(isset($pd['fail_escape'])) $active_r += 50;
# 判断是否先制
$active = $active_dice < $active_r ? 1 : 0 ;
# pa先制失败,双方转入鏖战状态
if(!$active)
{
unset($pa['is_chase']);unset($pd['is_pchase']);
$pa['is_dfight'] = $pd['is_dfight'] = 1;
}
}
# 清除双方标记
$pa['action'] = $pd['action'] = '';
# 返回先制值
return $active;
}
// 判断是否转入追击/鏖战流程
function check_can_chase(&$pa,&$pd,$active)
{
global $chase_obbs,$dfight_obbs,$log;
$chase_flag = 0;
$dice = diceroll(99);
# 进攻方(pa)或防守方(pd)已存在鏖战标记、或防守方(pd)成功反击了进攻方(pa)的攻击,检查是否维持&转入鏖战状态
if((isset($pa['is_dfight']) || isset($pd['is_dfight']) || isset($pd['is_counter'])))
{
if($dice < $dfight_obbs)
{
# 满足鏖战条件,检查pa是玩家还是NPC,并赋予对应标记
if($active) $pa['action'] = 'dfight'.$pd['pid'];
else $pd['action'] = 'dfight'.$pa['pid'];
$chase_flag = 1;
$log.= "<span class='red'>{$pa['nm']}{$pd['nm']}相互对峙着!</span><br>";
}
else
{
$log.= "<span class='grey'>{$pd['nm']}{$pa['nm']}的视野里消失了。</span><br>";
}
}
# 进攻方(pa)持有非爆武器,且防守方(pd)未能及时反击,检查是否触发追击
if(!$chase_flag && !empty($pa['wep_range']) && isset($pd['cannot_counter']))
{
if($dice < $dfight_obbs)
{
# 满足追击条件,检查pa是玩家还是NPC,并赋予对应标记
if($active) $pa['action'] = 'chase'.$pd['pid'];
else $pd['action'] = 'pchase'.$pa['pid'];
$chase_flag = 1;
$log.= "<span class='red'>但是{$pa['nm']}紧紧跟在{$pd['nm']}身后!</span><br>";
}
else
{
$log.= "<span class='grey'>{$pd['nm']}{$pa['nm']}的视野里消失了。</span><br>";
}
}
if($chase_flag)
{
# 满足追击/鏖战条件,判定战斗轮次步进
change_battle_turns($pa,$pd,$active);
}
else
{
# 不满足追击/鏖战条件,重置战斗轮次
rs_battle_turns($pa,$pd);
}
return;
}
# 战斗准备流程:
# pa、pd分别代表先制发现者与被先制发现者;
# active用于判断当前的主视角(玩家、战斗界面下方那一栏)对应pa还是pd;
# actvie=1代表主视角是pa,否则主视角是pd;
function rev_combat_prepare($pa,$pd,$active,$wep_kind='',$msg='',$log_print=1)
function rev_combat_prepare($pa,$pd,$active,$wep_kind='',$log_print=1)
{
global $db,$tablepre,$log,$mode,$main,$cmd,$battle_title;
......@@ -48,28 +144,58 @@
$main = 'battle_rev';
}
# 加入喊话
if(!empty($msg)) $pa['message'] = $msg;
# 初始化双方的真实攻击方式wep_kind,传入了攻击方式/主动技的情况下,在这里判断传入参数的合法性。
get_wep_kind($pa,$wep_kind);
$pa['wep_range'] = get_wep_range($pa);
get_wep_kind($pd);
$pd['wep_range'] = get_wep_range($pd);
# 进入战斗流程
rev_combat($pa,$pd,$active,$wep_kind,$log_print);
# 传入pa为玩家、pd为NPC,且存在鏖战/追击标志时,判断战斗流程类型(标准/追击/鏖战/协战)
if(!$pa['type'] && $pd['type'] && (strpos($pa['action'],'dfight')!==false || strpos($pa['action'],'chase')!==false))
{
# 玩家正在追击NPC,或两人进入鏖战状态,判定先攻
if(strpos($pa['action'],'chase')===0 || strpos($pa['action'],'dfight')!==false)
{
# 传入参数,第一位为pa(玩家),第二位为pd(NPC),传出active
$active = check_revcombat_status($pa,$pd,$active);
if($active)
rev_combat($pa,$pd,$active,$log_print);
else
rev_combat($pd,$pa,$active,$log_print);
}
# NPC正在追击玩家,判定NPC是否为先攻
else
{
# 传入参数,第一位为pd(NPC),第二位为pa(玩家),传出1-active
$active = check_revcombat_status($pd,$pa,$active);
if($active)
rev_combat($pd,$pa,1-$active,$log_print);
else
rev_combat($pa,$pd,1-$active,$log_print);
}
}
# 进入标准战斗流程
else
{
rev_combat($pa,$pd,$active,$log_print);
}
}
# 战斗流程:
# 注意:无论任何情况,都不要在rev_combat()执行完之前插入return!如果想要跳过战斗阶段,请使用goto battle_finish_flag;
# 如果无论如何都要提前return,请完整执行一遍 #保存双方状态 这一块的内容;
function rev_combat(&$pa,&$pd,$active,$wep_kind='',$log_print=1)
function rev_combat(&$pa,&$pd,$active,$log_print=1)
{
global $db,$tablepre,$now,$mode,$main,$cmd,$log;
global $hdamage,$hplayer;
global $infinfo,$plsinfo,$hplsinfo,$nosta;
global $infinfo,$plsinfo,$hplsinfo,$nosta,$chase_obbs,$dfight_obbs;
# 登记非功能性地点信息时合并隐藏地点
foreach($hplsinfo as $hgroup=>$hpls) $plsinfo += $hpls;
# 登记称谓:之后的流程里已经用不到active了(大概)
$pa['nm'] = (!$pa['type'] && $active) ? '你' : $pa['name'];
$pd['nm'] = (!$pd['type'] && !$active && $pa['nm']!=='你') ? '你' : $pd['name'];
$pa['nm'] = (!$pa['type'] && $active) ? '你' : $pa['name'];
$pd['nm'] = (!$pd['type'] && !$active && $pa['nm']!=='你') ? '你' : $pd['name'];
# 在初始化战斗阶段触发的事件。即:无论是否反击都只会触发1次的事件。如果返回值小于0,则中断战斗。
$cp_flag = combat_prepare_events($pa,$pd,$active);
......@@ -89,12 +215,34 @@
}
else
{
$log .= "{$pa['nm']}向<span class=\"red\">{$pd['nm']}</span>发起了攻击!<br>";
if(isset($pa['is_chase']))
{
$log .= "{$pa['nm']}再度向<span class=\"red\">{$pd['nm']}</span>发起攻击!<br>";
}
elseif(isset($pa['is_dfight']))
{
$log .= "{$pa['nm']}抓住机会抢先向<span class=\"red\">{$pd['nm']}</span>发起攻击!<br>";
}
else
{
$log .= "{$pa['nm']}向<span class=\"red\">{$pd['nm']}</span>发起攻击!<br>";
}
}
}
else
{
$log .= "<span class=\"red\">{$pa['nm']}</span>突然向{$pd['nm']}袭来!<br>";
if(isset($pa['is_chase']))
{
$log .= "<span class=\"red\">{$pa['nm']}</span>再度向{$pd['nm']}袭来!<br>";
}
elseif(isset($pa['is_dfight']))
{
$log .= "但是<span class=\"red\">{$pa['nm']}</span>抢先对{$pd['nm']}发起攻击!<br>";
}
else
{
$log .= "<span class=\"red\">{$pa['nm']}</span>突然向{$pd['nm']}袭来!<br>";
}
}
# 战斗发起者是NPC时
......@@ -104,10 +252,6 @@
//换装判定
npc_changewep_rev($pa,$pd,$active);
}
# 初始化双方的真实攻击方式wep_kind,传入了攻击方式/主动技的情况下,在这里判断传入参数的合法性。
get_wep_kind($pa,$wep_kind);
get_wep_kind($pd);
# 打击流程
# 这里的第一个参数指的是进攻方(造成伤害的一方);第二个参数指的是防守方(承受伤害的一方)。active已经没用了。
......@@ -136,8 +280,6 @@
{
# 反击者是NPC时,进行换装判断
if($pd['type']) npc_changewep_rev($pd,$pa,$active);
# 初始化pa、pd射程:
$pa['wep_range'] = get_wep_range($pa); $pd['wep_range'] = get_wep_range($pd);
if (check_in_counter_range($pa,$pd,$active))
{
# 计算反击率
......@@ -175,12 +317,6 @@
$log .= "<span class=\"red\">{$pd['nm']}转身逃开了!</span><br>";
}
# pd为NPC,且不满足反击条件时,判断pa是否进行追击
/*if(isset($pd['cannot_counter']) && (($pd['type']&&!$pa['type'])||($pa['type']&&!$pd['type'])))
{
$pa['action'] = 'chase'.$pd['pid'];
}*/
# 存在暴毙标识:反击方(pd)在反击过程中未造成伤害就暴毙,可能是因为触发了武器直死。
if(isset($pd['gg_flag']))
{
......@@ -197,6 +333,12 @@
$def_result = rev_combat_result($pd,$pa,1-$active);
}
# 攻击、反击的战斗结果判断均非0时:检查是否触发追击/鏖战事件
if($att_result && (!isset($def_result)||!empty($def_result)) && $chase_obbs && $dfight_obbs)
{
check_can_chase($pa,$pd,$active);
}
# 检查是否更新最高伤害情报
$att_dmg = !empty($att_dmg) ? $att_dmg : 0;
$def_dmg = !empty($def_dmg) ? $def_dmg : 0;
......@@ -286,6 +428,8 @@
# 根据玩家身上的标记($action) 判断接下来要跳转的页面
if(substr($action,0,6)=='corpse')
{
// 清除战斗轮记录
unset($clbpara['battle_turns']);
// 发现尸体
include_once GAME_ROOT . './include/game/battle.func.php';
findcorpse($edata);
......@@ -293,9 +437,16 @@
else
{
// 转入追击状态
if(strpos($action,'chase')!==false) $chase_flag = 1;
if(strpos($action,'chase')!==false || strpos($action,'dfight')!==false)
{
$chase_flag = 1;
}
// 否则脱离战斗状态 清空标记
else $action = '';
else
{
unset($clbpara['battle_turns']);
$action = '';
}
include template('battleresult');
$cmd = ob_get_contents();
ob_clean();
......@@ -989,7 +1140,8 @@
$pa['itme'.$c] = $pa['wepe']; $pa['itms'.$c] = $pa['weps'];
$pa['wep'] = $chosen[1]; $pa['wepk'] = $chosen[2]; $pa['wepe'] = $chosen[3]; $pa['weps'] = $chosen[4]; $pa['wepsk'] = $chosen[5];
$pa['wep_kind'] = get_wep_kind($pa);
$log .= "<span class=\"yellow\">{$pa['nm']}</span>将手中的<span class=\"yellow\">{$oldwep}</span>卸下,装备了<span class=\"yellow\">{$pa['wep']}</span>!<br>";
$pa['wep_range'] = get_wep_range($pa);
$pa['change_wep_log'] = "<span class=\"yellow\">{$pa['nm']}</span>将手中的<span class=\"yellow\">{$oldwep}</span>卸下,装备了<span class=\"yellow\">{$pa['wep']}</span>!<br>";
}
}
return;
......
......@@ -630,6 +630,7 @@ function discover($schmode = 0) {
//if ($active_r>96) $active_r=96;
include_once GAME_ROOT.'./include/game/dice.func.php';
include_once GAME_ROOT.'./include/game/revbattle.func.php';
include_once GAME_ROOT.'./include/game/revattr.func.php';
//获取并保存当前玩家数据
$sdata = current_player_save();
//计算先攻概率
......@@ -637,7 +638,7 @@ function discover($schmode = 0) {
$bid = $edata['pid'];
$active_dice = diceroll(99);
//先制
if($active_dice < $active_r)
if($active_dice < $active_r)
{
$action = 'enemy'.$edata['pid'];
#include_once GAME_ROOT.'./include/game/battle.func.php';
......
......@@ -48,6 +48,14 @@
<td height="20px" class="b2"><span>{lang inf}</span></td>
<td class="b3"><span><!--{if $w_infdata}-->$w_infdata<!--{else}--><!--{/if}--></span></td>
</tr>
<tr>
<td height=20px></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
......
......@@ -48,6 +48,19 @@
<td height="20px" class="b2"><span>{lang inf}</span></td>
<td class="b3"><span><!--{if $w_infdata}-->$w_infdata<!--{else}--><!--{/if}--></span></td>
</tr>
<tr>
<!--{if isset($s_clbpara['battle_turns'])}-->
<td class="b2" height=20px><span>战斗回合</span></td>
<td class="b3"><span>$s_clbpara['battle_turns']</span></td>
<!--{else}-->
<td height=20px></td>
<td></td>
<!--{/if}-->
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
</table>
</td>
</tr>
......
......@@ -8,9 +8,14 @@
</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>
<input type="button" class="cmdbutton" style="width:100" name="w1" value="{$attinfo[$w1]}" onclick="$('command').value='$w1';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{if $s_wep2s}-->
<input type="button" class="cmdbutton" style="padding-left: 5px; width:100" name="w1" value="切换副武器" onclick="$('command').value='changewep';postCmd('gamecmd','command.php');this.disabled=true;">
<!--{/if}-->
<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>
<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}-->
......
......@@ -186,6 +186,7 @@
<TD class=b3>
<!--{if CURSCRIPT == 'game' && $mode == 'command' && $wepe}--><span><input type="button" value="卸下" onclick="$('mode').value='itemmain';$('command').value='offwep';postCmd('gamecmd','command.php');return false;"</span><!--{/if}-->
<span><!--{if $weps}-->$wep_words<!--{else}-->$nowep<!--{/if}--></span>
<span class="eicon" onclick="$('mode').value='itemmain';$('command').value='changewep';postCmd('gamecmd','command.php');return false;">🔃</span>
</TD>
<TD class=b3><span>$wepsk_words</span></TD>
<TD class=b3><span>$wepe</span></TD>
......
......@@ -50,6 +50,10 @@ for ($i=0; $i<$achievement_count; $i++)
{
$cpl[$i]=check_achievement($i,$n);
$prc[$i]=fetch_achievement($i,$n);
//$ncp[$i]['s'] = $cpl[$i];
//$ncp[$i]['v'] = $prc[$i];
}
//$ncp = json_encode($ncp);
//$db->query("UPDATE {$tablepre}users SET achrev='$ncp' WHERE username='$n'" );
include template('user_profile');
......@@ -64,6 +64,7 @@ if($mode == 'enter') {
$icon = $icon ? $icon : rand(1,$iconlimit);
$club = 0;
$wep2 = '拳头'; $wep2k = 'WN'; $wep2e = 0; $wep2s = $nosta; $wep2sk = '';
$arb = $gd == 'm' ? '男生校服' : '女生校服';
$arbk = 'DB'; $arbe = 5; $arbs = 15; $arbsk = '';
$arh = $ara = $arf = $art = '';
......
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