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

CF: attack.c patch for Turn Undead and Holy Word




    I just did a diff -cr to pull out all the various changes I've been
trying out.  I think some of them are ready to be published here, for
further testing and decisions on whether to include them.  Comments on
the changes I've made are marked with my initials, D.A.M.N.

    This one makes Turn Undead and Holy Word affect undead even if your
religion does not list them as an enemy race, but at significantly
reduced effectiveness.  If they are actually listed as a friendly race,
these spells still have no effect (on undead).

-- 
            -Dave Noelle,                 dave@Straylight.org
            -the Villa Straylight,  http://www.straylight.org

diff -cr crossfire-0.95.4/server/attack.c crossfire-0.95.4-mod/server/attack.c
*** crossfire-0.95.4/server/attack.c	Tue Jul 13 00:42:14 1999
--- crossfire-0.95.4-mod/server/attack.c	Thu Jul 29 12:16:58 1999
***************
*** 625,632 ****
      } else if (attacktype & AT_TURN_UNDEAD) {
  	if (QUERY_FLAG(op,FLAG_UNDEAD)) {
  	    object *owner=get_owner(hitter)==NULL?hitter:get_owner(hitter);
! 
! 	    if(op->level<turn_bonus[owner->stats.Wis]+owner->level)
  		SET_FLAG(op, FLAG_SCARED);
  	}
  	else dam=0; /*don't damage non undead - should we damage undead? */
--- 625,633 ----
      } else if (attacktype & AT_TURN_UNDEAD) {
  	if (QUERY_FLAG(op,FLAG_UNDEAD)) {
  	    object *owner=get_owner(hitter)==NULL?hitter:get_owner(hitter);
! 	    /* if undead are not an enemy of your god, you turn them at half strength */
! 	    if(op->level<((turn_bonus[owner->stats.Wis]+owner->level) /
! 			  (strstr(find_god(determine_god(owner))->slaying,undead_name)?1:2)))
  		SET_FLAG(op, FLAG_SCARED);
  	}
  	else dam=0; /*don't damage non undead - should we damage undead? */
***************
*** 641,648 ****
  
      /* Godpower does normal effect? */
      } else if (attacktype & AT_HOLYWORD) {
! 	/* Holyword only effects a limited range of creatures */
! 	if (op->race && hitter->slaying && strstr(hitter->slaying,op->race)) {
  	    object *owner=get_owner(hitter)==NULL?hitter:get_owner(hitter);
  
  	    if(op->level<turn_bonus[owner->stats.Wis]+owner->level)
--- 642,655 ----
  
      /* Godpower does normal effect? */
      } else if (attacktype & AT_HOLYWORD) {
!       /* Holyword only Affects a limited range of creatures 		*/
!       /* Affects enemies of your god (*3 for slaying applied above)	*
!        * Affects undead even if not enemies, unless they are friends	*
!        * -- DAMN							*/
! 	if ((op->race != NULL && hitter->slaying != NULL && strstr(hitter->slaying,op->race) != NULL) ||
! 	    (QUERY_FLAG(op,FLAG_UNDEAD) &&
! 	     (hitter->title == NULL ||
! 	      (strstr(find_god(determine_god(hitter))->race,undead_name)==NULL)))) {
  	    object *owner=get_owner(hitter)==NULL?hitter:get_owner(hitter);
  
  	    if(op->level<turn_bonus[owner->stats.Wis]+owner->level)
***************
*** 727,733 ****
       * a proper match, otherwise no damage.
       */
      if (type & AT_HOLYWORD) {
! 	if (!op->race || !hitter->slaying || !strstr(hitter->slaying,op->race))
  	    return 0;
      }
  
--- 734,743 ----
       * a proper match, otherwise no damage.
       */
      if (type & AT_HOLYWORD) {
! 	if ((!op->race || !hitter->slaying || !strstr(hitter->slaying,op->race)) &&
! 	    (!QUERY_FLAG(op,FLAG_UNDEAD) ||
! 	     (hitter->title != NULL &&
! 	      (strstr(find_god(determine_god(hitter))->race,undead_name)!=NULL))))
  	    return 0;
      }
  
***************
*** 1138,1144 ****
      int atk_lev, def_lev, kill_lev;
  
      if(hitter->slaying) 
! 	if(!( (QUERY_FLAG(op,FLAG_UNDEAD)&&strstr(hitter->slaying,"undead")) ||
  		(op->race&&strstr(hitter->slaying,op->race))))	return;
  
      def_lev = op->level;
--- 1148,1154 ----
      int atk_lev, def_lev, kill_lev;
  
      if(hitter->slaying) 
! 	if(!( (QUERY_FLAG(op,FLAG_UNDEAD)&&strstr(hitter->slaying,undead_name)) ||
  		(op->race&&strstr(hitter->slaying,op->race))))	return;
  
      def_lev = op->level;
-
[you can put yourself on the announcement list only or unsubscribe altogether
by sending an email stating your wishes to crossfire-request@ifi.uio.no]