项目作者: mdtrooper

项目描述 :
A toy Powerline segment. This segment shows result of a dice.
高级语言: Python
项目地址: git://github.com/mdtrooper/powerline_dice.git
创建时间: 2019-11-18T22:11:43Z
项目社区:https://github.com/mdtrooper/powerline_dice

开源协议:GNU General Public License v3.0

下载


POWERLINE DICE

A toy Powerline segment. This segment shows a result of dice combination.

By Miguel de Dios Matias.

Installation

Using pip

  1. pip install powerline-dice

Configuration

You can activate the Powerline Slotmachine segment by adding it to your segment configuration,
for example in .config/powerline/themes/shell/default.json:

  1. {
  2. "function": "powerline_dice.roll",
  3. "priority": 90
  4. }

By default shows a roll of d6 (dice of six faces).

screenshot roll six faces

Arguments

  • diceCombination (string): The combination of dices in dice notation format or wikipedia: Dice notation.
    • Default: “d6”
  • preContent (string): The string to show before the result.
    • Default: “”
  • postContent (string): The string to show after the result.
    • Default: “🎲”
  • facesDice list(string) or None: The faces of dice as list of string (can be emojis).
    • Default: None
  • critical int or list(int) or None: The minimum or exact values to critical hit, the background change to critical success.
    • Default: None
  • fumble int or list(int) or None: The maximum or exact values to critical fumble, the background change to critical failture.
    • Default: None

Examples

Rolls two dices of twenty faces and get critical hit with 40 and critical fumble with 1.

  1. {
  2. "function": "powerline_dice.roll",
  3. "priority": 30,
  4. "args": {
  5. "diceCombination": "2d20",
  6. "critical": 30,
  7. "fumble": 15
  8. }
  9. },

screenshot roll d20 critical and fumble

Flip a coin with the tail 🙂 and head ️☹️.

  1. {
  2. "function": "powerline_dice.roll",
  3. "priority": 30,
  4. "args": {
  5. "diceCombination": "d2",
  6. "facesDice": ["🙂", "☹️"],
  7. "postContent": ""
  8. }
  9. },

screenshot flip a coin

Thanks

  • Python Dice: for great library to parse dice combination.

License

Licensed under the GPL3 License.