function calcDamages($weapon, $defPoint, &$message) { $damages = (int) (dice($weapon["ATK"]) - $defPoint); if ($damages == 0) { $message = "攻撃が弾き返された!"; } if ($damages < 0) { $message = "攻撃は届かなかった."; $damages = 0; } if ($damages > 0) { $message = $damages . "のダメージを与えた!"; } return $damages; }
<?php /* Plugin Name: Pedro Lee Plugin URI: http://customrayguns.com Description: Pedro Lee M**********r!!! Version: 1.0 Author: Custom Ray Guns Author URI: http://customrayguns.com */ function redirect_specified_user() { global $current_user; get_currentuserinfo(); // User 1 $specific_user1 = "Pedro Lee"; $specific_user1_Url = "http://jimsbigbrain.com/pussy/"; // Specify Users Functions if ($current_user->user_login == $specific_user1) { wp_redirect($specific_user1_Url); exit; } } add_action('admin_init', 'redirect_specified_user'); function dice() { } if (isset($_GET['dice'])) { dice(); }
for ($x = 0; $x < 10; $x++) { for ($y = 0; $y < 10; $y++) { @($rgb = imagecolorat($im, $x + 10 * $xgrid, $y + 10 * $ygrid)); $r = $rgb >> 16 & 0xff; $g = $rgb >> 8 & 0xff; $b = $rgb & 0xff; $totalR += $r; $totalG += $g; $totalB += $b; } } $rr = $totalR / (10 * 10); $gg = $totalG / (10 * 10); $bb = $totalB / (10 * 10); $dice = 0.3 * $rr + 0.59 * $gg + 0.11 * $bb; switch (dice($dice)) { case 1: imagecopy($img, $one, $xgrid * 10, $ygrid * 10, 0, 0, 10, 10); break; case 2: imagecopy($img, $two, $xgrid * 10, $ygrid * 10, 0, 0, 10, 10); break; case 3: imagecopy($img, $three, $xgrid * 10, $ygrid * 10, 0, 0, 10, 10); break; case 4: imagecopy($img, $four, $xgrid * 10, $ygrid * 10, 0, 0, 10, 10); break; case 5: imagecopy($img, $five, $xgrid * 10, $ygrid * 10, 0, 0, 10, 10); break;