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

Comparing deliantra/server/server/rune.C (file contents):
Revision 1.14 by root, Tue Dec 26 08:55:00 2006 UTC vs.
Revision 1.15 by root, Tue Dec 26 20:04:09 2006 UTC

143 op->stats.sp -= SP_level_spellpoint_cost (caster, rune_spell, SPELL_MANA); 143 op->stats.sp -= SP_level_spellpoint_cost (caster, rune_spell, SPELL_MANA);
144 } 144 }
145 145
146 /* already proper rune. Note this should only be the case if other_arch was set */ 146 /* already proper rune. Note this should only be the case if other_arch was set */
147 if (rune_spell->type == RUNE) 147 if (rune_spell->type == RUNE)
148 {
149 rune = rune_spell; 148 rune = rune_spell;
150 }
151 else 149 else
152 { 150 {
153 rune = get_archetype (GENERIC_RUNE); 151 rune = get_archetype (GENERIC_RUNE);
154 sprintf (buf, "You set off a rune of %s\n", &rune_spell->name); 152 sprintf (buf, "You set off a rune of %s\n", &rune_spell->name);
155 rune->msg = buf; 153 rune->msg = buf;
156 tmp = rune_spell->clone (); 154 rune->insert (rune_spell->clone ());
157 insert_ob_in_ob (tmp, rune);
158 155
159 if (spell->face != blank_face) 156 if (spell->face != blank_face)
160 rune->face = spell->face; 157 rune->face = spell->face;
161 } 158 }
162 159
163 rune->level = caster_level (caster, spell); 160 rune->level = caster_level (caster, spell);
164 rune->stats.Cha = rune->level / 2; /* the invisibility parameter */ 161 rune->stats.Cha = rune->level / 2; /* the invisibility parameter */
165 rune->x = nx;
166 rune->y = ny;
167 rune->map = m;
168 rune->direction = dir; /* where any spell will go upon detonation */ 162 rune->direction = dir; /* where any spell will go upon detonation */
169 rune->set_owner (op); /* runes without need no owner */ 163 rune->set_owner (op); /* runes without need no owner */
170 set_spell_skill (op, caster, spell, rune); 164 set_spell_skill (op, caster, spell, rune);
171 insert_ob_in_map (rune, m, op, 0); 165
166 m->insert (rune, nx, ny, op);
172 return 1; 167 return 1;
173
174} 168}
175
176
177 169
178/* move_rune: peterm 170/* move_rune: peterm
179 comments on runes: 171 comments on runes:
180 rune->level : level at which rune will cast its spell. 172 rune->level : level at which rune will cast its spell.
181 rune->hp : number of detonations before rune goes away 173 rune->hp : number of detonations before rune goes away
185 rune->attacktype: type of damage it does, if not casting spells 177 rune->attacktype: type of damage it does, if not casting spells
186 rune->other_arch: spell in the rune 178 rune->other_arch: spell in the rune
187 rune->Cha : how hidden the rune is 179 rune->Cha : how hidden the rune is
188 rune->maxhp : number of spells the rune casts 180 rune->maxhp : number of spells the rune casts
189*/ 181*/
190
191void 182void
192move_rune (object *op) 183move_rune (object *op)
193{ 184{
194 int det = 0; 185 int det = 0;
195 186
416} 407}
417 408
418int 409int
419trap_show (object *trap, object *where) 410trap_show (object *trap, object *where)
420{ 411{
421 object *tmp2;
422
423 if (where == NULL) 412 if (where == NULL)
424 return 0; 413 return 0;
414
425 tmp2 = get_archetype ("runedet"); 415 object *tmp = get_archetype ("runedet");
426 tmp2->face = &new_faces[GET_ANIMATION (trap, 0)]; 416 tmp->face = &new_faces[GET_ANIMATION (trap, 0)];
427 tmp2->x = where->x; 417 tmp->insert_at (where, 0);
428 tmp2->y = where->y; 418
429 tmp2->map = where->map;
430 insert_ob_in_map (tmp2, where->map, NULL, 0);
431 return 1; 419 return 1;
432
433} 420}
434
435 421
436int 422int
437trap_disarm (object *disarmer, object *trap, int risk, object *skill) 423trap_disarm (object *disarmer, object *trap, int risk, object *skill)
438{ 424{
439 int trapworth; /* need to compute the experience worth of the trap 425 int trapworth; /* need to compute the experience worth of the trap

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines