Файл: monst/core/pag/d.php
Строк: 135
<?
@$id = (int)$index[1];
include $HOME . '/core/content/dungeon.php';
//$_d -> remove();
if ( !$GROUP ) {
g('/main');
}
$d = $_d -> findOne(
[
'group_id' => $GROUP['id'],
'dungeon_id' => $id
]
);
//if ( isset($user['dungeon_cooldown'][$d['dungeon_id']]) AND $user['dungeon_cooldown'][$d['dungeon_id']] > time() ) {
// g('/dungeon?id=' . $d['dungeon_id']);
//}
if ( !$d ) {
if ( $id != 0 ) {
if ( !isset($DUNGEON[$id]) ) {
g('/main');
}
if ( $DUNGEON[$id]['need_part'] > $user['part'] ) {
g('/main');
}
$uniq_id = new_id('_d');
$_d -> insert(
[
'id' => $uniq_id,
'group_id' => $GROUP['id'],
'dungeon_id' => $id,
'monster_id' => 1,
'monster_count' => $DUNGEON[$id]['data'][1]['count'],
'monster_hp' => $DUNGEON[$id]['data'][1]['hp'],
'monster_hpf' => $DUNGEON[$id]['data'][1]['hp'],
'log' => '',
'reward_data' => [],
]
);
g('/d/'.$id);
}
// else {
// echo 'sssss';
// exit;
// g('/main');
// }
}
// ---------------------------------------------------------------------------------------------------------------------
if ( !$monster = $DUNGEON[$d['dungeon_id']]['data'][$d['monster_id']]) {
g('/main');
}
?>
<link rel='stylesheet' href='/core/s/css/animate.css?<?= r() ?>'>
<script src='/core/j/jquery-3.2.1.min.js'></script>
<script src='/core/j/anim.js'></script>
<script>
var cooldown = 0;
function attack() {
// if ( cooldown !== 1 ) {
$.ajax({
type: "POST",
url: "/core/jphp/d/attack.php",
data: "dungeon_id=<?=$d['dungeon_id']?>",
success: function (html) {
//alert(html);
// index();
// cooldown = 1;
}
});
// clearInterval(indexInterval);
$('#effect').show();
$('#monster_img').animateCss('damage');
setTimeout(stop_attack, 250);
// }
}
function stop_attack() {
$('#effect').hide();
$('#damage').hide();
index();
//indexInterval = setInterval(index, 500);
//cooldown = 0;
}
function index() {
$.ajax({
type: "POST",
url: "/core/jphp/d/index.php",
data: "dungeon_id=<?=$d['dungeon_id']?>",
success: function (html) {
// alert(html);
$('#index').empty();
$('#index').append(html);
}
});
}
index();
var indexInterval = setInterval(index, 500);
</script>
<!--<div style='text-align: center;'>-->
<!-- <img id='effect' src="/core/i/effect/bum.png" style='display: none; position: absolute; z-index: 1001; width: 200px;'/>-->
<!---->
<!-- <img OnClick='attack();' id='monster_img' src='/core/i/dungeon/monster/--><?//=$d['dungeon_id']?><!--/--><?//=$d['monster_id']?><!--.jpg?--><?//=filemtime($HOME . '/core/i/dungeon/monster/'.$d['dungeon_id'].'/'.$d['monster_id'].'.jpg')?><!--' alt='' style='width: 100%; cursor: pointer;'/>-->
<!---->
<!-- <img id='monster_img2' src='/core/i/dungeon/monster/--><?//=$d['dungeon_id']?><!--/--><?//=$d['monster_id']?><!--.jpg?--><?//=filemtime($HOME . '/core/i/dungeon/monster/'.$d['dungeon_id'].'/'.$d['monster_id'].'.jpg')?><!--' alt='' style='width: 100%; -webkit-filter: grayscale(100%); filter: grayscale(100%); display: none;'/>-->
<!---->
<!--</div>-->
<div style='text-align: center;'>
<div id='index'></div>
</div>
<?