New form options, new buttons to enable forms

This commit is contained in:
Adam Talbot
2023-02-17 22:11:39 -05:00
parent 09335c9e3e
commit 04150ae21b
2 changed files with 519 additions and 9 deletions
+62
View File
@@ -604,6 +604,15 @@ div.sheet-skill-selection .sheet-no-dropdown {
margin-top: -15px;
}
.sheet-form-buttons {
display: grid;
row-gap: 5px;
justify-items: end;
position: absolute;
top: 10px;
right: 10px;
}
.sheet-inventory {
display: flex;
flex-direction: column;
@@ -771,6 +780,15 @@ label.sheet-afflictions-text {
width: 70px;
}
.charsheet input.sheet-custom-move-name[type="text"] {
border: 2px var(--foreground-color);
border-style: none none solid none;
color: var(--foreground-color);
vertical-align: revert;
width: 300px;
font-size: 18px;
}
.charsheet input.sheet-affliction-display[type="text"] {
border: none;
color: var(--foreground-color);
@@ -985,6 +1003,13 @@ input.sheet-character-type[value="hybrid"] ~ div.sheet-tab-hybrid {
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
}
.sheet-pokemon-form-stats-grid {
display: grid;
justify-items: center;
text-align: center;
grid-template-columns: 1fr 1fr 1fr 1fr 1fr;
}
/* Stat Colors */
.sheet-attack-color[type="number"] {
@@ -1782,6 +1807,43 @@ button[type="roll"].sheet-inline-roller {
width: 0%;
}
.sheet-enable-tera:not(:checked) ~ div.sheet-tera-enabled {
display: none;
}
.sheet-enable-tera:checked ~ div.sheet-tera-enabled {
display: inline-block;
}
.sheet-enable-dyna:not(:checked) ~ div.sheet-dyna-enabled {
display: none;
}
.sheet-enable-dyna:checked ~ div.sheet-dyna-enabled {
display: inline-block;
}
.sheet-enable-mega:not(:checked) ~ div.sheet-mega-enabled {
display: none;
}
.sheet-enable-mega:checked ~ div.sheet-mega-enabled {
display: inline-block;
}
.sheet-enable-custom1:not(:checked) ~ div.sheet-custom1-enabled {
display: none;
}
.sheet-enable-custom1:checked ~ div.sheet-custom1-enabled {
display: inline-block;
}
.sheet-enable-custom2:not(:checked) ~ div.sheet-custom2-enabled {
display: none;
}
.sheet-enable-custom2:checked ~ div.sheet-custom2-enabled {
display: inline-block;
}
.sheet-enable-custom3:not(:checked) ~ div.sheet-custom3-enabled {
display: none;
}
.sheet-enable-custom3:checked ~ div.sheet-custom3-enabled {
display: inline-block;
}
/* For your PokeGear and other mobile devices */
@media only screen and (max-width: 480px) {
.sheet-wrapper {
+457 -9
View File
@@ -1,5 +1,5 @@
<!-- Background coloring strategy inspired by the GURPS sheet -->
<input class="sheet-color-setting" name="attr_type1" type="hidden" value="typeless" />
<input class="sheet-color-setting" name="attr_active_type1" type="hidden" value="typeless" />
<div class="sheet-wrapper sheet-color-background">
<div class="sheet-page-selection">
<button class="sheet-page-selection-option" name="act_character-page" type="action">Character</button>
@@ -9,6 +9,10 @@
<button class="sheet-page-selection-option" name="act_toggle-roll-publicity" type="action"><span name="attr_publicity_label"></span></button>
</div>
<div class="sheet-character-page">
</div>
<input class="sheet-selected-page" name="attr_selected-page" type="hidden" value="configuration-page" />
<!-- CHARACTER PAGE -->
@@ -19,6 +23,39 @@
<img src="https://raw.githubusercontent.com/Roll20/roll20-character-sheets/master/PokemonTabletopAdventures_v3/images/PTA3SmallLogo.png" />
</p>
<!-- Form Activation buttons -->
<div class="sheet-tab-pokemon sheet-tab-hybrid">
<div class="sheet-form-buttons">
<input class="sheet-enable-tera" name="attr_enable-tera" readonly hidden type="checkbox" />
<div class="sheet-tera-enabled">
<input name="attr_tera_label" type="hidden" value="Terastallize" />
<button class="sheet-page-selection-option" name="act_activate-tera" type="action"><span name="attr_tera_label"></span></button>
</div>
<input class="sheet-enable-dyna" name="attr_enable-dyna" readonly hidden type="checkbox" />
<div class="sheet-dyna-enabled">
<input name="attr_dyna_label" type="hidden" value="Dynamax" />
<button class="sheet-page-selection-option" name="act_activate-dyna" type="action"><span name="attr_dyna_label"></span></button>
</div>
<input class="sheet-enable-mega" name="attr_enable-mega" readonly hidden type="checkbox" />
<div class="sheet-mega-enabled">
<input name="attr_mega_label" type="hidden" value="Mega Evolve" />
<button class="sheet-page-selection-option" name="act_activate-mega" type="action"><span name="attr_mega_label"></span></button>
</div>
<input class="sheet-enable-custom1" name="attr_enable-custom1" readonly hidden type="checkbox" />
<div class="sheet-custom1-enabled">
<button class="sheet-page-selection-option" name="act_activate-custom1" type="action"><span name="attr_custom1_label"></span></button>
</div>
<input class="sheet-enable-custom2" name="attr_enable-custom2" readonly hidden type="checkbox" />
<div class="sheet-custom2-enabled">
<button class="sheet-page-selection-option" name="act_activate-custom2" type="action"><span name="attr_custom2_label"></span></button>
</div>
<input class="sheet-enable-custom3" name="attr_enable-custom3" readonly hidden type="checkbox" />
<div class="sheet-custom3-enabled">
<button class="sheet-page-selection-option" name="act_activate-custom3" type="action"><span name="attr_custom3_label"></span></button>
</div>
</div>
</div>
<div class="sheet-tab-trainer">
<div class="sheet-2col-centered">
<div class="sheet-character-name-grid">
@@ -1249,8 +1286,8 @@
<h2>Configuration Options</h2>
<div class="sheet-configuration-grid sheet-text-background">
<div class="sheet-character-type">
<b title="Default value: Trainer">Character Type:</b>
<b class="sheet-info-tooltip" title="Default value: Trainer"> </b>
<b title="Default value: Pokémon">Character Type:</b>
<b class="sheet-info-tooltip" title="Default value: Pokémon"> </b>
<select class="sheet-character-type sheet-no-dropdown" name="attr_character-type" title="Attribute: character-type">
<option value="trainer">Trainer</option>
<option value="pokemon" selected>Pokémon</option>
@@ -1388,6 +1425,325 @@
<textarea name="attr_json_export" title="Attribute: json_export" type="text"></textarea>
</div>
</div>
<h2>Transformations</h2>
<div class="sheet-configuration-grid sheet-text-background">
<div class="sheet-tera-config">
<h3><label class="sheet-afflictions-text"><input class="sheet-enable-tera" name="attr_enable-tera" type="checkbox" /> Terastallization</label></h3>
<p class="sheet-dark-text">
Check to enable the Terastal phenomenon. Select your Tera Type, and it will replace your current type when you Terastallize.
When Terastallized, your Defense and Special Defense are increased by +3. Even if other transformations are active, you will
stay as your Tera Type as long as you are Terastallized.
</p>
<b title="Default value: Normal">Tera Type: </b>
<select class="sheet-no-dropdown" name="attr_tera-type" title="Attribute: tera-type">
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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" selected>Typeless</option>
<option value="water">Water</option>
</select>
<textarea class="sheet-3row-textarea" name="attr_tera-notes" placeholder="Additional Terastallization Notes" spellcheck="false" title="Attribute: tera-notes"></textarea>
</div>
<div class="sheet-dyna-config">
<h3><label class="sheet-afflictions-text"><input name="attr_enable-dyna" type="checkbox" /> Dynamax/Gigantamax</label></h3>
<p class="sheet-dark-text">
Check to enable Dynamax (or Gigantamax). When Dynamaxed, your max HP is updated to 5 times your normal max HP.
When Dynamaxed, you can only move 10 ft per round, and your size and weight are changed to "Dynamic."
</p>
<textarea class="sheet-3row-textarea" name="attr_dyna-notes" placeholder="Additional Dynamax Notes" spellcheck="false" title="Attribute: dyna-notes"></textarea>
</div>
<div class="sheet-mega-config">
<h3><label class="sheet-afflictions-text"><input name="attr_enable-mega" type="checkbox" /> Mega Evolution</label></h3>
<p class="sheet-dark-text">
Check to enable Mega Evolution. Select the type for your Mega Form, and it will replace your current type when you Mega Evolve.
When Mega Evolved, your stats are changed based on the modifiers below. For example, if you normally have 8 Attack,
and you specify 4 in the box below, you will have 12 Attack after Mega Evolution.
</p>
<b>Mega Type: </b>
<span>
<select class="sheet-half-text sheet-no-dropdown" name="attr_mega-type1" title="Attribute: mega-type1">
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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" selected>Typeless</option>
<option value="water">Water</option>
</select>
<select class="sheet-half-text sheet-no-dropdown" name="attr_mega-type2" title="Attribute: mega-type2">
<option value=""></option>
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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="water">Water</option>
</select>
</span>
<br />
<div class="sheet-pokemon-form-stats-grid">
<b>Atk</b>
<b>Def</b>
<b>SpAtk</b>
<b>SpDef</b>
<b>Spd</b>
<input class="sheet-attack-color" name="attr_atkmega" title="Attribute: atkmega" type="number" />
<input class="sheet-defense-color" name="attr_defmega" title="Attribute: defmega" type="number" />
<input class="sheet-spatk-color" name="attr_spatkmega" title="Attribute: spatkmega" type="number" />
<input class="sheet-spdef-color" name="attr_spdefmega" title="Attribute: spdefmega" type="number" />
<input class="sheet-speed-color" name="attr_spdmega" title="Attribute: spdmega" type="number" />
</div>
<textarea class="sheet-3row-textarea" name="attr_mega-notes" placeholder="Additional Mega Notes" spellcheck="false" title="Attribute: mega-notes"></textarea>
</div>
<div class="sheet-custom1-config">
<span><h3>
<label class="sheet-afflictions-text">
<input name="attr_enable-custom1" type="checkbox" />
<input class="sheet-custom-move-name" name="attr_custom1-name" type="text" value="Custom Form Change (1)">
</label>
</h3></span>
<p class="sheet-dark-text">
Check to enable a customized form change. Name this form change to customize what appears to select on the character page.
Select the type for this custom form, and it will replace your current type when you activate it.
When activated, your stats are changed based on the modifiers below. The other two custom forms work in the same way.
</p>
<b>Type: </b>
<span>
<select class="sheet-half-text sheet-no-dropdown" name="attr_custom1-type1" title="Attribute: custom1-type1">
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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" selected>Typeless</option>
<option value="water">Water</option>
</select>
<select class="sheet-half-text sheet-no-dropdown" name="attr_custom1-type2" title="Attribute: custom1-type2">
<option value=""></option>
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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="water">Water</option>
</select>
</span>
<br />
<div class="sheet-pokemon-form-stats-grid">
<b>Atk</b>
<b>Def</b>
<b>SpAtk</b>
<b>SpDef</b>
<b>Spd</b>
<input class="sheet-attack-color" name="attr_atkcustom1" title="Attribute: atkcustom1" type="number" />
<input class="sheet-defense-color" name="attr_defcustom1" title="Attribute: defcustom1" type="number" />
<input class="sheet-spatk-color" name="attr_spatkcustom1" title="Attribute: spatkcustom1" type="number" />
<input class="sheet-spdef-color" name="attr_spdefcustom1" title="Attribute: spdefcustom1" type="number" />
<input class="sheet-speed-color" name="attr_spdcustom1" title="Attribute: spdcustom1" type="number" />
</div>
<textarea class="sheet-3row-textarea" name="attr_custom1-notes" placeholder="Additional Notes" spellcheck="false" title="Attribute: custom1-notes"></textarea>
</div>
<div class="sheet-custom2-config">
<span><h3>
<label class="sheet-afflictions-text">
<input name="attr_enable-custom2" type="checkbox" />
<input class="sheet-custom-move-name" name="attr_custom2-name" type="text" value="Custom Form Change (2)">
</label>
</h3></span>
<b>Type: </b>
<span>
<select class="sheet-half-text sheet-no-dropdown" name="attr_custom2-type1" title="Attribute: custom2-type1">
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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" selected>Typeless</option>
<option value="water">Water</option>
</select>
<select class="sheet-half-text sheet-no-dropdown" name="attr_custom2-type2" title="Attribute: custom2-type2">
<option value=""></option>
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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="water">Water</option>
</select>
</span>
<br />
<div class="sheet-pokemon-form-stats-grid">
<b>Atk</b>
<b>Def</b>
<b>SpAtk</b>
<b>SpDef</b>
<b>Spd</b>
<input class="sheet-attack-color" name="attr_atkcustom2" title="Attribute: atkcustom2" type="number" />
<input class="sheet-defense-color" name="attr_defcustom2" title="Attribute: defcustom2" type="number" />
<input class="sheet-spatk-color" name="attr_spatkcustom2" title="Attribute: spatkcustom2" type="number" />
<input class="sheet-spdef-color" name="attr_spdefcustom2" title="Attribute: spdefcustom2" type="number" />
<input class="sheet-speed-color" name="attr_spdcustom2" title="Attribute: spdcustom2" type="number" />
</div>
<textarea class="sheet-3row-textarea" name="attr_custom2-notes" placeholder="Additional Notes" spellcheck="false" title="Attribute: custom2-notes"></textarea>
</div>
<div class="sheet-custom3-config">
<span><h3>
<label class="sheet-afflictions-text">
<input name="attr_enable-custom3" type="checkbox" />
<input class="sheet-custom-move-name" name="attr_custom3-name" type="text" value="Custom Form Change (3)">
</label>
</h3></span>
<b>Type: </b>
<span>
<select class="sheet-half-text sheet-no-dropdown" name="attr_custom3-type1" title="Attribute: custom3-type1">
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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" selected>Typeless</option>
<option value="water">Water</option>
</select>
<select class="sheet-half-text sheet-no-dropdown" name="attr_custom3-type2" title="Attribute: custom3-type2">
<option value=""></option>
<option value="bug">Bug</option>
<option value="dark">Dark</option>
<option value="dragon">Dragon</option>
<option value="electric">Electric</option>
<option value="fairy">Fairy</option>
<option value="fighting">Fighting</option>
<option value="fire">Fire</option>
<option value="flying">Flying</option>
<option value="ghost">Ghost</option>
<option value="grass">Grass</option>
<option value="ground">Ground</option>
<option value="ice">Ice</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="water">Water</option>
</select>
</span>
<br />
<div class="sheet-pokemon-form-stats-grid">
<b>Atk</b>
<b>Def</b>
<b>SpAtk</b>
<b>SpDef</b>
<b>Spd</b>
<input class="sheet-attack-color" name="attr_atkcustom3" title="Attribute: atkcustom3" type="number" />
<input class="sheet-defense-color" name="attr_defcustom3" title="Attribute: defcustom3" type="number" />
<input class="sheet-spatk-color" name="attr_spatkcustom3" title="Attribute: spatkcustom3" type="number" />
<input class="sheet-spdef-color" name="attr_spdefcustom3" title="Attribute: spdefcustom3" type="number" />
<input class="sheet-speed-color" name="attr_spdcustom3" title="Attribute: spdcustom3" type="number" />
</div>
<textarea class="sheet-3row-textarea" name="attr_custom3-notes" placeholder="Additional Notes" spellcheck="false" title="Attribute: custom3-notes"></textarea>
</div>
</div>
</div>
</div>
@@ -2829,6 +3185,82 @@
});
});
on(`clicked:activate-tera`, function () {
performFormChange("tera_active", "tera_label", "Terastallize", "End Terastallization");
});
on(`clicked:activate-dyna`, function () {
performFormChange("dyna_active", "dyna_label", "Dynamax", "End Dynamax");
});
on(`clicked:activate-mega`, function () {
performFormChange("mega_active", "mega_label", "Mega Evolve", "End Mega Evolution");
});
on(`clicked:activate-custom1`, function () {
getAttrs(["custom1-name"], function (values) {
performFormChange("custom1_active", "custom1_label", `${values["custom1-name"]}`, `End ${values["custom1-name"]}`);
});
});
on(`clicked:activate-custom2`, function () {
getAttrs(["custom2-name"], function (values) {
performFormChange("custom2_active", "custom2_label", `${values["custom2-name"]}`, `End ${values["custom2-name"]}`);
});
});
on(`clicked:activate-custom3`, function () {
getAttrs(["custom3-name"], function (values) {
performFormChange("custom3_active", "custom3_label", `${values["custom3-name"]}`, `End ${values["custom3-name"]}`);
});
});
function performFormChange(activationAttr, labelAttr, activeText, inactiveText){
getAttrs([activationAttr], function (values) {
var newActiveStatus = true;
var newLabel = inactiveText;
if(values[activationAttr]){
newActiveStatus = false;
newLabel = activeText;
}
setAttrs({
[labelAttr]: newLabel,
[activationAttr]: newActiveStatus,
});
});
}
on("change:custom1-name change:enable-custom1", function () {
updateCustomFormName("1");
});
on("change:custom2-name change:enable-custom2", function () {
updateCustomFormName("2");
});
on("change:custom3-name change:enable-custom3", function () {
updateCustomFormName("3");
});
function updateCustomFormName(num){
getAttrs([`custom${num}_active`, `custom${num}-name`], function (values) {
var name = values[`custom${num}-name`];
if(!name){
name = `Custom Form Change (${num})`;
}
if(values[`custom${num}_active`]){
setAttrs({
[`custom${num}_label`]: `End ${name}`,
});
} else {
setAttrs({
[`custom${num}_label`]: `${name}`,
});
}
});
}
// Natures (must be before stat calculation)
const allNatures = {
lonely : [ 1, -1, 0, 0, 0],
@@ -3123,7 +3555,7 @@
// Handling Move Damage Bonuses
categoryDamageModifiers = ["", "ATKMOD", "SPATKMOD", ""];
categoryDamageBonuses = ["", "move_bonusattack", "move_bonusspecialattack", ""];
on("change:ATKMOD change:SPATKMOD change:type1 change:type2 change:move_bonusattack change:move_bonusspecialattack sheet:opened", function (eventInfo) {
on("change:ATKMOD change:SPATKMOD change:active_type1 change:active_type2 change:move_bonusattack change:move_bonusspecialattack sheet:opened", function (eventInfo) {
getSectionIDs("repeating_moves", function (idArray) {
const rowNames = idArray.map((id) => `repeating_moves_${id}`);
const categories = idArray.map((id) => `repeating_moves_${id}_move_category`);
@@ -3132,7 +3564,7 @@
const damageDice = idArray.map((id) => `repeating_moves_${id}_damage_dice`);
const types = idArray.map((id) => `repeating_moves_${id}_move_type`);
getAttrs([`ATKMOD`, `SPATKMOD`, `type1`, `type2`, `move_bonusattack`, `move_bonusspecialattack`, "character-type",
getAttrs([`ATKMOD`, `SPATKMOD`, `active_type1`, `active_type2`, `move_bonusattack`, `move_bonusspecialattack`, "character-type",
...categories, ...extraBonuses, ...diceNumbers, ...damageDice, ...types], function (values) {
const rows = rowNames.reduce((obj, rowName) => {
const category = parseInt(values[rowName + `_move_category`]) || 0;
@@ -3143,7 +3575,7 @@
let stab = 0;
if(values["character-type"] != "trainer" &&
(category == 1 || category == 2) &&
(movetype == values.type1 || movetype == values.type2)) stab = 4;
(movetype == values.active_type1 || movetype == values.active_type2)) stab = 4;
const categoryModifier = parseInt(values[`${categoryDamageModifiers[category]}`]) || 0;
const categoryBonus = parseInt(values[`${categoryDamageBonuses[category]}`]) || 0;
@@ -3175,8 +3607,8 @@
"repeating_moves_move_type",
"repeating_moves_move_dicenumber",
"repeating_moves_damage_dice",
"type1",
"type2",
"active_type1",
"active_type2",
"character-type"
],
function (values) {
@@ -3188,7 +3620,7 @@
let stab = 0;
if(values["character-type"] != "trainer" &&
(category == 1 || category == 2) &&
(values.repeating_moves_move_type == values.type1 || values.repeating_moves_move_type == values.type2)) stab = 4;
(values.repeating_moves_move_type == values.active_type1 || values.repeating_moves_move_type == values.active_type2)) stab = 4;
const categoryModifier = parseInt(values[`${categoryDamageModifiers[category]}`]) || 0;
const categoryBonus = parseInt(values[`${categoryDamageBonuses[category]}`]) || 0;
@@ -3495,6 +3927,22 @@
if (newBonus != oldTotal) setAttrs(attrs);
}
//Abstracting type1 and type2
on("change:type1 change:type2 change:tera-type change:mega-type1 change:mega-type2 change:custom1-type1 change:custom1-type2 change:custom2-type1 change:custom2-type2 change:custom3-type1 change:custom3-type2 sheet:opened", function (eventInfo) {
getAttrs(["type1", "type2", "tera-type", "mega-type1", "mega-type2", "custom1-type1", "custom1-type2", "custom2-type1", "custom2-type2", "custom3-type1", "custom3-type2", ], function (values) {
let newType1 = values.type1;
let newType2 = values.type2;
setAttrs({
"active_type1": values.type1,
"active_type2": values.type2
});
});
});
// Collapsing Blocks
on("change:repeating_features:options_flag", function (eventInfo) {
const flag = eventInfo.newValue == "on" ? "-" : "+";