|
|
@ -0,0 +1,141 @@ |
|
|
|
|
|
|
|
from JJMumbleBot.lib.plugin_template import PluginBase |
|
|
|
|
|
|
|
from JJMumbleBot.lib.utils.plugin_utils import PluginUtilityService |
|
|
|
|
|
|
|
from JJMumbleBot.lib.utils.logging_utils import log |
|
|
|
|
|
|
|
from JJMumbleBot.lib.utils.print_utils import PrintMode |
|
|
|
|
|
|
|
from JJMumbleBot.plugins.extensions.randomizer.resources.strings import CMD_INVALID_CUSTOM_ROLL |
|
|
|
|
|
|
|
from JJMumbleBot.settings import global_settings as gs |
|
|
|
|
|
|
|
from JJMumbleBot.lib.resources.strings import * |
|
|
|
|
|
|
|
import os |
|
|
|
|
|
|
|
import random |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class Plugin(PluginBase): |
|
|
|
|
|
|
|
def __init__(self): |
|
|
|
|
|
|
|
super().__init__() |
|
|
|
|
|
|
|
from json import loads |
|
|
|
|
|
|
|
self.plugin_name = os.path.basename(__file__).rsplit('.')[0] |
|
|
|
|
|
|
|
self.metadata = PluginUtilityService.process_metadata(f'plugins/extensions/{self.plugin_name}') |
|
|
|
|
|
|
|
self.plugin_cmds = loads(self.metadata.get(C_PLUGIN_INFO, P_PLUGIN_CMDS)) |
|
|
|
|
|
|
|
self.is_running = True |
|
|
|
|
|
|
|
log( |
|
|
|
|
|
|
|
INFO, |
|
|
|
|
|
|
|
f"{self.metadata[C_PLUGIN_INFO][P_PLUGIN_NAME]} v{self.metadata[C_PLUGIN_INFO][P_PLUGIN_VERS]} Plugin Initialized.", |
|
|
|
|
|
|
|
origin=L_STARTUP, |
|
|
|
|
|
|
|
print_mode=PrintMode.REG_PRINT.value |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def quit(self): |
|
|
|
|
|
|
|
self.is_running = False |
|
|
|
|
|
|
|
log( |
|
|
|
|
|
|
|
INFO, |
|
|
|
|
|
|
|
f"Exiting {self.plugin_name} plugin...", |
|
|
|
|
|
|
|
origin=L_SHUTDOWN, |
|
|
|
|
|
|
|
print_mode=PrintMode.REG_PRINT.value |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def stop(self): |
|
|
|
|
|
|
|
if self.is_running: |
|
|
|
|
|
|
|
self.quit() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def start(self): |
|
|
|
|
|
|
|
if not self.is_running: |
|
|
|
|
|
|
|
self.__init__() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_init(self, data): |
|
|
|
|
|
|
|
all_data = data.message.strip().split() |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
number_of_dice = int(all_data[1]) |
|
|
|
|
|
|
|
init_bonus = int(all_data[2]) |
|
|
|
|
|
|
|
ret_text = "<br><font color='red'>Init Roll:</font><br><font colour='blue'>" |
|
|
|
|
|
|
|
result = 0 |
|
|
|
|
|
|
|
for i in range(number_of_dice): |
|
|
|
|
|
|
|
random.seed(int.from_bytes(os.urandom(8), byteorder="big")) |
|
|
|
|
|
|
|
this_die = random.randint(1,6) |
|
|
|
|
|
|
|
result = result + this_die |
|
|
|
|
|
|
|
ret_text += f"{this_die} + " |
|
|
|
|
|
|
|
result = result + init_bonus |
|
|
|
|
|
|
|
ret_text += f" {init_bonus} </font><br><font color='yellow'> {result}</font>" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='left') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except IndexError: |
|
|
|
|
|
|
|
log(ERROR, CMD_INVALID_CUSTOM_ROLL, |
|
|
|
|
|
|
|
origin=L_COMMAND, error_type=CMD_INVALID_ERR, print_mode=PrintMode.VERBOSE_PRINT.value) |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(CMD_INVALID_CUSTOM_ROLL, |
|
|
|
|
|
|
|
text_type='header', box_align='left') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_srun(self, data): |
|
|
|
|
|
|
|
all_data = data.message.strip().split() |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
number_of_dice = int(all_data[1]) |
|
|
|
|
|
|
|
ret_text = "<br><font color='red'>Die Pool:</font><br><font colour='blue'>" |
|
|
|
|
|
|
|
successes = 0 |
|
|
|
|
|
|
|
ones = 0 |
|
|
|
|
|
|
|
for i in range(number_of_dice): |
|
|
|
|
|
|
|
random.seed(int.from_bytes(os.urandom(8), byteorder="big")) |
|
|
|
|
|
|
|
this_die = random.randint(1,6) |
|
|
|
|
|
|
|
ret_text += f"{this_die}, " |
|
|
|
|
|
|
|
if this_die > 4: |
|
|
|
|
|
|
|
successes = successes + 1 |
|
|
|
|
|
|
|
if this_die == 1: |
|
|
|
|
|
|
|
ones = ones + 1 |
|
|
|
|
|
|
|
ret_text += f"<br>Successes: {successes} , Ones: {ones}" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='left') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except IndexError: |
|
|
|
|
|
|
|
log(ERROR, CMD_INVALID_CUSTOM_ROLL, |
|
|
|
|
|
|
|
origin=L_COMMAND, error_type=CMD_INVALID_ERR, print_mode=PrintMode.VERBOSE_PRINT.value) |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(CMD_INVALID_CUSTOM_ROLL, |
|
|
|
|
|
|
|
text_type='header', box_align='left') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_preedge(self, data): |
|
|
|
|
|
|
|
all_data = data.message.strip().split() |
|
|
|
|
|
|
|
try: |
|
|
|
|
|
|
|
number_of_dice = int(all_data[1]) |
|
|
|
|
|
|
|
ret_text = "<br><font color='red'>Die Pool:</font><br><font colour='blue'>" |
|
|
|
|
|
|
|
successes = 0 |
|
|
|
|
|
|
|
ones = 0 |
|
|
|
|
|
|
|
explosions = 0 |
|
|
|
|
|
|
|
i = 0 |
|
|
|
|
|
|
|
while i < number_of_dice: |
|
|
|
|
|
|
|
random.seed(int.from_bytes(os.urandom(8), byteorder="big")) |
|
|
|
|
|
|
|
this_die = random.randint(1,6) |
|
|
|
|
|
|
|
ret_text += f"{this_die}, " |
|
|
|
|
|
|
|
if this_die > 4: |
|
|
|
|
|
|
|
successes = successes + 1 |
|
|
|
|
|
|
|
if this_die == 1: |
|
|
|
|
|
|
|
ones = ones + 1 |
|
|
|
|
|
|
|
if this_die == 6: |
|
|
|
|
|
|
|
i = i-1 |
|
|
|
|
|
|
|
explosions = explosions + 1 |
|
|
|
|
|
|
|
i = i + 1 |
|
|
|
|
|
|
|
ret_text += f"<br>Successes: {successes} , Ones: {ones} , Explosions: {explosions}" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='left') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
except IndexError: |
|
|
|
|
|
|
|
log(ERROR, CMD_INVALID_CUSTOM_ROLL, |
|
|
|
|
|
|
|
origin=L_COMMAND, error_type=CMD_INVALID_ERR, print_mode=PrintMode.VERBOSE_PRINT.value) |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(CMD_INVALID_CUSTOM_ROLL, |
|
|
|
|
|
|
|
text_type='header', box_align='left') |
|
|
|
|
|
|
|
return |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_assensing(self, data): |
|
|
|
|
|
|
|
ret_text = "<table border=\"1\" style=\"text-align:center;background:black;color:white;\"><caption style=\"color:gold;\">ASSENSING TABLE</caption><tbody><tr><th style=\"background:black;color:gold;\">HITS</th><th style=\"background:black;color:gold;\">INFORMATION GAINED</th></tr><tr><td>0</td><td>None</td></tr><tr><td>1</td><td>The general state of the subject’s health (healthy, injured, ill, etc.). The subject’s general emotional state or impression (happy, sad, angry, etc.). Whether the subject is mundane or Awakened. </td></tr><tr><td>2</td><td>The presence and location of cyberware implants. The class of a magical subject (fire elemental, manipulation spell, power focus, curse ritual, and so on). If you have seen the subject’s aura before, you may recognize it, regardless of physical disguises or alterations</td></tr><tr><td>3</td><td>The presence and location of alphaware cyber implants. Whether the subject’s Essence and Magic are higher, lower, or equal to your own. Whether the subject’s Force is higher, lower, or equal to your Magic. A general diagnosis for any maladies (diseases or toxins) the subject suffers. Any astral signatures present on the subject. </td></tr><tr><td>4</td><td>The presence and location of bioware implants and betaware cyber implants. The exact Essence, Magic, and Force of the subject. The general cause of any astral signature (combat spell, alchemical combat spell, air spirit, and so on). </td></tr><tr><td>5+</td><td>The presence and location of deltaware implants, gene treatments, and nanotech. An accurate diagnosis of any disease or toxins which afflict the subject. The fact that a subject is a technomancer. </td></tr></tbody></table>" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='center') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_delivery(self, data): |
|
|
|
|
|
|
|
ret_text = "<table border=\"1\" style=\"text-align:center;background:black;color:white;\"> <caption style=\"color:gold;\">DELIVERY TIMES TABLE </caption> <tbody><tr> <th style=\"background:black;color:gold;\">GEAR COST </th> <th style=\"background:black;color:gold;\">DELIVERY TIME </th></tr> <tr> <td>Up to 100¥</td> <td>6 hours </td></tr> <tr> <td>101¥ to 1,000¥</td> <td>1 day </td></tr> <tr> <td>1,000¥ to 10,000¥</td> <td>2 days </td></tr> <tr> <td>10,001 to 100,000¥</td> <td>1 week </td></tr> <tr> <td>More than 100,000¥</td> <td>1 month </td></tr></tbody></table>" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='center') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_concealability(self, data): |
|
|
|
|
|
|
|
ret_text = "<table class=\"wikitable\" border=\"1\" style=\"text-align:center;background:black;\"> <caption style=\"color:gold;\">CONCEALABILITY MODIFIERS </caption> <caption style=\"color:black;\">*Applies to observer </caption> <tbody><tr> <th style=\"background:black;color:gold;\">MODIFIER*</th> <th style=\"background:black;color:gold;\">EXAMPLE ITEMS </th></tr> <tr> <td style=\"background:black;color:white;\">–6 </td> <td style=\"background:black;color:white;text-align:left;\">RFID tag, bug slap patch, microdrone, contact lenses </td></tr> <tr> <td style=\"background:black;color:white;\">–4 </td> <td style=\"background:black;color:white;text-align:left;\">Hold-out pistol, monowhip, ammo clip, credstick, chips/softs, sequencer/passkey, autopicker, lockpick set, commlink, glasses </td></tr> <tr> <td style=\"background:black;color:white;\">–2 </td> <td style=\"background:black;color:white;text-align:left;\">Light pistol, knife, sap, minidrone, microgrenade, flash-pak, jammer, cyberdeck, rigger command console </td></tr> <tr> <td style=\"background:black;color:white;\">0 </td> <td style=\"background:black;color:white;text-align:left;\">Heavy pistol, machine pistol with folding stock collapsed, grenade, goggles, ammo belt/drum, club, extendable baton (collapsed) </td></tr> <tr> <td style=\"background:black;color:white;\">+2 </td> <td style=\"background:black;color:white;text-align:left;\">SMG, machine pistol with folding stock extended, medkit, small drone, extendable baton (extended), stun baton </td></tr> <tr> <td style=\"background:black;color:white;\">+4 </td> <td style=\"background:black;color:white;text-align:left;\">Sword, sawed-off shotgun, bullpup assault rifle </td></tr> <tr> <td style=\"background:black;color:white;\">+6 </td> <td style=\"background:black;color:white;text-align:left;\">Katana, monosword, shotgun, assault rifle, sport rifle, crossbow </td></tr> <tr> <td style=\"background:black;color:white;\">+8 </td> <td style=\"background:black;color:white;text-align:left;\">Sniper rifle, bow, grenade launcher, medium drone </td></tr> <tr> <td style=\"background:black;color:white;\">+10/Forget about it </td> <td style=\"background:black;color:white;text-align:left;\">Machine gun, rocket launcher, missile launcher, staff, claymore, metahuman body </td></tr></tbody></table>" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='center') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_perception_mods(self, data): |
|
|
|
|
|
|
|
ret_text = "<table class=\"wikitable\" border=\"1\" style=\"text-align:center;background:black;color:white;\"> <caption style=\"color:gold;\">PERCEPTION TEST MODIFIERS </caption> <tbody><tr> <th style=\"background:black;color:gold;\">SITUATION </th> <th style=\"background:black;color:gold;\">DICE POOL MODIFIER </th></tr> <tr> <td>Perceiver is distracted</td> <td>-2 </td></tr> <tr> <td>Perciever is specifically looking/listening for it</td> <td>+3 </td></tr> <tr> <td>Object/sound not in immediate vicinity</td> <td>-2 </td></tr> <tr> <td>Object/sound far away</td> <td>-3 </td></tr> <tr> <td>Object/sound stands out in some way</td> <td>+2 </td></tr> <tr> <td>Interfering sight/odor/sound</td> <td>-2 </td></tr> <tr> <td>Perceiver has active enhancements</td> <td>+ Rating </td></tr> <tr> <td>Visibility and Light</td> <td>Environmental Factors (Above) </td></tr></tbody></table> <table class=\"wikitable\" border=\"1\" style=\"text-align:center;background:black;color:white;\"> <caption style=\"color:black;\">PERCEPTION THRESHOLDS </caption> <tbody><tr> <th style=\"background:black;color:gold;\">ITEM/EVENT IS: </th> <th style=\"background:black;color:gold;\">THRESHOLD </th> <th style=\"background:black;color:gold;\">EXAMPLES </th></tr> <tr> <td>Obvious</td> <td>1</td> <td>Neon sign, running crowd, yelling, gunfire </td></tr> <tr> <td>Normal</td> <td>2</td> <td>Street sign, pedestrian, conversation, silenced gunfire </td></tr> <tr> <td>Obscured/Small/Muffled</td> <td>3</td> <td>Item dropped under table, contact lens, whispering </td></tr> <tr> <td>Hidden/Micro/Silent</td> <td>4</td> <td>Secret door, needle in haystack, subvocal speech </td></tr></tbody></table>" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='center') |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def cmd_environmental(self, data): |
|
|
|
|
|
|
|
ret_text = "<table class=\"wikitable\" border=\"1\" style=\"text-align:center;background:black;color:white;\"> <caption style=\"color:gold;\">ENVIRONMENTAL </caption> <tbody><tr> <th style=\"background:black;color:gold;\">VISIBILITY </th> <th style=\"background:black;color:gold;\">LIGHT / GLARE </th> <th style=\"background:black;color:gold;\">WIND </th> <th style=\"background:black;color:gold;\">RANGE </th> <th style=\"background:black;color:gold;\">MODIFIER </th></tr> <tr> <td>Clear</td> <td>Full Light / No Glare</td> <td>None / Light Breeze</td> <td>Short</td> <td>0 </td></tr> <tr> <td>Light Rain / Fog / Smoke</td> <td>Partial Light / Weak Glare</td> <td>Light Winds / Light Breeze</td> <td>Medium</td> <td>-1 </td></tr> <tr> <td>Moderate Rain / Fog / Smoke</td> <td>Dim Light / Moderate Glare</td> <td>Moderate Winds / Light Breeze</td> <td>Long</td> <td>-3 </td></tr> <tr> <td>Heavy Rain / Fog / Smoke</td> <td>Total Darkness/ Blinding Glare</td> <td>Strong Winds / Light Breeze</td> <td>Extreme</td> <td>-6 </td></tr> <tr> <td>Combination of two or more conditions at the -6 level row</td> <td></td> <td></td> <td></td> <td>-10 </td></tr></tbody></table>" |
|
|
|
|
|
|
|
gs.gui_service.quick_gui(ret_text, text_type='header', box_align='center') |