More improvements for Life Realm and PASS_WALLing borg.
- In borg_think(), the borg needed to do his borg_notice() before borg_update() because some of his my_stat_ind[] were not being loaded on time. This would have him believe that he had no spells available as well as other problems with his attributes. This was only a problem on his very first pass through borg_think() and only showed up if there was a monster on-screen. Imagine a screen-saver initiating with a monster on-screen. The borg would not have proper knowledge of his attributes that first round.
- I needed to add the borg_notice() and borg_hidden() to the begining of borg_think() as well as at the end because some of the variables looked at during borg_think() were not populated yet. In particular, borg_cheat_spell() uses some of the borg_skill[], but those are empty when borg_cheat_spell() is called.
- I added a structure member called ‘avoid’ to the structure borg_kills[]. This will tell the borg to avoid flowing to this monster. It is a hard to kill monster (borg lacks strong attacks against it) and he should not pick a fight with this guy. I also added ‘cautious’ which means the monster is hard to kill and it will take at least 7 rounds to kill it.
- Borg_flow_kill_corridor_2() needed a fix. It was looking at the wrong monster. It was using monster ‘i’ instead of ‘borg_kills_summoner’. ooops.
- I needed to add a monster flow version of borg_data_hard in order to help the borg understand monster flow patterns better. He was believing the monsters could not flow on a grid unless the grid was a known grid.
- borg_flow_spread_m() needed a rework. Additionally it had some variable naming problems, like ‘i’ being used in a loop, when it was previously assigned to be the monster id#. Some monsters can move through doors.
- borg_flow_commit_m() needed a correction. It was looking at cost of flowing to the wrong grid and needed to look at the 0 vs 255 cost differently.
- Reduced the danger from bolts to zero when the borg has Reflection flag.
- Reduced the amount of time the borg would rest on a grid waiting for a monster to approach. He would wait for up to 350 turns, that was dropped to 75.
- Passwalling borgs might try to cast Glyph while in the walls.
- The flow for anti-summon corridors (type 2) was using goal type GOAL_KILL when GOAL_DIGGING is a better fit. There is better handling of GOAL_DIGGING in borg_play_step().
- The type 2 anti-summon corridor will be used only on never_move monsters.
A passwalling borg might get twitchy if he was dark-exploring and was parked on a closed stair. - The game message “You tunnel into the granite wall” was causing the tunneling borg to reset his goals. This is not a good idea since he was tunneling to begin with. The message is helpful to keep the borg from looping. But I added a check to not reset the goal if goal == GOAL_DIGGING. The negative effect of this bug was that the borg was not completing his anti-summon corridors.
- The ‘sneak’ used in borg_flow_committ() should not look at the borgs own grid; he is leaving that grid.
- Updated borg_flow_old() so that he is penalized for trying to flow through a monster.
Borg_play_step() needed a bounds check on the section that deals with orbing the loot on the floor. - Borg_defend_aux_rest() was improved by incorporating the improved borg_flow code.
I taught the borg to flow to an ‘unreachable’ grid. The borg will select a grid which is safe from melee combat but also affords the borg a good ranged attack position. For example, he will flow to deep water, to keep land-lubbers from attacking him. - The borg needed to know the extra terrains could not hold a glyph of warding.
- The borg will now be allowed to shoot spells into walls to attack PASS_WALL guys. Previously, all ranged attacks were forbidden if the PASS_WALL was sitting in the wall. The game will allow a spell to hit the monster but not a thrown/fired ammo.
- Borg should not attempt to flee a battle in order to flow to a recovery grid. There is a check in place now to make sure there are no adjacent monsters.
- Borg was bouncing on grids trying to get to a take. He thought his pet was on the take and he could not flow through his pet. Pets had been exempted from the I-haven’t-seen-you-in-a-while expiration. But they will be added back in.
- Also in borg_flow_old() the borg will be allowed to flow through his pets/friendlies.