Delete cCurTown::difficulty
It seemed like it was intended as a mirror of cTown::difficulty, yet there didn't seem to be anything that ever wrote to it. So I just made everything use cTown::difficulty directly instead.
This commit is contained in:
@@ -887,7 +887,7 @@ static void handle_town_wait(bool& need_redraw, bool& need_reprint) {
|
||||
increase_age();
|
||||
do_monsters();
|
||||
do_monster_turn();
|
||||
int make_wand = get_ran(1,1,160 - univ.town.difficulty);
|
||||
int make_wand = get_ran(1,1,160 - univ.town->difficulty);
|
||||
if(make_wand == 10)
|
||||
create_wand_monst();
|
||||
for(int j = 0; j < 6; j++)
|
||||
@@ -1491,7 +1491,7 @@ void handle_monster_actions(bool& need_redraw, bool& need_reprint) {
|
||||
}
|
||||
}
|
||||
if(overall_mode == MODE_TOWN) {
|
||||
if(get_ran(1,1,160 - univ.town.difficulty + univ.party.less_wm * 200) == 2)
|
||||
if(get_ran(1,1,160 - univ.town->difficulty + univ.party.less_wm * 200) == 2)
|
||||
create_wand_monst();
|
||||
}
|
||||
}
|
||||
|
@@ -1301,7 +1301,7 @@ void cast_town_spell(location where) {
|
||||
if(univ.scenario.ter_types[ter].flag2 == 10)
|
||||
r1 = 10000;
|
||||
else{
|
||||
r1 = get_ran(1,1,100) - 5 * adj + 5 * univ.town.difficulty;
|
||||
r1 = get_ran(1,1,100) - 5 * adj + 5 * univ.town->difficulty;
|
||||
r1 += univ.scenario.ter_types[ter].flag2 * 7;
|
||||
}
|
||||
if(r1 < (135 - combat_percent[min(19,level)])) {
|
||||
@@ -1319,7 +1319,7 @@ void cast_town_spell(location where) {
|
||||
|
||||
case eSpell::DISPEL_BARRIER:
|
||||
if((univ.town.is_fire_barr(where.x,where.y)) || (univ.town.is_force_barr(where.x,where.y))) {
|
||||
r1 = get_ran(1,1,100) - 5 * adj + 5 * (univ.town.difficulty / 10) + 25 * univ.town->strong_barriers;
|
||||
r1 = get_ran(1,1,100) - 5 * adj + 5 * (univ.town->difficulty / 10) + 25 * univ.town->strong_barriers;
|
||||
if(univ.town.is_fire_barr(where.x,where.y))
|
||||
r1 -= 8;
|
||||
if(r1 < (120 - combat_percent[min(19,level)])) {
|
||||
|
@@ -1149,7 +1149,7 @@ void pick_lock(location where,short pc_num) {
|
||||
if(r1 < 75)
|
||||
will_break = true;
|
||||
|
||||
r1 = get_ran(1,1,100) - 5 * univ.party[pc_num].stat_adj(eSkill::DEXTERITY) + univ.town.difficulty * 7
|
||||
r1 = get_ran(1,1,100) - 5 * univ.party[pc_num].stat_adj(eSkill::DEXTERITY) + univ.town->difficulty * 7
|
||||
- 5 * univ.party[pc_num].skill(eSkill::LOCKPICKING) - which_item->abil_strength * 7;
|
||||
|
||||
// Nimble?
|
||||
@@ -1186,7 +1186,7 @@ void bash_door(location where,short pc_num) {
|
||||
short r1,unlock_adjust;
|
||||
|
||||
terrain = univ.town->terrain(where.x,where.y);
|
||||
r1 = get_ran(1,1,100) - 15 * univ.party[pc_num].stat_adj(eSkill::STRENGTH) + univ.town.difficulty * 4;
|
||||
r1 = get_ran(1,1,100) - 15 * univ.party[pc_num].stat_adj(eSkill::STRENGTH) + univ.town->difficulty * 4;
|
||||
|
||||
if(univ.scenario.ter_types[terrain].special != eTerSpec::UNLOCKABLE) {
|
||||
add_string_to_buf(" Wrong terrain type.");
|
||||
|
@@ -57,7 +57,7 @@ bool run_trap(short pc_num,eTrapType trap_type,short trap_level,short diff) {
|
||||
int i = disarmer.stat_adj(eSkill::DEXTERITY);
|
||||
i += disarmer.get_prot_level(eItemAbil::THIEVING) / 2;
|
||||
skill = minmax(0,20,disarmer.skill(eSkill::DISARM_TRAPS) +
|
||||
+ disarmer.skill(eSkill::LUCK) / 2 + 1 - univ.town.difficulty + 2 * i);
|
||||
+ disarmer.skill(eSkill::LUCK) / 2 + 1 - univ.town->difficulty + 2 * i);
|
||||
|
||||
r1 = get_ran(1,1,100) + diff;
|
||||
// Nimble?
|
||||
@@ -76,21 +76,21 @@ bool run_trap(short pc_num,eTrapType trap_type,short trap_level,short diff) {
|
||||
case TRAP_BLADE:
|
||||
for(short i = 0; i < num_hits; i++) {
|
||||
add_string_to_buf(" A knife flies out!");
|
||||
r1 = get_ran(2 + univ.town.difficulty / 14,1,10);
|
||||
r1 = get_ran(2 + univ.town->difficulty / 14,1,10);
|
||||
damage_pc(disarmer,r1,eDamageType::WEAPON,eRace::UNKNOWN,0);
|
||||
}
|
||||
break;
|
||||
|
||||
case TRAP_DART:
|
||||
add_string_to_buf(" A dart flies out.");
|
||||
r1 = 3 + univ.town.difficulty / 14;
|
||||
r1 = 3 + univ.town->difficulty / 14;
|
||||
r1 = r1 + trap_level * 2;
|
||||
disarmer.poison(r1);
|
||||
break;
|
||||
|
||||
case TRAP_GAS:
|
||||
add_string_to_buf(" Poison gas pours out.");
|
||||
r1 = 2 + univ.town.difficulty / 14;
|
||||
r1 = 2 + univ.town->difficulty / 14;
|
||||
r1 = r1 + trap_level * 2;
|
||||
univ.party.poison(r1);
|
||||
break;
|
||||
@@ -98,14 +98,14 @@ bool run_trap(short pc_num,eTrapType trap_type,short trap_level,short diff) {
|
||||
case TRAP_EXPLOSION:
|
||||
for(short i = 0; i < num_hits; i++) {
|
||||
add_string_to_buf(" There is an explosion.");
|
||||
r1 = get_ran(3 + univ.town.difficulty / 13,1,8);
|
||||
r1 = get_ran(3 + univ.town->difficulty / 13,1,8);
|
||||
hit_party(r1,eDamageType::FIRE);
|
||||
}
|
||||
break;
|
||||
|
||||
case TRAP_SLEEP_RAY:
|
||||
add_string_to_buf(" A purple ray flies out.");
|
||||
r1 = 200 + univ.town.difficulty * 100;
|
||||
r1 = 200 + univ.town->difficulty * 100;
|
||||
r1 = r1 + trap_level * 400;
|
||||
// TODO: It says sleep ray but is actually paralysis ray?
|
||||
disarmer.sleep(eStatus::PARALYZED, r1, 50);
|
||||
@@ -135,14 +135,14 @@ bool run_trap(short pc_num,eTrapType trap_type,short trap_level,short diff) {
|
||||
|
||||
case TRAP_DISEASE:
|
||||
add_string_to_buf(" You prick your finger.");
|
||||
r1 = 3 + univ.town.difficulty / 14;
|
||||
r1 = 3 + univ.town->difficulty / 14;
|
||||
r1 = r1 + trap_level * 2;
|
||||
disarmer.disease(r1);
|
||||
break;
|
||||
|
||||
case TRAP_DISEASE_ALL:
|
||||
add_string_to_buf(" A foul substance sprays out.");
|
||||
r1 = 2 + univ.town.difficulty / 14;
|
||||
r1 = 2 + univ.town->difficulty / 14;
|
||||
r1 = r1 + trap_level * 2;
|
||||
univ.party.disease(r1);
|
||||
break;
|
||||
|
Reference in New Issue
Block a user