Файл: monst/core/pag/fig.php
Строк: 104
<?
upd_loc('campaign battle');
include $HOME . '/core/content/monster.php';
if ( isset($index[1]) AND is_numeric($index[1]) ) {
$id = (int)$index[1];
if ( !$id ) g('/main');
if ( $user['last_monster_id'] + 1 != $id ) g('/main');
if ( !$monster_dat = $MONSTER[$user['part']][$id] ) g('/main');
$fig = $_fig -> findOne(
[
'user_id' => $user['id']
]
);
if ( !$fig ) {
if ( $user['fig'] <= 0 ) {
g('/campaign');
}
$log = '<img src="/core/i/monster/'.$user['part'].'/'.$id.'.jpg" alt="" width="15"/><span style="color: #999;">'.$monster_dat['name'].'</span>: '.$monster_dat['says'].'<br/>';
$uniq_id = new_id('_fig');
$insert = $_fig -> insert(
[
'id' => $uniq_id,
'user_id' => $user['id'],
'monster_id' => $monster_dat['id'],
'monster_hp' => $monster_dat['hp'],
'monster_hpf' => $monster_dat['hp'],
'log' => $log,
'time' => time()
]
);
g('/fig');
} else {
g('/fig');
}
}
$fig = $_fig -> findOne(
[
'user_id' => $user['id']
]
);
if ( !$fig ) {
g('/main');
}
$id = $fig['monster_id'];
if ( !$demon_dat = $MONSTER[$user['part']][$id] ) g('/main');
//$_users -> update(
// [
// 'id' => $user['id']
// ],
//
// [
// '$set' => [
// 'val2' => $user['val2'] + 50
// ]
// ]
//);
?>
<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/fig/attack.php",
data: "null",
success: function (html) {
//alert(html);
// cooldown = 1;
index();
}
});
$('#effect').show();
$('#monster_img').animateCss('damage');
setTimeout(stop_attack, 250);
// }
}
function stop_attack() {
$('#effect').hide();
$('#damage').hide();
// cooldown = 0;
}
function index() {
$.ajax({
type: "POST",
url: "/core/jphp/fig/index.php",
data: "null",
success: function (html) {
// alert(html);
$('#index').empty();
$('#index').append(html);
}
});
}
index();
</script>
<div style='text-align: center;'>
<img id='effect_killed' src="/core/i/effect/killed.png?2" style='display: none; position: absolute; le2ft: 130px; top: 100px; z-index: 1001; width: 200px;'/>
<img id='effect' src="/core/i/effect/bum.png" style='display: none; position: absolute; z-index: 1001; width: 200px;'/>
<div class='b_img'>
<img OnClick='attack();' style='width: 100%; cursor: pointer;' id='monster_img' src='/core/i/monster/<?=$user['part']?>/<?=$fig['monster_id']?>.jpg?<?=filemtime($HOME . '/core/i/monster/'.$user['part'].'/'.$fig['monster_id'].'.jpg')?>' alt=''/>
</div>
<img style='width: 100%; display: none; -webkit-filter: grayscale(100%); filter: grayscale(100%);' id='monster_img_gray' src='/core/i/monster/<?=$user['part']?>/<?=$fig['monster_id']?>.jpg?<?=filemtime($HOME . '/core/i/monster/'.$user['part'].'/'.$fig['monster_id'].'.jpg')?>' alt=''/>
</div>
<!--<div style='position: relative; top: -20px; bac2kground: #000; text-align: center; opacity: 0.7; '>-->
<div style='text-align: center;'>
<div id='index'></div>
</div>
<!--</div>-->