commit - c0c6ae4a59ce0ecc749f0507f9ee44f8df7dfafc
commit + 361591bb0df5e8ab1da0523f8b5a6916574bea65
blob - 90765ca3185efc629a86bc5d1f857ae5035ee2dc
blob + 2e4f55fd846a5563558ecd8e64dbb0f2d70a532c
--- fight.c
+++ fight.c
#include "isscrolls.h"
void
-cmd_enter_the_fray(char *stat)
+cmd_enter_the_fray(char *cmd)
{
struct character *curchar = get_current_character();
+ char stat[MAX_STAT_LEN];
int ival[2] = { -1, -1 };
int ret;
return;
}
- if (strlen(stat) == 0) {
+ ret = get_args_from_cmd(cmd, stat, &ival[1]);
+ if (ret <= -10) {
info:
printf("\nPlease specify the stat you'd like to use in this move\n\n");
printf("heart\t- You are facing off against your foe\n");
printf("wits\t- You are ambushed\n");
printf("Example: enterthefray wits\n\n");
return;
+ } else if (ret <= -20) {
+ return;
}
if (strcmp(stat, "wits") == 0) {
- ival[0] = curchar->wits;
+ ival[0] = curchar->wits;
} else if (strcmp(stat, "shadow") == 0) {
ival[0] = curchar->shadow;
} else if (strcmp(stat, "heart") == 0) {
}
void
-cmd_strike(char *stat)
+cmd_strike(char *cmd)
{
struct character *curchar = get_current_character();
+ char stat[MAX_STAT_LEN];
int ival[2] = { -1, -1 };
int ret;
return;
}
- if (strlen(stat) == 0) {
+ ret = get_args_from_cmd(cmd, stat, &ival[1]);
+ if (ret <= -10) {
info:
printf("Please specify the stat you'd like to use in this move\n\n");
printf("iron\t- You attack in close quarters\n");
printf("edge\t- You attack at range\n");
printf("Example: strike iron\n");
return;
- }
+ } else if (ret <= -20)
+ return;
if (strcmp(stat, "iron") == 0) {
ival[0] = curchar->iron;
}
void
-cmd_clash(char *stat)
+cmd_clash(char *cmd)
{
struct character *curchar = get_current_character();
+ char stat[MAX_STAT_LEN];
int ival[2] = { -1, -1 };
int ret;
return;
}
- if (strlen(stat) == 0) {
+ ret = get_args_from_cmd(cmd, stat, &ival[1]);
+ if (ret <= -10) {
info:
printf("Please specify the stat you'd like to use in this move\n\n");
printf("iron\t- You fight in close quarters\n");
printf("edge\t- You fight at range\n");
printf("Example: clash iron\n");
return;
- }
+ } else if (ret <= -20)
+ return;
if (strcmp(stat, "iron") == 0) {
ival[0] = curchar->iron;
}
void
-cmd_battle(char *stat)
+cmd_battle(char *cmd)
{
struct character *curchar = get_current_character();
+ char stat[MAX_STAT_LEN];
int ival[2] = { -1, -1 };
int ret;
return;
}
- if (strlen(stat) == 0) {
+ ret = get_args_from_cmd(cmd, stat, &ival[1]);
+ if (ret <= -10) {
info:
printf("Please specify the stat you'd like to use in this move\n\n");
printf("edge\t- Fight at range, or using your speed and the terrain\n");
printf("wits\t- Fight using careful tactics to outsmart your opponents\n\n");
printf("Example: battle iron\n");
return;
- }
+ } else if (ret <= -20)
+ return;
if (strcmp(stat, "iron") == 0) {
ival[0] = curchar->iron;