Import RMFRP tables + properly rename all files

This commit is contained in:
2024-08-15 22:25:07 +02:00
parent aad90144fe
commit fe36edfeff
110 changed files with 158657 additions and 462 deletions

View File

@ -1,4 +1,4 @@
export class RMSSActor extends Actor {
export class RMFRPActor extends Actor {
/** @override */
prepareData() {
@ -12,7 +12,7 @@ export class RMSSActor extends Actor {
prepareDerivedData() {
const actorData = this;
const systemData = actorData.system;
const flags = actorData.flags.rmss || {};
const flags = actorData.flags.rmfrp || {};
// Make separate methods for each Actor type (character, npc, etc.) to keep
// things organized.
@ -70,7 +70,7 @@ export class RMSSActor extends Actor {
modifier = -30;
}
this.system.modifiers.woundsModifier = modifier;
console.log(`rmss | actor.js | Wounds Malus: ${this.system.modifiers.woundsModifier} ${percent}`);
console.log(`rmfrp | actor.js | Wounds Malus: ${this.system.modifiers.woundsModifier} ${percent}`);
}
/**
@ -238,7 +238,7 @@ export class RMSSActor extends Actor {
calculateSkillBonuses() {
for (const item of this.items) {
if (item.type === "skill") {
console.log(`rmss | actor.js | Calculating skill bonus for Skill: ${item.name}`);
console.log(`rmfrp | actor.js | Calculating skill bonus for Skill: ${item.name}`);
item.calculateSelectedSkillCategoryBonus(item);
item.calculateSkillTotalBonus(item);
}
@ -250,7 +250,7 @@ export class RMSSActor extends Actor {
for (const item of this.items) {
if (item.type === "skill_category") {
console.log(`rmss | actor.js | Calculating Skill Category Stat Bonuses for: ${item.name}`);
console.log(`rmfrp | actor.js | Calculating Skill Category Stat Bonuses for: ${item.name}`);
// Get all the applicable stats for this skill category
let app_stat_1 = item.system.app_stat_1;
let app_stat_2 = item.system.app_stat_2;
@ -265,17 +265,17 @@ export class RMSSActor extends Actor {
let applicable_stat_bonuses = [];
// Iterate through the applicable stats and find their full names
for (const stat in CONFIG.rmss.stats) {
for (const stat in CONFIG.rmfrp.stats) {
// If the configured App Stat matches the one of the stats in config
if (app_stat_1 === CONFIG.rmss.stats[stat].shortname) {
if (app_stat_1 === CONFIG.rmfrp.stats[stat].shortname) {
// Add the Stat Bonus to the array
applicable_stat_bonuses.push(this.system.stats[stat].stat_bonus);
}
if (app_stat_2 === CONFIG.rmss.stats[stat].shortname) {
if (app_stat_2 === CONFIG.rmfrp.stats[stat].shortname) {
// Add the Stat Bonus to the array
applicable_stat_bonuses.push(this.system.stats[stat].stat_bonus);
}
if (app_stat_3 === CONFIG.rmss.stats[stat].shortname) {
if (app_stat_3 === CONFIG.rmfrp.stats[stat].shortname) {
// Add the Stat Bonus to the array
applicable_stat_bonuses.push(this.system.stats[stat].stat_bonus);
}
@ -302,7 +302,7 @@ export class RMSSActor extends Actor {
getOwnedItemsByType(item_type) {
let ownedItems = {None: "None"};
console.log(`rmss | actor.js | Getting owned ${item_type} for: ${this.name}`);
console.log(`rmfrp | actor.js | Getting owned ${item_type} for: ${this.name}`);
for (const item of this.items) {
if (item.type === item_type) {
ownedItems[item._id] = item.name;

View File

@ -1,6 +1,6 @@
import { RFRPUtility } from "../rfrp-utility.js";
export class RMSSItem extends Item {
export class RMFRPItem extends Item {
/** @override */
prepareData() {
@ -8,7 +8,7 @@ export class RMSSItem extends Item {
// the following, in order: data reset (to clear active effects),
// prepareBaseData(), prepareEmbeddedDocuments() (including active effects),
// prepareDerivedData().
console.log(`rmss | item.js | prepareData for: ${this.name}`);
console.log(`rmfrp | item.js | prepareData for: ${this.name}`);
super.prepareData();
}
@ -62,7 +62,7 @@ export class RMSSItem extends Item {
_prepareSkillCategoryData(itemData) {
if (itemData.type !== "skill_category") return;
console.log(`rmss | item.js | Preparing Skill Category Data for: ${itemData.name}`);
console.log(`rmfrp | item.js | Preparing Skill Category Data for: ${itemData.name}`);
// Calculate Skill Category Total Bonus
this.calculateSkillCategoryTotalBonus(itemData);
}
@ -70,7 +70,7 @@ export class RMSSItem extends Item {
_prepareSkillData(itemData) {
if (itemData.type !== "skill") return;
console.log(`rmss | item.js | Preparing Skill Data for: ${itemData.name}`);
console.log(`rmfrp | item.js | Preparing Skill Data for: ${itemData.name}`);
// Make modifications to data here. For example:
// const systemData = itemData.system;
// Calculate Skill Category Bonus
@ -81,7 +81,7 @@ export class RMSSItem extends Item {
calculateSkillCategoryTotalBonus(itemData) {
if (this.type === "skill_category") {
console.log(`rmss | item.js | Calculating Skill Category Total Bonus for: ${itemData.name}`);
console.log(`rmfrp | item.js | Calculating Skill Category Total Bonus for: ${itemData.name}`);
const systemData = itemData.system;
itemData.system.total_bonus = Number(systemData.rank_bonus)
+ Number(systemData.stat_bonus)
@ -94,7 +94,7 @@ export class RMSSItem extends Item {
calculateSkillTotalBonus(itemData) {
if (this.type === "skill") {
const systemData = itemData.system;
console.log(`rmss | item.js | Calculating Skill Total Bonus for: ${itemData.name}`);
console.log(`rmfrp | item.js | Calculating Skill Total Bonus for: ${itemData.name}`);
itemData.system.total_bonus = Number(systemData.rank_bonus)
+ Number(systemData.category_bonus)
+ Number(systemData.item_bonus)