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

Comparing deliantra/server/server/skills.C (file contents):
Revision 1.59 by elmex, Sun Dec 14 15:25:44 2008 UTC vs.
Revision 1.64 by root, Tue May 5 04:51:56 2009 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2005,2006,2007,2008 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 4 * Copyright (©) 2005,2006,2007,2008,2009 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * Copyright (©) 2003,2007 Mark Wedel & Crossfire Development Team 5 * Copyright (©) 2003,2007 Mark Wedel & Crossfire Development Team
6 * Copyright (©) 1992,2007 Frank Tore Johansen 6 * Copyright (©) 1992,2007 Frank Tore Johansen
7 * 7 *
8 * Deliantra is free software: you can redistribute it and/or modify 8 * Deliantra is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
41 /* Only prohibit stealing if the player does not have a free 41 /* Only prohibit stealing if the player does not have a free
42 * hand available and in fact does have hands. 42 * hand available and in fact does have hands.
43 */ 43 */
44 if (op->type == PLAYER && op->slot[body_arm].used <= 0 && op->slot[body_arm].info) 44 if (op->type == PLAYER && op->slot[body_arm].used <= 0 && op->slot[body_arm].info)
45 { 45 {
46 new_draw_info (NDI_UNIQUE, 0, op, "But you have no free hands to steal with!"); 46 new_draw_info (NDI_UNIQUE, 0, op, "But you have no free hands to steal with! "
47 "H<Try to unapply weapons or things you hold in your hands, use the C<body> command.>");
47 return -1; 48 return -1;
48 } 49 }
49 50
50 /* ADJUSTMENTS */ 51 /* ADJUSTMENTS */
51 52
101{ 102{
102 object *success = NULL, *tmp = NULL, *next; 103 object *success = NULL, *tmp = NULL, *next;
103 int roll = 0, chance = 0, stats_value; 104 int roll = 0, chance = 0, stats_value;
104 rv_vector rv; 105 rv_vector rv;
105 106
106 stats_value = ((who->stats.Dex + who->stats.Int) * 3) / 2; 107 stats_value = (who->stats.Dex + who->stats.Int) * 3 / 2;
107 108
108 /* if the victim is aware of a thief in the area (FLAG_NO_STEAL set on them) 109 /* if the victim is aware of a thief in the area (FLAG_NO_STEAL set on them)
109 * they will try to prevent stealing if they can. Only unseen theives will 110 * they will try to prevent stealing if they can. Only unseen theives will
110 * have much chance of success. 111 * have much chance of success.
111 */ 112 */
112 if (op->type != PLAYER && QUERY_FLAG (op, FLAG_NO_STEAL)) 113 if (!op->is_player () && op->flag [FLAG_NO_STEAL])
113 { 114 {
114 if (can_detect_enemy (op, who, &rv)) 115 if (can_detect_enemy (op, who, &rv))
115 { 116 {
116 npc_call_help (op); 117 npc_call_help (op);
117 CLEAR_FLAG (op, FLAG_UNAGGRESSIVE); 118 CLEAR_FLAG (op, FLAG_UNAGGRESSIVE);
118 new_draw_info (NDI_UNIQUE, 0, who, "Your attempt is prevented!"); 119 new_draw_info (NDI_UNIQUE, 0, who, "Your attempt is prevented!");
119 return 0; 120 return 0;
120 } 121 }
121 else /* help npc to detect thief next time by raising its wisdom */ 122 else /* help npc to detect thief next time by raising its wisdom */
122 op->stats.Wis += (op->stats.Int / 5) + 1; 123 op->stats.Wis += (op->stats.Int / 5) + 1;
124
123 if (op->stats.Wis > MAX_STAT) 125 if (op->stats.Wis > MAX_STAT)
124 op->stats.Wis = MAX_STAT; 126 op->stats.Wis = MAX_STAT;
125 } 127 }
126 128
127 if (op->type == PLAYER && QUERY_FLAG (op, FLAG_WIZ)) 129 if (op->is_player () && op->flag [FLAG_WIZ])
128 { 130 {
129 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from the dungeon master!\n"); 131 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from the dungeon master!\n");
130 return 0; 132 return 0;
131 } 133 }
132 134
133 // only allow stealing between hostile players (TODO: probably should change) 135 // only allow stealing between hostile players (TODO: probably should change)
134 if (op->type == PLAYER && who->type == PLAYER && (who->contr->peaceful || op->contr->peaceful)) 136 if (op->is_player () && who->is_player () && (who->contr->peaceful || op->contr->peaceful))
135 { 137 {
136 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from other players!\n"); 138 new_draw_info (NDI_UNIQUE, 0, who, "You can't steal from other players!\n");
137 return 0; 139 return 0;
138 } 140 }
139 141
1478 for (tmp = op->inv; tmp != NULL; tmp = tmp->below) 1480 for (tmp = op->inv; tmp != NULL; tmp = tmp->below)
1479 { 1481 {
1480 /* can't toss invisible or inv-locked items */ 1482 /* can't toss invisible or inv-locked items */
1481 if (tmp->invisible || QUERY_FLAG (tmp, FLAG_INV_LOCKED)) 1483 if (tmp->invisible || QUERY_FLAG (tmp, FLAG_INV_LOCKED))
1482 continue; 1484 continue;
1483 if (!request || !strcmp (query_name (tmp), request) || !strcmp (tmp->name, request)) 1485 if (!request || !strcmp (query_name (tmp), request) || !strcmp (&tmp->name, request))
1484 break; 1486 break;
1485 } 1487 }
1486 } 1488 }
1487 1489
1488 /* this should prevent us from throwing away 1490 /* this should prevent us from throwing away
1719 { 1721 {
1720 throw_ob->last_sp += eff_str / 3; /* fly a little further */ 1722 throw_ob->last_sp += eff_str / 3; /* fly a little further */
1721 throw_ob->stats.dam += throw_ob->inv->stats.dam + throw_ob->magic + 2; 1723 throw_ob->stats.dam += throw_ob->inv->stats.dam + throw_ob->magic + 2;
1722 throw_ob->stats.wc -= throw_ob->magic + throw_ob->inv->stats.wc; 1724 throw_ob->stats.wc -= throw_ob->magic + throw_ob->inv->stats.wc;
1723 /* only throw objects get directional faces */ 1725 /* only throw objects get directional faces */
1724 if (GET_ANIM_ID (throw_ob) && NUM_ANIMATIONS (throw_ob)) 1726 if (throw_ob->has_anim () && throw_ob->anim_frames ())
1725 SET_ANIMATION (throw_ob, dir); 1727 throw_ob->set_anim_frame (dir);
1726 } 1728 }
1727 else 1729 else
1728 { 1730 {
1729 uint16 mat = throw_ob->materials; 1731 uint16 mat = throw_ob->materials;
1730 1732

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines