Skip to content

Commit

Permalink
v1.0.7
Browse files Browse the repository at this point in the history
Added tooltips to weapon qualities in the chat window
  • Loading branch information
ELH-mk1 committed Aug 31, 2024
1 parent 8af469a commit 2a05afb
Showing 5 changed files with 81 additions and 26 deletions.
Binary file added package/sta2e-1.0.7.zip
Binary file not shown.
23 changes: 22 additions & 1 deletion src/lang/en.json
Original file line number Diff line number Diff line change
@@ -209,5 +209,26 @@
"sta.dice.dsn.ufp.gold": "UFP Gold",
"sta.dice.dsn.ufp.red": "UFP Red",
"sta.dice.dsn.ufp.theme.black": "Star Trek Adventures UFP (Black)",
"sta.dice.dsn.ufp.theme.white": "Star Trek Adventures UFP (White)"
"sta.dice.dsn.ufp.theme.white": "Star Trek Adventures UFP (White)",

"sta.actor.belonging.weapon.areatooltip": "This weapon impacts a wider area and can affect several targets at once. When you succeed at an attack, additional targets in the same zone may be hit by spending 1 Momentum for each additional target (Repeatable). This attack may Succeed at Cost (see page 259)",
"sta.actor.belonging.weapon.intensetooltip": "When making an attack with this weapon, you may increase the damage by 1 by spending 1 Momentum, rather than 2. This is Repeatable.",
"sta.actor.belonging.weapon.accuratetooltip": "If you perform the Aim minor action before making an attack with this weapon, you may re-roll up to two d20s in your dice pool, rather than only one.",
"sta.actor.belonging.weapon.chargetooltip": "If you perform the Prepare minor action before attacking with this weapon, you may add one of the following qualities to the attack: Area, Intense, or Piercing. If you choose Area, the attack’s severity is reduced by 1.",
"sta.actor.belonging.weapon.cumbersometooltip": "You cannot attack with a cumbersome weapon unless you take the Prepare minor action on the same turn.",
"sta.actor.belonging.weapon.debilitatingtooltip": "The Difficulty to treat or to heal injuries caused by this weapon is increased by 1",
"sta.actor.belonging.weapon.depletingtooltip": "This attack strips away the protective layers of deflector shields. The attack cannot cause the ship to be shaken, but the Momentum cost to increase damage is reduced to 1",
"sta.actor.belonging.weapon.grenadetooltip": "You can attack a target at up to Medium range and have enough grenades for three separate attacks",
"sta.actor.belonging.weapon.inaccuratetooltip": "The weapon is imprecise and clumsy. You do not benefit from the Aim minor action when making an attack with this weapon.",
"sta.actor.belonging.weapon.spreadtooltip": "Attacks with this weapon reduce the cost of the Devastating Attack Momentum spend to 1. This is Repeatable",
"sta.actor.belonging.weapon.dampeningtooltip": "This attack drains the target’s reserve power, causing widespread disruption. If the target has Reserve Power available, it loses Reserve Power",
"sta.actor.belonging.weapon.calibrationtooltip": "This weapon needs to be calibrated before firing. The weapon cannot be fired unless a Prepare minor action is performed before the Attack major action in the same turn.",
"sta.actor.belonging.weapon.devastatingtooltip": "Tasks to repair breaches caused by this weapon increase in Difficulty by 1.",
"sta.actor.belonging.weapon.highyieldtooltip": "This weapon inflicts massive damage to energy vessels. If the attack inflicts one or more breaches to a system, it inflicts one additional breach (or steps up the Potency of a breach inflicted by 1—attacker’s choice)",
"sta.actor.belonging.weapon.hiddenxtooltip": "This weapon system is concealed from scans. When the weapon is hidden, it cannot be detected unless a specific scan is attempted; this scan is a task with a Difficulty of X.",
"sta.actor.belonging.weapon.piercingxtooltip": "Ignore the target's Protection and Resistance rating(s).",
"sta.actor.belonging.weapon.versatilextooltip": "If an attack with this weapon is successful, it gains X points of bonus Momentum. Bonus Momentum cannot be saved.",
"sta.actor.belonging.weapon.persistentxtooltip": "When this weapon hits, you may spend 1–3 Momentum. At the end of each round, the target suffers half the weapon’s damage rating (round up) again. This effect lasts for a number of rounds equal to the Momentum spent.",
"sta.actor.belonging.weapon.slowingtooltip": "Until the end of the current round, characters aboard the target vessel cannot use the Keep the Initiative Momentum spend",
"sta.actor.belonging.weapon.jammingtooltip": "This weapon sends out a scattering field, disrupting the target’s sensors or communications systems. Until the end of the current round, the target increases the Difficulty for all tasks assisted by Communications and Sensors by 1."
}
43 changes: 21 additions & 22 deletions src/module/roll.js
Original file line number Diff line number Diff line change
@@ -442,31 +442,30 @@ export class STARoll {
if (item.system.qualities.melee) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.melee')+'</div>';
if (item.system.qualities.ranged) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.ranged')+'</div>';
// Space tags
if (item.system.range == "close") tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.close')+'</div>';
if (item.system.range == "close") tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.close')+ '</div>';
if (item.system.range == "medium") tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.medium')+'</div>';
if (item.system.range == "long") tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.long')+'</div>';

if (item.system.qualities.accurate) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.accurate')+'</div>';

if (item.system.qualities.area) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.area')+'</div>';
if (item.system.qualities.calibration) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.calibration')+'</div>';
if (item.system.qualities.charge) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.charge')+'</div>';
if (item.system.qualities.cumbersome) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.cumbersome')+'</div>';
if (item.system.qualities.dampening) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.dampening')+'</div>';
if (item.system.qualities.debilitating) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.debilitating')+'</div>';
if (item.system.qualities.depleting) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.depleting')+'</div>';
if (item.system.qualities.devastating) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.devastating')+'</div>';
if (item.system.qualities.grenade) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.grenade')+'</div>';
if (item.system.qualities.hiddenx > 0) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.hiddenx') + ' ' + item.system.qualities.hiddenx +'</div>';
if (item.system.qualities.highyield) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.highyield')+'</div>';
if (item.system.qualities.inaccurate) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.inaccurate')+'</div>';
if (item.system.qualities.intense) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.intense')+'</div>';
if (item.system.qualities.jamming) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.jamming')+'</div>';
if (item.system.qualities.persistentx) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.persistentx')+'</div>';
if (item.system.qualities.piercingx) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.piercingx')+'</div>';
if (item.system.qualities.slowing) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.slowing')+'</div>';
if (item.system.qualities.spread) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.spread')+'</div>';
if (item.system.qualities.versatilex > 0) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.versatilex') + ' ' + item.system.qualities.versatilex +'</div>';
if (item.system.qualities.accurate) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.accurate')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.accuratetooltip') + '</span>' +'</div>';
if (item.system.qualities.area) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.area')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.areatooltip') + '</span>' +'</div>';
if (item.system.qualities.calibration) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.calibration')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.calibrationtooltip') + '</span>' +'</div>';
if (item.system.qualities.charge) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.charge')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.chargetooltip') + '</span>' +'</div>';
if (item.system.qualities.cumbersome) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.cumbersome')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.cumbersometooltip') + '</span>' +'</div>';
if (item.system.qualities.dampening) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.dampening')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.dampeningtooltip') + '</span>' +'</div>';
if (item.system.qualities.debilitating) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.debilitating')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.debilitatingtooltip') + '</span>' +'</div>';
if (item.system.qualities.depleting) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.depleting')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.depletingtooltip') + '</span>' +'</div>';
if (item.system.qualities.devastating) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.devastating')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.devastatingtooltip') + '</span>' +'</div>';
if (item.system.qualities.grenade) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.grenade')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.grenadetooltip') + '</span>' +'</div>';
if (item.system.qualities.hiddenx > 0) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.hiddenx') + ' ' + item.system.qualities.hiddenx + '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.hiddenxtooltip') + '</span>' +'</div>';
if (item.system.qualities.highyield) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.highyield')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.highyieldtooltip') + '</span>' +'</div>';
if (item.system.qualities.inaccurate) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.inaccurate')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.inaccuratetooltip') + '</span>' +'</div>';
if (item.system.qualities.intense) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.intense')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.intensetooltip') + '</span>' +'</div>';
if (item.system.qualities.jamming) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.jamming')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.jammingtooltip') + '</span>' +'</div>';
if (item.system.qualities.persistentx) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.persistentx')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.persistentxtooltip') + '</span>' +'</div>';
if (item.system.qualities.piercingx) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.piercingx')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.piercingxtooltip') + '</span>' +'</div>';
if (item.system.qualities.slowing) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.slowing')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.slowingtooltip') + '</span>' +'</div>';
if (item.system.qualities.spread) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.spread')+ '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.spreadtooltip') + '</span>' +'</div>';
if (item.system.qualities.versatilex > 0) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.versatilex') + ' ' + item.system.qualities.versatilex + '<span class=\'tooltiptext\'> '+game.i18n.format('sta.actor.belonging.weapon.versatilextooltip') + '</span>' +'</div>';

