Crossfire Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Traps and cone spells



This is the spring trap routine, which I assume is by peterm
(the rest of the rune stuff appears to be by him...)
that great god of crossfire (I think we should add him to the god
list as something a few evils beyond satan or something)

void spring_trap(object *trap,object *victim)
{  int spell_in_rune;
   object *env;
  trap->stats.hp--;  /*decrement detcount */
  /*  get the spell number from the name in the slaying field, and set
      that as the spell to be cast. */
  if((spell_in_rune=look_up_spell_by_name(NULL,trap->slaying))!=-1) trap->stats.
sp=spell_in_rune;
  if(victim) if(victim->type==PLAYER) new_draw_info(NDI_UNIQUE, 0,victim,trap->m
sg);
  if(!trap->stats.sp) rune_attack(trap,victim); 
  else {
    remove_ob(trap);
/*****************************************************************
THIS NEXT LINE appears to be the problem to my inexpert eyes
The trap when reinserted should be probably be put directly
under where it currently is and the the spell cast in the
direction of the player. I could do it, but I'm an ugly coder
and a horrible hacker. 

Could someone fix this properly, Does anyone else think it
should be please email me with support I feel neglected?
*****************************************************************/
    trap->x=victim->x;trap->y=victim->y;
    insert_ob_in_map(trap,victim->map);
    cast_spell(trap,trap,trap->direction,trap->stats.sp,1,0,NULL);
  }
  for(env=trap;env!=NULL&&env->env!=NULL;env=env->env);
  trap_show(trap,env);  
  if(!trap->stats.hp) {
    trap->type=98;  /* make the trap impotent */
    trap->stats.food=20;  /* make it stick around until it's spells are gone */
    SET_FLAG(trap,FLAG_IS_USED_UP);
  }
}


Sorry for existing... seriously I tell you.