1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-04 20:52:43 +01:00
phorge-phorge/src/applications/badges/lipsum/PhabricatorBadgesLootContextFreeGrammar.php
epriestley 5cb4c76bef Add a lipsum generator for Badges
Summary: Ref T12319. Ref T12270. Allow badges to be generated with `bin/lipsum`. These aren't hugely sophisticated but I'm not sure about the fate of T9010 yet or what's happening with the quality levels, and didn't want to make those changes more difficult.

Test Plan:
  - Used `bin/lipsum generate badges --force --quickly` to generate badges.
  - Made some coffee and came back to 20K badges.

{F3422200}

Reviewers: chad

Reviewed By: chad

Subscribers: cspeckmim

Maniphest Tasks: T12319, T12270

Differential Revision: https://secure.phabricator.com/D17422
2017-02-27 09:10:05 -08:00

88 lines
2.3 KiB
PHP

<?php
final class PhabricatorBadgesLootContextFreeGrammar
extends PhutilContextFreeGrammar {
protected function getRules() {
return array(
'start' => array(
'[jewelry]',
),
'jewelry' => array(
'Ring [jewelry-suffix]',
'Ring [jewelry-suffix]',
'[jewelry-prefix] Ring',
'[jewelry-prefix] Ring',
'Amulet [jewelry-suffix]',
'Amulet [jewelry-suffix]',
'[jewelry-prefix] Amulet',
'[jewelry-prefix] Amulet',
'[jewelry-prefix] Ring [jewelry-suffix]',
'[jewelry-prefix] Amulet [jewelry-suffix]',
'[unique-jewelry]',
),
'jewelry-prefix' => array(
'[mana-prefix]',
),
'jewelry-suffix' => array(
'[dexterity-suffix]',
'[dexterity-suffix-jewelry]',
),
'mana-prefix' => array(
'Hyena\'s (-<11-25> Mana)',
'Frog\'s (-<1-10> Mana)',
'Spider\'s (+<10-15> Mana)',
'Raven\'s (+<15-20> Mana)',
'Snake\'s (+<21-30> Mana)',
'Serpent\'s (+<31-40> Mana)',
'Drake\'s (+<41-50> Mana)',
'Dragon\'s (+<51-60> Mana)',
),
'dexterity-suffix' => array(
'of Paralysis (-<6-10> Dexterity)',
'of Atrophy (-<1-5> Dexterity)',
'of Dexterity (+<1-5> Dexterity)',
'of Skill (+<6-10> Dexterity)',
'of Accuracy (+<11-15> Dexterity)',
'of Precision (+<16-20> Dexterity)',
),
'dexterity-suffix-jewelry' => array(
'[dexterity-suffix]',
'[dexterity-suffix]',
'[dexterity-suffix]',
'[dexterity-suffix]',
'[dexterity-suffix]',
'[dexterity-suffix]',
'[dexterity-suffix]',
'[dexterity-suffix]',
'[dexterity-suffix]',
'of Perfection (+<21-30> Dexterity)',
),
'unique-jewelry' => array(
'[jewelry]',
'[jewelry]',
'[jewelry]',
'[jewelry]',
'[jewelry]',
'[jewelry]',
'[jewelry]',
'[jewelry]',
'[unique-ring]',
'[unique-amulet]',
),
'unique-ring' => array(
'The Bleeder',
'The Bramble',
'Constricting Ring',
'Empyrean Band',
'Ring of Engagement',
'Ring of Regha',
),
'unique-amulet' => array(
'Optic Amulet',
),
);
}
}