… | |
… | |
1998 | object *weapon, *tmp; |
1998 | object *weapon, *tmp; |
1999 | char buf[MAX_BUF]; |
1999 | char buf[MAX_BUF]; |
2000 | int a, i; |
2000 | int a, i; |
2001 | sint16 x, y; |
2001 | sint16 x, y; |
2002 | maptile *m; |
2002 | maptile *m; |
2003 | materialtype_t *mt; |
|
|
2004 | |
2003 | |
2005 | if (!spell->other_arch) |
2004 | if (!spell->other_arch) |
2006 | { |
2005 | { |
2007 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
2006 | new_draw_info (NDI_UNIQUE, 0, op, "Oops, program error!"); |
2008 | LOG (llevError, "animate_weapon failed: spell %s missing other_arch!\n", &spell->name); |
2007 | LOG (llevError, "animate_weapon failed: spell %s missing other_arch!\n", &spell->name); |
… | |
… | |
2120 | |
2119 | |
2121 | /* attacktype */ |
2120 | /* attacktype */ |
2122 | if (!tmp->attacktype) |
2121 | if (!tmp->attacktype) |
2123 | tmp->attacktype = AT_PHYSICAL; |
2122 | tmp->attacktype = AT_PHYSICAL; |
2124 | |
2123 | |
2125 | mt = NULL; |
|
|
2126 | if (op->materialname != NULL) |
|
|
2127 | mt = name_to_material (op->materialname); |
2124 | if (materialtype_t *mt = name_to_material (op->materialname)) |
2128 | if (mt != NULL) |
|
|
2129 | { |
2125 | { |
2130 | for (i = 0; i < NROFATTACKS; i++) |
2126 | for (i = 0; i < NROFATTACKS; i++) |
2131 | tmp->resist[i] = 50 - (mt->save[i] * 5); |
2127 | tmp->resist[i] = 50 - (mt->save[i] * 5); |
2132 | a = mt->save[0]; |
2128 | a = mt->save[0]; |
2133 | } |
2129 | } |
… | |
… | |
2135 | { |
2131 | { |
2136 | for (i = 0; i < NROFATTACKS; i++) |
2132 | for (i = 0; i < NROFATTACKS; i++) |
2137 | tmp->resist[i] = 5; |
2133 | tmp->resist[i] = 5; |
2138 | a = 10; |
2134 | a = 10; |
2139 | } |
2135 | } |
|
|
2136 | |
2140 | /* Set weapon's immunity */ |
2137 | /* Set weapon's immunity */ |
2141 | tmp->resist[ATNR_CONFUSION] = 100; |
2138 | tmp->resist[ATNR_CONFUSION] = 100; |
2142 | tmp->resist[ATNR_POISON] = 100; |
2139 | tmp->resist[ATNR_POISON] = 100; |
2143 | tmp->resist[ATNR_SLOW] = 100; |
2140 | tmp->resist[ATNR_SLOW] = 100; |
2144 | tmp->resist[ATNR_PARALYZE] = 100; |
2141 | tmp->resist[ATNR_PARALYZE] = 100; |
… | |
… | |
2150 | |
2147 | |
2151 | /* Improve weapon's armour value according to best save vs. physical of its material */ |
2148 | /* Improve weapon's armour value according to best save vs. physical of its material */ |
2152 | |
2149 | |
2153 | if (a > 14) |
2150 | if (a > 14) |
2154 | a = 14; |
2151 | a = 14; |
|
|
2152 | |
2155 | tmp->resist[ATNR_PHYSICAL] = 100 - (int) ((100.0 - (float) tmp->resist[ATNR_PHYSICAL]) / (30.0 - 2.0 * a)); |
2153 | tmp->resist[ATNR_PHYSICAL] = 100 - (int) ((100.0 - (float) tmp->resist[ATNR_PHYSICAL]) / (30.0 - 2.0 * a)); |
2156 | |
2154 | |
2157 | /* Determine golem's speed */ |
2155 | /* Determine golem's speed */ |
2158 | tmp->set_speed (min (3.33, 0.4 + 0.1 * SP_level_range_adjust (caster, spell))); |
2156 | tmp->set_speed (min (3.33, 0.4 + 0.1 * SP_level_range_adjust (caster, spell))); |
2159 | |
2157 | |