Skip to content

Commit

Permalink
Merge pull request #50 from neillc/gurps
Browse files Browse the repository at this point in the history
Add initial support for GURPS
  • Loading branch information
mclemente authored Aug 3, 2022
2 parents 10716c4 + adfaeaf commit cb92a49
Show file tree
Hide file tree
Showing 3 changed files with 91 additions and 3 deletions.
38 changes: 37 additions & 1 deletion module/SystemProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -1379,7 +1379,7 @@ export class cyphersystemProvider extends SystemProvider {
}
}

export class CoC7Provider {
export class CoC7Provider extends SystemProvider {
get template() {
return "/modules/party-overview/templates/coc7.hbs";
}
Expand Down Expand Up @@ -1408,3 +1408,39 @@ export class CoC7Provider {
};
}
}
export class GURPSProvider extends SystemProvider {
get template() {
return "/modules/party-overview/templates/gurps.hbs";
}

getActorDetails(actor) {
const data = actor.data.data;
return {
id: actor.id,
name: actor.name,
hp: data.HP,
fp: data.FP,
dx: data.attributes.DX,
ht: data.attributes.HT,
iq: data.attributes.IQ,
st: data.attributes.ST,
per: data.attributes.PER,
will: data.attributes.WILL,
move: data.currentmove,
dodge: data.currentdodge,
parry: data.equippedparry,
hearing: data.hearing,
touch: data.touch,
vision: data.vision,
tastesmell: data.tastesmell,
};
}

/**
* Default width for the system's overview.
*/
get width() {
return 750;
}

}
7 changes: 5 additions & 2 deletions module/api.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// prettier-ignore
import { SystemProvider, archmageProvider, bitdProvider, dccProvider, dnd35eProvider, dnd4eProvider, dnd5eProvider, pf1Provider, pf2eProvider,
scumAndVillainyProvider, sfrpgProvider, swadeProvider, tormenta20Provider, wfrp4eProvider, cyphersystemProvider, CoC7Provider} from "./SystemProvider.js";
scumAndVillainyProvider, sfrpgProvider, swadeProvider, tormenta20Provider, wfrp4eProvider, cyphersystemProvider, CoC7Provider, GURPSProvider} from "./SystemProvider.js";

export const availableSystemProviders = {};
export let currentSystemProvider = undefined;
Expand Down Expand Up @@ -86,7 +86,10 @@ export function initApi() {
systemProviders.push(new cyphersystemProvider("native.cyphersystem"));
break;
case "CoC7":
systemProviders.push(new CoC7Provider("native.coc7"))
systemProviders.push(new CoC7Provider("native.coc7"));
break;
case "gurps":
systemProviders.push(new GURPSProvider("native.gurps"));
break;
default:
systemProviders.push(new SystemProvider("native"));
Expand Down
49 changes: 49 additions & 0 deletions templates/gurps.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<div>
<section class="content">
<div class="tab" data-group="party">
<div class="table-row header">
{{> "modules/party-overview/templates/parts/FilterButton.html"}}
<div class="text">Name</div>

<div class="num" title="Strength">ST</div>
<div class="num" title="Dexterity">DX</div>

<div class="num" title="Health">HT</div>
<div class="num" title="Intelligence">IQ</div>

<div class="num" title="HitPoints"><i class="fas fa-heart"></i></div>
<div class="num" title="Fatigue">FP</div>

<div class="num" title="Move">Move</div>
<div class="num" title="Dodge">Dodge</div>
<div class="num" title="Parry">Parry</div>
<div class="num" title="Will">Will</div>
<div class="num" title="Perception">Per</div>

</div>

{{#each actors as | actor | }}
<div class="table-row">
{{> "modules/party-overview/templates/parts/ToggleVisibilityButton.html" actor=actor}}
<div class="text">{{ actor.name }}</div>

<div class="num">{{ actor.st.value }}</div>
<div class="num">{{ actor.dx.value }}</div>
<div class="num">{{ actor.iq.value }}</div>
<div class="num">{{ actor.ht.value }}</div>


<div class="num">{{ actor.hp.value }}/{{ actor.hp.max }}</div>
<div class="num">{{ actor.fp.value }}/{{ actor.fp.max }}</div>

<div class="num">{{ actor.move }}</div>
<div class="num">{{ actor.dodge }}</div>
<div class="num">{{ actor.parry }}</div>
<div class="num">{{ actor.will.value }}</div>
<div class="num">{{ actor.per.value }}</div>

</div>
{{/each}}
</div>
</section>
</div>

0 comments on commit cb92a49

Please sign in to comment.