X-Git-Url: https://jfr.im/git/irc/gameservirc.git/blobdiff_plain/8f0f4c84e865e325c8c074bb69bf75b6c5c76bd0..8a5cec4fe1859f7c5b1c818cf1cd7a5369e284aa:/gameserv/do_attack.cpp diff --git a/gameserv/do_attack.cpp b/gameserv/do_attack.cpp index 1f53b24..222ebf0 100644 --- a/gameserv/do_attack.cpp +++ b/gameserv/do_attack.cpp @@ -51,25 +51,26 @@ void do_attack(char *u) if (!player_fight(ni)) { // Player's Hit - hit = ((ni->stats->strength + webonus[ni->stats->weapon]) / 2) + - (rand() % ((ni->stats->strength + webonus[ni->stats->weapon]) / 2)); + hit = ((ni->stats->strength + webonus[ni->stats->wea]) / 2) + + (rand() % ((ni->stats->strength + webonus[ni->stats->wea]) / 2)) - + fight->defense; // Opponent's Hit mhit = (fight->strength / 2) + (rand() % (fight->strength / 2) - (ni->stats->defense + - arbonus[ni->stats->armor])); + arbonus[ni->stats->arm])); } else { // Opponent's Hit - mhit = (((battle->stats->strength + webonus[battle->stats->weapon]) / 2) + - (rand() % ((battle->stats->strength + webonus[battle->stats->weapon])) / 2) - - (ni->stats->defense + arbonus[ni->stats->armor])); + mhit = (((battle->stats->strength + webonus[battle->stats->wea]) / 2) + + (rand() % ((battle->stats->strength + webonus[battle->stats->wea])) / 2) - + (ni->stats->defense + arbonus[ni->stats->arm])); // Player's Hit - hit = (((ni->stats->strength + webonus[ni->stats->weapon]) / 2) + - (rand() % ((ni->stats->strength + webonus[ni->stats->weapon])) / 2) - - (battle->stats->defense + arbonus[battle->stats->armor])); + hit = (((ni->stats->strength + webonus[ni->stats->wea]) / 2) + + (rand() % ((ni->stats->strength + webonus[ni->stats->wea])) / 2) - + (battle->stats->defense + arbonus[battle->stats->arm])); } if (!player_fight(ni)) @@ -95,13 +96,22 @@ void do_attack(char *u) notice(s_GameServ, u, "You recieve %d experience and %d gold!", fight->exp, fight->gold); - if (dragon_fight(ni)) - { - addNews(todaysnews, "%s is a true warrior! %s has beaten %s!!", - ni->stats->name.c_str(), ni->stats->name.c_str(), - ni->stats->master->name.c_str()); - ni->stats->master = NULL; // Don't progress in levels - } + if (dragon_fight(ni)) + { + addNews(todaysnews, "%s is a true warrior! %s has beaten %s!!"\ + " %s is now watching over the Dragon's lair!", + ni->stats->name.c_str(), ni->stats->name.c_str(), + ni->stats->fight->name.c_str(), ni->stats->name.c_str()); + dragon.name = "DRAGON-" + ni->stats->name; + dragon.weapon = weapons[ni->stats->wea]; + dragon.strength = ni->stats->strength + webonus[ni->stats->wea]; + dragon.defense = ni->stats->defense + arbonus[ni->stats->arm]; + dragon.hp = ni->stats->maxhp; + dragon.maxhp = ni->stats->maxhp; + save_dragon(); + clearDragonFight(ni->stats); + reset(ni->stats); + } // If your new experience (or gold) will be greater than 2 billion, // then set your exp to 2bil. (2 billion max)... otherwise add them. @@ -212,7 +222,7 @@ void do_attack(char *u) notice(s_GameServ, battle->getNick(), "%s has hit you with their %s for "\ "^B%d^B damage!", ni->stats->name.c_str(), - weapons[ni->stats->weapon], hit); + weapons[ni->stats->wea], hit); } else {