Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
poschengband committed Nov 12, 2014
2 parents b8a675a + c5c7b72 commit 5537bbc
Show file tree
Hide file tree
Showing 24 changed files with 566 additions and 133 deletions.
14 changes: 7 additions & 7 deletions lib/edit/e_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -426,9 +426,9 @@ F:VULN_DARK | DEC_STR |
F:HIDE_TYPE | SHOW_MODS

N:112:CLOAK:of the Nazgul
W:50:*:64
C:6:6:6:6
F:STEALTH | RES_COLD | RES_POIS | RES_NETHER | FREE_ACT | SEE_INVIS | XTRA_H_RES
W:50:*:0
C:6:6:6:3
F:STEALTH | SPEED | RES_COLD | RES_POIS | RES_NETHER | FREE_ACT | SEE_INVIS | XTRA_H_RES
F:VULN_LITE | RANDOM_CURSE2 | DEC_WIS | DEC_LIFE | DRAIN_EXP | HEAVY_CURSE
F:HIDE_TYPE | SHOW_MODS

Expand Down Expand Up @@ -467,7 +467,7 @@ C:0:0:0:3
F:STEALTH | SPEED | LEVITATION

N:126:BOOTS:of Feanor
W:90:*:100
W:100:*:250
C:0:0:0:10
F:SPEED | HIDE_TYPE | FREE_ACT | RES_NEXUS
F:IGNORE_ACID | IGNORE_ELEC | IGNORE_FIRE | IGNORE_COLD
Expand Down Expand Up @@ -932,10 +932,10 @@ N:306:RING:of Speed
W:70:*:1
F:SPEED | HIDE_TYPE

N:307:RING:of Nazgul
W:70:*:32
N:307:RING:of the Nazgul
W:70:*:0
C:13:13:0:2
F:STEALTH | RES_COLD | RES_POIS | RES_NETHER | FREE_ACT | SEE_INVIS | XTRA_H_RES
F:STEALTH | SPEED | RES_COLD | RES_POIS | RES_NETHER | FREE_ACT | SEE_INVIS | XTRA_H_RES
F:STR | INT | DEC_WIS | DEX | DEC_CON | CHR
F:VULN_LITE | RANDOM_CURSE2 | DEC_LIFE | DRAIN_EXP | HEAVY_CURSE
F:HIDE_TYPE | SHOW_MODS
Expand Down
6 changes: 3 additions & 3 deletions lib/edit/r_info.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12485,7 +12485,7 @@ B:HIT:HURT:10d10
B:HIT:HURT:5d5
B:TOUCH:EXP_40
B:TOUCH:EXP_40
F:UNIQUE | MALE | CAN_SPEAK |
F:UNIQUE | MALE | CAN_SPEAK | AURA_FEAR
F:FORCE_SLEEP | FORCE_MAXHP |
F:ONLY_ITEM | DROP_3D2 | DROP_4D2 | DROP_GOOD |
F:SMART | COLD_BLOOD | OPEN_DOOR | BASH_DOOR | MOVE_BODY |
Expand Down Expand Up @@ -16877,7 +16877,7 @@ B:HIT:HURT:10d10
B:HIT:HURT:5d5
B:TOUCH:EXP_80
B:WAIL:TERRIFY
F:UNIQUE | MALE | CAN_SPEAK |
F:UNIQUE | MALE | CAN_SPEAK | AURA_FEAR
F:FORCE_SLEEP | FORCE_MAXHP | SMART |
F:ONLY_ITEM | DROP_2D2 | DROP_4D2 | DROP_GOOD |
F:COLD_BLOOD | OPEN_DOOR | BASH_DOOR | MOVE_BODY |
Expand Down Expand Up @@ -18058,7 +18058,7 @@ B:HIT:HURT:5d5
B:HIT:HURT:5d5
B:BITE:EXP_40:2d4
B:WAIL:TERRIFY
F:UNIQUE | MALE |
F:UNIQUE | MALE | AURA_FEAR
F:FORCE_SLEEP | FORCE_MAXHP |
F:ONLY_ITEM | DROP_4D2 | DROP_GOOD |
F:SMART | COLD_BLOOD | OPEN_DOOR | BASH_DOOR | MOVE_BODY |
Expand Down
2 changes: 1 addition & 1 deletion lib/file/news.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
****************************************
** PosChengband 3.3.5 **
** PosChengband 3.3.6 **
****************************************

