Skip to content

Commit

Permalink
Fixes forgotten link in ctrl.list and uses verb actions in cnvtLinks
Browse files Browse the repository at this point in the history
  • Loading branch information
Baltasarq committed Sep 13, 2023
1 parent 259d54d commit 2ef7738
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions lib/fi.js
Original file line number Diff line number Diff line change
Expand Up @@ -1656,8 +1656,8 @@ const ctrl = ( function() {
*/
function decideLinkClass(cmd)
{
const pnjRefPrefix = "<a class=\"" + HtmlClassRef.links.pnj + "\"";
const objRefPrefix = "<a class=\"" + HtmlClassRef.links.obj + "\"";
const PRS_REF_PREFIX = "<a class=\"" + HtmlClassRef.links.pnj + "\"";
const OBJ_REF_PREFIX = "<a class=\"" + HtmlClassRef.links.obj + "\"";
let toret = "<a class=\"" + HtmlClassRef.links.mov + "\"";

if ( cmd != null ) {
Expand All @@ -1669,20 +1669,19 @@ const ctrl = ( function() {
if ( words.length > 0 ) {
let firstWord = words[ 0 ];

const objs = [
"ex", "examina", "examinar", "examino",
"m", "mirar", "mira", "miro",
"look", "x", "take", "get", "pick",
"coger", "coge", "cojo", "tomar", "toma", "tomo" ];
const OBJS_VERBS =
actions.getAction( "examine" ).verbs
.concat( actions.getAction( "look" ).verbs )
.concat( actions.getAction( "take" ).verbs );

const pnjs = [ "habla", "hablar", "hablo", "talk" ];
const PRS_VERBS = actions.getAction( "talk" ).verbs;

if ( objs.indexOf( firstWord ) > -1 ) {
toret = objRefPrefix;
if ( OBJS_VERBS.indexOf( firstWord ) > -1 ) {
toret = OBJ_REF_PREFIX;
}
else
if ( pnjs.indexOf( firstWord ) > -1 ) {
toret = pnjRefPrefix;
if ( PRS_VERBS.indexOf( firstWord ) > -1 ) {
toret = PRS_REF_PREFIX;
}
}
}
Expand Down Expand Up @@ -2524,7 +2523,7 @@ const ctrl = ( function() {
// Action
if ( loc == player ) {
if ( obj.isWorn() ) {
toret += obj.id + " (";
toret += buildTextLink( obj.id, EX_ACT ) + " (";
toret += buildTextLink( obj.id, DISROBE_ACT, "puesto" );
toret += ")";
} else {
Expand Down

0 comments on commit 2ef7738

Please sign in to comment.