notice(s_GameServ, sender->getNick(), "Hit Points: %d of %d", ni->stats->hp,
ni->stats->maxhp);
- sprintf(buf, "Strength: %d", ni->stats->strength + webonus[ni->stats->weapon]);
+ sprintf(buf, "Strength: %d", ni->stats->strength + webonus[ni->stats->wea]);
space = spaces(strlen(buf), " ");
notice(s_GameServ, sender->getNick(), "%s%sDefense: %d",
- buf, space, ni->stats->defense + arbonus[ni->stats->armor]);
+ buf, space, ni->stats->defense + arbonus[ni->stats->arm]);
delete [] space;
- sprintf(buf, "Armor: %s", armors[ni->stats->armor]);
+ sprintf(buf, "Armor: %s", armors[ni->stats->arm]);
space = spaces(strlen(buf), " ");
notice(s_GameServ, sender->getNick(), "%s%sWeapon: %s", buf, space,
- weapons[ni->stats->weapon]);
+ weapons[ni->stats->wea]);
delete [] space;
sprintf(buf, "Forest Fights: %d", ni->stats->forest_fights);
return;
}
- target->stats->weapon = stringtoint(cmd2);
+ target->stats->wea = stringtoint(cmd2);
- if (target->stats->weapon < 0)
- target->stats->weapon = 0;
- else if (target->stats->weapon >= WNA)
- target->stats->weapon = WNA - 1;
- notice(s_GameServ, u, "Weapon set to %s", weapons[target->stats->weapon]);
+ if (target->stats->wea < 0)
+ target->stats->wea = 0;
+ else if (target->stats->wea >= WNA)
+ target->stats->wea = WNA - 1;
+ notice(s_GameServ, u, "Weapon set to %s", weapons[target->stats->wea]);
return;
}
}
notice(s_GameServ, u, "SYNTAX: /msg %S SET [NAME] ARMOR <NUMBER>");
return;
}
- target->stats->armor = stringtoint(cmd2);
+ target->stats->arm = stringtoint(cmd2);
- if (target->stats->armor < 0)
- target->stats->armor = 0;
- else if (target->stats->armor >= WNA)
- target->stats->armor = WNA - 1;
+ if (target->stats->arm < 0)
+ target->stats->arm = 0;
+ else if (target->stats->arm >= WNA)
+ target->stats->arm = WNA - 1;
- notice(s_GameServ, u, "Armor set to %s", armors[target->stats->armor]);
+ notice(s_GameServ, u, "Armor set to %s", armors[target->stats->arm]);
return;
}
}
if (!is_playing(user))
{
ListNode<aClient> *temp;
- user->stats = new Player(user);
+ user->stats = new Player();
user->stats->client = user; // Set the backwards pointer
user->stats->reset(); // set the user up
user->stats->setPassword(password);
// Opponent's Hit
mhit = (fight->strength / 2) +
(rand() % (fight->strength / 2) - (user->stats->defense +
- arbonus[user->stats->armor]));
+ arbonus[user->stats->arm]));
}
else
{
// Opponent's Hit
- mhit = (((battle->stats->strength + webonus[battle->stats->weapon]) / 2) +
- (rand() % ((battle->stats->strength + webonus[battle->stats->weapon])) / 2) -
- (user->stats->defense + arbonus[user->stats->armor]));
+ mhit = (((battle->stats->strength + webonus[battle->stats->wea]) / 2) +
+ (rand() % ((battle->stats->strength + webonus[battle->stats->wea])) / 2) -
+ (user->stats->defense + arbonus[user->stats->arm]));
}
if (!player_fight(user))
{
clearYourTurn(it);
outfile << it->name.c_str() << ' ' << it->level << ' ' << it->exp << ' ' << it->gold << ' ' << it->bank << ' '
<< it->hp << ' ' << it->maxhp << ' ' << it->strength << ' ' << it->defense << ' '
- << it->armor << ' ' << it->weapon << ' '
+ << it->arm << ' ' << it->wea << ' '
<< it->forest_fights << ' ' << it->player_fights << ' '
<< it->getFlags() << ' ' << it->password << ' ' << it->inventory.Healing()
<< ' ' << it->inventory.Strength() << ' ' << it->inventory.Defense() << ' ' << it->inventory.HP()
p->maxhp = stringtoint(strtok(NULL, " "));
p->strength = stringtoint(strtok(NULL, " "));
p->defense = stringtoint(strtok(NULL, " "));
- p->armor = stringtoint(strtok(NULL, " "));
- p->weapon = stringtoint(strtok(NULL, " "));
+ p->arm = stringtoint(strtok(NULL, " "));
+ p->wea = stringtoint(strtok(NULL, " "));
p->forest_fights = stringtoint(strtok(NULL, " "));
p->player_fights = stringtoint(strtok(NULL, " "));
p->setFlags(stringtoint(strtok(NULL, " ")));
p = user->stats;
- if (p->weapon != 0)
- notice(s_GameServ, u, "You have to sell your %s first!", weapons[p->weapon]);
+ if (p->wea != 0)
+ notice(s_GameServ, u, "You have to sell your %s first!", weapons[p->wea]);
else if (p->gold < prices[wep - 1])
notice(s_GameServ, u, "You don't have enough gold for %s!", weapons[wep]);
else
{
notice(s_GameServ, u, "You have purchased %s! Thanks for the gold!", weapons[wep]);
- p->weapon = wep;
+ p->wea = wep;
p->gold -= prices[wep - 1];
}
}
p = user->stats;
- if (p->armor != 0)
- notice(s_GameServ, u, "You have to sell your %s first!", armors[p->armor]);
+ if (p->arm != 0)
+ notice(s_GameServ, u, "You have to sell your %s first!", armors[p->arm]);
else if (p->gold < prices[wep - 1])
notice(s_GameServ, u, "You don't have enough gold for %s!", armors[wep]);
else
{
notice(s_GameServ, u, "You have purchased %s! Thanks for the gold!", armors[wep]);
- p->armor = wep;
+ p->arm = wep;
p->gold -= prices[wep - 1];
}
}
if (stricmp(item, "WEAPON") == 0)
{
- if (p->weapon == 0)
+ if (p->wea == 0)
{
notice(s_GameServ, u, "You want me to chop off your hands?");
return;
else if (p->gold == 2000000000)
{
notice(s_GameServ, u, "You have enough gold. I'll just take that off your hands, sire.");
- p->weapon = 0;
+ p->wea = 0;
}
- else if (2000000000 - p->gold < (prices[p->weapon - 1] / 2))
+ else if (2000000000 - p->gold < (prices[p->wea - 1] / 2))
{
notice(s_GameServ, u, "Thank you for your business! You now have as much gold as you can carry.");
notice(s_GameServ, u, "However, you have no weapon... can I interest you in the %s?", weapons[WNA - 1]);
p->gold = 2000000000;
- p->weapon = 0;
+ p->wea = 0;
}
else
{
- notice(s_GameServ, u, "Thank you for your business! You now have %d more gold but no weapon!", (prices[p->weapon - 1] / 2));
- p->gold += (prices[p->weapon - 1] / 2);
- p->weapon = 0;
+ notice(s_GameServ, u, "Thank you for your business! You now have %d more gold but no weapon!", (prices[p->wea - 1] / 2));
+ p->gold += (prices[p->wea - 1] / 2);
+ p->wea = 0;
}
}
else if (stricmp(item, "ARMOR") == 0)
{
p = user->stats;
- if (p->armor == 0)
+ if (p->arm == 0)
{
notice(s_GameServ, u, "I don't think you can be any more naked...");
return;
if (p->gold == 2000000000)
{
notice(s_GameServ, u, "You have enough gold. I'll just take that off your hands, sire.");
- p->armor = 0;
+ p->arm = 0;
}
- else if (2000000000 - p->gold < (prices[p->armor - 1] / 2))
+ else if (2000000000 - p->gold < (prices[p->arm - 1] / 2))
{
notice(s_GameServ, u, "Thank you for your business! You now have as much gold as you can carry.");
notice(s_GameServ, u, "However, you have no armor... can I interest you in %s?", armors[WNA - 1]);
p->gold = 2000000000;
- p->armor = 0;
+ p->arm = 0;
}
else
{
notice(s_GameServ, u, "Thank you for your business! You now have %d more gold but no armor!",
- (prices[p->armor - 1] / 2));
+ (prices[p->arm - 1] / 2));
- p->gold += (prices[p->armor - 1] / 2);
- p->armor = 0;
+ p->gold += (prices[p->arm - 1] / 2);
+ p->arm = 0;
}
}
else
"your %s, and venture into the hot, dark cave. "\
"You are surprised at the angle of descent as you climb "\
"lower and lower, deeper into the dragon's den.",
- armors[p->armor], weapons[p->weapon]);
+ armors[p->arm], weapons[p->wea]);
notice(s_GameServ, u, "You come to the end of the cave to find "\
"a tooth. It is a large tooth... bigger than your torso."\
" Suddenly the darkness lifts from the gleam of an eye "\