//if (item.system.qualities.deadly) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.deadly')+'</div>';
//if (item.system.qualities.stun) tags += '<div class=\'tag\'> '+game.i18n.format('sta.actor.belonging.weapon.stun')+'</div>';
37 changes: 36 additions & 1 deletion src/sta.css
Original file line number Diff line number Diff line change
@@ -661,14 +661,49 @@
flex-direction: row;
text-align: center;
flex-wrap: wrap; }
.sta.roll.generic .dice-roll .dice-result .tags .tag {
.sta.roll.generic .dice-roll .dice-result .tags .tag {
position: relative;
width: calc(100%/3);
font-size: 12px;
flex-grow: 1;
border: 0.5px solid #0F0F0F;
border-radius: 3px;
background-color: rgba(255, 255, 255, 0.3); }

.sta.roll.generic .dice-roll .dice-result .tags .tag .tooltiptext {
visibility: hidden;
width: 100px;
background-color: black;
font-size: 10px;
color: #fff;
text-align: center;
border-radius: 6px;
padding: 8px 0;

/* Position the tooltip */
position: absolute;
z-index: 1;
bottom: 100%;
left: 50%;
margin-left: -50px;

opacity: 0;
transition: opacity 1s;}

.sta.roll.generic .dice-roll .dice-result .tags .tag:hover .tooltiptext {
visibility: visible;
opacity: 1}

.sta.roll.generic .dice-roll .dice-result .tags .tag .tooltiptext::after {
content: " ";
position: absolute;
top: 100%; /* At the bottom of the tooltip */
left: 50%;
margin-left: -5px;
border-width: 5px;
border-style: solid;
border-color: black transparent transparent transparent; }

.sta.roll.generic .dice-roll .dice-total.effect {
color: #33CCCC; }

4 changes: 2 additions & 2 deletions src/system.json
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
"id": "sta2e",
"title": "Star Trek Adventures (2nd Edition)",
"description": "An -UNOFFICIAL- rendition of the Modiphius TTRPG System.",
"version": "1.0.6",
"version": "1.0.7",
"compatibility": {
"minimum": "9",
"verified": "12"
@@ -60,5 +60,5 @@
"url": "https://github.com/ELH-mk1/sta2e",
"background": "systems/sta2e/assets/splash.webp",
"manifest": "https://raw.githubusercontent.com/ELH-mk1/sta2e/master/src/system.json",
"download": "https://raw.githubusercontent.com/ELH-mk1/sta2e/master/package/sta2e-1.0.6.zip"
"download": "https://raw.githubusercontent.com/ELH-mk1/sta2e/master/package/sta2e-1.0.7.zip"
}

0 comments on commit 2a05afb

Please sign in to comment.