Beispiel #1
0
 public static function onCreateLangFiles()
 {
     $player = Shadowrun4::getDummyPlayer();
     // 		Shadowcmd::$CURRENT_PLAYER = $player;
     // 		$spells = SR_Spell::getSpells();
     // 		ksort($spells);
     // 		foreach ($spells as $name => $spell)
     // 		{
     // 			printf("'%s' => '%s'\n", $name, $name);
     // 		}
     // 		die();
     $back = self::createItemLangFile() && self::createItemTypeFile() && self::createStatUUIDFile();
     # && self::createItemDataFile();
     Shadowcmd::$CURRENT_PLAYER = NULL;
     return $back;
     // 		return true;
     // 		return
     // 			(true === self::createNPCLangFiles()) &&
     // 			(true === self::createQuestLangFiles()) &&
     // 			(true === self::createLocationLangFiles()) &&
     // 			(true === self::createItemLangFile()) &&
     // 			(true === self::createHelpLangFile());
 }
Beispiel #2
0
 public static function onTrigger(SR_Player $player, $message)
 {
     self::$CURRENT_PLAYER = $player;
     if ($player->isFighting()) {
         $cmd = Common::substrUntil($message, ' ', $message);
         $cmd = self::unshortcut($cmd);
         $cmd = self::untranslate($cmd);
         if (true === in_array($cmd, self::$CMDS['fight'], true)) {
             $player->combatPush($message);
             return true;
         }
     }
     return self::onExecute($player, $message);
 }
Beispiel #3
0
 /**
  * @return SR_Player
  */
 public static function getDummyPlayer()
 {
     static $DUMMY;
     if (!isset($DUMMY)) {
         echo "Creating Dummy!\n";
         $DUMMY = new SR_DummyPlayer(array());
         Shadowcmd::$CURRENT_PLAYER = $DUMMY;
         $DUMMY = SR_Player::getRealNPCByName('Redmond_dloser');
         Shadowcmd::$CURRENT_PLAYER = $DUMMY;
     }
     return $DUMMY;
 }
Beispiel #4
0
 public function on_fight($done)
 {
     if (false === ($ep = $this->getEnemyParty())) {
         $this->popAction(true);
     } else {
         $this->timestamp = time();
         foreach ($this->members as $player) {
             $player instanceof SR_Player;
             # Make sure player hasn't left because of something like #cast bunny.
             if ($player->getParty() !== $this) {
                 continue;
             }
             Shadowcmd::$CURRENT_PLAYER = $player;
             if ($player->combatTimer()) {
                 # No more enemies! \o/
                 break;
             }
         }
     }
 }