From d6691cfdd356ba705969519779a0bc499187e49a Mon Sep 17 00:00:00 2001 From: dshaligram Date: Fri, 28 Dec 2007 14:50:20 +0000 Subject: [1857669] Fixed books using the wrong glyph when thrown, removed SYM_foo enum and replaced it with dchars. git-svn-id: https://crawl-ref.svn.sourceforge.net/svnroot/crawl-ref/trunk@3130 c06c8d41-db1a-0410-9941-cceddc491573 --- crawl-ref/source/abl-show.cc | 2 +- crawl-ref/source/beam.cc | 114 ++++++++++++++++++++----------------------- crawl-ref/source/beam.h | 23 +-------- crawl-ref/source/effects.cc | 2 +- crawl-ref/source/enum.h | 17 +++++++ crawl-ref/source/it_use3.cc | 2 +- crawl-ref/source/item_use.cc | 37 +++++++------- crawl-ref/source/items.cc | 2 +- crawl-ref/source/monstuff.cc | 8 +-- crawl-ref/source/mstuff2.cc | 70 +++++++++++++------------- crawl-ref/source/spells1.cc | 6 +-- crawl-ref/source/spells4.cc | 2 +- crawl-ref/source/spl-cast.cc | 14 +++--- crawl-ref/source/view.cc | 41 ++++++++++------ crawl-ref/source/view.h | 1 + crawl-ref/source/xom.cc | 2 +- 16 files changed, 174 insertions(+), 169 deletions(-) (limited to 'crawl-ref') diff --git a/crawl-ref/source/abl-show.cc b/crawl-ref/source/abl-show.cc index b153af37a2..3c46b78b07 100644 --- a/crawl-ref/source/abl-show.cc +++ b/crawl-ref/source/abl-show.cc @@ -1514,7 +1514,7 @@ static bool do_ability(const ability_def& abil) // make a divine lightning bolt... beam.beam_source = NON_MONSTER; - beam.type = SYM_BURST; + beam.type = DCHAR_FIRED_BURST; beam.damage = dice_def( 3, 30 ); beam.flavour = BEAM_ELECTRICITY; beam.target_x = you.x_pos; diff --git a/crawl-ref/source/beam.cc b/crawl-ref/source/beam.cc index 9ea7595ec6..251578e4e2 100644 --- a/crawl-ref/source/beam.cc +++ b/crawl-ref/source/beam.cc @@ -180,9 +180,8 @@ void zap_animation( int colour, const monsters *mon, bool force ) if (in_los_bounds(drawx, drawy)) { view_update(); - textcolor( colour ); gotoxy( drawx, drawy ); - putch( SYM_ZAP ); + put_colour_ch( colour, dchar_glyph( DCHAR_FIRED_ZAP ) ); update_screen(); delay(50); } @@ -535,7 +534,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = dice_def( 1, 5 ); // dam: 5 pbolt.hit = 8 + power / 10; // 25: 10 - pbolt.type = SYM_SPACE; + pbolt.type = dchar_glyph(DCHAR_SPACE); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; break; @@ -546,7 +545,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = random2(5) + 8; pbolt.damage = dice_def( 1, 3 + power / 5 ); // 25: 1d8 pbolt.hit = AUTOMATIC_HIT; // hits always - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; break; @@ -557,7 +556,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = dice_def( 1, 3 + power / 5 ); // 25: 1d8 pbolt.hit = 8 + power / 5; // 25: 13 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_POISON; // extra damage pbolt.obvious_effect = true; @@ -569,7 +568,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 6 + random2(8); // extended in beam pbolt.damage = dice_def( 1, 3 + random2(power) / 2 ); // 25: 1d11 pbolt.hit = 8 + power / 7; // 25: 11 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_ELECTRICITY; // beams & reflects pbolt.obvious_effect = true; @@ -603,7 +602,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 1, 8 + power / 4 ); // 25: 1d14 pbolt.hit = 7 + power / 6; // 25: 11 - pbolt.type = SYM_BOLT; + pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT); pbolt.flavour = BEAM_FIRE; pbolt.obvious_effect = true; @@ -622,7 +621,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = (random2(power) > random2(30)) ? 2 : 1; pbolt.damage = dice_def( 1, 8 + power / 4 ); // 25: 1d14 pbolt.hit = 8 + power / 5; // 25: 13 - pbolt.type = SYM_BOLT; + pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT); pbolt.flavour = BEAM_FRAG; // extra AC resist pbolt.obvious_effect = true; @@ -638,7 +637,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 2, 4 + power / 3 ); // 25: 2d12 pbolt.hit = 13 + power / 10; // 25: 15 - pbolt.type = SYM_BOLT; + pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT); pbolt.flavour = BEAM_FRAG; // extra AC resist pbolt.obvious_effect = true; @@ -655,7 +654,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) // level of 100 (for 3d20). pbolt.damage = dice_def( 3, 2 + (power / 250) ); pbolt.hit = 8 + (power / 100); // max hit: 53 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_MAGIC; // unresisted pbolt.obvious_effect = true; @@ -668,7 +667,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = dice_def( 2, 4 + power / 10 ); // 25: 2d6 50: 2d9 pbolt.hit = 8 + power / 10; // 25: 10 50: 13 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_FIRE; pbolt.obvious_effect = true; @@ -680,7 +679,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = dice_def( 2, 4 + power / 10 ); // 25: 2d6 50: 2d9 pbolt.hit = 8 + power / 10; // 50: 10 50: 13 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_COLD; pbolt.obvious_effect = true; @@ -692,7 +691,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = dice_def( 2, 5 + power / 7 ); // 25: 2d8 50: 2d12 pbolt.hit = 8 + power / 10; // 25: 10 50: 13 - pbolt.type = SYM_MISSILE; + pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE); pbolt.flavour = BEAM_MMISSILE; // irresistible pbolt.obvious_effect = true; @@ -704,7 +703,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = dice_def( 2, 3 + power / 12 ); // 50: 2d7 100: 2d11 pbolt.hit = 11 + power / 10; // 50: 16 100: 21 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_FIRE; pbolt.obvious_effect = true; @@ -716,7 +715,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = calc_dice( 2, 15 + (power * 2) / 5 ); pbolt.hit = 10 + power / 7; // 50: 17 100: 24 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; @@ -728,7 +727,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = calc_dice( 3, 10 + power / 2 ); pbolt.hit = 9 + power / 12; // 50: 13 100: 17 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_ICE; // half resistable break; @@ -747,7 +746,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 5 + random2(4); pbolt.damage = calc_dice( 4, 10 + (power * 3) / 5 ); pbolt.hit = 8 + power / 25; // 50: 10 100: 14 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_LAVA; pbolt.obvious_effect = true; @@ -760,7 +759,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7 + random2(10); pbolt.damage = calc_dice( 6, 18 + power * 2 / 3 ); pbolt.hit = 10 + power / 25; // 50: 12 100: 14 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_FIRE; pbolt.obvious_effect = true; @@ -773,7 +772,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7 + random2(10); pbolt.damage = calc_dice( 6, 18 + power * 2 / 3 ); pbolt.hit = 10 + power / 25; // 50: 12 100: 14 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_COLD; pbolt.obvious_effect = true; @@ -786,7 +785,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(10); pbolt.damage = calc_dice( 4, 15 + power / 2 ); pbolt.hit = 8 + power / 20; // 50: 10 100: 13 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_POISON; // extra damage pbolt.obvious_effect = true; @@ -799,7 +798,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7 + random2(10); pbolt.damage = calc_dice( 4, 15 + (power * 3) / 5 ); pbolt.hit = 8 + power / 20; // 50: 10 100: 13 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_NEG; // drains levels pbolt.is_beam = true; @@ -811,7 +810,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 5 + random2(5); pbolt.damage = calc_dice( 9, 15 + (power * 3) / 4 ); pbolt.hit = 7 + power / 15; // 50: 10 100: 13 - pbolt.type = SYM_MISSILE; + pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; break; @@ -822,7 +821,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = calc_dice( 4, 15 + power ); pbolt.hit = 5 + power / 10; // 50: 10 100: 15 - pbolt.type = SYM_MISSILE; + pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE); pbolt.flavour = BEAM_POISON_ARROW; // extra damage pbolt.obvious_effect = true; break; @@ -845,7 +844,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(10); // extended in beam pbolt.damage = calc_dice( 1, 10 + (power * 3) / 5 ); pbolt.hit = 7 + random2(power) / 20; // 50: 7-9 100: 7-12 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_ELECTRICITY; // beams & reflects pbolt.obvious_effect = true; @@ -858,7 +857,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 8 + random2(5); pbolt.damage = calc_dice( 3, 10 + power / 2 ); pbolt.hit = 40; // hit: 40 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_FIRE; // fire pbolt.is_explosion = true; break; @@ -870,7 +869,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = calc_dice( 1, 15 + (power * 4) / 5 ); pbolt.damage.num = 0; // only does explosion damage pbolt.hit = 40; // hit: 40 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_ELECTRICITY; pbolt.is_explosion = true; break; @@ -881,7 +880,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 9 + random2(7); pbolt.damage = calc_dice( 3, 30 + (power * 3) / 4 ); pbolt.hit = 20; // hit: 20 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_FRAG; // extra AC resist pbolt.is_explosion = true; break; @@ -892,7 +891,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7; pbolt.damage = calc_dice( 3, 20 + (power * 2) / 3 ); pbolt.hit = 150; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_HOLY; pbolt.obvious_effect = true; @@ -905,7 +904,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 6 + random2(4); pbolt.damage = calc_dice( 10, 23 + power ); pbolt.hit = 10 + power / 15; // 50: 13 100: 16 - pbolt.type = SYM_MISSILE; + pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; @@ -917,7 +916,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7 + random2(10); pbolt.damage = calc_dice( 3, 10 + (power * 3) / 4 ); pbolt.hit = 20 + power / 10; // 50: 25 100: 30 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_HELLFIRE; pbolt.obvious_effect = true; @@ -932,7 +931,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage.num = 0; // only does explosion damage pbolt.hit = 20 + power / 10; // 50: 25 100: 30 pbolt.ench_power = power; // used for radius - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_ICE; // half resisted pbolt.is_explosion = true; break; @@ -943,7 +942,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7 + random2(10); pbolt.damage = calc_dice( 12, 40 + (power * 3) / 2 ); pbolt.hit = 1; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_ENERGY; // unresisted pbolt.obvious_effect = true; @@ -961,7 +960,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 1, 4 + power / 2 ); // max dam: 25 pbolt.hit = 5 + random2( 1 + power / 3 ); // max hit: 19 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_POISON; pbolt.obvious_effect = true; break; @@ -977,7 +976,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 3, 4 + power / 3 ); // max dam: 60 pbolt.hit = 8 + random2( 1 + power / 3 ); // max hit: 25 - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_FIRE; pbolt.obvious_effect = true; @@ -995,7 +994,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 3, 4 + power / 3 ); // max dam: 39 pbolt.hit = 8 + random2( 1 + power / 3 ); - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_COLD; pbolt.obvious_effect = true; @@ -1013,7 +1012,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 3, 3 + power / 3 ); // max dam: 36 pbolt.hit = 5 + random2( 1 + power / 3 ); - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_ACID; pbolt.obvious_effect = true; @@ -1031,7 +1030,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 3, 2 + power / 6 ); // max dam: 18 pbolt.hit = 6 + random2( 1 + power / 3 ); - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_POISON; pbolt.obvious_effect = true; @@ -1056,7 +1055,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 3, 3 + power / 3 ); // max dam: 36 pbolt.hit = 5 + random2( 1 + power / 3 ); - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; @@ -1074,7 +1073,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.damage = dice_def( 3, 4 + power / 5 ); // max dam: 27 pbolt.hit = 10 + random2( 1 + power / 5 ); - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_STEAM; pbolt.obvious_effect = true; @@ -1206,7 +1205,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7 + random2(10); pbolt.damage = dice_def( 1500, 1 ); // dam: 1500 pbolt.hit = 1500; // hit: 1500 - pbolt.type = SYM_DEBUG; + pbolt.type = dchar_glyph(DCHAR_FIRED_DEBUG); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; @@ -1218,7 +1217,7 @@ static void zappy( zap_type z_type, int power, bolt &pbolt ) pbolt.range = 7 + random2(10); pbolt.damage = dice_def( 1, 0 ); pbolt.hit = 60; - pbolt.type = SYM_DEBUG; + pbolt.type = dchar_glyph(DCHAR_FIRED_DEBUG); pbolt.flavour = BEAM_MMISSILE; // unresistable pbolt.obvious_effect = true; @@ -1485,13 +1484,10 @@ void fire_beam( bolt &pbolt, item_def *item ) // bounds check if (in_los_bounds(drawx, drawy)) { - if (pbolt.colour == BLACK) - textcolor(random_colour()); - else - textcolor(pbolt.colour); - gotoxy(drawx, drawy); - putch(pbolt.type); + put_colour_ch( + pbolt.colour == BLACK? random_colour() : pbolt.colour, + pbolt.type ); // get curses to update the screen so we can see the beam update_screen(); @@ -4356,7 +4352,7 @@ static void explosion1(bolt &pbolt) seeMsg = "The hellfire explodes!"; hearMsg = "You hear a strangely unpleasant explosion."; - pbolt.type = SYM_BURST; + pbolt.type = dchar_glyph(DCHAR_FIRED_BURST); pbolt.flavour = BEAM_HELLFIRE; } @@ -4365,7 +4361,7 @@ static void explosion1(bolt &pbolt) seeMsg = "The flame explodes!"; hearMsg = "You feel a deep, resonant explosion."; - pbolt.type = SYM_BURST; + pbolt.type = dchar_glyph(DCHAR_FIRED_BURST); pbolt.flavour = BEAM_HOLY; ex_size = 2; } @@ -4375,7 +4371,7 @@ static void explosion1(bolt &pbolt) seeMsg = "The fireball explodes!"; hearMsg = "You hear an explosion."; - pbolt.type = SYM_BURST; + pbolt.type = dchar_glyph(DCHAR_FIRED_BURST); pbolt.flavour = BEAM_FIRE; ex_size = 1; } @@ -4385,7 +4381,7 @@ static void explosion1(bolt &pbolt) seeMsg = "The orb of electricity explodes!"; hearMsg = "You hear a clap of thunder!"; - pbolt.type = SYM_BURST; + pbolt.type = dchar_glyph(DCHAR_FIRED_BURST); pbolt.flavour = BEAM_ELECTRICITY; pbolt.colour = LIGHTCYAN; pbolt.damage.num = 1; @@ -4404,7 +4400,7 @@ static void explosion1(bolt &pbolt) hearMsg = "You hear an explosion!"; pbolt.name = "blast of shrapnel"; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.flavour = BEAM_FRAG; // sets it from pure damage to shrapnel (which is absorbed extra by armour) } @@ -4415,7 +4411,7 @@ static void explosion1(bolt &pbolt) pbolt.name = "ice storm"; pbolt.damage.num = 6; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.colour = WHITE; ex_size = 2 + (random2( pbolt.ench_power ) > 75); } @@ -4703,13 +4699,10 @@ static void explosion_cell(bolt &beam, int x, int y, bool drawOnly) // bounds check if (in_los_bounds(drawx, drawy)) { - if (beam.colour == BLACK) - textcolor(random_colour()); - else - textcolor(beam.colour); - gotoxy(drawx, drawy); - putch('#'); + put_colour_ch( + beam.colour == BLACK ? random_colour() : beam.colour, + dchar_glyph( DCHAR_EXPLOSION ) ); } } } @@ -4824,7 +4817,8 @@ bool nice_beam( monsters *mon, bolt &beam ) // // TODO: Eventually it'd be nice to have a proper factory for these things // (extended from setup_mons_cast() and zapping() which act as limited ones). -bolt::bolt() : range(0), rangeMax(0), type(SYM_ZAP), colour(BLACK), +bolt::bolt() : range(0), rangeMax(0), type('*'), + colour(BLACK), flavour(BEAM_MAGIC), source_x(0), source_y(0), damage(0,0), ench_power(0), hit(0), target_x(0), target_y(0), pos(), thrower(KILL_MISC), ex_size(0), beam_source(MHITNOT), name(), diff --git a/crawl-ref/source/beam.h b/crawl-ref/source/beam.h index 028018a47f..0978603454 100644 --- a/crawl-ref/source/beam.h +++ b/crawl-ref/source/beam.h @@ -26,27 +26,6 @@ enum demon_beam_type DMNBM_MUTATION }; -// beam[].type - note that this (and its variants) also accepts values -// from other enums - confusing {dlb} -enum zap_symbol_type -{ - SYM_SPACE = ' ', // 32 - SYM_FLASK = '!', // 33 - SYM_BOLT = '#', // 35 - SYM_CHUNK = '%', // 37 - SYM_OBJECT = '(', // 40 - actually used for books, but... {dlb} - SYM_WEAPON = ')', // 41 - SYM_ZAP = '*', // 42 - SYM_BURST = '+', // 43 - SYM_STICK = '/', // 47 - SYM_TRINKET = '=', // 61 - SYM_SCROLL = '?', // 63 - SYM_DEBUG = 'X', // 88 - SYM_ARMOUR = '[', // 91 - SYM_MISSILE = '`', // 96 - SYM_EXPLOSION = '#' -}; - // must match wand subtypes! (see item_def::zap()) enum zap_type { @@ -124,7 +103,7 @@ struct bolt // INPUT parameters set by caller int range; // minimum range int rangeMax; // maximum range - int type; // missile gfx + unsigned type; // missile gfx int colour; int flavour; int source_x, source_y; // beam origin diff --git a/crawl-ref/source/effects.cc b/crawl-ref/source/effects.cc index 93b9eceaee..4159e7e0ee 100644 --- a/crawl-ref/source/effects.cc +++ b/crawl-ref/source/effects.cc @@ -473,7 +473,7 @@ void direct_effect(struct bolt &pbolt) pbolt.ex_size = 1; pbolt.flavour = BEAM_HELLFIRE; pbolt.is_explosion = true; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.colour = RED; pbolt.thrower = KILL_MON_MISSILE; pbolt.aux_source.clear(); diff --git a/crawl-ref/source/enum.h b/crawl-ref/source/enum.h index 2ea4e787bb..f3a19160eb 100644 --- a/crawl-ref/source/enum.h +++ b/crawl-ref/source/enum.h @@ -770,6 +770,23 @@ enum dungeon_char_type DCHAR_ITEM_GOLD, DCHAR_ITEM_AMULET, // 30 DCHAR_CLOUD, // 31 + + DCHAR_SPACE, + DCHAR_FIRED_FLASK, + DCHAR_FIRED_BOLT, + DCHAR_FIRED_CHUNK, + DCHAR_FIRED_BOOK, + DCHAR_FIRED_WEAPON, + DCHAR_FIRED_ZAP, + DCHAR_FIRED_BURST, + DCHAR_FIRED_STICK, + DCHAR_FIRED_TRINKET, + DCHAR_FIRED_SCROLL, + DCHAR_FIRED_DEBUG, + DCHAR_FIRED_ARMOUR, + DCHAR_FIRED_MISSILE, + DCHAR_EXPLOSION, + NUM_DCHAR_TYPES }; diff --git a/crawl-ref/source/it_use3.cc b/crawl-ref/source/it_use3.cc index 5e4d1bf643..5d15554b41 100644 --- a/crawl-ref/source/it_use3.cc +++ b/crawl-ref/source/it_use3.cc @@ -852,7 +852,7 @@ void tome_of_power(int slot) } bolt beam; - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 15 ); // unsure about this // BEAM_EXPLOSION instead? [dlb] beam.flavour = BEAM_FIRE; diff --git a/crawl-ref/source/item_use.cc b/crawl-ref/source/item_use.cc index 7a89f1f20c..9e49ecfe58 100644 --- a/crawl-ref/source/item_use.cc +++ b/crawl-ref/source/item_use.cc @@ -1701,25 +1701,26 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, pbolt.flavour = BEAM_MISSILE; // pbolt.range is set below + dungeon_char_type zapsym = DCHAR_SPACE; switch (item.base_type) { - case OBJ_WEAPONS: pbolt.type = SYM_WEAPON; break; - case OBJ_MISSILES: pbolt.type = SYM_MISSILE; break; - case OBJ_ARMOUR: pbolt.type = SYM_ARMOUR; break; - case OBJ_WANDS: pbolt.type = SYM_STICK; break; - case OBJ_FOOD: pbolt.type = SYM_CHUNK; break; - case OBJ_UNKNOWN_I: pbolt.type = SYM_BURST; break; - case OBJ_SCROLLS: pbolt.type = SYM_SCROLL; break; - case OBJ_JEWELLERY: pbolt.type = SYM_TRINKET; break; - case OBJ_POTIONS: pbolt.type = SYM_FLASK; break; - case OBJ_UNKNOWN_II: pbolt.type = SYM_ZAP; break; - case OBJ_BOOKS: pbolt.type = SYM_OBJECT; break; - // this does not seem right, but value was 11 {dlb} - // notice how the .type does not match the class -- hmmm... {dlb} - case OBJ_STAVES: pbolt.type = SYM_STICK; break; + case OBJ_WEAPONS: zapsym = DCHAR_FIRED_WEAPON; break; + case OBJ_MISSILES: zapsym = DCHAR_FIRED_MISSILE; break; + case OBJ_ARMOUR: zapsym = DCHAR_FIRED_ARMOUR; break; + case OBJ_WANDS: zapsym = DCHAR_FIRED_STICK; break; + case OBJ_FOOD: zapsym = DCHAR_FIRED_CHUNK; break; + case OBJ_UNKNOWN_I: zapsym = DCHAR_FIRED_BURST; break; + case OBJ_SCROLLS: zapsym = DCHAR_FIRED_SCROLL; break; + case OBJ_JEWELLERY: zapsym = DCHAR_FIRED_TRINKET; break; + case OBJ_POTIONS: zapsym = DCHAR_FIRED_FLASK; break; + case OBJ_UNKNOWN_II: zapsym = DCHAR_FIRED_ZAP; break; + case OBJ_BOOKS: zapsym = DCHAR_FIRED_BOOK; break; + case OBJ_STAVES: zapsym = DCHAR_FIRED_STICK; break; default: break; } + pbolt.type = dchar_glyph(zapsym); + pbolt.source_x = you.x_pos; pbolt.source_y = you.y_pos; pbolt.colour = item.colour; @@ -2022,7 +2023,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, pbolt.name += "flame"; pbolt.colour = RED; - pbolt.type = SYM_BOLT; + pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT); pbolt.thrower = KILL_YOU_MISSILE; pbolt.aux_source.clear(); @@ -2042,7 +2043,7 @@ bool throw_it(bolt &pbolt, int throw_2, bool teleport, int acc_bonus, pbolt.name += "frost"; pbolt.colour = WHITE; - pbolt.type = SYM_BOLT; + pbolt.type = dchar_glyph(DCHAR_FIRED_BOLT); pbolt.thrower = KILL_YOU_MISSILE; pbolt.aux_source.clear(); } @@ -3515,7 +3516,7 @@ static bool affix_weapon_enchantment() case SPWPN_FLAMING: mprf("%s is engulfed in an explosion of flames!", itname.c_str()); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 10 ); beam.flavour = 2; beam.target_x = you.x_pos; @@ -4006,7 +4007,7 @@ void read_scroll(void) // we do this here to prevent it from blowing itself up dec_inv_item_quantity( item_slot, 1 ); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 10 ); // unsure about this // BEAM_EXPLOSION instead? {dlb} beam.flavour = BEAM_FIRE; diff --git a/crawl-ref/source/items.cc b/crawl-ref/source/items.cc index d4f5975cb0..4414fb2ccf 100644 --- a/crawl-ref/source/items.cc +++ b/crawl-ref/source/items.cc @@ -2554,7 +2554,7 @@ void handle_time( long time_delta ) if (you.magic_contamination >= 10 && coinflip()) { struct bolt boom; - boom.type = SYM_BURST; + boom.type = dchar_glyph(DCHAR_FIRED_BURST); boom.colour = BLACK; boom.flavour = BEAM_RANDOM; boom.target_x = you.x_pos; diff --git a/crawl-ref/source/monstuff.cc b/crawl-ref/source/monstuff.cc index fb6639cb70..fb8f25bd1c 100644 --- a/crawl-ref/source/monstuff.cc +++ b/crawl-ref/source/monstuff.cc @@ -2529,7 +2529,7 @@ static bool handle_special_ability(monsters *monster, bolt & beem) beem.rangeMax = 13; beem.damage = dice_def( 3, 10 ); beem.colour = RED; - beem.type = SYM_ZAP; + beem.type = dchar_glyph(DCHAR_FIRED_ZAP); beem.flavour = BEAM_LAVA; beem.hit = 20; beem.beam_source = monster_index(monster); @@ -2562,7 +2562,7 @@ static bool handle_special_ability(monsters *monster, bolt & beem) beem.name = "bolt of electricity"; beem.damage = dice_def( 3, 6 ); beem.colour = LIGHTCYAN; - beem.type = SYM_ZAP; + beem.type = dchar_glyph(DCHAR_FIRED_ZAP); beem.flavour = BEAM_ELECTRICITY; beem.hit = 50; beem.beam_source = monster_index(monster); @@ -2689,7 +2689,7 @@ static bool handle_special_ability(monsters *monster, bolt & beem) beem.hit = 14; beem.damage = dice_def( 2, 10 ); beem.beam_source = monster_index(monster); - beem.type = SYM_MISSILE; + beem.type = dchar_glyph(DCHAR_FIRED_MISSILE); beem.colour = LIGHTGREY; beem.flavour = BEAM_MISSILE; beem.thrower = KILL_MON; @@ -5673,7 +5673,7 @@ forget_it: static void setup_plant_spit(monsters *monster, bolt &pbolt) { pbolt.name = "acid"; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.range = 9; pbolt.rangeMax = 9; pbolt.colour = YELLOW; diff --git a/crawl-ref/source/mstuff2.cc b/crawl-ref/source/mstuff2.cc index 487db44742..5a5edaac3b 100644 --- a/crawl-ref/source/mstuff2.cc +++ b/crawl-ref/source/mstuff2.cc @@ -1060,7 +1060,7 @@ void setup_dragon(struct monsters *monster, struct bolt &pbolt) pbolt.rangeMax = 13; pbolt.damage = dice_def( 3, (monster->hit_dice * 2) ); pbolt.damage.size = scaling * pbolt.damage.size / 100; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); pbolt.hit = 30; pbolt.beam_source = monster_index(monster); pbolt.thrower = KILL_MON; @@ -1073,7 +1073,7 @@ void setup_generic_throw(struct monsters *monster, struct bolt &pbolt) pbolt.rangeMax = 9; pbolt.beam_source = monster_index(monster); - pbolt.type = SYM_MISSILE; + pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE); pbolt.flavour = BEAM_MISSILE; pbolt.thrower = KILL_MON_MISSILE; pbolt.aux_source.clear(); @@ -1118,7 +1118,7 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used) pbolt.range = 9; pbolt.beam_source = monster_index(monster); - pbolt.type = SYM_MISSILE; + pbolt.type = dchar_glyph(DCHAR_FIRED_MISSILE); pbolt.colour = item.colour; pbolt.flavour = BEAM_MISSILE; pbolt.thrower = KILL_MON_MISSILE; @@ -1287,7 +1287,7 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used) pbolt.name += "flame"; pbolt.colour = RED; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); } // WEAPON or AMMO of FROST @@ -1305,7 +1305,7 @@ bool mons_throw(struct monsters *monster, struct bolt &pbolt, int hand_used) pbolt.name += "frost"; pbolt.colour = WHITE; - pbolt.type = SYM_ZAP; + pbolt.type = dchar_glyph(DCHAR_FIRED_ZAP); } // Note: we already have throw_energy taken off. -- bwr @@ -1487,7 +1487,7 @@ void spore_goes_pop(struct monsters *monster) beam.is_tracer = false; beam.is_explosion = true; beam.beam_source = monster_index(monster); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.target_x = monster->x; beam.target_y = monster->y; beam.thrower = KILL_MON; // someone else's explosion @@ -1557,7 +1557,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 10; beam.damage = dice_def( 3, 4 + (power / 100) ); beam.hit = AUTOMATIC_HIT; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_MMISSILE; beam.is_beam = false; @@ -1575,7 +1575,7 @@ bolt mons_spells( int spell_cast, int power ) beam.damage = dice_def( 3, 5 + (power / 40) ); beam.hit = 25 + power / 40; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_FIRE; beam.is_beam = false; @@ -1592,7 +1592,7 @@ bolt mons_spells( int spell_cast, int power ) beam.damage = dice_def( 3, 5 + (power / 40) ); beam.hit = 25 + power / 40; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_COLD; beam.is_beam = false; @@ -1674,7 +1674,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 3, 6 + power / 13 ); beam.colour = LIGHTGREEN; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_POISON; beam.hit = 19 + power / 20; @@ -1685,7 +1685,7 @@ bolt mons_spells( int spell_cast, int power ) beam.name = "poison arrow"; beam.damage = dice_def( 3, 7 + power / 12 ); beam.colour = LIGHTGREEN; - beam.type = SYM_MISSILE; + beam.type = dchar_glyph(DCHAR_FIRED_MISSILE); beam.thrower = KILL_MON; beam.flavour = BEAM_POISON_ARROW; beam.hit = 20 + power / 25; @@ -1698,7 +1698,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 13; beam.damage = dice_def( 3, 8 + power / 11 ); beam.colour = RED; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_LAVA; beam.hit = 17 + power / 25; @@ -1711,7 +1711,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 13; beam.damage = dice_def( 3, 8 + power / 11 ); beam.colour = RED; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_FIRE; beam.hit = 17 + power / 25; @@ -1724,7 +1724,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 13; beam.damage = dice_def( 3, 8 + power / 11 ); beam.colour = WHITE; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_ICE; beam.hit = 17 + power / 25; @@ -1737,7 +1737,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 13; beam.damage = dice_def( 3, 8 + power / 11 ); beam.colour = WHITE; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_COLD; beam.hit = 17 + power / 25; @@ -1750,7 +1750,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 12; beam.damage = dice_def( 2, 9 + power / 11 ); beam.colour = WHITE; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_COLD; beam.hit = 17 + power / 25; @@ -1764,7 +1764,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 1, 8 + (power / 20) ); beam.colour = LIGHTCYAN; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_ELECTRICITY; beam.hit = 17 + power / 20; @@ -1777,7 +1777,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 3, 10 + power / 17 ); beam.colour = LIGHTCYAN; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_ELECTRICITY; beam.hit = 16 + power / 40; @@ -1801,7 +1801,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 10; beam.damage = dice_def( 3, 7 + power / 10 ); beam.hit = 40; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_FIRE; // why not BEAM_FIRE? {dlb} beam.is_beam = false; @@ -1849,7 +1849,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 3, 16 + power / 10 ); beam.colour = WHITE; - beam.type = SYM_MISSILE; + beam.type = dchar_glyph(DCHAR_FIRED_MISSILE); beam.thrower = KILL_MON; beam.flavour = BEAM_MMISSILE; beam.hit = 22 + power / 20; @@ -1872,7 +1872,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 3, 6 + power / 13 ); beam.colour = DARKGREY; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_NEG; beam.hit = 16 + power / 35; @@ -1888,7 +1888,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 10; beam.damage = dice_def( 3, 7 + (power / 14) ); beam.hit = 20 + (power / 20); - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_MMISSILE; beam.is_beam = false; @@ -1903,7 +1903,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 10; beam.damage = dice_def( 3, 7 + (power / 15) ); beam.hit = 20 + power / 20; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_STEAM; beam.is_beam = false; @@ -1934,7 +1934,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 10; beam.damage = dice_def( 3, 3 + power / 50 ); beam.hit = 18 + power / 15; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_FIRE; beam.is_beam = false; @@ -1946,7 +1946,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 3, 3 + power / 25 ); beam.colour = LIGHTGREEN; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_POISON; beam.hit = 18 + power / 25; @@ -1961,7 +1961,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 23; beam.damage = dice_def( 3, 20 ); beam.hit = 15 + power / 30; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_NUKE; // a magical missile which destroys walls beam.is_beam = true; @@ -1974,7 +1974,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 12; beam.damage = dice_def( 1, 6 + power / 25 ); beam.hit = 60; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_POISON; beam.is_beam = false; @@ -1987,7 +1987,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 8; beam.damage = dice_def( 3, 8 + (power / 9) ); beam.hit = 20 + (power / 25); - beam.type = SYM_MISSILE; + beam.type = dchar_glyph(DCHAR_FIRED_MISSILE); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_MMISSILE; // similarly unresisted thing beam.is_beam = false; @@ -2000,7 +2000,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 12; beam.damage = dice_def( 3, 5 + (power / 10) ); beam.hit = 14 + power / 35; - beam.type = SYM_MISSILE; + beam.type = dchar_glyph(DCHAR_FIRED_MISSILE); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_MMISSILE; // similarly unresisted thing beam.is_beam = false; @@ -2013,7 +2013,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 10; beam.damage = dice_def( 1, 4 + power / 10 ); beam.hit = 16 + power / 20; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_POISON; beam.is_beam = false; @@ -2038,7 +2038,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 3, 2 + power / 25 ); beam.colour = GREEN; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_POISON; beam.hit = 14 + power / 30; @@ -2050,7 +2050,7 @@ bolt mons_spells( int spell_cast, int power ) beam.name = "foul vapour"; beam.damage = dice_def( 3, 5 + power / 24 ); beam.colour = DARKGREY; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_MIASMA; beam.hit = 17 + power / 20; @@ -2066,7 +2066,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 23; beam.damage = dice_def( 3, 25 ); beam.hit = 16 + power / 25; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON_MISSILE; beam.flavour = BEAM_MMISSILE; beam.is_beam = false; @@ -2080,7 +2080,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 13; beam.damage = dice_def( 3, 25 ); beam.hit = 24; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_HELLFIRE; beam.is_beam = true; @@ -2093,7 +2093,7 @@ bolt mons_spells( int spell_cast, int power ) beam.rangeMax = 16; beam.damage = dice_def( 3, 20 + power / 20 ); beam.colour = CYAN; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.thrower = KILL_MON; beam.flavour = BEAM_FRAG; beam.hit = 19 + power / 30; diff --git a/crawl-ref/source/spells1.cc b/crawl-ref/source/spells1.cc index c9bae358a2..900514d471 100644 --- a/crawl-ref/source/spells1.cc +++ b/crawl-ref/source/spells1.cc @@ -244,7 +244,7 @@ int cast_fire_storm(int powc, bolt &beam) { beam.ex_size = 2 + (random2(powc) > 75); beam.flavour = BEAM_LAVA; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.colour = RED; beam.beam_source = MHITYOU; beam.thrower = KILL_YOU_MISSILE; @@ -279,7 +279,7 @@ void cast_chain_lightning( int powc ) beam.range = 8; beam.rangeMax = 8; beam.hit = AUTOMATIC_HIT; - beam.type = SYM_ZAP; + beam.type = dchar_glyph(DCHAR_FIRED_ZAP); beam.flavour = BEAM_ELECTRICITY; beam.obvious_effect = true; beam.is_beam = false; // since we want to stop at our target @@ -548,7 +548,7 @@ int stinking_cloud( int pow, bolt &beem ) beem.rangeMax = 6; beem.damage = dice_def( 1, 0 ); beem.hit = 20; - beem.type = SYM_ZAP; + beem.type = dchar_glyph(DCHAR_FIRED_ZAP); beem.flavour = BEAM_MMISSILE; beem.ench_power = pow; beem.beam_source = MHITYOU; diff --git a/crawl-ref/source/spells4.cc b/crawl-ref/source/spells4.cc index 2d12fbe7be..173f4ea7fd 100644 --- a/crawl-ref/source/spells4.cc +++ b/crawl-ref/source/spells4.cc @@ -1721,7 +1721,7 @@ void cast_evaporate(int pow) beem.colour = you.inv[potion].colour; beem.range = 9; beem.rangeMax = 9; - beem.type = SYM_FLASK; + beem.type = dchar_glyph(DCHAR_FIRED_FLASK); beem.beam_source = MHITYOU; beem.thrower = KILL_YOU_MISSILE; beem.aux_source.clear(); diff --git a/crawl-ref/source/spl-cast.cc b/crawl-ref/source/spl-cast.cc index 79d792e072..39b887ce6f 100644 --- a/crawl-ref/source/spl-cast.cc +++ b/crawl-ref/source/spl-cast.cc @@ -2049,7 +2049,7 @@ static void miscast_conjuration(int severity, const char* cause) break; case 1: mpr("You are caught in a violent explosion!"); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 12 ); beam.flavour = BEAM_MISSILE; // unsure about this // BEAM_EXPLOSION instead? {dlb} @@ -2080,7 +2080,7 @@ static void miscast_conjuration(int severity, const char* cause) break; case 1: mpr("There is a sudden explosion of magical energy!"); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 20 ); beam.flavour = BEAM_MISSILE; // unsure about this // BEAM_EXPLOSION instead? {dlb} @@ -2968,7 +2968,7 @@ static void miscast_fire(int severity, const char* cause) case 1: mpr("You are caught in a fiery explosion!"); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 14 ); beam.flavour = BEAM_FIRE; beam.target_x = you.x_pos; @@ -3000,7 +3000,7 @@ static void miscast_fire(int severity, const char* cause) break; case 1: mpr("There is a sudden and violent explosion of flames!"); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 20 ); beam.flavour = BEAM_FIRE; beam.target_x = you.x_pos; @@ -3102,7 +3102,7 @@ static void miscast_ice(int severity, const char* cause) case 1: mpr("You are caught in an explosion of ice and frost!"); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 11 ); beam.flavour = BEAM_COLD; beam.target_x = you.x_pos; @@ -3220,7 +3220,7 @@ static void miscast_earth(int severity, const char* cause) { case 0: mpr("You are caught in an explosion of flying shrapnel!"); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 15 ); beam.flavour = BEAM_FRAG; beam.target_x = you.x_pos; @@ -3332,7 +3332,7 @@ static void miscast_air(int severity, const char* cause) { case 0: mpr("You are caught in an explosion of electrical discharges!"); - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 8 ); beam.flavour = BEAM_ELECTRICITY; beam.target_x = you.x_pos; diff --git a/crawl-ref/source/view.cc b/crawl-ref/source/view.cc index e3e50a2bb1..1912e398fa 100644 --- a/crawl-ref/source/view.cc +++ b/crawl-ref/source/view.cc @@ -3338,30 +3338,36 @@ bool trans_wall_blocking( const coord_def &p ) return see_grid(p) && !see_grid_no_trans(p); } -static const unsigned table[ NUM_CSET ][ NUM_DCHAR_TYPES ] = +static const unsigned dchar_table[ NUM_CSET ][ NUM_DCHAR_TYPES ] = { // CSET_ASCII { - '#', '*', '.', ',', '\'', '+', '^', '>', '<', // wall, stairs up - '_', '\\', '}', '{', '8', '~', '~', // altar, item detect - '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb, missile - ':', '|', '}', '%', '$', '"', '#', // book, cloud + '#', '*', '.', ',', '\'', '+', '^', '>', '<', // wall .. stairs up + '_', '\\', '}', '{', '8', '~', '~', // altar .. item detect + '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb .. missile + ':', '|', '}', '%', '$', '"', '#', // book .. cloud + ' ', '!', '#', '%', ':', ')', '*', '+', // space .. fired_burst + '/', '=', '?', 'X', '[', '`', '#' // fi_stick .. explosion }, // CSET_IBM - this is ANSI 437 { - 177, 176, 249, 250, '\'', 254, '^', '>', '<', // wall, stairs up - 220, 239, 244, 247, '8', '~', '~', // altar, item detect - '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb, missile - '+', '\\', '}', '%', '$', '"', '#', // book, cloud + 177, 176, 249, 250, '\'', 254, '^', '>', '<', // wall .. stairs up + 220, 239, 244, 247, '8', '~', '~', // altar .. item detect + '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb .. missile + '+', '\\', '}', '%', '$', '"', '#', // book .. cloud + ' ', '!', '#', '%', '+', ')', '*', '+', // space .. fired_burst + '/', '=', '?', 'X', '[', '`', '#' // fi_stick .. explosion }, // CSET_DEC - remember: 224-255 are mapped to shifted 96-127 { - 225, 224, 254, ':', '\'', 238, '^', '>', '<', // wall, stairs up - 251, 182, 167, 187, '8', 171, 168, // altar, item detect - '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb, missile - '+', '\\', '}', '%', '$', '"', '#', // book, cloud + 225, 224, 254, ':', '\'', 238, '^', '>', '<', // wall .. stairs up + 251, 182, 167, 187, '8', 171, 168, // altar .. item detect + '0', ')', '[', '/', '%', '?', '=', '!', '(', // orb .. missile + '+', '\\', '}', '%', '$', '"', '#', // book .. cloud + ' ', '!', '#', '%', '+', ')', '*', '+', // space .. fired_burst + '/', '=', '?', 'X', '[', '`', '#' // fi_stick .. explosion }, // CSET_UNICODE @@ -3370,6 +3376,8 @@ static const unsigned table[ NUM_CSET ][ NUM_DCHAR_TYPES ] = '_', 0x2229, 0x2320, 0x2248, '8', '~', '~', '0', ')', '[', '/', '%', '?', '=', '!', '(', '+', '|', '}', '%', '$', '"', '#', + ' ', '!', '#', '%', '+', ')', '*', '+', // space .. fired_burst + '/', '=', '?', 'X', '[', '`', '#' // fi_stick .. explosion }, }; @@ -3400,10 +3408,15 @@ void init_char_table( char_set_type set ) if (Options.cset_override[set][i]) Options.char_table[i] = Options.cset_override[set][i]; else - Options.char_table[i] = table[set][i]; + Options.char_table[i] = dchar_table[set][i]; } } +unsigned dchar_glyph(dungeon_char_type dchar) +{ + return (Options.char_table[dchar]); +} + void apply_feature_overrides() { for (int i = 0, size = Options.feature_overrides.size(); i < size; ++i) diff --git a/crawl-ref/source/view.h b/crawl-ref/source/view.h index 09d42738e7..5eae770a41 100644 --- a/crawl-ref/source/view.h +++ b/crawl-ref/source/view.h @@ -215,6 +215,7 @@ inline bool trans_wall_blocking(int x, int y) std::string screenshot(bool fullscreen = false); dungeon_char_type get_feature_dchar( dungeon_feature_type feat ); +unsigned dchar_glyph(dungeon_char_type dchar); unsigned get_sightmap_char(int feature); unsigned get_magicmap_char(int feature); diff --git a/crawl-ref/source/xom.cc b/crawl-ref/source/xom.cc index d48bd21e49..c6ec9d920b 100644 --- a/crawl-ref/source/xom.cc +++ b/crawl-ref/source/xom.cc @@ -652,7 +652,7 @@ static bool xom_is_good(int sever) mpr("The area is suffused with divine lightning!"); beam.beam_source = NON_MONSTER; - beam.type = SYM_BURST; + beam.type = dchar_glyph(DCHAR_FIRED_BURST); beam.damage = dice_def( 3, 30 ); beam.flavour = BEAM_ELECTRICITY; beam.target_x = you.x_pos; -- cgit v1.2.3-54-g00ecf