Based on Moria: Copyright (c) 1985 Robert Alan Koeneke
Expand Down
13 changes: 8 additions & 5 deletions src/autopick.c
Original file line number Diff line number Diff line change
Expand Up @@ -1977,11 +1977,17 @@ static bool _rod_is_charging(object_type *o_ptr)
safe place and then repeat until successful anyway. */
bool autopick_auto_id(object_type *o_ptr)
{
if (!object_is_known(o_ptr))
int class_idx = p_ptr->pclass;
race_t *race = get_race_t();

if (class_idx == CLASS_MONSTER)
class_idx = race->pseudo_class_idx;

if (!object_is_known(o_ptr) && class_idx != CLASS_BERSERKER)
{
int i = _pack_find(TV_SCROLL, SV_SCROLL_IDENTIFY);

if (!p_ptr->blind && i >= 0)
if (i >= 0 && !p_ptr->blind && !(race->flags & RACE_IS_ILLITERATE))
{
identify_item(o_ptr);

Expand Down Expand Up @@ -2023,9 +2029,6 @@ bool autopick_auto_id(object_type *o_ptr)
}

/* Player spells not supported ... */

if (disturb_minor)
msg_print("Unable to auto-identify. Get some more scrolls of identify!");
}
return FALSE;
}
Expand Down
56 changes: 35 additions & 21 deletions src/cmd1.c
Original file line number Diff line number Diff line change
Expand Up @@ -2219,7 +2219,7 @@ static void do_monster_knockback(int x, int y, int dist);

static void innate_attacks(s16b m_idx, bool *fear, bool *mdeath, int mode)
{
int dam, base_dam, to_h, chance;
int dam, base_dam, effect_pow, to_h, chance;
monster_type *m_ptr = &m_list[m_idx];
monster_race *r_ptr = &r_info[m_ptr->r_idx];
char m_name[80];
Expand Down Expand Up @@ -2261,8 +2261,7 @@ static void innate_attacks(s16b m_idx, bool *fear, bool *mdeath, int mode)
chance = p_ptr->skills.thn + (to_h * BTH_PLUS_ADJ);
if (test_hit_norm(chance, MON_AC(r_ptr, m_ptr), m_ptr->ml))
{
critical_t crit;
int dd = a->dd + p_ptr->innate_attack_info.to_dd;
int dd = a->dd + p_ptr->innate_attack_info.to_dd;

hit_ct++;
sound(SOUND_HIT);
Expand All @@ -2289,25 +2288,43 @@ static void innate_attacks(s16b m_idx, bool *fear, bool *mdeath, int mode)
}
}
base_dam += a->to_d;
crit = critical_norm(a->weight, to_h, 0, mode, HAND_NONE);
if (crit.desc)
if (!(a->flags & INNATE_NO_DAM))
{
base_dam = base_dam * crit.mul/100 + crit.to_d;
msg_print(crit.desc);
critical_t crit = critical_norm(a->weight, to_h, 0, mode, HAND_NONE);
if (crit.desc)
{
base_dam = base_dam * crit.mul/100 + crit.to_d;
msg_print(crit.desc);
}
}

dam = base_dam + p_ptr->to_d_m;
if (dam < 0) dam = 0;
if (a->flags & INNATE_NO_DAM)
{
base_dam = 0;
effect_pow = p_ptr->lev * 2;
dam = 0;
}
else
effect_pow = base_dam;
if (dam < 0)
dam = 0;
dam = mon_damage_mod(m_ptr, dam, FALSE);
if (dam > 0) anger_monster(m_ptr);
if (dam > 0)
anger_monster(m_ptr);

