Second Gender

version 1 by Felix Larsson

  • Home page
  • Beginning
  • Previous
  • Next



  • Section - Pronoun Handling
    [This code is adapted from Fredrik Ramsberg's Swedish translation of Inform 6.]

    [PronounNotice should consider GetSecondaryObject.]
    Include (-
    [ SetPronoun dword value x;
    for (x=1 : x<=LanguagePronouns-->0 : x=x+3)
    if (LanguagePronouns-->x == dword) {
    LanguagePronouns-->(x+2) = value; return;
    }
    RunTimeError(14);
    ];

    [ PronounValue dword x;
    for (x=1 : x<=LanguagePronouns-->0 : x=x+3)
    if (LanguagePronouns-->x == dword)
    return LanguagePronouns-->(x+2);
    return 0;
    ];

    [ ResetVagueWords obj; PronounNotice(obj); ];

    [ PronounNotice obj x bm;
    if (obj == player) return;

    bm = PowersOfTwo_TB-->(GetGNAOfObject(obj));
    ! §#§ Added one line, to allow for an object to have two genders
    bm = bm | (PowersOfTwo_TB-->(GetSecondaryGNAOfObject(obj)));

    for (x = 1 : x <= LanguagePronouns-->0: x = x+3)
    if (bm & (LanguagePronouns-->(x+1)) ~= 0)
    LanguagePronouns-->(x+2) = obj;
    ];

    [ PronounNoticeHeldObjects x;
    #IFNDEF MANUAL_PRONOUNS;
    objectloop(x in player) PronounNotice(x);
    #ENDIF;
    x = 0; ! To prevent a "not used" error
    rfalse;
    ];
    -) instead of "Pronoun Handling" in "Parser.i6t".