示例#1
0
 public function onConsume(SR_Player $player)
 {
     $m = array('alc' => 0.1);
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 1, $m));
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 2, $m));
     $oldhp = $player->getHP();
     $gain = $player->healHP(0.3);
     $player->getParty()->notice(sprintf('%s drank a beer and got alcoholized (+0.2) %s.', $player->getName(), Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP())));
 }
示例#2
0
文件: heal.php 项目: sinfocol/gwf3
 public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
 {
     $min = $level + 1;
     $max = $min + $level / 4 + $hits / 10;
     $gain = Shadowfunc::diceFloat($min, $max);
     $oldhp = $target->getHP();
     $maxhp = $target->getMaxHP();
     $gain = $target->healHP($gain);
     $append = Shadowfunc::displayHPGain($oldhp, $gain, $maxhp);
     $this->announceADV($player, $target, $level, '10110', $append);
     return true;
 }
示例#3
0
 public function onItemUse(SR_Player $player, array $args)
 {
     if (false === ($target = $this->getFriendlyTarget($player, isset($args[0]) ? $args[0] : ''))) {
         return $player->message('The target is unknown.');
     }
     $maxhp = $target->get('max_hp');
     $oldhp = $target->getHP();
     if ($oldhp >= $maxhp) {
         return $player->message(sprintf('%s does not need to get healed.', $target->getName()));
     }
     $bio = $player->get('biotech');
     $mingain = 50 + $bio * 7;
     $maxgain = 120 + $bio * 12;
     $gain = round(rand($mingain, $maxgain) / 10, 2);
     $gained = $target->healHP($gain);
     $message = sprintf(' %s.', Shadowfunc::displayHPGain($oldhp, $gained, $maxhp));
     $this->announceUsage($player, $target, $message);
     return true;
 }
示例#4
0
 public function onConsume(SR_Player $player)
 {
     $p = $player->getParty();
     $oldhp = $player->getHP();
     $maxhp = $player->getMaxHP();
     $gain = $player->healHP(0.1);
     $newhp = $player->getHP();
     $gainmsg = Shadowfunc::displayHPGain($oldhp, $gain, $maxhp);
     $last = $this->getAmount() === 0 ? 'the last' : 'a';
     if ($p->isFighting()) {
         $busy = $this->getItemUsetime();
         $player->busy($busy);
         $busytext = sprintf(' %s busy.', GWF_Time::humanDuration($busy));
         $p->message($player, sprintf(' eats %s potatoe chip from his roll of Pringles: %s.%s', $last, $gainmsg, $busytext));
         $p->getEnemyParty()->message($player, sprintf(' eats %s chip from his roll of Pringles.', $last));
     } else {
         $player->message(sprintf('You eat %s chip from your Pringles: %s', $last, $gainmsg));
     }
 }
示例#5
0
文件: Cake.php 项目: sinfocol/gwf3
 public function onConsume(SR_Player $player)
 {
     $oldhp = $player->getHP();
     $gain = $player->healHP(25);
     $player->getParty()->message($player, 'ate a cake. ' . Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP()));
 }
示例#6
0
文件: Milk.php 项目: sinfocol/gwf3
 public function onConsume(SR_Player $player)
 {
     $oldhp = $player->getHP();
     $gain = $player->healHP(0.4);
     $player->getParty()->notice(sprintf('%s drank a half litre of milk %s.', $player->getName(), Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP())));
 }
示例#7
0
文件: Bacon.php 项目: sinfocol/gwf3
 public function onConsume(SR_Player $player)
 {
     $oldhp = $player->getHP();
     $gain = $player->healHP(Shadowfunc::diceFloat(1.0, 3.0, 1));
     $player->getParty()->message($player, 'ate some bacon. ' . Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP()));
 }
示例#8
0
 public function onConsume(SR_Player $player)
 {
     $oldhp = $player->getHP();
     $gain = $player->healHP(rand(1, 5));
     $player->getParty()->message($player, 'giggles. ' . Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP()));
 }
示例#9
0
文件: Fish.php 项目: sinfocol/gwf3
 public function onConsume(SR_Player $player)
 {
     $oldhp = $player->getHP();
     $gain = $player->healHP(2);
     $player->getParty()->message($player, 'ate a trout and healed two cent. ' . Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP()) . ' ... Lamer!');
 }
示例#10
0
文件: Apple.php 项目: sinfocol/gwf3
 public function onConsume(SR_Player $player)
 {
     $oldhp = $player->getHP();
     $gain = $player->healHP(Shadowfunc::diceFloat(0.2, 0.5, 1));
     $player->getParty()->message($player, 'ate an apple. ' . Shadowfunc::displayHPGain($oldhp, $gain, $player->getMaxHP()));
 }
示例#11
0
 private static function damage(SR_Player $player, $field, array $data)
 {
     $perc = $player->get($field);
     // 		echo "$perc% for $field\n";
     if ($perc < self::DAMAGE_STARTING) {
         list($msgkey, $dmgperc) = $data;
         $damage = self::calcDamage($player, $perc, $dmgperc);
         $oldhp = $player->getHP();
         $player->healHP(-$damage);
         $gain = $player->getHP() - $oldhp;
         $maxhp = $player->getMaxHP();
         $player->getParty()->ntice($msgkey, array($player->getEnum(), $player->displayName(), Shadowfunc::displayHPGain($oldhp, $gain, $maxhp)));
     }
 }