text: /* Generated by Opal 0.10.5 */
  (function(Opal) {
    function $rb_le(lhs, rhs) {
      return (typeof(lhs) === 'number' && typeof(rhs) === 'number') ? lhs <= rhs : lhs['$<='](rhs);
    }
    var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice, $klass = Opal.klass, $gvars = Opal.gvars, $hash = Opal.hash;
  
    Opal.add_stubs(['$setPrefixes', '$=~', '$getChombaResultText', '$isChomba', '$roll', '$collect', '$to_i', '$split', '$sort!', '$getYaku', '$nil?', '$getResultTextByDice', '$getDemeZorome', '$==', '$debug', '$<=', '$getResultText', '$[]', '$join']);
    return (function($base, $super) {
      function $GeishaGirlwithKatana(){};
      var self = $GeishaGirlwithKatana = $klass($base, $super, 'GeishaGirlwithKatana', $GeishaGirlwithKatana);
  
      var def = self.$$proto, $scope = self.$$scope, TMP_1, TMP_2, TMP_3, TMP_5, TMP_6, TMP_7, TMP_8, TMP_9, TMP_10, TMP_11;
  
      self.$setPrefixes(["GK(#\\d+)?", "GL"]);
  
      Opal.defn(self, '$gameName', TMP_1 = function $$gameName() {
        var self = this;
  
        return "ゲイシャ・ガール・ウィズ・カタナ";
      }, TMP_1.$$arity = 0);
  
      Opal.defn(self, '$gameType', TMP_2 = function $$gameType() {
        var self = this;
  
        return "GeishaGirlwithKatana";
      }, TMP_2.$$arity = 0);
  
      Opal.defn(self, '$getHelpMessage', TMP_3 = function $$getHelpMessage() {
        var self = this;
  
        return "・判定 (GK#n)\n  役やチョムバを含めて1回分のダイスロールを判定します。\n　役は　（通常判定）／（戦闘時）　の順で両方出力されます。\n  GK のみの場合5%の確率でチョムバます。\n  GK#3 の様に #n をつけることによってチョムバの確率をn%にすることができます。\n　例）GK　GK#10\n・隠しコマンド (GL)\n  必ずチョムバします。GMが空気を読んでチョムバさせたいときや、\n  GKコマンドを打ち間違えてチョムバするを想定してます。\n　例）GL\n";
      }, TMP_3.$$arity = 0);
  
      Opal.defn(self, '$rollDiceCommand', TMP_5 = function $$rollDiceCommand(command) {
        var $a, $b, TMP_4, $c, self = this, output = nil, chomba_counter = nil, _ = nil, dice_str = nil, diceList = nil, yakuResult = nil, deme = nil, zorome = nil, yp = nil;
  
        output = nil;
        if ((($a = /^GL$/i['$=~'](command)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
          return self.$getChombaResultText()};
        if ((($a = /^GK(#(\d+))?$/i['$=~'](command)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
          } else {
          return output
        };
        chomba_counter = (($a = $gvars['~']) === nil ? nil : $a['$[]'](2));
        if ((($a = self.$isChomba(chomba_counter)) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
          return self.$getChombaResultText()};
        $b = self.$roll(3, 6), $a = Opal.to_ary($b), _ = ($a[0] == null ? nil : $a[0]), dice_str = ($a[1] == null ? nil : $a[1]), $b;
        diceList = ($a = ($b = dice_str.$split(/,/)).$collect, $a.$$p = (TMP_4 = function(i){var self = TMP_4.$$s || this;
  if (i == null) i = nil;
        return i.$to_i()}, TMP_4.$$s = self, TMP_4.$$arity = 1, TMP_4), $a).call($b);
        diceList['$sort!']();
        yakuResult = self.$getYaku(diceList);
        if ((($a = (yakuResult['$nil?']())) !== nil && $a != null && (!$a.$$is_boolean || $a == true))) {
          } else {
          return self.$getResultTextByDice(diceList, "【役】" + (yakuResult))
        };
        $c = self.$getDemeZorome(diceList), $a = Opal.to_ary($c), deme = ($a[0] == null ? nil : $a[0]), zorome = ($a[1] == null ? nil : $a[1]), $c;
        if (deme['$=='](0)) {
          return self.$getResultTextByDice(diceList, "失敗")};
        yp = ((function() {if (zorome['$=='](1)) {
          return " YPが1増加"
          } else {
          return ""
        }; return nil; })());
        output = self.$getResultTextByDice(diceList, "達成値" + (deme) + (yp));
        self.$debug("getGGwKResult(command) result", output);
        return output;
      }, TMP_5.$$arity = 1);
  
      Opal.defn(self, '$isChomba', TMP_6 = function $$isChomba(chomba_counter) {
        var $a, $b, self = this, chomba = nil;
  
        ((($a = chomba_counter) !== false && $a !== nil && $a != null) ? $a : chomba_counter = 5);
        chomba_counter = chomba_counter.$to_i();
        $b = self.$roll(1, 100), $a = Opal.to_ary($b), chomba = ($a[0] == null ? nil : $a[0]), $b;
        return ($rb_le(chomba, chomba_counter));
      }, TMP_6.$$arity = 1);
  
      Opal.defn(self, '$getChombaResultText', TMP_7 = function $$getChombaResultText() {
        var self = this;
  
        return self.$getResultText("チョムバ！！");
      }, TMP_7.$$arity = 0);
  
      Opal.defn(self, '$getYaku', TMP_8 = function $$getYaku(diceList) {
        var self = this, rule = nil, yaku = nil;
  
        rule = $hash([1, 2, 3], "自動失敗／自分の装甲効果無しでダメージを受けてしまう", [4, 5, 6], "自動成功／敵の装甲を無視してダメージを与える", [1, 1, 1], "10倍成功 YPが10増加／10倍ダメージ YPが10増加", [2, 2, 2], "2倍成功／2倍ダメージ", [3, 3, 3], "3倍成功／3倍ダメージ", [4, 4, 4], "4倍成功／4倍ダメージ", [5, 5, 5], "5倍成功／5倍ダメージ", [6, 6, 6], "6倍成功／6倍ダメージ");
        yaku = rule['$[]'](diceList);
        return yaku;
      }, TMP_8.$$arity = 1);
  
      Opal.defn(self, '$getDemeZorome', TMP_9 = function $$getDemeZorome(diceList) {
        var self = this, deme = nil, zorome = nil;
  
        deme = 0;
        zorome = 0;
        if (diceList['$[]'](0)['$=='](diceList['$[]'](1))) {
          deme = diceList['$[]'](2);
          zorome = diceList['$[]'](0);
        } else if (diceList['$[]'](1)['$=='](diceList['$[]'](2))) {
          deme = diceList['$[]'](0);
          zorome = diceList['$[]'](1);};
        return [deme, zorome];
      }, TMP_9.$$arity = 1);
  
      Opal.defn(self, '$getResultTextByDice', TMP_10 = function $$getResultTextByDice(diceList, result) {
        var self = this;
  
        return self.$getResultText("" + (diceList.$join(",")) + " ＞ " + (result));
      }, TMP_10.$$arity = 2);
  
      return (Opal.defn(self, '$getResultText', TMP_11 = function $$getResultText(result) {
        var self = this;
  
        return "(3B6) ＞ " + (result);
      }, TMP_11.$$arity = 1), nil) && 'getResultText';
    })($scope.base, $scope.get('DiceBot'))
  })(Opal);
  
  /* Generated by Opal 0.10.5 */
  (function(Opal) {
    var self = Opal.top, $scope = Opal, nil = Opal.nil, $breaker = Opal.breaker, $slice = Opal.slice;
  
    Opal.add_stubs(['$exit']);
    return $scope.get('Kernel').$exit()
  })(Opal);
  