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


PHP SR_Player::getY方法代码示例

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


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

示例1: cast

 public function cast(SR_Player $player, SR_Player $target, $level, $hits, SR_Player $potion_player)
 {
     // 		echo "Casting Firewall with level $level and $hits hits.\n";
     # Firebolt ads 0.20 per level
     $firebolt = $potion_player->getSpell('firebolt');
     $firebolt = $firebolt === false ? 0 : $firebolt->getLevel($potion_player);
     $firebolt = round($firebolt / 5, 1);
     $level += $firebolt;
     # Fireball ads 0.25 per level
     $fireball = $potion_player->getSpell('fireball');
     $fireball = $fireball === false ? 0 : $fireball->getLevel($potion_player);
     $fireball = round($fireball / 4, 1);
     $level += $fireball;
     $line = $target->getY();
     $damage = array();
     $ep = $target->getParty();
     foreach ($ep->getMembers() as $t) {
         $t instanceof SR_Player;
         $d = abs($line - $t->getY());
         // 			echo "Distance to target is $d\n";
         $l = $level - $d;
         if ($l >= 0) {
             $hits = $this->dice($potion_player, $t, $l);
             $damage[$t->getID()] = $this->calcFirewallDamage($player, $t, $level, $hits);
         }
     }
     $this->announceADV($player, $target, $level);
     Shadowfunc::multiDamage($player, $damage);
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:30,代码来源:firewall.php

示例2: calcDistance

 public static function calcDistance(SR_Player $player, SR_Player $target)
 {
     $x1 = $player->getX();
     $y1 = $player->getY();
     $x2 = $target->getX();
     $y2 = $target->getY();
     return self::calcDistanceB($x1, $y1, $x2, $y2);
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:8,代码来源:Shadowfunc.php

示例3: moveTowards

 public function moveTowards(SR_Player $player, SR_Player $target)
 {
     $move = $player->getMovePerSecond();
     $d1 = $player->getY();
     $d2 = $target->getY();
     $dt = $d1 - $d2;
     if ($dt < 0) {
         $dt = -$dt;
         if ($move > $dt) {
             $move = $dt;
         }
         $move = -$move;
     } else {
         if ($move > $dt) {
             $move = $dt;
         }
     }
     $pid = $player->getID();
     $move = -$move;
     $new_d = 0;
     $move = round($move, 1);
     $this->movePlayerB($pid, $move, $new_d);
     $new_d = round($new_d, 1);
     $busy = $player->busy(25);
     $name = $player->displayNameNB();
     $tn = $target->displayNameNB();
     $ep = $this->getEnemyParty();
     $args = array($name, abs($move), $tn, $new_d, $busy);
     $this->ntice('5097', $args);
     $ep->ntice('5097', $args);
     // 		$ep->ntice('5098', array($name, abs($move), $tn, $new_d));
     // 		$this->notice(sprintf('%s moves %.01f meters towards %s and is now on position %.01f meters. %ds busy.', $name, abs($move), $tn, $new_d, $busy));
     // 		$this->getEnemyParty()->notice(sprintf('%s moves %.01f meters towards %s and is now on position %.01f meters.', $name, abs($move), $tn, $new_d));
     return true;
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:35,代码来源:SR_Party.php


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