blob: c6031a480d33aa3bc726c9bec945974b711aa9da [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001/*
2 * secure/combat.c
3 *
4 * the combat master object. It defines some useful functions to be
5 * used by weapons, armour and livings.
6 */
7#pragma strict_types
8#pragma no_clone
9#pragma no_shadow
10//#pragma no_inherit
11#pragma verbose_errors
12#pragma combine_strings
13//#pragma pedantic
14//#pragma range_check
15#pragma warn_deprecated
16
17#include <combat.h>
18
19int default_weapon_class(string type) {
20 switch(type) {
21 case "knife":
22 return 50;
23 case "club":
24 return 70;
25 case "sword":
26 return 100;
27 case "axe":
28 return 90;
29 }
30 return 30;
31}
32
33int default_weapon_weight(string type) {
34 switch(type) {
35 case "knife":
36 return 100;
37 case "club":
38 return 1500;
39 case "sword":
40 return 2000;
41 case "axe":
42 return 1500;
43 }
44 return 1000;
45}
46
47int default_weapon_value(string type) {
48 switch(type) {
49 case "knife":
50 return 10;
51 case "club":
52 return 50;
53 case "sword":
54 return 500;
55 case "axe":
56 return 300;
57 }
58 return(0);
59}
60
61int valid_weapon_type(mixed t) {
62 if (member(({WT_SWORD, WT_AXE, WT_CLUB, WT_SPEAR, WT_STAFF,
63 WT_KNIFE}), t ) != -1) {
64 return 1;
65 }
66 else {
67 log_file("COMBAT","Invalid weapon type: "+t+", object: "+
68 object_name(previous_object())+"\n");
69 return 0;
70 }
71}
72
73
74int valid_armour_type(mixed t) {
75 if (VALID_ARMOUR_TYPE(t)) {
76 return 1;
77 }
78 else {
79 log_file("COMBAT","Invalid armour type: "+t+", object: "+
80 object_name(previous_object())+"\n");
81 return 0;
82 }
83}
84
85
86int query_prevent_shadow() { return 1; }
87