Fix the line-of-sight stuff that was broken thanks to 0 being implicitly convertible to std::function
This commit is contained in:
@@ -823,7 +823,7 @@ bool handle_action(sf::Event event)
|
||||
// if ((can_see(cur_loc,destination) >= 4) || ((overall_mode != 35) && (loc_off_world(destination) == true)))
|
||||
if ((overall_mode != MODE_LOOK_COMBAT) && (party_can_see(destination) == 6))
|
||||
add_string_to_buf(" Can't see space. ");
|
||||
else if ((overall_mode == MODE_LOOK_COMBAT) && (can_see(pc_pos[current_pc],destination,0) >= 4))
|
||||
else if ((overall_mode == MODE_LOOK_COMBAT) && (can_see_light(pc_pos[current_pc],destination,sight_obscurity) >= 4))
|
||||
add_string_to_buf(" Can't see space. ");
|
||||
else {
|
||||
add_string_to_buf("You see... ");
|
||||
@@ -893,7 +893,7 @@ bool handle_action(sf::Event event)
|
||||
destination.x = destination.x + i - 4;
|
||||
destination.y = destination.y + j - 4;
|
||||
|
||||
if ((can_see(cur_loc,destination,0) >= 4) || (loc_off_world(destination) == true)) {
|
||||
if ((can_see_light(cur_loc,destination,sight_obscurity) >= 4) || (loc_off_world(destination) == true)) {
|
||||
add_string_to_buf(" Can't see space ");
|
||||
need_reprint = true;
|
||||
}
|
||||
|
||||
@@ -860,7 +860,7 @@ void place_target(location target)
|
||||
add_string_to_buf(" Space not in town. ");
|
||||
return;
|
||||
}
|
||||
if (can_see(pc_pos[current_pc],target,0) > 4) {
|
||||
if (can_see_light(pc_pos[current_pc],target,sight_obscurity) > 4) {
|
||||
add_string_to_buf(" Can't see target. ");
|
||||
return;
|
||||
}
|
||||
@@ -980,7 +980,7 @@ void do_combat_cast(location target)////
|
||||
cost_taken = true;
|
||||
}
|
||||
|
||||
if ((adjust = can_see(pc_pos[current_pc],target,0)) > 4) {
|
||||
if ((adjust = can_see_light(pc_pos[current_pc],target,sight_obscurity)) > 4) {
|
||||
add_string_to_buf(" Can't see target. ");
|
||||
}
|
||||
else if (loc_off_act_area(target) == true) {
|
||||
@@ -1494,7 +1494,7 @@ void fire_missile(location target) {
|
||||
dam = univ.party[missile_firer].items[ammo_inv_slot].item_level;
|
||||
dam_bonus = univ.party[missile_firer].items[ammo_inv_slot].bonus + minmax(-8,8,univ.party[missile_firer].status[1]);
|
||||
hit_bonus = (overall_mode == MODE_FIRING) ? univ.party[missile_firer].items[missile_inv_slot].bonus : 0;
|
||||
hit_bonus += stat_adj(missile_firer,1) - can_see(pc_pos[missile_firer],target,0)
|
||||
hit_bonus += stat_adj(missile_firer,1) - can_see_light(pc_pos[missile_firer],target,sight_obscurity)
|
||||
+ minmax(-8,8,univ.party[missile_firer].status[1]);
|
||||
if ((skill_item = pc_has_abil_equip(missile_firer,41)) < 24) {
|
||||
hit_bonus += univ.party[missile_firer].items[skill_item].ability_strength / 2;
|
||||
@@ -1510,7 +1510,7 @@ void fire_missile(location target) {
|
||||
|
||||
if (dist(pc_pos[missile_firer],target) > range)
|
||||
add_string_to_buf(" Out of range.");
|
||||
else if (can_see(pc_pos[missile_firer],target,0) >= 5)
|
||||
else if (can_see_light(pc_pos[missile_firer],target,sight_obscurity) >= 5)
|
||||
add_string_to_buf(" Can't see target. ");
|
||||
else {
|
||||
// First, some missiles do special things
|
||||
@@ -1809,7 +1809,7 @@ void do_monster_turn()
|
||||
if ((cur_monst->active == 1) && (cur_monst->attitude % 2 == 1) && (overall_mode == MODE_COMBAT)) {
|
||||
r1 = get_ran(1,1,100); // Check if see PCs first
|
||||
r1 += (PSD[SDF_PARTY_STEALTHY] > 0) ? 45 : 0;
|
||||
r1 += can_see(cur_monst->cur_loc,closest_pc_loc(cur_monst->cur_loc),0) * 10;
|
||||
r1 += can_see_light(cur_monst->cur_loc,closest_pc_loc(cur_monst->cur_loc),sight_obscurity) * 10;
|
||||
if (r1 < 50)
|
||||
cur_monst->active = 2;
|
||||
|
||||
@@ -1825,7 +1825,7 @@ void do_monster_turn()
|
||||
if ((univ.town.monst[j].active > 0) &&
|
||||
(univ.town.monst[j].attitude % 2 != 1) &&
|
||||
(dist(cur_monst->cur_loc,univ.town.monst[j].cur_loc) <= 6) &&
|
||||
(can_see(cur_monst->cur_loc,univ.town.monst[j].cur_loc,0) < 5))
|
||||
(can_see_light(cur_monst->cur_loc,univ.town.monst[j].cur_loc,sight_obscurity) < 5))
|
||||
cur_monst->active = 2;
|
||||
}
|
||||
|
||||
@@ -1835,7 +1835,7 @@ void do_monster_turn()
|
||||
for (j = 0; j < univ.town->max_monst(); j++)
|
||||
if ((univ.town.monst[j].active > 0) && (univ.town.monst[j].attitude % 2 == 1) &&
|
||||
(dist(cur_monst->cur_loc,univ.town.monst[j].cur_loc) <= 6)
|
||||
&& (can_see(cur_monst->cur_loc,univ.town.monst[j].cur_loc,0) < 5)) {
|
||||
&& (can_see_light(cur_monst->cur_loc,univ.town.monst[j].cur_loc,sight_obscurity) < 5)) {
|
||||
cur_monst->active = 2;
|
||||
cur_monst->mobility = 1;
|
||||
}
|
||||
@@ -2138,7 +2138,7 @@ void do_monster_turn()
|
||||
}
|
||||
|
||||
// Place fields for monsters that create them. Only done when monst sees foe
|
||||
if ((target != 6) && (can_see(cur_monst->cur_loc,targ_space,0) < 5)) { ////
|
||||
if ((target != 6) && (can_see_light(cur_monst->cur_loc,targ_space,sight_obscurity) < 5)) { ////
|
||||
if ((cur_monst->radiate_1 == 1) && (get_ran(1,1,100) < cur_monst->radiate_2))
|
||||
place_spell_pattern(square,cur_monst->cur_loc,5,false,7);
|
||||
if ((cur_monst->radiate_1 == 2) && (get_ran(1,1,100) < cur_monst->radiate_2))
|
||||
@@ -2700,7 +2700,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor
|
||||
for (i = 0; i < 8; i++) {
|
||||
j = get_ran(1,0,5);
|
||||
if(univ.party[j].main_status == eMainStatus::ALIVE && univ.party[j].cur_sp > 4 &&
|
||||
(can_see(source,pc_pos[j],0) < 5) && (dist(source,pc_pos[j]) <= 8)) {
|
||||
(can_see_light(source,pc_pos[j],sight_obscurity) < 5) && (dist(source,pc_pos[j]) <= 8)) {
|
||||
target = j;
|
||||
i = 8;
|
||||
targ_space = pc_pos[target];
|
||||
@@ -2790,7 +2790,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor
|
||||
}
|
||||
|
||||
r1 = get_ran(1,1,100) - 5 * min(10,bless) + 5 * univ.party[target].status[1]
|
||||
- 5 * (can_see(source, pc_pos[target],0));
|
||||
- 5 * (can_see_light(source, pc_pos[target],sight_obscurity));
|
||||
if (pc_parry[target] < 100)
|
||||
r1 += 5 * pc_parry[target];
|
||||
r2 = get_ran(dam[level],1,7) + min(10,bless);
|
||||
@@ -2832,7 +2832,7 @@ void monst_fire_missile(short m_num,short bless,short level,location source,shor
|
||||
break;
|
||||
}
|
||||
r1 = get_ran(1,1,100) - 5 * min(10,bless) + 5 * m_target->status[1]
|
||||
- 5 * (can_see(source, m_target->cur_loc,0));
|
||||
- 5 * (can_see_light(source, m_target->cur_loc,sight_obscurity));
|
||||
r2 = get_ran(dam[level],1,7) + min(10,bless);
|
||||
|
||||
if (r1 <= hit_chance[dam[level] * 2]) {
|
||||
@@ -3636,7 +3636,7 @@ void place_spell_pattern(effect_pat_type pat,location center,short type,bool pre
|
||||
for (j = minmax(active.top + 1,active.bottom - 1,center.y - 4);
|
||||
j <= minmax(active.top + 1,active.bottom - 1,center.y + 4); j++) {
|
||||
s_loc.x = i; s_loc.y = j;
|
||||
if (can_see(center,s_loc,0) == 5)
|
||||
if (can_see_light(center,s_loc,sight_obscurity) == 5)
|
||||
pat.pattern[i - center.x + 4][j - center.y + 4] = 0;
|
||||
}
|
||||
|
||||
@@ -3817,7 +3817,7 @@ void do_shockwave(location target)
|
||||
for (i = 0; i < univ.town->max_monst(); i++)
|
||||
if ((univ.town.monst[i].active != 0) && (dist(target,univ.town.monst[i].cur_loc) > 0)
|
||||
&& (dist(target,univ.town.monst[i].cur_loc) < 11)
|
||||
&& (can_see(target,univ.town.monst[i].cur_loc,0) < 5))
|
||||
&& (can_see_light(target,univ.town.monst[i].cur_loc,sight_obscurity) < 5))
|
||||
damage_monst(i, current_pc, get_ran(2 + dist(target,univ.town.monst[i].cur_loc) / 2 , 1, 6), 0, DAMAGE_UNBLOCKABLE,0);
|
||||
do_explosion_anim(5,0);
|
||||
end_missile_anim();
|
||||
@@ -3836,7 +3836,7 @@ void radius_damage(location target,short radius, short dam, eDamageType type)///
|
||||
for (i = 0; i < univ.town->max_monst(); i++)
|
||||
if ((univ.town.monst[i].active != 0) && (dist(target,univ.town.monst[i].cur_loc) > 0)
|
||||
&& (dist(target,univ.town.monst[i].cur_loc) <= radius)
|
||||
&& (can_see(target,univ.town.monst[i].cur_loc,0) < 5))
|
||||
&& (can_see_light(target,univ.town.monst[i].cur_loc,sight_obscurity) < 5))
|
||||
damage_monst(i, current_pc, dam, 0, type,0);
|
||||
return;
|
||||
}
|
||||
@@ -3849,7 +3849,7 @@ void radius_damage(location target,short radius, short dam, eDamageType type)///
|
||||
for (i = 0; i < univ.town->max_monst(); i++)
|
||||
if ((univ.town.monst[i].active != 0) && (dist(target,univ.town.monst[i].cur_loc) > 0)
|
||||
&& (dist(target,univ.town.monst[i].cur_loc) <= radius)
|
||||
&& (can_see(target,univ.town.monst[i].cur_loc,0) < 5))
|
||||
&& (can_see_light(target,univ.town.monst[i].cur_loc,sight_obscurity) < 5))
|
||||
damage_monst(i, current_pc, dam, 0, type,0);
|
||||
do_explosion_anim(5,0);
|
||||
end_missile_anim();
|
||||
@@ -4250,7 +4250,7 @@ bool combat_cast_mage_spell()
|
||||
for (i = 0; i < univ.town->max_monst(); i++) {
|
||||
if ((univ.town.monst[i].active != 0) && (univ.town.monst[i].attitude % 2 == 1)
|
||||
&& (dist(pc_pos[current_pc],univ.town.monst[i].cur_loc) <= mage_range[spell_num])
|
||||
&& (can_see(pc_pos[current_pc],univ.town.monst[i].cur_loc,0) < 5)) {
|
||||
&& (can_see_light(pc_pos[current_pc],univ.town.monst[i].cur_loc,sight_obscurity) < 5)) {
|
||||
which_m = &univ.town.monst[i];
|
||||
switch (spell_num) {
|
||||
case 47:
|
||||
|
||||
@@ -898,7 +898,7 @@ void draw_terrain(short mode)
|
||||
where_draw.y = -1;
|
||||
if (where_draw.y > univ.town->max_dim() - 1)
|
||||
where_draw.y = univ.town->max_dim();
|
||||
if (can_see(view_loc,where_draw,0) < 5)
|
||||
if (can_see_light(view_loc,where_draw,sight_obscurity) < 5)
|
||||
can_draw = 1;
|
||||
else can_draw = 0;
|
||||
spec_terrain = 0;
|
||||
@@ -1688,7 +1688,7 @@ void draw_targeting_line(location where_curs)
|
||||
k = (k * 28) + 32 + ul.x;
|
||||
l = (l * 36) + 36 + ul.y;
|
||||
|
||||
if ((can_see(from_loc,which_space,0) < 5)
|
||||
if ((can_see_light(from_loc,which_space,sight_obscurity) < 5)
|
||||
&& (dist(from_loc,which_space) <= current_spell_range)) {
|
||||
terrain_rect.inset(13,13);
|
||||
terrain_rect.offset(5 + ul.x,5 + ul.y);
|
||||
|
||||
@@ -174,7 +174,7 @@ void draw_monsters() ////
|
||||
for (i = 0; i < 10; i++)
|
||||
if (univ.party.out_c[i].exists == true) {
|
||||
if ((point_onscreen(univ.party.p_loc, univ.party.out_c[i].m_loc) == true) &&
|
||||
(can_see(univ.party.p_loc, univ.party.out_c[i].m_loc,0) < 5)) {
|
||||
(can_see_light(univ.party.p_loc, univ.party.out_c[i].m_loc,sight_obscurity) < 5)) {
|
||||
where_draw.x = univ.party.out_c[i].m_loc.x - univ.party.p_loc.x + 4;
|
||||
where_draw.y = univ.party.out_c[i].m_loc.y - univ.party.p_loc.y + 4;
|
||||
terrain_there[where_draw.x][where_draw.y] = -1;
|
||||
@@ -435,7 +435,7 @@ void draw_outd_boats(location center)
|
||||
for (i = 0; i < 30; i++)
|
||||
if ((point_onscreen(center, univ.party.boats[i].loc) == true) && (univ.party.boats[i].exists == true) &&
|
||||
(univ.party.boats[i].which_town == 200) &&
|
||||
(can_see(center, univ.party.boats[i].loc,0) < 5) && (univ.party.in_boat != i)) {
|
||||
(can_see_light(center, univ.party.boats[i].loc,sight_obscurity) < 5) && (univ.party.in_boat != i)) {
|
||||
where_draw.x = univ.party.boats[i].loc.x - center.x + 4;
|
||||
where_draw.y = univ.party.boats[i].loc.y - center.y + 4;
|
||||
//source_rect = boat_rects[0];
|
||||
@@ -445,7 +445,7 @@ void draw_outd_boats(location center)
|
||||
for (i = 0; i < 30; i++)
|
||||
if ((point_onscreen(center, univ.party.horses[i].loc) == true) && (univ.party.horses[i].exists == true) &&
|
||||
(univ.party.horses[i].which_town == 200) &&
|
||||
(can_see(center, univ.party.horses[i].loc,0) < 5) && (univ.party.in_horse != i)) {
|
||||
(can_see_light(center, univ.party.horses[i].loc,sight_obscurity) < 5) && (univ.party.in_horse != i)) {
|
||||
where_draw.x = univ.party.horses[i].loc.x - center.x + 4;
|
||||
where_draw.y = univ.party.horses[i].loc.y - center.y + 4;
|
||||
//source_rect = boat_rects[0];
|
||||
@@ -465,7 +465,7 @@ void draw_town_boat(location center)
|
||||
for (i = 0; i < 30; i++)
|
||||
if ((univ.party.boats[i].which_town == univ.town.num) &&
|
||||
((point_onscreen(center, univ.party.boats[i].loc) == true) &&
|
||||
(can_see(center, univ.party.boats[i].loc,0) < 5) && (univ.party.in_boat != i)
|
||||
(can_see_light(center, univ.party.boats[i].loc,sight_obscurity) < 5) && (univ.party.in_boat != i)
|
||||
&& (pt_in_light(center,univ.party.boats[i].loc) == true))) {
|
||||
where_draw.x = univ.party.boats[i].loc.x - center.x + 4;
|
||||
where_draw.y = univ.party.boats[i].loc.y - center.y + 4;
|
||||
@@ -476,7 +476,7 @@ void draw_town_boat(location center)
|
||||
for (i = 0; i < 30; i++)
|
||||
if ((univ.party.horses[i].which_town == univ.town.num) &&
|
||||
((point_onscreen(center, univ.party.horses[i].loc) == true) &&
|
||||
(can_see(center, univ.party.horses[i].loc,0) < 5) && (univ.party.in_horse != i)
|
||||
(can_see_light(center, univ.party.horses[i].loc,sight_obscurity) < 5) && (univ.party.in_horse != i)
|
||||
&& (pt_in_light(center,univ.party.horses[i].loc) == true))) {
|
||||
where_draw.x = univ.party.horses[i].loc.x - center.x + 4;
|
||||
where_draw.y = univ.party.horses[i].loc.y - center.y + 4;
|
||||
|
||||
@@ -795,7 +795,7 @@ short get_item(location place,short pc_num,bool check_container)
|
||||
|
||||
for (i = 0; i < univ.town->max_monst(); i++)
|
||||
if ((univ.town.monst[i].active > 0) && (univ.town.monst[i].attitude == 1)
|
||||
&& (can_see(place,univ.town.monst[i].cur_loc,0) < 5))
|
||||
&& (can_see_light(place,univ.town.monst[i].cur_loc,sight_obscurity) < 5))
|
||||
mass_get = 0;
|
||||
|
||||
for (i = 0; i < NUM_TOWN_ITEMS; i++)
|
||||
@@ -803,7 +803,7 @@ short get_item(location place,short pc_num,bool check_container)
|
||||
if (((adjacent(place,univ.town.items[i].item_loc) == true) ||
|
||||
((mass_get == 1) && (check_container == false) &&
|
||||
((dist(place,univ.town.items[i].item_loc) <= 4) || ((is_combat()) && (which_combat_type == 0)))
|
||||
&& (can_see(place,univ.town.items[i].item_loc,0) < 5)))
|
||||
&& (can_see_light(place,univ.town.items[i].item_loc,sight_obscurity) < 5)))
|
||||
&& ((!univ.town.items[i].contained) || (check_container == true))) {
|
||||
taken = 1;
|
||||
|
||||
@@ -815,7 +815,7 @@ short get_item(location place,short pc_num,bool check_container)
|
||||
if (display_item(place,pc_num,mass_get,check_container) > 0) { // if true, there was a theft
|
||||
for (i = 0; i < univ.town->max_monst(); i++)
|
||||
if ((univ.town.monst[i].active > 0) && (univ.town.monst[i].attitude % 2 != 1)
|
||||
&& (can_see(place,univ.town.monst[i].cur_loc,0) < 5)) {
|
||||
&& (can_see_light(place,univ.town.monst[i].cur_loc,sight_obscurity) < 5)) {
|
||||
make_town_hostile();
|
||||
i = univ.town->max_monst();
|
||||
add_string_to_buf("Your crime was seen!");
|
||||
@@ -1058,7 +1058,7 @@ bool display_item(location from_loc,short pc_num,short mode, bool check_containe
|
||||
if (((adjacent(from_loc,univ.town.items[i].item_loc) == true) ||
|
||||
((mode == 1) && (check_container == false) &&
|
||||
((dist(from_loc,univ.town.items[i].item_loc) <= 4) || ((is_combat()) && (which_combat_type == 0)))
|
||||
&& (can_see(from_loc,univ.town.items[i].item_loc,0) < 5))) &&
|
||||
&& (can_see_light(from_loc,univ.town.items[i].item_loc,sight_obscurity) < 5))) &&
|
||||
(univ.town.items[i].contained == check_container) &&
|
||||
((!check_container) || (univ.town.items[i].item_loc == from_loc))) {
|
||||
item_array[array_position] = i;
|
||||
|
||||
@@ -250,7 +250,7 @@ void update_explored(location dest)
|
||||
for (look2.x = max(0,dest.x - 4); look2.x < min(univ.town->max_dim(),dest.x + 5); look2.x++)
|
||||
for (look2.y = max(0,dest.y - 4); look2.y < min(univ.town->max_dim(),dest.y + 5); look2.y++)
|
||||
if (is_explored(look2.x,look2.y) == false)
|
||||
if ((can_see(dest, look2,0) < 5) && (pt_in_light(dest,look2) == true))
|
||||
if ((can_see_light(dest, look2,sight_obscurity) < 5) && (pt_in_light(dest,look2) == true))
|
||||
make_explored(look2.x,look2.y);
|
||||
}
|
||||
}
|
||||
@@ -380,7 +380,7 @@ bool monst_can_see(short m_num,location l)
|
||||
for (j = 0; j < univ.town.monst[m_num].y_width; j++) {
|
||||
destination.x = univ.town.monst[m_num].cur_loc.x + i;
|
||||
destination.y = univ.town.monst[m_num].cur_loc.y + j;
|
||||
if (can_see(destination,l,0) < 5)
|
||||
if (can_see_light(destination,l,sight_obscurity) < 5)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -410,7 +410,7 @@ bool can_see_monst(location l,short m_num)
|
||||
for (j = 0; j < univ.town.monst[m_num].y_width; j++) {
|
||||
destination.x = univ.town.monst[m_num].cur_loc.x + i;
|
||||
destination.y = univ.town.monst[m_num].cur_loc.y + j;
|
||||
if (can_see(l,destination,0) < 5)
|
||||
if (can_see_light(l,destination,sight_obscurity) < 5)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -565,13 +565,13 @@ short party_can_see(location where)
|
||||
short i;
|
||||
|
||||
if (is_out()) {
|
||||
if ((point_onscreen(univ.party.p_loc,where) == true) && (can_see(univ.party.p_loc,where,0) < 5))
|
||||
if ((point_onscreen(univ.party.p_loc,where) == true) && (can_see_light(univ.party.p_loc,where,sight_obscurity) < 5))
|
||||
return 1;
|
||||
else return 6;
|
||||
}
|
||||
if (is_town()) {
|
||||
if ( ((point_onscreen(univ.town.p_loc,where) == true) || (overall_mode == MODE_LOOK_TOWN)) && (pt_in_light(univ.town.p_loc,where) == true)
|
||||
&& (can_see(univ.town.p_loc,where,0) < 5))
|
||||
&& (can_see_light(univ.town.p_loc,where,sight_obscurity) < 5))
|
||||
return 1;
|
||||
else return 6;
|
||||
}
|
||||
@@ -583,7 +583,7 @@ short party_can_see(location where)
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
if(univ.party[i].main_status == eMainStatus::ALIVE) {
|
||||
if (can_see(pc_pos[i],where,0) < 5)
|
||||
if (can_see_light(pc_pos[i],where,sight_obscurity) < 5)
|
||||
return i;
|
||||
}
|
||||
|
||||
|
||||
@@ -293,7 +293,7 @@ void do_monsters()
|
||||
else if (monst_hate_spot(i,&l2) == true)
|
||||
acted_yet = seek_party(i,l1,l2);
|
||||
else if (((univ.town.monst[i].mu == 0) && (univ.town.monst[i].mu == 0))
|
||||
|| (can_see(l1,l2,0) > 3))
|
||||
|| (can_see_light(l1,l2,sight_obscurity) > 3))
|
||||
acted_yet = seek_party(i,l1,l2);
|
||||
}
|
||||
}
|
||||
@@ -305,7 +305,7 @@ void do_monsters()
|
||||
&& (dist(univ.town.monst[i].cur_loc,univ.town.p_loc) <= 8)) {
|
||||
r1 = get_ran(1,1,100);
|
||||
r1 += (PSD[SDF_PARTY_STEALTHY] > 0) ? 46 : 0;
|
||||
r1 += can_see(univ.town.monst[i].cur_loc,univ.town.p_loc,0) * 10;
|
||||
r1 += can_see_light(univ.town.monst[i].cur_loc,univ.town.p_loc,sight_obscurity) * 10;
|
||||
if (r1 < 50) {
|
||||
univ.town.monst[i].active = 2;
|
||||
add_string_to_buf("Monster saw you!");
|
||||
@@ -405,7 +405,7 @@ short monst_pick_target(short which_m)
|
||||
}
|
||||
|
||||
// if (monst_target[which_m] >= 100) {
|
||||
// if ((can_see(cur_monst->m_loc,univ.town.monst[monst_target[which_m] - 100].m_loc,0) < 4)
|
||||
// if ((can_see_light(cur_monst->m_loc,univ.town.monst[monst_target[which_m] - 100].m_loc,sight_obscurity) < 4)
|
||||
// && (univ.town.monst[monst_target[which_m] - 100].active > 0))
|
||||
// return monst_target[which_m];
|
||||
// }
|
||||
@@ -632,7 +632,7 @@ bool rand_move(char i)
|
||||
store_loc = univ.town.monst[i].cur_loc;
|
||||
store_loc.x += get_ran(1,0,24) - 12;
|
||||
store_loc.y += get_ran(1,0,24) - 12;
|
||||
if ((loc_off_act_area(store_loc) == false) && (can_see(univ.town.monst[i].cur_loc,store_loc,0) < 5)) {
|
||||
if ((loc_off_act_area(store_loc) == false) && (can_see_light(univ.town.monst[i].cur_loc,store_loc,sight_obscurity) < 5)) {
|
||||
univ.town.monst[i].targ_loc = store_loc; j = 3;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1689,7 +1689,7 @@ void cast_town_spell(location where) ////
|
||||
return;
|
||||
}
|
||||
|
||||
adjust = can_see(univ.town.p_loc,where,0);
|
||||
adjust = can_see_light(univ.town.p_loc,where,sight_obscurity);
|
||||
if (town_spell < 1000)
|
||||
univ.party[who_cast].cur_sp -= spell_cost[town_spell / 100][town_spell % 100];
|
||||
else town_spell -= 1000;
|
||||
|
||||
@@ -1110,7 +1110,7 @@ void use_item(short pc,short item)
|
||||
for (i = 0; i < univ.town->max_monst(); i++) {
|
||||
if ((univ.town.monst[i].active != 0) && (univ.town.monst[i].attitude % 2 == 1)
|
||||
&& (dist(pc_pos[current_pc],univ.town.monst[i].cur_loc) <= 8)
|
||||
&& (can_see(pc_pos[current_pc],univ.town.monst[i].cur_loc,0) < 5)) {
|
||||
&& (can_see_light(pc_pos[current_pc],univ.town.monst[i].cur_loc,sight_obscurity) < 5)) {
|
||||
which_m = &univ.town.monst[i];
|
||||
charm_monst(which_m,0,0,8);
|
||||
}
|
||||
|
||||
@@ -809,7 +809,7 @@ short do_look(location space)
|
||||
if (overall_mode == MODE_LOOK_COMBAT)
|
||||
for (i = 0; i < 6; i++)
|
||||
if(space == pc_pos[i] && univ.party[i].main_status == eMainStatus::ALIVE
|
||||
&& (is_lit == true) && (can_see(pc_pos[current_pc],space,0) < 5)) {
|
||||
&& (is_lit == true) && (can_see_light(pc_pos[current_pc],space,sight_obscurity) < 5)) {
|
||||
msg = " " + univ.party[i].name;
|
||||
add_string_to_buf(msg);
|
||||
}
|
||||
@@ -818,7 +818,7 @@ short do_look(location space)
|
||||
for (i = 0; i < univ.town->max_monst(); i++)
|
||||
if ((univ.town.monst[i].active != 0) && (is_lit == true)
|
||||
&& (monst_on_space(space,i) == true) &&
|
||||
((overall_mode == MODE_LOOK_TOWN) || (can_see(pc_pos[current_pc],space,0) < 5))
|
||||
((overall_mode == MODE_LOOK_TOWN) || (can_see_light(pc_pos[current_pc],space,sight_obscurity) < 5))
|
||||
&& (univ.town.monst[i].picture_num != 0)) {
|
||||
|
||||
|
||||
|
||||
@@ -1488,7 +1488,7 @@ void set_up_lights() {
|
||||
if (rad > 0) {
|
||||
for (where.x = max(0,i - rad); where.x < min(town->max_dim(),i + rad + 1); where.x++)
|
||||
for (where.y = max(0,j - rad); where.y < min(town->max_dim(),j + rad + 1); where.y++)
|
||||
if ((where_lit[where.x][where.y] == 0) && (dist(where,l) <= rad) && (can_see(l,where,0) < 5))
|
||||
if ((where_lit[where.x][where.y] == 0) && (dist(where,l) <= rad) && (can_see(l,where,light_obscurity) < 5))
|
||||
where_lit[where.x][where.y] = 1;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user