mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-09-05 22:52:32 +00:00
Merge pull request #8313 from mrianmerry/pta/capture-pokemon-adjustment
[PokemonTabletopAdventures_v3] Adds capture roll modifiers
This commit is contained in:
@@ -287,6 +287,7 @@ div.sheet-character-stat-grid p {
|
||||
|
||||
.sheet-configuration-grid {
|
||||
align-items: start;
|
||||
column-gap: 10px;
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr;
|
||||
padding: 6px;
|
||||
@@ -454,13 +455,29 @@ div.sheet-skill-selection .sheet-no-dropdown {
|
||||
}
|
||||
|
||||
.sheet-capture-pokemon-skill {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 10fr 4fr;
|
||||
align-items: center;
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 3fr 7fr 2fr 2fr;
|
||||
}
|
||||
|
||||
div.sheet-capture-pokemon-skill input[type="text"] {
|
||||
margin-left: -1px;
|
||||
width: 65% !important;
|
||||
}
|
||||
|
||||
div.sheet-capture-pokemon-skill .sheet-skill-roller {
|
||||
grid-column: 2 / end;
|
||||
}
|
||||
|
||||
div.sheet-capture-pokemon-skill select.sheet-ball-picker {
|
||||
grid-column: 1 / span 2;
|
||||
}
|
||||
|
||||
div.sheet-capture-pokemon-skill > span {
|
||||
padding-left: 10px;
|
||||
}
|
||||
|
||||
select.sheet-ball-picker {
|
||||
border: none;
|
||||
width: auto;
|
||||
}
|
||||
|
||||
@@ -668,10 +685,15 @@ input.sheet-skill-color-setting[value="SPD"] + .sheet-skill-total + button[type=
|
||||
background-color: var(--stat-ro-spd);
|
||||
}
|
||||
|
||||
input[type="number"].sheet-skill-total {
|
||||
input.sheet-skill-total {
|
||||
border: none;
|
||||
font-style: italic;
|
||||
font-weight: bold;
|
||||
width: 3.5em;
|
||||
}
|
||||
|
||||
input[type="text"].sheet-skill-total {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.sheet-stat-ball-color[type="number"] {
|
||||
|
||||
@@ -578,14 +578,17 @@
|
||||
<hr class="sheet-skill-separator" />
|
||||
<div class="sheet-capture-pokemon-skill sheet-tab-trainer">
|
||||
<input class="sheet-skill-color-setting" name="attr_capture_ability_mod" type="hidden" value="SPD" />
|
||||
<input class="sheet-skill-total" name="attr_capture_total" readonly title="Attribute: capture_total" type="number" />
|
||||
<input class="sheet-skill-total" name="attr_capture_total" readonly title="The value added to your skill check to hit a Pokémon with a Pokéball. Note - this can be ignored if the target Pokémon is at or below half of their max HP.
|
||||
Attribute: capture_total" type="number" />
|
||||
<button class="sheet-skill-roller" name="roll_capturecheck" type="roll"
|
||||
value="&{template:skill-roll} {{base-attribute=spd}} {{character-id=@{character_id}}} {{character-name=@{character_name}}} {{skill-name=Capture Pokémon}} {{skill-roll=[[ 1d20 + @{capture_total} ]] Capture Roll: [[ d100 + @{ball_capture_modifier} ]] }}">
|
||||
value="&{template:skill-roll} {{base-attribute=spd}} {{character-id=@{character_id}}} {{character-name=@{character_name}}} {{skill-name=Capture Pokémon}} {{skill-roll=[[ 1d20 + @{capture_total} ]] Capture Roll: [[ d100 @{ball_capture_modifier} + @{capture_roll_bonus} ]] }}">
|
||||
Capture Pokémon (<span name="attr_capture_ability_mod"></span>)
|
||||
</button>
|
||||
<select class="sheet-ball-picker sheet-no-dropdown" name="attr_ball_capture_modifier" title="Attribute: ball_capture_modifier">
|
||||
<option value="5" selected>Basic Ball</option>
|
||||
<option value="0">Great Ball</option>
|
||||
<input name="attr_capture_default_custom_modifier" type="hidden" value="0" />
|
||||
<select class="sheet-ball-picker" name="attr_ball_capture_modifier" title="Select which Pokéball you want to use - this presumes the benefit is applied for conditional balls such as Quick Ball.
|
||||
Attribute: ball_capture_modifier">
|
||||
<option value="+5" selected>Basic Ball</option>
|
||||
<option value="+0">Great Ball</option>
|
||||
<option value="-5">Ultra Ball</option>
|
||||
<option value="-20">Park Ball</option>
|
||||
<option value="-20">Safari Ball</option>
|
||||
@@ -601,8 +604,8 @@
|
||||
<option value="-10">Repeat Ball</option>
|
||||
<option value="-10">1m Timer Ball</option>
|
||||
<option value="-25">2m Timer Ball</option>
|
||||
<option value="0">Friend Ball</option>
|
||||
<option value="0">Heal Ball</option>
|
||||
<option value="+0">Friend Ball</option>
|
||||
<option value="+0">Heal Ball</option>
|
||||
<option value="-10">Dream Ball</option>
|
||||
<option value="-15">Heavy Ball</option>
|
||||
<option value="-10">Level Ball</option>
|
||||
@@ -613,8 +616,17 @@
|
||||
<option value="-12">Terrain Ball</option>
|
||||
<option value="-10">Save Ball</option>
|
||||
<option value="-100">Master Ball</option>
|
||||
<option value="?{Custom Ball Modifier|0}">Custom Ball</option>
|
||||
<option value="+ ?{Custom Ball Modifier|@{capture_default_custom_modifier}}">Custom Ball</option>
|
||||
</select>
|
||||
<span title="The modifier applied to your capture rolls because of your selected Pokéball. This value can be configured for custom balls in the Configuration page.
|
||||
Attribute: capture_display">
|
||||
<b>Ball Mod:</b>
|
||||
<input class="sheet-total-display" name="attr_capture_display" readonly type="text" />
|
||||
</span>
|
||||
<input name="attr_capture_roll_bonus" title="Use this field to assign a static modifier to your capture rolls - things like a Capture Specialist's Capture Point feature.
|
||||
Attribute: capture_roll_bonus" type="number" value="0" />
|
||||
<input class="sheet-skill-total sheet-total-display" name="attr_capture_roll_total" readonly title="The total modifier applied to your d100 capture rolls. If an asterisk * is shown, that means you've selected a custom ball.
|
||||
Attribute: capture_roll_total" type="text" />
|
||||
</div>
|
||||
</div>
|
||||
<textarea class="sheet-inventory" name="attr_inventory" placeholder="Pokéballs, Berries, Medicine, Accessories, etc." spellcheck="false" title="Attribute: inventory"></textarea>
|
||||
@@ -933,12 +945,12 @@
|
||||
<option value="grass">Grass</option>
|
||||
<option value="ground">Ground</option>
|
||||
<option value="ice">Ice</option>
|
||||
<option value="normal" selected>Normal</option>
|
||||
<option value="normal">Normal</option>
|
||||
<option value="poison">Poison</option>
|
||||
<option value="psychic">Psychic</option>
|
||||
<option value="rock">Rock</option>
|
||||
<option value="steel">Steel</option>
|
||||
<option value="typeless">Typeless</option>
|
||||
<option value="typeless" selected>Typeless</option>
|
||||
<option value="water">Water</option>
|
||||
</select>
|
||||
<p class="sheet-dark-text">
|
||||
@@ -984,6 +996,14 @@
|
||||
selector, and then assign the stat you want to use with the right selector.
|
||||
</p>
|
||||
</div>
|
||||
<div class="sheet-custom-ball-default-selecton">
|
||||
<b title="Default value: 0">Custom Ball Default:</b>
|
||||
<b class="sheet-info-tooltip" title="Default value: 0"> ℹ </b>
|
||||
<input name="attr_capture_default_custom_modifier" title="Attribute: capture_default_custom_modifier" type="text" value="0" /><br />
|
||||
<p class="sheet-dark-text">
|
||||
This setting allows you to specify a default modifier to be used for the Custom Ball when capturing pokémon. You can use an attribute for this value.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -2299,7 +2319,7 @@
|
||||
});
|
||||
|
||||
// Capture
|
||||
on("change:SPDMOD change:capture sheet:opened", function () {
|
||||
on("change:SPDMOD sheet:opened", function () {
|
||||
getAttrs([`SPDMOD`, `capture_total`], function (values) {
|
||||
const stat = parseInt(values.SPDMOD) || 0;
|
||||
const total = parseInt(values.capture_total) || -1;
|
||||
@@ -2308,6 +2328,35 @@
|
||||
});
|
||||
});
|
||||
|
||||
on("change:ball_capture_modifier change:capture_roll_bonus sheet:opened", function () {
|
||||
getAttrs(["ball_capture_modifier", "capture_default_custom_modifier", "capture_roll_bonus"], function (values) {
|
||||
|
||||
const ball = values.ball_capture_modifier;
|
||||
const bonus = parseInt(values.capture_roll_bonus) || 0;
|
||||
|
||||
var display;
|
||||
var isCustomPokeball = false;
|
||||
if (ball.includes("Custom")) {
|
||||
display = values.capture_default_custom_modifier;
|
||||
isCustomPokeball = true;
|
||||
} else {
|
||||
display = ball;
|
||||
}
|
||||
|
||||
var total = bonus;
|
||||
if (isCustomPokeball) {
|
||||
total = `${total}*`;
|
||||
} else {
|
||||
total += parseInt(display) || 0;
|
||||
}
|
||||
|
||||
setAttrs({
|
||||
"capture_display": display,
|
||||
"capture_roll_total": total
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function getSkillAttributes(statLabel, talent1Label, talent2Label, userBonusLabel, totalLabel) {
|
||||
getAttrs([statLabel, talent1Label, talent2Label, totalLabel, userBonusLabel], function (attributes) {
|
||||
const stat = parseInt(attributes[statLabel]) || 0;
|
||||
|
||||
@@ -23,6 +23,13 @@ Things we want to add to the character sheet, presented in no particular order o
|
||||
|
||||
## Changelog
|
||||
|
||||
### Feb 18th, 2021
|
||||
|
||||
- Expanded the Capture Pokémon skill, allowing modifiers such as Capture Point to be applied
|
||||
- Improved the display of the Pokéball selection, and added a display of the effect that each has on the capture roll
|
||||
- Added a display of the total modifier to capture rolls
|
||||
- Added the option of configuring the default value for Custom Pokéballs
|
||||
|
||||
### Feb 11th, 2021
|
||||
|
||||
- Resolved a small issue with the move repeating section where the button to collapse the fields would show a `+` instead of a `-`
|
||||
|
||||
Reference in New Issue
Block a user