Class: BCDice::GameSystem::DungeonsAndDragons_Korean

Inherits:
DungeonsAndDragons show all
Defined in:
lib/bcdice/game_system/DungeonsAndDragons_Korean.rb

Constant Summary collapse

ID =

ゲームシステムの識別子

'DungeonsAndDragons:Korean'
NAME =

ゲームシステム名

'던전 앤 드래곤'
SORT_KEY =

ゲームシステム名の読みがな

'国際化:Korean:던전 앤 드래곤'
HELP_MESSAGE =

ダイスボットの使い方

"※ 이 다이스봇은 방의 시스템 이름 표시용입니다.\n"

Instance Attribute Summary

Attributes inherited from Base

#d66_sort_type, #default_cmp_op, #default_target_number, #randomizer, #reroll_dice_reroll_threshold, #round_type, #sides_implicit_d, #upper_dice_reroll_threshold

Instance Method Summary collapse

Methods inherited from Base

#change_text, command_pattern, #enable_debug, #enabled_d9?, eval, #eval, #grich_text, #initialize, prefixes_pattern, register_prefix, register_prefix_from_super_class, #sort_add_dice?, #sort_barabara_dice?

Methods included from Translate

#translate

Constructor Details

This class inherits a constructor from BCDice::Base

Instance Method Details

#check_result(total, rand_results, cmp_op, target) ⇒ Object

Base.check_result(total, rand_results, cmp_op, target)를 오버라이드



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/bcdice/game_system/DungeonsAndDragons_Korean.rb', line 41

def check_result(total, rand_results, cmp_op, target)
  # target이 '?' 같은 문자열일 경우 nil 반환
  return nil if target.is_a?(String)

  # 크리티컬/펌블 처리 (D&D 룰: 1 = 펌블, 20 = 크리티컬)
  dice_total = rand_results.map(&:value).sum
  if rand_results.map(&:sides) == [20]
    return Result.critical(critical_text) if dice_total == 20
    return Result.fumble(fumble_text) if dice_total == 1
  end

  # 일반 성공/실패 판정
  if total.send(cmp_op, target)
    Result.success(success_text)
  else
    Result.failure(failure_text)
  end
end

#critical_textObject

크리티컬 결과 문자열



31
32
33
# File 'lib/bcdice/game_system/DungeonsAndDragons_Korean.rb', line 31

def critical_text
  "크리티컬"
end

#failure_textObject

실패 결과 문자열



26
27
28
# File 'lib/bcdice/game_system/DungeonsAndDragons_Korean.rb', line 26

def failure_text
  "실패"
end

#fumble_textObject

펌블 결과 문자열



36
37
38
# File 'lib/bcdice/game_system/DungeonsAndDragons_Korean.rb', line 36

def fumble_text
  "펌블"
end

#success_textObject

성공 결과 문자열



21
22
23
# File 'lib/bcdice/game_system/DungeonsAndDragons_Korean.rb', line 21

def success_text
  "성공"
end