Is there any effective method to get rid of annoying trap types in V?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Obsilium
    Rookie
    • Apr 2007
    • 22

    Is there any effective method to get rid of annoying trap types in V?

    I have been trying to eliminate trap doors from my Angband version without success. Is there any proper method for doing so? I really like to completely finish all levels that I enter and in moments of stupidity I tend to allow mobs like Harowen to TD me to the next level.
  • PaulBlay
    Knight
    • Jan 2009
    • 657

    #2
    Originally posted by Obsilium
    I have been trying to eliminate trap doors from my Angband version without success. Is there any proper method for doing so? I really like to completely finish all levels that I enter and in moments of stupidity I tend to allow mobs like Harowen to TD me to the next level.
    Find the function pick_trap in trap.c

    Change to be like follows.

    Code:
    void pick_trap(int y, int x)
    {
    	int feat;
    
    	static const int min_level[] =
    	{
    		2,		/* Trap door */
    		2,		/* Open pit */
    		2,		/* Spiked pit */
    		2,		/* Poison pit */
    		3,		/* Summoning rune */
    		1,		/* Teleport rune */
    		2,		/* Fire rune */
    		2,		/* Acid rune */
    		2,		/* Slow rune */
    		6,		/* Strength dart */
    		6,		/* Dexterity dart */
    		6,		/* Constitution dart */
    		2,		/* Gas blind */
    		1,		/* Gas confuse */
    		2,		/* Gas poison */
    		2,		/* Gas sleep */
    	};
    
    	/* Paranoia */
    	if (cave_feat[y][x] != FEAT_INVIS) return;
    
    	/* Pick a trap */
    	while (1)
    	{
    		/* Hack -- pick a trap */
    		feat = FEAT_TRAP_HEAD + randint0(16);
    
    		/* Check against minimum depth */
    		if (min_level[feat - FEAT_TRAP_HEAD] > p_ptr->depth) continue;
    
    		[COLOR="Red"]/* Hack -- no trap doors */
    		if (feat == FEAT_TRAP_HEAD + 0x00) continue;[/COLOR]
    
    		/* Done */
    		break;
    	}
    
    	/* Activate the trap */
    	cave_set_feat(y, x, feat);
    }
    Recompile.
    Currently turning (Angband) Japanese.

    Comment

    • Big Al
      Swordsman
      • Apr 2007
      • 327

      #3
      Or you could just change the min_level for trap doors to something big, from eg. 2 to 200.
      Come play Metroplexity!
      Un, V MX H- D c-- f- PV s- d+ P++ M+
      c-- S I++ So+ B+ ac- !GHB SQ RQ+ V+

      Comment

      • Obsilium
        Rookie
        • Apr 2007
        • 22

        #4
        The trick seems to be that I am not a compiling expert at all. I tried looking at the instructions on the Wiki but I'm not any nearer to getting it done right.

        Comment

        • PaulBlay
          Knight
          • Jan 2009
          • 657

          #5
          Originally posted by Big Al
          Or you could just change the min_level for trap doors to something big, from eg. 2 to 200.
          Good point, but make it a legal level or it might cause problems. (Say, 125)

          Originally posted by Obsilium
          The trick seems to be that I am not a compiling expert at all. I tried looking at the instructions on the Wiki but I'm not any nearer to getting it done right.
          If you want an alternative set of instructions, the ones for Angband/65 will (largely) apply. (The ones for VC++ IDE). Big Al's idea is easiest, though.

          Currently turning (Angband) Japanese.

          Comment

          Working...
          😀
          😂
          🥰
          😘
          🤢
          😎
          😞
          😡
          👍
          👎