Compare commits
8 Commits
fvtt-pegas
...
fvtt-pegas
Author | SHA1 | Date | |
---|---|---|---|
536b42dbe0 | |||
00761d57d3 | |||
5fb0221007 | |||
19f7ebca92 | |||
afe4fc2a1b | |||
27029abc88 | |||
d8f8b7198c | |||
908cf4206a |
@ -771,6 +771,9 @@ export class PegasusActor extends Actor {
|
|||||||
if (this.type == 'character') {
|
if (this.type == 'character') {
|
||||||
this.rollMR(true, combatId, combatantId)
|
this.rollMR(true, combatId, combatantId)
|
||||||
}
|
}
|
||||||
|
if (this.type == 'vehicle') {
|
||||||
|
this.rollMR(true, combatId, combatantId)
|
||||||
|
}
|
||||||
console.log("Init required !!!!")
|
console.log("Init required !!!!")
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
@ -1344,6 +1347,7 @@ export class PegasusActor extends Actor {
|
|||||||
this.getTraumaState()
|
this.getTraumaState()
|
||||||
this.cleanupPerksIfTrauma()
|
this.cleanupPerksIfTrauma()
|
||||||
this.parseStatEffects()
|
this.parseStatEffects()
|
||||||
|
this.parseStatusEffects()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1365,6 +1369,37 @@ export class PegasusActor extends Actor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
parseStatusEffects() {
|
||||||
|
let effects = this.items.filter(effect => effect.type == "effect" && effect.system.affectstatus && (Number(effect.system.effectlevel) > 0) )
|
||||||
|
for (let statusKey in this.system.secondary) {
|
||||||
|
let status = duplicate(this.system.secondary[statusKey])
|
||||||
|
let bonus = 0
|
||||||
|
for (let effect of effects) {
|
||||||
|
if ( effect.system.affectedstatus && effect.system.affectedstatus == statusKey) {
|
||||||
|
bonus += Number(effect.system.effectlevel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( bonus != status.bonus) {
|
||||||
|
status.bonus = bonus
|
||||||
|
this.update( { [`system.secondary.${statusKey}`]: status} )
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
let nrg = duplicate(this.system.nrg)
|
||||||
|
let bonus = 0
|
||||||
|
for (let effect of effects) {
|
||||||
|
if ( effect.system.affectedstatus && effect.system.affectedstatus == "nrg") {
|
||||||
|
bonus += Number(effect.system.effectlevel)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ( bonus != nrg.mod) {
|
||||||
|
nrg.mod = bonus
|
||||||
|
this.update( { [`system.nrg`]: nrg} )
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async modStat(key, inc = 1) {
|
async modStat(key, inc = 1) {
|
||||||
let stat = duplicate(this.system.statistics[key])
|
let stat = duplicate(this.system.statistics[key])
|
||||||
@ -1887,7 +1922,8 @@ export class PegasusActor extends Actor {
|
|||||||
|
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
async rollMR(isInit = false, combatId = 0, combatantId = 0) {
|
async rollMR(isInit = false, combatId = 0, combatantId = 0) {
|
||||||
let mr = duplicate(this.system.mr)
|
|
||||||
|
let mr = duplicate((this.type =="vehicle") ? this.system.statistics.mr : this.system.mr)
|
||||||
if (mr) {
|
if (mr) {
|
||||||
mr.dice = PegasusUtility.getDiceFromLevel(mr.value);
|
mr.dice = PegasusUtility.getDiceFromLevel(mr.value);
|
||||||
|
|
||||||
@ -2261,12 +2297,12 @@ export class PegasusActor extends Actor {
|
|||||||
if (actor) {
|
if (actor) {
|
||||||
let stat = this.getStat("hr")
|
let stat = this.getStat("hr")
|
||||||
let rollData = this.getCommonRollData("hr")
|
let rollData = this.getCommonRollData("hr")
|
||||||
|
rollData.isVehicleStun = true
|
||||||
rollData.mode = "stat"
|
rollData.mode = "stat"
|
||||||
rollData.title = `Stat ${stat.label}`;
|
rollData.title = `Stat ${stat.label}`
|
||||||
|
|
||||||
this.addVehicleArmors(rollData)
|
this.addVehicleArmors(rollData)
|
||||||
this.startRoll(rollData)
|
this.startRoll(rollData)
|
||||||
this.modifyVehicleStun(1)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -302,7 +302,7 @@ export class PegasusUtility {
|
|||||||
item = this.actor.items.get(data.uuid)
|
item = this.actor.items.get(data.uuid)
|
||||||
}
|
}
|
||||||
let itemFull = await PegasusUtility.searchItem(item)
|
let itemFull = await PegasusUtility.searchItem(item)
|
||||||
console.log("DROPPED DATA", data.uuid)
|
//console.log("DROPPED DATA", data.uuid)
|
||||||
if (game.user.isGM || token.actor.isOwner) {
|
if (game.user.isGM || token.actor.isOwner) {
|
||||||
this.addItemDropToActor(token.actor, itemFull)
|
this.addItemDropToActor(token.actor, itemFull)
|
||||||
} else {
|
} else {
|
||||||
@ -575,6 +575,21 @@ export class PegasusUtility {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* -------------------------------------------- */
|
||||||
|
static computeDistance() {
|
||||||
|
let mytarget = game.user.targets.first()
|
||||||
|
console.log("target", mytarget, mytarget)
|
||||||
|
let mytoken = _token
|
||||||
|
|
||||||
|
if (mytarget) {
|
||||||
|
let dist = canvas.grid.measureDistances(
|
||||||
|
[{ ray: new Ray(mytoken.center, mytarget.center) }],
|
||||||
|
{ gridSpaces: true });
|
||||||
|
console.log("DIST", dist)
|
||||||
|
} else {
|
||||||
|
console.log("NO TARGET")
|
||||||
|
}
|
||||||
|
}
|
||||||
/* -------------------------------------------- */
|
/* -------------------------------------------- */
|
||||||
static getDefenseState(actorId) {
|
static getDefenseState(actorId) {
|
||||||
return this.defenderStore[actorId];
|
return this.defenderStore[actorId];
|
||||||
@ -816,10 +831,13 @@ export class PegasusUtility {
|
|||||||
combat.updateEmbeddedDocuments("Combatant", [{ _id: rollData.combatantId, initiative: rollData.finalScore }])
|
combat.updateEmbeddedDocuments("Combatant", [{ _id: rollData.combatantId, initiative: rollData.finalScore }])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Stun specific -> Suffere a stun level when dmg-res
|
// Stun specific -> Suffer a stun level when dmg-res for character
|
||||||
if (rollData.subKey && rollData.subKey == "dmg-res") {
|
if (rollData.subKey && rollData.subKey == "dmg-res") {
|
||||||
actor.modifyStun(+1)
|
actor.modifyStun(+1)
|
||||||
}
|
}
|
||||||
|
if (rollData.isVehicleStun) {
|
||||||
|
this.modifyVehicleStun(1)
|
||||||
|
}
|
||||||
|
|
||||||
//this.removeUsedPerkEffects( rollData) // Unused for now
|
//this.removeUsedPerkEffects( rollData) // Unused for now
|
||||||
this.removeOneUseEffects(rollData) // Unused for now
|
this.removeOneUseEffects(rollData) // Unused for now
|
||||||
|
@ -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.24",
|
"version": "10.0.28",
|
||||||
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.24.zip",
|
"download": "https://www.uberwald.me/gitea/uberwald/fvtt-pegasus-rpg/archive/fvtt-pegasus-rpg-v10.0.28.zip",
|
||||||
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
"background": "systems/fvtt-pegasus-rpg/images/ui/pegasus_welcome_page.webp"
|
||||||
}
|
}
|
@ -154,6 +154,7 @@
|
|||||||
"label": "MR (Initiative)",
|
"label": "MR (Initiative)",
|
||||||
"type": "dice",
|
"type": "dice",
|
||||||
"value": 0,
|
"value": 0,
|
||||||
|
"bonuseffect": 0,
|
||||||
"mod": 0
|
"mod": 0
|
||||||
},
|
},
|
||||||
"momentum": {
|
"momentum": {
|
||||||
@ -412,6 +413,9 @@
|
|||||||
"physicalimmunity": false,
|
"physicalimmunity": false,
|
||||||
"nobonusdice": false,
|
"nobonusdice": false,
|
||||||
"noperksallowed": false,
|
"noperksallowed": false,
|
||||||
|
"affectstatus": false,
|
||||||
|
"affectedstatus": "",
|
||||||
|
"locked": false,
|
||||||
"description": ""
|
"description": ""
|
||||||
},
|
},
|
||||||
"race": {
|
"race": {
|
||||||
@ -444,7 +448,7 @@
|
|||||||
"perks": [],
|
"perks": [],
|
||||||
"perksrole": "",
|
"perksrole": "",
|
||||||
"description": "",
|
"description": "",
|
||||||
"rolelevel": 0
|
"rolelevel": 1
|
||||||
},
|
},
|
||||||
"ability": {
|
"ability": {
|
||||||
"affectedstat": "str",
|
"affectedstat": "str",
|
||||||
|
@ -302,18 +302,30 @@
|
|||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{#each effects as |effect key|}}
|
{{#each effects as |effect key|}}
|
||||||
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}"
|
<li class="item stat flexrow list-item list-item-shadow" data-arme-id="{{effect.id}}" data-item-id="{{effect._id}}">
|
||||||
data-item-id="{{effect._id}}">
|
{{#if effect.system.locked}}
|
||||||
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img"
|
{{#if @root.isGM}}
|
||||||
src="{{effect.img}}" /></a>
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{effect.img}}" /></a>
|
||||||
|
{{else}}
|
||||||
|
<img class="sheet-competence-img" src="{{effect.img}}" />
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<a class="item-edit item-name-img" title="Edit Item"><img class="sheet-competence-img" src="{{effect.img}}" /></a>
|
||||||
|
{{/if}}
|
||||||
<span class="item-name-label-long2">{{effect.name}}</span>
|
<span class="item-name-label-long2">{{effect.name}}</span>
|
||||||
<span class="item-field-label-short">{{effect.system.effectlevel}}</span>
|
<span class="item-field-label-short">{{effect.system.effectlevel}}</span>
|
||||||
<span class="item-field-label-short">{{upperFirst effect.system.type}}</span>
|
<span class="item-field-label-short">{{upperFirst effect.system.type}}</span>
|
||||||
<span class="item-field-label-short">{{upperFirst effect.datsystema.genre}}</span>
|
<span class="item-field-label-short">{{upperFirst effect.system.genre}}</span>
|
||||||
<span class="item-field-label-short">{{upper effect.system.stataffected}}</span>
|
<span class="item-field-label-short">{{upper effect.system.stataffected}}</span>
|
||||||
<div class="item-filler"> </div>
|
<div class="item-filler"> </div>
|
||||||
<div class="item-controls item-controls-fixed">
|
<div class="item-controls item-controls-fixed">
|
||||||
|
{{#if effect.system.locked}}
|
||||||
|
{{#if @root.isGM}}
|
||||||
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
|
{{/if}}
|
||||||
|
{{else}}
|
||||||
|
<a class="item-control item-delete" title="Delete Item"><i class="fas fa-trash"></i></a>
|
||||||
|
{{/if}}
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
@ -61,11 +61,13 @@
|
|||||||
<li class="flexrow"><label class="generic-label">No perks allowed ?</label>
|
<li class="flexrow"><label class="generic-label">No perks allowed ?</label>
|
||||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.noperksallowed" {{checked data.noperksallowed}}/></label>
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.noperksallowed" {{checked data.noperksallowed}}/></label>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="flexrow"><label class="generic-label">Locked (Only GM can change/edit) ?</label>
|
||||||
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.locked" {{checked data.locked}}/></label>
|
||||||
|
</li>
|
||||||
|
|
||||||
<li class="flexrow"><label class="generic-label">Effect Level is a Stat?</label>
|
<li class="flexrow"><label class="generic-label">Effect Level is a Stat?</label>
|
||||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.effectstatlevel" {{checked data.effectstatlevel}}/></label>
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.effectstatlevel" {{checked data.effectstatlevel}}/></label>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{{#if data.effectstatlevel}}
|
{{#if data.effectstatlevel}}
|
||||||
<li class="flexrow"><label class="generic-label">Stat to use for Effect Level</label>
|
<li class="flexrow"><label class="generic-label">Stat to use for Effect Level</label>
|
||||||
<select class="competence-base flexrow" type="text" name="system.effectstat" value="{{data.effectstat}}" data-dtype="String">
|
<select class="competence-base flexrow" type="text" name="system.effectstat" value="{{data.effectstat}}" data-dtype="String">
|
||||||
@ -83,6 +85,23 @@
|
|||||||
</li>
|
</li>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
|
<li class="flexrow"><label class="generic-label">Affect Status?</label>
|
||||||
|
<label class="attribute-value checkbox"><input type="checkbox" name="system.affectstatus" {{checked data.affectstatus}}/></label>
|
||||||
|
</li>
|
||||||
|
{{#if data.affectstatus}}
|
||||||
|
<li class="flexrow"><label class="generic-label">Affected status</label>
|
||||||
|
<select class="competence-base flexrow" type="text" name="system.affectedstatus" value="{{data.affectedstatus}}" data-dtype="String">
|
||||||
|
{{#select data.affectedstatus}}
|
||||||
|
<option value="health">Health</option>
|
||||||
|
<option value="delirium">Delirium</option>
|
||||||
|
<option value="socialhealth">Social Health</option>
|
||||||
|
<option value="stealthhealth">Stealth Health</option>
|
||||||
|
<option value="nrg">NRG</option>
|
||||||
|
{{/select}}
|
||||||
|
</select>
|
||||||
|
</li>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
<li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li>
|
<li class="flexrow"> <label class="generic-label">Affected Specialisations </label></li>
|
||||||
<li class="flexrow">
|
<li class="flexrow">
|
||||||
<ul class="ul-level1">
|
<ul class="ul-level1">
|
||||||
|
@ -13,16 +13,20 @@
|
|||||||
|
|
||||||
<div class="tab description" data-group="primary" data-tab="description">
|
<div class="tab description" data-group="primary" data-tab="description">
|
||||||
<div class="medium-editor item-text-long-line">
|
<div class="medium-editor item-text-long-line">
|
||||||
<label class="generic-label">Power Ups</label>
|
<label class="generic-label"><strong>Power Ups</strong></label>
|
||||||
{{editor purchasedeffects target="system.purchasedeffects" button=true owner=owner
|
{{editor purchasedeffects target="system.purchasedeffects" button=true owner=owner
|
||||||
editable=editable}}
|
editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
|
<span><label> </label></span>
|
||||||
|
<hr>
|
||||||
<div class="long-editor item-text-long-line">
|
<div class="long-editor item-text-long-line">
|
||||||
<label class="generic-label">Description</label>
|
<label class="generic-label"><strong>Description</strong></label>
|
||||||
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
{{editor description target="system.description" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
|
<span><label> </label></span>
|
||||||
|
<hr>
|
||||||
<div class="medium-editor item-text-long-line">
|
<div class="medium-editor item-text-long-line">
|
||||||
<label class="generic-label">Available Upgrades</label>
|
<label class="generic-label"><strong>Available Upgrades</strong></label>
|
||||||
{{editor effects target="system.effects" button=true owner=owner editable=editable}}
|
{{editor effects target="system.effects" button=true owner=owner editable=editable}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -30,8 +34,8 @@
|
|||||||
<div class="tab details" data-group="primary" data-tab="details">
|
<div class="tab details" data-group="primary" data-tab="details">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="flexrow"><label class="generic-label">Roll Needed ?</label>
|
<li class="flexrow"><label class="generic-label">Roll Needed ?</label>
|
||||||
<label class="attribute-value checkbox"><input type="checkbox" name="system.rollneeded" {{checked
|
<label class="attribute-value checkbox">
|
||||||
data.rollneeded}} /></label>
|
<input type="checkbox" name="system.rollneeded" {{checked data.rollneeded}} /></label>
|
||||||
</li>
|
</li>
|
||||||
{{#if data.rollneeded}}
|
{{#if data.rollneeded}}
|
||||||
<li class="flexrow"><label class="generic-label">Related Statistic (only if roll is needed)</label>
|
<li class="flexrow"><label class="generic-label">Related Statistic (only if roll is needed)</label>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
</label>
|
</label>
|
||||||
</span>
|
</span>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.value" value="{{stat2.value}}" data-dtype="Number"/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.bonus" value="{{stat2.bonus}}" data-dtype="Number" disabled/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.secondary.{{key}}.max" value="{{stat2.max}}" data-dtype="Number"/>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<label class="status-small-label"><strong>{{data.nrg.label}}</strong></label>
|
<label class="status-small-label"><strong>{{data.nrg.label}}</strong></label>
|
||||||
</span>
|
</span>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.value" value="{{data.nrg.value}}" data-dtype="Number"/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.mod" value="{{data.nrg.mod}}" data-dtype="Number" disabled/>
|
||||||
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
<input type="text" class="padd-right status-small-label no-grow" name="system.nrg.max" value="{{data.nrg.max}}" data-dtype="Number"/>
|
||||||
<span class="small-label status-small-label"> / {{data.nrg.absolutemax}}</span>
|
<span class="small-label status-small-label"> / {{data.nrg.absolutemax}}</span>
|
||||||
</li>
|
</li>
|
||||||
|
@ -119,10 +119,9 @@
|
|||||||
<option value="d4">Slight cover d4</option>
|
<option value="d4">Slight cover d4</option>
|
||||||
<option value="d8">Half cover d8</option>
|
<option value="d8">Half cover d8</option>
|
||||||
<option value="d12">Full cover d12</option>
|
<option value="d12">Full cover d12</option>
|
||||||
<option value="d12">Full cover d12</option>
|
|
||||||
<option value="none2">===== Cover Damage Resistance</option>
|
<option value="none2">===== Cover Damage Resistance</option>
|
||||||
<option value="d4">Soft cover d4</option>
|
<option value="d4">Soft cover d4</option>
|
||||||
<option value="d6">Dense cover d16</option>
|
<option value="d6">Dense cover d6</option>
|
||||||
<option value="d8">Light cover d8</option>
|
<option value="d8">Light cover d8</option>
|
||||||
<option value="d10">Thick cover d10</option>
|
<option value="d10">Thick cover d10</option>
|
||||||
<option value="d12">Solid cover d12</option>
|
<option value="d12">Solid cover d12</option>
|
||||||
@ -131,7 +130,7 @@
|
|||||||
<option value="d6">Outnumbered 2 Extra Allies d6</option>
|
<option value="d6">Outnumbered 2 Extra Allies d6</option>
|
||||||
<option value="d8">Outnumbered 3 Extra Allies d8</option>
|
<option value="d8">Outnumbered 3 Extra Allies d8</option>
|
||||||
<option value="d10">Outnumbered 4 Extra Allies d10</option>
|
<option value="d10">Outnumbered 4 Extra Allies d10</option>
|
||||||
<option value="d12">Outnumbered 5 Extra Allies d1<option>
|
<option value="d12">Outnumbered 5 Extra Allies d12<option>
|
||||||
<option value="none4">===== Called DMG Shot Bonus</option>
|
<option value="none4">===== Called DMG Shot Bonus</option>
|
||||||
<option value="d12">Eyes/head d12<option>
|
<option value="d12">Eyes/head d12<option>
|
||||||
<option value="none4">===== Impact DMG Bonus</option>
|
<option value="none4">===== Impact DMG Bonus</option>
|
||||||
|
Reference in New Issue
Block a user