Fix bug on getFlavorText for creatures and ships

This commit is contained in:
Melon-PieldeSapo
2025-03-27 18:04:18 +01:00
parent 37a0903b12
commit 140415920b
2 changed files with 17 additions and 18 deletions
+5 -6
View File
@@ -60,21 +60,20 @@ export class MothershipActor extends Actor {
if (game.settings.get("mosh", "useCalm") && context === 'stress') {
context = 'calm';
}
let systemclass = this.system.class.value.toLowerCase();
if (systemclass != "android"){
systemclass = "human";
let systemclass = "human";
if (this.type === 'character') {
systemclass = this.system.class.value.toLowerCase();
}
let locString = `Mosh.${type}.${context}.${action}.${systemclass}`;
//check to see if this address exists in the library, return the action parameter if not
if(game.i18n.has(locString, true)){ // You can pass false as the second argument to ignore english-language fallback.
//log what was done
console.log(`Retrieved flavor text for ${type}:${context}:${action}`);
console.log(`Retrieved flavor text for ${locString}`);
//return class appropriate text
return game.i18n.localize(locString);
} else {
//log what was done
console.log(`Retrieved flavor text for ${type}:${context}:${action}, which did not have an entry`);
console.log(`Retrieved flavor text for ${locString}, which did not have an entry`);
//return what we were asked
return action;
}
+12 -12
View File
@@ -91,18 +91,18 @@
<option value="Bleeding" />
<option value="Bleeding [-]" />
<option value="Bleeding [+]" />
<option value="BluntForce" />
<option value="BluntForce [-]" />
<option value="BluntForce [+]" />
<option value="FireAndExplosives" />
<option value="FireAndExplosives [-]" />
<option value="FireAndExplosives [+]" />
<option value="GoreAndMassive" />
<option value="GoreAndMassive [-]" />
<option value="GoreAndMassive [+]" />
<option value="Gunshot'" />
<option value="Gunshot' [-]" />
<option value="Gunshot' [+]" />
<option value="Blunt Force" />
<option value="Blunt Force [-]" />
<option value="Blunt Force [+]" />
<option value="Fire & Explosives" />
<option value="Fire & Explosives [-]" />
<option value="Fire & Explosives [+]" />
<option value="Gore & Massive" />
<option value="Gore & Massive [-]" />
<option value="Gore & Massive [+]" />
<option value="Gunshot" />
<option value="Gunshot [-]" />
<option value="Gunshot [+]" />
</datalist>
{{/if}}
</div>