… | |
… | |
48 | is_dragon_pl (const object *op) |
48 | is_dragon_pl (const object *op) |
49 | { |
49 | { |
50 | if (op != NULL && op->type == PLAYER && op->arch != NULL && op->arch->clone.race != NULL && strcmp (op->arch->clone.race, "dragon") == 0) |
50 | if (op != NULL && op->type == PLAYER && op->arch != NULL && op->arch->clone.race != NULL && strcmp (op->arch->clone.race, "dragon") == 0) |
51 | return 1; |
51 | return 1; |
52 | |
52 | |
|
|
53 | return 0; |
|
|
54 | } |
|
|
55 | |
|
|
56 | /* Returns TRUE if the range specified (int r) is legal - that is, |
|
|
57 | * the character has an item that is equipped for that range type. |
|
|
58 | * return 0 if there is no item of that range type that is usable. |
|
|
59 | * This function could probably be simplified, eg, everything |
|
|
60 | * should index into the ranges[] array. |
|
|
61 | */ |
|
|
62 | bool |
|
|
63 | player::legal_range (rangetype r) const |
|
|
64 | { |
|
|
65 | switch (r) |
|
|
66 | { |
|
|
67 | case range_none: /* "Nothing" is always legal */ |
|
|
68 | return 1; |
|
|
69 | |
|
|
70 | case range_bow: |
|
|
71 | case range_misc: |
|
|
72 | case range_magic: /* cast spells */ |
|
|
73 | case range_golem: |
|
|
74 | return !!ranges [r]; |
|
|
75 | |
|
|
76 | case range_skill: |
|
|
77 | return !!ob->chosen_skill; |
|
|
78 | } |
|
|
79 | |
|
|
80 | /* No match above, must not be valid */ |
53 | return 0; |
81 | return 0; |
54 | } |
82 | } |
55 | |
83 | |
56 | /* |
84 | /* |
57 | * If final is set, it a clean/final save, not a backup, ie dont remove objects from inventory |
85 | * If final is set, it a clean/final save, not a backup, ie dont remove objects from inventory |