Commit 3a62f679 authored by Nemo Ma's avatar Nemo Ma Committed by GitHub

Merge pull request #78 from hikawiier/waaagh

rev botservice phase 0.33
parents 8e713228 bad47d4c
...@@ -34,6 +34,7 @@ gamedata/banlist.php ...@@ -34,6 +34,7 @@ gamedata/banlist.php
gamedata/clearlog.php gamedata/clearlog.php
gamedata/cache/queue_vnmixitem_1.php gamedata/cache/queue_vnmixitem_1.php
gamedata/cache/vnmixitem_1.php gamedata/cache/vnmixitem_1.php
bot/bot_enable.bat
# DTS Cache Files # DTS Cache Files
gamedata/bak/ gamedata/bak/
......
<?php
require './include/common.inc.php';
require './bot/revbotservice.php';
while (true) {
botservice();
sleep($botcds);
}
?>
\ No newline at end of file
@echo off
PATH=%PATH%;C:\wamp64\bin\php\php7.4.0
php -v
set BOT_CD=2
cd ..
:loop
php bot/revbotservice.php
timeout /t %BOT_CD%
goto loop
\ No newline at end of file
#!/bin/bash #!/bin/bash
BOT_CD=0.5 BOT_CD=2
cd .. cd ..
while true; do while true; do
php bot/revbotservice.php php bot/revbotservice.php
......
<?php
if(!defined('IN_GAME')) {
exit('Access Denied');
}
# bot参数一览
/*
0.['clbpara']['botphase'] : bot阶段 用于判定bot总的行动方针
1.['clbpara']['botact'] :包含bot具体的行为参数
2.['clbpara']['botstf']:记录bot获取过的素材
3.['clbpara']['botmix']:记录bot合成过的道具
*/
# bot在不同阶段的行动目标
$bot_action_phase = Array
(
# 0.探索阶段:刚刚入场,目标是寻找合成素材
0 => Array(
'pose' => 3,
'tactic' => 2,
),
# 1.偷反阶段:攒够合成素材,开始刷兵,会主动移动到有声音或有兵死掉的位置
1 => Array(
'pose' => 4,
'tactic' => 3,
),
# 2.强袭阶段:武器效果到达阈值,开始合成广域主动猎杀场上玩家目标
2 => Array(
'pose' => 2, //小开不算开
'tactic' => 2,
),
# 3.躲避阶段:场上存在其他更强的玩家,进入躲避阶段,不停移动躲避敌人,并把身上的钱全部拿来买雷
3 => Array(
'pose' => 4,
'tactic' => 4,
),
);
# bot在阶段0寻找素材时要前往的地图
$bot_moveto_phase = Array
(
1 => 30,
2 => 21,
3 => 16,
4 => 21,
);
# bot会拾取的道具名白名单(注意:商店购买也算在内)
$bot_can_get_itemlist = Array
(
'治疗针','体力回复药','凸眼鱼','针线包','驱云弹','钉','磨刀石','沉默磨刀石','黑磨刀石','『祝福宝石』','『灵魂宝石』',
);
$bot_stfid = Array
(
0 => Array
(
'增幅设备' => 'r0',
'生命探测器' => 'r1',
'广域生命探测器' => 'r2',
'手机' => 'p1',
'笔记本电脑' => 'p2',
'移动PC' => 'p3',
),
1 => Array
(
'原型武器P' => 'c11',
'实验装甲A' => 'c12',
'小棍棒' => 'c13',
'冰沙' => 'c14',
'御神签' => 'c15',
'《哲♂学》' => 'c16',
'☆金属拳套☆ ' => 'c17',
'★RPG-7★' => 'c19',
),
2 => Array
(
'『风魔激光刃』' => 'c21',
'『祝福宝石』' => 'c22',
),
3 => Array
(
'《小黄的草帽》' => 'c31',
'《小黄的钓鱼竿》' => 'c32',
'《小黄的行军靴》' => 'c33',
'《小黄的收服特训》' => 'c34',
'《小黄的常磐之力》' => 'c35',
),
4 => Array
(
'『连射激光』' => 'c41',
'『高性能子机』' => 'c42',
),
);
$bot_mixid = Array
(
'『T-LINK念动冲拳』' => 'm11',
'Azurewrath' => 'm21',
'《小黄的精灵球》' => 'm31',
'《小黄的超级球》' => 'm32',
'《小黄的大师球》' => 'm33',
);
$bot_player_list = Array
(
'type' => 18,
'bid' => 0,
'inf' => '',
'rage' => 0,
'pose'=> 2,
'tactic' => 3,
'killnum' => 0,
'rp' => 0,
'mhp' => 400,
'msp' => 400,
'att' => 120,
'def' => 120,
'lvl' => 0,
'skill' => 40,
'money' => 50,
'art' => '◆焰火',
'artk' => 'A',
'arte' => 1,
'arts' => 1,
'artsk' => 'H',
'itm1' => '治疗针',
'itmk1' => 'HH',
'itme1' => 100,
'itms1' => 60,
'itm2' => '体力回复药',
'itmk2' => 'HS',
'itme2' => 100,
'itms2' => 60,
'itm6' => '银白盒子',
'itmk6' => 'ps',
'itme6' => 1,
'itms6' => 1,
'sub' => array
(
0 => array
(
'name' => '小黄鸡',
'nick' => '参展者',
'icon' => 0,
'gd' => 'm',
'club' => 2,
'pls' => 21,
'wep' => '『寻星勇者』',
'wepk' => 'WK',
'wepe' => 75,
'weps' => 45,
'wepsk' => 'd',
'arb' => '男生校服',
'arbk' => 'DB',
'arbe' => 15,
'arbs' => 5,
),
1 => array
(
'name' => '小黄鸭',
'nick' => '参展者',
'icon' => 0,
'gd' => 'f',
'club' => 4,
'pls' => 21,
'wep' => '『单向火箭炮』',
'wepk' => 'WG',
'wepe' => 90,
'weps' => 188,
'wepsk' => 'do',
'arb' => '女生校服',
'arbk' => 'DB',
'arbe' => 15,
'arbs' => 5,
),
2 => array
(
'name' => '大白鹅',
'nick' => '参展者',
'icon' => 0,
'gd' => 'f',
'club' => 3,
'pls' => 16,
'wep' => '冰冻青蛙',
'wepk' => 'WC',
'wepe' => 90,
'weps' => 198,
'wepsk' => 'i',
'arb' => '女生校服',
'arbk' => 'DB',
'arbe' => 15,
'arbs' => 5,
),
3 => array
(
'name' => '小鲤鱼',
'nick' => '参展者',
'icon' => 0,
'gd' => 'm',
'club' => 1,
'pls' => 30,
'wep' => '电击鞭',
'wepk' => 'WP',
'wepe' => 64,
'weps' => 32,
'wepsk' => 'e',
'arb' => '男生校服',
'arbk' => 'DB',
'arbe' => 15,
'arbs' => 5,
),
),
);
?>
This diff is collapsed.
<?php <?php
require './include/common.inc.php'; include './include/common.inc.php';
require GAME_ROOT . './include/game.func.php'; include GAME_ROOT.'./include/game.func.php';
require config('combatcfg', $gamecfg); include GAME_ROOT.'./bot/revbot.func.php';
$botname = '测试用脚本狗'; if($gamestate > 10)
$botcds = 0.5; //每0.5秒行动一次 {
if(!empty($gamevars['botplayer']))
$bdata = fetch_playerdata_by_name($botname); {
# bot初始化
if (!$bdata) { $ids = bot_player_valid($gamevars['botplayer']);
echo "bot_not_in_game=1\n"; unset($gamevars['botplayer']);
exit(); $gamevars['botid'] = $ids;
} save_gameinfo();
echo "所有BOT初始化完成,共计:".(count($ids))."个";
if ($gamestate == 0) {
echo "game_ended=1\n";
exit();
}
# 初始化bot上次行动时间
if (empty($bdata['clbpara']['action_flag']['lastact']))
$bdata['clbpara']['action_flag']['lastact'] = $now;
# 初始化bot可行动次数
$action_t = ($now - $bdata['clbpara']['action_flag']['lastact']) / $botcds;
# 初始化bot逻辑判断
while ($action_t > 0 && $bdata['hp'] > 0) {
player_save($bdata);
$bdata = fetch_playerdata_by_name($bdata['name']);
echo "bot开始行动...<br>";
$bdata['clbpara']['action_flag']['lastact'] = $now;
$action_t--;
unset($bmoveto);
# 判定bot是否需要移动:
# bot优先移动到有声音的位置
if ($noisepls && $bdata['pls'] != $noisepls) {
$bmoveto = $noisepls;
}
# 否则检查是否在同一个位置探索超过20次,超过20次则移动到下个位置
elseif ($bdata['pls'] == 0 || $bdata['clbpara']['action_flag']['sctimes'] > 20 || !empty($bdata['clbpara']['action_flag']['needmove'])) {
$bmoveto = rand(1, 31);
}
# 待补完:直接调用move()
if (isset($bmoveto)) {
$bdata['pls'] = $bmoveto;
unset($bdata['clbpara']['action_flag']['sctimes']);
unset($bdata['clbpara']['action_flag']['needmove']);
} }
elseif(!empty($gamevars['botid']))
# 判断是否需要执行探索行为 {
$bsearch = 1; foreach($gamevars['botid'] as $botid)
{
# 待补完:直接调用search() $flag = bot_acts($botid);
if ($bsearch) { if($flag == 0)
echo "bot开始探索...<br>"; {
# bot触发事件(暂不可用) unset($gamevars['botid'][array_search($botid,$gamevars['botid'])]);
$bot_event_obbs = -1; save_gameinfo();
$event_dice = rand(0, 99); if(empty($gamevars['botid'])) break;
if ($event_dice < $event_obbs) {
include_once GAME_ROOT . './include/game/event.func.php';
$event_flag = event();
//触发了事件,中止探索推进
if ($event_flag)
goto action_end_flag;
}
# bot踩雷(暂不可用)
$bot_trap_obbs = -1;
$trap_dice = diceroll(99);
// 计算陷阱“发现率”
if ($trap_dice < $bot_trap_obbs) {
$trapresult = $db->query("SELECT * FROM {$tablepre}maptrap WHERE pls = {$bdata['pls']} ORDER BY itmk DESC");
$trpnum = $db->num_rows($trapresult);
//看地图上有没有陷阱
if ($trpnum) {
include_once GAME_ROOT . './include/game/itemmain.func.php';
$fstrp = $db->fetch_array($trapresult);
//奇迹雷
$xtrpflag = $fstrp['itmk'] == 'TOc' ? true : false;
//计算 或不计算陷阱“触发率”:
$real_trap_obbs = $xtrpflag ? 100 : calc_real_trap_obbs($bdata, $trpnum);
//echo "realtrapobbs = {$real_trap_obbs}<br>";
if ($trap_dice < $real_trap_obbs) {
if (!$xtrpflag) {
$itemno = rand(0, $trpnum - 1);
$db->data_seek($trapresult, $itemno);
$fstrp = $db->fetch_array($trapresult);
}
$bdata['itm0'] = $fstrp['itm'];
$bdata['itmk0'] = $fstrp['itmk'];
$bdata['itme0'] = $fstrp['itme'];
$bdata['itms0'] = $fstrp['itms'];
$bdata['itmsk0'] = $fstrp['itmsk'];
$tid = $fstrp['tid'];
$db->query("DELETE FROM {$tablepre}maptrap WHERE tid='$tid'");
//itemfind();
goto action_end_flag;
}
}
}
# bot遇敌
$bot_schmode_obbs = 75;
include_once GAME_ROOT . './include/game/attr.func.php';
$mode_dice = rand(0, 99);
if ($mode_dice < $bot_schmode_obbs) {
echo "bot进入遇敌判定...<br>";
$result = $db->query("SELECT * FROM {$tablepre}players WHERE pls={$bdata['pls']} AND pid!={$bdata['pid']}");
if (!$db->num_rows($result)) {
echo 'bot发现<span class="yellow">周围一个人都没有</span>,准备离开。<br>';
$bdata['clbpara']['action_flag']['needmove'] = 1;
goto action_end_flag;
}
$enemynum = $db->num_rows($result);
$enemyarray = range(0, $enemynum - 1);
shuffle($enemyarray);
# 计算bot遇敌率 待整合
//$find_r = get_find_r($weather,$pls,$pose,$tactic,$club,$inf);
$b_find_r = 75;
global $enemy_obbs, $corpse_obbs, $corpseprotect;
$find_obbs = $enemy_obbs + $b_find_r;
# 计算bot是否遇敌
$meetman_flag = 0;
include_once GAME_ROOT . './include/game/revattr.func.php';
foreach ($enemyarray as $enum) {
$db->data_seek($result, $enum);
$edata = $db->fetch_array($result);
if (!$edata['type'] || $gamestate < 50) {
if ($edata['hp'] <= 0) {
//直接略过无效尸体
if ($gamestate >= 40 || ($edata['endtime'] > ($now - $corpseprotect)))
continue;
$ret = false;
foreach (array('money', 'arhs', 'aras', 'arfs', 'arts', 'itms1', 'itms2', 'itms3', 'itms4', 'itms5', 'itms6') as $chkval) {
if ($edata[$chkval]) {
$ret = true;
break;
}
}
if (!$ret)
continue;
//计算尸体发现率
$corpse_dice = rand(0, 99);
if ($corpse_dice < $corpse_obbs) {
$meetman_flag = 1;
break;
}
} else {
//直接略过决斗者
global $artk;
if ((!$edata['type']) && ($artk == 'XX') && (($edata['artk'] != 'XX') || ($edata['art'] != $name)) && ($gamestate < 50))
continue;
if (($artk != 'XX') && ($edata['artk'] == 'XX') && ($gamestate < 50))
continue;
//计算活人发现率
$hide_r = get_hide_r_rev($bdata, $edata);
$enemy_dice = diceroll(99);
//echo "hide_r = {$hide_r} | find_obbs = {$find_obbs} | dice = {$enemy_dice}";
$meetman_flag = $enemy_dice < ($find_obbs - $hide_r) ? 1 : -1;
break;
}
}
}
if ($meetman_flag > 0) {
echo "bot已遇敌!<br>";
if ($edata['hp'] > 0) {
# bot发现发现队友或中立单位(暂无效果)
/*if($teamID&&(!$fog)&&($gamestate<40)&&($teamID == $edata['teamID']))
{
$bid = $edata['pid'];
$action = 'team'.$edata['pid'];
include_once GAME_ROOT.'./include/game/battle.func.php';
findteam($edata);
return;
}
//发现中立NPC或友军 TODO:把这里条件判断挪到一个函数里
elseif(isset($edata['clbpara']['post']) && $edata['clbpara']['post'] == $pid)
{
$bid = $edata['pid'];
$action = 'neut'.$edata['pid'];
include_once GAME_ROOT.'./include/game/revbattle.func.php';
findneut($edata,1);
return;
}*/
# bot 发现敌人
include_once GAME_ROOT . './include/game/revbattle.func.php';
include_once GAME_ROOT . './include/game/revcombat.func.php';
//刷新敌人时效性状态
if (!empty($edata['clbpara']['lasttimes']))
$edata = check_skilllasttimes($edata);
//计算先攻概率
$active_r = get_active_r_rev($bdata, $edata);
$active_dice = diceroll(99);
//进入战斗
//先制
if ($active_dice < $active_r) {
$action = 'enemy' . $edata['pid'];
//findenemy_rev($edata);
rev_combat_prepare($bdata, $edata, 1);
}
//挨打
else {
rev_combat_prepare($edata, $bdata, 0);
}
echo $log;
//战斗后刷新bdata数据
$bdata = fetch_playerdata_by_name($bdata['name']);
} else {
# bot发现尸体(暂无操作)
echo "bot发现了{$edata['name']}的尸体。<br>";
//$bdata['action'] = 'corpse'.$edata['pid'];
//include_once GAME_ROOT.'./include/game/battle.func.php';
//findcorpse($edata);
}
} elseif ($meetman_flag < 0) {
echo "bot没有发现敌人,因为敌人隐藏起来了。<br>";
} else {
echo 'bot发现<span class="yellow">周围一个人都没有</span>,准备移动到下一张地图。<br>';
$bdata['clbpara']['action_flag']['needmove'] = 1;
}
goto action_end_flag;
} else {
# bot发现道具判定(暂无)
echo "bot发现了道具...<br>";
//echo "进入道具判定<br>";
/*$find_r = get_find_r($weather,$pls,$pose,$tactic,$club,$inf);
$find_obbs = $item_obbs + $find_r;
$item_dice = rand(0,99);
if($item_dice < $find_obbs) {
$result = $db->query("SELECT * FROM {$tablepre}mapitem WHERE pls = '$pls'");
$itemnum = $db->num_rows($result);
if($itemnum <= 0){
$log .= '<span class="yellow">周围找不到任何物品。</span><br>';
$mode = 'command';
return;
}
$itemno = rand(0,$itemnum-1);
$db->data_seek($result,$itemno);
$mi=$db->fetch_array($result);
global $itm0,$itmk0,$itme0,$itms0,$itmsk0;
$itm0=$mi['itm'];
$itmk0=$mi['itmk'];
$itme0=$mi['itme'];
$itms0=$mi['itms'];
$itmsk0=$mi['itmsk'];
$iid=$mi['iid'];
$db->query("DELETE FROM {$tablepre}mapitem WHERE iid='$iid'");
if($itms0){
include_once GAME_ROOT.'./include/game/itemmain.func.php';
itemfind();
return;
} else {
$log .= "但是什么都没有发现。可能是因为道具有天然呆属性。<br>";
} }
} else { sleep(1);
$log .= "但是什么都没有发现。<br>";
}*/
} }
goto action_end_flag; echo "所有BOT行动完成";
} }
action_end_flag:
player_save($bdata);
$bdata = fetch_playerdata_by_name($bdata['name']);
} }
player_save($bdata);
$bdata = fetch_playerdata_by_name($bdata['name']);
?> ?>
\ No newline at end of file
...@@ -85,6 +85,7 @@ $typeinfo = Array( ...@@ -85,6 +85,7 @@ $typeinfo = Array(
13=>'循环使者', 13=>'循环使者',
14=>'数据碎片', 14=>'数据碎片',
15=>'抹杀使徒', 15=>'抹杀使徒',
18=>'参战者', //bot用
19=>'参战者', //真红暮·蓝凝用 19=>'参战者', //真红暮·蓝凝用
20=>'英雄', 20=>'英雄',
21=>'武神', 21=>'武神',
...@@ -113,6 +114,7 @@ $killmsginfo = Array( ...@@ -113,6 +114,7 @@ $killmsginfo = Array(
12=>'你要反省的事情还有很多。', 12=>'你要反省的事情还有很多。',
14=>'死吧。', 14=>'死吧。',
15=>'………………RIP.', 15=>'………………RIP.',
18=>'你弱爆了!',
19=>'我赢了。', 19=>'我赢了。',
89=>'系统弹出,正在计算补正值……', 89=>'系统弹出,正在计算补正值……',
90=>'你弱爆了!', 90=>'你弱爆了!',
...@@ -216,7 +218,8 @@ $lwinfo = Array( ...@@ -216,7 +218,8 @@ $lwinfo = Array(
'守卫者 静流' => '………………………………?!', '守卫者 静流' => '………………………………?!',
), ),
15 => '………………………………抹杀任务中止,脱出。', 15 => '………………………………抹杀任务中止,脱出。',
20 => '這就是善有善報嗎?', 18 => '怎么会这样呢?',
20 => '怎么会这样呢?',
21 => Array( 21 => Array(
'虚子' => '你做完后,你的心理得到什么样的满足感,你自己清楚!', '虚子' => '你做完后,你的心理得到什么样的满足感,你自己清楚!',
'水月' => '……', '水月' => '……',
......
...@@ -110,6 +110,8 @@ if(CURSCRIPT !== 'chat'){ ...@@ -110,6 +110,8 @@ if(CURSCRIPT !== 'chat'){
//addnews($starttime,'newgame',$gamenum); //addnews($starttime,'newgame',$gamenum);
addnews($starttime,'newgame',$gamenum); addnews($starttime,'newgame',$gamenum);
systemputchat($starttime,'newgame'); systemputchat($starttime,'newgame');
//是否部署BOT -> 数量;
$gamevars['botplayer'] = 1;
$ginfochange = true; $ginfochange = true;
} }
} }
......
...@@ -568,25 +568,25 @@ function fetch_playerdata_by_name($n) ...@@ -568,25 +568,25 @@ function fetch_playerdata_by_name($n)
global $db,$tablepre; global $db,$tablepre;
$result = $db->query("SELECT * FROM {$tablepre}players WHERE name = '$n' AND type = 0"); $result = $db->query("SELECT * FROM {$tablepre}players WHERE name = '$n' AND type = 0");
if(!$db->num_rows($result)) return NULL; if(!$db->num_rows($result)) return NULL;
$pdata = $db->fetch_array($result); $data = $db->fetch_array($result);
if(!empty($pdata['clbpara'])) $pdata['clbpara'] = get_clbpara($pdata['clbpara']); if(!empty($data['clbpara'])) $data['clbpara'] = get_clbpara($data['clbpara']);
//套装效果刷新 //套装效果刷新
include_once GAME_ROOT.'./include/game/itemmain.func.php'; include_once GAME_ROOT.'./include/game/itemmain.func.php';
reload_set_items($pdata); reload_set_items($pdata);
return $pdata; return $data;
} }
//通过pid抓取指定玩家/NPC数据 //通过pid抓取指定玩家/NPC数据
function fetch_playerdata_by_pid($pid) function fetch_playerdata_by_pid($pid)
{ {
global $db,$tablepre; global $db,$tablepre;
$result = $db->query("SELECT pid FROM {$tablepre}players WHERE pid = '$pid'"); $result = $db->query("SELECT * FROM {$tablepre}players WHERE pid = '$pid'");
if(!$db->num_rows($result)) return NULL; if(!$db->num_rows($result)) return NULL;
$pdata = $db->fetch_array($result); $data = $db->fetch_array($result);
if(!empty($pdata['clbpara'])) $pdata['clbpara'] = get_clbpara($pdata['clbpara']); if(!empty($data['clbpara'])) $data['clbpara'] = get_clbpara($data['clbpara']);
//套装效果刷新 //套装效果刷新
include_once GAME_ROOT.'./include/game/itemmain.func.php'; include_once GAME_ROOT.'./include/game/itemmain.func.php';
reload_set_items($pdata); reload_set_items($data);
return $pdata; return $data;
} }
//用于将指定player数据存回数据库 //用于将指定player数据存回数据库
function player_save($data){ function player_save($data){
...@@ -604,6 +604,15 @@ function player_save($data){ ...@@ -604,6 +604,15 @@ function player_save($data){
return; return;
} }
//获取安全地图范围
function get_safe_plslist($mode=1)
{
global $areanum,$arealist,$hack,$deepzones;
$r = $hack ? array_slice($arealist,$areanum+1) : $arealist;
if($mode) $r = array_diff($r, $deepzones);
return $r;
}
function w_save($id){ function w_save($id){
global $db,$tablepre,$w_name,$w_pass,$w_type,$w_endtime,$w_deathtime,$w_gd,$w_sNo,$w_icon,$w_club,$w_hp,$w_mhp,$w_sp,$w_msp,$w_att,$w_def,$w_pls,$w_lvl,$w_exp,$w_money,$w_bid,$w_inf,$w_rage,$w_pose,$w_tactic,$w_killnum,$w_state,$w_wp,$w_wk,$w_wg,$w_wc,$w_wd,$w_wf,$w_teamID,$w_teamPass,$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,$w_rp,$w_action,$w_achievement,$w_skillpoint; global $db,$tablepre,$w_name,$w_pass,$w_type,$w_endtime,$w_deathtime,$w_gd,$w_sNo,$w_icon,$w_club,$w_hp,$w_mhp,$w_sp,$w_msp,$w_att,$w_def,$w_pls,$w_lvl,$w_exp,$w_money,$w_bid,$w_inf,$w_rage,$w_pose,$w_tactic,$w_killnum,$w_state,$w_wp,$w_wk,$w_wg,$w_wc,$w_wd,$w_wf,$w_teamID,$w_teamPass,$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,$w_rp,$w_action,$w_achievement,$w_skillpoint;
......
This diff is collapsed.
This diff is collapsed.
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
} }
# NPC释放战斗技 暂时先重复写一遍,之后合并到一个函数里 # NPC释放战斗技 暂时先重复写一遍,之后合并到一个函数里
if(!$active && $pa['type'] && !empty($pa['clbpara']['skill'])) if($pa['type'] && !empty($pa['clbpara']['skill']))
{ {
# 打乱并遍历pa技能队列 寻找可用战斗技 # 打乱并遍历pa技能队列 寻找可用战斗技
$npc_skill = $pa['clbpara']['skill']; $npc_skill = $pa['clbpara']['skill'];
......
...@@ -412,49 +412,48 @@ ...@@ -412,49 +412,48 @@
//pa是玩家/主视角NPC的情况下 把edata($w_*)发给$pd 把sdata($s_*) 发给$pa //pa是玩家/主视角NPC的情况下 把edata($w_*)发给$pd 把sdata($s_*) 发给$pa
init_battle_rev($pa,$pd,1); init_battle_rev($pa,$pd,1);
player_save($pa); player_save($pd); player_save($pa); player_save($pd);
$edata = $pd; if(!$pa['type']) $sname = $pa['name']; $edata = $pd; if(!$pa['type']) $sdata = $pa;
} }
else else
{ {
//pd是玩家/主视角NPC的情况下 把edata($w_*)发给$pa 把sdata($s_*) 发给$pd //pd是玩家/主视角NPC的情况下 把edata($w_*)发给$pa 把sdata($s_*) 发给$pd
init_battle_rev($pd,$pa,1); init_battle_rev($pd,$pa,1);
player_save($pa); player_save($pd); player_save($pa); player_save($pd);
$edata = $pa; if(!$pd['type']) $sname = $pd['name']; $edata = $pa; if(!$pd['type']) $sdata = $pd;
} }
$main = 'battle_rev'; $main = 'battle_rev';
if(isset($sname)) if(isset($sdata) && $sdata['pass'] != 'bot')
{ {
$pdata = fetch_playerdata_by_name($sname); $pdata = fetch_playerdata_by_name($sdata['name']);
extract($pdata,EXTR_REFS); extract($pdata,EXTR_REFS);
} # 根据玩家身上的标记($action) 判断接下来要跳转的页面
if(substr($action,0,6)=='corpse')
# 根据玩家身上的标记($action) 判断接下来要跳转的页面
if(substr($action,0,6)=='corpse')
{
// 清除战斗轮记录
unset($clbpara['battle_turns']);
// 发现尸体
include_once GAME_ROOT . './include/game/battle.func.php';
findcorpse($edata);
}
else
{
// 转入追击状态
if(strpos($action,'chase')!==false || strpos($action,'dfight')!==false)
{ {
$chase_flag = 1; // 清除战斗轮记录
unset($clbpara['battle_turns']);
// 发现尸体
include_once GAME_ROOT . './include/game/battle.func.php';
findcorpse($edata);
} }
// 否则脱离战斗状态 清空标记 else
else
{ {
unset($clbpara['battle_turns']); // 转入追击状态
$action = ''; if(strpos($action,'chase')!==false || strpos($action,'dfight')!==false)
{
$chase_flag = 1;
}
// 否则脱离战斗状态 清空标记
else
{
unset($clbpara['battle_turns']);
$action = '';
}
include template('battleresult');
$cmd = ob_get_contents();
ob_clean();
} }
include template('battleresult');
$cmd = ob_get_contents();
ob_clean();
} }
return; return;
} }
......
This diff is collapsed.
...@@ -6,10 +6,20 @@ if(!defined('IN_GAME')) { ...@@ -6,10 +6,20 @@ if(!defined('IN_GAME')) {
# TODO: NO GLOBAL # TODO: NO GLOBAL
# resources_1.php # resources_1.php
function get_equip_list() function get_equip_list($mode=0)
{ {
//装备列表 //装备列表
$equip_list = Array('wep','arb','arh','ara','arf','art'); $equip_list = Array('wep','arb','arh','ara','arf','art');
$equip_list2 = Array
(
'W' => 'wep',
'DB' => 'arb',
'DH' => 'arh',
'DA' => 'ara',
'DF' => 'arf',
'A' => 'art',
);
if($mode) return $equip_list2;
return $equip_list; return $equip_list;
} }
......
...@@ -4,9 +4,19 @@ if (! defined ( 'IN_GAME' )) { ...@@ -4,9 +4,19 @@ if (! defined ( 'IN_GAME' )) {
exit ( 'Access Denied' ); exit ( 'Access Denied' );
} }
function death($death, $kname = '', $ktype = 0, $annex = '') { function death($death, $kname = '', $ktype = 0, $annex = '',&$data=NULL)
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; //global $name, $state, $deathtime, $type, $lvl, $bid, $hp, $mhp, $wp, $wk, $wg, $wc, $wd, $wf, $sp, $msp, $club, $pls , $nick;
global $now, $db, $tablepre, $alivenum, $deathnum, $killmsginfo, $typeinfo, $weather;
if(!isset($data))
{
global $pdata;
$data = &$pdata;
}
extract($data,EXTR_REFS);
if (! $death) { if (! $death) {
return; return;
} }
......
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