mirror of
https://github.com/Nighthawk42/roll20-character-sheets.git
synced 2026-08-30 03:40:32 +00:00
### Version 1.1.06
- Added Robot tab with support for compendium drag and drop
This commit is contained in:
+21
-3
@@ -52,6 +52,7 @@ p {
|
||||
.sheet-pc,
|
||||
.sheet-npc,
|
||||
.sheet-animal,
|
||||
.sheet-robot,
|
||||
.sheet-ship,
|
||||
.sheet-shipdetails,
|
||||
.sheet-shipcrew,
|
||||
@@ -106,6 +107,13 @@ p {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sheet-typetoggle[value="robot"] ~ .sheet-robot {
|
||||
display: block;
|
||||
animation-name: slide-in;
|
||||
animation-duration: 1s;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.sheet-typetoggle[value="ship"] ~ .sheet-ship {
|
||||
display: block;
|
||||
animation-name: slide-in;
|
||||
@@ -1290,7 +1298,7 @@ button.sheet-tab {
|
||||
outline: none !important;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
width: 11vw;
|
||||
width: 10vw;
|
||||
content: attr(title);
|
||||
display: inline;
|
||||
height: 35px;
|
||||
@@ -1312,6 +1320,7 @@ button.sheet-but-prime {
|
||||
input.sheet-typeshow[value="pc"] ~ .sheet-type-pc,
|
||||
input.sheet-typeshow[value="npc"] ~ .sheet-type-npc,
|
||||
input.sheet-typeshow[value="animal"] ~ .sheet-type-animal,
|
||||
input.sheet-typeshow[value="robot"] ~ .sheet-type-robot,
|
||||
input.sheet-typeshow[value="ship"] ~ .sheet-type-ship,
|
||||
input.sheet-shiptypeshow[value="shipdetails"] ~ .sheet-type-shipdetails,
|
||||
input.sheet-shiptypeshow[value="shipcrew"] ~ .sheet-type-shipcrew,
|
||||
@@ -2208,7 +2217,7 @@ grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
|
||||
.sheet-laf-animal-detail {
|
||||
grid-template-columns: 3fr 1fr 0.25fr;
|
||||
grid-template-columns: 3fr 0.2fr 0.25fr;
|
||||
}
|
||||
|
||||
.sheet-laf-animal-detail input {
|
||||
@@ -2224,6 +2233,15 @@ grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
grid-column: 2 / 4;
|
||||
}
|
||||
|
||||
.sheet-laf-robot {
|
||||
grid-template-columns: 1fr 0.2fr 1fr 0.3fr 0.2fr 0.5fr;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.sheet-laf-robot-sub {
|
||||
grid-template-columns: 0.1fr 1fr 0.1fr 0.75fr;
|
||||
}
|
||||
|
||||
.sheet-laf-ship-hardpoint.sheet-speculative-font {
|
||||
font-size: 1em;
|
||||
}
|
||||
@@ -2921,7 +2939,7 @@ body.sheet-darkmode .charsheet:after {
|
||||
outline: none !important;
|
||||
cursor: pointer;
|
||||
z-index: 1;
|
||||
width: 11vw;
|
||||
width: 10vw;
|
||||
content: attr(title);
|
||||
display: inline;
|
||||
height: 35px;
|
||||
|
||||
+302
-11
@@ -23,12 +23,14 @@
|
||||
<br>
|
||||
<div class="sheet-body sheet-laf-border-corner">
|
||||
<div class="sheet-bold">
|
||||
<span class="sheet-button sheet-header" data-i18n="sheettype-u">Sheet Type:</span>
|
||||
<span class="sheet-button sheet-header"></span>
|
||||
<input type="hidden" class="sheet-typeshow" name="attr_sheetTypeShow" value="pc"/>
|
||||
<button type="action" name="act_pc" class="sheet-type sheet-type-pc" data-i18n="pc-u">PC</button>
|
||||
<button type="action" name="act_npc" class="sheet-type sheet-type-npc" data-i18n="npc-u">NPC</button>
|
||||
<button type="action" name="act_animal" class="sheet-type sheet-type-animal" data-i18n="animal-u">Animal
|
||||
</button>
|
||||
<button type="action" name="act_robot" class="sheet-type sheet-type-robot" data-i18n="robot-u">Robot
|
||||
</button>
|
||||
<button type="action" name="act_vehicle" class="sheet-type sheet-type-vehicle" data-i18n="vehicle-u">
|
||||
Vehicle
|
||||
</button>
|
||||
@@ -324,10 +326,13 @@
|
||||
<input type="number" class="sheet-input sheet-norm sheet-currentdamage" name="attr_current"
|
||||
value="0"/>
|
||||
<input type="number" class="sheet-input" name="attr_modifier" value="0">
|
||||
<!-- <button style="font-size:0.8em !important;" class="sheet-button sheet-dicerollbutton btn"-->
|
||||
<!-- name="act_characteristic" type="action">b-->
|
||||
<!-- </button>-->
|
||||
<button name="roll_Characteristic" type="roll" value="@{whispertoggle}&{template:skill-general-alt} {{skill=@{name}}} {{character= @{character_name} }} @{ro_default_rolltype} + [[@{modifier}]] @{ro_default_mod}]] }}" class="sheet-button sheet-dicerollbutton btn">b</button>
|
||||
<!-- <button style="font-size:0.8em !important;" class="sheet-button sheet-dicerollbutton btn"-->
|
||||
<!-- name="act_characteristic" type="action">b-->
|
||||
<!-- </button>-->
|
||||
<button name="roll_Characteristic" type="roll"
|
||||
value="@{whispertoggle}&{template:skill-general-alt} {{skill=@{name}}} {{character= @{character_name} }} @{ro_default_rolltype} + [[@{modifier}]] @{ro_default_mod}]] }}"
|
||||
class="sheet-button sheet-dicerollbutton btn">b
|
||||
</button>
|
||||
<input type="hidden" name="attr_calc" value="0"/>
|
||||
</div>
|
||||
</fieldset>
|
||||
@@ -6240,7 +6245,7 @@
|
||||
<fieldset class="repeating_animaltraits">
|
||||
<div class="sheet-laf-animal-cols sheet-laf-centredgrid sheet-laf-animal-detail">
|
||||
<input class="sheet-laf-wauto" type="text" name="attr_animaltraits-trait"/>
|
||||
<input type="text" name="attr_animaltraits-mod" value="0"/>
|
||||
<input type="text" name="attr_animaltraits-mod" value=""/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
@@ -6270,7 +6275,97 @@
|
||||
<textarea class="sheet-laf-animal-desc" name="attr_animal_notes"></textarea>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sheet-tab-content sheet-robot">
|
||||
<span class="sheet-errortext" name="attr_compendium_error_Robots"></span>
|
||||
<div class="compendium-drop-target sheet-laf-compendium-drop-target sheet-redbold">
|
||||
<input class="sheet-laf-compendium-accept-input" name="attr_compendiumRobotData" type="text" accept="data">
|
||||
<h3 data-i18n="robot-u">Robot</h3>
|
||||
</div>
|
||||
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-robot">
|
||||
<h5>Robot</h5>
|
||||
<h5>Hits</h5>
|
||||
<h5>Locomotion</h5>
|
||||
<h5>Speed</h5>
|
||||
<h5>TL</h5>
|
||||
<h5>Cost</h5>
|
||||
<input type="text" class="sheet-input" name="attr_robot_name"/>
|
||||
<input type="number" class="sheet-input" name="attr_robot_hits" value="0"/>
|
||||
<input type="text" class="sheet-input" name="attr_robot_locomotion"/>
|
||||
<span><input type="number" class="sheet-input" name="attr_robot_speed" value=""/>m</span>
|
||||
<input type="number" class="sheet-input" name="attr_robot_tl" value=""/>
|
||||
<input type="text" class="sheet-input" name="attr_robot_cost" value="0"/>
|
||||
</div>
|
||||
<br>
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-animal-sub">
|
||||
<span class="sheet-bold" data-i18n="skillstitle-u">Skills</span>
|
||||
<fieldset class="repeating_robotskills">
|
||||
<div class="sheet-laf-centredgrid sheet-laf-animal-cols sheet-laf-animal-detail">
|
||||
<input class="sheet-laf-wauto" type="text" name="attr_name"/>
|
||||
<input type="number" name="attr_mod" value="0"/>
|
||||
<button class="sheet-weaponroll" name="act_robotskill" type="action">
|
||||
<span class="sheet-weaponrollbutton">b</span>
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<br>
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-animal-sub">
|
||||
<span class="sheet-bold" data-i18n="attacks-u">Attacks</span>
|
||||
<fieldset class="repeating_robotattacks">
|
||||
<div class="sheet-laf-centredgrid sheet-laf-animal-weapon">
|
||||
<input type="text" name="attr_name"/>
|
||||
<span class="sheet-bold sheet-textright" data-i18n="skilltotal-u">Skill Total</span>
|
||||
<input class="sheet-laf-wnum" type="number" value="0" name="attr_attackmod"/>
|
||||
<span class="sheet-bold sheet-textright" data-i18n="damage-u">Damage</span>
|
||||
<input class="sheet-laf-wnum2" type="text" name="attr_damage"/>
|
||||
<button class="sheet-weaponroll" name="act_robotattack" type="action">
|
||||
<span class="sheet-weaponrollbutton">b</span>
|
||||
</button>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<br>
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-robot-sub">
|
||||
<span class="sheet-bold" data-i18n="manipulators-u">Manipulators</span>
|
||||
<input class="sheet-laf-vehicle-div" type="text" name="attr_robot_manipulators"/>
|
||||
<span class="sheet-bold" data-i18n="endurance-u">Endurance</span>
|
||||
<input class="sheet-laf-vehicle-div" type="text" name="attr_robot_endurance"/>
|
||||
</div>
|
||||
<br>
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-animal-sub">
|
||||
<span class="sheet-bold" data-i18n="traits-u">Traits</span>
|
||||
<fieldset class="repeating_robottraits">
|
||||
<div class="sheet-laf-animal-cols sheet-laf-centredgrid sheet-laf-animal-detail">
|
||||
<input class="sheet-laf-wauto" type="text" name="attr_robottraits-trait"/>
|
||||
<input type="text" name="attr_robottraits-mod" value=""/>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<br>
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-robot-sub">
|
||||
<span class="sheet-bold" data-i18n="programming-u">Programming</span>
|
||||
<input class="sheet-laf-vehicle-div" type="text" name="attr_robot_programming"/>
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-animal-init">
|
||||
<span class="sheet-bold" data-i18n="mod-u">Mod</span>
|
||||
<input type="number" class="sheet-input" name="attr_robot_initmod" value="0">
|
||||
<button class="sheet-laf-initbutton btn ui-draggable sheet-wide-button" data-i18n="initiativeroll-u"
|
||||
type="roll"
|
||||
name="roll_initiative"
|
||||
value="@{whispertoggle} &{template:skill-general-alt} {{skill=^{initiative-u}}} {{character= @{robot_name} }} @{ro_default_rolltype_nodiff}+@{robot_initmod}+@{initiative_effect} @{ro_default_mod} &{tracker}]]}}">
|
||||
<div class="sheet-button_header">Roll Initiative (Select Token)</div>
|
||||
</button>
|
||||
</div>
|
||||
<br>
|
||||
<div class="sheet-redborder sheet-laf-centredgrid sheet-laf-animal-sub">
|
||||
<span class="sheet-header" data-i18n="options-u">Options</span>
|
||||
<textarea style="height: 100px;" class="sheet-laf-animal-desc" name="attr_robot_options"></textarea>
|
||||
<span></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sheet-tab-content sheet-vehicle">
|
||||
|
||||
@@ -6722,9 +6817,9 @@
|
||||
custom modifier.</h5>
|
||||
<br>
|
||||
<span class="sheet-redbold-noborder" name="attr_shipweapon_error"></span>
|
||||
<!-- <div class="sheet-laf-centredgrid sheet-laf-ship-hardpoint">-->
|
||||
<!-- <div class="sheet-laf-centredgrid sheet-laf-ship-hardpoint">-->
|
||||
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<fieldset class="repeating_shipweapon">
|
||||
<div class="sheet-laf-centredgrid sheet-laf-ship-hardpoint">
|
||||
<span data-i18n="hardpoint-u">Hardpoint</span>
|
||||
@@ -7175,7 +7270,8 @@
|
||||
<input type="checkbox" class="sheet-carried" name="attr_equippedleft" value="1"/>
|
||||
<span></span>
|
||||
<div style="float: right; margin-right: -10px;">
|
||||
<input style=";" type="checkbox" class="sheet-delete" name="attr_deleteleft" value="1"/>
|
||||
<input style=";" type="checkbox" class="sheet-delete" name="attr_deleteleft"
|
||||
value="1"/>
|
||||
<span></span>
|
||||
</div>
|
||||
<div class="sheet-laf-centredgrid sheet-laf-gearrow sheet-bold">
|
||||
@@ -8396,7 +8492,7 @@
|
||||
<div class="sheet-tab-content sheet-help">
|
||||
<h4>Help</h4>
|
||||
<br>
|
||||
<h4>Character Sheet Version 1.1.05</h4>
|
||||
<h4>Character Sheet Version 1.1.06</h4>
|
||||
<br>
|
||||
<h4>Diagnostics Attribute Lookup</h4>
|
||||
<br>
|
||||
@@ -9761,7 +9857,7 @@
|
||||
});
|
||||
});
|
||||
|
||||
const buttonlist_sheettype = ["pc", "npc", "animal", "ship", "vehicle", "trade", "help"];
|
||||
const buttonlist_sheettype = ["pc", "npc", "animal", "robot", "ship", "vehicle", "trade", "help"];
|
||||
buttonlist_sheettype.forEach(button => {
|
||||
on(`clicked:${button}`, function() {
|
||||
setAttrs({
|
||||
@@ -13101,6 +13197,57 @@
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:repeating_robotskills:robotskill", (info) => {
|
||||
|
||||
console.log("MgT2E: Robot skill: " + JSON.stringify(info))
|
||||
|
||||
const rowId = info.sourceAttribute.split('_')[2];
|
||||
const skillName = "repeating_robotskills" + rowId + "_name";
|
||||
const skillDM = "repeating_robotskills" + rowId + "_mod";
|
||||
|
||||
getAttrs([skillName, skillDM, "robot_name"], function(v) {
|
||||
startRoll("@{whispertoggle}&{template:skill-attrib-alt} {{skill=" + v[skillName] + "}} {{character= " + v.robot_name + "}} @{ro_default_rolltype} + " + v[skillDM] + " ]]}} }}", (results) => {
|
||||
finishRoll(results.rollId, {});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
on("clicked:repeating_robotattacks:robotattack", (info) => {
|
||||
|
||||
console.log("MgT2E: Robot attack: " + JSON.stringify(info))
|
||||
|
||||
const rowId = info.sourceAttribute.split('_')[2];
|
||||
const name = "repeating_robotattack" + rowId + "_name";
|
||||
const attackMod = "repeating_robotattack" + rowId + "_attackmod";
|
||||
const damage = "repeating_robotattack" + rowId + "_damage";
|
||||
|
||||
getAttrs([name, attackMod, damage, "robot_name"], function(v) {
|
||||
console.log("- Attrs: " + JSON.stringify(v));
|
||||
|
||||
const wD = formatWeaponDamage(v[damage]);
|
||||
|
||||
startRoll("@{whispertoggle}&{template:combat-animal-alt} {{character=" + v.robot_name + "}} {{weapon=" + v[name] + "}} {{effect=[[0D6]]}} @{ro_default_rolltype_nodiff} + " + v[attackMod] + " @{ro_default_mod}]]}} {{damage=[[" + wD.weaponDamage + "]]}}", (results) => {
|
||||
const toHit = results.results.roll.result;
|
||||
var damage = results.results.damage.result;
|
||||
//var effect = results.results.effect.result;
|
||||
//if(toHit > 8 && !wD.isDestructive) {
|
||||
// damage += (toHit - 8);
|
||||
// effect = toHit - 8;
|
||||
//}
|
||||
|
||||
finishRoll(
|
||||
results.rollId,
|
||||
{
|
||||
roll: toHit,
|
||||
damage: damage,
|
||||
//effect: effect
|
||||
}
|
||||
);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
on("clicked:vehicle-autopilot clicked:vehicle-navigation clicked:vehicle-sensors clicked:vehicle-camoflage clicked:vehicle-stealth", (info) => {
|
||||
|
||||
console.log("MgT2E: Vehicle skill roll: " + JSON.stringify(info))
|
||||
@@ -14032,6 +14179,148 @@
|
||||
setAttrs(attrs);
|
||||
});
|
||||
|
||||
// Robot data
|
||||
on('change:compendiumRobotData', function(info) {
|
||||
|
||||
console.log("MgT2E: compendiumRobotData: " + JSON.stringify(info));
|
||||
|
||||
// We may be coming in here from a blanking out of the compendium data
|
||||
if(info.newValue === "__RESET__") {
|
||||
console.log("Bailing from robot drop operation as this is a reset");
|
||||
return;
|
||||
}
|
||||
|
||||
// Grab the new value which is our stringified JSON
|
||||
const compendiumData = JSON.parse(info.newValue);
|
||||
console.log("MgT2E: compendiumRobotData: " + JSON.stringify(compendiumData, null, 4));
|
||||
|
||||
// Check the category
|
||||
if(!checkCompendiumCategory(compendiumData, "Robots", "Robots")) {
|
||||
return;
|
||||
}
|
||||
|
||||
console.log("Robot attr setting");
|
||||
let attrs = {compendiumRobotData: "__RESET__"};
|
||||
|
||||
/* Robot data takes the form:
|
||||
{
|
||||
"TL": "13",
|
||||
"Cost": "Cr310000",
|
||||
"Hits": "50",
|
||||
"Name": "Angel of Mercy",
|
||||
"Speed": "—",
|
||||
"Skills": "Athletics (strength) 2, Medic 3, Melee 0, Recon 0, Science (biology) 2, Tactics (military) 1 ",
|
||||
"Source": "custom",
|
||||
"Traits": "Armour (+10, +10 vs. lasers), Flyer (high), Heightened Senses, Large (+2), IR/UV Vision, ",
|
||||
"Attacks": "Static Axes x2 (4D+2, AP 8, Smasher)",
|
||||
"Options": "Auditory Sensor (broad spectrum), Construction Equipment (small), Drone Interface, Environment Processor, Medical Chamber (50 Slots), Medikit (enhanced), Olfactory Sensor (advanced), PRIS Sensor, Reflec Armour, Storage Compartment (2 Slots refrigerated), Transceiver 500km (enhanced), Vacuum Environment Protection, Voder Speaker, Weapon Mounts (small) x2, Wireless Data Link ",
|
||||
"Category": "Robots",
|
||||
"Endurance": "36 (9) hours",
|
||||
"Expansion": "38706",
|
||||
"data-Name": "Angel of Mercy",
|
||||
"Locomotion": "Grav",
|
||||
"Programming": "Advanced (INT 9)",
|
||||
"Manipulators": "2x (STR 12 DEX 8), 2x (STR 6 DEX 9)",
|
||||
"data-description": "RH",
|
||||
"blobs": {},
|
||||
"expansion": 38706
|
||||
}
|
||||
*/
|
||||
|
||||
attrs.robot_name = compendiumData["data-Name"];
|
||||
attrs.character_name = compendiumData["data-Name"];
|
||||
attrs.robot_hits = compendiumData["Hits"];
|
||||
attrs.robot_speed = compendiumData["Speed"];
|
||||
attrs.robot_manipulators = compendiumData["Manipulators"];
|
||||
attrs.robot_endurance = compendiumData["Endurance"];
|
||||
attrs.robot_programming = compendiumData["Programming"];
|
||||
attrs.robot_options = compendiumData["Options"];
|
||||
attrs.robot_locomotion = compendiumData["Locomotion"];
|
||||
|
||||
console.log("- Processing robot skills: " + compendiumData["Skills"]);
|
||||
|
||||
// Process skills (repeating)
|
||||
removeRepeatingRows("repeating_robotskills");
|
||||
// Bit hacky but sometimes we have 'Athletics (endurance)+2' so want to space out the mod for parsing
|
||||
let skills = compendiumData["Skills"].replace(")+", ") +").replace(")-", ") -").split(",");
|
||||
console.log("- Skills- " + skills);
|
||||
skills.forEach((skill, index) => {
|
||||
console.log("- Skill: " + skill);
|
||||
let skillRec = skill.trim().split(" ");
|
||||
let mod = skillRec.pop().replace("+", "");
|
||||
let skillName = skillRec.join(" ");
|
||||
|
||||
let slotId = generateRowID();
|
||||
attrs["repeating_robotskills_" + slotId + "_name"] = skillName;
|
||||
attrs["repeating_robotskills_" + slotId + "_mod"] = mod;
|
||||
});
|
||||
|
||||
// Process attacks (repeating)
|
||||
removeRepeatingRows("repeating_robotattacks");
|
||||
|
||||
if(compendiumData["Attacks"] !== "None" && compendiumData["Attacks"] !== "-") {
|
||||
|
||||
// Need to tidy up the atack data as comes in the form: Laser Rifle (5D+3, Zero-G), Claws (1D+2 ) OR
|
||||
// Crush (3D) or Claw (2D), Submachinegun (3D, Auto 3) etc.
|
||||
// So we split on closing '),' then have to trim and reformat
|
||||
let attacks = compendiumData["Attacks"].split("),");
|
||||
console.log("- Attacks: " + attacks);
|
||||
|
||||
// Process attacks if set, may be set to empty space, dash or long dash e.g., - or —
|
||||
if(attacks.length > 1) {
|
||||
attacks.forEach((attack, index) => {
|
||||
|
||||
// Need to trim and format
|
||||
attack = attack.trim().replaceAll(" )", ")");
|
||||
console.log("- Attack: " + attack);
|
||||
|
||||
// So need to extract damage as first term after bracket
|
||||
let damage = attack.replace(/.*\(/, "").replace(/,.*/, "");
|
||||
// With a single term like Crush (3D) we need to remove last bracket
|
||||
damage = damage.replace(")", "");
|
||||
|
||||
let attackRec = attack.trim().split(" ");
|
||||
let attackName = attackRec.join(" ");
|
||||
// Because we've split on ,) we need to add the bracket back in for any attacks that don't have it
|
||||
if(!attackName.endsWith(")")) {
|
||||
attackName += ")";
|
||||
}
|
||||
|
||||
let slotId = generateRowID();
|
||||
attrs["repeating_robotattacks_" + slotId + "_name"] = attackName;
|
||||
if(damage.includes("DD")) {
|
||||
attrs["repeating_robotattacks_" + slotId + "_damage"] = damage;
|
||||
}
|
||||
else {
|
||||
attrs["repeating_robotattacks_" + slotId + "_damage"] = damage.replace("D", "D6");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Process Traits (repeating)
|
||||
removeRepeatingRows("repeating_robottraits");
|
||||
|
||||
let traits = compendiumData["Traits"].split(",");
|
||||
traits.forEach((trait, index) => {
|
||||
let traitRec = trait.trim();
|
||||
let mod = "";
|
||||
let traitArr = traitRec.split(" ");
|
||||
if(traitRec.endsWith(")")) {
|
||||
// Has a modifier
|
||||
mod = traitArr.pop().replace(")", "").replace("(", "");
|
||||
}
|
||||
let traitName = traitArr.join(" ");
|
||||
|
||||
let slotId = generateRowID();
|
||||
attrs["repeating_robottraits_" + slotId + "_robottraits-trait"] = traitName;
|
||||
attrs["repeating_robottraits_" + slotId + "_robottraits-mod"] = mod;
|
||||
});
|
||||
|
||||
// Finally set our attributes
|
||||
setAttrs(attrs);
|
||||
});
|
||||
|
||||
on("sheet:compendium-drop", (e) => {
|
||||
|
||||
console.log("compendium-drop: " + JSON.stringify(e));
|
||||
@@ -14099,5 +14388,7 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
</div>
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 340 KiB After Width: | Height: | Size: 313 KiB |
@@ -108,6 +108,8 @@ This is the Official Mongoose Traveller 2nd Edition Character Sheet
|
||||
- Updated translation key for personal Armour for translations
|
||||
- Allow custom characteristics to be dragged to macro bar
|
||||
|
||||
### Version 1.1.06
|
||||
- Added Robot tab to character sheet
|
||||
|
||||

|
||||
|
||||
|
||||
Reference in New Issue
Block a user