コード例 #1
0
ファイル: Ether.php プロジェクト: sinfocol/gwf3
 public function onConsume(SR_Player $player)
 {
     $es = $player->get('essence');
     $min = 3 + $es * 2;
     # 15
     $max = $min * 2;
     # 30
     $gain = rand($min, $max);
     $gained = $player->healMP($gain);
     $player->message(sprintf('You gained +%s MP!', $gained));
 }
コード例 #2
0
ファイル: magicarp.php プロジェクト: sinfocol/gwf3
 public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
 {
     echo "Casting " . $this->getName() . " with level {$level} and {$hits} hits.\n";
     $min = 0.0;
     $max = $hits * 1.5;
     $sucked = Shadowfunc::diceFloat($min, $max, 1);
     $target->healMP(-$sucked);
     // 		$append = sprintf('%s lost %s MP.', $target->getName(), $sucked);
     $this->announceADV($player, $target, $level, '10090', $sucked);
     return true;
 }
コード例 #3
0
ファイル: teleport.php プロジェクト: sinfocol/gwf3
 public function onBrew(SR_Player $player, $mp, $diff, $hits)
 {
     if ($player->getMP() < $mp) {
         $player->msg('1077', array($mp, $player->getMP()));
         // 			$player->message(sprintf('You need %s MP to brew this potion, but you got only %s.', $mp, $player->getMP()));
         return false;
     }
     $player->healMP(-$mp);
     $es = $player->get('essence');
     $al = $player->get('alchemy');
     $wi = $player->get('wisdom');
     $dices = $es * 3 + $al * 2 + $wi;
     $hit = Shadowfunc::dicePool($dices, $diff, $diff);
     return $hit >= $hits;
 }