当前位置: 首页>>代码示例>>PHP>>正文


PHP SR_Player::addEffects方法代码示例

本文整理汇总了PHP中SR_Player::addEffects方法的典型用法代码示例。如果您正苦于以下问题:PHP SR_Player::addEffects方法的具体用法?PHP SR_Player::addEffects怎么用?PHP SR_Player::addEffects使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SR_Player的用法示例。


在下文中一共展示了SR_Player::addEffects方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: onConsume

 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));
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 3, $m));
     $player->getParty()->notice(sprintf('%s drunk an alcopop and got alcoholized (+0.3).', $player->getName()));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Alcopop.php

示例2: onConsume

 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())));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:9,代码来源:SmallBeer.php

示例3: onDealDamage

 /**
  * Poison the target.
  * @see SR_Weapon::onDealDamage()
  */
 public function onDealDamage(SR_Player $player, SR_Player $target, $hits, $damage)
 {
     $biotech = Common::clamp($target->getVar('biotech'), 0, 15);
     $min = 0.1 - $biotech * 0.01;
     $max = 0.3 - $biotech * 0.02;
     $duration = rand(20, 40);
     $per_sec = Shadowfunc::diceFloat($min, $max, 2);
     if ($per_sec > 0) {
         $modifiers = array('hp' => $per_sec);
         $target->addEffects(new SR_Effect($duration, $modifiers));
         $target->msg('5294', array(sprintf('%.02f', $per_sec), GWF_Time::humanDuration($duration)));
     }
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:17,代码来源:ScorpionSting.php

示例4: onConsume

 public function onConsume(SR_Player $player)
 {
     $mod = array('quickness' => 1);
     $player->addEffects(new SR_Effect(5400, $mod), new SR_Effect(3600, $mod), new SR_Effect(1800, $mod));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:QuicknessElixir.php

示例5: onConsume

 public function onConsume(SR_Player $player)
 {
     $m = array('caf' => 0.1);
     $player->addEffects(new SR_Effect(GWF_Time::ONE_HOUR * 1, $m));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:Coffee.php

示例6: onConsume

 public function onConsume(SR_Player $player)
 {
     $mod = array('strength' => 1);
     $player->addEffects(new SR_Effect(3600, $mod), new SR_Effect(1800, $mod));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:5,代码来源:StrengthPotion.php


注:本文中的SR_Player::addEffects方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。