for (k = 0; k < MAX_INNATE_EFFECTS && !*mdeath; k++)
{
int e = a->effect[k];
int p = a->effect_chance[k];

if (p == 0) p = 100;
if (!e && k == 0) e = GF_MISSILE;
if (!e && k == 0)
{
if (a->flags & INNATE_NO_DAM)
continue;
e = GF_MISSILE;
}

/* Hack: When I decreased monster base resistance (89% -> 50%)
I inadvertantly made dragon bite attacks too strong. Let's
Expand Down Expand Up @@ -2459,35 +2476,32 @@ static void innate_attacks(s16b m_idx, bool *fear, bool *mdeath, int mode)
}
break;
case GF_OLD_SLEEP:
delay_sleep += base_dam;
delay_sleep += effect_pow;
break;
case GF_STASIS:
if (a->dd * a->ds == 0)
delay_stasis += p_ptr->lev*2;
else
delay_stasis += base_dam;
delay_stasis += effect_pow;
break;
case GF_PARALYSIS:
delay_paralysis += base_dam;
delay_paralysis += effect_pow;
break;
case GF_OLD_CONF:
case GF_OLD_SLOW:
case GF_STUN:
project(0, 0, m_ptr->fy, m_ptr->fx, MAX(2*p_ptr->lev, base_dam), e, PROJECT_KILL|PROJECT_HIDE, -1);
project(0, 0, m_ptr->fy, m_ptr->fx, effect_pow, e, PROJECT_KILL|PROJECT_HIDE, -1);
*mdeath = (m_ptr->r_idx == 0);
break;
case GF_DRAIN_MANA:
{
int amt = MIN(base_dam, max_drain_amt - drain_amt);
int amt = MIN(effect_pow, max_drain_amt - drain_amt);
if (amt && project(0, 0, m_ptr->fy, m_ptr->fx, amt, e, PROJECT_KILL|PROJECT_HIDE, -1))
drain_amt += amt;
*mdeath = (m_ptr->r_idx == 0);
break;
}
case GF_OLD_DRAIN:
if (monster_living(r_ptr) && project(0, 0, m_ptr->fy, m_ptr->fx, base_dam, e, PROJECT_KILL|PROJECT_HIDE, -1))
if (monster_living(r_ptr) && project(0, 0, m_ptr->fy, m_ptr->fx, effect_pow, e, PROJECT_KILL|PROJECT_HIDE, -1))
{
int amt = MIN(base_dam, max_drain_amt - drain_amt);
int amt = MIN(effect_pow, max_drain_amt - drain_amt);
if (prace_is_(MIMIC_BAT))
{
vampire_feed(amt);
Expand All @@ -2513,7 +2527,7 @@ static void innate_attacks(s16b m_idx, bool *fear, bool *mdeath, int mode)
}
break;
default:
project(0, 0, m_ptr->fy, m_ptr->fx, base_dam, e, PROJECT_KILL|PROJECT_HIDE, -1);
project(0, 0, m_ptr->fy, m_ptr->fx, effect_pow, e, PROJECT_KILL|PROJECT_HIDE, -1);
*mdeath = (m_ptr->r_idx == 0);
}
}
Expand Down
85 changes: 71 additions & 14 deletions src/cmd4.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

#include "angband.h"
#include "equip.h"
#include "int-map.h"

static void do_cmd_knowledge_weapon(void);
static void do_cmd_knowledge_shooter(void);
Expand Down Expand Up @@ -3392,6 +3393,7 @@ void do_cmd_feeling(void)
*/
static cptr monster_group_text[] =
{
"Corpses",
"Uniques",
"Ridable monsters",
"Wanted monsters",
Expand Down Expand Up @@ -3468,6 +3470,7 @@ static cptr monster_group_char[] =
(char *) -3L,
(char *) -4L,
(char *) -5L,
(char *) -6L,
"a",
"b",
"c",
Expand Down Expand Up @@ -3544,8 +3547,8 @@ static bool ang_sort_comp_monster_level(vptr u, vptr v, int a, int b)
/* Unused */
(void)v;

if (r_ptr2->level > r_ptr1->level) return TRUE;
if (r_ptr1->level > r_ptr2->level) return FALSE;
if (r_ptr2->level > r_ptr1->level) return FALSE;
if (r_ptr1->level > r_ptr2->level) return TRUE;

if ((r_ptr2->flags1 & RF1_UNIQUE) && !(r_ptr1->flags1 & RF1_UNIQUE)) return TRUE;
if ((r_ptr1->flags1 & RF1_UNIQUE) && !(r_ptr2->flags1 & RF1_UNIQUE)) return FALSE;
Expand All @@ -3567,18 +3570,60 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
/* Get a list of x_char in this group */
cptr group_char = monster_group_char[grp_cur];

/* XXX Hack -- Check if this is the "Uniques" group */
bool grp_unique = (monster_group_char[grp_cur] == (char *) -1L);
/* XXX Hack -- Check for special groups */
bool grp_corpses = (monster_group_char[grp_cur] == (char *) -1L);
bool grp_unique = (monster_group_char[grp_cur] == (char *) -2L);
bool grp_riding = (monster_group_char[grp_cur] == (char *) -3L);
bool grp_wanted = (monster_group_char[grp_cur] == (char *) -4L);
bool grp_amberite = (monster_group_char[grp_cur] == (char *) -5L);
bool grp_olympian = (monster_group_char[grp_cur] == (char *) -6L);
int_map_ptr available_corpses = NULL;

/* XXX Hack -- Check if this is the "Riding" group */
bool grp_riding = (monster_group_char[grp_cur] == (char *) -2L);
if (grp_corpses)
{
store_type *store_ptr = &town[1].store[STORE_HOME];

available_corpses = int_map_alloc(NULL);

/* In Pack */
for (i = 0; i < INVEN_PACK; i++)
{
object_type *o_ptr = &inventory[i];
if (!o_ptr->k_idx) continue;
if (!object_is_(o_ptr, TV_CORPSE, SV_CORPSE)) continue;
int_map_add(available_corpses, o_ptr->pval, NULL);
}

/* At Home */
for (i = 0; i < store_ptr->stock_num; i++)
{
object_type *o_ptr = &store_ptr->stock[i];
if (!o_ptr->k_idx) continue;
if (!object_is_(o_ptr, TV_CORPSE, SV_CORPSE)) continue;
int_map_add(available_corpses, o_ptr->pval, NULL);
}

/* Underfoot */
if (in_bounds2(py, px))
{
cave_type *c_ptr = &cave[py][px];
s16b o_idx = c_ptr->o_idx;

while (o_idx)
{
object_type *o_ptr = &o_list[o_idx];
if (!o_ptr->k_idx) continue;
if (!object_is_(o_ptr, TV_CORPSE, SV_CORPSE)) continue;
int_map_add(available_corpses, o_ptr->pval, NULL);
o_idx = o_ptr->next_o_idx;
}
}

/* XXX Hack -- Check if this is the "Wanted" group */
bool grp_wanted = (monster_group_char[grp_cur] == (char *) -3L);
/* Current Form for Easier Comparisons */
if (p_ptr->prace == RACE_MON_POSSESSOR && p_ptr->current_r_idx != MON_POSSESSOR_SOUL)
int_map_add(available_corpses, p_ptr->current_r_idx, NULL);

/* XXX Hack -- Check if this is the "Amberite" group */
bool grp_amberite = (monster_group_char[grp_cur] == (char *) -4L);
bool grp_olympian = (monster_group_char[grp_cur] == (char *) -5L);
}


/* Check every race */
Expand All @@ -3588,12 +3633,18 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
monster_race *r_ptr = &r_info[i];

/* Skip empty race */
if (!r_ptr->name) continue ;
if (!r_ptr->name) continue;

/* Require known monsters */
if (!(mode & 0x02) && !cheat_know && !r_ptr->r_sights) continue;

if (grp_unique)
if (grp_corpses)
{
if (!int_map_contains(available_corpses, i))
continue;
}

else if (grp_unique)
{
if (!(r_ptr->flags1 & RF1_UNIQUE)) continue;
}
Expand Down Expand Up @@ -3652,6 +3703,9 @@ static int collect_monsters(int grp_cur, s16b mon_idx[], byte mode)
/* Sort by monster level */
ang_sort(mon_idx, &dummy_why, mon_cnt);

if (grp_corpses)
int_map_free(available_corpses);

/* Return the number of races */
return mon_cnt;
}
Expand Down Expand Up @@ -6179,14 +6233,17 @@ static void do_cmd_knowledge_monsters(bool *need_redraw, bool visual_only, int d
/* Check every group */
for (i = 0; monster_group_text[i] != NULL; i++)
{
if (monster_group_char[i] == ((char *) -1L) && p_ptr->prace != RACE_MON_POSSESSOR)
continue;

/* Measure the label */
len = strlen(monster_group_text[i]);

/* Save the maximum length */
if (len > max) max = len;

/* See if any monsters are known */
if ((monster_group_char[i] == ((char *) -1L)) || collect_monsters(i, mon_idx, mode))
if ((monster_group_char[i] == ((char *) -2L)) || collect_monsters(i, mon_idx, mode))
{
/* Build a list of groups with known monsters */
grp_idx[grp_cnt++] = i;
Expand Down
Loading

0 comments on commit 5537bbc

Please sign in to comment.