|
Atrinik Server 2.5
|
00001 /************************************************************************ 00002 * Atrinik, a Multiplayer Online Role Playing Game * 00003 * * 00004 * Copyright (C) 2009-2011 Alex Tokar and Atrinik Development Team * 00005 * * 00006 * Fork from Daimonin (Massive Multiplayer Online Role Playing Game) * 00007 * and Crossfire (Multiplayer game for X-windows). * 00008 * * 00009 * This program is free software; you can redistribute it and/or modify * 00010 * it under the terms of the GNU General Public License as published by * 00011 * the Free Software Foundation; either version 2 of the License, or * 00012 * (at your option) any later version. * 00013 * * 00014 * This program is distributed in the hope that it will be useful, * 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00017 * GNU General Public License for more details. * 00018 * * 00019 * You should have received a copy of the GNU General Public License * 00020 * along with this program; if not, write to the Free Software * 00021 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * 00022 * * 00023 * The author can be reached at admin@atrinik.org * 00024 ************************************************************************/ 00025 00030 #include <global.h> 00031 00036 void walk_on_deep_swamp(object *op, object *victim) 00037 { 00038 if (victim->type == PLAYER && !QUERY_FLAG(victim, FLAG_FLYING) && victim->stats.hp >= 0) 00039 { 00040 new_draw_info(0, COLOR_WHITE, victim, "You are down to your knees in the swamp."); 00041 op->stats.food = 1; 00042 victim->speed_left -= (float) (SLOW_PENALTY(op)); 00043 } 00044 } 00045 00049 void move_deep_swamp(object *op) 00050 { 00051 object *above = op->above, *nabove; 00052 00053 while (above) 00054 { 00055 nabove = above->above; 00056 if (above->type == PLAYER && !QUERY_FLAG(above, FLAG_FLYING) && above->stats.hp >= 0) 00057 { 00058 if (op->stats.food < 1) 00059 { 00060 LOG(llevDebug, "move_deep_swamp(): player is here, but state is %d\n", op->stats.food); 00061 op->stats.food = 1; 00062 } 00063 00064 switch (op->stats.food) 00065 { 00066 case 1: 00067 if (rndm(0, 2) == 0) 00068 { 00069 new_draw_info(0, COLOR_WHITE, above, "You are down to your waist in the wet swamp."); 00070 op->stats.food = 2; 00071 above->speed_left -= (float) (SLOW_PENALTY(op)); 00072 } 00073 00074 break; 00075 00076 case 2: 00077 if (rndm(0, 2) == 0) 00078 { 00079 new_draw_info(0, COLOR_WHITE, above, "You are down to your NECK in the dangerous swamp."); 00080 op->stats.food = 3; 00081 strcpy(CONTR(above)->killer, "drowning in a swamp"); 00082 above->stats.hp--; 00083 above->speed_left -= (float) (SLOW_PENALTY(op)); 00084 } 00085 00086 break; 00087 00088 case 3: 00089 if (rndm(0, 4) == 0) 00090 { 00091 /* player is ready to drown */ 00092 if (rndm(0, 4) == 0) 00093 { 00094 op->stats.food = 0; 00095 new_draw_info_format(NDI_ALL, COLOR_WHITE, NULL, "%s disappeared into a swamp.", above->name); 00096 strcpy(CONTR(above)->killer, "drowning in a swamp"); 00097 00098 above->stats.hp = -1; 00099 /* player dies in the swamp */ 00100 kill_player(above); 00101 } 00102 } 00103 00104 break; 00105 } 00106 } 00107 else if (!IS_LIVE(above)) 00108 { 00109 if (rndm(0, 2) == 0) 00110 { 00111 decrease_ob(above); 00112 } 00113 } 00114 00115 above = nabove; 00116 } 00117 }
1.7.4