ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/common/living.C
(Generate patch)

Comparing deliantra/server/common/living.C (file contents):
Revision 1.87 by root, Tue May 6 17:31:21 2008 UTC vs.
Revision 1.88 by root, Tue Jul 15 20:41:58 2008 UTC

1442 1442
1443/* 1443/*
1444 * set the new dragon name after gaining levels or 1444 * set the new dragon name after gaining levels or
1445 * changing ability focus (later this can be extended to 1445 * changing ability focus (later this can be extended to
1446 * eventually change the player's face and animation) 1446 * eventually change the player's face and animation)
1447 *
1448 * Note that the title is written to 'own_title' in the
1449 * player struct. This should be changed to 'ext_title'
1450 * as soon as clients support this!
1451 * Please, anyone, write support for 'ext_title'.
1452 */ 1447 */
1453void 1448void
1454set_dragon_name (object *pl, const object *abil, const object *skin) 1449set_dragon_name (object *pl, const object *abil, const object *skin)
1455{ 1450{
1456 int atnr = -1; /* attacknumber of highest level */ 1451 int atnr = -1; /* attacknumber of highest level */
1474 /* now if there are equals at highest level, pick the one with focus, 1469 /* now if there are equals at highest level, pick the one with focus,
1475 or else at random */ 1470 or else at random */
1476 if (atnr_is_dragon_enabled (abil->stats.exp) && abil->resist[abil->stats.exp] >= level) 1471 if (atnr_is_dragon_enabled (abil->stats.exp) && abil->resist[abil->stats.exp] >= level)
1477 atnr = abil->stats.exp; 1472 atnr = abil->stats.exp;
1478 1473
1479 level = (int) (level / 25.);
1480
1481 /* now set the new title */ 1474 /* now set the new title */
1482 if (pl->contr)
1483 {
1484 if (level == 0)
1485 sprintf (pl->contr->title, "%s hatchling", attacks[atnr]); 1475 if (level < 25) sprintf (pl->contr->title, "%s hatchling", attacks[atnr]);
1486 else if (level == 1)
1487 sprintf (pl->contr->title, "%s wyrm", attacks[atnr]); 1476 else if (level < 50) sprintf (pl->contr->title, "%s wyrm" , attacks[atnr]);
1488 else if (level == 2)
1489 sprintf (pl->contr->title, "%s wyvern", attacks[atnr]); 1477 else if (level < 75) sprintf (pl->contr->title, "%s wyvern" , attacks[atnr]);
1490 else if (level == 3)
1491 sprintf (pl->contr->title, "%s dragon", attacks[atnr]); 1478 else if (level < 100) sprintf (pl->contr->title, "%s dragon" , attacks[atnr]);
1492 else 1479 else
1493 { 1480 {
1494 /* special titles for extra high resistance! */ 1481 /* special titles for extra high resistance! */
1495 if (skin->resist[atnr] > 80)
1496 sprintf (pl->contr->title, "legendary %s dragon", attacks[atnr]); 1482 if (skin->resist[atnr] > 80) sprintf (pl->contr->title, "legendary %s dragon", attacks[atnr]);
1497 else if (skin->resist[atnr] > 50)
1498 sprintf (pl->contr->title, "ancient %s dragon", attacks[atnr]); 1483 else if (skin->resist[atnr] > 50) sprintf (pl->contr->title, "ancient %s dragon" , attacks[atnr]);
1499 else
1500 sprintf (pl->contr->title, "big %s dragon", attacks[atnr]); 1484 else sprintf (pl->contr->title, "big %s dragon" , attacks[atnr]);
1501 }
1502 } 1485 }
1503 1486
1504 strcpy (pl->contr->own_title, ""); 1487 strcpy (pl->contr->own_title, "");
1505} 1488}
1506 1489

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines