Compare commits
4 Commits
fvtt-pegas
...
fvtt-pegas
Author | SHA1 | Date | |
---|---|---|---|
241c7fa1ae | |||
857f36387a | |||
b185a3902d | |||
7d3f880633 |
@ -743,17 +743,20 @@ export class PegasusActor extends Actor {
|
|||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
getSubActors() {
|
getSubActors() {
|
||||||
let subActors = [];
|
let subActors = [];
|
||||||
|
if (this.system.subactors) {
|
||||||
for (let id of this.system.subactors) {
|
for (let id of this.system.subactors) {
|
||||||
subActors.push(duplicate(game.actors.get(id)))
|
subActors.push(duplicate(game.actors.get(id)))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return subActors;
|
return subActors;
|
||||||
}
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async addSubActor(subActorId) {
|
async addSubActor(subActorId) {
|
||||||
let subActors = duplicate(this.system.subactors);
|
let subActors = duplicate(this.system.subactors || []);
|
||||||
subActors.push(subActorId);
|
subActors.push(subActorId);
|
||||||
await this.update({ 'system.subactors': subActors });
|
await this.update({ 'system.subactors': subActors });
|
||||||
}
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async delSubActor(subActorId) {
|
async delSubActor(subActorId) {
|
||||||
let newArray = [];
|
let newArray = [];
|
||||||
@ -1122,7 +1125,7 @@ export class PegasusActor extends Actor {
|
|||||||
modifyHeroLevelRemaining(incDec) {
|
modifyHeroLevelRemaining(incDec) {
|
||||||
let biodata = duplicate(this.system.biodata)
|
let biodata = duplicate(this.system.biodata)
|
||||||
biodata.currentlevelremaining = Math.max(biodata.currentlevelremaining + incDec, 0)
|
biodata.currentlevelremaining = Math.max(biodata.currentlevelremaining + incDec, 0)
|
||||||
this.update({ "data.biodata": biodata })
|
this.update({ "system.biodata": biodata })
|
||||||
ChatMessage.create({ content: `${this.name} has used a Hero Level to reroll !` })
|
ChatMessage.create({ content: `${this.name} has used a Hero Level to reroll !` })
|
||||||
return biodata.currentlevelremaining
|
return biodata.currentlevelremaining
|
||||||
}
|
}
|
||||||
@ -1391,26 +1394,31 @@ export class PegasusActor extends Actor {
|
|||||||
let newItems = []
|
let newItems = []
|
||||||
if (ability.system.effectsgained) {
|
if (ability.system.effectsgained) {
|
||||||
for (let effect of ability.system.effectsgained) {
|
for (let effect of ability.system.effectsgained) {
|
||||||
|
if (!effect.system) effect.system = effect.data
|
||||||
newItems.push(effect);
|
newItems.push(effect);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ability.system.powersgained) {
|
if (ability.system.powersgained) {
|
||||||
for (let power of ability.system.powersgained) {
|
for (let power of ability.system.powersgained) {
|
||||||
|
if (!power.system) power.system = power.data
|
||||||
newItems.push(power);
|
newItems.push(power);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ability.system.specialisations) {
|
if (ability.system.specialisations) {
|
||||||
for (let spec of ability.system.specialisations) {
|
for (let spec of ability.system.specialisations) {
|
||||||
|
if (!spec.system) spec.system = spec.data
|
||||||
newItems.push(spec);
|
newItems.push(spec);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ability.system.attackgained) {
|
if (ability.system.attackgained) {
|
||||||
for (let weapon of ability.system.attackgained) {
|
for (let weapon of ability.system.attackgained) {
|
||||||
|
if (!weapon.system) weapon.system = weapon.data
|
||||||
newItems.push(weapon);
|
newItems.push(weapon);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ability.system.armorgained) {
|
if (ability.system.armorgained) {
|
||||||
for (let armor of ability.system.armorgained) {
|
for (let armor of ability.system.armorgained) {
|
||||||
|
if (!armor.system) armor.system = armor.data
|
||||||
newItems.push(armor);
|
newItems.push(armor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1427,11 +1435,13 @@ export class PegasusActor extends Actor {
|
|||||||
|
|
||||||
console.log("DROPPED RACE", race)
|
console.log("DROPPED RACE", race)
|
||||||
for (let ability of race.system.abilities) {
|
for (let ability of race.system.abilities) {
|
||||||
|
if (!ability.system) ability.system = ability.data
|
||||||
newItems.push(ability)
|
newItems.push(ability)
|
||||||
this.applyAbility(ability, updates)
|
this.applyAbility(ability, updates)
|
||||||
}
|
}
|
||||||
if (race.system.perksgained) {
|
if (race.system.perksgained) {
|
||||||
for (let power of race.system.perks) {
|
for (let power of race.system.perks) {
|
||||||
|
if (!power.system) power.system = power.data
|
||||||
newItems.push(power);
|
newItems.push(power);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1462,7 +1472,7 @@ export class PegasusActor extends Actor {
|
|||||||
this.getIncreaseStatValue(updates, role.system.statincrease2)
|
this.getIncreaseStatValue(updates, role.system.statincrease2)
|
||||||
|
|
||||||
if (role.system.specialability.length > 0) {
|
if (role.system.specialability.length > 0) {
|
||||||
console.log("Adding ability", role.system.specialability)
|
//console.log("Adding ability", role.system.specialability)
|
||||||
newItems = newItems.concat(duplicate(role.system.specialability)) // Add new ability
|
newItems = newItems.concat(duplicate(role.system.specialability)) // Add new ability
|
||||||
this.applyAbility(role.system.specialability[0], newItems)
|
this.applyAbility(role.system.specialability[0], newItems)
|
||||||
}
|
}
|
||||||
@ -2056,6 +2066,10 @@ export class PegasusActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
addCrew(actorId) {
|
addCrew(actorId) {
|
||||||
|
if ( this.system.crew.length >= this.system.crewmax) {
|
||||||
|
ui.notifications.warn("Vehicle crew is already full.")
|
||||||
|
return
|
||||||
|
}
|
||||||
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
|
let crewList = duplicate(this.system.crew.filter(actorDef => actorDef.id != actorId) || [])
|
||||||
crewList.push({ id: actorId })
|
crewList.push({ id: actorId })
|
||||||
this.update({ 'system.crew': crewList })
|
this.update({ 'system.crew': crewList })
|
||||||
|
@ -426,11 +426,15 @@ export class PegasusItemSheet extends ItemSheet {
|
|||||||
let data = event.dataTransfer.getData('text/plain')
|
let data = event.dataTransfer.getData('text/plain')
|
||||||
let dataItem = JSON.parse( data)
|
let dataItem = JSON.parse( data)
|
||||||
console.log("DROP", event, dataItem )
|
console.log("DROP", event, dataItem )
|
||||||
const item = fromUuidSync(dataItem.uuid)
|
let item = fromUuidSync(dataItem.uuid)
|
||||||
|
if (item.pack) {
|
||||||
|
item = await PegasusUtility.searchItem(item)
|
||||||
|
}
|
||||||
if (!item) {
|
if (!item) {
|
||||||
ui.notifications.warn("Unable to find relevant item - Aborting drag&drop " + data.uuid)
|
ui.notifications.warn("Unable to find relevant item - Aborting drag&drop " + data.uuid)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
console.log("DROP REULT", this.object.type, item.type)
|
||||||
|
|
||||||
if (this.object.type == 'virtue' ) {
|
if (this.object.type == 'virtue' ) {
|
||||||
if (item.type == 'effect') {
|
if (item.type == 'effect') {
|
||||||
|
@ -253,7 +253,7 @@
|
|||||||
],
|
],
|
||||||
"title": "Pegasus RPG",
|
"title": "Pegasus RPG",
|
||||||
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
"url": "https://www.uberwald.me/data/files/fvtt-pegasus-rpg",
|
||||||
"version": "10.0.14",
|
"version": "10.0.15",
|
||||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.14.zip",
|
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.15.zip",
|
||||||
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
||||||
}
|
}
|
@ -201,6 +201,8 @@
|
|||||||
},
|
},
|
||||||
"vehicle": {
|
"vehicle": {
|
||||||
"crew": [],
|
"crew": [],
|
||||||
|
"crewmax": 0,
|
||||||
|
"crewmin": 0,
|
||||||
"statistics": {
|
"statistics": {
|
||||||
"fc": {
|
"fc": {
|
||||||
"label": "FC",
|
"label": "FC",
|
||||||
|
@ -11,7 +11,11 @@
|
|||||||
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.level"
|
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.level"
|
||||||
value="{{stat.level}}" data-dtype="Number" disabled>
|
value="{{stat.level}}" data-dtype="Number" disabled>
|
||||||
{{#select stat.level}}
|
{{#select stat.level}}
|
||||||
|
{{#if (eq key "ad")}}
|
||||||
|
{{{@root.optionsLevel}}}
|
||||||
|
{{else}}
|
||||||
{{{@root.optionsDiceList}}}
|
{{{@root.optionsDiceList}}}
|
||||||
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -20,7 +24,11 @@
|
|||||||
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.currentlevel"
|
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.currentlevel"
|
||||||
value="{{stat.currentlevel}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
value="{{stat.currentlevel}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
||||||
{{#select stat.currentlevel}}
|
{{#select stat.currentlevel}}
|
||||||
|
{{#if (eq key "ad")}}
|
||||||
|
{{{@root.optionsLevel}}}
|
||||||
|
{{else}}
|
||||||
{{{@root.optionsDiceList}}}
|
{{{@root.optionsDiceList}}}
|
||||||
|
{{/if}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -30,7 +38,7 @@
|
|||||||
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.turningarc45"
|
<select class="status-small-label color-class-common" type="text" name="system.statistics.{{key}}.turningarc45"
|
||||||
value="{{stat.turningarc45}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
value="{{stat.turningarc45}}" data-dtype="Number" {{#unless @root.editScore}}disabled{{/unless}}>
|
||||||
{{#select stat.turningarc45}}
|
{{#select stat.turningarc45}}
|
||||||
{{{@root.optionsDiceList}}}
|
{{{@root.optionsLevel}}}
|
||||||
{{/select}}
|
{{/select}}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
|
@ -553,6 +553,20 @@
|
|||||||
|
|
||||||
{{!-- Crew Tab --}}
|
{{!-- Crew Tab --}}
|
||||||
<div class="tab items" data-group="primary" data-tab="crew">
|
<div class="tab items" data-group="primary" data-tab="crew">
|
||||||
|
|
||||||
|
<div class="stat-item">
|
||||||
|
<ul class="stat-list alternate-list">
|
||||||
|
<li class="item stat flexrow list-item">
|
||||||
|
<span class="generic-label small-label "><strong>Maximum Crew Capacity</strong></span>
|
||||||
|
<input type="text" class="input-numeric-short padd-right" name="system.crewmax" value="{{data.crewmax}}"
|
||||||
|
data-dtype="Number" />
|
||||||
|
<span class="generic-label small-label"><strong>Minimum Crew Required</strong></span>
|
||||||
|
<input type="text" class="input-numeric-short" name="system.crewmin" value="{{data.crewmin}}"
|
||||||
|
data-dtype="Number" />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
|
||||||
<ul class="item-list alternate-list">
|
<ul class="item-list alternate-list">
|
||||||
<li class="item flexrow list-item items-title-bg">
|
<li class="item flexrow list-item items-title-bg">
|
||||||
<span class="item-name-label-header">
|
<span class="item-name-label-header">
|
||||||
|
Reference in New Issue
Block a user