enum speechpart {unknown, intransitive, transitive};
-enum wordtype {NO_WORD_TYPE, MOTION, OBJECT, ACTION, SPECIAL, NUMERIC};
+enum wordtype {NO_WORD_TYPE, MOTION, OBJECT, ACTION, NUMERIC};
typedef enum scorebonus {none, splatter, defeat, victory} score_t;
# actions: Action words, grouped into synonyms, and their corresponding
# default messages. The 'oldstyle' attribute is as for motions.
#
-# specials: Special action words, grouped into synonyms, and their
-# messages. These differ from the regular action words above in that
-# they only display their corresponding message; no other logic is
-# invoked. In the future, these will be merged into the regular actions.
-#
# hints: Each item contains a hint number, a hint label (used to
# generate the value macro for the hint) the number of turns he
# must be at the right loc(s) before triggering the hint, the
words: ['versi']
noaction: true
-# Specials no longer used, but this is still needed for now
-specials: !!omap
-- SPC_DELETEME:
- message: 'Please delete this item'
- words: ['null']
-
# end
command.part = intransitive;
command.verb = command.id1;
break;
- case SPECIAL:
- speak(specials[command.id1].message);
- goto Lclearobj;
case NUMERIC:
default: // LCOV_EXCL_LINE
BUG(VOCABULARY_TYPE_N_OVER_1000_NOT_BETWEEN_0_AND_3); // LCOV_EXCL_LINE
const bool noaction;
}} action_t;
-typedef struct {{
- const string_group_t words;
- const char* message;
- const bool noaction;
-}} special_t;
-
enum condtype_t {{cond_goto, cond_pct, cond_carry, cond_with, cond_not}};
enum desttype_t {{dest_goto, dest_special, dest_speak}};
extern long conditions[];
extern const motion_t motions[];
extern const action_t actions[];
-extern const special_t specials[];
extern const travelop_t travel[];
extern const long tkey[];
extern const char *ignore;
#define NCLASSES {}
#define NDEATHS {}
#define NTHRESHOLDS {}
-#define NMOTIONS {}
+#define NMOTIONS {}
#define NACTIONS {}
-#define NSPECIALS {}
#define NTRAVEL {}
#define NKEYS {}
{}
}};
-enum special_refs {{
-{}
-}};
-
/* State definitions */
{}
{}
}};
-const special_t specials[] = {{
-{}
-}};
-
const long tkey[] = {{{}}};
const travelop_t travel[] = {{
ignore += word.upper()
return mot_str
-def get_specials(specials):
+def get_actions(actions):
template = """ {{
.words = {},
.message = {},
.noaction = {},
}},
"""
- spc_str = ""
- for special in specials:
- contents = special[1]
+ act_str = ""
+ for action in actions:
+ contents = action[1]
if contents["words"] == None:
words_str = get_string_group([])
else:
noaction = "true"
- spc_str += template.format(words_str, message, noaction)
+ act_str += template.format(words_str, message, noaction)
global ignore
if contents.get("oldstyle", True) == False:
for word in contents["words"]:
if len(word) == 1:
ignore += word.upper()
- spc_str = spc_str[:-1] # trim trailing newline
- return spc_str
+ act_str = act_str[:-1] # trim trailing newline
+ return act_str
def bigdump(arr):
out = ""
get_hints(db["hints"], db["arbitrary_messages"]),
get_condbits(db["locations"]),
get_motions(db["motions"]),
- get_specials(db["actions"]),
- get_specials(db["specials"]),
+ get_actions(db["actions"]),
bigdump(tkey),
get_travel(travel),
ignore,
len(db["turn_thresholds"]),
len(db["motions"]),
len(db["actions"]),
- len(db["specials"]),
len(travel),
len(tkey),
deathbird,
get_refs(db["objects"]),
get_refs(db["motions"]),
get_refs(db["actions"]),
- get_refs(db["specials"]),
statedefines,
)
return (WORD_NOT_FOUND);
}
-static int get_special_vocab_id(const char* word)
-// Return the first special number that has 'word' as one of its words.
-{
- for (int i = 0; i < NSPECIALS; ++i) {
- for (int j = 0; j < specials[i].words.n; ++j) {
- if (strncasecmp(word, specials[i].words.strs[j], TOKLEN) == 0)
- return (i);
- }
- }
- // If execution reaches here, we didn't find the word.
- return (WORD_NOT_FOUND);
-}
-
static bool is_valid_int(const char *str)
/* Returns true if the string passed in is represents a valid integer,
* that could then be parsed by atoi() */
return;
}
- ref_num = get_special_vocab_id(word);
- if (ref_num != WORD_NOT_FOUND) {
- *id = ref_num;
- *type = SPECIAL;
- return;
- }
-
// Check for the reservoir magic word.
if (strcasecmp(word, game.zzword) == 0) {
*id = PART;
report["messages"][name]["covered"] = True
report["covered"] += 1
-def specials_actions_coverage(items, text, report):
- # works for actions or specials
+def actions_coverage(items, text, report):
+ # works for actions
for name, item in items:
if name not in report["messages"]:
report["messages"][name] = {"covered" : False}
loc_coverage(db["locations"], chk, report["locations"])
obit_coverage(db["obituaries"], chk, report["obituaries"])
obj_coverage(db["objects"], chk, report["objects"])
- specials_actions_coverage(db["actions"], chk, report["actions"])
- specials_actions_coverage(db["specials"], chk, report["specials"])
+ actions_coverage(db["actions"], chk, report["actions"])
threshold_coverage(db["classes"], chk, report["classes"])
threshold_coverage(db["turn_thresholds"], chk, report["turn_thresholds"])