Tokiwa Battle Royale  GE777
A PHP Battle Royale inspired game
 All Data Structures Namespaces Files Functions Variables Pages
attr.func.php
Go to the documentation of this file.
1 
2 <?php
3 
4 if(!defined('IN_GAME')) {
5  exit('Access Denied');
6 }
7 global $gamecfg;
8 include_once config('combatcfg',$gamecfg);
9 
10 /*
11 $poseinfo = Array('通常','作战姿态','','探物姿态','偷袭姿态','治疗姿态');
12 $tacinfo = Array('通常','','重视防御','重视反击','重视躲避',);
13 
14 */
15 
16 //发现率修正 find_r,越大越容易发现目标
17 function get_find_r($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf = ''){
18  $_FIND = Array
19  (
20  'weather' => array(10,20,0,-2,-3,-10,-7,5,-10,-20,0,-7,-5,-30,-5,-20,0),
21  //'weather' => array(10,20,0,-2,-3,-7,-10,-5,10,0,0,-7,-5,-30),
22  'pls' => array(10,0,0,10,-10,10,0,10,-10,0,10,0,0,-10,0,-10,-10,-10,0,10,0,10),
23  'pose' => array(0,0,0,25,-10,-25),
24  'tactic' => array(),
25  );
26  $find_r = 0;
27  $find_r += $_FIND['pose'][$pose];
28  $find_r += $_FIND['weather'][$weather];
29  $find_r += $_FIND['pls'][$pls];
30 
31  return $find_r;
32 }
33 
34 
35 //躲避率修正 hide_r,越大越不容易被发现
36 function get_hide_r($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf = ''){
37  $_HIDE = Array
38  (
39  'weather' => array(),
40  'pls' => array(),
41  'pose' => array(0,-25,0,-10,10,-25),
42  //'tactic' => array(),
43  //'pose' => array(),
44  'tactic' => array(0,0,0,-15,15),
45  );
46  $hide_r = 0;
47  $hide_r += $_HIDE['tactic'][$tactic];
48  return $hide_r;
49 }
50 //先攻几率修正,越大越容易先攻
51 function get_active_r($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf = '',$wpose = 0){
53  $_ACTIVE = Array
54  (
55  'weather' => array(10,20,0,-5,-10,-20,-15,0,-7,-10,-10,-5,0,-5,-20,-5,0),
56  //'weather' => array(20,10,0,-3,-5,-5,-7,10,-10,-10,-10,-5,0,-5),
57  'pls' => array(),
58  'pose' => array(0,0,0,0,25,-25),
59  'tactic' => array(),
60  );
61  $_DACTIVE= Array
62  (
63  'pose' => array(0,0,50,0,0,0),
64  );
65  $active_r = $active_obbs;
66  $active_r += $_ACTIVE['weather'][$weather];
67  $active_r += $_ACTIVE['pose'][$pose];
68  $active_r -= $_DACTIVE['pose'][$wpose];
69  foreach ($inf_active_p as $inf_ky => $value) {
70  if(strpos($inf, $inf_ky)!==false){$active_r *= $value;}
71  }
72  //echo 'active:'.$active_r.' ';
73  return $active_r;
74 }
75 //命中率修正
76 function get_hitrate($wkind = 'N',$skill = 0,$club = 0,$inf = ''){
78  $hitrate = $hitrate_obbs[$wkind];
79  $hitrate += round($skill * $hitrate_r[$wkind]);
80  if($hitrate > $hitrate_max_obbs[$wkind]) {$hitrate = $hitrate_max_obbs[$wkind];}
81  foreach ($inf_htr_p as $inf_ky => $value) {
82  if(strpos($inf, $inf_ky)!==false){$hitrate *= $value;}
83  }
84  if($weather == 12){$hitrate += 20;}
85  //echo 'wkind:'.$wkind.' skill:'.$skill.' club:'.$club.' hitrate:'.$hitrate.' ';
86  return $hitrate;
87 }
88 
89 //获取反击几率
90 function get_counter($wkind = 'N',$tactic = 0,$club = 0,$inf = ''){
92  $counter = $counter_obbs[$wkind];
93  if($tactic == 4) {
94  $counter = 0;
95  } elseif($tactic == 3) {
96  $counter += 30;
97  }
98  foreach ($inf_counter_p as $inf_ky => $value) {
99  if(strpos($inf, $inf_ky)!==false){$counter *= $value;}
100  }
101  //echo 'counter:'.$counter.' ';
102  return $counter;
103 }
104 //攻击力修正,百分比增加
105 function get_attack_p($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf = '',$active = 1){
106  global $inf_att_p;
107  $_ATTACK = Array
108  (
109  'weather' => array(10,10,0,-5,-10,-20,-15,0,0,7,20,-7,-20,-5,-10,-10,-10),
110  'pls' => array(0,0,0,0,0,0,10,0,0,-10,0,0,0,0,-10,0,0,0,10,0,0,0),
111  'pose' => array(0,100,0,-25,25,-50),
112  'tactic' => array(0,20,-25,25,-50),
113  );
114 
115  $attack = 100;
116  $attack += $_ATTACK['weather'][$weather];
117  $attack += $_ATTACK['pls'][$pls];
118  if($active){$attack += $_ATTACK['pose'][$pose];}
119  else{$attack += $_ATTACK['tactic'][$tactic];}
120  foreach ($inf_att_p as $inf_ky => $value) {
121  if(strpos($inf, $inf_ky)!==false){$attack *= $value;}
122  }
123 /* if(strpos($inf,'a') !== false){$attack -= 20;}
124  if(strpos($inf,'u') !== false){$attack -= 30;}*/
125  $attack = $attack > 0 ? $attack : 1;
126 
127  return $attack/100;
128 }
129 //防御力修正,百分比
130 function get_defend_p($weather = 0,$pls = 0,$pose = 0,$tactic = 0,$club = 0,$inf = '',$active = 1){
131  global $inf_def_p;
132  $_DEFEND = Array
133  (
134  'weather' => array(10,30,0,0,-3,-15,-10,0,-20,-30,-50,-5,-20,-3,-20,5,-30),
135  'pls' => array(0,-10,10,0,0,0,0,0,0,0,0,-10,10,0,0,0,0,0,0,0,10,0),
136  'pose' => array(0,25,0,-25,-50,-50),
137  'tactic' => array(0,-20,50,-25,0),
138  );
139 
140  $defend = 100;
141  $defend += $_DEFEND['weather'][$weather];
142  $defend += $_DEFEND['pls'][$pls];
143  if($active){$defend += $_DEFEND['pose'][$pose];}
144  else{$defend += $_DEFEND['tactic'][$tactic];}
145  foreach ($inf_def_p as $inf_ky => $value) {
146  if(strpos($inf, $inf_ky)!==false){$defend *= $value;}
147  }
148  /*if(strpos($inf,'b') !== false){$defend -= 20;}
149  if(strpos($inf,'i') !== false){$attack -= 10;}*/
150  $defend = $defend > 0 ? $defend : 1;
151 
152  return $defend/100;
153 }
154 
155 
156 ?>
$inf
Definition: botservice.php:49
get_active_r($weather=0, $pls=0, $pose=0, $tactic=0, $club=0, $inf= '', $wpose=0)
Definition: attr.func.php:51
$inf_def_p
Definition: combatcfg_1.php:62
$inf_att_p
Definition: combatcfg_1.php:60
$hitrate_r
Definition: combatcfg_1.php:13
get_attack_p($weather=0, $pls=0, $pose=0, $tactic=0, $club=0, $inf= '', $active=1)
Definition: attr.func.php:105
get_defend_p($weather=0, $pls=0, $pose=0, $tactic=0, $club=0, $inf= '', $active=1)
Definition: attr.func.php:130
get_find_r($weather=0, $pls=0, $pose=0, $tactic=0, $club=0, $inf= '')
Definition: attr.func.php:17
$active_obbs
Definition: gamecfg_1.php:94
$inf_htr_p
Definition: combatcfg_1.php:64
【生存者数:<?php echo $alivenum?> 人】< input type="button"value="显示全部幸存者"onClick="$('alivemode').value='all';$('gbmode').value='none';postCmd('alive','alive.php');"></p > if($gamblingon &&$gamestate >=20) elseif($gamblingon &&$gamestate<=10)
Definition: 1_alive.tpl.php:18
$inf_counter_p
Definition: combatcfg_1.php:68
get_hitrate($wkind= 'N', $skill=0, $club=0, $inf= '')
Definition: attr.func.php:76
get_counter($wkind= 'N', $tactic=0, $club=0, $inf= '')
Definition: attr.func.php:90
$weather
Definition: gameinfo.php:11
config($file= '', $cfg=1)
$hitrate_max_obbs
Definition: combatcfg_1.php:11
$hitrate_obbs
Definition: combatcfg_1.php:8
$inf_active_p
Definition: combatcfg_1.php:66
get_hide_r($weather=0, $pls=0, $pose=0, $tactic=0, $club=0, $inf= '')
Definition: attr.func.php:36
if(!defined('IN_GAME')) global $gamecfg
Definition: attr.func.php:4
$counter_obbs
Definition: combatcfg_1.php:4