[CF-Devel] CVS update: crossfire/server
Crossfire CVS devel
mwedel at scruznet.com
Thu Oct 12 13:10:36 CDT 2000
Date: Thursday October 12, 2000 @ 11:10
Author: peterm
Update of /home/cvs/CVS/crossfire/server
In directory boltzmann.eecs.berkeley.edu:/tmp/cvs-serv16722
Modified Files:
attack.c
Log Message:
Patch from AV which makes poison attack savethrows depend
on the level difference between the attacker and victim.
--PeterM
****************************************
Index: crossfire/server/attack.c
diff -u crossfire/server/attack.c:1.14 crossfire/server/attack.c:1.15
--- crossfire/server/attack.c:1.14 Wed Jun 21 02:34:56 2000
+++ crossfire/server/attack.c Thu Oct 12 11:10:35 2000
@@ -1,6 +1,6 @@
/*
* static char *rcsid_attack_c =
- * "$Id: attack.c,v 1.14 2000/06/21 09:34:56 jec Exp $";
+ * "$Id: attack.c,v 1.15 2000/10/12 18:10:35 peterm Exp $";
*/
/*
CrossFire, A Multiplayer game for X-windows
@@ -540,9 +540,10 @@
int hit_player_attacktype(object *op, object *hitter, int dam,
uint32 attacktype, int magic) {
-
+
int does_slay=0;
-
+ int level_diff; /* for special attacktypes (paralyze, etc) */
+
#ifdef ATTACK_DEBUG
LOG(llevDebug, "\thit_player_attacktype: attacktype %x, dam %d\n",
attacktype, dam);
@@ -587,11 +588,14 @@
} else if (attacktype &
(AT_CONFUSION|AT_POISON|AT_SLOW|AT_PARALYZE|AT_FEAR|AT_CANCELLATION|
AT_DEPLETE|AT_BLIND)) {
+ /* chance for inflicting a special attack depends on the
+ difference between attacker's and defender's level */
+ level_diff = MIN(110, MAX(0, op->level - hitter->level));
if (op->speed && (QUERY_FLAG(op, FLAG_MONSTER) || op->type==PLAYER) &&
!(RANDOM()%((attacktype&AT_SLOW?6:3))) &&
(RANDOM()%20+1+((op->protected&attacktype)?4:0)-((op->vulnerable&attacktype)?4:0)
- < savethrow[op->level])) {
+ < savethrow[level_diff])) {
/* Player has been hit by something */
if (attacktype & AT_CONFUSION) confuse_player(op,hitter,dam);
else if (attacktype & AT_POISON) poison_player(op,hitter,dam);
@@ -1123,10 +1127,11 @@
tmp->stats.food+=dam; /* more damage, longer poisoning */
if(op->type==PLAYER) {
- tmp->stats.Con= -(dam/4+1);
- tmp->stats.Str= -(dam/3+2);
- tmp->stats.Dex= -(dam/6+1);
- tmp->stats.Int= -dam/7;
+ /* player looses stats, maximum is -10 of each */
+ tmp->stats.Con= MAX(-(dam/4+1), -10);
+ tmp->stats.Str= MAX(-(dam/3+2), -10);
+ tmp->stats.Dex= MAX(-(dam/6+1), -10);
+ tmp->stats.Int= MAX(-dam/7, -10);
SET_FLAG(tmp,FLAG_APPLIED);
fix_player(op);
new_draw_info(NDI_UNIQUE, 0,op,"You suddenly feel very ill.");
More information about the crossfire
mailing list