• R/O
  • SSH
  • HTTPS

jinrousiki: Commit


Commit MetaInfo

Revision2567 (tree)
Time2020-01-06 00:03:44
Authorumethyl

Log Message

VoteNight::FilterReport()
Role_mind_scanner::MindScan()
Role_step_scanner::StepMindScan()

Change Summary

Incremental Difference

--- trunk/include/game_vote_functions.php (revision 2566)
+++ trunk/include/game_vote_functions.php (revision 2567)
@@ -789,10 +789,10 @@
789789 self::FilterMage();
790790 self::FilterMageKill();
791791
792+ //-- 透視レイヤー --//
793+ self::FilterMindScan();
794+
792795 if (DB::$ROOM->IsDate(1)) {
793- //-- 透視レイヤー --//
794- self::FilterMindScan();
795-
796796 //-- コピーレイヤー --//
797797 self::FilterCopy();
798798
@@ -1326,6 +1326,8 @@
13261326 private static function FilterMindScan() {
13271327 $vote_data = RoleManager::GetVoteData();
13281328 RoleVote::FilterNight($vote_data[VoteAction::SCAN], 'MindScan');
1329+ RoleVote::FilterNight($vote_data[VoteAction::STEP_SCAN], 'StepMindScan', null, 'multi');
1330+ self::FilterDelayTrapKill(); //遅行罠死処理 (凍傷型は無効)
13291331 }
13301332
13311333 //神話マニアの処理
@@ -1367,40 +1369,10 @@
13671369 RoleLoader::Load('tengu')->SetWinCamp();
13681370 }
13691371
1370- //ブン屋・猩々・雷神
1372+ //尾行処理
13711373 private static function FilterReport() {
13721374 $vote_data = RoleManager::GetVoteData();
1373- foreach (VoteActionGroup::$report as $action) {
1374- foreach ($vote_data[$action] as $id => $target_id) {
1375- $user = DB::$USER->ByID($id);
1376- if ($user->IsDead(true)) { //直前に死んでいたら無効
1377- continue;
1378- }
1379-
1380- switch ($action) {
1381- case VoteAction::STEP_SCAN: //雷神
1382- $target_list = Text::Parse($target_id);
1383- foreach (RoleLoader::LoadFilter('trap') as $filter) { //罠判定
1384- foreach ($target_list as $target_id) {
1385- if ($filter->DelayTrap($user, $target_id)) continue 4;
1386- }
1387- }
1388- RoleLoader::LoadMain($user)->StepScan($target_list);
1389- break;
1390-
1391- default:
1392- foreach (RoleLoader::LoadFilter('trap') as $filter) { //罠判定
1393- if ($filter->TrapKill($user, $target_id)) continue 3;
1394- }
1395- RoleLoader::LoadMain($user)->Report(DB::$USER->ByID($target_id));
1396- break;
1397- }
1398- }
1399-
1400- if ($action == VoteAction::STEP_SCAN) { //遅行罠死処理 (凍傷型は無効)
1401- self::FilterDelayTrapKill();
1402- }
1403- }
1375+ RoleVote::FilterNight($vote_data[VoteAction::REPORTER], 'Report');
14041376 }
14051377
14061378 //反魂処理
--- trunk/include/role/clairvoyance_scanner.php (revision 2566)
+++ trunk/include/role/clairvoyance_scanner.php (revision 2567)
@@ -22,11 +22,17 @@
2222 return null;
2323 }
2424
25- /*
26- 複数の投票イベントを持つタイプが出現した場合は複数のメッセージを発行する必要がある
27- 対象が NULL でも有効になるタイプ (キャンセル投票はスキップ) は想定していない
28- */
29- public function Report(User $user) {
25+ public function MindScan(User $user) {
26+ foreach (RoleLoader::LoadFilter('trap') as $filter) { //罠判定
27+ if ($filter->TrapKill($this->GetActor(), $user->id)) {
28+ return false;
29+ }
30+ }
31+
32+ /*
33+ 複数の投票イベントを持つタイプが出現した場合は複数のメッセージを発行する必要がある
34+ 対象が NULL でも有効になるタイプ (キャンセル投票はスキップ) は想定していない
35+ */
3036 foreach (RoleManager::GetVoteData() as $action => $vote_stack) {
3137 if (Text::Search($action, '_NOT_DO') || false === isset($vote_stack[$user->id])) {
3238 continue;
--- trunk/include/role/reporter.php (revision 2566)
+++ trunk/include/role/reporter.php (revision 2567)
@@ -22,9 +22,15 @@
2222
2323 //尾行
2424 public function Report(User $user) {
25+ foreach (RoleLoader::LoadFilter('trap') as $filter) { //罠判定
26+ if ($filter->TrapKill($this->GetActor(), $user->id)) {
27+ return false;
28+ }
29+ }
30+
2531 $target = $this->GetWolfTarget();
2632 if ($user->IsSame($target)) { //尾行成功
27- if (! $user->wolf_eat) { //人狼襲撃が失敗していたらスキップ
33+ if (false === $user->wolf_eat) { //人狼襲撃が失敗していたらスキップ
2834 return;
2935 }
3036 $result = $this->GetWolfVoter()->GetName();
--- trunk/include/role/step_scanner.php (revision 2566)
+++ trunk/include/role/step_scanner.php (revision 2567)
@@ -40,10 +40,22 @@
4040 }
4141
4242 //範囲透視
43- public function StepScan(array $list) {
44- if ($this->IgnoreStep()) return false;
43+ public function StepMindScan(array $list) {
44+ //-- 罠判定 --//
45+ foreach (RoleLoader::LoadFilter('trap') as $filter) {
46+ foreach ($list as $id) {
47+ if ($filter->DelayTrap($this->GetActor(), $id)) {
48+ return false;
49+ }
50+ }
51+ }
4552
46- //周辺ID取得
53+ //-- 足音無効判定 --//
54+ if ($this->IgnoreStep()) {
55+ return false;
56+ }
57+
58+ //-- 周辺ID取得 --//
4759 //Text::p($list, '◆Target [Vote]');
4860 $max = DB::$USER->Count();
4961 $stack = [];
@@ -53,12 +65,14 @@
5365
5466 $around_list = [];
5567 foreach ($stack as $id) {
56- if (in_array($id, $list) || DB::$USER->ByID($id)->IsDead(true)) continue;
68+ if (in_array($id, $list) || DB::$USER->ByID($id)->IsDead(true)) {
69+ continue;
70+ }
5771 $around_list[] = $id;
5872 }
5973 //Text::p($around_list, '◆Target [Around]');
6074
61- //確率判定
75+ //-- 確率判定 --//
6276 $rate = min(80, count($around_list) * 10);
6377 //Text::p($rate, '◆Rate');
6478 if (Lottery::Percent(100 - $rate)) {
@@ -65,19 +79,14 @@
6579 return false;
6680 }
6781
68- //会話能力者判定
69- $step_flag = false;
82+ //-- 会話能力者判定 --//
7083 foreach ($around_list as $id) {
7184 $user = DB::$USER->ByID($id);
72- if ($user->IsDead(true)) continue;
7385 if (RoleUser::IsCommon($user) || RoleUser::IsWolf($user) || RoleUser::IsFox($user) ||
7486 $user->IsRole('mind_friend')) {
75- $step_flag = true;
76- break;
87+ $this->Step($list); //足音処理
88+ return true;
7789 }
7890 }
79- if (true === $step_flag) {
80- $this->Step($list);
81- }
8291 }
8392 }
Show on old repository browser