-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcold.cc
More file actions
132 lines (101 loc) · 3.24 KB
/
cold.cc
File metadata and controls
132 lines (101 loc) · 3.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
#include <ctype.h>
#include <sys/types.h>
#include <stdio.h>
#include <syslog.h>
#include "define.h"
#include "struct.h"
const index_data cold_index [] = {
{ "has no effect on", "have no effect on", 0 },
{ "cools", "cool", 7 },
{ "chills", "chill", 15 },
{ "numbs", "numbs", 35 },
{ "blisters", "blister", 50 },
{ "FROSTS", "FROST", 75 },
{ "FREEZES", "FREEZE", 100 },
{ "* STIFFENS *", "* STIFFEN *", 150 },
{ "* HARDENS *", "* HARDEN *", 200 },
{ "** ICES **", "** ICE **", 275 },
{ "** SOLIDIFIES **", "** SOLIDIFY **", 350 },
{ "*** PETRIFIES ***", "*** PETRIFY ***", -1 }
};
bool damage_cold( char_data* victim, char_data* ch, int damage,
const char* string, bool plural,
const char *die )
{
if( victim->is_affected( AFF_SANCTUARY ) )
damage = 0;
else
add_percent_average( damage, -victim->Save_Cold( ) );
dam_message( victim, ch, damage, string,
lookup( cold_index, damage, plural ) );
return inflict( victim, ch, damage, die );
}
int Obj_Data :: vs_cold( )
{
int save = 100;
for( int i = 0; i < table_max[TABLE_MATERIAL]; i++ )
if( is_set( pIndexData->materials, i ) )
save = min( save, material_table[i].save_cold );
if( pIndexData->item_type != ITEM_ARMOR
|| pIndexData->item_type != ITEM_WEAPON )
return save;
return save+value[0]*(100-save)/(value[0]+2);
}
/*
* COLD SPELLS
*/
/*
bool spell_resist_cold( char_data* ch, char_data* victim, void*,
int level, int duration )
{
return spell_affect( ch, victim, level, duration,
SPELL_RESIST_COLD, AFF_RESIST_COLD );
}
*/
/*
bool spell_chilling_touch( char_data* ch, char_data* victim, void*,
int level, int )
{
damage_cold( victim, ch, spell_damage( SPELL_CHILLING_TOUCH, level ),
"*the touch of ice" );
return true;
}
bool spell_freeze( char_data* ch, char_data* victim, void*, int level, int )
{
damage_cold( victim, ch, spell_damage( SPELL_FREEZE, level ),
"*the sphere of cold" );
return true;
}
bool spell_ice_storm( char_data* ch, char_data* victim, void*, int level,
int )
{
damage_cold( victim, ch, spell_damage( SPELL_ICE_STORM, level ),
"*the icy blast" );
return true;
}
bool spell_ice_lance( char_data* ch, char_data* victim, void*, int level,
int )
{
damage_cold( victim, ch, spell_damage( SPELL_ICE_LANCE, level ),
"*the frigid pierce" );
return true;
}
*/
bool spell_ice_shield( char_data* ch, char_data* victim, void*,
int level, int duration )
{
// strip_affect( victim, AFF_INVISIBLE );
leave_shadows( victim );
if( is_submerged( victim ) ) {
send( victim, "The water around you cools noticeably.\n\r" );
send_seen( victim, "Nothing happens." );
return false;
}
if( victim->is_affected( AFF_FIRE_SHIELD ) ) {
send( victim, "A cloud of steam surrounds you, but quickly dissipates.\n\r" );
fsend_seen( victim, "A cloud of steam surrounds %s, but quickly dissipates.", victim );
return false;
}
return spell_affect( ch, victim, level, duration,
SPELL_ICE_SHIELD, AFF_ICE_SHIELD );
}